Nodes/comfyui-anima-toolkit/TK 提示词扩写
ComfyUI Node

TK 提示词扩写

Anima's second block, written from tags you already typed — no LLM

By Ararararararaki·Created 3 months ago·Updated about 21 hours ago· 22
TK 提示词扩写
    • prompt
    • natural
    • vlm_prompt
    prompt
    write_naturaltrue
    style标准(2-3 句)
    keep_input_naturaltrue
    fill_lightingfalse
    fill_lighting_tagssoft lighting, soft shadows
    fill_camerafalse
    fill_camera_tagscowboy shot
    fill_qualityfalse
    fill_quality_tagsmasterpiece, best quality
    dedupe_filledtrue
    vlm_output
    validate_vlm_tagstrue
    keep_unknown_vlm_tagsfalse
    keep_vlm_naturaltrue
    existing_tags_override
    normalise_outputtrue

    The structure that works on Anima is a tag block, an empty line, then a descriptive paragraph. The tag block is the easy half - your WD14 tagger gives you that for free. The paragraph is where people stall, and the usual answer is a local LLM prompt enhancer, which comes with two failure modes the community has documented thoroughly: chat scaffolding leaking into your conditioning ("Here is your enhanced prompt:"), and subject drift, where the model invents detail you never asked for. Let a captioning VLM do it instead and you hit the third wall - the moment two characters are in frame, VLMs mix up who is wearing what.

    TK 提示词扩写 (AnimaTKPromptExpander) takes a different route. Danbooru tags are already English phrases - long hair, looking at viewer, school uniform - so building a sentence out of them needs no translation and no generation, just classification and templates. Every word in the output came from your input, which means it structurally cannot hallucinate, it costs microseconds, and it uses zero VRAM. That is the pitch, and it holds up. The honest caveat is the other side of the same coin: it can only read what you wrote.

    How it works

    Same taxonomy as the pack's formatter - roughly 693k Danbooru tags in 20 categories, built offline from the board's API and shipped in the repo. Tags get bucketed by category and assembled into sentences in a fixed order: subject first, then features, then costume/pose/expression, then camera and setting, then mood. 2girls becomes "two girls"; a character tag like nozomi (blue archive) becomes "Nozomi from Blue Archive" - the model card explicitly advises naming the character before describing appearance, and this follows that. Hair tags get merged, so long hair plus silver hair gives you "long silver hair" rather than two clauses fighting each other.

    The style dropdown sets the length: 简洁(1 句), 标准(2-3 句), or 详细(3-4 句), which adds a camera/background/props sentence and then a lighting sentence. Blank-line input still works the way it does across this pack's text nodes: everything before the blank line is tags, everything after is natural language you wrote yourself, so it composes with the formatter and the Danbooru Tag Getter in either direction.

    The inputs you'll actually touch

    prompt is required. The toggles that matter are:

    • write_natural (on) - the whole point; turn it off if you only want the tag block back.
    • style - sentence count.
    • keep_input_natural (on) - keep the prose you pasted, or replace it with the generated version.
    • normalise_output (on) - outputs tags in Anima's space-separated form rather than whatever your tagger produced.
    • fill_lighting, fill_camera, fill_quality - all off by default, and that's the right default. They append from a curated list (fill_lighting_tags defaults to soft lighting, soft shadows, fill_camera_tags to cowboy shot, fill_quality_tags to masterpiece, best quality) and only fire when that dimension is genuinely missing. dedupe_filled stops them duplicating what you already have.

    Three outputs. prompt is your tag string, optionally with the fill-ins appended. natural is the generated paragraph - a separate port on purpose, because tags do precision and prose does coherence and you'll want to place them yourself. vlm_prompt is the interesting one: it's an instruction, with your existing tags embedded, telling a vision model to add only what's visible in the image but missing from the tag list, and to answer in two blocks, <danbooru_tags> and <natural>.

    The VLM path

    Wire vlm_prompt into the VLM or LLM node you were already running - that's the design goal: no extra inference call, the one you were making anyway does this job too. Route its reply back into vlm_output and the node parses the two blocks. validate_vlm_tags (on) then checks every returned tag against the taxonomy and drops the phrases a language model naturally produces - "soft afternoon light fills the room" is not a Danbooru tag and won't be treated as one, unless you flip keep_unknown_vlm_tags. keep_vlm_natural lets the VLM's description win over the template version, since it saw the actual image. existing_tags_override lets you feed a different tag list into the instruction without changing what comes out.

    One practical note: the instruction text itself is written in Chinese, matching the pack author's language. Every modern VLM handles that, but an English-only small model is a bad fit.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/Ararararararaki/comfyui-anima-toolkit
    

    Restart ComfyUI. In Manager, search TK Toolkit (registry id anima-toolkit). The node lives under TKTK/prompt, needs no model downloads and no packages beyond what ComfyUI already has, and the taxonomy index (data/tag_taxonomy.tsv.gz) ships in the repo - keep the data/ folder or classification quietly degrades to "everything is unclassified". Docs are Chinese-first; there is effectively no English-language discussion of this pack to fall back on.

    If the input is empty, the node still hands you a usable vlm_prompt, which is a neat way to caption an image from nothing. If a fill toggle seems dead, check whether you already had a light/shadow tag - camera fill counts looking at viewer as camera information, so it won't stuff a cowboy shot on top of it.

    Where it falls down is the same place every auto-describer does: multi-character scenes. The templates build one subject, so two people collapse into a shared description, and Anima's real answer to that is word order - naming who does what, in order. For a two-hander, write that paragraph yourself and use this node for everything else.

    CategoryTK/prompt

    Inputs (17)

    NameTypeDefaultDescription
    promptSTRING标签串;空行之后的段落视为自然语言原样保留
    write_naturaloptBOOLEANtrue
    styleoptCOMBO标准(2-3 句)4 options: , 简洁(1 句), 标准(2-3 句), 详细(3-4 句)
    keep_input_naturaloptBOOLEANtrue
    fill_lightingoptBOOLEANfalse
    fill_lighting_tagsoptSTRINGsoft lighting, soft shadows
    fill_cameraoptBOOLEANfalse
    fill_camera_tagsoptSTRINGcowboy shot
    fill_qualityoptBOOLEANfalse
    fill_quality_tagsoptSTRINGmasterpiece, best quality
    dedupe_filledoptBOOLEANtrue
    vlm_outputoptSTRING把 VLM 的返回接到这里(配合 vlm_prompt 指令使用);会自动解析 <danbooru_tags> / <natural> 两个块
    validate_vlm_tagsoptBOOLEANtrue
    keep_unknown_vlm_tagsoptBOOLEANfalse
    keep_vlm_naturaloptBOOLEANtrue
    existing_tags_overrideoptSTRING
    normalise_outputoptBOOLEANtrue

    Outputs (3)

    NameTypeDescription
    promptSTRING
    naturalSTRING
    vlm_promptSTRING