Prompt enhancement is the unglamorous step behind many good AI images: a language model quietly expands "a corgi playing guitar in the rain" into a paragraph about lighting, lens and layout before the image model ever sees it. A new paper from the Qwen team, Qwen-Image-PE: Learning Visual Design for Text-to-Image Prompt Enhancement, argues that most enhancers add appeal but ignore design, and shows how to train one that does not.
The practical news is that a 9B version is already on Hugging Face. If you use Qwen's image models, it is a drop-in front end you can run yourself.
TL;DR: Qwen-Image-PE at a glance
| Question | Answer |
|---|---|
| What is it? | A prompt enhancer that rewrites short image requests into detailed visual specifications |
| Who built it? | Qwen (Alibaba), paper submitted to Hugging Face papers on October 27, 2026 |
| Training | Two stages: supervised fine-tuning with Caption-Based Reverse Distillation (CRD), then reinforcement learning with Groupwise Design Reward (GDR) |
| Headline result | Qwen-Image-PE-397B improves over original requests by 7.81 points on Qwen-Image-Bench with Qwen-Image-2.1; the 9B outperforms all evaluated PE baselines |
| What is released? | Qwen-Image-PE-9B, as Qwen/Qwen-Image-2.1-PE-T2I |
| License | Qwen Research License Agreement (not Apache 2.0) |
| Input and output | Short request in any language in, long English prompt plus aspect ratio out |
What problem does prompt enhancement solve?
Text-to-image models respond best to detailed prompts, but users type short ones. A prompt enhancer (PE) bridges the gap by expanding the request into a "coherent visual specification." The paper's complaint is that existing enhancers preserve user intent and generally raise overall appeal, but give "less explicit emphasis on fine-grained design dimensions." In plain terms, they make prompts longer and prettier without necessarily improving composition, lighting or layout.
This matters more as image models get more capable. Qwen's own Qwen-Image-2.1 Turbo release is a 7B-class open checkpoint; a good rewriter is often the cheapest way to raise output quality without touching the image model.
How does Qwen-Image-PE learn design?
The authors describe two stages.
Stage one: Caption-Based Reverse Distillation. Instead of asking the model to imagine good prompts, the team starts from well-designed images and uses their dense captions as supervision. Reversing the usual direction, the caption of a good image becomes the target the enhancer should produce from a short request. The design knowledge is therefore baked in through the data, not left to the model to guess.
Stage two: Groupwise Design Reward. In reinforcement learning, the enhancer produces several candidate prompts for the same request, each rendered into an image. The reward then "jointly compares all candidate images for the same request" to refine lighting, composition, layout and detail. Comparing candidates within a group, rather than scoring each in isolation, gives a more reliable signal on subtle design differences. This resembles group-relative approaches used elsewhere in RL for language models, and our explainer on what reinforcement learning rewards can get wrong is a useful caution about optimizing a reward model.
What results does the paper report?
All figures below come from the authors abstract; we could not independently reproduce them.
- Qwen-Image-PE-397B improves over original requests by 7.81 points on Qwen-Image-Bench with Qwen-Image-2.1.
- Qwen-Image-PE-9B outperforms all evaluated PE baselines.
- Further evaluations show gains in visual design, aesthetics, image quality and human preference.
- The enhancer generalizes to four additional T2I backbones, surpassing native prompt enhancers on HunyuanImage-2.1 and FLUX 3 Image Klein.
The paper also reports that prompt enhancement scales along three axes: training data, model size and information density, "with sufficient information density as a prerequisite for effective enhancement." That last point is useful: a rewriter that only adds flowery adjectives does not help; the rewritten prompt must carry enough concrete design information for the image model to use.
Treat the benchmark carefully. Qwen-Image-Bench is the same lab's benchmark, evaluated with the same lab's image model, so the 7.81-point figure shows the method works in-house. The cross-backbone claims against HunyuanImage-2.1 and FLUX 3 Image Klein are the more interesting external signal, and independent testing would strengthen them. For context on that open image model, see our FLUX 3 Image Klein guide.
What can you download today?
The Hugging Face model card for Qwen/Qwen-Image-2.1-PE-T2I describes it as a "text-to-image prompt rewriting model for Qwen-Image-2.1" and a "fine-tuned Qwen3.5-VL 9B that turns a brief image request in any language into a detailed English prompt plus a recommended aspect ratio." The repository lists about 9.4 billion BF16 parameters (roughly 18.8 GB of weights), and the page showed 74 likes and 7,545 downloads last month at the time of writing. The repo was created on September 20, 2026, a month before the paper.
Two caveats: the license is the Qwen Research License Agreement, so read it before commercial use, and the paper's 397B model is described but only the 9B is announced as released.
How do you run it?
The model card gives a Transformers and Diffusers recipe. In outline:
- Install
transformers5.4 or newer,torch2.4 or newer, plusaccelerateandpillow. - Load the model and tokenizer, and download the
system_prompt.txtthat ships with the repo. - Apply the chat template with your short request (the card's example is a Chinese prompt about a corgi playing guitar in the rain) and thinking enabled.
- Generate with the card's sampling settings: temperature 1.0, top_p 0.95, top_k 20.
- Split the thinking from the answer at the closing think tag and parse the JSON. It contains
rewritten_promptandwh_ratio. - Pass the rewritten prompt to the
QwenImage21Pipelinefrom Diffusers, using a size mapped from the ratio (for example 16:9 maps to 2752 by 1536), with 40 inference steps in the card example.
Because the output follows a thinking block and can be long (the card sets a very large maximum token budget), expect the rewriting step to be slower than the image step on small GPUs. Budget for that if you want an interactive tool.
What does a rewrite look like in practice?
The model card's example request is a single Chinese sentence, roughly "a corgi playing guitar in the rain." The model reasons first, then returns a JSON object with a long English rewritten_prompt and a wh_ratio such as 16:9. The card does not publish the full rewritten text, so we will not invent one, but the contract is clear: the enhancer is responsible for deciding the scene's design (framing, light, mood, layout) and the aspect ratio, so the user only has to state the subject.
That contract is worth testing in your own pipeline. A sensible evaluation is to take 50 of your real prompts, generate images with and without the enhancer using the same seed, and have two people pick the better image blind. If the enhanced version does not win clearly, the extra latency of a thinking model is not worth paying. It is also worth logging the aspect ratios the model picks, since a rewriter that always chooses landscape can quietly break a product that needs square or vertical output.
Speckled noise resolving into a clean shape, a picture of how a rewritten prompt guides text-to-image generation
How does this compare with other approaches to better images?
| Approach | What changes | Cost | Example on explainx.ai |
|---|---|---|---|
| Better image model | Retrain or scale the generator | High | Microsoft MAI-Image-2.7 preview |
| Layout and text control built in | Condition the generator on structure | Medium | MOSS-Image 5B |
| Smarter prompt rewriting | Add a separate enhancer in front | Low to medium | Qwen-Image-PE (this post) |
| Rethinking training compute | New pretraining recipe | High | Halcyon text-to-image |
The prompt-enhancer route is attractive because it is modular. You can swap the enhancer without retraining the image model, and the paper claims it transfers across backbones.
What to watch for
- Prompts get long and English-only. The card says it outputs a detailed English prompt even from a request in another language. That is fine for Qwen-Image-2.1, but check that your target image model handles long English prompts well.
- Intent drift. A stronger rewriter can add design choices you did not ask for. Review rewritten prompts when brand consistency matters.
- Benchmark provenance. The 7.81-point gain is on Qwen's own benchmark. Test on your own prompt set before adopting it.
- License. A research license is not the same as an open-source one.
Why it matters for builders
If you ship an image feature, there are two cheap levers: choose a better generator, or improve the text it receives. Qwen-Image-PE makes the second lever a downloadable model. It also reflects a wider trend in Qwen releases, from image generation to agents, where the lab publishes smaller specialist models around a main checkpoint. Compare that with how other open image efforts like Bria FIBO 2.0 structure licensing and pricing claims.
The most reusable idea in the paper is not the model but the training signal: judge a prompt by comparing the group of images it produces, not by scoring a single sample. Any team training a rewriter, in images or elsewhere, can borrow that.
Related reading
- Qwen-Image-2.1 Turbo: 8-step 7B open checkpoint and how to run it
- FLUX 3 Image Klein open weights guide
- MOSS-Image: open text-to-image with layout control
- Halcyon: text-to-image without language pretraining
- Microsoft MAI-Image-2.7 preview
- Specification gaming and Goodhart's law in AI metrics
- Official: Qwen-Image-PE paper page, Qwen/Qwen-Image-2.1-PE-T2I model card
Benchmark numbers are from the authors abstract and the model card as of October 27, 2026; they have not been independently verified.
