fix: send only target draft for scale patch

This commit is contained in:
134 2026-07-02 22:12:18 +08:00
parent 0904fdf98a
commit da7fbb1284

View File

@ -997,7 +997,7 @@ function buildScaleAdjustSourceFootprintWashSvg(params: {
const top = Math.max(0, box.top - blur); const top = Math.max(0, box.top - blur);
const right = Math.min(width, box.left + box.width + blur); const right = Math.min(width, box.left + box.width + blur);
const bottom = Math.min(height, box.top + box.height + blur); const bottom = Math.min(height, box.top + box.height + blur);
return `<rect x="${left}" y="${top}" width="${Math.max(1, right - left)}" height="${Math.max(1, bottom - top)}" fill="${SCALE_ADJUST_LAYOUT_GUIDE_WASH_COLOR}" fill-opacity="0.96" filter="url(#soft-wash)" />`; return `<rect x="${left}" y="${top}" width="${Math.max(1, right - left)}" height="${Math.max(1, bottom - top)}" fill="${SCALE_ADJUST_LAYOUT_GUIDE_WASH_COLOR}" fill-opacity="0.985" filter="url(#soft-wash)" />`;
}) })
.join(""); .join("");
@ -2058,7 +2058,7 @@ function buildScaleAdjustPatchPrompt(
const firstInputRole = targetDraftPrimary const firstInputRole = targetDraftPrimary
? includeSourceReference ? includeSourceReference
? "Input image 1 is the rough edited target-layout crop. It is the hard layout target: the selected furniture size and center in the final output must match this draft, but the rough wash, ghosted old footprint, placeholder shadow, blur, and patch artifacts must be cleaned." ? "Input image 1 is the rough edited target-layout crop. It is the hard layout target: the selected furniture size and center in the final output must match this draft, but the rough wash, ghosted old footprint, placeholder shadow, blur, and patch artifacts must be cleaned."
: "Input image 1 is the rough edited target-layout crop and the only crop base. It is the hard layout target: the selected furniture size and center in the final output must match this draft. Clean away the rough wash, ghosted old footprint, placeholder shadow, blur, and patch artifacts." : "Input image 1 is the rough edited target-layout crop and the only visual reference. It is the hard layout target: the selected furniture size and center in the final output must match this draft. Clean away the rough wash, ghosted old footprint, placeholder shadow, blur, and patch artifacts."
: "Input image 1 is the exact crop from the original photo and is the locked crop base."; : "Input image 1 is the exact crop from the original photo and is the locked crop base.";
const secondInputRole = targetDraftPrimary const secondInputRole = targetDraftPrimary
? includeSourceReference ? includeSourceReference
@ -2120,7 +2120,7 @@ function buildScaleAdjustPatchPrompt(
targetDraftPrimary targetDraftPrimary
? includeSourceReference ? includeSourceReference
? "中文硬约束:输入图1是目标大小/位置草稿,必须按它的小尺寸家具布局输出;输入图2只是原始质感和背景参考,绝对不要把家具恢复成输入图2里的旧大尺寸。只输出同一裁切范围的干净局部照片,去掉草稿中的泛白、残影和拼接感。" ? "中文硬约束:输入图1是目标大小/位置草稿,必须按它的小尺寸家具布局输出;输入图2只是原始质感和背景参考,绝对不要把家具恢复成输入图2里的旧大尺寸。只输出同一裁切范围的干净局部照片,去掉草稿中的泛白、残影和拼接感。"
: "中文硬约束:输入图1是唯一的裁切底图和目标大小/位置草稿,必须按它的小尺寸家具布局输出;后续家具识别图只看材质形状,不看旧尺寸。只输出同一裁切范围的干净局部照片,去掉草稿中的泛白、残影和拼接感。" : "中文硬约束:输入图1是唯一视觉参考和目标大小/位置草稿,必须按它的小尺寸家具布局输出。不要找回旧尺寸家具。只输出同一裁切范围的干净局部照片,去掉草稿中的泛白、残影和拼接感。"
: "中文硬约束:只输出输入图1同一裁切范围的干净局部照片;输入图2是目标大小/位置草稿,必须按它的小尺寸家具布局输出,不是要保留旧尺寸。目标家具必须相对原图产生明显比例变化,非目标背景和裁切边缘要稳定自然。", : "中文硬约束:只输出输入图1同一裁切范围的干净局部照片;输入图2是目标大小/位置草稿,必须按它的小尺寸家具布局输出,不是要保留旧尺寸。目标家具必须相对原图产生明显比例变化,非目标背景和裁切边缘要稳定自然。",
"", "",
"Region instructions:", "Region instructions:",
@ -2397,11 +2397,11 @@ export async function POST(request: NextRequest) {
: null; : null;
const shouldCreateScaleAdjustCropReferences = const shouldCreateScaleAdjustCropReferences =
isScaleAdjustOperation && isScaleAdjustOperation &&
(useScaleAdjustPatchWorkflow || (!scaleAdjustPatchReference &&
useScaleAdjustVisualLayoutGuide || (useScaleAdjustVisualLayoutGuide ||
!useScaleAdjustCoordinatePrompt || !useScaleAdjustCoordinatePrompt ||
useProviderTextOnlyCoordinatePrompt || useProviderTextOnlyCoordinatePrompt ||
(useScaleAdjustMarkedPhotoGuide && !useFalScaleAdjustCoordinatePrompt)); (useScaleAdjustMarkedPhotoGuide && !useFalScaleAdjustCoordinatePrompt)));
const scaleAdjustCropReferences: ScaleAdjustCropReference[] = const scaleAdjustCropReferences: ScaleAdjustCropReference[] =
shouldCreateScaleAdjustCropReferences shouldCreateScaleAdjustCropReferences
? await createScaleAdjustCropReferences({ ? await createScaleAdjustCropReferences({