From 35a65f26f6618248aba14ca3dbe23727cf5f051b Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 20 Feb 2026 18:19:47 +0800 Subject: [PATCH] fix: always honor selected image size from canvas toolbar --- components/image-params-bar.tsx | 58 ++++++++++++--------------------- 1 file changed, 21 insertions(+), 37 deletions(-) diff --git a/components/image-params-bar.tsx b/components/image-params-bar.tsx index 5e025f216..437780efd 100644 --- a/components/image-params-bar.tsx +++ b/components/image-params-bar.tsx @@ -102,18 +102,13 @@ export function ImageParamsBar({ // Gemini:1~2 张 return [1, 2]; }; - const supportsSize = imageGenConfig?.supportsSize !== false; - const clampParamsByProvider = (raw: ImageGenerationParams): ImageGenerationParams => { const options = getImageCountOptions(); const fallbackCount = options[0] ?? 1; const imageCount = options.includes(raw.imageCount || fallbackCount) ? (raw.imageCount || fallbackCount) : fallbackCount; - const imageSize = supportsSize - ? (raw.imageSize || "2K") - : "2K"; return { ...raw, - imageSize, + imageSize: raw.imageSize || "2K", imageCount, }; }; @@ -209,37 +204,26 @@ export function ImageParamsBar({ {/* 分辨率 */} - {supportsSize ? ( - - - - - - {IMAGE_SIZE_OPTIONS.map((option) => ( - updateParam("imageSize", option.value)} - className="focus-visible:ring-0 focus-visible:ring-offset-0 focus:outline-none focus:ring-0" - > - - {option.label} - - ))} - - - ) : ( - - )} + + + + + + {IMAGE_SIZE_OPTIONS.map((option) => ( + updateParam("imageSize", option.value)} + className="focus-visible:ring-0 focus-visible:ring-offset-0 focus:outline-none focus:ring-0" + > + + {option.label} + + ))} + + {showImageCountSelector && (