Nodes/ComfyUI-AnimaForge-Windows/Anima VLM Caption Config
ComfyUI Node

Anima VLM Caption Config

The config node that usually needs no API key

By AI-KSK·Created 3 months ago·Updated 3 months ago· 0
Anima VLM Caption Config
    • VLM_CAPTION_CONFIG
    api_urlhttp://127.0.0.1:8000/v1/chat/completions
    api_key
    model_namegemma-vlm
    caption_modehybrid
    trigger_modefolder_name
    max_tokens180
    temperature0.20
    overwrite_existing_captionfalse
    nsfw_caption_modetrue
    request_timeout120

    AnimaVlmCaptionConfig is a pure configuration node: it collects everything the captioning pipeline needs to know about the vision-language model and hands it downstream as a VLM_CAPTION_CONFIG object that AnimaBatchVlmCaption consumes. It never calls an API itself and it never downloads a model. The name sounds like it wants a key and a cloud account, but the intended setup is a local VLM server on your own machine - so api_key sits there, mostly empty, in the way all honest local-setup keys do.

    How it works

    Every field gets bundled into a config dict (VlmCaptionConfig in vlm_caption.py), which is validated on the way out - bogus caption_mode or trigger_mode values are quietly snapped back to hybrid and folder_name. The actual work happens one node downstream: AnimaBatchVlmCaption uses this config to build the OpenAI-format request, including the caption prompt that starts with your trigger word.

    The inputs that matter

    • api_url - the VLM endpoint, default http://127.0.0.1:8000/v1/chat/completions. The pack's vlm_server.py serves exactly this shape, and any OpenAI-compatible server works. Leave the default if you're running the bundled server.
    • api_key - leave blank for a local server. Only fill it if you point api_url at something that wants a bearer token.
    • model_name - what the server knows your model as, default gemma-vlm. Match it to your server's registration or you'll get HTTP 400s.
    • caption_mode - tags_only, hybrid, or natural_language. hybrid (default) asks for the Anima-style line: trigger, anime illustration, booru-style tags, then one short natural-language phrase. That mirrors how Anima was trained - it understands tags and prose, per the KB's Anima notes - so hybrid is the natural default.
    • trigger_mode - where the trigger word comes from: folder_name (the task folder's name), parent_folder, or root_folder.
    • max_tokens (default 180), temperature (0.2 - low is right for captioning; you want consistency, not creativity), request_timeout (120s), overwrite_existing_caption (false = skip already-captioned images), and nsfw_caption_mode (true = keep adult content clinical, add safety rules to the prompt, and strip underage/ambiguous tags - worth knowing this pack applies that filter by default even though Anima itself is uncensored).

    The single output, VLM_CAPTION_CONFIG, feeds straight into AnimaBatchVlmCaption.

    Installing it

    It's in the AnimaForge Windows pack: ComfyUI Manager → "ComfyUI-AnimaForge-Windows", or

    cd C:\ComfyUI\custom_nodes
    git clone https://github.com/AI-KSK/ComfyUI-AnimaForge-Windows.git
    cd ComfyUI-AnimaForge-Windows
    powershell -ExecutionPolicy Bypass -File .\scripts\install_windows.ps1
    

    The pack's own requirements are just requests and pillow; the VLM side needs your local server up (a Gemma-class GGUF plus matching mmproj in ComfyUI\models\LLM).

    Common issues

    The number one beginner stumble is model_name mismatch - the node sends what you typed, and a llama-cpp server returns 400 if the id doesn't match its loaded model. Second: pointing api_url at a server that isn't running, which shows up downstream as a connection error per image. Third: forgetting that overwrite_existing_caption defaults to false is actually a feature - rerun the workflow to fill gaps, and flip it only when you've changed your caption mode and genuinely want to redo everything. The KB's captioning guidance holds here too: auto-caption big sets, but audit the small ones by hand, because multi-subject attribution is where every VLM slips.

    CategoryAnima/Batch LoRA

    Inputs (10)

    NameTypeDefaultDescription
    api_urlSTRINGhttp://127.0.0.1:8000/v1/chat/completions
    api_keySTRING
    model_nameSTRINGgemma-vlm
    caption_modeCOMBOhybrid3 options: tags_only, hybrid, natural_language
    trigger_modeCOMBOfolder_name3 options: folder_name, parent_folder, root_folder
    max_tokensINT18016–2048
    temperatureFLOAT0.200–2
    overwrite_existing_captionBOOLEANfalse
    nsfw_caption_modeBOOLEANtrue
    request_timeoutINT1205–1800

    Outputs (1)

    NameTypeDescription
    VLM_CAPTION_CONFIGVLM_CAPTION_CONFIG