OpenAI Image Understand
Ask a Vision Model About Your Image, In-Graph
- image
- image1
- image2
- image3
- image4
- history
- text
- history
- payload
You've generated an image and you need to know what's actually in it - for a caption, a quality review, a "does this match my prompt" check, or just a second opinion. YogurtOpenAIImageUnderstand is the vision-model node that answers: feed it an image, ask it a question, get a STRING back.
The setup mirrors the pack's other OpenAI nodes:
api_key- inline, or blank to fall back toapi_key.json/OPENAI_API_KEY.model_name- defaults togpt-5.1, called as a vision model.system_promptandprompt- the framing and your question ("Describe this image", "What's wrong with this composition?").temperature,top_p,max_tokens,frequency_penalty,presence_penalty- the standard sampling dials.retry_count,timeout,proxy_url- resilience settings.chat_template- the default<-system->/<-user->template, restructurable.
Optional inputs are the star here: image plus image1–image4 let you feed up to five images for comparison or multi-image questions. history chains turns, extra adds raw JSON to the request, and image_send_mode picks the wire format - openai (standard image_url objects) or base64 (for x.ai-style compatibility). Outputs: text, history, and payload (the raw response).
The workflows this unlocks
The text output is a first-class STRING, so it plugs straight into logic. Three patterns that actually get built:
- Captioning loops. Generate → caption → feed the caption into your next prompt. Self-improving iterations without you in the middle.
- Quality gates. Ask "does this image match the prompt: <prompt>?" and branch on the answer. Auto-reroll until the model says yes.
- Reverse engineering. Drop in a reference image, ask for a prompt that would recreate it, wire the reply into a text2img node. It's not perfect prompt extraction, but it's a shockingly good starting point.
Multi-image input is the sleeper feature - "which of these two renders is closer to the reference?" is a real question you can ask in one call.
Install and keys
Ships in ComfyUI-YogurtNodes. ComfyUI Manager → search ComfyUI-YogurtNodes → install, or:
cd ComfyUI/custom_nodes
git clone https://github.com/yogurt7771/ComfyUI-YogurtNodes.git
cd ComfyUI-YogurtNodes
pip install -r requirements.txt
Restart ComfyUI, find it under "Yogurt Nodes/LLM". Needs the openai package and a valid API key; nothing to download.
Two caveats. The default model_name is a text-model default - confirm it's actually a vision-capable model before you count on image understanding, or you'll get an "unsupported image" error for your trouble. And remember the answer is only as good as the question: "describe this" gives you a paragraph of fluff, "list exactly three visible objects and their positions" gives you something a workflow can act on.
Inputs (22)
| Name | Type | Default | Description |
|---|---|---|---|
| api_key | STRING | API key for accessing OpenAI API | |
| base_url | STRING | Base URL for OpenAI API (leave blank for official API) | |
| model_name | STRING | gpt-5.1 | OpenAI vision model name |
| system_prompt | STRING | System-level prompt that affects the overall conversation style | |
| prompt | STRING | Question or instruction about the image | |
| temperature | FLOAT | 1.000–2 | Sampling temperature, higher values produce more random outputs |
| top_p | FLOAT | 0.000–1 | Sampling probability threshold, controls output diversity |
| max_tokens | INT | 40960–32768 | Maximum number of tokens in the generated text |
| frequency_penalty | FLOAT | 0.00-2–2 | Frequency penalty to reduce repetition |
| presence_penalty | FLOAT | 0.00-2–2 | Presence penalty to encourage new topics |
| retry_count | INT | 11–10 | Number of retry attempts if the request fails |
| chat_template | STRING | <-system-> {{system_instruction}} <-/system-> <-user-> {{prompt}} <-/user-> | Content template for the generated text |
| proxy_url | STRING | 代理URL,格式: protocol://user:pass@addr:port,支持http,https,socks5,socks5h | |
| timeout | INT | 00–2147483647 | Timeout for the request in seconds, 0 means no timeout |
| imageopt | IMAGE | — | |
| image1opt | IMAGE | — | |
| image2opt | IMAGE | — | |
| image3opt | IMAGE | — | |
| image4opt | IMAGE | — | |
| historyopt | HISTORY | — | |
| extraopt | STRING | {} | Extra parameters for the request, in JSON format |
| image_send_modeopt | COMBO | openai | 图片发送方式: openai(标准image_url对象), base64(x.ai兼容url字段) |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |
| history | HISTORY | — |
| payload | * | — |