Agent skill

Prompt Engineering

by artokun in artokun/comfyui-mcp

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

MITAuto-check passedAI & LLM Engineering

Install Prompt Engineering

skills CLI
$ npx skills add artokun/comfyui-mcp --skill prompt-engineering -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install artokun/comfyui-mcp prompt-engineering --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/artokun/comfyui-mcp.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugin/skills/prompt-engineering .claude/skills/prompt-engineering && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
prompt-engineering
GitHub stars
800
Token cost
~2.9k tokens
SKILL.md length
1,140 words
Files
1
Skills in repo
42
Repo updated
First seen
Licence
MIT

At a glance

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

  • Works in 9 steps: Quality modifiers (if SD 1.5/SDXL):… → Subject: a young woman, a cyberpunk… → Subject details: with long flowing red… → …
  • Tasks that involve Diffusion and image models
  • SKILL.md covers CLIP Text Encoding Fundamentals, Weight Syntax, BREAK Token and Embeddings / Textual Inversions, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Prompt Engineering is an agent skill from artokun/comfyui-mcp. ComfyUI prompt engineering knowledge covering CLIP text encoding syntax, weight modifiers, model-specific prompting strategies, and best practices

Its SKILL.md is about 2.9k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in AI & LLM Engineering, covering Diffusion and image models, Prompt engineering and Embeddings. It works with ComfyUI. The repository describes itself as: Local-first, agent-native control plane for ComfyUI — MCP server + sidebar agent that generates images, video & audio, authors and runs workflows, and edits your live graph in… The licence is MIT.

When your agent uses it

  • Tasks that involve Diffusion and image models
  • Tasks that involve Prompt engineering
  • Tasks that involve Embeddings

Example prompts

  • “/prompt-engineering”

Workflow steps

9 steps, taken from the first numbered list in SKILL.md.

  1. Quality modifiers (if SD 1.5/SDXL): masterpiece, best quality, highly detailed
  2. Subject: a young woman, a cyberpunk cityscape, a golden retriever
  3. Subject details: with long flowing red hair, wearing a white dress
  4. Action/pose: standing in a field, looking at the camera, running
  5. Environment: in a sunlit meadow, at night in a neon-lit street
  6. Composition: close-up portrait, full body shot, wide angle
  7. Lighting: dramatic lighting, soft natural light, studio lighting, golden hour
  8. Style/medium: oil painting, photograph, digital art, watercolor, anime
  9. Technical quality: 8k, uhd, photorealistic, sharp focus, depth of field

What it can do on your machine

Read from SKILL.md and the folder at commit 6ad6fc0. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Prompt Engineering loads about 2.9k tokens when it runs. Until then it costs about 41 tokens; SKILL.md has 1,140 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~41
When it runs · the whole SKILL.md, loaded when a task matches
~2.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from artokun/comfyui-mcp at commit 6ad6fc0, republished under its MIT licence (© artokun). 1,140 words, ~2,938 tokens.

