Nodes/ComfyUI-Artha-Nodes/πŸ”± Artha Gemini Imagen
ComfyUI Node

πŸ”± Artha Gemini Imagen

Google's image model, called from inside ComfyUI

By CyrostarΒ·Created 10 months agoΒ·Updated 8 months agoΒ· 0
πŸ”± Artha Gemini Imagen
  • image
  • image
  • response
β—„text_promptA cat with a hatβ–Ί
β—„modify_imagefalseβ–Ί
β—„api_keyβ–Ί
β—„modelgemini-2.5-flash-image-previewβ–Ί
β—„max_tokens5000β–Ί
β—„temperature0.7β–Ί
β—„system_instructionβ–Ί

Artha Gemini Imagen is the black sheep of the Artha pack: instead of writing prompts, it generates images - by calling Google's native image model (Gemini 2.5 Flash Image, the "imagen" branding notwithstanding) from inside ComfyUI. It is not a diffusion sampler, there is no checkpoint loader anywhere in its path, and it doesn't touch your GPU. It's a thin, well-behaved wrapper around a cloud API that returns a real IMAGE tensor, which is the part that surprises people the most.

So the honest framing: this is for when you want Gemini's image generation as a step inside a ComfyUI graph - an initial concept sketch, an edit of an existing image, a second opinion from a different model family - and then you want to keep that result in the node graph to save, upscale, or composite. It is not a local-generation node, and it should not be compared to a KSampler on cost-per-image grounds, because it will lose that comparison badly.

What you set

  • text_prompt - the instruction. Defaults to "A cat with a hat," which tells you everything about how the author tests.
  • modify_image - the mode switch. Off = text-to-image from scratch. On = the connected image is used as the base, and the prompt edits it (edit-instruction style, like "make it night").
  • image - optional; only used when modify_image is on.
  • system_instruction - optional; an extra layer of steering on top of the prompt.
  • model - defaults to gemini-2.5-flash-image-preview; the pack also lists gemini-3-pro-image-preview in its api.json.
  • The pack's usual api_key, max_tokens, temperature.

Two outputs: image (an IMAGE tensor, so you can wire it into a Save Image node or further processing) and response (the model's text commentary, if any).

How it works

Under the hood it uses the google-genai SDK with both TEXT and IMAGE response modalities enabled. When modify_image is on, the image is converted to RGB and sent alongside the prompt; the API returns the edited image and sometimes a text note, and the node decodes the returned inline bytes into a ComfyUI tensor for you. Nothing runs locally beyond that conversion.

The catch, of course, is cost and availability. Every execution is a paid API call, image generation is pricier than the text calls the other Artha nodes make, and you need a key from Google AI Studio. If your region or key tier doesn't have the image model enabled, you'll get an API error - printed to the ComfyUI console, with an empty image output handed back rather than a thrown exception.

The realistic workflow

Where this earns its place is as a concept generator at the front of a graph: rough out the idea with Gemini, then run it through a local img2img pass (or IP-Adapter, or a detailer) to turn the rough draft into something with your own model's look. One light aside - "imagen" is doing a lot of heavy lifting in the node name; think of it as "Gemini's image generator" and you'll have the right expectations.

Keep modify_image off when you want generation from scratch, remember that a connected image only matters when it's on, and don't loop it in a batch of a hundred without checking your quota first.

Install

It's part of the one-install πŸ”± pack:

cd ComfyUI/custom_nodes
git clone https://github.com/Cyrostar/ComfyUI-Artha-Nodes
cd ComfyUI-Artha-Nodes
pip install -r requirements.txt

Restart ComfyUI (or ComfyUI Manager β†’ search "Artha"). Put your key in api.json in the pack folder rather than the node's plaintext api_key field - especially here, since image generation means the key gets used a lot and workflows get shared.

CategoryArtha/LLM/Gemini

Inputs (8)

NameTypeDefaultDescription
text_promptSTRINGA cat with a hatβ€”
modify_imageBOOLEANfalseβ€”
api_keySTRINGAPI key will be visible in plain text. Consider adding your api to the api.json located inside this custom node folder.
modelCOMBOgemini-2.5-flash-image-preview2 options: gemini-2.5-flash-image-preview, gemini-3-pro-image-preview
max_tokensINT50001–8192For Gemini models, a token is equivalent to about 4 characters. 100 tokens is equal to about 60–80 English words.
temperatureFLOAT0.70–2A temperature of 0 means only the most likely tokens are selected. Higher values increase randomness.
imageoptIMAGEβ€”
system_instructionoptSTRINGβ€”

Outputs (2)

NameTypeDescription
imageIMAGEβ€”
responseSTRINGβ€”