Random Character Picker (Image Saver)
Roll random danbooru-style character tags into a prompt
- tags
This is the odd one out in the Image Saver pack - nothing to do with saving files. It reads a text file of character tags and randomly picks some to drop into your prompt. If you generate anime/booru-style images and want variety without hand-picking a character every run, this rolls the dice for you: point it at a tag list, tell it how many to grab, and it outputs a formatted tag string ready to feed a text encoder.
Think of it as a lightweight wildcard specifically shaped for danbooru-style character tags, with the formatting knobs those tags actually need.
How it works
You give it a file_path to a tag file and it selects count entries at random (the seed makes that repeatable). Then it formats them the way prompt tags want: replace_underscore turns character_name into character name, escape_parens backslash-escapes parentheses so they don't get read as prompt-weighting syntax, and delimiter sets what goes between tags. weight_by_count biases the random pick toward more common tags rather than treating every entry equally, and exclude / filter let you blocklist or narrow the pool. The include_core_tags and include_copyright toggles pull in the character's associated defining tags and source series when your file carries them.
The inputs and outputs that matter
- file_path - the tag file to draw from. This is the one you have to get right; no file, nothing to pick.
- count - how many characters to grab (1–1000).
- seed - fix it for reproducible picks, vary it for fresh ones.
- replace_underscore / escape_parens - leave both on for normal prompt use; they make the tags actually parse correctly.
- weight_by_count / filter / exclude - shape the pool and the odds.
The single output is tags (a STRING) - wire it into a CLIP Text Encode, or concatenate it with your base prompt.
Installing it
ComfyUI Manager: search ComfyUI Image Saver, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/alexopus/ComfyUI-Image-Saver
cd ComfyUI-Image-Saver
pip install -r requirements.txt
Restart, hard-refresh. The pack ships no tag file for you - you supply your own.
Where people get tripped up
The whole thing hinges on the file. Point file_path at a list that doesn't exist, or one in a format the node doesn't expect, and you get nothing useful - this is where most confusion starts, so confirm the path and that the file is a plain tag list. The include_core_tags / include_copyright toggles also only do something if your file actually carries that structured data; on a flat list of names they're inert.
And match your formatting to your model. replace_underscore and escape_parens are on by default because booru-trained SD 1.5 / SDXL checkpoints expect spaced, escaped tags - but if you're feeding a natural-language model, a pile of comma-separated danbooru tags isn't how it wants to be prompted. This is a tool for tag-based checkpoints; on newer LLM-encoder models it's the wrong shape of input.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| file_path | STRING | path to a CSV file with character, trigger, core_tags, copyright, and count columns | |
| count | INT | 11–1000 | number of characters to pick |
| delimiter | STRING | , | string used to join all output tags |
| replace_underscore | BOOLEAN | true | replace underscores with spaces in output |
| escape_parens | BOOLEAN | true | escape ( and ) as \( and \) to prevent ComfyUI from interpreting them as attention weights |
| trailing_comma | BOOLEAN | false | append a trailing comma to the result |
| weight_by_count | BOOLEAN | false | use the count column as sampling weight — characters with more posts are more likely to be picked |
| seed | INT | 00–18446744073709550000 | random seed — same seed produces the same selection |
| include_core_tags | BOOLEAN | false | append each character's core descriptive tags (e.g. hair color, eye color) after their trigger |
| include_copyright | BOOLEAN | false | append each character's copyright/series name after their tags |
| exclude | STRING | comma-separated character names to exclude from the pool before sampling (case-insensitive, underscores and spaces are equivalent) | |
| filter | STRING | only consider characters whose name contains this substring (case-insensitive); leave empty for no filtering |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| tags | STRING | — |