fix(canvas): 图生图节点 - 自动结果继承来源图片尺寸

This commit is contained in:
ddCat
2026-07-31 17:17:30 +08:00
parent 1c48f8cc4a
commit 8617e2241f
3 changed files with 21 additions and 11 deletions

View File

@@ -84,7 +84,9 @@ export async function buildGenerationTaskNodeResult(node: CanvasNodeData, task:
? { url: await resolveImageUrl(image.storageKey, image.dataUrl), storageKey: image.storageKey, width: image.width || 1024, height: image.height || 1024, bytes: image.bytes || 0, mimeType: image.mimeType || "image/png" }
: await uploadImage(resultDataUrl);
const imageConfig = NODE_DEFAULT_SIZE[CanvasNodeType.Image];
const imageSize = fitNodeSize(uploaded.width, uploaded.height, node.width || imageConfig.width, node.height || imageConfig.height);
const imageSize = node.metadata?.generationType === "edit"
? { width: node.width || imageConfig.width, height: node.height || imageConfig.height }
: fitNodeSize(uploaded.width, uploaded.height, node.width || imageConfig.width, node.height || imageConfig.height);
return {
...node,
type: CanvasNodeType.Image,