π± Artha Gemini Imagen
Google's image model, called from inside ComfyUI
- image
- image
- response
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 connectedimageis used as the base, and the prompt edits it (edit-instruction style, like "make it night").image- optional; only used whenmodify_imageis on.system_instruction- optional; an extra layer of steering on top of the prompt.model- defaults togemini-2.5-flash-image-preview; the pack also listsgemini-3-pro-image-previewin itsapi.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.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| text_prompt | STRING | A cat with a hat | β |
| modify_image | BOOLEAN | false | β |
| 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.5-flash-image-preview | 2 options: gemini-2.5-flash-image-preview, gemini-3-pro-image-preview |
| 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. Higher values increase randomness. |
| imageopt | IMAGE | β | |
| system_instructionopt | STRING | β |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | β |
| response | STRING | β |