Nodes/ComfyUI Seed Wildcard Pack/Danbooru Tag Importer (Anima)
ComfyUI Node

Danbooru Tag Importer (Anima)

Steal a Danbooru post's tags without touching the API

By sinanzoo2nd·Created 8 months ago·Updated 3 months ago· 0
Danbooru Tag Importer (Anima)
    • ARTIST_PROMPT
    • CHARACTER_PROMPT
    • BACKGROUND_PROMPT
    • ALL_RAW_TAGS
    urlhttps://danbooru.donmai.us/posts/...
    artisttrue
    charactertrue
    copyrighttrue
    persontrue
    species_traitstrue
    bodytrue
    facetrue
    hairtrue
    appearancetrue
    clothingtrue
    accessorytrue
    state_emotiontrue
    posetrue
    actiontrue
    camera_compositiontrue
    backgroundtrue
    environmenttrue
    uncategorizedfalse
    preview_box버튼을 눌러 분석하세요.

    Danbooru is the source of truth for anime tags, and if you've ever hand-typed a character's tag set from memory you know how much you're leaving on the table. DanbooruTagImporter (Anima) pulls the full tag list off a real Danbooru post - artist, character, copyright, hair, pose, everything - and hands it to you sorted into Anima-friendly prompt blocks. No API key, no login, and one of the cleverest network-workarounds in a custom node you'll ever see.

    The architecture trick that makes it work

    Here's what makes this node special, and it's worth understanding before you judge it on first run. Danbooru sits behind Cloudflare, which blocks most server-side scraping, and the node's author solved that by not calling Danbooru from Python at all. Instead:

    1. The node has a button in its UI (a small JS extension ships with the pack)
    2. When you click it, your browser fetches https://danbooru.donmai.us/posts/<id>.json directly - the browser is a real browser, so it sails past Cloudflare, and it carries whatever login state you have
    3. The browser posts that JSON to a custom backend route the pack registers (/anima/danbooru_analyze), where Python categorizes the tags using the same 37k-entry tag_category.json the Text Categorizer uses
    4. The result is cached to disk in danbooru_cache/<post_id>.json, so it only needs the one fetch

    The node itself never touches the network. It reads only from that cache. That's the entire reason it works where other Danbooru importers die on a 403.

    The workflow

    Input a url like https://danbooru.donmai.us/posts/1234567, click the analyze button (the preview box shows progress and then a breakdown of what was cached), and the node gives you the same four outputs as the Text Categorizer:

    • ARTIST_PROMPT - the post's artist tags
    • CHARACTER_PROMPT - character, copyright, species, body, face, hair, clothing, pose, action, and friends
    • BACKGROUND_PROMPT - camera & composition, background, environment
    • ALL_RAW_TAGS - every tag, flattened

    Each category also has its own boolean toggle (all on by default except uncategorized), so you can exclude hair tags or keep only the artist. Tags are converted from underscores to spaces and parens get escaped for prompt safety.

    The gotchas - read these before you rage

    • You must click the button first. Until you do, the node has no cache entry and returns an error string in ALL_RAW_TAGS ("데이터가 없습니다... please click analyze"). This trips everyone. The node does not auto-fetch - by design, to avoid hammering Danbooru.
    • Login-walled content. The fetch runs in your browser, so posts that require a Danbooru login (most NSFW posts) only work if you're logged in in that browser - the same browser tab running ComfyUI. It inherits your cookies, which is both the feature and the limitation.
    • It's a cache. Fetch once per post and it's stored forever; fetch a post with the same ID twice and the second run reads disk. If a post is deleted after you cached it, you still have the data.
    • CORS and adblockers. The browser fetch is the whole mechanism, so if a privacy extension blocks the Danbooru request, the preview will show an HTTP error and nothing gets cached. Whitelist danbooru.donmai.us if you're running aggressive blockers.

    Install

    Part of the ComfyUI Seed Wildcard Pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/sinanzoo2nd/ComfyUI-Seed-Wildcard-Pack
    

    or ComfyUI Manager → search Seed Wildcard → install, restart. The requests library gets used by the pack's Python side, but it's present in essentially every ComfyUI install. No model files, no keys, no external data to download - the 37k-tag table and the JS extension ship in the repo.

    Who this is for

    If you generate Anima (or Illustrious/NoobAI-class) anime images and want real Danbooru-accurate tag sets for a character or scene you like, this is the fastest path from "I like that post" to "I have its full tag list organized." The browser-fetch architecture is a genuinely clever bit of engineering for a problem - Cloudflare-blocked Danbooru - that has killed half a dozen similar nodes. Just remember the button.

    CategoryAnima/Text

    Inputs (20)

    NameTypeDefaultDescription
    urlSTRINGhttps://danbooru.donmai.us/posts/...
    artistBOOLEANtrue
    characterBOOLEANtrue
    copyrightBOOLEANtrue
    personBOOLEANtrue
    species_traitsBOOLEANtrue
    bodyBOOLEANtrue
    faceBOOLEANtrue
    hairBOOLEANtrue
    appearanceBOOLEANtrue
    clothingBOOLEANtrue
    accessoryBOOLEANtrue
    state_emotionBOOLEANtrue
    poseBOOLEANtrue
    actionBOOLEANtrue
    camera_compositionBOOLEANtrue
    backgroundBOOLEANtrue
    environmentBOOLEANtrue
    uncategorizedBOOLEANfalse
    preview_boxoptSTRING버튼을 눌러 분석하세요.

    Outputs (4)

    NameTypeDescription
    ARTIST_PROMPTSTRING
    CHARACTER_PROMPTSTRING
    BACKGROUND_PROMPTSTRING
    ALL_RAW_TAGSSTRING