# Prompt Engineering

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

- Repository: https://github.com/artokun/comfyui-mcp (883 stars)
- Category: AI and agents
- License: MIT
- Last updated: 2026-10-26
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add artokun/comfyui-mcp --skill prompt-engineering -g -a claude-code -y`
Codex: `npx skills add artokun/comfyui-mcp --skill prompt-engineering -g -a codex -y`
Cursor: `npx skills add artokun/comfyui-mcp --skill prompt-engineering -g -a cursor -y`
Gemini CLI: `npx skills add artokun/comfyui-mcp --skill prompt-engineering -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add artokun/comfyui-mcp`

## Description

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

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 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:

| Syntax | Effect | Equivalent 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

The rest: https://github.com/artokun/comfyui-mcp/blob/HEAD/plugin/skills/prompt-engineering/SKILL.md
