Nodes/ComfyUI-YogurtNodes/OpenAI Image Understand
ComfyUI Node

OpenAI Image Understand

Ask a Vision Model About Your Image, In-Graph

By yogurt7771·Created 2 years ago·Updated 4 days ago· 1
OpenAI Image Understand
  • image
  • image1
  • image2
  • image3
  • image4
  • history
  • text
  • history
  • payload
api_key
base_url
model_namegpt-5.1
system_prompt
prompt
temperature1.00
top_p0.00
max_tokens4096
frequency_penalty0.00
presence_penalty0.00
retry_count1
chat_template<-system-> {{system_instruction}} <-/system-> <-user-> {{prompt}} <-/user->
proxy_url
timeout0
extra{}
image_send_modeopenai

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 to api_key.json / OPENAI_API_KEY.
  • model_name - defaults to gpt-5.1, called as a vision model.
  • system_prompt and prompt - 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 image1image4 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:

  1. Captioning loops. Generate → caption → feed the caption into your next prompt. Self-improving iterations without you in the middle.
  2. Quality gates. Ask "does this image match the prompt: <prompt>?" and branch on the answer. Auto-reroll until the model says yes.
  3. 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.

CategoryYogurtNodes/LLM

Inputs (22)

NameTypeDefaultDescription
api_keySTRINGAPI key for accessing OpenAI API
base_urlSTRINGBase URL for OpenAI API (leave blank for official API)
model_nameSTRINGgpt-5.1OpenAI vision model name
system_promptSTRINGSystem-level prompt that affects the overall conversation style
promptSTRINGQuestion or instruction about the image
temperatureFLOAT1.000–2Sampling temperature, higher values produce more random outputs
top_pFLOAT0.000–1Sampling probability threshold, controls output diversity
max_tokensINT40960–32768Maximum number of tokens in the generated text
frequency_penaltyFLOAT0.00-2–2Frequency penalty to reduce repetition
presence_penaltyFLOAT0.00-2–2Presence penalty to encourage new topics
retry_countINT11–10Number of retry attempts if the request fails
chat_templateSTRING<-system-> {{system_instruction}} <-/system-> <-user-> {{prompt}} <-/user->Content template for the generated text
proxy_urlSTRING代理URL,格式: protocol://user:pass@addr:port,支持http,https,socks5,socks5h
timeoutINT00–2147483647Timeout for the request in seconds, 0 means no timeout
imageoptIMAGE
image1optIMAGE
image2optIMAGE
image3optIMAGE
image4optIMAGE
historyoptHISTORY
extraoptSTRING{}Extra parameters for the request, in JSON format
image_send_modeoptCOMBOopenai图片发送方式: openai(标准image_url对象), base64(x.ai兼容url字段)

Outputs (3)

NameTypeDescription
textSTRING
historyHISTORY
payload*