diff --git a/app/api/canvas/local-edit/route.ts b/app/api/canvas/local-edit/route.ts index 2f3a56f2a..33cbf15e6 100644 --- a/app/api/canvas/local-edit/route.ts +++ b/app/api/canvas/local-edit/route.ts @@ -1500,9 +1500,12 @@ export async function POST(request: NextRequest) { resolvedScaleAdjustModelEntry?.provider?.type === "fal-image", scaleAdjustProviderFallbackPolicy: isScaleAdjustOperation ? scaleAdjustModelFamily - ? "same-name-low-cost-first-fal-last" + ? "same-name-service-error-only-fal-last" : "default-model-failover" : undefined, + scaleAdjustQualityFailoverPolicy: isScaleAdjustOperation + ? "disabled-return-first-ai-candidate" + : undefined, scaleAdjustPreferSameNameProviderFailover: isScaleAdjustOperation && Boolean(scaleAdjustModelFamily), scaleAdjustStrictSameFamilyFailover: diff --git a/lib/canvas/generate-image.ts b/lib/canvas/generate-image.ts index 1e4ffb1b1..6709efd5c 100644 --- a/lib/canvas/generate-image.ts +++ b/lib/canvas/generate-image.ts @@ -156,7 +156,7 @@ const LOCAL_EDIT_COMPOSITE_FEATHER_MAX_PX = 72; const LOCAL_EDIT_COMPOSITE_FEATHER_RATIO = 0.018; const LOCAL_EDIT_COMPOSITE_DIFF_LOW_THRESHOLD = 10; const LOCAL_EDIT_COMPOSITE_DIFF_HIGH_THRESHOLD = 34; -const SCALE_ADJUST_VISUAL_DIFF_THRESHOLD = 14; +const SCALE_ADJUST_VISUAL_DIFF_THRESHOLD = 10; const SCALE_ADJUST_OUTSIDE_DIFF_THRESHOLD = 18; const SCALE_ADJUST_OUTSIDE_DIFF_MIN_CHANGED_RATIO = 0.28; const SCALE_ADJUST_OUTSIDE_PIXEL_DIFF_THRESHOLD = 16; @@ -2630,9 +2630,9 @@ export async function generateCanvasImage( const allowFailover = request.allowFailover !== false; const shouldFailover = shouldFailoverAiModelError(caughtError) || - (scaleAdjustRejected && - Boolean(debugMeta?.scaleAdjustPreferSameNameProviderFailover)) || - (Boolean(debugMeta?.detailFixedModelApplied) && Boolean(caughtError)); + (!scaleAdjustRejected && + Boolean(debugMeta?.detailFixedModelApplied) && + Boolean(caughtError)); const fallbackModel = allowFailover && shouldFailover ? findCanvasFailoverModel({ selectedModel,