From 65afd2344b94b5a805076899185680643588e3b3 Mon Sep 17 00:00:00 2001 From: shrimbly Date: Fri, 27 Feb 2026 07:42:08 +1300 Subject: [PATCH] fix: use model-specific resolution lists and normalize on model switch Nano Banana Pro supports 1K/2K/4K, while Nano Banana 2 also supports 512. Split the shared RESOLUTIONS constant into RESOLUTIONS_PRO and RESOLUTIONS_NB2, and use the correct list based on the selected model in both GenerateImageNode and SplitGridSettingsModal. Also normalize aspect ratio and resolution to valid defaults when switching models in the SplitGrid modal. Co-Authored-By: Claude Opus 4.6 --- src/components/SplitGridSettingsModal.tsx | 21 ++++++++++++++++++--- src/components/nodes/GenerateImageNode.tsx | 8 +++++--- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/src/components/SplitGridSettingsModal.tsx b/src/components/SplitGridSettingsModal.tsx index c06f31fe..51230ac5 100644 --- a/src/components/SplitGridSettingsModal.tsx +++ b/src/components/SplitGridSettingsModal.tsx @@ -22,7 +22,8 @@ const LAYOUT_OPTIONS = [ const BASE_ASPECT_RATIOS: AspectRatio[] = ["1:1", "2:3", "3:2", "3:4", "4:3", "4:5", "5:4", "9:16", "16:9", "21:9"]; const EXTENDED_ASPECT_RATIOS: AspectRatio[] = ["1:1", "1:4", "1:8", "2:3", "3:2", "3:4", "4:1", "4:3", "4:5", "5:4", "8:1", "9:16", "16:9", "21:9"]; -const RESOLUTIONS: Resolution[] = ["1K", "2K", "4K"]; +const RESOLUTIONS_PRO: Resolution[] = ["1K", "2K", "4K"]; +const RESOLUTIONS_NB2: Resolution[] = ["512", "1K", "2K", "4K"]; const MODELS: { value: ModelType; label: string }[] = [ { value: "nano-banana", label: "Nano Banana" }, { value: "nano-banana-2", label: "Nano Banana 2" }, @@ -55,6 +56,7 @@ export function SplitGridSettingsModal({ const targetCount = rows * cols; const isNanoBananaPro = model === "nano-banana-pro" || model === "nano-banana-2"; const aspectRatios = model === "nano-banana-2" ? EXTENDED_ASPECT_RATIOS : BASE_ASPECT_RATIOS; + const resolutions = model === "nano-banana-2" ? RESOLUTIONS_NB2 : RESOLUTIONS_PRO; const handleCreate = useCallback(() => { const splitNode = getNodeById(nodeId); @@ -267,7 +269,20 @@ export function SplitGridSettingsModal({ diff --git a/src/components/nodes/GenerateImageNode.tsx b/src/components/nodes/GenerateImageNode.tsx index b767e764..57838d49 100644 --- a/src/components/nodes/GenerateImageNode.tsx +++ b/src/components/nodes/GenerateImageNode.tsx @@ -20,8 +20,9 @@ const BASE_ASPECT_RATIOS: AspectRatio[] = ["1:1", "2:3", "3:2", "3:4", "4:3", "4 // Extended 14 aspect ratios (Nano Banana 2 adds extreme ratios) const EXTENDED_ASPECT_RATIOS: AspectRatio[] = ["1:1", "1:4", "1:8", "2:3", "3:2", "3:4", "4:1", "4:3", "4:5", "5:4", "8:1", "9:16", "16:9", "21:9"]; -// Resolutions for Nano Banana Pro and Nano Banana 2 -const RESOLUTIONS: Resolution[] = ["512", "1K", "2K", "4K"]; +// Resolutions per model (nano-banana-pro: 1K-4K, nano-banana-2: 512-4K) +const RESOLUTIONS_PRO: Resolution[] = ["1K", "2K", "4K"]; +const RESOLUTIONS_NB2: Resolution[] = ["512", "1K", "2K", "4K"]; // Hardcoded Gemini image models (always available) const GEMINI_IMAGE_MODELS: { value: ModelType; label: string }[] = [ @@ -407,6 +408,7 @@ export function GenerateImageNode({ id, data, selected }: NodeProps 1; // Track previous status to detect error transitions @@ -714,7 +716,7 @@ export function GenerateImageNode({ id, data, selected }: NodeProps - {RESOLUTIONS.map((res) => ( + {resolutions.map((res) => (