🌸 WDanbooru Injector
Paste a booru post ID, get a prompt Anima actually understands
- positive_prompt
- injected_tags_only
You see a post you like, and you want to riff on it - the pose, the framing, the style. If you're on Anima or any Danbooru-trained model, the honest way to do that is to reproduce the post's tag structure. Retyping forty tags by hand is miserable. This node fetches them for you: paste a booru post ID or URL, and it pulls the tags straight from the site's API, rebuilds them into a properly ordered prompt, and merges that into whatever you already had.
The name isn't a metaphor. It injects.
How it works
The WDanbooru Injector hits one of 13 sources - gelbooru, e621, danbooru, konachan.net, konachan.com, yande.re, lolibooru, safebooru, rule34, hypnohub, atfbooru, xbooru, or a fully offline manual mode - and fetches the post's tags. Where the API separates categories (e621 and Danbooru do), it splits tags into artist, character, copyright, and general; the flat boorus just dump everything into general. Then it assembles them in Anima's recommended order:
[quality] [year] [safety] [count] [character] [copyright] [@artist] [general]
Underscores become spaces, and artist tags get the @ prefix Anima wants. The whole point of that ordering is that the models you're using were trained on exactly this vocabulary - a correctly ordered tag string beats a sentence for control, and Anima's card spells this order out almost verbatim.
The inputs that matter
source- which booru to fetch from.post_id- a plain number or the post's page URL. Don't paste the direct image URL; there's no post ID in it, and the node will tell you so.inject_mode-prepend(tags before your prompt),append(after), orreplace(your prompt gets thrown away).safety_tag- the rating tag. Note the default issafe, so if your source post is explicit and you want that reflected, set it (ornone).- The four include toggles and
max_general_tags(default 40) - trim the noise. Artist, character, and copyright toggles let you keep just the parts you want.
The optional inputs are where it gets useful: positive_prompt is your existing prompt to merge with, count_tag adds the character count (1girl, 2boys), extra_tags appends whatever you always want in there, and the gelbooru_user_id / gelbooru_api_key / e621_username / danbooru_api_key fields carry your credentials. The default quality prefix is masterpiece, best quality, score_7 - Anima's recommended opener. Score tags are the model's own quality dial, and if you're chasing a specific artist style you can drop the prefix entirely and let the @artist tag carry it.
Outputs
positive_prompt is the full merged string - wire it to your CLIP Text Encode positive input and you're done. injected_tags_only is the fetched block by itself, before your base prompt gets mixed in; it exists for debugging, and you'll be glad it does the first time a prompt comes out weird.
Installing it
ComfyUI Manager, search WDanbooru_Injector, install, restart. Manual, if that's your style:
cd ComfyUI/custom_nodes
git clone https://github.com/Winnougan/WDanbooru_Injector.git
Restart and you'll find it under WDanbooru. The only dependency is requests (already in ComfyUI), so no model downloads and no surprises.
Common gotchas
Gelbooru flat-out requires a free-account API key - every request, no exceptions - and the node raises a clear error telling you where to get it. e621 wants your username in its requests (their API policy), so fill e621_username or expect 403s. The node accepts credentials raw or with the key= prefixes stripped, so pasting the whole copied string works either way. And when all you want is no network at all - say, testing the tag ordering - switch source to manual and paste tags into manual_tags; no API call happens.
Inputs (21)
| Name | Type | Default | Description |
|---|---|---|---|
| source | COMBO | gelbooru | 13 options: gelbooru, e621, danbooru, konachan.net, konachan.com, yande.re, +7 |
| post_id | STRING | — | |
| inject_mode | COMBO | prepend | 3 options: prepend, append, replace |
| quality_prefix | STRING | masterpiece, best quality, score_7 | — |
| safety_tag | COMBO | safe | 5 options: safe, sensitive, questionable, explicit, none |
| year_tag | COMBO | none | 7 options: none, 2020, 2021, 2022, 2023, 2024, +1 |
| include_artist | BOOLEAN | true | — |
| include_character | BOOLEAN | true | — |
| include_copyright | BOOLEAN | true | — |
| include_general | BOOLEAN | true | — |
| max_general_tags | INT | 401–200 | — |
| positive_promptopt | STRING | — | |
| manual_tagsopt | STRING | — | |
| count_tagopt | STRING | — | |
| gelbooru_user_idopt | STRING | — | |
| gelbooru_api_keyopt | STRING | — | |
| e621_usernameopt | STRING | Your e621 username. Required for API access (e621 policy). | |
| e621_api_keyopt | STRING | Optional e621 API key for higher rate limits. Get at e621.net → Account → Manage API Access. | |
| danbooru_usernameopt | STRING | Your Danbooru username. Optional for public posts. | |
| danbooru_api_keyopt | STRING | Optional Danbooru API key. | |
| extra_tagsopt | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| positive_prompt | STRING | — |
| injected_tags_only | STRING | — |