Nodes/ComfyUI_QwenVL_PromptCaption/Qwen2.5 VL Batch Caption
ComfyUI Node

Qwen2.5 VL Batch Caption

Qwen2.5 batch captioning with the model you probably already downloaded

By WingeD123·Created 10 months ago·Updated 4 months ago· 46
Qwen2.5 VL Batch Caption
    • summary
    model_path
    lang中文
    dtype4bit
    keep_model_loadedfalse
    max_side532
    image_path
    save_path
    instruction

    Folder captioning for your LoRA dataset, but with the Qwen generation that most people already own. Qwen2.5 VL Batch Caption does exactly what Qwen3CaptionBatch does - point at a folder, get a .txt caption next to every image - except it runs Qwen2.5-VL instead of Qwen3-VL. And here's the kicker: if you use ComfyUI's own Qwen Image/Edit model, you already have qwen_2.5_vl_7b.safetensors sitting in ComfyUI/models/text_encoders, which is the exact file this node wants. That's the pack's best onboarding story and the reason this node got its own page.

    It's part of the WingeD123/ComfyUI_QwenVL_PromptCaption pack, which is built around one principle: the models live in text_encoders, the pack never downloads anything, and you reuse what's already on disk.

    How it works

    Mechanically it's the same batch pipeline as the Qwen3 version: scan image_path for common image formats, resize each one to max_side, run the vision-language model with a prompt-engineering instruction, write basename.txt beside each source file, and return a summary count string. There's a result cache keyed on the image's content hash, so re-runs skip finished images. One nice touch for real-world datasets: it applies exif_transpose before captioning, so phone photos with rotation flags come out captioned correctly instead of sideways.

    The Qwen2.5-VL model it loads uses a slightly different input convention than Qwen3 - the code respects the 28-pixel tile factor, which is why max_side here defaults to 532 (28 × 19) and steps in 28s, not 32s like the Qwen3 nodes. It's a small detail, but it's why this node exists as a separate class instead of sharing code with its newer sibling.

    The inputs that matter

    • image_path - the source folder. Required.
    • save_path - optional; empty means captions are written next to the images.
    • instruction - override the default caption style. For training data you'll want to write your own ("a prompt engineer's detailed description, comma-separated, trigger word first") because the built-in prompts are tuned for prompt inversion, not dataset labeling.
    • lang - 中文 or English.
    • dtype - auto/4bit/8bit, default 4bit. On the 7B model, 4bit runs comfortably on 6-8GB cards.
    • keep_model_loaded - False is fine for batches; the node keeps the model alive until the folder is done regardless.
    • max_side - long-edge pre-scale. 532 is a reasonable default; lowering it speeds up runs on slow cards.

    Output: a summary STRING reporting how many images were captioned.

    Install and model setup

    ComfyUI Manager (search "ComfyUI_QwenVL_PromptCaption") or the manual route:

    cd ComfyUI/custom_nodes
    git clone https://github.com/WingeD123/ComfyUI_QwenVL_PromptCaption
    

    then restart ComfyUI. Dependencies: transformers>=5.2.0, accelerate, peft, bitsandbytes. For the model, the README's reuse recipe is the whole point of this node: create a subfolder in ComfyUI/models/text_encoders, rename qwen_2.5_vl_7b.safetensors to model.safetensors inside it, and add the config files from Qwen2.5-VL-7B-Instruct on Hugging Face. No extra disk, and the original model still works for ComfyUI's Qwen Image/Edit. Alternatively drop the full official HF repo folder in and call it a day.

    Troubleshooting

    The 0 image captioned summary means the folder path was wrong or empty of supported files. A "Failed to load model" return usually means the text_encoders subfolder is missing the config files (config.json, tokenizer files, preprocessor_config.json) - that's the step everyone skips. And because this is the older generation, one honest caveat: Qwen2.5-VL's captions are a step below Qwen3-VL's for fine detail like small text and complex scenes. If your training set is hard to caption well, try the Qwen3 nodes first. If you just want something that works today with a model you already have, this is the node.

    Categoryimage/caption

    Inputs (8)

    NameTypeDefaultDescription
    model_pathCOMBO0 options:
    langCOMBO中文2 options: 中文, English
    dtypeCOMBO4bit3 options: auto, 4bit, 8bit
    keep_model_loadedBOOLEANfalse
    max_sideINT532252–2240
    image_pathSTRING
    save_pathoptSTRING
    instructionoptSTRING

    Outputs (1)

    NameTypeDescription
    summarySTRING