How to Write Effective AI Image Prompts for SDXL and Flux
With the same model, some create images as stunning as magazine photos, while others only get messy results. The biggest difference usually lies in the prompt – the description you give to the AI. This article shares how to write structured prompts, the differences between model generations, and testing workflows to help you achieve consistent results.
What is a Prompt and How Does a Model "Read" It?
A prompt is converted by a text encoder into numerical data that the diffusion model uses to guide the image generation process. It is important to remember:
- Models don't "understand" like humans; they associate words with what they've seen in training data.
- Different models are trained with different description styles, so the optimal way to write prompts also varies.
Basic Prompt Structure
A good prompt usually answers the following questions, in descending order of importance:
- Subject: who/what? (a young girl, an antique watch, a cat)
- Action/Pose: what are they doing? (sitting and reading, placed on a wooden table)
- Context: where, when? (a coffee shop, a rainy afternoon)
- Lighting: window light, neon lights, golden hour, studio lighting
- Composition/Camera Angle: close-up, full body, low angle, telephoto lens
- Style: realistic photography, watercolor painting, anime, 3D render
- Quality/Detail: sharpness, texture, dominant colors
Example: "Close-up portrait of a young girl reading a book by a cafe window, rainy afternoon, soft natural window light, warm tones, realistic photography, 85mm lens, slight bokeh."
Writing Prompts for SDXL and Tag-based Models
Many checkpoints based on SD 1.5/SDXL – especially anime branches like Pony and Illustrious – are trained with tags (keywords separated by commas). For this group:
- Use concise tags:
1girl, reading book, cafe, window light, rainy day, warm tones. - Place important elements first.
- Some models have specific quality tags or score tags defined by the author – be sure to read the model description on Civitai/Tensor.art.
- You can increase/decrease keyword weights using syntax like
(window light:1.2)in many interfaces.
Writing Prompts for Flux and Natural Language Models
New generation models like Flux or Qwen-Image use more powerful text encoders and understand natural language descriptions much better:
- Write in complete sentences, clearly describing relationships between objects: "a red cup placed to the left of an open book".
- You can describe text in the image (placed in quotes) – the text rendering capability in newer models is significantly better.
- No need for old-style quality tags; instead, describe specific textures, lighting, and lenses.
- Negative prompts often have little effect or are not supported in some configurations – describe what you want directly.
Negative Prompts: Using Them Correcty
For supported models, negative prompts help remove unwanted elements: blurry, low quality, watermark, text, extra fingers. Note:
- Don't stuff a long list copied from somewhere; it can make the image look "stiff" or unintentionally change the style.
- Only add them when you actually encounter that specific error.
Parameters Accompanying the Prompt
A good prompt still needs appropriate parameters:
- Size/Aspect Ratio: portrait for people, landscape for scenery. Use the native resolution the model was trained on.
- CFG (guidance): how closely the model follows the prompt; each model has its own recommended range.
- Steps, sampler: follow the model author's recommendations.
- Seed: keep it fixed during testing for a fair comparison.
If you use ComfyUI, see the ComfyUI guide for beginners to understand each parameter in KSampler.
Effective Testing Workflow
- Start simple: subject + context + style.
- Fix the seed, add elements one by one (lighting, camera angle...) to see the impact.
- Generate in batches of 4–8 images to evaluate trends, rather than relying on one lucky shot.
- Save good prompts as templates for each type of image: portrait, product, landscape.
- Combine LoRAs when you need specific characters, styles, or products – prompts cannot fully replace training data. See how to train character LoRAs.
Common Mistakes
- Contradictory descriptions: "bright sunlight, late at night" confuses the model.
- Too many subjects: the model can easily mix up characteristics between characters.
- Vague words: "beautiful", "impressive" have less value than specific descriptions like "rim lighting, dark background, cool blue tones".
- Writing prompts in the wrong "language" for the model: using long sentences for tag-based models, or disjointed tag strings for natural language models.
Prompts in Real-World Applications
When integrating image generation into products via API, end users are often not good at writing prompts. A common solution is prompt templates: the user only enters the subject, and the system automatically appends styles, lighting, and optimized parameters. If you are building such a feature, try the image generation API at Lumina (details: AI Image Generation API by SDG) with pre-optimized models.
Conclusion
Writing effective prompts is a learnable skill: understand the model you are using, describe things structurally and specifically, and test methodically. Start with the simple structure above, read the model author's instructions carefully, and save effective prompts for long-term use.


