fix: avoid protected person mask rectangle fill

This commit is contained in:
134 2026-07-05 11:53:40 +08:00
parent 4ab60cc7a3
commit f16c54c3a9

View File

@ -1715,6 +1715,7 @@ function filterScaleAdjustStructureComponents(params: {
Boolean(protectedPersonMask) &&
protectedPersonOverlap > 0 &&
touchesProtectedPersonSide;
const allowSurfaceFill = !protectedPersonSide;
const isProtectedPersonPixel = (pixelX: number, pixelY: number) => {
const pixelIndex = pixelY * width + pixelX;
if (protectedPersonMask?.[pixelIndex]) return true;
@ -1756,7 +1757,7 @@ function filterScaleAdjustStructureComponents(params: {
!edgeSliver &&
!broadTopBackground
) {
if (fillSurfaceComponent) {
if (fillSurfaceComponent && allowSurfaceFill) {
for (let fillY = minY; fillY <= maxY; fillY += 1) {
for (let fillX = minX; fillX <= maxX; fillX += 1) {
if (isProtectedPersonPixel(fillX, fillY)) continue;
@ -4785,7 +4786,7 @@ export async function POST(request: NextRequest) {
scaleAdjustPromptStrategy: isScaleAdjustOperation
? scaleAdjustPatchReference
? useScaleAdjustFullFrameStructurePatch
? "full-frame-structure-locked-draft-v2-protected-direction-one-shot"
? "full-frame-structure-locked-draft-v3-no-protected-fill-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"