Hello,
I would like to set up options for nano banana such as resulotion, aspect ratio, top-p and temprature. Therefore, there is no space inthe module to select them.
Thank you.
yeah n8n’s Gemini node doesnt expose those — gotta hit the API directly. heres the HTTP Request node:
all the params from ur screenshot map straight in — aspectRatio (1:1, 16:9, 9:16 etc), imageSize (1K/2K/4K), temperature, topP. swap the prompt/values to whatever u need. is this for the jewelry + model combine flow from ur other thread, or just text-to-image?
the built-in Gemini node in n8n currently does not expose those image generation settings, so if you want things like aspectRatio, imageSize, temperature, topP, or topK, the easiest way is to call the Gemini API directly with an HTTP Request node instead.
I tested this pattern before and it works well for image generation with a reference image. One important note though: you should not keep your API key inside a Set node like in the sample workflow, because that can leak the key if the workflow gets shared. It’s better to store the key in credentials or pass it through a secure environment variable.
Here’s a simple workflow you can import and adapt:
A few practical notes:
aspectRatio supports quite a few presets, not just 1:1, 16:9, and 9:16. From what’s currently documented for Nano Banana image generation, the supported ratios include 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, and 21:9.
imageSize depends on the model/version, but in practice you’ll typically see options like 1K, 2K, and in some cases 4K on newer Nano Banana variants.
If you only want text-to-image, you can remove the fileData block completely.
If you want image editing, style transfer, or composition based on a reference image, keep the reference image in the request.
Don’t hesitate to ask if you need anything else or want to tweak this further. I really hope this ends up being the solution that works for you.
Hi @Trilogy_Elektronik it’s really great to hear that you were able to get it working so easily. If it solves your problem, please don’t forget to mark my reply as the solution, that would mean a lot to me.
regenerate ur API key right now. its visible in ur screenshot (the AIzaSyB… one). anyone scrolling this thread can grab + use it. take 30 sec on aistudio.google.com → Get API Key → revoke old + create new.
the real bug: in ur last screenshot (Expression vs Result panel), look at the right side — inlineData.data resolves to [undefined]. that means $binary.productimage.toBase64() cant find a binary field called productimage on the upstream node. so gemini receives the literal string [undefined] as the base64 image data, hence the “unable to process input image” error.
fix: click ur upstream node (the one before HTTP Request — looks like a Google Drive download) and check the binary output panel. the actual key is probably data, not productimage. then in ur HTTP body change to:
swap ‘Google Drive’ for whatever ur source node is actually called, and data for the actual binary key u see in its output. once inlineData.data resolves to a real base64 string the call will go through.
@Trilogy_Elektronik ah ok i see the issue now — looking back at ur Prepare node, its only setting text fields (image_model, geminiApi, prompts, params). theres no actual image binary feeding into the HTTP node. so when the HTTP request tries to read $binary it returns undefined no matter what name we use.
u need a Google Drive Download node BEFORE the HTTP call to fetch the actual product image bytes. heres the missing node:
connect: Prepare → Download Product Image → HTTP Request. then in the HTTP body change inlineData.data to:
and add productImageId to ur Prepare node as the actual Google Drive file ID of the product image (the part after /d/ in the share URL, or pull it from ur loop). once that download node runs, the HTTP node finally has a real binary to send.
if that doesent work, can you redact the api key from ur workflow, do control A in n8n control C and than controlV into your post/reply?