Nodes/ComfyUI-Qwen2_5-VL/Qwen2_5_VL_Run
ComfyUI Node

Qwen2_5_VL_Run

Ask a vision model about your image or video, inside the graph

By MakkiShizu·Created about a year ago·Updated 11 months ago· 20
Qwen2_5_VL_Run
  • Qwen2_5_VL_model
  • image
  • video
  • BatchImage
  • text
text
video_decode_methodtorchvision
max_new_tokens128
min_pixels256
max_pixels1280
total_pixels20480
seed1

Qwen2_5_VL_Run is the workhorse of the ComfyUI-Qwen2_5-VL pack: the node where your image, video, or batch of images actually meets the model and gets an answer back as text. This is the "does it see" half of the ecosystem Alibaba's Qwen team has been building out - the same family that powers Qwen-Image's instruction editing reads a picture and tells you what's in it. In a ComfyUI graph that means things like: feed a rendered frame in and ask "what is this character wearing," hand it a video and have it describe the scene for a prompt, or use it as a local replacement for sending screenshots to a cloud API. The name is a small lie in one direction worth knowing: it calls no API and needs no key. Everything runs on the model you loaded in DownloadAndLoadQwen2_5_VLModel.

How it works

This is where the pack's differentiator lives. Most Qwen-VL ComfyUI packs make you point at a file path; this one accepts ComfyUI's native IMAGE, VIDEO, and BatchImage types straight off the wire. Internally it still has to give the model something it can chew on, so it dumps whatever you connected into temporary PNG/MP4 files in ComfyUI's temp directory, builds a chat message out of them plus your text, and runs processor.generate(...). The seed input matters because generation is sampling - same inputs, different seed, slightly different wording.

The two controls worth actually setting for beginners:

  • text - your instruction. "Describe this image in detail," "What's the style of this art?," "Write a prompt that would generate this scene." Multiline, so whole paragraphs are fine. Leave it empty and the model still describes what it sees, but you'll get much more useful output if you ask for something specific.
  • max_new_tokens - how long the answer can be, 1–1024, default 128. Short captions are fine at the default; anything that needs reasoning or detailed descriptions will get cut off, so raise it when the answer truncates mid-sentence.

Optional inputs image, video, and BatchImage accept one or more of each; the author notes that mixing all three in one prompt makes the video get treated as a single image (its first frame), which matches what the official Qwen chat does. The output is a single text string - wire it into a Show Text node to read it, or into anything that consumes a STRING, like a prompt-extension workflow that feeds the description straight into your sampler.

The pixel controls (leave them alone until something breaks)

min_pixels, max_pixels, and total_pixels are the model's resolution throttles, and they're the values that keep a video from blowing up your VRAM. Images get resized to keep their aspect ratio between min_pixels and max_pixels (256 and 1280 by default). total_pixels caps the token budget of a whole video - the README-style guidance in the tooltip says keep it below 24576 * 28 * 28 tokens to avoid absurdly long input sequences. The defaults are fine for almost everything; if a video runs out of memory, drop total_pixels before you blame the model.

video_decode_method (default torchvision) picks the library used to decode video frames: decord and torchcodec are the alternatives, and each is an optional dependency you'd have to install yourself (qwen-vl-utils[decord] is in the pack's requirements, so decord is the one that's actually available out of the box).

Installing and the usual friction

Install is shared across the pack: search "ComfyUI-Qwen2_5-VL" in ComfyUI Manager, or git clone https://github.com/MakkiShizu/ComfyUI-Qwen2_5-VL into custom_nodes and pip install -r requirements.txt (transformers>=4.49.0 is the floor). Expect the first run to spend a while downloading the model before this node does anything.

Two failure modes to know before you hit them. First, the model decides the quality, not you: a 3B at 4-bit quantization will confidently hallucinate details, so garbage-in-garbage-out is usually a model-size problem, not a prompt problem. Second, if the node errors on video, it's almost always the decode method - switch video_decode_method to decord and make sure the decord package actually imported at startup.

CategoryQwen2_5-VL

Inputs (11)

NameTypeDefaultDescription
textSTRING
Qwen2_5_VL_modelQWEN2_5_VL_MODEL
video_decode_methodCOMBOtorchvision3 options: torchvision, decord, torchcodec
max_new_tokensINT1281–1024
min_pixelsINT25664–1280Define min_pixels and max_pixels: Images will be resized to maintain their aspect ratio within the range of min_pixels and max_pixels.
max_pixelsINT128064–2048Define min_pixels and max_pixels: Images will be resized to maintain their aspect ratio within the range of min_pixels and max_pixels.
total_pixelsINT204801–24576We recommend setting appropriate values for the min_pixels and max_pixels parameters based on available GPU memory and the specific application scenario to restrict the resolution of individual frames in the video. Alternatively, you can use the total_pixels parameter to limit the total number of tokens in the video (it is recommended to set this value below 24576 * 28 * 28 to avoid excessively long input sequences). For more details on parameter usage and processing logic, please refer to the fetch_video function in qwen_vl_utils/vision_process.py.
seedINT11–18446744073709550000
imageoptIMAGE
videooptVIDEO
BatchImageoptBatchImage

Outputs (1)

NameTypeDescription
textSTRING