Logo de Prompt Engineering

Prompt Engineering

Comunidade
artokun
prompt-engineering

Conhecimentos de engenharia de prompt para ComfyUI, incluindo sintaxe de codificação de texto do CLIP, modificadores de peso, estratégias de prompt específicas para cada modelo e práticas recomendadas

Add to TypingMind

Visão geral

Publicado porartokun
Repositóriocomfyui-mcp
Nome da habilidadeprompt-engineering
Estrelas
811
Forks
137
Arquivos incluídos
Somente instruções
LicençaMIT
Links
  • Instruções em Markdown

    Um arquivo SKILL.md que o modelo carrega sob demanda, consumindo tokens apenas quando uma solicitação é realmente relevante para a habilidade.

  • Funciona com qualquer LLM

    As habilidades de IA são escritas em Markdown simples, não em código específico de um provedor. Por isso, funcionam com GPT, Claude, Gemini, Grok ou um modelo local.

  • Sem arquivos extras

    Tudo de que o modelo precisa está nas instruções — sem arquivos extras para sincronizar.

  • Código aberto

    Publicada por artokun no GitHub. Leia os arquivos da habilidade antes de instalá-la.

Instalação

Instale a habilidade de IA Prompt Engineering no TypingMind para usá-la com qualquer LLM ou adicione-a a outro agente que leia SKILL.md.

1

Instalar no TypingMind

O TypingMind instala uma habilidade diretamente da pasta dela no GitHub — lê o arquivo SKILL.md, reúne os arquivos de recursos em um pacote e armazena o resultado localmente.

  1. Abra o app e vá para Plugins → Habilidades.
  2. Escolha "Instalar do GitHub".
  3. Cole a URL abaixo, que aponta para a pasta da habilidade, e confirme.
    https://github.com/artokun/comfyui-mcp/tree/main/plugin/skills/prompt-engineering
  4. Ative a habilidade em cada chat em que quiser disponibilizá-la.
Plugins → Habilidades → Adicionar habilidade → Via URL do GitHub. Depois, cole a URL da pasta e pressione Continuar.
2

Instalar em outro agente

Qualquer agente que leia o formato Agent Skills pode usar esta habilidade — copie a pasta para o diretório de habilidades desse agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/artokun/comfyui-mcp.git /tmp/comfyui-mcp
mkdir -p .claude/skills
cp -r /tmp/comfyui-mcp/plugin/skills/prompt-engineering .claude/skills/prompt-engineering
Reinicie Claude Code após copiar para que a nova habilidade seja reconhecida.

Use no TypingMind

Ative Prompt Engineering em qualquer chat do TypingMind e o modelo cuida do resto. O nome e a descrição da habilidade ficam no prompt do sistema e, assim que uma solicitação relevante aparece, o modelo carrega as instruções completas automaticamente — sem precisar de acionamento manual e sem consumir tokens até que ela seja realmente usada.

O modelo carrega Prompt Engineering automaticamente assim que uma solicitação é relevante para essa habilidade.

Funciona com qualquer modelo de IA

Habilidades de IA são instruções em Markdown simples, não código específico de um provedor. Por isso, Prompt Engineering não fica vinculada ao modelo para o qual foi criada. Instale-a uma vez no TypingMind e use-a com GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ou um modelo local executado por conta própria — tudo com suas próprias chaves de API.

  • Carregada apenas quando necessário

    O prompt do sistema contém apenas o nome e a descrição. As instruções são buscadas na primeira solicitação relevante, então uma habilidade sem uso não gera custo.

  • Troque de modelo durante a conversa

    Como a habilidade é composta de instruções, não de código, trocar de modelo não afeta seu funcionamento — o próximo modelo lê o mesmo arquivo SKILL.md.

Instruções da habilidade

Este é o conteúdo de SKILL.md que o modelo carrega. Leia antes de instalar — uma habilidade é um conjunto de instruções que seu modelo seguirá.

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

Recommended Order

  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.

Perguntas frequentes

O que a habilidade de IA Prompt Engineering faz?

Conhecimentos de engenharia de prompt para ComfyUI, incluindo sintaxe de codificação de texto do CLIP, modificadores de peso, estratégias de prompt específicas para cada modelo e práticas recomendadas

Por que usar Prompt Engineering no TypingMind?

Porque basta instalar uma vez para usar com qualquer modelo. A habilidade Prompt Engineering é escrita em Markdown simples, e não em código específico de um provedor, então a mesma habilidade funciona com GPT-5, Claude, Gemini, Grok ou um modelo local — e é possível trocar de modelo no meio do chat sem que ela deixe de funcionar. No TypingMind, você usa suas próprias chaves de API e paga diretamente aos provedores, em vez de pagar uma assinatura por licença de usuário. Suas habilidades e chats permanecem no seu próprio armazenamento.

Como instalar Prompt Engineering no TypingMind?

Abra Plugins → Habilidades → Instalar do GitHub no TypingMind e cole https://github.com/artokun/comfyui-mcp/tree/main/plugin/skills/prompt-engineering. O TypingMind lê o arquivo SKILL.md e instala a habilidade para que possa ser ativada em cada chat.

Quais modelos de IA podem usar Prompt Engineering?

Qualquer modelo conectado no TypingMind. As habilidades de IA são instruções em Markdown simples, e não código específico de um provedor. Assim, GPT, Claude, Gemini, Grok e modelos locais podem carregar esta habilidade quando uma solicitação corresponder a ela.

Quantos modelos de IA posso usar com Prompt Engineering?

Quantos quiser. Desde que o modelo ofereça suporte a habilidades, é possível usar Prompt Engineering com ele — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e outros — tudo no TypingMind com suas próprias chaves de API.

A habilidade de IA Prompt Engineering é gratuita?

Sim. A habilidade é publicada no GitHub por artokun sob a licença MIT. O pagamento é feito apenas ao seu provedor de IA pelos tokens usados.

O que são habilidades de IA?

Uma habilidade de IA é um conjunto reutilizável de instruções que ensina um modelo de IA a realizar uma tarefa específica. Ela segue o formato aberto Agent Skills: um arquivo SKILL.md com nome e descrição, além de scripts, templates ou arquivos de referência de que o modelo possa precisar. O modelo lê as instruções apenas quando sua solicitação corresponde à habilidade, então uma habilidade instalada não gera custos até ser usada.

Qual é a diferença entre habilidades de IA e plugins ou servidores MCP?

Um plugin ou servidor MCP oferece ao modelo novas ferramentas que ele pode acionar — código que é executado em algum lugar e retorna um resultado. Já uma habilidade de IA dá ao modelo o conhecimento e as orientações de que ele precisa: como abordar uma tarefa, quais etapas seguir e como deve ser um bom resultado. As habilidades são escritas em Markdown simples, por isso não precisam de servidor, chave de API nem ambiente de execução, e funcionam com qualquer modelo.

Ver lista completa

Crie seu próprio espaço de trabalho com IA agora

Inscreva-se na nossa newsletter para receber avisos sobre novos recursos e futuros sorteios 👇