Portrait Master: Prompt Styler
The Portrait Master node that translates old-school weighted prompts for modern models
- text_out
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:
- Split
text_inon commas into tags. - Strip CLIP weight syntax:
(tag:1.15)→tag(drops the parentheses and the:number). - Deduplicate tags (via
dict.fromkeys), keeping first occurrence. - Sniff the subject's gender from the tags - "woman/girl/female" → "a woman," "man/boy/male" → "a man," otherwise "a person."
- Rewrap everything into a template based on the
styledropdown - descriptive, cinematic, illustrative, artistic, documentary, fashion, portrait, studio, or natural. - If
add_extra_instructionsis 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 thetext_outof any other Portrait Master node in here. That's the intended flow.style- the voice of the rewrite.descriptiveis the safe default;portraitandstudioare 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_intoward 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_intight, and consider turning offadd_extra_instructionsfor terse models.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| text_in | STRING | — | |
| style | COMBO | descriptive | 9 options: descriptive, cinematic, illustrative, artistic, documentary, fashion, +3 |
| add_extra_instructions | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text_out | STRING | — |