fix: respect FAL edit image count limit

This commit is contained in:
134 2026-06-28 14:16:36 +08:00
parent 471eb3f650
commit 36d575b825
2 changed files with 4 additions and 4 deletions

View File

@ -1529,7 +1529,7 @@ export async function POST(request: NextRequest) {
falSystemPrompt: undefined,
falThinkingLevel: undefined,
allowFailover: useFalScaleAdjustMockup ? false : undefined,
imageCount: useFalScaleAdjustMockup ? 6 : 1,
imageCount: useFalScaleAdjustMockup ? 4 : 1,
imageSize:
typeof body.imageSize === "string" && body.imageSize.trim()
? body.imageSize.trim()
@ -1554,7 +1554,7 @@ export async function POST(request: NextRequest) {
scaleAdjustPromptStrategy: "fal-guide-only-clean-target-v20",
},
falSafetyTolerance: "6",
imageCount: 6,
imageCount: 4,
label: "fal-guide-only-clean-target-v20",
negativePrompt: falScaleAdjustNegativePrompt,
prompt: falScaleAdjustGuideOnlyPrompt,
@ -1570,7 +1570,7 @@ export async function POST(request: NextRequest) {
scaleAdjustPromptStrategy: "fal-guide-only-simple-clean-target-v20",
},
falSafetyTolerance: "6",
imageCount: 6,
imageCount: 4,
label: "fal-guide-only-simple-clean-target-v20",
negativePrompt: falScaleAdjustNegativePrompt,
prompt: falScaleAdjustSimpleGuideOnlyPrompt,

View File

@ -1885,7 +1885,7 @@ export async function generateCanvasImage(
const imageSize = normalizedImageParams.imageSize;
const imageCount =
scaleAdjustVerification && provider.type === "fal-image"
? Math.max(1, Math.min(6, requestedImageCount))
? Math.max(1, Math.min(4, requestedImageCount))
: normalizedImageParams.imageCount;
if (imageSize !== requestedImageSize || imageCount !== requestedImageCount) {
console.info("[Canvas Generate Image] Normalized model image params:", {