Nodes/ComfyUI-JM-Gemini-API/JM Gemini Image Generator
ComfyUI Node

JM Gemini Image Generator

Nano Banana, but inside your ComfyUI graph

By juemingai·Created 10 months ago·Updated 9 months ago· 16
JM Gemini Image Generator
  • image1
  • image2
  • image3
  • image4
  • image5
  • image6
  • image7
  • image8
  • image9
  • image10
  • image
◄gemini_api_key►
◄prompt►
◄modelgemini-3-pro-image-preview►
◄aspect_ratio1:1►
◄resolution2K►
◄seed0►

If you've been jealous of everyone getting clean, coherent Nano Banana images while you're stuck fighting your SDXL checkpoint's hands, this is the node for you. JMGeminiImageGenerator puts Google's Gemini image models - gemini-3-pro-image-preview (that's Nano Banana Pro) and the faster gemini-2.5-flash-image (Nano Banana) - right into a ComfyUI graph as a single node. You prompt it, it talks to Google, and an IMAGE tensor comes out the other side ready to plug into your normal preview/save/upscale chain.

The whole point is keeping your ComfyUI workflow while offloading generation to the cloud. Zero VRAM for the actual image gen - your GPU just renders whatever post-processing you chain after it. That's a big deal if you're on a 6GB card, and it's the reason this category of "cloud model as a node" pack keeps growing.

How it works

Under the hood it's a thin wrapper around the official google-genai SDK (client.models.generate_content with response_modalities=['TEXT', 'IMAGE']). You give it an API key, it calls Google, and it hands back the first image in the response as a ComfyUI tensor - plus an auto-saved PNG in ComfyUI/output/ named something like gemini3pro_text2img_1234567890.png.

Three modes, decided by which image inputs you fill:

  • Text-to-image - leave all image slots empty.
  • Image editing - connect exactly one image; your prompt becomes an edit instruction ("add a sunset background").
  • Image-to-image - connect 2–10 images; the model combines or transforms them per your prompt.

The inputs that actually matter

  • gemini_api_key - from Google AI Studio. Without it nothing happens. This is pay-per-use, not free: KB pricing puts Nano Banana Pro around $0.04–$0.24 per image depending on resolution, and it adds up fast if you iterate.
  • prompt - the prompt. In edit mode, the instruction.
  • model - gemini-3-pro-image-preview (default, higher quality, supports 1K/2K/4K) vs gemini-2.5-flash-image (faster and cheaper, ignores the resolution dropdown entirely and maps aspect ratio to fixed pixel sizes).
  • aspect_ratio - one of ten (1:1 through 21:9).
  • resolution - 1K/2K/4K, only honored by the Pro model. Set it on Flash and wonder why nothing changed - that's expected.
  • image1..image10 - optional IMAGE inputs for edit/i2i modes.

One trap worth knowing: seed does nothing. The source literally comments that the seed is only used for ComfyUI re-execution and never passed to the API. Don't expect seed-locked reproducibility - if you want a different take, change the prompt or re-run.

Installing

cd ComfyUI/custom_nodes
git clone https://github.com/synthetai/ComfyUI-JM-Gemini-API
cd ComfyUI-JM-Gemini-API
pip install -r requirements.txt

Then restart ComfyUI. Easier: search "ComfyUI-JM-Gemini-API" in ComfyUI Manager and let it handle it. The one dependency that actually matters is google-genai==1.52.0 - it's pinned, and httpx[socks] is there for proxy users (set HTTP_PROXY/HTTPS_PROXY env vars if you need them, which most users in China do). No model files to download.

Common issues

  • "Gemini API key is required" - the key field is empty or pasted with whitespace.
  • "No images were generated" - usually a prompt that tripped Google's safety filters, or a key with no quota. This model is heavily censored (the KB quotes the community's "powerful, unimaginative, massive hidden biasing"); if your prompt is even close to a blocked subject, you'll get text back instead of an image.
  • Resolution changes do nothing - you're on Flash. Switch to Pro.

Pair its output with the pack's JM Gemini Watermark Remover and your pipeline is complete: generate, strip the corner logo, save. If you want Gemini quality without paying per image, the pack's other node - the Reverse Engineering one - is the "free" cookie-based path, with caveats of its own.

CategoryJM-Gemini

Inputs (16)

NameTypeDefaultDescription
gemini_api_keySTRING—
promptSTRING—
modelCOMBOgemini-3-pro-image-preview2 options: gemini-3-pro-image-preview, gemini-2.5-flash-image
aspect_ratioCOMBO1:110 options: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, +4
resolutionCOMBO2K3 options: 1K, 2K, 4K
seedoptINT00–18446744073709550000—
image1optIMAGE—
image2optIMAGE—
image3optIMAGE—
image4optIMAGE—
image5optIMAGE—
image6optIMAGE—
image7optIMAGE—
image8optIMAGE—
image9optIMAGE—
image10optIMAGE—

Outputs (1)

NameTypeDescription
imageIMAGE—