Nodes/ComfyUI-Alchemine-Pack/Danbooru Popular Posts Tags Retriever
ComfyUI Node

Danbooru Popular Posts Tags Retriever

Mine Danbooru's most popular posts for ready-made prompts

By alchemine·Created about a year ago·Updated 3 days ago· 2
Danbooru Popular Posts Tags Retriever
    • full_tags
    • general_tags
    • character_tags
    • copyright_tags
    • artist_tags
    • meta_tags
    date
    scaleday
    n1
    randomtrue
    seed0
    offset0

    DanbooruPopularPostsTagsRetriever grabs the tags from Danbooru's popular-posts leaderboard - daily, weekly, or monthly - and returns them as ready-to-prompt tag lists. It's the "what's good this week" node for the Danbooru-trained model crowd: a steady source of prompts that the community actually upvoted, which correlates with output that reads as "good" to the same audience.

    Where Danbooru Post Tags Retriever is precise (you know the post), this one is exploratory (you want something popular). It's a genuinely fun node to plug into a workflow that generates a batch of images from trending tags - a poor-man's trend feed for Illustrious and NoobAI prompting.

    How it works

    The node hits Danbooru's explore/posts/popular.json endpoint. The scale input picks day/week/month, and date (YYYY-MM-DD) lets you rewind to a specific day - empty means "latest". The popular endpoint returns posts in rank order, 20 per page, and there are two consumption modes:

    • random=True (default): fetches a pool of popular posts and randomly samples n of them using your seed, so repeated runs with the same seed give the same "random" selection. Great for variety without surprises.
    • random=False: walks the ranking deterministically. With offset you can step down the leaderboard - set offset's control to increment and n=1, and each queue returns the next most-popular post's tags. This is the documented way to iterate through the ranking one post at a time, and it's cleverly efficient: it only fetches the page(s) that actually contain your rank range, not the whole leaderboard. If the rank you asked for doesn't exist, it raises rather than silently returning nothing.

    Each output is a list - one entry per post - so n=5 gives you five tag strings per category. full_tags is the character + copyright + artist + general combination with meta tags excluded, same convention as the rest of the pack.

    Inputs that matter

    • scale - day/week/month. Day is the freshest and noisiest; month is the safest "these are broadly popular" signal.
    • n - how many posts to pull (default 1).
    • random / seed / offset - the three knobs that decide which posts you get.

    Outputs: full_tags, general_tags, character_tags, copyright_tags, artist_tags, meta_tags - all lists.

    Install

    Part of ComfyUI-Alchemine-Pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/alchemine/comfyui-alchemine-pack
    pip install -r requirements.txt
    

    Or via ComfyUI Manager (search "ComfyUI-Alchemine-Pack"). Uses plain requests; no model downloads.

    Common issues

    This endpoint is cached with a 1-hour TTL, so the same day's leaderboard won't refetch for an hour - that's a feature (rate-limit courtesy), but it means you won't see freshly-uploaded posts appear mid-session. The offset walk raises if you overshoot the leaderboard depth, which is correct behavior, but it can look like a crash - if you've hit it, you've simply walked past the end of the ranking. And popular isn't the same as promptable: many top posts lean on artist style tags, so you may want to drop artist_tags from your full prompt.

    CategoryAlcheminePack/Danbooru

    Inputs (6)

    NameTypeDefaultDescription
    dateSTRING
    scaleCOMBOday3 options: day, week, month
    nINT1
    randomBOOLEANtrue
    seedINT0
    offsetINT0

    Outputs (6)

    NameTypeDescription
    full_tagsSTRING
    general_tagsSTRING
    character_tagsSTRING
    copyright_tagsSTRING
    artist_tagsSTRING
    meta_tagsSTRING