Nodes/comfyui-rapidfire/RandomCharacterSelector
ComfyUI Node

RandomCharacterSelector

A Character Lottery You'll Probably Have to Rewire First

By Zeks·Created 2 years ago·Updated 10 months ago· 3
RandomCharacterSelector
    • full_prompt
    • name1
    • name2
    • tags1
    • tags2
    • lora1
    • lora2
    num_girls1
    girl1_moderandom
    girl1_name
    girl1_strength1.00
    girl1_lora_strength1.00
    girl2_modedisabled
    girl2_name
    girl2_strength1.00
    girl2_lora_strength1.00

    RandomCharacterSelector is the pack's take on the character-reference-library idea: keep a weighted database of characters, and every run it picks one (or two) and assembles the full prompt - name, Danbooru-style tags, and a <lora:...> tag for the character LoRA - so you can batch-generate a character you didn't hand-pick.

    The idea is genuinely useful, and it's the same impulse behind the community's "batch 32 and get the same person across scenes" trick: instead of writing a character prompt yourself, let a database rotate through candidates. But here's the honest part you need before you install: this node reads its character list from a hardcoded path on the author's machine - H:\imagegen checkpoints\loras\kiseki_illustrious_v2\prompts\kiseki-noclothes-illustrious_weighted.txt. Unless that exact file exists, the node fails to initialize. Out of the box, on any normal install, it's dead weight.

    How it works

    It loads a text database where each line is weight,lora,name,tags (weight for weighted random selection, the lora tag, the character's name, and the comma-separated tag list). Two character slots (num_girls, max 2) each have a mode: random (weighted pick), specified (you choose from the database), or disabled. It then emits:

    • full_prompt - 1girl, or 2girls, prefix plus name, tags per character, with (name:strength) weighting when strength isn't 1.0 and <lora:name:lora_strength> tags for the LoRA loader.
    • name1/name2, tags1/tags2, lora1/lora2 - the parts split out, so you can wire the character name into your naming or logging without parsing the prompt.

    The split outputs are the smart part - they decouple "which character" from "the assembled prompt," which plays well with the pack's save-and-log loop.

    What you set

    • num_girls - 1 or 2 characters.
    • girl1_mode / girl2_mode - random, specified, or disabled.
    • girl1_name / girl2_name - the character dropdown (from the database).
    • girl1_strength / girl2_strength - prompt-name weight (0–2).
    • girl1_lora_strength / girl2_lora_strength - the <lora:...> weight.

    Outputs: full_prompt, name1, name2, tags1, tags2, lora1, lora2.

    The hard reality

    This node is written for one person's Illustrious workflow, and it shows. To use it yourself you'd edit girlselector.py (the source file behind it) to point CharacterDatabase.hardcoded_path at your own weighted list in the same weight,lora,name,tags format. That's maybe ten minutes of work if you keep the format, and the payoff is a genuinely handy character-rotation prompt generator for anime/Illustrious work.

    Install

    It's part of comfyui-rapidfire, no extra dependencies. Install via ComfyUI Manager (search "comfyui-rapidfire") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Zeks/comfyui-rapidfire
    

    then restart. And if the node errors on load with a FileNotFoundError about an H:\ path - that's not a broken install, that's this design, and it's telling you to go edit the source.

    Categoryconditioning

    Inputs (9)

    NameTypeDefaultDescription
    num_girlsINT11–2
    girl1_modeCOMBOrandom3 options: random, specified, disabled
    girl1_nameCOMBO0 options:
    girl1_strengthFLOAT1.000–2
    girl1_lora_strengthFLOAT1.000–2
    girl2_modeCOMBOdisabled3 options: random, specified, disabled
    girl2_nameCOMBO0 options:
    girl2_strengthFLOAT1.000–2
    girl2_lora_strengthFLOAT1.000–2

    Outputs (7)

    NameTypeDescription
    full_promptSTRING
    name1STRING
    name2STRING
    tags1STRING
    tags2STRING
    lora1STRING
    lora2STRING