Nodes/ComfyUI-Generator-Pack/Character Tags Generator
ComfyUI Node

Character Tags Generator

Roll a Danbooru character the model actually knows

By alchemine·Created 12 days ago·Updated a day ago· 5
Character Tags Generator
    • processed_text
    ◄n1►
    ◄girltrue►
    ◄boyfalse►
    ◄otherfalse►
    ◄subjecttrue►
    ◄year_minfalse►
    ◄year_min_value2020►
    ◄year_maxfalse►
    ◄year_max_value2025►
    ◄min_count200►
    ◄seed0►

    Here's the thing nobody tells you about Danbooru-trained models: for a character with a few hundred posts on the board, you don't need a LoRA. You need the name, spelled the way the board spells it. The community rule of thumb puts the bar at roughly 200 works on Danbooru - past that, Illustrious and NoobAI usually resolve the character from the tag alone.

    The catch is knowing which name to type, and the board's spelling isn't always the one you remember (hatsune miku, astolfo (fate), underscores gone).

    Character Tags Generator rolls you one from the actual statistics. It's a slot machine over every Danbooru character tag with at least 100 posts, and it always pays out something real.

    What you'd use it for

    Prompt variety: batch a workflow across seeds and each run gets a different cast member instead of the same three girls you always write. Discovery: it hands you characters you'd never have thought to ask for. And testing what your checkpoint actually knows - a high min_count pool gives you household names, a low one tests the long tail. It pairs with the rest of the pack too: draw a character here, then let Tags Generator grow a scene around it.

    How it works

    The pool is resources/characters_v1.txt: every character tag with at least 100 posts, built from a Danbooru metadata dump through 2025-09 (about 17,000 rows). Each row is a name, a post count, the year of that character's first post, and a sex.

    That sex field is a heuristic, not gospel. It's whichever of 1girl, 1boy or 1other appears on the most of the character's solo posts; a tie, or no solo posts at all, counts as other - which is why a character who mostly shows up in group art is filed there.

    Your widgets narrow the pool, and the node samples from what's left - uniformly, without repeats, through random.Random(seed), so a fixed seed always draws the same characters. Fewer candidates than n and you get all of them rather than an error.

    The output counts the people for you: one girl with subject on gives 1girl, solo, hatsune miku; a girl and a boy gives 1girl, 1boy and then the names. Brackets are escaped (astolfo \(fate\)) so a prompt parser doesn't read the parenthesis as a weight - don't hand-edit those.

    Inputs that matter

    • n - how many to draw, 1 to 10.
    • girl / boy / other - the sex filter, drawn as one row of chips. At least one stays on; the UI won't let you switch off the last one. Only girl is enabled by default.
    • subject - prepends the person-count tags. On for tag models.
    • min_count - default 200, and your main lever. The file only holds characters with 100+ posts, so 100 is as wide as this node goes.
    • year_min / year_min_value, year_max / year_max_value - toggle-and-year pairs filtering on the year of the character's first post. The value is inert while its toggle is off.
    • seed - with the usual randomize control beside it.

    Output

    One string: processed_text, going straight into a CLIP text encoder or into the front of a prompt you already wrote. There's no separate name output, so branching on the character needs a text-splitting node downstream.

    Installing it

    ComfyUI Manager → search ComfyUI-Generator-Pack, restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/alchemine/comfyui-generator-pack
    

    Restart ComfyUI. The pack wants Python 3.12+; this node needs no dependency at all, only a data download. Files land in the pack's resources/ folder on first use, checksum-pinned by sha256, and a file already on disk is never re-fetched. You'll find the node under GeneratorPack/Tags.

    Where people get tripped up

    • Empty output, no error. Either all three sex toggles are off, or the year filters between them exclude everything. The node returns "" rather than breaking the workflow, so a silently empty prompt is the symptom to watch for.
    • Also empty: the download never ran. Check the console for [CharacterTagsGenerator] downloading characters_v1.txt (560KB) and confirm the file is in resources/. If the fetch fails, you get "".
    • The year filter is easy to use backwards. first_year is the character's first Danbooru post, not the year of their show. Filtering to recent years gets you characters a 2024-era checkpoint may never have learned; the useful direction is usually year_max, set near your checkpoint's data cutoff.
    • A drawn character comes out generic. Raise min_count. A 150-post character on a model that only internalised the top few thousand tags is a coin flip, and you get a vaguely matching hairstyle instead of the person.
    • Two characters in one prompt is still hard. This node handles naming; it can't fix binding. On CLIP-based models the attributes bleed between people and the better-known character usually wins. Give each one an attribute the other doesn't have.
    • other is a mixed bag - it's the bucket for ties and characters with no solo posts, so mascots and under-tagged characters come along for the ride.

    One note on trust: this is a young, single-author pack with essentially no install base yet. It's a few hundred lines of readable Python, it runs offline, and it loads no models - the only thing it fetches is data, from GitHub, on first run. Still, read the source before you install anything novel.

    CategoryGeneratorPack/Tags

    Inputs (11)

    NameTypeDefaultDescription
    nINT11–10How many characters to draw.
    girlBOOLEANtrueDraw characters whose solo posts are mostly 1girl. Characters with a tie or no solo post count as other.
    boyBOOLEANfalseDraw characters whose solo posts are mostly 1boy. Characters with a tie or no solo post count as other.
    otherBOOLEANfalseDraw characters whose solo posts are mostly 1other. Characters with a tie or no solo post count as other.
    subjectBOOLEANtruePut the person count of the drawn characters in front: 1girl and solo for one girl, 1girl and 1boy for a girl and a boy.
    year_minBOOLEANfalseLimit the year of the character's first post.
    year_min_valueINT20202005–2025Earliest year of the first post, inclusive. Ignored while the toggle is off.
    year_maxBOOLEANfalseLimit the year of the character's first post.
    year_max_valueINT20252005–2025Latest year of the first post, inclusive. Ignored while the toggle is off.
    min_countINT200100–100000Only characters with at least this many posts. The pool stops at 100.
    seedINT00–18446744073709550000Reproducibility. The same seed and settings always draw the same characters.

    Outputs (1)

    NameTypeDescription
    processed_textSTRING—