Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

fix(image): preserve resolution when changing aspect ratio (#13324)

BillionTokendacc7798ab58
diff --git a/src/store/image/slices/generationConfig/action.ts b/src/store/image/slices/generationConfig/action.ts
index 96a394ee26c..cc65cfc52c8 100644
--- a/src/store/image/slices/generationConfig/action.ts
+++ b/src/store/image/slices/generationConfig/action.ts
@@ -254,6 +254,12 @@ export class GenerationConfigActionImpl {
newParams.aspectRatio = aspectRatio;
}
+ // Preserve resolution if it exists in current parameters (models like nanoBanana2 use resolution enum)
+ // This ensures 4K/2K resolution is maintained when changing aspect ratios
+ if ('resolution' in parameters && parameters.resolution !== undefined) {
+ newParams.resolution = parameters.resolution;
+ }
+
this.#set(
{ activeAspectRatio: aspectRatio, parameters: newParams },
false,