π± Gemini Imagen
Gemini's Nano Banana image generation, parked inside a ComfyUI node
- system_instruction
- image
- response
Gemini Imagen is the pack's cloud image generator, and it's the node that shows what Artha-Gemini is really about: not replacing your local diffusion stack, but giving you a completely different generation engine to mix into it. The default model is gemini-2.0-flash-preview-image-generation - the older preview tier of the Gemini image line that the community now knows as Google's Nano Banana - so when this node fires, the picture is being made by Google's servers, not your GPU.
The output is a standard ComfyUI IMAGE tensor, which is the clever part. You can do whatever you normally do with a generated image: preview it, save it, VAE-encode it, feed it into img2img, or run it through ControlNet. The cloud does the hard part, and the result lands back in your workflow like any local generation.
How it works
It's a thin wrapper around the Gemini API's image-capable model. You give it a text_prompt, it calls generate_content with image response modalities enabled, and returns both the generated image tensor and whatever text Gemini produced alongside it.
The twist is the modify_image toggle. When it's off, you get text-to-image. Flip it on and the image input becomes an editing target - the API uses it as a reference and applies your prompt on top of it. That "edit this reference image with natural language" workflow is genuinely powerful, and it's where Nano Banana-class models shine: describing a change beats wrestling a mask and a denoise value.
Inputs and outputs
- text_prompt - the generation or edit instruction. Defaults to
A cat with a hat. - modify_image - boolean. False = generate fresh; true = edit the uploaded image.
- image - an upload widget. Only matters when
modify_imageis on. - system_instruction (optional) - an
ARTHAINSTRUCTslot from the pack's Gemini Instruct node, if you want to steer style.
The API block includes the image-model list (gemini-2.5-flash-image-preview is the other option - that's the newer Nano Banana tier), api_key, max_tokens, and temperature. Outputs are image (IMAGE) and response (STRING). Both can be null if the call fails, so wire the response into a text display to see what happened.
Installing it
Install the pack in ComfyUI Manager (search Artha-Gemini) or:
cd ComfyUI/custom_nodes
git clone https://github.com/Cyrostar/ComfyUI-Artha-Gemini
cd ComfyUI-Artha-Gemini
pip install -r requirements.txt
No model downloads - everything runs server-side. You need a Gemini API key from Google AI Studio, and honestly you need to look at the pricing before you wire this into a loop that generates hundreds of images, because every generation is a billable API call.
Where people get burned
Three things. First, the key - same story as the whole pack: put it in api.json (gemini_api_key) or the GEMINI_API_KEY env var, not the plain-text node field. Second, censorship. Google's image models are aggressively filtered; the KB tracks the January 2026 policy update that tightened IMAGE_SAFETY further. If you're coming from local SD where you're used to generating whatever you want, this will frustrate you fast. Third, expectations: this is a hosted service with invisible SynthID watermarking on output, so it's not a drop-in replacement for a private local stack - it's a second, opinionated engine to have in the toolbox.
One more tip: if modify_image is on but you haven't uploaded an image, the node tries to open whatever's selected and errors out. Keep a valid file in the input picker whenever the toggle is live.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| text_prompt | STRING | A cat with a hat | β |
| api_key | STRING | API key will be visible in plain text. Consider adding your api to the api.json located inside this custom node folder. | |
| model | COMBO | gemini-2.0-flash-preview-image-generation | 2 options: gemini-2.5-flash-image-preview, gemini-2.0-flash-preview-image-generation |
| max_tokens | INT | 50001β8192 | For Gemini models, a token is equivalent to about 4 characters. 100 tokens is equal to about 60-80 English words. |
| temperature | FLOAT | 0.70β2 | A temperature of 0 means only the most likely tokens are selected, and there's no randomness. Conversely, a high temperature injects a high degree of randomness into the tokens selected by the model, leading to more unexpected, surprising model responses. |
| modify_image | BOOLEAN | false | β |
| image | COMBO | 1 options: example.png | |
| system_instructionopt | ARTHAINSTRUCT | β |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | β |
| response | STRING | β |