Nodes/ComfyUI-Ovis2/Ovis2 Multi-Image Analysis
ComfyUI Node

Ovis2 Multi-Image Analysis

Ovis2 Multi-Image Analysis

By Andro-Meta·Created about a year ago·Updated about a year ago· 4
Ovis2 Multi-Image Analysis
  • model
  • image1
  • image2
  • image3
  • image4
  • response
promptAnalyze these images. What are the similarities and differences?
max_new_tokens512
temperature0.7

Single-image captioning is table stakes for a vision model. What's actually useful is asking one model to look at several images at once and compare them - and that's the entire job of Ovis2 Multi-Image Analysis (Ovis2MultiImageInput). Instead of captioning each render separately and reading the results yourself, you hand it up to four images and one question, and it answers across all of them in a single pass.

Where this earns its keep: checking whether a character LoRA stayed consistent across four renders, reviewing a style grid to see which iteration actually matches, before/after comparisons of an upscale or edit, or sanity-checking a batch of images against a brief. It's the node you reach for when the question isn't "what is this?" but "are these the same, and if not, how are they different?"

How it works

Mechanically it's the caption node with more mouths. Each IMAGE input is converted to PIL and collected into a list - required image1 plus optional image2, image3, image4 - and the whole set is passed to Ovis2's preprocess_inputs as one query, prefixed with a single <image> token. The model sees all of them together as one context, then generates its comparison. Because the images share the context window, the max_token_length you set on the loader matters more here than anywhere else in the pack: four images of vision tokens plus a long prompt can push toward the 32768 default, so don't be surprised if you need to raise it.

Inputs that matter

  • model - the OVIS2_MODEL output from Load Ovis2 Model.
  • image1 - required. image2, image3, image4 are optional, and you can use any subset; the node adapts to how many you actually feed it.
  • prompt - the default, "Analyze these images. What are the similarities and differences?", is a decent starting point, but this is the node where you'll want to write your own. A specific question ("which of these best matches the reference?") gets you a specific answer; a vague one gets you a paragraph of waffle.
  • max_new_tokens and temperature - same as the caption node: 512/0.7 defaults, lower temperature for repeatable comparisons.

Output is a single response (STRING) with the whole analysis. Wire it into a Save Text node or display it.

Installing

Same pack as everything else: ComfyUI Manager → search "Ovis2", or clone it manually:

cd ComfyUI/custom_nodes
git clone https://github.com/Andro-Meta/ComfyUI-Ovis2
pip install -r ComfyUI-Ovis2/requirements.txt

Restart, and remember the Load Ovis2 Model node has to come first - its first run downloads the model to models/ovis/, which is a multi-gigabyte wait.

Common gotchas

  • It's a fixed four slots, not a batch of N. If you have 20 images to compare, you can't feed them in as one list - you run the node multiple times or pick your four most important ones. The pack's author kept it deliberately simple; work within it.
  • Same first-image-only behavior as the caption node. If you drop a batch of frames into image1, only the first frame is actually analyzed. Feed it single images per slot.
  • More images, more context, more VRAM. Every image adds tokens and attention cost. If you hit context limits or OOM on the 8B model, drop back to two or three images or a smaller model size.
  • The shared prompt applies to all four. There's no per-image prompt, so phrase your question to reference "these images" rather than assuming the model knows which is which. With the right prompt it handles that fine; with a sloppy one it gets confused about which image it's talking about.
CategoryOvis2

Inputs (8)

NameTypeDefaultDescription
modelOVIS2_MODEL
image1IMAGE
promptSTRINGAnalyze these images. What are the similarities and differences?
max_new_tokensINT51264–2048
temperatureFLOAT0.70.1–1
image2optIMAGE
image3optIMAGE
image4optIMAGE

Outputs (1)

NameTypeDescription
responseSTRING