Download SKILL.mdSave it as .claude/skills/prompt-engineering/SKILL.md (or your agent's skills folder).
name
prompt-engineering
description
ComfyUI prompt engineering knowledge covering CLIP text encoding syntax, weight modifiers, model-specific prompting strategies, and best practices
globs
**/*.json

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
  • Prompt exceeds ~60 words (approaching the 77-token limit)
  • You want to separate conceptually distinct parts of the prompt
  • Certain details are being ignored (they may be past the 77-token cutoff)
BREAK Example
masterpiece, best quality, a beautiful Japanese garden with cherry blossoms,
stone lanterns, koi pond, traditional wooden bridge, morning mist
BREAK
highly detailed, 8k uhd, photorealistic, volumetric lighting,
depth of field, golden hour, award-winning photography

Each chunk is encoded independently and then concatenated as conditioning, so all tokens are processed.

Embeddings / Textual Inversions

Embeddings (textual inversions) are pre-trained token sets that encode complex concepts into a single trigger word.

Syntax
embedding:easynegative
embedding:badhandv4
embedding:bad-image-v2-39000
Usage in Prompts
  • Place embedding triggers directly in the prompt text
  • Most commonly used in negative prompts to improve quality
  • The embedding .safetensors or .pt file must be in models/embeddings/
Common Negative Embeddings
EmbeddingBest ForDescription
easynegativeSD 1.5General quality improvement
badhandv4SD 1.5Fixes hand deformities
bad-image-v2-39000SD 1.5Reduces artifacts
negativeXL_DSDXLSDXL-specific negative embedding
ac_neg1SDXLAlternative SDXL negative
Example with Embeddings

Positive: a portrait of a woman, masterpiece, best quality Negative: embedding:easynegative, embedding:badhandv4, worst quality, low quality

Model-Specific Prompting

SD 1.5

Negative prompt: IMPORTANT. SD 1.5 is sensitive to negatives.

Positive prompt structure:

(masterpiece:1.2), (best quality:1.2), subject description, details, style tags

Recommended negative prompt:

worst quality, low quality, normal quality, lowres, watermark, signature,
text, jpeg artifacts, blurry, bad anatomy, bad hands, extra fingers,
missing fingers, extra limbs, deformed, disfigured, mutation, ugly

Key notes:

  • Quality tags like masterpiece, best quality make a large difference to output
  • Responds well to danbooru-style tags: 1girl, long hair, blue eyes, school uniform
  • Embedding-based negatives (easynegative) work well
  • Keep prompts concise, since each chunk is limited to 77 tokens
SDXL (1.0 / Turbo / Lightning)

Negative prompt: Moderate importance. SDXL is less sensitive to negatives than SD 1.5.

Positive prompt structure:

subject description with natural language, detailed description of scene and style

Recommended negative prompt:

blurry, low quality, deformed, ugly, bad anatomy, disfigured, poorly drawn face,
mutation, mutated, extra limbs, watermark, text

Key notes:

  • SDXL understands natural language better than tag-based prompts
  • Dual CLIP encoders (CLIP-L + CLIP-G). Use CLIPTextEncodeSDXL for separate control
  • CLIPTextEncodeSDXL has separate text_g (global description) and text_l (local details) fields
  • Supports longer prompts natively (two 77-token chunks via dual CLIP)
  • Quality tags are less critical but still helpful
  • SDXL Turbo: 1-4 steps, CFG 1.0-2.0, minimal negative prompt needed
  • SDXL Lightning: 4-8 steps, CFG 1.0-2.0, often works with empty negative
Flux (Flux.1 schnell / dev)

Negative prompt: NOT USED. Flux operates at CFG=1.0 with no negative conditioning.

Positive prompt structure:

Detailed natural language description. Flux excels with descriptive sentences
rather than comma-separated tags. Describe the scene as if writing a paragraph.

Key notes:

  • CFG must be 1.0. Higher values cause artifacts
  • No negative prompt. Connect nothing or empty string to negative conditioning
  • T5-XXL encoder understands complex sentences and spatial relationships
  • Flux handles compositional prompts better than SD models
  • Longer prompts (200+ tokens) work well thanks to T5 encoder
  • Prompt structure: describe the scene naturally, like a caption
  • Schnell: 4 steps, simple scheduler
  • Dev: 20-50 steps, sgm_uniform scheduler
Flux Prompt Example
A serene Japanese garden in autumn. A stone path leads through a grove of maple
trees with bright red and orange leaves. A small wooden bridge crosses a koi pond
where golden fish swim beneath the surface. Morning mist rises from the water,
and soft sunlight filters through the canopy. The scene is photorealistic with
warm, natural lighting and shallow depth of field.
SD3 / SD3.5

Negative prompt: Minimal. SD3 needs little negative guidance.

Positive prompt structure:

Natural language description, supports very long detailed prompts thanks to T5-XXL

Key notes:

  • Triple CLIP architecture: CLIP-L + CLIP-G + T5-XXL
  • Supports much longer prompts than SD 1.5 or SDXL
  • Natural language works better than tag-based prompting
  • CFG 4-7 (lower than SD 1.5)
  • Minimal negatives needed. low quality, blurry is usually sufficient
  • Use CLIPTextEncodeSD3 node for model-specific encoding if available

Prompt Structure Best Practices

Show full SKILL.md (474 more words)Show less
  1. Quality modifiers (if SD 1.5/SDXL): masterpiece, best quality, highly detailed
  2. Subject: a young woman, a cyberpunk cityscape, a golden retriever
  3. Subject details: with long flowing red hair, wearing a white dress
  4. Action/pose: standing in a field, looking at the camera, running
  5. Environment: in a sunlit meadow, at night in a neon-lit street
  6. Composition: close-up portrait, full body shot, wide angle
  7. Lighting: dramatic lighting, soft natural light, studio lighting, golden hour
  8. Style/medium: oil painting, photograph, digital art, watercolor, anime
  9. Technical quality: 8k, uhd, photorealistic, sharp focus, depth of field
Quality Boosters

These tokens generally improve output quality across SD 1.5 and SDXL:

masterpiece, best quality, highly detailed, 8k, photorealistic,
ultra-detailed, sharp focus, professional, award-winning

For photorealism specifically:

photorealistic, hyperrealistic, RAW photo, DSLR, 8k uhd,
film grain, Fujifilm XT3, sharp focus, natural lighting

For anime/illustration:

masterpiece, best quality, highly detailed, anime,
beautiful detailed eyes, detailed face, illustration

LoRA Trigger Words

LoRA (Low-Rank Adaptation) models are fine-tuned on specific concepts and require their trigger words to activate the learned concept.

Rules
  • Trigger words are specific to each LoRA. Check the LoRA's model page for its triggers
  • Place trigger words in the prompt naturally: a photo of ohwx woman in a garden (where ohwx is the trigger)
  • Some LoRAs use style triggers: in the style of pixar3d
  • Multiple LoRAs can be stacked, but each needs its own trigger word in the prompt
  • LoRA strength (in the LoraLoader node) interacts with prompt weight. Usually keep one at default
Common Patterns
# Character LoRA
a photo of sks person, wearing casual clothes, in a park

# Style LoRA
a landscape painting, autumn forest, in the style of impressionism, masterpiece

# Concept LoRA
a character wearing mecha_armor, standing in a battlefield, detailed

Wildcards and Dynamic Prompts

If ComfyUI-Impact-Pack or a wildcard node pack is installed, you can use dynamic prompt syntax:

Wildcard Syntax
a {red|blue|green|yellow} car parked on a {sunny|rainy|snowy} street

Each {option1|option2|option3} randomly selects one option per generation.

Wildcard Files

Wildcard .txt files (one option per line) can be referenced:

a __haircolor__ haired woman wearing a __clothing__ in __location__

Where haircolor.txt, clothing.txt, and location.txt are in the wildcards directory.

CLIPTextEncode Variants

NodeUse CaseNotes
CLIPTextEncodeStandard single-CLIP encodingWorks with all models
CLIPTextEncodeSDXLSDXL dual-CLIP with separate G/L fieldsBetter SDXL control
CLIPTextEncodeSD3SD3 triple-CLIP encodingFor SD3/SD3.5 models
CLIPTextEncodeFluxFlux T5-based encodingFor Flux models
ConditioningCombineMerge two conditioningsStack different prompt aspects
ConditioningSetAreaRegional promptingApply conditioning to specific image areas
ConditioningSetMaskMask-based conditioningApply prompt only where mask is active

Common Prompting Mistakes

  1. Using negative prompts with Flux: Flux ignores negatives and CFG > 1 causes artifacts
  2. Tag-based prompts for Flux/SD3: These models prefer natural language descriptions
  3. Exceeding 77 tokens without BREAK: Tokens past the limit are silently dropped
  4. Weight > 1.5: Causes color bleeding, artifacts, and distortion
  5. Conflicting terms: (bright:1.3) (dark:1.3) confuses the model
  6. Embedding without file: Using embedding:name without the .safetensors file installed causes errors
  7. Wrong LoRA trigger words: The prompt must contain the exact trigger word(s) for the LoRA to activate
  8. Quality tags in Flux prompts: masterpiece, best quality are meaningless for Flux. Describe quality naturally

Sources

  • Official: none found as a dedicated vendor prompting guide. CLIP (word:1.2) attention is community convention (A1111/ComfyUI), not a model-vendor spec.
  • Empirical: model-specific notes (Flux CFG=1, SD 1.5 quality tags, BREAK token) from observed ComfyUI behaviour.

© artokun, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in plugin/skills/prompt-engineering of artokun/comfyui-mcp.

Open the folder on GitHubat commit 6ad6fc0

Compare with similar skills

Prompt Engineering next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Prompt Engineering compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Prompt Engineering this skillartokun/comfyui-mcp800—~2.9kAutomated safety check: PassMIT
Comfyui AnimatoolShiroEirin/comfyui-good-anima481—~4.6kAutomated safety check: PassGPL-3.0
Comfyui Agent Skill MieMieMieeeee/comfyui-agent-skill116—~3.9kAutomated safety check: PassApache-2.0
Importing SubgraphsComfy-Org/workflow_templates1.3k—~1.5kAutomated safety check: PassMIT
Comfyui Node Addernixified-ai/flake841—~806Automated safety check: PassAGPL-3.0
Managing BundlesComfy-Org/workflow_templates1.3k—~1.2kAutomated safety check: PassMIT

Similar skills

  • Comfyui Animatool

    ShiroEirin/comfyui-good-anima

    Route ALL Anima image generation: validate Danbooru hard anchors, form visual brief, assemble English prompts and args, then load comfyui-manager for workflow execution.

    481 GitHub stars~4.6k tokensUpdated 3 mo ago
    AI & LLM EngineeringAuto-check passed
  • Comfyui Agent Skill Mie

    MieMieeeee/comfyui-agent-skill

    Agent skill for running registered ComfyUI workflows through a stable CLI, and for importing a user's own ComfyUI workflow into their private registry after review.

    116 GitHub stars~3.9k tokensUpdated 5 days ago
    AI & LLM EngineeringAuto-check passed
  • Importing Subgraphs

    Comfy-Org/workflow_templates

    Imports and registers subgraph blueprints into the ComfyUI workflowtemplates repository.

    1.3k GitHub stars~1.5k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Comfyui Node Adder

    nixified-ai/flake

    Adds new custom nodes to the ComfyUI Nix project, including npins fetching, dependency resolution in package.nix, disabling impure pip installs, and verifying the Nix build.

    841 GitHub stars~806 tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Managing Bundles

    Comfy-Org/workflow_templates

    Manages template bundles, categories, and ordering in the ComfyUI template repository.

    1.3k GitHub stars~1.2k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Headroom

    momori777/Artemis

    SmartCrusher + CCR context compression — crunch large JSON arrays, tool outputs, and search results to save tokens.

    378 GitHub stars~562 tokensUpdated 8 days ago
    AI & LLM EngineeringAuto-check passed

More from artokun/comfyui-mcp

All 42 skills in this repo
  • AI Toolkit Trainer

    artokun/comfyui-mcp

    Train custom LoRAs with ostris AI-Toolkit. An agent skill from artokun/comfyui-mcp.

    800 GitHub stars~2.7k tokensUpdated 4 days ago
    Auto-check passed
  • Anima Base

    artokun/comfyui-mcp

    Anime/illustration text-to-image (ANIMA 1.0, ~2B Cosmos DiT).

    800 GitHub stars~4k tokensUpdated 4 days ago
    Auto-check passed
  • Civitai

    artokun/comfyui-mcp

    Discover Civitai models with the BUILT-IN downloadmodel action:"searchcivitai" and install/generate them locally.

    800 GitHub stars~1.1k tokensUpdated 4 days ago
    Auto-check passed
  • Color Correction

    artokun/comfyui-mcp

    Diagnose and fix video/image color OBJECTIVELY with the getimage (action:"analyzecolor") tool (scopes/stats such as black/white points, contrast, saturation, clipping, cast) instead of eyeballing a…

    800 GitHub stars~2.4k tokensUpdated 4 days ago
    Auto-check passed
  • Comfyui Frontend Extensions

    artokun/comfyui-mcp

    Authoring ComfyUI v2 frontend extensions with @comfyorg/extension-api, covering defineNode/defineExtension/defineWidget, shell UI (sidebar tabs, commands, hotkeys), typed events, and handles.

    800 GitHub stars~5.4k tokensUpdated 4 days ago
    Auto-check passed
  • Comfyui Launch Flags

    artokun/comfyui-mcp

    Pick the right ComfyUI startup flags for VRAM, attention, caching, and speed.

    800 GitHub stars~3.1k tokensUpdated 4 days ago
    Auto-check passed

Works with

Questions about Prompt Engineering

What does Prompt Engineering do?

ComfyUI prompt engineering knowledge covering CLIP text encoding syntax, weight modifiers, model-specific prompting strategies, and best practices. Prompt Engineering is an agent skill from artokun/comfyui-mcp.

When should I use Prompt Engineering?

Prompt Engineering fits situations like: tasks that involve Diffusion and image models; tasks that involve Prompt engineering; tasks that involve Embeddings.

How do I install Prompt Engineering in Claude Code?

Run `npx skills add artokun/comfyui-mcp --skill prompt-engineering -a claude-code`. Or copy the skill folder (plugin/skills/prompt-engineering in artokun/comfyui-mcp) into .claude/skills/prompt-engineering in your project. Claude Code loads it when a task matches its description.

How do I install Prompt Engineering in Codex?

Run `npx skills add artokun/comfyui-mcp --skill prompt-engineering -a codex`. Or copy the skill folder (plugin/skills/prompt-engineering in artokun/comfyui-mcp) into .agents/skills/prompt-engineering in your project. Codex loads it when a task matches its description.

Can I use Prompt Engineering in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add artokun/comfyui-mcp --skill prompt-engineering -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/prompt-engineering, .gemini/skills/prompt-engineering, .github/skills/prompt-engineering and .opencode/skills/prompt-engineering in your project.

What does Prompt Engineering need to run?

SKILL.md names no scripts, command-line tools or credentials: Prompt Engineering is instructions for the agent only.

Does Prompt Engineering access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Prompt Engineering safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Prompt Engineering use?

Prompt Engineering is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Prompt Engineering use?

About 2.9k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Prompt Engineering?

Skills that share tags, products or a category with Prompt Engineering: Comfyui Animatool (ShiroEirin/comfyui-good-anima, 481 stars), Comfyui Agent Skill Mie (MieMieeeee/comfyui-agent-skill, 116 stars), Importing Subgraphs (Comfy-Org/workflow_templates, 1.3k stars) and Comfyui Node Adder (nixified-ai/flake, 841 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Prompt Engineering?

artokun (a GitHub user) maintains it in artokun/comfyui-mcp, which has 800 GitHub stars. The repository holds 42 skills in this directory. The repository was last updated on October 5, 2026.

Source: artokun/comfyui-mcp on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.