AB
AiBoss
project

PromptEnhancer - Tencent's open-source text-to-image prompt enhancement framework

PromptEnhancer is an open-source suggestion rewriting framework developed by Tencent's Hunyuan team for improving text-to-image (T2I) models. It utilizes Chain-of-Thought (CoT) suggestion rewriting and a dedicated reward model, AlignEval...

What is PromptEnhancer?

PromptEnhancer is an open-source suggestion rewriting framework developed by Tencent's Hunyuan team to improve text-to-image (T2I) models. Through Chain-of-Thought (CoT) suggestion rewriting and a dedicated reward model, AlignEvaluator, it significantly enhances the understanding of complex user commands and the accuracy of image generation in T2I models. The framework requires no modification to the weights of the T2I model, is versatile and plug-and-play, and is compatible with various pre-trained models. PromptEnhancer optimizes suggestions through two-stage training (supervised fine-tuning and reinforcement learning), making the generated images more aligned with user intent.

PromptEnhancer's main functions

  • Improve the accuracy and alignment precision of text-to-image models.PromptEnhancer significantly improves the accuracy of text-to-image (T2I) model-generated images and the alignment with user intent by optimizing text prompts for user input. It can better handle complex user commands, including attribute binding, negation commands, and complex relational descriptions.
  • Universality and plug-and-playIt requires no modification to the weights of any pre-trained T2I model and can be used as a general module to adapt to various pre-trained models, such as HunyuanImage, Stable Diffusion, and Imagen, reducing optimization costs.
  • Provide high-quality benchmark datasetsThe open-source dataset contains 6,000 prompts and corresponding multi-dimensional fine-grained annotations, providing researchers with important reference resources and promoting research on the interpretability and reproducibility of prompt optimization techniques.

The technical principle of PromptEnhancer

  • Chain-of-Thought (CoT) hints for rewritingIntroducing a thought chain mechanism to simulate the thinking process of human designers, this approach breaks down concise user instructions into three steps: "core element - potential ambiguity - detail supplementation".
  • AlignEvaluator, a dedicated reward modelWe construct an evaluation system covering 6 major categories and 24 key dimensions. By training AlignEvaluator with large-scale labeled data, it can provide a "precise score" for the generated image for each dimension. Dimensions include language understanding (such as negative instructions and pronoun reference), visual attributes (such as the number of objects, texture, and expression), and complex relationships (such as inclusion relationships, similarity relationships, and counterfactual scenarios).
  • Two-stage training
    • Phase 1: Supervisory Fine-tuning (SFT)The CoT rewriter is initialized through supervised fine-tuning, enabling the generation of refined suggestions that conform to grammatical logic. It is trained using a large dataset of "raw suggestions - thought chains - refined suggestions" generated by a large model.
    • Phase 2: Generative Reward-Based Policy Optimization (GRPO)The process involves inputting multiple candidate cues generated by the rewriter into a frozen T2I model, and then scoring the generated images using the AlignEvaluator. By applying the logic that "cues with higher rewards are given more importance," the rewriter's strategy is optimized to maximize the alignment between the generated images and the user's intent.

PromptEnhancer project address

  • Project official websitehttps://hunyuan-promptenhancer.github.io/
  • GitHub repositoryhttps://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 designQuickly generate high-quality advertising posters and promotional materials, improving design efficiency.
  • Illustration CreationIt helps illustrators quickly generate creative sketches, saving time and effort.
  • Game DesignIt enables game developers to quickly generate concept art for game characters, scenes, and props, accelerating the game development process.
  • Social media contentQuickly generate engaging social media images and videos to enhance the appeal of your content.
  • Video productionIn video content creation, it generates high-quality video frames or concept art to assist in video editing and special effects production.