Nodes/PromptPrism πŸŒˆβƒ€/Character Prompt Parser πŸŒˆβƒ€
ComfyUI Node

Character Prompt Parser πŸŒˆβƒ€

One prompt in, 15 labeled categories out β€” via the LLM of your choice

By BewinxedΒ·Created 2 years agoΒ·Updated about a year agoΒ· 0
Character Prompt Parser πŸŒˆβƒ€
    • quality 🌟
    • clothes πŸ‘—
    • hair πŸ’‡
    • eyes πŸ‘€
    • face
    • expression 😊
    • body πŸ‘€
    • pose πŸ•Ί
    • accessories πŸ•ΆοΈ
    • background 🏞️
    • composition πŸ–ΌοΈ
    • gender 🚻
    • species 🐾
    • age
    • name
    • character
    β—„promptβ€”β–Ί
    β—„modelgpt-4-turboβ–Ί
    β—„api_keyβ–Ί
    β—„temperature0.7β–Ί

    Paste a character prompt, pick an LLM, and this node hands you separate strings for hair, eyes, clothes, pose, background, and ten more categories. That's the whole pitch of the Character Prompt Parser, and it's more useful than it sounds if you've ever hand-edited the same 1girl, long hair, blue eyes, school uniform preamble into ten different prompts. It's built for character-focused work - Visual Novel sprites, character sheets, "same character, different outfit" batches - where you want the person's identity kept in one place and everything else swappable.

    The name is accurate, which is rarer in this ecosystem than it should be. This is a splitter, not a generator and not an enhancer. It doesn't invent tags; it's explicitly told not to.

    What it actually does

    Under the hood it's a thin wrapper around two libraries: LiteLLM, which talks to OpenAI, Anthropic, DeepSeek and Ollama through one API, and Instructor, which pins the model's reply to a strict JSON schema. That schema is the 15 categories. Your prompt goes in as the user message, the model returns JSON, and each key becomes an output. The system prompt does the important work: keep the format of tags and any weights ((blue_hair:1.2)) exactly as written, keep their order, don't add or remove anything. So the "parsing" is really "sorting" - which is what makes it safe to feed back into a tag-based model.

    The provider isn't a separate dropdown. It's baked into the model string: openai/gpt-4-turbo (the default), anthropic/claude-3-5-sonnet, deepseek/deepseek-chat, or an ollama/llama3-style entry for a fully local run.

    The inputs that matter

    • prompt - your character prompt, multiline. Tag soup or natural language, it handles both.
    • model - a long dropdown of 50 OpenAI/Anthropic/DeepSeek/Ollama models. The default gpt-4-turbo expects an OpenAI key.
    • api_key - paste your key for the chosen provider. Leave it empty if you're on Ollama, which runs locally and needs no key at all.
    • temperature - 0 to 2, default 0.7. This is your fidelity knob. The node's whole promise is "don't change my tags," so if the output keeps coming back "improved," drop this toward 0.2 and it stops rewriting.

    The outputs

    Fifteen category strings - quality, clothes, hair, eyes, face, expression, body, pose, accessories, background, composition, gender, species, age, name - plus one character output carrying the whole structured object. The character socket is what you wire into this pack's Merger node; the individual strings can feed a text encoder directly if you only care about one category.

    One heads-up from the source: most of those category outputs are Python lists wearing a STRING costume - only quality is a true string. Connecting one straight to a display node can show you a list instead of text. The Merger handles them properly, which is the sane way to consume this node anyway.

    Install

    ComfyUI Manager (search "PromptPrism"), or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Bewinxed/PromptPrism.git
    cd PromptPrism
    pip install -r requirements.txt
    

    Then restart ComfyUI. No model files to download - the "heavy" part is a dependency chain of LiteLLM, Instructor and the OpenAI/Anthropic/DeepSeek/Ollama clients, and pip install handles all of it.

    Where people get burned

    • It's an API call per run. Every execution sends your prompt to a cloud provider and bills you. Your prompt also leaves the machine, and the provider's content filters apply - the same tradeoff as every API wrapper. Want local and free per call? Use an Ollama model.
    • It's aimed at the tag lineage. Because it preserves :1.2-style weights and Danbooru tags, it fits Pony/Illustrious/NoobAI pipelines perfectly. Feed its output to an LLM-encoded model like Flux or Anima and those weight parentheses just become literal punctuation.
    • It doesn't finish the job. The parser only sorts. You still need a text encoder or this pack's Merger to turn the result into conditioning.
    • Provider mismatch. Pick a model from a provider you don't have a key for and you get an auth error at runtime, not at the dropdown. The default assumes an OpenAI key.
    • It's a small, nearly-unknown pack that phones home with your key by design - the standard "skim the source before first run" caution for this category.

    The typical setup: Parser β†’ Merger β†’ CLIPTextEncode β†’ sampler. The parser is the paid brain; the merger is where you actually assemble your prompt.

    Categorysplitters

    Inputs (4)

    NameTypeDefaultDescription
    promptSTRINGβ€”
    modelCOMBOgpt-4-turbo50 options: openai/o1-mini, openai/o1-preview, openai/gpt-4o-mini, openai/gpt-4o-mini-2024-07-18, openai/gpt-4o, openai/gpt-4o-2024-08-06, +44
    api_keySTRINGβ€”
    temperatureFLOAT0.70–2β€”

    Outputs (16)

    NameTypeDescription
    quality 🌟STRINGβ€”
    clothes πŸ‘—STRINGβ€”
    hair πŸ’‡STRINGβ€”
    eyes πŸ‘€STRINGβ€”
    face STRINGβ€”
    expression 😊STRINGβ€”
    body πŸ‘€STRINGβ€”
    pose πŸ•ΊSTRINGβ€”
    accessories πŸ•ΆοΈSTRINGβ€”
    background 🏞️STRINGβ€”
    composition πŸ–ΌοΈSTRINGβ€”
    gender 🚻STRINGβ€”
    species 🐾STRINGβ€”
    age STRINGβ€”
    name STRINGβ€”
    characterCHARACTERβ€”