ComfyUI Node

Qwen3 VQA

Run a local vision model to caption and question images or video

By IuvenisSapiens·Created 2 years ago·Updated 10 months ago· 572
Qwen3 VQA
  • source_path
  • image
  • STRING
text
modelQwen3-VL-4B-Instruct-FP8
quantizationnone
keep_model_loadedfalse
temperature0.7
max_new_tokens2048
min_pixels200704
max_pixels1003520
seed-1
attention

Point it at an image and a question, get text back. That's the whole job. "Describe this photo," "what color is the car," "write me a detailed caption for LoRA training" - you type the ask into text, wire in an image, and the node hands you a string with the answer. VQA stands for Visual Question Answering, and this is the one node in the pack that does the actual thinking; the video loaders just feed it.

Under the hood it's Alibaba's Qwen3-VL, a vision-language model, running locally on your GPU. No API, no key, nothing phones home despite the "Instruct" branding sounding cloud-ish. If you've used JoyCaption or Florence-2 to caption a training set, this scratches the same itch - a VLM that looks at an image and writes about it - except Qwen3-VL is a newer, strong general model that takes free-form instructions instead of just spitting one fixed caption style. That flexibility is the point: ask it to tag, to describe in a line, to answer a specific question, or to reason step by step.

How it works

A vision-language model chops your image into visual tokens, glues them onto your text prompt, and runs the lot through a language model trained to describe and reason about what it sees. The min_pixels / max_pixels pair (defaults 200704 and 1003520, roughly a 1MP ceiling) is the resolution budget: the node resizes your image to land in that window before tokenizing. More pixels means finer detail but more VRAM and time - bump max_pixels when it's missing small text, drop it when memory's tight.

The model dropdown is where the real choice lives. You get 4B and 8B sizes, each in Instruct (answers directly) or Thinking (reasons out loud first, better for hard questions, more tokens), and each of those in a smaller FP8 build or the full-precision one. The default Qwen3-VL-4B-Instruct-FP8 is the right starting point and honestly the one most people should stay on - more on that below.

The inputs that matter

  • text - your question or instruction. This is the prompt. "Caption this image in one detailed paragraph" behaves very differently from "list the objects as tags," so it's worth being specific.
  • model - size and flavor. Start at Qwen3-VL-4B-Instruct-FP8. Reach for 8B or Thinking only when the 4B answers aren't good enough and you've got the VRAM.
  • image (optional) - a standard IMAGE input from Load Image. Leave it empty and the node works as a plain text chat; wire it in for single- or multi-image captioning.
  • source_path (optional) - a PATH, which is what the pack's video loaders output. This is how you caption video instead of a still.
  • quantization - none / 4bit / 8bit. Squeezes the loaded model with bitsandbytes to save VRAM. Note it's not the GGUF path - this node doesn't load GGUF files, so a tiny quant on a 6GB card is a different toolchain.

temperature (0–1, default 0.7) controls randomness - drop it toward 0 for repeatable, literal captions. max_new_tokens caps the answer length. keep_model_loaded keeps the weights in VRAM between runs so you're not paying the reload every queue; handy if you're captioning a batch, wasteful if this is a one-off in a heavy image workflow. The single output is a STRING - pipe it into a Display Text node to read it, or straight into a text encoder / save node.

Install

ComfyUI Manager → search Qwen3 → install → restart. Or cd ComfyUI/custom_nodes && git clone https://github.com/IuvenisSapiens/ComfyUI_Qwen3-VL-Instruct, then pip install -r requirements.txt and restart. The models aren't bundled - they download on first run into ComfyUI/models/prompt_generator/, a multi-gigabyte wait for the 8B builds, so don't panic when that first queue sits there.

One gotcha from the README: to actually see the output you want a Display Text node, and this pack doesn't ship one. Grab it from the same author's ComfyUI_MiniCPM-V-4_5 pack, or wire the string into any other text-display node you already have.

Common issues

The big one is picking a model your card can't feed. The 4B Instruct FP8 runs fine on a 16GB GPU; step up to 8B and people on 16GB report it fitting but choking, especially on long video, and jumping to the 30B/32B tiers freezes ComfyUI outright. If your workflow hangs the moment you switch models, that's the cause - go back to 4B, or add 4bit/8bit quantization to buy headroom.

The attention dropdown is the other trap. flash_attention_2 is fast but needs the flash-attn package compiled, which is famously fiddly - if you didn't set that up, it errors on load. Use sdpa (PyTorch's built-in) unless you know flash-attn works. And Thinking models spend hundreds of tokens reasoning before answering; if captions come back rambling, switch to an Instruct build or lower max_new_tokens.

CategoryComfyui_Qwen3-VL-Instruct

Inputs (12)

NameTypeDefaultDescription
textSTRING
modelCOMBOQwen3-VL-4B-Instruct-FP88 options: Qwen3-VL-4B-Instruct-FP8, Qwen3-VL-4B-Thinking-FP8, Qwen3-VL-8B-Instruct-FP8, Qwen3-VL-8B-Thinking-FP8, Qwen3-VL-4B-Instruct, Qwen3-VL-4B-Thinking, +2
quantizationCOMBOnone3 options: none, 4bit, 8bit
keep_model_loadedBOOLEANfalse
temperatureFLOAT0.70–1
max_new_tokensINT2048128–256000
min_pixelsINT2007043136–12845056
max_pixelsINT10035203136–12845056
seedINT-1
attentionCOMBO3 options: eager, sdpa, flash_attention_2
source_pathoptPATH
imageoptIMAGE

Outputs (1)

NameTypeDescription
STRINGSTRING