fix: clear dark artifacts from protected scale drafts

This commit is contained in:
134 2026-07-05 12:39:07 +08:00
parent 5262b085c2
commit 729ccec2f8

View File

@ -2668,8 +2668,8 @@ function suppressScaleAdjustProtectedFurnitureDarkAlpha(params: {
const g = rawRgb[colorIndex + 1] || 0;
const b = rawRgb[colorIndex + 2] || 0;
const { luma, saturation } = getScaleAdjustPixelStats(r, g, b);
const veryDark = luma < 62;
const flatDark = luma < 95 && saturation < 0.25;
const veryDark = luma < 72;
const flatDark = luma < 110 && saturation < 0.28;
if (!veryDark && !flatDark) continue;
const sourceX = bbox.left + localX;
@ -2677,7 +2677,7 @@ function suppressScaleAdjustProtectedFurnitureDarkAlpha(params: {
if (isProtectedSideArea(sourceX, sourceY)) {
output[alphaIndex] = 0;
} else {
output[alphaIndex] = Math.round(alpha * 0.12);
output[alphaIndex] = 0;
}
}
}
@ -4303,7 +4303,7 @@ function buildScaleAdjustFullFramePatchPrompt(
"Input image 1 is a full-photo target draft. The selected furniture/product has already been moved and scaled with source-photo pixels to the required final footprint. Treat the size, position, silhouette, product structure, material, perspective, wheels, rods, panels, hooks, weave, and visible details in input image 1 as the hard target.",
"Input image 2 is the original clean full photo. Use it only for clean background texture, lighting, perspective, non-target people, non-target objects, and untouched areas. Do not restore the selected furniture/product to its old size or old position from input image 2.",
"AI work is limited to natural background completion, boundary blending, occlusion, contact shadows, and removing rough draft artifacts. Do not repaint, redesign, replace, stretch, duplicate, or distort the selected furniture/product interior.",
"The target draft can contain translucent pasted pixels, faint old-footprint washes, clipped dark clothing fragments, or partial mask silhouettes. These are draft artifacts only. Do not copy any dark blob, black hole, ghost fragment, transparent residue, or pasted silhouette as final photo content.",
"The target draft can contain translucent pasted pixels, faint old-footprint washes, clipped dark clothing fragments, suppressed dark details, or partial mask silhouettes. These are draft artifacts only. Use input image 2 to recover clean product details at the target size, but do not copy any dark blob, black hole, ghost fragment, transparent residue, pasted silhouette, or old-size placement as final photo content.",
"If the target footprint intersects a non-target person, preserve that person as the foreground occluder exactly as in the original photo: do not move, cover, deform, redraw, or change their face, body, clothes, hands, legs, feet, or pose. Blend the furniture/product behind the person naturally where needed.",
"Erase the old larger furniture/product footprint outside the final target footprint and rebuild newly visible wall, curtain, floor, rug, shadow, and background naturally. Do not leave ghost copies, old-size remnants, rectangular haze, pale wash blocks, patch edges, black holes, dirty speckles, or visible seams.",
"Keep all non-target content stable: person identity and anatomy, sofa, window, curtain, cabinet, lamp, wall art, floor, rug, lighting, textural grain, and global color must remain consistent.",
@ -4934,7 +4934,7 @@ export async function POST(request: NextRequest) {
scaleAdjustPromptStrategy: isScaleAdjustOperation
? scaleAdjustPatchReference
? useScaleAdjustFullFrameStructurePatch
? "full-frame-structure-locked-draft-v4-protected-side-dark-suppressed-one-shot"
? "full-frame-structure-locked-draft-v5-protected-side-dark-cleared-one-shot"
: scaleAdjustPatchReference.structureLockedDraft
? "ai-patch-workspace-structure-locked-draft-v87-subject-alpha-clipped-one-shot"
: "ai-patch-workspace-draft-v75-soft-wipe-erase-ghost-one-shot"