Image
Gemini image generation through your own LiteLLM server — the chat API does the drawing
- config
- image_1
- image_2
- image_3
- image_4
- image_5
- IMAGE
The "Image" node is the LiteLLM half's answer to the ORImageGenerate node: a text prompt in, a real ComfyUI IMAGE tensor out, with no local diffusion model involved at all. The catch that separates it from its OpenRouter sibling is that it needs a LiteLLM server you control - this is the node for people who already run one, not for people looking to avoid setup.
Worth reading the parent article first if you haven't: same pack, same zero-dependency install, same cloud-API model of operation. This node is specifically the version that sends your request through {api_base} rather than straight to a vendor.
How it works - and why it's weird
The genuinely interesting bit is what the README's FAQ spells out. Gemini through LiteLLM refuses the standard /images/generations endpoint - it returns empty data for Gemini models. So this node does the non-obvious thing and uses /chat/completions with an image_config block carrying your aspect_ratio and image_size. The image comes back inside the chat message response, gets base64-decoded, and lands as a standard IMAGE tensor you can save or edit like any other.
There's a version requirement hiding here: the LiteLLM side needs image_config support, which arrived around LiteLLM 1.80.7. If you're on an older proxy, update it before you debug the node itself. The request also carries a hard 180-second timeout, so don't expect hero shots - a busy server will blow past it and you'll see a retry, then an error.
The inputs that matter
- config - an
LLM_IMAGE_CONFIG, which only comes from Image Params. This one matters more than it looks, because the node checks ause_gemini_imageflag set by Image Params. Wire a chat config into this node and it throwsGemini config required. Wrong config type is the #1 beginner trip here. - prompt - keep it short and descriptive. This node shares Gemini's quirk where complex or question-y prompts come back as text instead of a picture.
- n - 1 to 4. And the same caveat as the OpenRouter version: it doesn't request n distinct images. Whatever comes back, the first image gets tiled to fill the batch. n is a batch-size control, not a variety control.
Optional image_1–image_5 give you image editing (Gemini works from reference images), and additional_text lets you add a second instruction field without cluttering the prompt.
Installing it
# ComfyUI Manager: search "Gemini LiteLLM", Install, restart
# or:
cd ComfyUI/custom_nodes
git clone https://github.com/ZUENS2020/ComfyUI-Gemini-LiteLLM
No requirements.txt, no pip install, no model files - the pack is stdlib urllib plus the numpy/torch/Pillow that ComfyUI already ships. The real "install" is standing up your LiteLLM server and giving Base Config its URL and key.
Gotchas
Beyond the config-type mistake and the LiteLLM version floor, the main thing to remember is that this node is only as reliable as your proxy. If everything looks right and you still get failures, check the LiteLLM server logs first - the node's own console output stays quiet by design (this half of the pack only prints errors), so the signal you need is usually on the server side.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| config | LLM_IMAGE_CONFIG | — | |
| prompt | STRING | A beautiful landscape | — |
| n | INT | 11–4 | — |
| image_1opt | IMAGE | — | |
| image_2opt | IMAGE | — | |
| image_3opt | IMAGE | — | |
| image_4opt | IMAGE | — | |
| image_5opt | IMAGE | — | |
| additional_textopt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |