Nodes/Comfyui_CXH_joy_caption/CXH_Ic_lora_Joy_batch
ComfyUI Node

CXH_Ic_lora_Joy_batch

IC-LoRA pair captioning with JoyCaption Alpha Two

By StartHua·Created 2 years ago·Updated 2 years ago· 624
CXH_Ic_lora_Joy_batch
  • JoyPipeline_alpha
    promptA descriptive caption for this image
    format
    max_new_tokens1024
    dir1
    dir2
    saveDir
    text1
    text2
    templateRealistic 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}
    directionright
    match_image_sizetrue

    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 - from Joy_caption_alpha_load (which needs the Alpha Two checkpoint in models/Joy_caption_alpha/).
    • prompt - the captioning instruction (wire in a Joy_caption_alpha_prompt for 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 cache toggle 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_size off yields ragged stitches and muddier captions. Keep it on.
    • Reverse-direction captions: run the outputs through CXH_IC_lora_reversal afterward to build the mirrored training set.
    • NVIDIA only, as with the whole JoyCaption path.
    CategoryCXH/Images

    Inputs (12)

    NameTypeDefaultDescription
    JoyPipeline_alphaJoyPipeline_alpha
    promptSTRINGA descriptive caption for this image
    formatCOMBO2 options: png, jpg
    max_new_tokensINT102410–4096
    dir1STRING
    dir2STRING
    saveDirSTRING
    text1STRING
    text2STRING
    templateSTRINGRealistic 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}
    directionCOMBOright4 options: right, down, left, up
    match_image_sizeBOOLEANtrue

    Outputs (0)

    No outputs