ComfyUI Node

RanbooruURL

Paste a booru post URL, get its tags — the targeted sibling of Ranbooru

By Inzaniak·Created 3 years ago·Updated 3 months ago· 26
RanbooruURL
    • TAGS
    • IMAGE
    • IMAGE_URL
    boorugelbooru
    url
    return_picturefalse

    RanbooruURL is the sibling of the main Ranbooru node with the randomness removed: instead of rolling a random post, you tell it exactly which post you want - by URL or by plain post ID - and it returns that post's tags. If the flagship node is for "surprise me," this one is for "I saw this picture and I want to prompt like it."

    The workflow is direct: you find a composition you like on a booru, paste its link into url, and out comes a comma-separated tag string ready for a CLIP Text Encode - the same cleaned-and-shuffled format the main node produces. It also passes through the same bad-tag filtering (no watermark, no text tags, no artist names), so the output is actually promptable rather than a raw dump.

    How it works

    You pick a booru and provide a url. The node figures out the post ID two ways: if the string is all digits, it's used as the ID directly; otherwise it regex-scans for id=(\d+) and uses that match. If neither works, it raises "Invalid URL." Then it fetches that post's tags, applies the same cleanup and shuffle as the main node, and returns TAGS (STRING), IMAGE (the picture as a tensor - a 1×1 black pixel if return_picture is off), and IMAGE_URL (STRING).

    One thing to notice in the source: the booru list here is smaller than the main node's. You get six options - gelbooru, rule34, safebooru, yande.re, aibooru, xbooru - and notably danbooru, konachan, and e621 are absent (konachan and e621 don't support post-ID lookups in this code, and danbooru just isn't wired into this node's picker). So a danbooru link can't be fed straight in; match the URL's host to the booru you select, or the ID you pasted will be queried against the wrong site and come back empty.

    Inputs and outputs

    • booru - enum, six options, default gelbooru.
    • url - STRING. A full post URL or a bare numeric ID.
    • return_picture - BOOLEAN, default off. Fetch the actual image too.

    Outputs: TAGS, IMAGE, IMAGE_URL.

    Installing it

    Ships in the Ranbooru pack: ComfyUI Manager, search "Ranbooru", or

    cd ComfyUI/custom_nodes
    git clone https://github.com/Inzaniak/comfyui-ranbooru
    

    then restart. No requirements.txt - it uses ComfyUI's bundled requests, torch, numpy and Pillow - and no model downloads.

    Common issues

    This node needs internet, and the 403 story is the same as the main node: first run creates ranbooru.conf with empty API-key slots, most boorus work keyless, and if one refuses, that's where credentials go. The other thing to remember is that this is not an always-rerun node in the same way as the flagship - it's keyed to the URL you give it, so it'll cache until the input changes. That's fine and predictable. And if you're used to feeding the output into the anime SDXL line, the tag vocabulary is native to it; on LLM-encoded checkpoints, the words still land but the comma formatting is just decoration.

    CategoryRanbooru Nodes

    Inputs (3)

    NameTypeDefaultDescription
    booruCOMBOgelbooru6 options: gelbooru, rule34, safebooru, yande.re, aibooru, xbooru
    urlSTRING
    return_pictureBOOLEANfalse

    Outputs (3)

    NameTypeDescription
    TAGSSTRING
    IMAGEIMAGE
    IMAGE_URLSTRING