Danbooru Tag Fetcher
Pull tags and a ready prompt off any Danbooru post ID
- tags
- prompt
Give this node a Danbooru post number and it hands back two things: the plain tag list, and a fuller prompt with the character name and series stitched onto the front. It's a one-input, one-API-call node - no model to load, nothing to configure. If you've found a reference post on danbooru.donmai.us and want its tags in your graph without retyping them, this is the fast way in.
Why bother at all? Because Danbooru's tags aren't a casual caption, they're the actual training vocabulary of most anime checkpoints. Illustrious, NoobAI, and Pony (to a lesser degree) all learned this exact tag set, so pulling tags straight off a real post gives you a prompt that speaks the model's native language instead of you guessing at phrasing it may not even recognize. Find a post with the pose, outfit, or character you want, feed in the ID, and you've got a starting prompt built from data the model actually saw during training.
How it works
You give it image_id - the numeric post ID from the post's URL. The node hits https://danbooru.donmai.us/posts/<id>.json, the same public API the site itself runs on, no key or login required. From the JSON it pulls three fields Danbooru already splits out for you: the character tags, the copyright/series tags, and the general tags - pose, clothing, setting, the bulk of the list. It's a live call every time you run it, not a cached lookup, so it needs the internet and it needs Danbooru to actually be up.
Inputs and outputs
One input:
image_id- the post number, as a string. That's the whole interface.
Two outputs, and the difference between them is the entire point of having both:
tags- just the general tags: pose, clothing, background, expression. The safe default when you want to describe a scene without dragging a specific character's identity along.prompt- the character and series tags stitched onto the front of those same general tags. Reach for this one when you actually want a named character to resolve, since Illustrious/NoobAI-family models respond hard to a correct character tag.
Both come back comma-separated. One thing worth knowing going in: it doesn't touch underscores inside individual tags - long_hair stays long_hair, the node only turns Danbooru's space-separated tag list into a comma-separated one. If your workflow expects clean spaces (most prompting guides tell you to want that), plan on a find-and-replace or a small tag-cleanup node downstream.
Installing it
ComfyUI Manager: search RenesStuffDanbooruTagGet, install, restart. Manual: cd ComfyUI/custom_nodes && git clone https://github.com/crave33/RenesStuffDanboruTagGet, restart. Nothing to download, no extra pip installs - it only needs requests, which ComfyUI already ships with. The author credits shirooo39's original get-danbooru-tags script as the base this was adapted from, worth knowing if you go looking for prior art.
Where people get burned
A bad or nonexistent post ID doesn't fail loudly - it comes back as an empty tags string with the actual error shoved into the prompt output instead: [ERROR]: 404 for a post that doesn't exist, or [ERROR]: Image ID cannot be empty! if you left the field blank. If your "prompt" output reads like an error code instead of tags, that's not a glitch, that's the node telling you the ID didn't resolve - open it in a browser and check first.
The other one to know before you build a workflow around this: there's no error handling around the network call itself. If Danbooru is unreachable, or your executor has no outbound internet, you don't get one of those clean [ERROR] strings - you get an unhandled exception and a red node. That's a real risk on a sandboxed or offline runner, since this node has zero offline fallback; it's entirely dependent on the live site responding.
And the standard Danbooru caveat applies here same as anywhere else that touches the board: it's uncensored by design, spanning G-rated art to explicit content under its own rating tags, so a post ID you grabbed without checking its rating first can hand back tags you weren't expecting.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| image_id | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| tags | STRING | — |
| prompt | STRING | — |