Nodes/ComfyUI Gemini Nodes/Gemini Image Processor
ComfyUI Node

Gemini Image Processor

Analyze, edit, or caption any image

By jqy-yoΒ·Created about a year agoΒ·Updated 11 months agoΒ· 7
Gemini Image Processor
  • image
  • reference_image
  • output_text
  • processed_image
  • raw_json
  • api_request
  • api_response
β—„api_keyβ–Ί
β—„modeanalyzeβ–Ί
β—„promptDescribe this image in detail.β–Ί
β—„modelgemini-1.5-flashβ–Ί
β—„temperature0.7β–Ί
β—„max_output_tokens1024β–Ί
β—„top_p0.95β–Ί
β—„top_k64β–Ί
β—„seed0β–Ί
β—„output_schema{ "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"] }β–Ί

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_image as 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-flash by default; gemini-1.5-pro if you need deeper analysis. The pack's own model notes warn against forcing gemini-2.5-flash-lite on large images.
  • reference_image - only matters for modify mode.
  • output_schema - only matters for structured_output mode.
  • 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.

CategoryπŸ€– Gemini

Inputs (12)

NameTypeDefaultDescription
api_keySTRINGβ€”
imageIMAGEβ€”
modeCOMBOanalyze5 options: analyze, modify, generate_prompt, extract_text, structured_output
promptSTRINGDescribe this image in detail.β€”
modelSTRINGgemini-1.5-flashβ€”
temperatureFLOAT0.70–1β€”
max_output_tokensINT102450–8192β€”
top_pFLOAT0.950–1β€”
top_kINT641–100β€”
seedINT00–2147483647β€”
reference_imageoptIMAGEβ€”
output_schemaoptSTRING{ "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)

NameTypeDescription
output_textSTRINGβ€”
processed_imageIMAGEβ€”
raw_jsonSTRINGβ€”
api_requestSTRINGβ€”
api_responseSTRINGβ€”