Nodes/comfyui-portrait-master/Portrait Master: Prompt Styler
ComfyUI Node

Portrait Master: Prompt Styler

The Portrait Master node that translates old-school weighted prompts for modern models

By florestefano1975·Created 3 years ago·Updated 7 months ago· 1,227
Portrait Master: Prompt Styler
    • text_out
    text_in
    styledescriptive
    add_extra_instructionstrue

    Prompt Styler is the pack's translator. Every other Portrait Master node emits SD1.5/SDXL-style weighted tags - (wavy chestnut hair:1.05), (amused expression:1.1) - and that syntax is exactly what modern LLM-encoded models like Flux 2 Klein, HiDream, Sana, or Anima throw in the bin. They read your prompt as a message to a language model, not a bag of weighted tokens; (word:1.3) gets discarded, the 77-token chunking that the weights were built for doesn't exist, and a raw PM tag dump lands flat. This node converts the pack's output into plain, conversational sentences those models actually understand.

    It's the node you use because you're on a modern model. If you're running SDXL, Illustrious, or Pony - the CLIP-encoded lineage where weights still mean something - leave it alone; stripping the weights would cost you useful emphasis.

    How it works

    The mechanism is a small text-processing pipeline, and it's easy to follow:

    1. Split text_in on commas into tags.
    2. Strip CLIP weight syntax: (tag:1.15)tag (drops the parentheses and the :number).
    3. Deduplicate tags (via dict.fromkeys), keeping first occurrence.
    4. Sniff the subject's gender from the tags - "woman/girl/female" → "a woman," "man/boy/male" → "a man," otherwise "a person."
    5. Rewrap everything into a template based on the style dropdown - descriptive, cinematic, illustrative, artistic, documentary, fashion, portrait, studio, or natural.
    6. If add_extra_instructions is on, append " Photorealistic, high resolution, dynamic lighting, intricate details."

    So a PM dump like (young woman:1.1), (studio light:1.05), (smile:1.2) becomes something like:

    Portrait photo of a young woman, studio light, smile, professional studio lighting, high quality. Photorealistic, high resolution, dynamic lighting, intricate details.
    

    Each style has its own template - cinematic adds "dramatic lighting, cinematic composition," documentary pushes "natural lighting, realistic scene," and so on.

    The inputs that matter

    There are only three:

    • text_in - wire the text_out of any other Portrait Master node in here. That's the intended flow.
    • style - the voice of the rewrite. descriptive is the safe default; portrait and studio are the closest to the pack's original intent.
    • add_extra_instructions - toggles that realism boilerplate appended to every prompt. Turn it off if you're feeding a model that hates long tails, or if you'd rather write your own.

    Output is a single text_out STRING, wired to your model's text encoder (typically CLIPTextEncodeFlux or whatever your checkpoint uses) instead of CLIPTextEncode.

    Installing it

    Part of comfyui-portrait-master - one install covers all seven nodes:

    cd ComfyUI/custom_nodes
    git clone https://github.com/florestefano1975/comfyui-portrait-master
    

    Restart ComfyUI, or search "Portrait Master" (florestefano1975) in ComfyUI Manager. No dependencies, no model downloads. Unlike the rest of the pack this node has no presets, no seed, no active toggle - it's a pure text filter.

    Common issues

    • On SDXL it makes results worse. Expected - it's stripping the weights that CLIP models still respect. Use it only for Flux/HiDream/Sana/Anima-class models.
    • The subject comes out as "a person." The gender sniffer only looks for a handful of keywords; if your prompt calls her a "model" without "woman," it falls back to generic. Nudge text_in toward words like "woman" or "man."
    • Prompts get long. All nine templates plus the extra-instructions tail can push past the effective attention budget on LLM encoders. Keep text_in tight, and consider turning off add_extra_instructions for terse models.
    CategoryAI WizArt/Portrait Master

    Inputs (3)

    NameTypeDefaultDescription
    text_inSTRING
    styleCOMBOdescriptive9 options: descriptive, cinematic, illustrative, artistic, documentary, fashion, +3
    add_extra_instructionsBOOLEANtrue

    Outputs (1)

    NameTypeDescription
    text_outSTRING