Nodes/ComfyUI-YogurtNodes/OpenRouter Image Understand
ComfyUI Node

OpenRouter Image Understand

One API key, every vision model — this node shops for you

By yogurt7771·Created 2 years ago·Updated 4 days ago· 1
OpenRouter Image Understand
  • image
  • image1
  • image2
  • image3
  • image4
  • history
  • text
  • history
  • payload
api_key
model_nameanthropic/claude-3.5-sonnet
infrastructure_providerauto
system_prompt
prompt
temperature1.00
top_p0.00
max_tokens8192
retry_count1
chat_template<-system-> {{system_instruction}} <-/system-> <-user-> {{prompt}} <-/user->
provider_list
proxy_url
seed-1
timeout0
extra{}

OpenRouter's whole pitch is "stop making accounts." One API key, one billing relationship, and you can call Claude, GPT, Gemini, and a hundred other models through the same endpoint - swap the model name, keep everything else. Yogurt OpenRouter Image Understand is that idea as a ComfyUI node: feed it an image (or five), tell it what to look at, and it returns the model's verdict as text. If you do any captioning, tagging, or "describe this reference image so I can prompt from it" work, this is the node that makes it a one-block step instead of a Python detour.

How it works

The node takes your image tensors, encodes them to base64, and sends a standard multimodal chat request to OpenRouter with the vision model you pick. It's a client, not a local model - no weights, no VRAM, just an HTTP call, which is exactly why it's useful in the middle of a generation graph: you can caption a candidate image and feed the caption straight into a prompt-building node in the same run.

The default model_name is anthropic/claude-3.5-sonnet, which is fine, but the point of OpenRouter is that this field is a menu. Want cheap batch captioning? Point it at a fast flash-tier model. Need meticulous detail? Claude or a strong Gemini variant. The node's payload output also gives you the raw response object, so you can inspect exactly what the API sent back instead of guessing.

Inputs worth knowing

  • api_key - paste an OpenRouter key (get one at openrouter.ai/keys), or leave it blank if you've set up the config file / OPENROUTER_API_KEY env var. The README's priority order is node field, then api_key.json, then env var.
  • model_name - OpenRouter model IDs are slash-qualified (provider/model). Anything with vision support works.
  • image, image1, image2, image3, image4 - up to five images, which is more than most standalone vision nodes give you. Multi-image input is where this node actually shines: hand it a character sheet of references and ask for a single consistent description, or a before/after pair and ask what changed.
  • system_prompt and prompt - same split as everywhere: style vs. request. The system prompt is where you'd say "you are an expert image analyst."
  • temperature - default 1; lower it for deterministic tagging.
  • max_tokens - default 8192, which is plenty for a description but worth capping if you're doing thousands of calls.

There's also infrastructure_provider (auto/azure/aws routing), provider_list (a comma-separated override like openai,azure,together to force specific providers), seed, proxy_url, timeout, retry_count, chat_template, and an extra JSON field.

Outputs

  • text - the description/answer (STRING). Wire this into a Save Text node, a prompt builder, or a conditional.
  • history - updated conversation for multi-turn, loops back into the history input.
  • payload - the raw API response (any type), for when you want the structured data instead of just the text.

Install and setup

Same pack, same story: ComfyUI Manager, search "ComfyUI-YogurtNodes", or:

cd ComfyUI/custom_nodes
git clone https://github.com/yogurt7771/ComfyUI-YogurtNodes.git
cd ComfyUI-YogurtNodes && pip install -r requirements.txt

Then restart ComfyUI. The OpenAI/OpenRouter nodes need the openai package, which the requirements file installs. For the key, the cleanest setup is custom_nodes/ComfyUI-YogurtNodes/yogurt_nodes/llm/api_key.json:

{ "openrouter": "YOUR_API_KEY" }

Where people get burned

Two real failure modes. First, a blank api_key field only works if the file or env var is present - the field is required, and if nothing is configured you get an auth error, not a graceful hint. Second, OpenRouter model IDs change: claude-3.5-sonnet was the default this node shipped with, but model availability shifts and the exact slug you saved in a workflow can 404 later. If you suddenly get "model not found" errors on an old workflow, the model name is the first thing to check. And remember - this sends your images to a third-party API. For proprietary reference material, a local vision node is the more private option, but for everyday captioning this is hard to beat.

CategoryYogurtNodes/LLM

Inputs (21)

NameTypeDefaultDescription
api_keySTRINGAPI key for accessing OpenRouter API
model_nameSTRINGanthropic/claude-3.5-sonnetOpenRouter vision model name
infrastructure_providerCOMBOautoInfrastructure provider (auto, azure, aws, etc.) - Optional
system_promptSTRINGSystem-level prompt that affects the overall conversation style
promptSTRINGMain prompt content input by the user
temperatureFLOAT1.000–2Sampling temperature, higher values produce more random outputs
top_pFLOAT0.000–1Sampling probability threshold, controls output diversity
max_tokensINT81920–32768Maximum number of tokens in the generated text
retry_countINT11–10Number of retries when request fails
chat_templateSTRING<-system-> {{system_instruction}} <-/system-> <-user-> {{prompt}} <-/user->Content template for the generated text
provider_listSTRINGProvider list (comma separated, e.g: 'openai,azure,together'), empty means use infrastructure_provider
proxy_urlSTRING代理URL,格式: protocol://user:pass@addr:port,支持http,https,socks5,socks5h
seedINT-1-1–2147483647Random seed for generation (-1 for random)
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

Outputs (3)

NameTypeDescription
textSTRING
historyHISTORY
payload*