ComfyUI Node

Prompt Style Encoder

203 art styles in one dropdown, no LoRA required

By Isi-dev·Created 2 years ago·Updated 10 months ago· 33
Prompt Style Encoder
  • clip
  • +VE
  • -VE
positive_prompt
negative_prompt
style

If you've loaded one of this pack's img2img workflows, this is the node doing the prompt encoding. It's a CLIPTextEncode with a 203-entry style dropdown bolted on - pick "ps1" or "disney" or "Cyberpunk" and it encodes your prompt as that style without you writing a single style tag. That's the whole pitch, and it's genuinely convenient for A/B-ing looks while you iterate.

The name is a lie in the good way. "Style Encoder" sounds like it needs a model or an API key. It needs neither. Open the node and you'll see it's a thin wrapper over ComfyUI's own CLIP encoding path: it tokenizes your text, encodes with pooled output, and hands back a conditioning. The "style" is just a block of canned prompt text - a styles.json file full of hand-written positive/negative pairs that ships with the pack. generate_prompts prepends the style's text to your prompt and negative, and the rest is bog-standard CLIPTextEncode machinery.

You can tell they're hand-typed. Style "anime1" cheerfully begins "Japanese comic book anime style, samurai x..." - someone's favourite 90s anime leaking into the prompt. It's part of the charm, and it means you can edit styles.json yourself. It's loaded at runtime, so add your own entries and they show up in the dropdown after a reload.

The inputs and outputs that matter

  • positive_prompt / negative_prompt - your text, multiline. The style text gets prepended to both, so keep yours short-ish.
  • style - the 203-choice dropdown. none is a plain encode with no style text, useful as a baseline.
  • clip - the CLIP model from your checkpoint loader. No extra model download for this node.

Outputs are +VE and -VE conditioning, which wire straight into the KSampler's positive and negative inputs exactly like a stock CLIPTextEncode. There is no trick here.

Installing it

It ships in the ComfyUI-Animation_Nodes_and_Workflows pack by Isi-dev (an animation-focused dev who also maintains the UniAnimate-W nodes). Install the pack once and you get all eight nodes:

  • ComfyUI Manager → search ComfyUI-Animation_Nodes_and_Workflows → install, restart.
  • Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/Isi-dev/ComfyUI-Animation_Nodes_and_Workflows
cd ComfyUI-Animation_Nodes_and_Workflows
pip install -r requirements.txt

The requirements are torch, torchaudio, numpy, opencv-python, mediapipe. The only heavy one is mediapipe, and it's only used by the pack's LivePortrait face node - the style encoder itself just needs whatever CLIP you already load. No model downloads, no API keys, all local.

Gotchas

  • On SD 1.5 you have a 77-token CLIP limit, and the style text is prepended to your prompt. Long style plus long prompt means your tail gets truncated - write tight.
  • The tag-stack styles (anime, comic, ps1) are built for tag-based checkpoints like SD 1.5 and SDXL. Feeding "PS1 style, low-poly..." at a Flux-class T5 that wants natural language is a different game, and several of these styles won't read the way they're written there.
  • Red node after install usually means Manager didn't grab the pack's requirements - run pip install -r requirements.txt manually and restart.

It's a small, honest utility. For quick style shuffling it beats juggling a folder of prompt presets; just don't expect it to be a substitute for an actual style LoRA - it's text, not weights.

Categoryconditioning

Inputs (4)

NameTypeDefaultDescription
positive_promptSTRINGThe text to be encoded.
negative_promptSTRINGThe text to be encoded.
styleCOMBO203 options: none, anime1, anime2, beauArt, black Line art, comic1, +197
clipCLIPThe CLIP model used for encoding the text.

Outputs (2)

NameTypeDescription
+VECONDITIONINGA conditioning containing the embedded text used to guide the diffusion model.
-VECONDITIONING