ComfyUI Node

Get AIBooru Post

Grab a post and the model it was generated with

By DraconicDragon·Created 2 years ago·Updated 3 months ago· 7
Get AIBooru Post
    • IMAGE
    • GENERAL_TAGS
    • CHARACTER_TAGS
    • COPYRIGHT_TAGS
    • ARTIST_TAGS
    • META_TAGS
    • MODEL_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

    AIBooru (aibooru.online) is the Danbooru-style board for AI-generated anime art, and this node exists because it has one thing the other boards don't: a MODEL_TAGS output. AIBooru categorizes which checkpoint a post was generated with, so instead of just feeding your prompt the tags, this node hands you the model name too. That's the differentiator, and it's genuinely useful when you're mining the board for inspiration or trying to figure out what recipe produced a look you like.

    Beyond that, it's the same pattern as the pack's other post nodes: paste a post URL, get back the image, the tags split into categories, and the original dimensions. It's the node you reach for when the post you're looking at lives on AIBooru - for e621 or Danbooru URLs the sibling nodes are the better fit.

    How it works

    AIBooru runs the same JSON response structure as Danbooru (tag_string_general, tag_string_character, and so on), so the handler parses it Danbooru-style and adds tag_string_model for the checkpoint. One quirk it handles for you: AIBooru sometimes serves image URLs without a scheme (starting //), and the handler patches those back to https: automatically.

    Inputs and outputs that matter

    • url - the post URL. No API key needed, unlike some boorus.
    • img_size - which image variant to download. sample is the sane default; original grabs the full-res file; none - don't download image skips the download entirely (you still get tags and dimensions - handy if you only want the prompt ingredients).
    • format_tags (default on) - strips underscores and escapes parentheses so tags are prompt-ready.
    • trailing_comma - appends a comma to the last tag in each output, useful when you're concatenating into a longer prompt.
    • exclude_tags + user_excluded_tags - a default list that filters out board housekeeping tags (conditional dnp, patreon, text, dialogue and friends) that do nothing in a prompt. Edit the textbox to your taste.

    The outputs: IMAGE, GENERAL_TAGS, CHARACTER_TAGS, COPYRIGHT_TAGS, ARTIST_TAGS, META_TAGS, MODEL_TAGS, plus ORIGINAL_WIDTH and ORIGINAL_HEIGHT (integers you can feed straight into a resolution node so the latent matches the source aspect ratio).

    Install

    The pack is one clone or one Manager search away:

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

    then restart ComfyUI (or search "ComfyUI_e621_booru_toolkit" in ComfyUI Manager). Dependencies are light - requests, pillow, and curl_cffi, which does the browser impersonation that keeps the booru APIs from shrugging you off.

    Gotchas

    AIBooru is a small community site, so expect occasional slowness or Cloudflare friction; that's exactly why the requests impersonate a real browser. And the usual disclaimer: boorus are full of NSFW posts, and AIBooru serves whatever someone uploaded. If you get an error on an empty URL that's the node's way of saying "give me a real link." Past that, it just works - paste, queue, done.

    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 (9)

    NameTypeDescription
    IMAGEIMAGE
    GENERAL_TAGSSTRING
    CHARACTER_TAGSSTRING
    COPYRIGHT_TAGSSTRING
    ARTIST_TAGSSTRING
    META_TAGSSTRING
    MODEL_TAGSSTRING
    ORIGINAL_WIDTHINT
    ORIGINAL_HEIGHTINT