ComfyUI Node

Get Danbooru Post

Turn any anime booru post into prompt-ready tags

By DraconicDragon·Created 2 years ago·Updated 3 months ago· 7
Get Danbooru Post
    • IMAGE
    • GENERAL_TAGS
    • CHARACTER_TAGS
    • COPYRIGHT_TAGS
    • ARTIST_TAGS
    • META_TAGS
    • ORIGINAL_WIDTH
    • ORIGINAL_HEIGHT
    url
    img_sizesample
    format_tagstrue
    trailing_commafalse
    exclude_tagstrue
    user_excluded_tagsconditional dnp, sound_warning, unknown_artist, third-party_edit, anonymous_artist, e621, e621 post recursion, e621_comment, patreon, patreon logo, patreon username, instagram username, text, dialogue

    Danbooru is the board whose tag vocabulary is the prompting language for the entire anime model ecosystem - Illustrious, NoobAI, and Pony all learned to read 1girl, long hair, looking at viewer. So if you browse Danbooru for prompt ideas, Get Danbooru Post is the node that turns any post URL into the exact ingredients: the image, the tags split into the board's categories, and the dimensions. One paste, one queue, and the tags are already formatted the way a tag-prompting model wants them.

    It's part of DraconicDragon's e621 booru toolkit, and it's one of the pack's cleaner wins: dedicated handlers per site instead of the old node's "guess and fall back to Danbooru" approach. There's no API key, no account, no config - just a URL.

    How it works

    The node appends .json to the post URL, fetches Danbooru's API response, and reads the tag_string_* fields for each category. For the image it pulls the media_asset variants list and grabs whichever img_size you asked for, falling back to the full file if the variant is missing. Everything rides on curl_cffi impersonating a Firefox browser with a real User-Agent, because Danbooru has long since learned to be picky about plain scripts.

    Inputs and outputs that matter

    • url - a post URL from danbooru.donmai.us (the handler also covers the safebooru.donmai.us and donmai.moe mirrors).
    • img_size - sample is the sensible default; original for the full-res file; none - don't download image if you only want tags.
    • format_tags - on by default, and it's what makes the output paste-ready: underscores become spaces, parentheses get backslash-escaped so they don't trigger prompt weighting.
    • exclude_tags - a default blocklist (patreon, text, dialogue, conditional dnp and friends) that strips the tags that do nothing in a prompt. Edit the box as you like; the node's parser tolerates underscores or spaces, backslashes or not.

    The outputs are IMAGE, GENERAL_TAGS, CHARACTER_TAGS, COPYRIGHT_TAGS, ARTIST_TAGS, META_TAGS, plus ORIGINAL_WIDTH and ORIGINAL_HEIGHT. Note there's no species or contributor output - Danbooru doesn't have those categories, and that's precisely why the pack ships a separate e621 node. If you want tags that genuinely matter for a furry model, grab the e621 one.

    Install

    Clone or use ComfyUI Manager:

    cd ComfyUI/custom_nodes
    git clone https://github.com/DraconicDragon/ComfyUI_e621_booru_toolkit
    

    restart, done. Dependencies are just requests, pillow, and curl_cffi.

    Gotchas

    Danbooru rate-limits and occasionally block bursts of unauthenticated API calls. If you hit a run of failures, slow down rather than hammering it - this node has no retry logic, and a 403 surfaces as a fetch error on the console. And the standing disclaimer for every node in this pack: you're pulling from an imageboard with plenty of NSFW content, so it serves whatever the post holds. For anything on the anime side of the hobby, this is the node to reach for.

    CategoryBooru Toolkit/Posts

    Inputs (6)

    NameTypeDefaultDescription
    urlSTRINGEnter the booru post URL
    img_sizeCOMBOsampleSelect the image size variant to output through 'IMAGE'. Choose 'none' to output a blank image. For e6, anything below sample will be 'preview'
    format_tagsBOOLEANtrueFormat tags for prompt use. Removes underscores and adds backslashes to brackets
    trailing_commaBOOLEANfalseAppends a comma to the last tag in each output
    exclude_tagsBOOLEANtrueToggle exclusion of tags from output
    user_excluded_tagsSTRINGconditional dnp, sound_warning, unknown_artist, third-party_edit, anonymous_artist, e621, e621 post recursion, e621_comment, patreon, patreon logo, patreon username, instagram username, text, dialogueComma separated list of tags to exclude for output (they can include underscores or spaces, with or without backslashes)

    Outputs (8)

    NameTypeDescription
    IMAGEIMAGE
    GENERAL_TAGSSTRING
    CHARACTER_TAGSSTRING
    COPYRIGHT_TAGSSTRING
    ARTIST_TAGSSTRING
    META_TAGSSTRING
    ORIGINAL_WIDTHINT
    ORIGINAL_HEIGHTINT