--- title: WeavePrompt emoji: 🎨 colorFrom: blue colorTo: purple sdk: docker sdk_version: 5.44.1 pinned: false license: mit app_file: app.py app_port: 7860 --- # WeavePrompt Iterative prompt refinement for text-to-image models. Given a target image, WeavePrompt automatically generates and refines text prompts to make a model's output resemble the target image, using vision-language models and perceptual metrics. ## Features - Upload a target image - Step-by-step prompt optimization - View prompt and generated image at each iteration - Full optimization history ## Installation 1. Clone the repository: ```bash git clone cd WeavePrompt ``` 2. Install dependencies: ```bash uv venv uv sync source .venv/bin/activate ``` 3. Setup `.env` Put the following inside `.env`: - API keys `WANDB_API_KEY` and `FAL_KEY` - Weave project name `WEAVE_PROJECT` ## Usage Run the demo app: ```bash streamlit run app.py ``` Follow the instructions in the browser to upload an image and step through the optimization process. ## Architecture Diagram ![diagram](./diagram.png)