Booru Roulette
A Gelbooru slot machine that writes your anime prompt for you
- image
- meta
- rating
- person_count
- character
- series
- artist
- general
- post_id
- post_url
- image_url
- raw_tags
- width
- height
- raw_request
The name is a lie and a truth at once. This isn't a randomizer that smears random tags together - it's a slot machine that pulls a real post off Gelbooru and hands you both the image and that post's actual tags, already sorted into the buckets your anime model speaks. Prompt fatigue is a real thing after your five-hundredth "1girl, long hair, looking at viewer." Booru Roulette is the cure: type a theme, pull the lever, get a fresh, human-curated prompt.
It's a direct descendant of Inzaniak's Ranbooru (sd-webui-ranbooru), which the README credits, and which people have been using for years to fetch live Danbooru tags per image. This one goes the ComfyUI route and targets Gelbooru.
How it works
Under the hood it's a thin client for Gelbooru's JSON API. It builds a search from your inputs (your tags, your exclude_tags as negated terms, a rating filter, optional year range), appends sort:random, and asks for exactly one post. Then it does the useful work: it pulls that post's full tag list and classifies every tag via Gelbooru's tag-index endpoint, so character, series, and artist tags get separated from general ones. It strips known junk like watermark, signature, and text tags, optionally shuffles, and escapes parentheses so they don't read as attention weights. It always appends -animated to the query, too.
The year filter is the sneaky clever part: Gelbooru has no native year search, so the author hardcoded a table of post-ID boundaries per year (from a Gelbooru forum thread, verified Feb 2026) and translates your range into id:>= filters.
One requirement that surprises people: you need Gelbooru API credentials. The node raises a clear runtime error if they're missing. Unlike a scraper, this thing is a legit API client, and Gelbooru wants an account.
The inputs that matter
tags(default1girl) - your search theme. Keep it simple; think like a Gelbooru search.exclude_tagsvsremove_tags- the subtle pair.exclude_tagskeeps posts containing those tags out of the search entirely;remove_tagsstrips tags from the output prompt after the fact. Exclusion filters the pool, removal cleans the result.rating(defaultGeneral) - filters search by board rating. The board hosts everything from G to hardcore, so remember this is a search filter, not a safety guarantee.preview_only(default true) - download the small preview instead of the full file. You're mostly here for the tags; leave it on.random_seed(default-1) - set a value 0–10000 for a repeatable draw;-1means truly random.use_last_result(default false) - reuses the previous post when your search inputs haven't changed, so you can fiddle with unrelated settings without burning a new draw.
What comes out
Fifteen outputs, but the ones you care about: image (the downloaded post, as an IMAGE you can preview or use), and the categorized tag strings - character, series, artist, general, person_count, rating, meta. Those wire beautifully into the pack's PromptTagAssembler (see that article). You also get post_id, post_url, raw_tags for provenance, plus raw_request - a credential-free copy of the exact query, a lifesaver when you get zero results and want to paste the search into a browser.
Installing it
The whole Archon Nodes suite ships in one repo. Easiest via ComfyUI Manager - search "Archon Nodes" - or:
cd ComfyUI/custom_nodes
git clone https://github.com/esbe1175/comfyui-archon-nodes
pip install -r ComfyUI/custom_nodes/comfyui-archon-nodes/requirements.txt
Then restart ComfyUI. Beyond ComfyUI's own stack, the only real dependencies are requests and cloudscraper - the latter powers a Cloudflare fallback when Gelbooru or its image CDN throws a 403/503 at a plain request.
Then the credentials. Sign in to Gelbooru, open your account settings where the API key lives, and either drop them in booru_roulette_config.json next to the node (copy from .example) or set GELBOORU_USER_ID / GELBOORU_API_KEY env vars. Config file wins if both exist. The config is gitignored, so don't commit real keys.
Troubleshooting
- "Gelbooru credentials missing" - you skipped the setup above. That's the whole fix.
- HTTP 403/503 with a Cloudflare page - the node retries via cloudscraper; if it still fails you're likely rate-limited or flagged. Slow down.
- HTTP 429 - you're polling too fast. ComfyUI re-runs this node every queue pass by design (
IS_CHANGEDis always-changed - it's a randomizer), so heavy automation hammers the API. - Zero results - check
raw_requestin a browser. Yourexclude_tagsmay be eating the whole pool. - The image is a black box - the download failed and it fell back to a placeholder at the post's dimensions. Check the console log; the error names the URL that failed.
Honest caveat: this is a young, low-download pack from a small author, and its reputation is unproven. But the mechanism is straightforward, the errors are readable, and nothing touches your generation pipeline until you wire the strings out.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| tags | STRING | 1girl | — |
| exclude_tags | STRING | — | |
| remove_tags | STRING | — | |
| rating | COMBO | General | 5 options: All, General, Sensitive, Questionable, Explicit |
| anima_rating_format | BOOLEAN | false | — |
| year_filter_mode | COMBO | Any | 4 options: Any, Between (year_start-year_end), After (uses year_start), Before (uses year_start) |
| year_start | INT | 20202007–2100 | — |
| year_end | INT | 20262007–2100 | — |
| random_seed | INT | -1-1–10000 | — |
| shuffle_tags | BOOLEAN | true | — |
| preview_only | BOOLEAN | true | — |
| return_picture | BOOLEAN | true | — |
| use_last_result | BOOLEAN | false | — |
Outputs (15)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| meta | STRING | — |
| rating | STRING | — |
| person_count | STRING | — |
| character | STRING | — |
| series | STRING | — |
| artist | STRING | — |
| general | STRING | — |
| post_id | STRING | — |
| post_url | STRING | — |
| image_url | STRING | — |
| raw_tags | STRING | — |
| width | INT | — |
| height | INT | — |
| raw_request | STRING | — |