Gemini Image Processor
Analyze, edit, or caption any image
- image
- reference_image
- output_text
- processed_image
- raw_json
- api_request
- api_response
Five image jobs, one node
GeminiImageProcessor is the pack's all-rounder for single-image work. Instead of a separate node for every flavor of "look at this image and tell me stuff," it bundles five modes behind one mode dropdown - analyze, modify, generate a prompt, extract text, and structured output. If you're new to the pack, this is the first image node you'll reach for, because it handles the most common cases with the least setup.
The trade-off: it's a jack of all trades, and each mode is a bit shallower than the pack's dedicated nodes. For heavy batch image work, the Batch Processor is the better fit; for pure generation, the Image Editor. This one is for "I have one image and one job."
How it works
Every mode is a Gemini multimodal call with the image attached. The modes shape the system prompt and how the response is handled:
- analyze (default) - describe what's in the image. Prompt defaults to "Describe this image in detail."
- modify - ask for changes using a
reference_imageas the base and the prompt as the instruction. - generate_prompt - reverse-engineer: give it an image, get back a prompt that would reproduce it. Handy for turning someone else's image into your own generation seed.
- extract_text - OCR-ish text extraction from the image.
- structured_output - analyze into a JSON schema you supply via
output_schema(a default schema for subject/description/colors/mood/style is pre-filled).
Model defaults to gemini-1.5-flash - a sensible, cheap, stable choice for vision work.
Inputs you'll set
- image - the input image (required).
- mode - pick your job first; the other inputs change meaning based on it.
- prompt - the instruction for whatever mode you chose.
- model -
gemini-1.5-flashby default;gemini-1.5-proif you need deeper analysis. The pack's own model notes warn against forcinggemini-2.5-flash-liteon large images. - reference_image - only matters for
modifymode. - output_schema - only matters for
structured_outputmode. - temperature, top_p, top_k, seed, max_output_tokens - standard generation controls; keep temperature low for extraction-type tasks.
Outputs: output_text (the main result), processed_image (an IMAGE output - populated for modify mode, or a passthrough otherwise), raw_json (for structured mode), plus the usual api_request / api_response debug pair.
Install
Standard pack install:
cd ComfyUI/custom_nodes
git clone https://github.com/jqy-yo/comfyui-gemini-nodes
cd comfyui-gemini-nodes
pip install -r requirements.txt
Or "ComfyUI Gemini Nodes" via ComfyUI Manager, then restart. Key in the api_key field or GOOGLE_API_KEY env var.
Where people get burned
The main gotcha is mode confusion - a modify request sent with no reference_image (or an analyze prompt written as a modification instruction) produces a confident answer to the wrong question. Read the mode names as a contract. Also, the pack's MODEL_LIMITATIONS.md is explicit that small/lite models struggle with large images, so if you get 500s on a big source, downscale it or move to gemini-1.5-pro. And keep in mind this costs an API call per run - it's not a free local tool like the JSON utilities in this pack. Use the raw_json output to see exactly what the model returned when a mode behaves unexpectedly.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| api_key | STRING | β | |
| image | IMAGE | β | |
| mode | COMBO | analyze | 5 options: analyze, modify, generate_prompt, extract_text, structured_output |
| prompt | STRING | Describe this image in detail. | β |
| model | STRING | gemini-1.5-flash | β |
| temperature | FLOAT | 0.70β1 | β |
| max_output_tokens | INT | 102450β8192 | β |
| top_p | FLOAT | 0.950β1 | β |
| top_k | INT | 641β100 | β |
| seed | INT | 00β2147483647 | β |
| reference_imageopt | IMAGE | β | |
| output_schemaopt | STRING | { "type": "object", "properties": { "main_subject": {"type": "string"}, "description": {"type": "string"}, "colors": { "type": "array", "items": {"type": "string"} }, "mood": {"type": "string"}, "style": {"type": "string"} }, "required": ["main_subject", "description"] } | β |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| output_text | STRING | β |
| processed_image | IMAGE | β |
| raw_json | STRING | β |
| api_request | STRING | β |
| api_response | STRING | β |