Nodes/ComfyUI_e621_booru_toolkit/Get Booru Post (Any Service)
ComfyUI Node

Get Booru Post (Any Service)

One node, every booru, auto-detected

By DraconicDragon·Created 2 years ago·Updated 3 months ago· 7
Get Booru Post (Any Service)
    • IMAGE
    • GENERAL_TAGS
    • CHARACTER_TAGS
    • CONTRIBUTOR_TAGS
    • COPYRIGHT_TAGS
    • ARTIST_TAGS
    • SPECIES_TAGS
    • META_TAGS
    • MODEL_TAGS
    • ORIGINAL_WIDTH
    • ORIGINAL_HEIGHT
    url
    api_typeauto
    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

    This is the flagship of DraconicDragon's booru toolkit: the generalist fetch node that replaced the old single-purpose one. Paste in a post URL from e621, e6ai, Danbooru, AIBooru, or Gelbooru, and it figures out which site it's from and which API to hit - no site selection required. It's the node you keep in a template workflow so you never have to think about which of the five siblings to add.

    The one honest caveat up front: the author says the service-specific nodes (Get e621/e6ai Post, Get Danbooru Post, and so on) are more reliable, and it's true. The specific nodes pin to one handler, which means they ignore domain quirks and just fetch. Use this one when you bounce between boards or when a workflow has to survive whatever URL gets thrown at it.

    How it works

    Under the hood is a small handler registry. Each supported site registers a handler that knows its API URL format and its JSON shape, and GetAnyBooruPostAdv picks one by matching the URL's domain. If auto-detection ever guesses wrong - or you're hitting a mirror the detector doesn't know - the api_type dropdown lets you force AIBooru, Danbooru, Gelbooru, or e621/e6ai by hand.

    The output list is the union of every category across all sites, so it's long:

    • IMAGE, ORIGINAL_WIDTH, ORIGINAL_HEIGHT - the image and its true dimensions.
    • GENERAL_TAGS, CHARACTER_TAGS, COPYRIGHT_TAGS, ARTIST_TAGS - the core categories every board has.
    • CONTRIBUTOR_TAGS, SPECIES_TAGS, META_TAGS, MODEL_TAGS - the extras, which come back empty for boards that don't have them.

    That last point is worth internalizing: a Danbooru post has no SPECIES_TAGS (that's an e621 category), so that output will be an empty string. That's not a bug, it's the board. And if you're fetching from Gelbooru, skip this node entirely - Gelbooru doesn't categorize tags at all, and this node's flat output won't surface its ALL_TAGS the way the dedicated Get Gelbooru Post node does.

    The inputs are the pack's standard set: url, api_type, img_size (with sample as the default and none - don't download image for tag-only pulls), format_tags (prompt-ready: underscores gone, parens escaped), trailing_comma, and exclude_tags with its editable default blocklist of board housekeeping tags.

    Install

    Standard pack install - clone or Manager:

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

    restart ComfyUI, and you're set. Dependencies are requests, pillow, and curl_cffi, the last of which impersonates a browser so the APIs don't block you.

    When it bites

    The error to know: "No suitable handler found for URL" means the domain isn't in the registry (or the URL is malformed). Fix it by either switching to the matching specific node or forcing api_type. Everything else is standard booru friction - rate limits, slow mirrors, NSFW content that you clicked on knowingly. For one-note workflows the specific nodes are better, but for "fetch whatever this URL is" this is the one you want.

    CategoryBooru Toolkit/Posts

    Inputs (7)

    NameTypeDefaultDescription
    urlSTRINGEnter the booru post URL
    api_typeCOMBOautoSelect booru api type. 'auto' should generally be OK to use
    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 (11)

    NameTypeDescription
    IMAGEIMAGE
    GENERAL_TAGSSTRING
    CHARACTER_TAGSSTRING
    CONTRIBUTOR_TAGSSTRING
    COPYRIGHT_TAGSSTRING
    ARTIST_TAGSSTRING
    SPECIES_TAGSSTRING
    META_TAGSSTRING
    MODEL_TAGSSTRING
    ORIGINAL_WIDTHINT
    ORIGINAL_HEIGHTINT