Nodes/ComfyUI_RollingArtist/Rolling Character
ComfyUI Node

Rolling Character

Random prompts from 34,416 characters that already know what they look like

By StarAsh042·Created 2 years ago·Updated 7 days ago· 3
Rolling Character
    • prompt
    • characters_json
    • tested_count
    ◄character_count1►
    ◄character_top_ratio0.01►
    ◄character_top_count1►
    ◄seed1234►
    ◄use_top_prioritytrue►
    ◄exclude_characters►
    ◄force_include►
    ◄copyright_pick(不限)►
    ◄describe_charactertrue►
    ◄custom_csv_path►
    ◄tested_db_path►

    Rolling Character is a prompt printer with a dice roll in it. It pulls one or more characters out of a 34,416-row Danbooru table and emits their prompt tags as plain text you wire straight into a text encoder. No model, no sampling, no VRAM.

    The reason to care isn't the randomness. It's that each row ships with core_tags - the character's actual visual definition. Ask for Raiden Shogun and you get raiden_shogun,genshin_impact,1girl,purple eyes,mole under eye,purple kimono,obi. You don't have to know about the mole. Danbooru's taggers did that work years ago and the pack ships the result.

    What you actually get back

    With character_count = 3, a genshin_impact filter and seed 1234, the prompt output is literally this (tags trimmed):

    rosaria_\(genshin_impact\),genshin_impact,1girl,nun,purple eyes,veil,bare shoulders,
    scaramouche_\(genshin_impact\),genshin_impact,1boy,purple eyes,red eyeshadow,blunt ends,
    raiden_shogun,genshin_impact,1girl,purple eyes,mole under eye,purple kimono,obi
    

    One character per line, fields joined by commas, a trailing comma on every line except the last. That last detail is deliberate: the sibling RollingArtist node ends its output with a comma too, so you can drop both into one concat with no glue.

    Turn off describe_character and you get the short form - hakurei_reimu,touhou - for when a LoRA already supplies the appearance and you only need the identity tag.

    Inputs

    Four are required and they are the whole node:

    • character_count (1–10) - how many characters per run.
    • character_top_ratio (0.01–1.0) - the popularity pool, as a fraction of the candidates left after the copyright filter. The CSV is sorted by post count descending, so this means "take the first N rows," the most-drawn characters on the board. At the default 0.01 with no filter, that's the top ~345.
    • character_top_count (1–10) - how many picks are guaranteed to come from that pool. The knob that stops you rolling nine nobodies.
    • seed - reproducibility, with a caveat below.

    Then the ones you'll actually use: copyright_pick is a combo box of all 3,460 franchises in the shipped CSV, sorted by total post count, type-to-filter, (不限) for no filter. exclude_characters and force_include take comma-separated names; force wins over exclude, and names not in the CSV still work - they just arrive with no copyright and no description. Turn off use_top_priority for a flat uniform draw. The two advanced fields (custom_csv_path, tested_db_path) are folded away; leave them blank. If you do point custom_csv_path at your own table, copyright_pick won't follow it - that dropdown is built once, from the default file, at node registration.

    One thing this node deliberately doesn't do: weights. The artist node in the same pack assigns (name:0.8); character tags are identity, not style, and (raiden_shogun:0.7) isn't something you want.

    Outputs

    prompt is the text block above. characters_json is the same draw in structured form - name, copyright, top, count, core_tags - for when something downstream parses rather than encodes. tested_count is a string (it changed from INT in 4.1.0) counting rows logged in rollingcharacter.sqlite.

    Install

    ComfyUI Manager → search the pack title, or by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/StarAsh042/ComfyUI_RollingArtist.git
    

    Restart ComfyUI. That's it - requirements.txt in this repo is empty. No pip step, no model download, no compiled anything: stdlib Python plus SQLite, and both working CSVs (50,018 artists, 34,416 characters) are committed to the repo. The two large *_full.csv files are Git-LFS pointers, but they're only inputs to the optional rebuild scripts - ignore them.

    The README is Chinese-first, which is probably why you've never heard of this pack. The node's labels and tooltips follow your ComfyUI locale (Comfy.Locale), and English strings ship in locales/en/.

    Where people get burned

    Your seed is not as reproducible as it looks. The node avoids repeats across the last 10 outputs, and that window lives in memory, not in the database. Same seed, same settings, different result depending on what you generated five minutes ago. Restarting ComfyUI clears it; tested_db_path does not - that's a different thing, and the tooltip says so.

    The seed widget rolls. It's an ordinary integer control, so it ships with ComfyUI's control_after_generate dropdown. Find a character you like, leave the control on fixed, and every queue gives you that same one - either exactly what you want, or the reason you think the node is broken.

    Small franchises run dry. Filter to a 40-character series, ask for 10, and the avoidance window eats everything. It won't error - it logs a WARNING and starts repeating, which is why you'll occasionally see the same face twice.

    About 22% of characters have no core_tags, so those lines come out short: name plus franchise, nothing else. That's the data, not a bug.

    The two advanced path fields read and write whatever you type, with no sandboxing. Fine on a box only you touch. If your ComfyUI is reachable from the LAN with workflow execution enabled, anyone can make this node read a CSV or write a SQLite file anywhere on your disk.

    The honest caveat

    Stacking three random characters into one prompt does not give you three characters. SDXL-family anime models have no syntax for binding an attribute to a character, so hairstyles and eye colours bleed across everyone in frame and the better-known character tends to win. Keep character_count at 1 unless you're deliberately chasing a fusion - which is exactly what this node is good at.

    CategoryRollingArtist

    Inputs (11)

    NameTypeDefaultDescription
    character_countINT11–10每次生成的角色数量(1-10),每个角色输出一行。角色是单词条,没有穷举模式
    character_top_ratioFLOAT0.010.01–1人气池占比(0.01-1.0):按 CSV 行序取前 ceil(候选数×比例) 个(至少 1 个)作为 Top 池,行序越靠前的角色作品数越多。候选数指“作品筛选之后”剩下的角色数
    character_top_countINT11–10每次至少抽取几个人气池角色(1-10);仅在“Top 优先抽样”开启且人气池非空时生效
    seedINT12340–4294967295随机种子。同一种子在同一组参数下结果可复现;最近 10 条输出记录的回避窗口也会影响实际结果
    use_top_priorityoptBOOLEANtrue开启时优先从人气池抽角色,并保证含 character_top_count 个人气角色;关闭时从完整候选列表均匀抽样
    exclude_charactersoptSTRING要排除的角色名,英文逗号分隔;被排除的名字不会出现在结果中
    force_includeoptSTRING必须出现的角色名,英文逗号分隔;优先级高于“排除角色”,数量达到角色数量时直接从中随机抽取。不在 CSV 里的名字也能用,只是没有作品与角色描述信息
    copyright_pickoptCOMBO(不限)从下拉里挑一个作品。下拉列出 CSV 里的全部作品(按作品热度降序:该作品下所有角色的 count 之和),并且可以直接打字筛选、忽略大小写(输入 a 只留 a 开头的,继续输入 ab 会进一步收窄)。“(不限)”表示不筛选。同时接受 copyright 列的原始写法 fate_(series) 与 trigger 里转义后的写法 fate_\(series\)。注意:下拉项来自默认 CSV,换“自定义 CSV 路径”时下拉不会跟着变
    describe_characteroptBOOLEANtrue开启时在每行末尾拼上角色的固定外观标签(core_tags,即角色描述),格式为「角色标签,作品标签,角色描述」;关闭时只输出「角色标签,作品标签」
    custom_csv_pathoptSTRING自定义角色 CSV 的路径;留空使用节点目录下的 danbooru_character_001.csv
    tested_db_pathoptSTRING记录数据库(SQLite)路径;留空使用节点目录下的 rollingcharacter.sqlite(与画师节点分开)。这里只存历史输出记录,更换该路径不会重置“最近 10 条不重复”的窗口(那个窗口在内存里,重启即清零)

    Outputs (3)

    NameTypeDescription
    promptSTRING角色列表:每个角色一行,格式为「角色标签,作品标签,角色描述」,不带权重;关闭“开启角色描述”后为「角色标签,作品标签」
    characters_jsonSTRING结构化结果 JSON(角色 / 作品 / 是否 Top / 热度 / 角色描述)
    tested_countSTRING当前数据库里已记录的角色组合数量(字符串形式,可直接接到文本节点查看)