Nodes/CaptionForge/ JLC CaptionForge Qwen Caption
ComfyUI Node

 JLC CaptionForge Qwen Caption

Qwen captioning from Hugging Face

By Damkohler·Created 3 months ago·Updated 2 months ago· 1
 JLC CaptionForge Qwen Caption
  • image
  • pipeline_plan
  • template_options
  • image_out
  • pipeline_plan_out
  • template_options_out
  • caption
  • resolved_prompt
modelQwen2.5-VL-7B-Instruct
qwen_quantizationBalanced (8-bit)
keep_loadedtrue
caption_template_modetrue
caption_typeLoRA Literal
caption_lengthany
custom_prompt_modefalse
prompt_presetdefault_literal
system_promptYou are a helpful image-captioning assistant. Describe only what is visible in the image. Do not invent unseen context.
custom_prompt
max_new_tokens384
temperature0.75
top_p0.90
top_k50
repetition_penalty1.08
max_size1024
forbidden_phrases
replace_pairs
download_probe_onlyfalse
seed

Joy is the crowd favorite, but it's not the only game in town - and CaptionForge's whole premise is that a second, independent captioning voice catches what the first one misses. JLC CaptionForge Qwen Caption is that second voice: a Qwen-family vision-language model loaded from Hugging Face, run as a Pass A witness alongside Joy (and optionally Ollama). It's structurally a sibling of the Joy node - same template path, same outputs, same standalone-or-pipeline split - but with a different model and a few different defaults.

The practical argument for it: Joy and Qwen have different blind spots, and when a distiller later merges their accounts, details that appear in both get reinforced while contradictions get flagged. The README is honest that model choices matter a lot and that Qwen's value is mostly as a complementary voice. If you only run one captioner, Joy is the community default; if you run two, this is the natural second.

How it works

It's a Python/Hugging Face engine, so weights load into your ComfyUI process (managed through the CaptionForge model cache, with eviction before Ollama stages run). Models are expected under ComfyUI/models/LLM/JLC_QwenCaption/ and auto-download on first use unless download_probe_only is on. The model dropdown ships five variants, from the lightweight Qwen2.5-VL-3B-Instruct up to Qwen2.5-VL-7B-Instruct, plus community finetunes like the Unredacted and abliterated NSFW-caption variants - which tells you what kind of datasets this pack expects.

qwen_quantization defaults to Balanced (8-bit), bitsandbytes load-time quantization that's genuinely worth keeping for the 7B variants on 16 GB cards. The sampling defaults differ from Joy's too - repetition_penalty sits at 1.08 here versus Joy's 1.0, a small nudge against looped captions.

Inputs and outputs that matter

  • model - pick your Qwen variant; bigger isn't automatically better on a 16 GB card.
  • qwen_quantization - Balanced (8-bit) vs Default.
  • caption_type / caption_length - the template path (Descriptive, LoRA Literal, Taggy, Style Focus, SFW Character Caption…).
  • system_prompt / custom_prompt - same structure as Joy; custom_prompt_mode overrides the template path when enabled.
  • max_new_tokens / temperature / top_p / top_k - standalone sampling, overridden by the Pipeline Planner when a plan is connected.
  • forbidden_phrases / replace_pairs - the shared cleanup filter.

Outputs are the familiar five: caption, resolved_prompt, image_out, pipeline_plan_out, template_options_out. caption is what feeds your dataset or the capstone's JSONL; resolved_prompt shows you the exact prompt that went to the model.

Install

Pack install once:

git clone https://github.com/Damkohler/CaptionForge.git ComfyUI/custom_nodes/CaptionForge

Restart, then pip install -e . in the folder if your ComfyUI env lacks the deps (torch, transformers, accelerate, huggingface-hub, pillow, numpy, safetensors, qwen-vl-utils). pip install bitsandbytes enables the 8-bit path. The model itself auto-downloads into ComfyUI/models/LLM/JLC_QwenCaption/ - no manual weight step.

Common issues

