ComfyUI Node

TK QwenVL Interrogator

Point Qwen-VL at a folder and get captions (and .txt files) out the other side

By tackcrypto1031·Created 8 months ago·Updated 6 months ago· 2
TK QwenVL Interrogator
  • image_paths
  • texts
  • filenames
model_idQwen/Qwen2.5-VL-7B-Instruct
promptDescribe this image.
max_new_tokens2048
min_pixels200704
max_pixels1003520
temperature0.70
seed0

TK QwenVL Interrogator is the workhorse of this pack: a batch vision-language captioner that reads a folder of images, writes a text description for each one, and saves a .txt file as it goes. This is the heavy end of the captioning job - if JoyCaption is the rich uncensored option and WD14 is the tag option, Qwen-VL is the general-purpose natural-language option, and this node is the most capable thing in the pack.

How it works

Feed it the image_paths LIST from TK Batch Image Loader. For each path it builds a chat message with the image plus your prompt (default "Describe this image."), runs it through the model with the Qwen chat template, and appends the generated text to the texts output. Two things worth knowing about the mechanism:

  • It saves as it goes. Each caption is written to a {imagename}.txt next to the image in whatever folder the path points at - which, if you used the batch loader, is your output_path. No separate save node needed.
  • It downloads the model itself. Pick a model from the dropdown and, if it isn't in tk_comfyui_imageVL/models yet, the node pulls it with snapshot_download and loads it with AutoModelForVision2Seq + AutoProcessor on device_map="auto".

The model dropdown lists eleven Qwen-VL builds, from Qwen2-VL-2B through Qwen2.5-VL-7B up to Qwen3-VL-236B. The 72B and 236B entries are traps on consumer hardware - you'll be downloading tens of gigabytes and then OOMing. The 2B, 3B, 4B, and 8B are the ones that fit a normal card, and they're what people actually caption with.

The inputs that matter

  • model_id - your Qwen-VL choice (default Qwen2.5-VL-7B-Instruct).
  • prompt - the instruction. "Describe this image." is fine; for training captions you'll want something more specific.
  • min_pixels / max_pixels - these bound the vision encoder's "smart resize" (defaults 200704 ≈ 448², max 1003520 ≈ 1000²). Lower max_pixels means faster, less detailed, less VRAM; raise it when fine details are being lost.
  • max_new_tokens - caption length ceiling, default 2048.
  • temperature / seed - sampling controls; seed is set via torch.manual_seed, so a fixed seed reproduces a run.

Outputs are texts (LIST) and filenames (LIST), position-matched, which the pack's TK Text Saver consumes - though that node is a no-op now (see its page), since saving is automatic.

Installation

cd ComfyUI/custom_nodes
git clone https://github.com/tackcrypto1031/tk_comfyui_imageVL.git
cd tk_comfyui_imageVL
pip install -r requirements.txt

Restart after installing, or use ComfyUI Manager and search tk_comfyui_imageVL. Requirements include transformers>=4.45.0, qwen-vl-utils, accelerate, and huggingface-hub - the node needs them to load and drive the model.

Where people get burned

  • Pick a small model. This is the big one. The dropdown happily lists 236B and 72B; if you choose them on a 24GB card, expect a long download and then a crash.
  • NSFW captions. Qwen-VL Instruct models carry the usual assistant-style refusals, so explicit content gets demurred. The community runs abliterated Qwen3-VL builds for that job, or just uses JoyCaption, which is uncensored by design.
  • Multi-subject drift. Like every VLM captioner, it mixes up who's wearing what when two people share a frame. Auto-caption the bulk, hand-audit the small sets.
  • It's a batch, not a preview. The first run downloads and loads an 8B model - that's minutes, not seconds, before the first caption lands. Cache it in VRAM by leaving the workflow warm.

If your goal is a folder of high-quality natural-language captions without an API, this is the node. Just don't touch the big dropdown entries.

CategoryTK/QwenVL

Inputs (8)

NameTypeDefaultDescription
image_pathsLIST
model_idCOMBOQwen/Qwen2.5-VL-7B-Instruct11 options: Qwen/Qwen2.5-VL-7B-Instruct, Qwen/Qwen2.5-VL-3B-Instruct, Qwen/Qwen2.5-VL-72B-Instruct, Qwen/Qwen2-VL-7B-Instruct, Qwen/Qwen2-VL-2B-Instruct, Qwen/Qwen2-VL-72B-Instruct, +5
promptSTRINGDescribe this image.
max_new_tokensINT20481–8192
min_pixelsINT2007041024–99999999
max_pixelsINT10035201024–99999999
temperatureFLOAT0.700–1
seedINT00–18446744073709550000

Outputs (2)

NameTypeDescription
textsLIST
filenamesLIST