CXH_Ic_lora_Joy_batch
IC-LoRA pair captioning with JoyCaption Alpha Two
- JoyPipeline_alpha
CXH_Ic_lora_Joy_batch is the JoyCaption-powered version of the pack's IC-LoRA captioning idea. Where CXH_IC_Lora_Florence2Run does the same job with Florence 2, this one runs the pair through JoyCaption Alpha Two - which produces the higher-quality natural-language captions that matter most for Flux-class training data. If you're building a clothing/garment IC-LoRA dataset and want the best captions this pack can produce, this is the node.
"IC" here is the image-conditioned LoRA convention: every sample is two images - the product shot and the worn shot - stitched side by side, captioned as one frame so the model learns the before/after relationship. The default template spells it out: Realistic style, [cloth-on], the image pair highlights a transformation from a clothing sample photo to the effect of actually wearing it. [image1] {caption} [image2] a female model is wearing the cloth from [image1] with {caption}.
How it works
For each image in dir1 it finds the same-named file in dir2, resizes the second to match the first (when match_image_size is on), stitches the pair together in the chosen direction (right/down/left/up), and runs the Alpha Two pipeline - the same SigLIP → image adapter → Llama generation as the single-image nodes. The caption is inserted into template at {caption}, alongside {text1} and {text2} if you set them, and written as a .txt beside a saved copy of the composite pair in saveDir.
Inputs
JoyPipeline_alpha- fromJoy_caption_alpha_load(which needs the Alpha Two checkpoint inmodels/Joy_caption_alpha/).prompt- the captioning instruction (wire in aJoy_caption_alpha_promptfor styled output).dir1,dir2,saveDir- paired source folders and output.format(png/jpg),max_new_tokens(default 1024),text1,text2,template,direction,match_image_size.
There are no outputs - this is an output node; results are on disk.
Installing
Standard pack install - ComfyUI Manager (search "Comfyui_CXH_joy_caption") or:
cd ComfyUI/custom_nodes
git clone https://github.com/StartHua/Comfyui_CXH_joy_caption
cd Comfyui_CXH_joy_caption
python -m pip install -r requirements.txt
Restart, then get the Alpha Two checkpoint in place (see Joy_caption_alpha_load - that's the manual download step).
Gotchas
- Filenames must match across folders - missing pairs are skipped with a console print, so verify your counts after a run.
- No
cachetoggle here. Unlike the standalone batch nodes, this one keeps the Alpha Two pipeline resident for the whole batch - great for speed, but on an 8 GB card it can collide with your checkpoint. Consider running it as a dedicated caption pass. match_image_sizeoff yields ragged stitches and muddier captions. Keep it on.- Reverse-direction captions: run the outputs through
CXH_IC_lora_reversalafterward to build the mirrored training set. - NVIDIA only, as with the whole JoyCaption path.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| JoyPipeline_alpha | JoyPipeline_alpha | — | |
| prompt | STRING | A descriptive caption for this image | — |
| format | COMBO | 2 options: png, jpg | |
| max_new_tokens | INT | 102410–4096 | — |
| dir1 | STRING | — | |
| dir2 | STRING | — | |
| saveDir | STRING | — | |
| text1 | STRING | — | |
| text2 | STRING | — | |
| template | STRING | Realistic style, [cloth-on], the image pair highlights a transformation from a clothing sample photo to the effect of actually wearing it. [image1] {caption} [image2] a female model is wearing the cloth from [image1] with {caption} | — |
| direction | COMBO | right | 4 options: right, down, left, up |
| match_image_size | BOOLEAN | true | — |
Outputs (0)
No outputs