Nodes/Sage Utils/LLM Prompt (Vision)
ComfyUI Node

LLM Prompt (Vision)

Hand it an image, get back a prompt worth prompting with

By arcum42·Created 2 years ago·Updated 28 days ago· 33
LLM Prompt (Vision)
  • image
  • response
promptWrite a detailed description for this image. Use precise, unambiguous language. Avoid vague or general terms. This is going to be used as input for an AI image generator, so do not include anything other than the description, and do not break things into sections or use markdown.
provider
seed0

The single most useful trick in AI image work is captioning an image you like and feeding that description back into the generator. LLM Prompt (Vision) is Sage Utils' version of that: you drop an image in, an LLM looks at it, and you get a detailed text description out - one that's explicitly written to be usable as an input prompt for an image generator.

Like its text-only sibling in this pack, it's provider-agnostic. The same dropdown drives LM Studio, Ollama, OpenAI-compatible endpoints, and the fully local "Native" mode. The difference is the image input and the fact that your chosen model has to actually be vision-capable - a plain text LLM can't look at a picture, no matter how many times you ask politely.

How it works

The node sends your image plus a prompt to the selected vision provider and returns the model's response as a string. Note the default prompt - it's not casual. It reads something like: "Write a detailed description for this image. Use precise, unambiguous language… do not include anything other than the description, and do not break things into sections or use markdown." That's a deliberate, well-tuned instruction for captioning work: it tells the model to output pure description, nothing else, because you're going to paste that text into a CLIP encoder.

You can override it, of course - the field is editable. Want a stylistic caption instead? Swap the wording. But the shipped default is genuinely good for the "describe → regenerate" loop, and it's worth trying before you rewrite it.

The inputs that matter

  • image - the reference image. Any IMAGE output works, so you can caption a node's output, a loaded file, or a batch frame.
  • prompt - the instruction to the vision model (defaults to the captioning prompt above).
  • provider - backend plus its sub-settings. Model lists come from your running servers; vision-capable models are what the dropdown surfaces.
  • seed - base seed for reproducibility where the provider supports it.

Output: response, a STRING with the description.

What to do with the output

The obvious move: response → a CLIP Text Encode → your sampler. That's the "caption an image I like, regenerate in my style" pipeline, and it's the reason people install this node. The same output also feeds the pack's other prompt tooling - wire it into the prompt builder or a metadata node, or just read it in a text display to check what the model saw.

Installing

Standard Sage Utils install:

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

Restart ComfyUI (or ComfyUI Manager → "Sage Utils"). The heavy lifting is your backend: a vision model running in LM Studio or Ollama, an OpenAI-compatible endpoint with a vision model, or a GGUF vision model for Native mode.

Where people get stuck

Most vision failures here are backend failures in disguise. If your Ollama model isn't a vision model (llava, qwen2-vl, and friends are; base llama isn't), you'll get an error or an empty response. Same story for LM Studio - pick a model whose card says vision. And remember the provider scan happens when the graph loads, so start your server first or the dropdown shows "(No … vision models available)". Once the right model is loaded, this is the fastest caption-and-carry-over loop in the pack.

CategorySage Utils/LLM

Inputs (4)

NameTypeDefaultDescription
promptSTRINGWrite a detailed description for this image. Use precise, unambiguous language. Avoid vague or general terms. This is going to be used as input for an AI image generator, so do not include anything other than the description, and do not break things into sections or use markdown.The text prompt for vision-capable LLM providers.
imageIMAGEThe reference image sent to the vision provider.
providerCOMBOPick the backend provider and its model/runtime settings.
seedINT00–4294967295Base seed used by all providers (provider-specific behavior may vary).

Outputs (1)

NameTypeDescription
responseSTRINGThe text response returned by the selected vision provider.