Batch Joy Caption Two Advanced
Caption an entire LoRA dataset folder with trigger words baked in
- joy_two_pipeline
- extra_options
- STRING
This is the full toolkit: everything Joy_caption_two_advanced can do (extra options, custom prompt, sampling controls), everything Batch_joy_caption_two can do (folder in, caption files out), plus a set of batch-only extras - renaming files as it goes, and gluing a prefix or suffix onto every single caption it writes. That last part is the one worth knowing about even if you skip everything else on this node: it's how you inject a trigger word across an entire dataset in one pass instead of scripting it separately after captioning.
That matters because trigger words are still standard LoRA practice - a rare token like ohwx or ch9ractername that won't collide with real vocabulary, prepended or appended to every caption so the model has something unambiguous to key off of. Normally that's a separate step after captioning. Here it's built in.
How it works
Same SigLIP-plus-Llama captioning loop as the rest of the pack, run once per image in input_dir, with the prompt built from caption_type, caption_length, extra_options, and optionally overridden entirely by custom_prompt - identical mechanics to Joy_caption_two_advanced. The batch-specific fields (rename, prefix_caption, suffix_caption) are applied as a post-processing pass on top of whatever the LLM generates, before it gets written to output_dir.
The inputs and outputs that matter
Inherited from the advanced single-image node: joy_two_pipeline, caption_type, caption_length, extra_options, name, custom_prompt, low_vram, top_p, temperature - same behavior, see the Joy_caption_two_advanced writeup if you need the details on any of those.
What's new here:
input_dir/output_dir- same as the plain batch node; leaveoutput_dirblank to save alongside the source images.rename- when on, output files get renamed sequentially instead of keeping their original filenames.prefix_nameandstart_index(default 1) - the naming scheme whenrenameis on, e.g.prefix_name+ an incrementing number starting fromstart_index.prefix_captionandsuffix_caption- plain strings glued onto the front or back of every generated caption. This is the trigger-word field: put your unique token here and every caption in the folder gets it, consistently, without touching the LLM's output by hand.
Output is a STRING, but as with the plain batch node, the files written to output_dir during the run are the actual deliverable.
How to install it
Through ComfyUI Manager: search "JoyCaptionAlpha Two for ComfyUI" and install. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/EvilBT/ComfyUI_SLK_joy_caption_two.git
pip install -r ComfyUI_SLK_joy_caption_two/requirements.txt
Restart ComfyUI. No dependencies of its own beyond the pack's shared requirements - the model weights all live on Joy_caption_two_load upstream. SigLIP and your chosen Llama checkpoint auto-download; the JoyCaption adapter needs a manual pull from the fancyfeast/joy-caption-alpha-two HuggingFace space into models/Joy_caption_two - miss that step and the whole chain fails before it gets to this node.
Common issues & troubleshooting
prefix_caption/suffix_caption show up but look mashed onto the caption with no spacing. Add your own leading or trailing space/comma inside the field - the node doesn't insert punctuation or spacing for you.
Renamed files aren't in the order you expected. rename with start_index numbers files in whatever order the batch processes them (typically directory listing order), not necessarily the order you'd sort them visually - check the actual filenames if ordering matters for your pipeline.
A large batch runs out of VRAM partway through, or is very slow. Same story as the rest of the pack: turn on low_vram, and make sure Joy_caption_two_load upstream is set to the 4-bit Llama checkpoint rather than full precision - that's the configuration the pack author actually ran this on (8GB VRAM), and it's the difference between a batch completing and it not.
Only using this for the trigger-word fields and not touching extra_options or custom_prompt at all. That's a completely reasonable way to use this node - leave extra_options unwired and custom_prompt empty, set caption_type/caption_length like you would on the plain batch node, and just use prefix_caption/suffix_caption for the trigger word. You don't have to use every socket to get value out of this one.
Inputs (16)
| Name | Type | Default | Description |
|---|---|---|---|
| joy_two_pipeline | JoyTwoPipeline | — | |
| input_dir | STRING | — | |
| output_dir | STRING | — | |
| rename | BOOLEAN | false | — |
| prefix_name | STRING | — | |
| start_index | INT | 10–9999999 | — |
| extra_options | Extra_Options | — | |
| caption_type | COMBO | 9 options: Descriptive, Descriptive (Informal), Training Prompt, MidJourney, Booru tag list, Booru-like tag list, +3 | |
| caption_length | COMBO | long | 31 options: any, very short, short, medium-length, long, very long, +25 |
| name | STRING | — | |
| custom_prompt | STRING | — | |
| low_vram | BOOLEAN | false | — |
| top_p | FLOAT | 0.900–1 | — |
| temperature | FLOAT | 0.600–1 | — |
| prefix_caption | STRING | — | |
| suffix_caption | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |