fix: stop scale adjust quality failover
This commit is contained in:
parent
bf8197d884
commit
08b439b7f6
@ -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:
|
||||
|
||||
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user