First run is a multi-GB Hugging Face download, so either be patient or dry-run with download_probe_only. If you OOM on a 7B model, check that qwen_quantization is actually set to Balanced (8-bit) - that's the single biggest lever. And expect VRAM handoffs in full-pipeline runs: Qwen and Joy share the process-local model cache and get evicted before Ollama stages take over, which is normal behavior, not a leak.

CategoryCaptioning/CaptionForge/Captioning Nodes

Inputs (23)

NameTypeDefaultDescription
modelCOMBOQwen2.5-VL-7B-InstructQwen vision-language model. Models are loaded from ComfyUI/models/LLM/JLC_QwenCaption/. Missing models may be downloaded automatically unless download_probe_only is enabled.
qwen_quantizationCOMBOBalanced (8-bit)Qwen model load mode. Balanced (8-bit) uses bitsandbytes 8-bit loading to reduce VRAM pressure, especially for Qwen2.5-VL 7B variants.
keep_loadedBOOLEANtrueKeep the model cached after captioning for faster repeated runs. CaptionForge cache policy may still evict it when another caption model must load.
caption_template_modeBOOLEANtrueUse the structured CaptionForge template path: caption_type, caption_length, and optional Template Options from the template_options pin. If custom_prompt_mode is also enabled, custom_prompt_mode takes precedence.
caption_typeCOMBOLoRA LiteralCaption template style used when caption_template_mode is active.
caption_lengthCOMBOanyTarget caption length used when caption_template_mode is active.
custom_prompt_modeBOOLEANfalseUse custom_prompt when non-empty, otherwise use prompt_preset. This overrides caption_template_mode when both toggles are enabled.
prompt_presetCOMBOdefault_literalBuilt-in prompt preset used only in custom_prompt_mode when custom_prompt is blank.
system_promptSTRINGYou are a helpful image-captioning assistant. Describe only what is visible in the image. Do not invent unseen context.Qwen engine accepts a single prompt string, so this system instruction is folded above the resolved caption prompt. Kept next to custom_prompt for clarity.
custom_promptSTRINGCustom prompt used only when custom_prompt_mode is enabled. Overrides prompt_preset when non-empty.
max_new_tokensINT38416–4096Standalone token budget. When a Pipeline Planner is connected, this is overridden by the Planner's shared max_new_tokens.
temperatureFLOAT0.750–2Standalone sampling temperature. When a Pipeline Planner is connected, this is overridden by the Planner temperature schedule.
top_pFLOAT0.900–1Standalone top-p sampling value. When a Pipeline Planner is connected, this is overridden by the Planner top-p schedule.
top_kINT500–500Standalone top-k sampling limit. When a Pipeline Planner is connected, this is overridden by the Planner top-k schedule.
repetition_penaltyFLOAT1.081–2Penalty applied to repeated tokens. Kept with the core captioning parameters. This is not currently overridden by the Pipeline Planner.
max_sizeINT10240–4096Maximum longest-side image size for standalone captioning. The image is resized in memory only. Pipeline Planner overrides this in planned runs.
forbidden_phrasesSTRINGOptional cleanup filter: remove lines/captions containing any listed phrase, one per line.
replace_pairsSTRINGOptional cleanup replacements, one per line: old=>new.
download_probe_onlyBOOLEANfalseAt the very bottom by design. Probe/download lightweight model metadata only, then return a status message without captioning.
imageoptIMAGEImage or batch of images to caption. The image is passed through unchanged for clean node-to-node pipeline chaining.
pipeline_planoptCAPTIONFORGE_PIPELINE_PLANConnect the CaptionForge Pipeline Planner output here. When connected, this node switches into Pass A evidence mode: Planner image routing, per-run seeds, sampling schedules, shared output paths, and internal JSONL evidence append.
template_optionsoptCAPTIONFORGE_EXTRA_OPTIONSConnect the CaptionForge Template Options node here. Works in standalone and Pipeline modes. This is the only source for template modifiers and name input.
seedoptINTOptional standalone seed input. Ignored when a Pipeline Planner supplies a seed schedule.

Outputs (5)

NameTypeDescription
image_outIMAGE
pipeline_plan_outCAPTIONFORGE_PIPELINE_PLAN
template_options_outCAPTIONFORGE_EXTRA_OPTIONS
captionSTRING
resolved_promptSTRING