Nodes/ComfyUI-AnimaForge-Windows/Anima Llama-cpp Caption Prompt
ComfyUI Node

Anima Llama-cpp Caption Prompt

Writes the instructions your caption model actually follows

By AI-KSK·Created 3 months ago·Updated 3 months ago· 0
Anima Llama-cpp Caption Prompt
    • caption_prompt
    caption_modehybrid
    nsfw_caption_modetrue
    extra_rules

    This node does zero captioning. It writes the instructions for the captioner. AnimaLlamaCppCaptionPrompt turns a few choices into a long, specific system-style prompt telling the llama-cpp VLM exactly what shape of caption you want - and its single output, caption_prompt, plugs straight into the llama_cpp_instruct_adv node in the pack's caption workflow. If your captions come out as essay-length rambling instead of one clean line, this is the node that fixes it.

    How it works

    The prompt is assembled in code from three inputs. At its heart it tells the model: "You are a captioning engine for Anima-Base LoRA training. Return exactly one line. Begin exactly with FINAL: anime illustration," - then the mode-specific formatting rule, a set of constraints (lowercase tags with spaces not underscores, describe only visible content, keep fixed traits for character/clothing/style LoRAs, no artist names, no watermark/logo/score/rating/quality tags), and the extra_rules text if you added any.

    Two design choices are worth calling out because they're load-bearing. First, the prompt explicitly tells the model not to invent a trigger word - the trigger is inserted later by AnimaSaveLlamaCppCaptions, so letting the model hallucinate one would double it up or corrupt it. Second, nsfw_caption_mode = true (the default) appends adult-content rules: describe adult content clinically and briefly, and never sexualize minors or ambiguous young-looking subjects. Given the model behind this is an uncensored GGUF, that guardrail lives in the prompt, not the weights.

    The inputs

    • caption_mode - tags_only, hybrid, or natural_language. hybrid (default) asks for booru-style tags then a short natural-language phrase, matching the Anima caption format the pack targets: trigger_word, anime illustration, tags, one short phrase. tags_only skips the phrase; natural_language skips the tags.
    • nsfw_caption_mode (true) - toggles the adult-content safety rules on or off.
    • extra_rules - a free-text box appended verbatim to the prompt. This is your escape hatch for dataset-specific rules ("always mention the hair accessory", "never use the word 'pants'").

    Output: the assembled caption_prompt string, wired to the instruct node's prompt input.

    Installing it

    Part of 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
    

    No models, no dependencies beyond the pack itself - but the workflow it belongs to additionally needs ComfyUI-llama-cpp_vlm installed (the llama-cpp loader, parameters, and instruct nodes), plus a llama-cpp-compatible VLM GGUF and its matching mmproj in ComfyUI\models\LLM (the README's default is a Gemma3 12B, chosen over Gemma4 for batch-captioning speed).

    Common issues

    The classic mistake is mismatched expectations: caption_mode only shapes the instruction, and a model that ignores instructions will still ramble - check that your VLM and its n_ctx are up to the job. If captions arrive with the trigger word doubled, that's usually the trigger being inserted somewhere twice, not this prompt. And a practical tip from the pack's own README: for hundreds or thousands of images, captioning speed matters more than raw quality, so Gemma3-class is the practical default and hybrid mode keeps captions training-friendly. Use extra_rules to nudge a specific model's bad habits instead of fighting it with a rewrite downstream.

    CategoryAnima/Batch LoRA

    Inputs (3)

    NameTypeDefaultDescription
    caption_modeCOMBOhybrid3 options: tags_only, hybrid, natural_language
    nsfw_caption_modeBOOLEANtrue
    extra_rulesSTRING

    Outputs (1)

    NameTypeDescription
    caption_promptSTRING