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",
|
resolvedScaleAdjustModelEntry?.provider?.type === "fal-image",
|
||||||
scaleAdjustProviderFallbackPolicy: isScaleAdjustOperation
|
scaleAdjustProviderFallbackPolicy: isScaleAdjustOperation
|
||||||
? scaleAdjustModelFamily
|
? scaleAdjustModelFamily
|
||||||
? "same-name-low-cost-first-fal-last"
|
? "same-name-service-error-only-fal-last"
|
||||||
: "default-model-failover"
|
: "default-model-failover"
|
||||||
: undefined,
|
: undefined,
|
||||||
|
scaleAdjustQualityFailoverPolicy: isScaleAdjustOperation
|
||||||
|
? "disabled-return-first-ai-candidate"
|
||||||
|
: undefined,
|
||||||
scaleAdjustPreferSameNameProviderFailover:
|
scaleAdjustPreferSameNameProviderFailover:
|
||||||
isScaleAdjustOperation && Boolean(scaleAdjustModelFamily),
|
isScaleAdjustOperation && Boolean(scaleAdjustModelFamily),
|
||||||
scaleAdjustStrictSameFamilyFailover:
|
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_FEATHER_RATIO = 0.018;
|
||||||
const LOCAL_EDIT_COMPOSITE_DIFF_LOW_THRESHOLD = 10;
|
const LOCAL_EDIT_COMPOSITE_DIFF_LOW_THRESHOLD = 10;
|
||||||
const LOCAL_EDIT_COMPOSITE_DIFF_HIGH_THRESHOLD = 34;
|
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_THRESHOLD = 18;
|
||||||
const SCALE_ADJUST_OUTSIDE_DIFF_MIN_CHANGED_RATIO = 0.28;
|
const SCALE_ADJUST_OUTSIDE_DIFF_MIN_CHANGED_RATIO = 0.28;
|
||||||
const SCALE_ADJUST_OUTSIDE_PIXEL_DIFF_THRESHOLD = 16;
|
const SCALE_ADJUST_OUTSIDE_PIXEL_DIFF_THRESHOLD = 16;
|
||||||
@ -2630,9 +2630,9 @@ export async function generateCanvasImage(
|
|||||||
const allowFailover = request.allowFailover !== false;
|
const allowFailover = request.allowFailover !== false;
|
||||||
const shouldFailover =
|
const shouldFailover =
|
||||||
shouldFailoverAiModelError(caughtError) ||
|
shouldFailoverAiModelError(caughtError) ||
|
||||||
(scaleAdjustRejected &&
|
(!scaleAdjustRejected &&
|
||||||
Boolean(debugMeta?.scaleAdjustPreferSameNameProviderFailover)) ||
|
Boolean(debugMeta?.detailFixedModelApplied) &&
|
||||||
(Boolean(debugMeta?.detailFixedModelApplied) && Boolean(caughtError));
|
Boolean(caughtError));
|
||||||
const fallbackModel = allowFailover && shouldFailover
|
const fallbackModel = allowFailover && shouldFailover
|
||||||
? findCanvasFailoverModel({
|
? findCanvasFailoverModel({
|
||||||
selectedModel,
|
selectedModel,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user