Skills

Prompt Engineering

ComfyUI prompt engineering knowledge covering CLIP text encoding syntax, weight...

Install

npx skills add artokun/comfyui-mcp --skill prompt-engineering -g -a claude-code -y
Repository
artokun/comfyui-mcp883
Category
AI and agents
Updated
9d ago
License
MIT
Context cost
Mediumabout 2,884 tokens
Runs scripts
No, instructions only

What it does

ComfyUI prompt engineering knowledge covering CLIP text encoding syntax, weight modifiers, model-specific prompting strategies, and best practices

ComfyUI Prompt Engineering

CLIP Text Encoding Fundamentals

ComfyUI uses CLIP (Contrastive Language-Image Pre-training) text encoders to convert text prompts into conditioning tensors. The CLIPTextEncode node takes a text string and a CLIP model, producing a CONDITIONING output for the KSampler.

Token Limit

CLIP processes text in 77-token chunks. Each word is typically 1-3 tokens. Prompts exceeding 77 tokens are silently truncated unless you use the BREAK token or a multi-clip encoding node.

Weight Syntax

Emphasis (Attention Weights)

Adjust how strongly the model attends to specific words or phrases:

SyntaxEffectEquivalent Weight
(word:1.3)Increase emphasis by 30%Explicit weight 1.3
(word:0.7)Decrease emphasis by 30%Explicit weight 0.7
(word)Slight increase(word:1.1)
((word))Moderate increase(word:1.21), 1.1^2
(((word)))Strong increase(word:1.331), 1.1^3
[word]Slight decrease(word:0.9091), 1/1.1
[[word]]Moderate decrease(word:0.8264), 1/1.1^2

Weight Rules

  • Valid range: 0.0 to 2.0 (going beyond 1.5 often causes artifacts)
  • Default weight: 1.0 for unmodified tokens
  • Nesting stacks multiplicatively: ((word)) = 1.1 * 1.1 = (word:1.21)
  • Phrases: (red sports car:1.3) applies weight to the entire phrase
  • Mixing: (detailed face:1.4), (blurry background:0.6), combined in one prompt

Examples

a (beautiful:1.3) woman with (flowing red hair:1.2), wearing a blue dress, (sharp focus:1.1)
(masterpiece:1.4), (best quality:1.3), a knight in (ornate armor:1.2), standing on a cliff, (dramatic lighting:1.1), cinematic

BREAK Token

The BREAK keyword forces CLIP to end the current 77-token chunk and start processing subsequent text in a new chunk. This is critical for long prompts.

When to Use BREAK

Read the whole SKILL.md on GitHub

More in AI and agents