修复图片修改参数恢复与提交一致性
- 图片修改面板优先恢复历史模型、比例和尺寸,并保留显式设置优先级 - 图片修改提交计划统一归一化参数并下发 model、aspectRatio、imageSize 和 size - 画布完成占位使用实际目标输出尺寸 - 补充参数恢复回归测试与编辑器方案说明
This commit is contained in:
@@ -1682,21 +1682,30 @@ export function createEditDialogDraft(
|
||||
imageSize?: string;
|
||||
} = {},
|
||||
): GenerateDialogState {
|
||||
const imageModel = normalizeEditorImageModel(
|
||||
options.imageModel ?? sourceLayer.model,
|
||||
const decodedInputs = decodeCanvasGenerationInputs(
|
||||
sourceLayer.generationInputs,
|
||||
);
|
||||
const aspectRatio =
|
||||
options.aspectRatio ??
|
||||
inferEditorImageAspectRatio(
|
||||
sourceLayer.originalWidth,
|
||||
sourceLayer.originalHeight,
|
||||
);
|
||||
const imageSize =
|
||||
options.imageSize ??
|
||||
inferEditorImageSizeLabel(
|
||||
sourceLayer.originalWidth,
|
||||
sourceLayer.originalHeight,
|
||||
);
|
||||
const normalizedSourceLayer = decodedInputs.ok
|
||||
? { ...sourceLayer, generationInputs: decodedInputs.inputs }
|
||||
: sourceLayer;
|
||||
const persistedImageModel = decodedInputs.ok
|
||||
? getNormalizedString(normalizedSourceLayer, 'model') || undefined
|
||||
: undefined;
|
||||
const persistedAspectRatio = decodedInputs.ok
|
||||
? getNormalizedString(normalizedSourceLayer, 'aspectRatio') || undefined
|
||||
: undefined;
|
||||
const persistedImageSize = decodedInputs.ok
|
||||
? getNormalizedString(normalizedSourceLayer, 'imageSize') || undefined
|
||||
: undefined;
|
||||
const resolvedOptions = createQuickEditPanelDraft(sourceLayer, {
|
||||
imageModel:
|
||||
options.imageModel ??
|
||||
persistedImageModel ??
|
||||
sourceLayer.model ??
|
||||
undefined,
|
||||
aspectRatio: options.aspectRatio ?? persistedAspectRatio,
|
||||
imageSize: options.imageSize ?? persistedImageSize,
|
||||
});
|
||||
return {
|
||||
id: `edit-dialog:${sourceLayer.id}`,
|
||||
mode: 'edit',
|
||||
@@ -1704,9 +1713,9 @@ export function createEditDialogDraft(
|
||||
status: 'idle',
|
||||
composerOpen: true,
|
||||
sourceLayerId: sourceLayer.id,
|
||||
imageModel,
|
||||
aspectRatio,
|
||||
imageSize,
|
||||
imageModel: resolvedOptions.model,
|
||||
aspectRatio: resolvedOptions.aspectRatio,
|
||||
imageSize: resolvedOptions.imageSize,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user