Gemini 3 图像提示词编辑
It doesn't edit your image. That's the point.
- image
- new_prompt
- analysis_text
Read the name carefully: Gemini 3 Image Editor Prompt. It doesn't edit the image. It writes the prompt that another model will use to edit the image. This node is a prompt engineer in a box - you give it an image and an instruction like "turn the sky purple," and it returns a fully fleshed-out prompt for a text-to-image model, tuned to describe both what's already in the image and what you want changed.
That makes it a prompt-engineering node, not an image-editing node, and it's honestly a clever use of a vision model. The failure mode of editing-by-prompt is that your instruction is too terse for the generator to preserve the original subject while making the change. This node front-loads the work: Gemini looks at your actual image, describes it, and produces a prompt that carries the original content forward into the edit. You then feed new_prompt into a text-to-image or img2img sampler. It lives under "实验性" (experimental) in the pack, so treat it as a helpful assist rather than a guaranteed pipeline stage.
How it works
The node sends your image (converted from the IMAGE tensor to base64 PNG) plus your editing instruction to Gemini, with a system prompt that makes it behave like a professional prompt engineer. The model is told to first describe the image in detail, then explain how it'll fold in your edit, then produce the final prompt - with the analysis and the prompt separated by the literal line ---PROMPT---. The node splits on that marker: everything above goes to analysis_text, everything below to new_prompt. If the marker is missing (models forget), it falls back to treating the whole response as the prompt and warns you in analysis_text.
Inputs and outputs that matter
image- the IMAGE you're basing the edit on.prompt- the edit instruction. Be specific; "make it cooler" produces a vaguer prompt than "shift the color grade to cold blue, keep the subject and composition."- Standard auth/model fields.
Outputs: new_prompt (wire this into a CLIP text encode or prompt input of your generator) and analysis_text (the model's reasoning about the image and how it built the prompt - useful for sanity-checking, and where the missing-separator warning shows up).
Install
Same pack, same steps. ComfyUI Manager (search "ComfyUI-Gemini-3") or:
cd ComfyUI/custom_nodes
git clone https://github.com/xuchenxu168/ComfyUI-Gemini-3
cd ComfyUI-Gemini-3
pip install -r requirements.txt
No downloads. Google AI Studio key via api_key field, config.json, or GEMINI_API_KEY.
Common issues
- Expecting an edited image - the node returns text only. If you wired it straight to a Save Image node you'll be staring at an error; the output is a prompt string for a generator downstream.
- "Separator not found" warning - the model occasionally skips the
---PROMPT---line. The node degrades gracefully by returning the full text as the prompt, but checkanalysis_textwhen the output looks off. - Your base model still matters -
new_promptis written for a generic strong text-to-image model. An anime checkpoint or a tag-based model won't do well with natural-language prose; the same mismatch the KB flags about LLM prompt generation (prompt-engineering.md). For those bases, keep your own tag conventions. - Cost per call - every run sends a full image up to the API. Use it on images worth the round-trip, not as a whole-batch default.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| prompt | STRING | 将天空变成紫色。 | — |
| api_provider | COMBO | 1 options: google | |
| api_key | STRING | — | |
| model | COMBO | gemini-3-pro-preview | 1 options: gemini-3-pro-preview |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| new_prompt | STRING | — |
| analysis_text | STRING | — |