Nodes/ComfyUI-Qwen2_5-VL/Qwen2_5_VL_Run_Advanced
ComfyUI Node

Qwen2_5_VL_Run_Advanced

Same vision question, but with a system prompt that steers the answer

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

Qwen2_5_VL_Run_Advanced is the sibling of Qwen2_5_VL_Run with exactly one extra input: system_text. Everything else - the model, the optional image/video/BatchImage inputs, the pixel controls, the decode method, the seed, the text output - is identical. So the honest way to read it is not "a different node" but "the same node with a persona dial." If you're only ever asking one-off questions ("what's in this picture?"), use the plain Run node and save yourself the input. If you're building a workflow that runs over and over, Advanced is where you set the ground rules once.

What the extra input buys you

A system prompt is the instructions the model follows before it ever sees your actual question. In a ComfyUI graph it's a static string you write once and never touch again, which is exactly what makes it useful: it lets you bake a fixed behavior into a reusable workflow instead of repeating it inside every text prompt.

A few things people actually do with it:

  • "You are an expert prompt engineer. Turn the given image into a detailed Stable Diffusion prompt."
  • "Describe only the subject, clothing, and pose. Ignore the background and lighting."
  • "Answer in under 50 words." - paired with a lower max_new_tokens for speed.
  • "You are a strict NSFW/CSAM content checker. Reply with APPROVED or REJECTED only."

That last one points at the interesting use case: Qwen2.5-VL is a capable zero-shot content filter, and a system prompt that constrains the output format turns a verbose model into a binary decision you can branch a graph on. System prompts are also where you set the tone for captioning pipelines - e.g. a tag-style output that feeds straight into a Tagger-like workflow rather than prose.

The mechanism is straightforward under the hood: the node builds {"role": "system", "content": system_text} plus the user message with your text and media, applies the chat template, and generates. If system_text is empty it still gets passed as an empty system message, which is marginally worse than not sending one at all - so leave it blank only if you genuinely have nothing to say, and prefer the plain Run node in that case.

Inputs, outputs, and the shared install

All the same inputs as Qwen2_5_VL_Run apply: text (your question), max_new_tokens (default 128, raise it for long answers), the min_pixels/max_pixels/total_pixels resolution throttles (leave at defaults), video_decode_method (default torchvision; decord is the actually-installed alternative via the pack's requirements), and seed. Output is a single text STRING that goes to a Show Text node or straight into another node that consumes strings.

Installation is the pack's, shared: ComfyUI Manager search for "ComfyUI-Qwen2_5-VL", or git clone https://github.com/MakkiShizu/ComfyUI-Qwen2_5-VL into custom_nodes, then pip install -r requirements.txt with transformers>=4.49.0. Worth knowing: this node exists but the README's node list only mentions three of the four in the pack - the Advanced variant is the one that got left off the docs, so don't be confused when Manager installs the pack and you see four nodes instead of three.

Where people get burned

Because the two Run nodes share their brain, the failure modes carry over: small/quantized models hallucinate, and max_new_tokens too low truncates mid-answer. One extra trap is specific to Advanced - a system prompt that contradicts your text ("answer in one word" in the system prompt, then a question that can't be answered in one word) makes the model visibly squirm. Keep the system prompt a constraint on how to answer, not a second question, and you'll be fine.

CategoryQwen2_5-VL

Inputs (12)

NameTypeDefaultDescription
system_textSTRING
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