Prompt Engineering: Getting Better Results
Learn how to dramatically improve the quality of your AI-generated content through skillful prompting.
Table of Contents
01What Is Prompt Engineering?
Prompt engineering is the art of formulating instructions (prompts) so that AI models deliver the best possible results. A good prompt can make the difference between a mediocre and an impressive result. It's not programming, but rather like writing a detailed description for an artist.
02Structure of a Good Prompt
An effective prompt for image generation typically contains:
- Subject: What should be depicted? (e.g., 'a woman', 'a cityscape', 'a robot')
- Style: What artistic style? (e.g., 'photorealistic', 'anime', 'oil painting', 'digital art')
- Details: Specific features (e.g., 'long flowing red hair', 'golden hour lighting', 'rain reflections')
- Composition: How should the image be composed? (e.g., 'close-up portrait', 'wide-angle landscape', 'birds eye view')
- Quality Boosters: Technical terms for higher quality (e.g., 'masterpiece', '8k uhd', 'highly detailed', 'sharp focus')
- Negative Prompts: What should NOT be in the image (e.g., 'blurry', 'low quality', 'deformed hands', 'watermark')
03Example: Step by Step
Bad: 'a cat' Better: 'a fluffy orange tabby cat sitting on a windowsill' Very good: 'a fluffy orange tabby cat sitting on a sunlit windowsill, soft bokeh background, warm golden hour lighting, photorealistic, highly detailed fur texture, 8k, shot on Canon EOS R5' Negative Prompt: 'blurry, low quality, cartoon, deformed, bad anatomy, watermark, text' Notice how each improvement gives the model more context and direction.
04Prompt Weighting
Most AI tools support weighting of prompt elements. In ComfyUI and Stable Diffusion, you can use parentheses to increase or decrease the importance of terms: (important term:1.3) – increases weight by 30% (less important:0.7) – decreases weight by 30% Example: '(golden hour lighting:1.4), a portrait of a woman, (soft bokeh:1.2), photorealistic' Use weighting sparingly – too extreme values (above 1.5) can lead to artifacts.
05Prompts for Video Models
Video prompts differ from image prompts. Describe motion and temporal sequence: - Describe camera movement: 'slow camera pan from left to right' - Describe object movements: 'a bird gracefully soaring through clouds' - Keep the prompt shorter than for images – video models prefer concise descriptions - Avoid too many simultaneous movements
06Common Mistakes to Avoid
Avoid these common mistakes:
- Too vague descriptions: 'beautiful landscape' gives the model too little information
- Contradictory instructions: 'night with bright sunshine' confuses the model
- Too long prompts: More than 75-100 tokens are truncated by many models
- Using only nouns: Adjectives and context descriptions are crucial
- Ignoring negative prompts: They are just as important as the positive prompt