TK D站画廊
Pull a reference image off Danbooru without leaving the canvas
- images
- prompts
- metadata_json
Danbooru is where half of anime-model prompt vocabulary comes from, and it's the obvious place to grab a reference image - pose, outfit, composition - for an Anima graph. The usual dance is: browser tab, search, right-click, save to input/, alt-tab, load image. Ninety seconds per reference.
TK D站画廊 collapses that into a node. Search Danbooru, pick images in a waterfall grid, and get them out as IMAGE tensors with their prompts and metadata attached. It's part of TK Toolkit (anima-toolkit by 时运tk).
There are no inputs
Worth saying plainly, because it confuses people looking at the node: DanbooruGallery has no input sockets and no widgets. Everything - your search tags, rating and score filters, page size, the random-discovery quality floor - is configured in the node's own expanded UI, and the selection is carried through to execution as workflow state. Each gallery node in a graph keeps its own settings, so you can have two open on different searches without them fighting.
Outputs
Three, and they're the reason this is more useful than a browser tab:
- images - IMAGE, and it's a list. Multiple selected posts come out as multiple images, which is why the pack's TK 图像选择 node checks for a list on slot 0.
- prompts - STRING, also a list. The booru tags for each selected post, in the same order.
- metadata_json - a single JSON string with one record per selection:
danbooru_id, the rawtagsarray,prompt_groups(the prompt split into artist/copyright/character/general/meta buckets),rating,score,fav_count,width,height,file_ext,video,source_url, plusokanderrorfields if a download failed.
The prompts output has an on/off switch in the UI. Turn it off and that port returns an empty string while images and metadata still flow - useful when you want the picture as an img2img reference and deliberately don't want the booru prompt leaking into your conditioning.
How the fetching actually works
Search hits Danbooru's public API, rate-limited and cached, so flipping back to a previous page is instant instead of another round trip. Tag suggestions are bilingual: type a Chinese fragment and you get English tag candidates with post counts, and near-misses get autocorrected (standin → standing) rather than returning nothing.
Downloads are the interesting part, because Danbooru sits behind Cloudflare and actively challenges datacenter and VPN IPs. The node tries plain requests first. When it gets the "Just a moment" challenge, it falls back to driving your locally installed Edge or Chrome through Playwright as a hidden internal gateway - same session, real browser fingerprint - and continues. That fallback needs playwright in ComfyUI's Python environment; without it the node degrades to direct requests and tells you when it's blocked.
Two smaller mechanisms worth knowing. Animated posts are served as mp4, which PIL can't open, so the node extracts the first frame with ffmpeg rather than handing you a black image. And if every selected image fails to download, the node raises and stops the queue instead of silently outputting black tensors - the source comment says explicitly that it stopped doing that. Respect it.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/Ararararararaki/comfyui-anima-toolkit
# restart ComfyUI
# optional, only for the Cloudflare fallback gateway:
pip install -r ComfyUI/custom_nodes/comfyui-anima-toolkit/requirements-optional.txt
ComfyUI Manager: search TK Toolkit (anima-toolkit). Required packages are just aiohttp and requests. The node registers under TK/Danbooru. No API key, no account, no login - it's the public board.
Where people get burned
Cloudflare. This is the number one failure and it doesn't always look like one: search spins, or times out, and nothing says "challenge". Install playwright for the self-healing path, and if you're still blocked, change exit node - the README suggests exactly that. The gallery is only as reachable as your IP is.
Content. Danbooru is unfiltered by default; that's what makes it the training source for these models, and it's also what will put explicit images on your canvas at work. The rating filter in the node UI is not decoration. Use it deliberately.
The images are raw booru resolutions. Nothing here normalises to your canvas. Pair the output with a resize, or accept that a 2400px reference is going through your img2img at whatever denoise you set. Anima has no ControlNet, so the booru image is usually a structure reference at moderate denoise, not a hard control signal.
It's an output node. It runs whenever the workflow runs, so a gallery sitting in a graph with nothing selected downstream still does its work on queue.
Inputs (0)
No inputs
Outputs (3)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| prompts | STRING | — |
| metadata_json | STRING | — |