What is PromptEnhancer
PromptEnhancer is an open-source prompt rewriting framework by Tencent Hunyuan Team, used to enhancetext-to-image(T2I) models. Through Chain-of-Thought (CoT) prompt rewriting and a dedicated reward model AlignEvaluator, it significantly improves T2I models' understanding of complex user instructions and the accuracy of image generation. The framework requires no modification to the T2I model's weights, offering generality and plug-and-play characteristics, and is applicable to a variety of pre-trained models. PromptEnhancer optimizes prompts through two-stage training (supervised fine-tuning and reinforcement learning), making generated images better align with user intent.
Main Features of PromptEnhancer
- Improves the accuracy and alignment precision of text-to-image models: PromptEnhancer significantly improves the accuracy of images generated by text-to-image (T2I) models and their alignment with user intent by optimizing the text prompts entered by users. It can better handle complex user instructions, including attribute binding, negative instructions, and complex relational descriptions.
- Generality and plug-and-play: Without modifying the weights of any pre-trained T2I model, it can serve as a general module adapted to a variety of pre-trained models, such as HunyuanImage, Stable Diffusion, Imagen, etc., reducing optimization costs.
- Provides a high-quality benchmark dataset: Open-sources a high-quality benchmark dataset containing 6,000 prompts with corresponding fine-grained multi-dimensional annotations, providing researchers with an important reference resource and advancing research on the interpretability and reproducibility of prompt optimization techniques.
Technical Principles of PromptEnhancer
- Chain-of-Thought (CoT) prompt rewriting: Introduces a chain-of-thought mechanism that simulates the thinking process of human designers, breaking down concise user instructions into three steps: 'core elements - potential ambiguities - detail supplements'.
- Dedicated reward model AlignEvaluator: Builds an evaluation system covering 6 major categories and 24 key dimensions, and trains AlignEvaluator on large-scale annotated data, enabling it to give 'precise scores' for generated images along each dimension. The dimensions include language understanding (such as negative instructions and pronoun reference), visual attributes (such as object count, material, and expression), and complex relationships (such as containment, similarity, and counterfactual scenarios), etc.
- Two-stage training
- Stage 1: Supervised Fine-Tuning (SFT): Initializes the CoT rewriter through supervised fine-tuning, enabling it to generate refined prompts that conform to grammatical logic. It is trained on a large amount of 'original prompt - chain of thought - refined prompt' data generated by large models.
- Stage 2: Generation Reward-Based Policy Optimization (GRPO): Feeds multiple candidate prompts generated by the rewriter into a frozen T2I model, and uses AlignEvaluator to score the generated images. Through the logic that 'prompts with higher rewards receive more attention', it optimizes the rewriter's policy so that the prompts it generates maximize the alignment between images and user intent.
Project Address of PromptEnhancer
- Project Website:https://hunyuan-promptenhancer.github.io/
- GitHub Repository:https://github.com/Hunyuan-PromptEnhancer/PromptEnhancer
- HuggingFace Model Library:https://huggingface.co/tencent/HunyuanImage-2.1/tree/main/reprompt
- arXiv Technical Paper:https://www.arxiv.org/pdf/2509.04545
Application Scenarios of PromptEnhancer
- Advertising Design: Quickly generate high-quality advertising posters and promotional materials, improving design efficiency.
- Illustration Creation: Helps illustrators quickly generate creative sketches, saving time and effort.
- Game Design: Quickly generate concept art for game characters, scenes, and props for game developers, accelerating the game development process.
- Social Media Content: Quickly generate attractive social media images and videos, enhancing the appeal of content.
- Video Production: In video content creation, generate high-quality video frames or concept art to assist with video editing and special effects production.