LLM Prompt (Vision) Refined
Caption it, then make the caption prettier — in one node
- image
- initial_response
- refined_response
Plain vision captioning gets you a description. This node gets you a description and a better version of that description, in one run. LLM Prompt (Vision) Refined is the two-pass version of Sage's vision node: first pass looks at the image and writes a faithful caption, second pass takes that caption and rewrites it to be more vivid, detailed, and engaging - while the model is told to preserve the original meaning.
Why two passes? Because asking one LLM to both "describe what's in this image accurately" and "make it sound amazing" in a single response usually gets you a compromise that does neither well. Split the jobs and each pass can do its thing properly. It's a small architectural decision that makes the output noticeably better for actual prompt use.
How it works
You feed in an image and a prompt (the initial description instruction - defaults to the same careful "precise, unambiguous language, no markdown" captioning prompt the non-refined node uses). The node runs the vision pass, then hands the result to a second generation with refine_prompt (default: "rewrite it to be more vivid, detailed, and engaging, while preserving the original meaning").
The two passes have separate seeds - seed for the initial pass and refine_seed for the refinement - so you can reproduce or vary each stage independently. Both outputs come back: initial_response (the straight caption) and refined_response (the polished one). The provider dropdown covers the usual Sage suspects - LM Studio, Ollama, OpenAI-compatible, and Native - and for several of them you can even pick a separate model for the refine pass, so a big chatty model can do the rewriting while a faster one handles the initial look.
The inputs that matter
image- what the vision pass looks at.prompt- the initial captioning instruction.refine_prompt- what the second pass does to the caption. This is the one worth customizing: "make it more vivid" is a decent default, but you can ask for a specific style, shorter sentences, or keywords included.seed/refine_seed- independent seeds for the two passes.provider- backend and per-provider model/settings.
Outputs: initial_response and refined_response, both STRING. Wire refined_response into your CLIP Text Encode; keep initial_response around if you ever want the unvarnished version for comparison.
When it's worth the extra pass
The two-pass version shines when you're captioning for reuse - building a prompt library from images you like, or feeding descriptions into a prompt builder. The refinement pass tends to produce language that makes a diffusion model happier: more concrete detail, better grounding, fewer vague words. If you just need a quick literal caption, the single-pass node is faster and cheaper; this one is for when the description is going to do something.
Installing
Same as every Sage Utils node:
cd ComfyUI/custom_nodes
git clone https://github.com/arcum42/ComfyUI_SageUtils.git
cd ComfyUI_SageUtils && pip install -r requirements.txt
Restart ComfyUI, or grab "Sage Utils" via ComfyUI Manager. Backend requirements mirror the other LLM nodes: a running vision-capable model in LM Studio or Ollama, an OpenAI-compatible vision endpoint, or a GGUF vision model for Native mode.
The honest trade-off
It's two model calls per run instead of one, so it's slower and uses more tokens - with a local model that's a few extra seconds; with a paid API, a bit more spend. And the refinement pass can drift if your refine_prompt is loose, so if the polished output starts inventing detail the image never had, tighten the instruction. But for caption-to-prompt pipelines, the extra pass is usually the difference between "fine" and "worth regenerating from."
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | Write 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 the initial vision generation pass. |
| image | IMAGE | The reference image sent to the vision provider. | |
| seed | INT | 00–4294967295 | Seed for the initial generation pass. |
| refine_prompt | STRING | Take the provided text description and rewrite it to be more vivid, detailed, and engaging, while preserving the original meaning. | Instructions used for the second (refinement) pass. |
| refine_seed | INT | 00–4294967295 | Seed for the refinement pass. |
| provider | COMBO | Pick the backend provider and its model/runtime settings. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| initial_response | STRING | The initial response generated by the vision provider. |
| refined_response | STRING | The refined response generated during the second pass. |