🍭大炮-Qwen3VL@炮老师的小课堂
The flagship node of 大炮-Qwen3VL
- 🖼️ 图像1
- 🖼️ 图像2
- 🖼️ 图像3
- 🖼️ 图像4
- 🎥 视频
- 🎯 Qwen3VL额外选项
- 文本输出
You want Alibaba's Qwen3-VL reading your images locally, inside the graph, and you don't want to babysit a second program or pay for an API call. This node is that. Qwen3VL_Advanced is the flagship of the 大炮-Qwen3VL pack (from "炮老师的小课堂", a Chinese community author) - one node that reverse-prompts single or multiple images, understands a video as a frame sequence, and hands you a ready-to-use text prompt. The name is not a lie: it runs the model on your own GPU, needs no key, and makes no network calls after the weights are downloaded.
It's a "VLM as a tool in the graph" - bolted onto your workflow rather than part of a diffusion checkpoint. Reach for it to feed a generated image back into a prompt, build captions for a LoRA dataset, or turn a reference image into a structured txt2img prompt for a Qwen3-class encoder. The community pattern is to chain it - VLM describes, LLM rewrites, sampler generates - because two tightly-scoped steps drift less than one open-ended one.
How it works
Under the hood it's plain transformers: AutoModelForImageTextToText plus the Qwen processor and tokenizer, with bitsandbytes handling the 4-bit/8-bit quantization if you ask for it. On first run the node checks ComfyUI/models/prompt_generator/, and if the model isn't there it downloads it - from Hugging Face for the official Qwen models, from ModelScope for the two community (abliterated) ones, which need modelscope installed. The default Qwen3-VL-4B-Instruct runs in about 6GB of VRAM at full precision, ~3.5GB in 8-bit, ~2GB in 4-bit, so it fits a consumer card.
Two design choices are worth knowing. The "保持模型加载" (keep model loaded) toggle defaults to off - the model unloads and frees VRAM after every run, so a caption node doesn't squat on your card between generations. And a seed system (random / fixed / increment) is wired through IS_CHANGED so random mode reruns every time instead of getting cached. That's deliberate, but it's also one reason a workflow with this node re-executes more than you'd expect.
The inputs that matter
- 🤖 模型选择 - 20 options across Qwen3-VL 2B/4B/8B/32B (Instruct and Thinking variants plus FP8), Qwen2.5-VL for backwards compat, and two Huihui abliterated models. Start at 4B.
- ⚙️ 量化级别 -
None (FP16)/8-bit/4-bit. The VRAM numbers above tell you which one your card wants. - 🖼️ 最大长边 (default 768) - images are downscaled so the long edge fits this before hitting the vision encoder. This is your OOM lever: big images cause a VRAM spike, and 768 keeps it tame.
- 💭 预设提示词 - five captioning personalities: tag list, simple, detailed, ultra-detailed, cinematic. These become the model's instruction, so pick by what your downstream base wants. ✏️ 自定义提示词 overrides them.
- 🔢 最大令牌数, 🌡️ 采样温度, 🎯 核采样参数, 🔍 束搜索数量, 🚫 重复惩罚 - generation dials. Leave them unless output gets short, rambly, or repetitive.
- 🎬 视频帧数 - how many evenly-spaced frames get sampled from the video input (1–64).
- 🎲 随机种子 + 🎯 种子控制, 🚀 开启TF32加速 (Ampere+ only, notably faster), 🔄 保持模型加载, 🧪 性能诊断 (prints an environment and inference report to the console).
Optional inputs: 🖼️ 图像1–图像4 (wire up to four images for comparison) and 🎥 视频 (an IMAGE batch of frames), plus a 🎯 Qwen3VL额外选项 socket for the pack's option node.
The single output, 文本输出, is a STRING - wire it into a CLIP text encode, a prompt node, a save-text node, or anything that eats text. That's the whole loop.
Installing
ComfyUI Manager is the easy path - search for ComfyUI-Qwen3VL-DP. Otherwise:
cd ComfyUI/custom_nodes
git clone https://github.com/paolaoshi/ComfyUI-Qwen3VL-DP
cd ComfyUI-Qwen3VL-DP
pip install -r requirements.txt
Then restart ComfyUI. The dependency that bites: transformers >= 4.57.0. Qwen3-VL's architecture wasn't in older transformers; the classic symptom is model type 'qwen3_vl' but Transformers does not recognize this architecture. Upgrade and it goes away. The FP8 model variants also hard-require a GPU at compute capability 8.9 or higher (a 4090-class card); on anything older the node raises an error, so just pick a non-FP8 entry.
First run downloads several GB - the 4B weights are ~8GB on disk - so be patient and watch the console. If you already have a Qwen3-VL snapshot, dropping it into ComfyUI/models/prompt_generator/Qwen3-VL-4B-Instruct/ skips the download.
One honest caveat before you trust any VLM node with your machine: this category was weaponized once (the ComfyUI_LLMVISION malware), and this pack is small and Chinese-language-first. Glance at the code before your first run - it's short and readable. Fine to use; just don't install blind.
Inputs (24)
| Name | Type | Default | Description |
|---|---|---|---|
| 🤖 模型选择 | COMBO | Qwen3-VL-4B-Instruct | 20 options: Qwen3-VL-2B-Instruct, Qwen3-VL-2B-Thinking, Qwen3-VL-2B-Instruct-FP8, Qwen3-VL-2B-Thinking-FP8, Qwen3-VL-4B-Instruct, Qwen3-VL-4B-Thinking, +14 |
| ⚙️ 量化级别 | COMBO | None (FP16) | 3 options: 4-bit (节省显存), 8-bit (平衡), None (FP16) |
| 🧠 注意力模式 | COMBO | SDPA | 2 options: SDPA, Flash Attention 2 |
| 🖼️ 最大长边 | INT | 768256–2048 | — |
| 💭 预设提示词 | COMBO | 提示词风格 - 详细 | 5 options: 提示词风格 - 标签, 提示词风格 - 简单, 提示词风格 - 详细, 提示词风格 - 极致详细, 提示词风格 - 电影感 |
| ✏️ 自定义提示词 | STRING | — | |
| 🔢 最大令牌数 | INT | 102464–4096 | — |
| 🌡️ 采样温度 | FLOAT | 0.60.1–1 | — |
| 🎯 核采样参数 | FLOAT | 0.900–1 | — |
| 🔍 束搜索数量 | INT | 11–10 | — |
| 🚫 重复惩罚 | FLOAT | 1.200–2 | — |
| 🎬 视频帧数 | INT | 161–64 | — |
| 💻 设备选择 | COMBO | auto | 4 options: auto, cuda, cpu, mps |
| 🚀 开启TF32加速 | BOOLEAN | false | 启用TF32加速(仅支持Ampere及以上架构显卡,如30/40/50系,能显著提升速度) |
| 🔄 保持模型加载 | BOOLEAN | false | — |
| 🧪 性能诊断 | BOOLEAN | false | 打印一次关键环境与推理信息(用于排查慢速问题) |
| 🎲 随机种子 | INT | -1-1–18446744073709550000 | 随机种子,-1为随机 |
| 🎯 种子控制 | COMBO | 随机 | 3 options: 随机, 固定, 递增 |
| 🖼️ 图像1opt | IMAGE | — | |
| 🖼️ 图像2opt | IMAGE | — | |
| 🖼️ 图像3opt | IMAGE | — | |
| 🖼️ 图像4opt | IMAGE | — | |
| 🎥 视频opt | IMAGE | — | |
| 🎯 Qwen3VL额外选项opt | QWEN3VL_EXTRA_OPTIONS | 可选的Qwen3VL额外选项,连接Qwen3VL额外选项节点 |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| 文本输出 | STRING | — |