快速编辑直接覆盖原图

将图片快速编辑提交切到 /api/editor/images/edits,并用结果回写源图层

保留重绘作为右侧新结果图层,角色重绘继续走 character 生成契约

更新快速编辑文档和定向回归测试
This commit is contained in:
2026-06-27 19:47:53 +08:00
parent a6671e7da7
commit bb51c7e0d2
18 changed files with 336 additions and 298 deletions
@@ -238,6 +238,43 @@ export function createQuickEditResultLayer({
);
}
export function applyImageEditResultToSourceLayer({
generated,
sourceLayer,
generationInputs,
}: {
generated: EditorImageGenerationResult;
sourceLayer: CanvasLayer;
generationInputs: CanvasGenerationInputs;
}): CanvasLayer {
const originalWidth =
generated.width || sourceLayer.originalWidth || sourceLayer.width;
const originalHeight =
generated.height || sourceLayer.originalHeight || sourceLayer.height;
const { width, height } = resolveLayerResolutionSize(
originalWidth,
originalHeight,
{
width: sourceLayer.width,
height: sourceLayer.height,
},
);
return applyGeneratedMetadata(
{
...sourceLayer,
src: generated.imageSrc,
width,
height,
originalWidth,
originalHeight,
sourceType: generated.sourceType,
sourceResourceId: sourceLayer.resourceId,
},
generated,
generationInputs,
);
}
export function createIconSpritesheetResultLayers({
generated,
iconResults,