Nodes/comfyui-character-prompt-selector/Character Prompt Selector
ComfyUI Node

Character Prompt Selector

Character Prompt Selector turns your character into dropdowns

By suffle·Created 6 months ago·Updated 6 months ago· 0
Character Prompt Selector
    • prompt
    character_file
    outfits
    expressions
    poses
    backgrounds

    You know the workflow: one character, twenty variations, and every time you're retyping the same base tags and hand-editing "what's she wearing" into the middle of a prompt that's already forty tokens long. Character Prompt Selector exists to kill that. You define a character once in a YAML file, and the node gives you one dropdown per category - outfit, expression, pose, background, whatever you want - then glues it all into a single prompt string.

    This is pure prompt plumbing, not a character-consistency tool. It won't hold a face across generations; for that you still need a LoRA or an edit model. What it does well is keep your identity and quality tags stable while you swap fragments around, which is exactly the tag-prompting style the SDXL-anime lineage (Illustrious, Pony, NoobAI) rewards - stable base tags up front, (none)-able optional bits after. If you mostly run LLM-encoded models like Flux or Z-Image, this node's comma-tag worldview matters less, but it's not wrong; it just outputs a string.

    How it works

    Your YAML has one special key, base, plus any other keys you like:

    base: "1girl, long silver hair, blue eyes, masterpiece, best quality"
    
    outfits:
      - "red cocktail dress, high heels, elegant"
      - "school uniform, white blouse, navy skirt"
    
    expressions:
      - "smile, happy"
      - "serious, cold expression, stoic"
    

    Every key except base becomes a dropdown whose options are that key's list; base is prepended to every output no matter what you select. The output is "<base>, <selected outfit>, <selected expression>, …", comma-joined and cleaned.

    Two design details are worth knowing because they explain the weird edge cases. First, ComfyUI evaluates dropdown lists once at startup, so the node builds every category by unioning all files in your library - the character_file dropdown, plus one dropdown per category found anywhere. Second, at execution it loads only the selected file and silently discards any selection that doesn't exist in it, so switching characters never pushes stale values downstream. The bundled frontend extension narrows the category dropdowns live when you switch characters, and adds a ⟳ Reload Library button so you don't need to restart ComfyUI after editing a YAML - the node's IS_CHANGED hash of filenames + modification times handles the re-execution side.

    The inputs that matter

    • character_file - pick which YAML defines your character.
    • One dropdown per category in your YAML - with the two bundled example files you get outfits, expressions, poses, and backgrounds. Choose (none) to omit a category entirely. That's the whole interface; category names must be valid Python identifiers and can't be base.

    The single output, prompt (STRING), wires straight into a CLIP Text Encode node's positive input.

    Install and configure

    Easy. In ComfyUI Manager search "Character Prompt Selector", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/suffle/comfyui-character-prompt-selector.git
    

    Restart ComfyUI and the node appears under the prompt category. No models to download, no heavy deps - the only real dependency is PyYAML, which ComfyUI already ships.

    Point it at your library either way:

    • Recommended: add character_prompt_library: prompt_library/ to your extra_model_paths.yaml (relative to base_path, like checkpoints and LoRAs), then restart once.
    • Zero-config fallback: drop YAMLs into custom_nodes/comfyui-character-prompt-selector/prompts/.

    Where people get burned

    • Stale dropdowns after adding a file. New YAMLs won't appear until you hit Reload Library or restart - the startup union is a one-time thing.
    • Silently empty output. If the selected file is missing or malformed, the node logs a warning and returns an empty string instead of crashing. Output's empty and you're confused? Check the ComfyUI log.
    • One library directory only. The node deliberately never mixes directories, or values from different character sets would bleed into each other - so don't split your characters across two paths expecting both to show.

    For its niche - batch-generating the same character in different outfits - it's hard to beat. The YAML is your source of truth, the node is just the switchboard.

    Categoryprompt

    Inputs (5)

    NameTypeDefaultDescription
    character_fileCOMBO2 options: example_dark_hair_boy.yaml, example_silver_hair_girl.yaml
    outfitsCOMBO8 options: (none), tactical jacket, cargo pants, boots, formal suit, white shirt, black tie, martial arts gi, white uniform, black belt, red cocktail dress, high heels, elegant, gothic lolita dress, black and white, ribbon, lace, +2
    expressionsCOMBO8 options: (none), determined, focused, serious, grinning, confident, cocky, calm, neutral expression, smile, happy, cheerful, serious, cold expression, stoic, +2
    posesCOMBO8 options: (none), battle stance, fists raised, walking, hands in pockets, casual, sitting on steps, elbows on knees, standing, arms crossed, confident, sitting, legs crossed, relaxed, +2
    backgroundsCOMBO4 options: (none), city rooftop, night, neon lights, dojo, wooden floor, dim lighting, empty street, rain, atmospheric

    Outputs (1)

    NameTypeDescription
    promptSTRING