Prompt optimizer for text-to-image generation
Top 52.9% on sourcepulse
This repository provides an official implementation for optimizing "hard prompts" using gradient-based discrete optimization, specifically the PEZ algorithm. It targets researchers and practitioners in prompt engineering and generative AI, enabling the discovery of effective text prompts for image generation models like Stable Diffusion.
How It Works
The core approach involves using CLIP encoders to optimize a discrete "hard prompt" from a given image. This optimized prompt is then fed into Stable Diffusion to generate new images. The PEZ algorithm is designed for efficient and effective discrete optimization, inspired by the PEZ candy dispenser.
Quick Start & Requirements
pip install -r requirements.txt
after creating and activating a virtual environment.python run.py image.png
examples/
folder.Highlighted Details
prompt_lm/
.Maintenance & Community
Licensing & Compatibility
Limitations & Caveats
2 years ago
1 day