✍️ Module 4: Prompt Engineering — The Art of Speaking to the Machine
4.1 Fundamental Principles of Prompt Engineering
The prompt is the interface between human intention and automatic generation. A good prompt not only describes what is wanted, but also how it should be, including style, composition, lighting, perspective, and emotional context.
Key elements of an effective prompt:
- Main subject: “a Siamese cat”
- Action or state: “sleeping on a silk cushion”
- Artistic style: “watercolor style, soft strokes, pastel colors”
- Composition: “close-up, blurred background, natural lighting”
- Technical quality: “high resolution, 8K, fine details, no artifacts”
Complete example:
“A Siamese cat sleeping peacefully on a blue silk cushion, watercolor style with soft strokes and pastel colors, close-up with blurred background, natural window lighting, high resolution 8K, fine details, no artifacts”
4.2 Advanced Prompting Techniques
- Negative Prompts: Words or phrases to exclude from generation. E.g.: “deformed, blurry, extra fingers, low quality”.
- Weighting: Assign weights to certain terms using
(word: weight). E.g.: (Van Gogh style:1.3).
- Step Conditioning: In some pipelines, the prompt can vary across generation steps.
- Embeddings and Trigger Words: Use of custom embeddings (e.g., generated via Textual Inversion) that activate learned styles or concepts.
4.3 Common Mistakes and How to Avoid Them
- Overly vague prompts: “something beautiful” → provides insufficient information.
- Too many contradictory concepts: “realistic and cartoon at the same time” → confuses the model.
- Lack of structure: Mixing styles, actions, and qualities without hierarchy.
- Ignoring negative prompts: Results in images with artifacts or unwanted elements.