ComfyUI Node

Ovis2.5 Run

Thinking captions with a different flavor than Qwen

By WingeD123·Created 10 months ago·Updated 4 months ago· 46
Ovis2.5 Run
  • image
  • text
  • full_output
model_path
lang中文
dtypebf16
keep_model_loadedfalse
thinkingtrue
instruction

Every caption model in this pack is a Qwen. This one isn't, and that's the point. Ovis 2.5 Run loads a completely different vision-language family - Alibaba's Ovis 2.5, from AIDC-AI/Ovis2.5-2B and -9B on Hugging Face - and runs it in ComfyUI for the same prompt-inversion job. If the Qwen nodes give you captions that all read like Qwen, Ovis is the second opinion. It's particularly known for detailed structured descriptions, which makes it a nice cross-check for tricky LoRA datasets where one model keeps missing the same detail.

It's part of WingeD123/ComfyUI_QwenVL_PromptCaption, and mechanically it's the most different node in the pack. Ovis needs remote code to run - the loader uses AutoModelForCausalLM.from_pretrained(..., trust_remote_code=True) - and it does its own preprocessing through model.preprocess_inputs() rather than the standard transformers image processor path. Translation: it works, but it's the node most likely to have sharp edges with very new or very old library versions.

How it works

Feed it an IMAGE tensor and an instruction. It passes the image to the Ovis model with thinking enabled by default - this generation likes to reason first, so the default is a slower but more considered caption. The generation runs with a 3072-token budget split between a 2048-token thinking budget and the answer, and the output is split back out for you: text is the final answer with the <think> block stripped, full_output is the entire raw generation including the reasoning trace. Being able to inspect full_output is a real feature - you can see whether a bad caption was a reasoning miss or an instruction problem.

Note what's not here: no max_side input and no unload_other_models toggle. The image goes in at whatever resolution your workflow produced, and the node doesn't clear other models out of VRAM first. On the 9B model that's a practical difference - leave room, or the load can fail.

The inputs that matter

  • image - the image to describe. Required, and unlike the Qwen caption nodes this one doesn't do text-only or video.
  • model_path - dropdown over ComfyUI/models/text_encoders. Empty until you add Ovis.
  • dtype - auto/4bit/8bit/bf16. This is the only node in the pack exposing bf16, and it's the default - a sensible choice for a 2B model, heavier on 9B.
  • thinking - default True. Turn off for faster, shallower captions.
  • lang - 中文, English, or bbox (bounding boxes, wired for this pack's StringToBbox nodes).
  • instruction - required, and it's the caption prompt itself. Ovis is more literal than Qwen about following it, so phrase it carefully.
  • keep_model_loaded - True for consecutive runs.

Outputs: text (the answer) and full_output (with thinking trace), both STRINGs.

Install and model setup

ComfyUI Manager (search "ComfyUI_QwenVL_PromptCaption") or:

cd ComfyUI/custom_nodes
git clone https://github.com/WingeD123/ComfyUI_QwenVL_PromptCaption

then restart. Dependencies: transformers>=5.2.0, accelerate, peft, bitsandbytes. Download Ovis2.5-2B or Ovis2.5-9B from Hugging Face and drop it in ComfyUI/models/text_encoders - the pack never auto-downloads, and Ovis needs its full repo structure because of the remote code.

Troubleshooting

"Failed to load model" here is usually one of two things: the model folder is incomplete (Ovis needs its remote-code files, so a partial download fails at load, not silently), or trust_remote_code is being blocked by something in your environment. The 9B in bf16 is the OOM risk - with no unload_other_models and no max_side, a full-res input on a mid card can blow up. Use 4bit or 8bit, and resize images upstream if you have to. And remember thinking on by default: if the node feels slow, that's the reasoning pass, not a hang.

Categoryimage/caption

Inputs (7)

NameTypeDefaultDescription
imageIMAGE
model_pathCOMBO0 options:
langCOMBO中文3 options: 中文, English, bbox
dtypeCOMBObf164 options: auto, 4bit, 8bit, bf16
keep_model_loadedBOOLEANfalse
thinkingBOOLEANtrue
instructionSTRING

Outputs (2)

NameTypeDescription
textSTRING
full_outputSTRING