fix: avoid visual terms in alibaba scale prompt
This commit is contained in:
parent
11e6aca724
commit
89fca5d654
@ -1900,7 +1900,7 @@ function buildScaleAdjustTextOnlyPrompt(
|
||||
cropIndex >= 0
|
||||
? ` Input image ${cropIndex + 2} is the clean crop reference for this furniture identity and silhouette.`
|
||||
: "";
|
||||
return `Region ${region.index}: source search box left=${region.pixelRect.left}, top=${region.pixelRect.top}, right=${sourceRight}, bottom=${sourceBottom}, width=${region.pixelRect.width}, height=${region.pixelRect.height}; target final footprint left=${targetPixelRect.left}, top=${targetPixelRect.top}, right=${targetRight}, bottom=${targetBottom}, width=${targetPixelRect.width}, height=${targetPixelRect.height}; target scale width=${widthFactor.toFixed(2)}, height=${heightFactor.toFixed(2)}. User request: ${region.prompt || "scale the furniture to the target footprint"}.${cropNote}`;
|
||||
return `Region ${region.index}: hidden coordinate set A current area x0=${region.pixelRect.left}, y0=${region.pixelRect.top}, x1=${sourceRight}, y1=${sourceBottom}, width=${region.pixelRect.width}, height=${region.pixelRect.height}; hidden coordinate set B final size/location x0=${targetPixelRect.left}, y0=${targetPixelRect.top}, x1=${targetRight}, y1=${targetBottom}, width=${targetPixelRect.width}, height=${targetPixelRect.height}; final visual scale width=${widthFactor.toFixed(2)}, height=${heightFactor.toFixed(2)}. User request: ${region.prompt || "make the same furniture match set B"}.${cropNote}`;
|
||||
})
|
||||
.join("\n");
|
||||
|
||||
@ -1908,17 +1908,17 @@ function buildScaleAdjustTextOnlyPrompt(
|
||||
"Local furniture scale edit. Input image 1 is the locked source photo and the only final canvas base.",
|
||||
`Return one clean realistic photo with exactly the same camera frame and pixel size as input image 1: ${sourceSize.width} x ${sourceSize.height} px.`,
|
||||
cropLines ? cropLines : "",
|
||||
"Do not output any guide marks, boxes, labels, arrows, blue lines, cyan lines, overlays, UI marks, text annotations, patch edges, full-frame zoom, crop, pan, or redesigned room.",
|
||||
"Only edit the main movable furniture subject inside each source search box. Keep all other furniture, sofa, lamps, wall, windows, rug, floor, decor, text, lighting, and camera frame stable.",
|
||||
"Use the numeric pixel coordinates below as the only geometry guide. Do not need a visible guide image.",
|
||||
"When target footprint is smaller than source, make the same furniture visibly smaller and naturally rebuild the newly visible floor, rug, wall, shadow, or background around it. Do not leave the old full-size footprint.",
|
||||
"The final photo must contain only natural scene content. Never add artificial graphic overlays, visible coordinate aids, labels, lines, UI elements, or text.",
|
||||
"Only edit the main movable furniture subject inside each current pixel area. Keep all other furniture, sofa, lamps, wall, windows, rug, floor, decor, lighting, and camera frame stable.",
|
||||
"Use the numeric pixel sets below as hidden instructions only; they are not visual content and must not be drawn.",
|
||||
"When set B is smaller than set A, make the same furniture visibly smaller and naturally rebuild the newly visible floor, rug, wall, shadow, or background around it. Do not leave the old full-size furniture silhouette.",
|
||||
"Keep the furniture identity, materials, perspective, objects on top, contact shadows, and natural aspect ratio. Do not stretch, squash, duplicate, or paste a rectangular crop.",
|
||||
"中文硬约束:输入图1是锁定底图,只能调整源框里的主要家具主体;目标框是最终家具可见占位。禁止整图重绘、整图缩放、输出标注框、输出蓝线或把裁切图贴回。",
|
||||
"中文硬约束:输入图1是锁定底图,只能调整 A 像素范围里的主要家具主体,让它变成 B 像素范围对应的大小和位置。A/B 坐标只是隐藏指令,最终照片里绝对不能画出任何线条、框、文字、标注或 UI 元素。",
|
||||
"",
|
||||
"Region instructions:",
|
||||
regionLines,
|
||||
"",
|
||||
"Success check before returning: the selected furniture must be clearly closer to the target footprint than to the original source footprint, while the rest of the photo remains visually unchanged and clean.",
|
||||
"Success check before returning: the selected furniture must be clearly closer to set B than to set A, while the rest of the photo remains visually unchanged and clean.",
|
||||
].filter(Boolean).join("\n");
|
||||
}
|
||||
|
||||
@ -2222,6 +2222,8 @@ export async function POST(request: NextRequest) {
|
||||
const scaleAdjustCoordinateNegativePrompt = useFalScaleAdjustCoordinatePrompt
|
||||
? "guide marks, labels, boxes, arrows, overlays, patch edges, color mismatch, full-frame zoom, duplicate furniture, stretched furniture, distorted furniture"
|
||||
: "visible annotation, guide overlay, translucent overlay, target placement overlay, faded wash, placeholder shadow, text label, arrows, boxes, rectangle border, UI marks, pasted patch, rough layout patch, hard crop edge, seam, hard rectangular edge, color mismatch, different-resolution area, whole image zoom, whole image crop, whole image pan, whole image redesign, unchanged target furniture, old-size target furniture, stretched furniture, squashed furniture, duplicate furniture, second copy, extra legs, extra rails, side panels, shelves, cabinets, lattice panels";
|
||||
const scaleAdjustTextOnlyNegativePrompt =
|
||||
"artificial graphic overlay, visible coordinate aid, visible line, visible label, UI element, annotation text, full image redesign, full-frame zoom, crop, pan, pasted crop, hard patch edge, color mismatch, changed sofa, changed lamp, changed wall, changed rug, duplicate furniture, stretched furniture, distorted furniture";
|
||||
const manualRegionReferenceImageUrls = regions.flatMap((region) =>
|
||||
region.referenceImages.map((reference) => reference.url)
|
||||
);
|
||||
@ -2378,7 +2380,9 @@ export async function POST(request: NextRequest) {
|
||||
model: resolvedModel || undefined,
|
||||
negativePrompt:
|
||||
isScaleAdjustOperation
|
||||
? useScaleAdjustCoordinatePrompt || useProviderTextOnlyCoordinatePrompt
|
||||
? useProviderTextOnlyCoordinatePrompt
|
||||
? scaleAdjustTextOnlyNegativePrompt
|
||||
: useScaleAdjustCoordinatePrompt
|
||||
? scaleAdjustCoordinateNegativePrompt
|
||||
: "彩色框、蓝色边框、绿色边框、红色边框、橙色边框、矩形框、箭头、连线、角点、编号圆点、提示词气泡、标注文字、UI 控件、半透明色块、蓝色色块、色条、灰底坐标图、目标占位叠图、淡化痕迹、选区边框、白边、画幅压扁、画面拉伸、整张图缩放、全图放大、全图裁切、全图平移、文字位置变化、文字内容变化、文字模糊、Logo位置变化、主体拉伸、主体压扁、主体变窄、主体变高但变窄、横向挤压、纵向拉伸、透视变形、矩形贴片、硬边、拼接线、补丁感、局部裁切、色差边缘、背景断裂、背景错位、窗框错位、文字错位、地毯纹理错位、非主体背景重绘、主体未缩放、整块框选区域缩放"
|
||||
: "彩色框、蓝色边框、绿色边框、红色边框、橙色边框、矩形框、编号圆点、提示词气泡、标注文字、UI 控件、半透明色块、选区边框、白边、画幅压扁、画面拉伸、主体截断、动物截断、缺头、缺尾巴、缺四肢、贴边裁切、矩形贴片、硬边、拼接线、补丁感、色差边缘、背景错位、地面纹理断裂、椅脚错位",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user