PromptEnhancer
Prompt-rewriting tool from Tencent Hunyuan that turns short prompts into clearer, structured ones for text-to-image generation and image-editing instructions.
At a Glance
Royalty-free use of PromptEnhancer under the Tencent Hunyuan Community License (custom, not OSI-approved), limited to the Territory and subject to the Acceptable Use Policy.
Engagement
Available On
Alternatives
Listed Oct 2026
About PromptEnhancer
PromptEnhancer is a prompt-rewriting utility from the Tencent Hunyuan team. It rewrites user prompts into clearer, more structured versions for text-to-image generation and refines image-to-image editing instructions using the input image as context. The project is published as an open-source repository with a technical report (arXiv:2509.04545), model weights on Hugging Face, and a benchmark dataset.
What It Is
PromptEnhancer is a Chain-of-Thought prompt rewriter that sits in front of a text-to-image model. It restructures an input prompt while preserving the original intent, such as subject, action, style, layout and attributes. The framework decouples the rewriter from the generator, so according to the project it can enhance a pretrained T2I model without modifying that model's weights.
How It Works
The tech report describes a two-stage training process. First, the rewriter is initialized with supervised fine-tuning on (user prompt, reprompt) pairs. Then it is aligned with GRPO-based reinforcement learning, where candidate reprompts are rendered by a frozen T2I model and scored by a reward model called AlignEvaluator. AlignEvaluator uses a taxonomy of 24 key points drawn from common T2I failure modes such as attribute binding, negation and compositional relationships. The authors report evaluations on HunyuanImage 2.1 and release a human-preference benchmark, T2I-Keypoints-Eval.
Models and Usage
The repository provides Python inference classes for three paths: text-only enhancement with Transformers (7B and 32B), image-editing instruction enhancement with a vision-language model, and quantized GGUF models run through llama.cpp for lower memory use. Models are downloaded through the Hugging Face CLI. Generation parameters such as temperature, top_p and max_new_tokens can be adjusted, and prompts can be in Chinese or English. A multi-level fallback mechanism is described for robust output parsing.
Licensing Notes
The code is released under the Tencent Hunyuan Community License Agreement, which limits use to a defined territory that excludes the European Union, United Kingdom and South Korea, and includes an acceptable use policy.
Community Discussions
Be the first to start a conversation about PromptEnhancer
Share your experience with PromptEnhancer, ask questions, or help others learn from your insights.
Pricing
Community License
Royalty-free use of PromptEnhancer under the Tencent Hunyuan Community License (custom, not OSI-approved), limited to the Territory and subject to the Acceptable Use Policy.
- Royalty-free limited license to use, reproduce, distribute and modify, excluding the EU, UK and South Korea
- Operators with more than 100 million monthly active users must request a license from Tencent
- Outputs may not be used to improve other AI models
- Custom license, not OSI-approved
Capabilities
Key Features
- Text-to-image prompt rewriting
- Image-to-image editing instruction refinement with visual context
- Intent preservation across rewriting
- Chain-of-Thought rewriter trained with SFT and GRPO
- AlignEvaluator reward model with 24 key-point taxonomy
- Multi-level fallback output parsing
- 7B and 32B full-precision models
- Quantized GGUF models (Q8_0, Q6_K, Q4_K_M) via llama.cpp
- T2I-Keypoints-Eval benchmark and evaluation script
- Chinese and English prompt support
