Nodes/TK ImageVL - Batch Image & VLM Tools/TK JoyCaption Interrogator
ComfyUI Node

TK JoyCaption Interrogator

The batch JoyCaption node — uncensored natural-language captions for a whole folder

By tackcrypto1031·Created 8 months ago·Updated 6 months ago· 2
TK JoyCaption Interrogator
    • texts
    • filenames
    source_pathC:/input_images
    output_pathC:/output_images
    joycaption_modelfancyfeast/llama-joycaption-beta-one-hf-llava
    caption_typeDescriptive
    caption_lengthlong
    user_prompt
    max_new_tokens512
    temperature0.60
    top_p0.90
    top_k0
    cache_modeltrue
    filename_prefiximage_
    resize_mpfalse
    img_mp1.0
    resize_pxfalse
    img_px1024
    enable_captioningtrue

    If you're captioning a training set in natural language, JoyCaption is the community default - an 8B VLM built from scratch for exactly this job, free, open, and uncensored by design. TK JoyCaption Interrogator is the batch wrapper that points it at a folder, writes a .txt caption for every image, and gives you back the texts. It's the pack's answer for "I want rich prose captions, not tags, and I don't want to ask an API."

    How it works

    Give it a source_path and an output_path. It loads the JoyCaption model (default fancyfeast/llama-joycaption-beta-one-hf-llava, with the old pre-alpha as the second option), pulls it into tk_comfyui_imageVL/models on first use, then for each image:

    1. optionally resizes (same megapixel / longest-edge toggles as the batch loader),
    2. builds the caption prompt from your controls,
    3. runs inference and writes {prefix}{n}.txt into output_path,
    4. copies the image over with its new {prefix}{n} name.

    Outputs are texts (LIST) and filenames (LIST), position-matched. Saving is automatic - there's no separate saver step.

    The controls that actually shape the captions

    • caption_type - Descriptive (formal prose) or Stable Diffusion Prompt (tag-style with quality boosters like "masterpiece, best quality"). This swaps the internal instruction the model follows.
    • caption_length - any, very short, short, medium-length, long, very long. It's appended to the prompt, so treat it as a soft constraint, not a hard token limit.
    • user_prompt - overrides the built-in instruction entirely. Leave it empty to use the preset for your caption_type.
    • max_new_tokens / temperature / top_p / top_k - generation knobs; 512 default is fine for captions.
    • cache_model - keep it on. Off unloads the model after every run, and reloading an 8B VLM each time turns a batch into a waiting game.
    • enable_captioning - flip this off and the node becomes a resize-and-rename batch loader that writes no captions. It's the escape hatch if you just want the image pipeline.

    Installation

    cd ComfyUI/custom_nodes
    git clone https://github.com/tackcrypto1031/tk_comfyui_imageVL.git
    cd tk_comfyui_imageVL
    pip install -r requirements.txt
    

    Restart ComfyUI after, or use ComfyUI Manager and search tk_comfyui_imageVL. The node leans on transformers>=4.45.0, accelerate, and huggingface-hub from the pack's requirements.

    Where people get burned

    • It's an 8B model. Beta One is Llama 3.1 8B plus a SigLIP2 vision encoder. It fits a consumer card but it's not instant - a folder of hundreds of images takes a while, and the first run downloads the weights.
    • Multi-subject attribution. The author says it himself: when several people are in a frame, VLMs mix up who's wearing what. Auto-caption the bulk, audit the small sets by hand.
    • Not the tool for anime tag datasets. JoyCaption's tag modes approximate booru vocabulary, but if you're captioning for Illustrious/Pony/NoobAI, a WD14 tagger emits the exact tags those models were trained on. Use this node when the base wants prose (Flux, Z-Image, most LLM-encoded models) - and its uncensored stance is a real advantage there, since the API captioners refuse exactly the content you might need captioned.

    Batch JoyCaption in a node, no API key, no censorship dance, .txt files done for you. That's the pitch, and it mostly delivers.

    CategoryTK/JoyCaption

    Inputs (17)

    NameTypeDefaultDescription
    source_pathSTRINGC:/input_images
    output_pathSTRINGC:/output_images
    joycaption_modelCOMBOfancyfeast/llama-joycaption-beta-one-hf-llava2 options: fancyfeast/llama-joycaption-beta-one-hf-llava, fancyfeast/joy-caption-pre-alpha
    caption_typeCOMBODescriptive2 options: Descriptive, Stable Diffusion Prompt
    caption_lengthCOMBOlong6 options: any, very short, short, medium-length, long, very long
    user_promptSTRING
    max_new_tokensINT5121–4096
    temperatureFLOAT0.600–1
    top_pFLOAT0.900–1
    top_kINT00–100
    cache_modelBOOLEANtrue
    filename_prefixSTRINGimage_
    resize_mpBOOLEANfalse
    img_mpFLOAT1.00.1–100
    resize_pxBOOLEANfalse
    img_pxINT102464–8192
    enable_captioningBOOLEANtrue

    Outputs (2)

    NameTypeDescription
    textsLIST
    filenamesLIST