🆕Gemini_15P_Advance_Zho
The node behind the 'Gemini + SD = DALL·3' workflow
- image
- text
This is the node from the pack's headline demo: "Gemini 1.5 Pro + Stable Diffusion + ComfyUI = DALL·3". Gemini_15P_Advance_Zho is the reason that trick works - it's a Gemini 1.5 Pro call with a system instruction bolted on, and the system instruction is what turns a generic chatbot into a prompt-engineering machine.
The idea is dead simple. You feed it an image and it describes it; then, following its built-in instructions, it rewrites that description into a tight Stable Diffusion prompt (under 80 tokens, per the default). That prompt feeds your text encoder, and suddenly you've got the "describe an image, get a clean prompt" loop that people usually reach for closed DALL·3 for. It's an implicit-key node (the ㊙️-style setup - 1.5 Pro family), so your key lives in the pack's config.json, not in the workflow.
What makes it different from the plain Gemini nodes
The system_instruction input is the whole ballgame. That's a real Gemini 1.5 Pro feature - it pins the model's role before the prompt is even sent, the API-level equivalent of a chatbot's "system prompt." The default is ZHO's own SD-prompt-persona: describe the image, then produce a prompt, keep it under 80 tokens. Swap it out and the node becomes anything you want it to be - an art critic, a tagger, a captioner. The 1.5 Pro model also takes image or text, handles files, and advertises a huge context window (the README claims up to ~1,048,576 tokens), which is why the plain nodes feel quaint next to it.
Inputs that matter
- system_instruction - the persona/behavior. The default is a great starting point for the DALL·3-replacement workflow; edit it freely.
- prompt - your actual request or the thing to describe.
- model_name - fixed to
gemini-1.5-pro-latest, no choice. That's a moving alias, which matters (see below). - stream - off is fine.
- image (optional) - send a tensor; 1.5 Pro also works text-only.
The text output is what you feed into your prompt pipeline, typically through a DisplayText_Zho to check it before it hits the sampler.
Install
Same pack install as everything else here:
cd ComfyUI/custom_nodes
git clone https://github.com/ZHO-ZHO-ZHO/ComfyUI-Gemini.git
cd ComfyUI-Gemini
pip install -r requirements.txt
1.5 Pro needs google-generativeai > 0.4.1 - the requirements file already enforces that, but if you installed the pack long ago, pip install -U google-generativeai before expecting this node to work.
Where people get burned
Rate limits are the big one. 1.5 Pro on the free tier is roughly 2 requests/minute and 1000/day (the README says so outright), so don't point a 200-image tagging batch at this node and expect it to finish today. Also remember -latest is a versioned pointer - Google can roll the underlying model and change answers between runs. And like every node in this pack, it's a hosted call: no network to Google means "API key is required" style failures even with a valid key.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | What is the meaning of life? | — |
| system_instruction | STRING | You are creating a prompt for Stable Diffusion to generate an image. First step: describe this image, then put description into text. Second step: generate a text prompt for %s based on first step. Only respond with the prompt itself, but embellish it as needed but keep it under 80 tokens. | — |
| model_name | COMBO | 1 options: gemini-1.5-pro-latest | |
| stream | BOOLEAN | false | — |
| imageopt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |