From ff9362ce600b370e8de8a4d4cc499cfacbbc24bf Mon Sep 17 00:00:00 2001 From: weige <772752726@qq.com> Date: Thu, 28 May 2026 11:16:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BA=E5=AE=9A=E5=B1=95=E7=A4=BA=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E8=8A=82=E7=82=B9=E7=94=9F=E6=88=90=E5=BC=A0=E6=95=B0?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../composer/GenerationComposer.tsx | 34 +++++++++++++------ 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/src/components/composer/GenerationComposer.tsx b/src/components/composer/GenerationComposer.tsx index 331d9e10..3b67dc3e 100644 --- a/src/components/composer/GenerationComposer.tsx +++ b/src/components/composer/GenerationComposer.tsx @@ -142,6 +142,7 @@ const COMPOSER_COLLAPSED_WIDTH = 560; const COMPOSER_EXPANDED_HEIGHT_ESTIMATE = 300; const COMPOSER_COLLAPSED_HEIGHT_ESTIMATE = 80; const IMAGE_COUNT_PARAMETER_NAMES = ["imageCount", "numImages", "num_images", "numOutputs", "num_outputs", "count"]; +const DEFAULT_IMAGE_COUNT_OPTIONS: ImageGenerationCount[] = [1, 2, 4]; function findSchemaParameter(schema: ModelParameter[] | undefined, names: string[]): ModelParameter | null { if (!schema || schema.length === 0) return null; @@ -1355,9 +1356,15 @@ export function GenerationComposer() { const imageAspectRatioOptions = getSchemaEnumOptions(activeParameterSchema, ["aspectRatio", "aspect_ratio"]); const imageResolutionOptions = getSchemaEnumOptions(activeParameterSchema, ["resolution"]); const imageCountOptions = getImageCountOptions(activeParameterSchema); + const visibleImageCountOptions = imageCountOptions.length > 0 + ? imageCountOptions + : DEFAULT_IMAGE_COUNT_OPTIONS; const imageAspectRatioParameterName = getSchemaParameterName(activeParameterSchema, ["aspectRatio", "aspect_ratio"]); const imageResolutionParameterName = getSchemaParameterName(activeParameterSchema, ["resolution"]); const imageCountParameterName = getSchemaParameterName(activeParameterSchema, IMAGE_COUNT_PARAMETER_NAMES); + const selectedImageCountValue = imageCountParameterName + ? Number(draft.parameters?.[imageCountParameterName] ?? draft.imageCount) + : draft.imageCount; const videoDurationOptionsFromSchema = getSchemaEnumOptions(activeParameterSchema, VIDEO_DURATION_PARAMETER_NAMES); const videoResolutionOptions = getSchemaEnumOptions(activeParameterSchema, ["resolution"]); const videoRatioOptions = getSchemaEnumOptions(activeParameterSchema, ["videoRatio"]); @@ -2334,21 +2341,26 @@ export function GenerationComposer() { ))} )} - {imageCountParameterName && imageCountOptions.length > 0 && ( + {visibleImageCountOptions.length > 0 && (