PromptEnhancer  by Hunyuan-PromptEnhancer

AI prompt enhancer for text-to-image generation

Created 1 month ago
2,024 stars

Top 21.8% on SourcePulse

GitHubView on GitHub
Project Summary

Hunyuan-PromptEnhancer refines text prompts for text-to-image models, transforming user inputs into clearer, structured, and logically consistent versions. It targets users of image generation AI, researchers, and developers seeking to improve prompt quality and control. The tool enhances prompt clarity and adherence to desired image attributes, potentially leading to more accurate and aesthetically pleasing image outputs.

How It Works

The core approach involves rewriting prompts using a chain-of-thought methodology, structuring them with a "global–details–summary" narrative. This process preserves the original intent across key elements like subject, action, style, and layout. The system employs robust output parsing, prioritizing structured tags like <answer>...</answer>, falling back to cleaner text extraction, or using the original input if parsing fails. Inference parameters such as temperature, top_p, and max_new_tokens are configurable to balance deterministic output with creative diversity.

Quick Start & Requirements

Installation can be done via pip install -r requirements.txt or by running script/install_gguf.sh for GGUF model support. Prerequisites include Python 3.8+, CUDA 11.8+ (recommended for GPU acceleration), at least 20GB of free storage for models, and 8GB+ RAM (16GB+ recommended for 32B models). Users can download the PromptEnhancer-7B model (13GB) via huggingface-cli download tencent/HunyuanImage-2.1/reprompt --local-dir ./models/promptenhancer-7b.

Highlighted Details

  • Offers support for both standard full-precision models and memory-efficient GGUF quantized models.
  • GGUF models provide significant VRAM reduction (50-75%) and faster inference, with quantization levels like Q8_0, Q6_K, and Q4_K_M available.
  • Provides different model sizes, including PromptEnhancer-7B (balanced quality/efficiency) and PromptEnhancer-32B (highest quality), catering to diverse user needs and hardware capabilities.
  • The project has seen recent updates, including GGUF model support (Sept 22, 2025), release of PromptEnhancer-32B (Sept 18, 2025), and technical reports (Sept 7, 2025).

Maintenance & Community

The project appears actively developed with recent updates noted in September 2025. Contact is available via email at hunyuan_opensource@tencent.com. The project acknowledges contributions from the Transformers and HuggingFace communities.

Licensing & Compatibility

The provided README does not explicitly state the project's license. Users should verify licensing terms before integration, especially for commercial or closed-source applications.

Limitations & Caveats

No specific limitations, known bugs, or alpha status are mentioned in the provided documentation. Users should be aware of the significant hardware requirements for larger models, particularly the 32B variants and their GGUF counterparts.

Health Check
Last Commit

2 weeks ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
5
Star History
881 stars in the last 30 days

Explore Similar Projects

Starred by Eric Zhu Eric Zhu(Coauthor of AutoGen; Research Scientist at Microsoft Research) and Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems").

PromptWizard by microsoft

0.3%
4k
Agent-driven framework for task-aware prompt optimization
Created 1 year ago
Updated 3 weeks ago
Starred by Clement Delangue Clement Delangue(Cofounder of Hugging Face), Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), and
10 more.

promptsource by bigscience-workshop

0.1%
3k
Toolkit for creating, sharing, and using natural language prompts
Created 4 years ago
Updated 2 years ago
Feedback? Help us improve.