Nodes/Booru Prompter/Get Tags (ID)
ComfyUI Node

Get Tags (ID)

Paste a Danbooru post ID, get a finished anime prompt back

By dumbdemon·Created 7 days ago·Updated 2 days ago· 0
Get Tags (ID)
    • all
    • tags_only
    • artist
    • character
    • copyright
    • meta
    booru_id1
    remove_underscoresfalse
    add_spacetrue
    exclude_tags

    Every anime workflow hits the same moment: you're staring at a gorgeous Danbooru post and wishing you could lift its exact tags, because that's literally the prompt language your Illustrious or NoobAI model was trained on. Typing a post's tags out by hand is misery, and copying them means fishing through the page source. DDGetTagsByCode is the shortcut: type in the post ID, and the node hands you back six cleaned-up, prompt-ready strings you can wire straight into a CLIP Text Encode.

    It's part of the small Booru-Prompter pack by dumbdemon, which is otherwise just a sibling "Get Tags (URL)" node and a cache exporter. If you only add one node from the pack, this is it.

    How it works

    Give it a numeric post ID and the node fetches that post from the booru you've selected in settings - Danbooru or E621 - using the site's public JSON API. No API key required to read public posts, so there's nothing secret to configure. The site's own tag categories come back already split, and that's the neat part: instead of one blob of tags you get distinct lanes, which matters because artist, character, series and quality tags want to go different places in a prompt.

    Under the hood it caches every post it fetches on disk (more on that below), so the second time you look up the same ID it doesn't hit the network at all.

    The inputs you'll actually touch

    • booru_id - the number from a post URL, like https://danbooru.donmai.us/posts/12345671234567. Defaults to 1, so you always change it.
    • remove_underscores - off by default. Leave it off if you prompt in raw Danbooru style; flip it if you prefer spaces (long_hairlong hair), which some people claim lands better on certain models.
    • add_space - "Add Space after Comma", on by default. Keep it on. These models were trained on comma-space separated tags; joining with bare commas saves nothing and often reads worse.
    • exclude_tags - a comma-separated list to strip from every output, handy for killing 1girl or a rating tag you don't want in the positive prompt.

    What comes out

    Six STRING outputs, and all is the one you'll reach for 90% of the time: every tag joined into a single prompt-ready string, with artist tags prefixed (default prefix by, so sakimichan becomes by_sakimichan - configurable in settings). The rest split the lanes:

    • tags_only - the general category (poses, clothing, scenery), no artist/character/series noise
    • artist - style source, prefix added
    • character - named characters, e.g. hatsune_miku
    • copyright - the franchise/series
    • meta - the quality/rating end, where masterpiece, best quality, highres live

    Wire all into a text node or CLIP Text Encode positive and queue. If you want to reorder or reweight tags, drop the string into a text editor first.

    Installing it

    ComfyUI Manager: search Booru Prompter and install. Or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/dumbdemon/Booru-Prompter
    

    Then restart ComfyUI. It's a tiny pure-Python pack - no model downloads, no GPU dependencies. It declares pyyaml and diskcache; ComfyUI ships PyYAML, but if the nodes don't appear after install, pip install diskcache in your ComfyUI environment is the usual fix.

    The gotcha that trips everyone up

    There's one required setting before this node will do anything: your booru User ID, under ComfyUI's Settings → Booru Prompter (grab it from your profile page). The default 0000000 is a placeholder, and until you replace it every request fails - you'll see each output fill with the same error text like "No userid provided." That's by design, not a crash: the node writes error messages into the outputs so you can read what went wrong. See that repeated text across all six outputs and you've found the problem.

    Other real-world snags: hitting Danbooru too fast gets you a 429 rate-limit error text in the outputs (space your lookups out - the cache is there so you mostly don't have to). And whatever you paste into the URL-based sibling node must be a /posts/ link; a tag-search page will just error.

    CategoryBooru Prompter

    Inputs (4)

    NameTypeDefaultDescription
    booru_idINT11–4503599627370495
    remove_underscoresBOOLEANfalse
    add_spaceBOOLEANtrue
    exclude_tagsSTRING

    Outputs (6)

    NameTypeDescription
    allSTRING
    tags_onlySTRING
    artistSTRING
    characterSTRING
    copyrightSTRING
    metaSTRING