Iterative prompt refinement for image generation models; by giving 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.
WeavePrompt is a research and development project designed to evaluate and refine text-to-image generation prompts across multiple state-of-the-art image generation models. The primary goal is to optimize prompts such that the generated images align closely with a given reference image, improving both fidelity and semantic consistency.
Procedure/Implementation: The process involves generating images from identical prompts using various image generation models, comparing the results to a reference image through a recognition and similarity evaluation pipeline, and iteratively adjusting the prompt to minimize perceptual differences. This feedback loop continues for a set number of iterations, progressively enhancing prompt effectiveness.
To achieve this, WeavePrompt integrates advanced tools:
Image recognition is powered by meta-llama/Llama-4-Scout-17B-16E-Instruct.
Similarity evaluation uses the LPIPS (alex) metric for perceptual comparison.
Image generation models under evaluation include:
By systematically combining prompt optimization with multi-model evaluation, WeavePrompt aims to advance the understanding of cross-model prompt effectiveness and improve controllability in image generation tasks.
git clone https://github.com/kevin1kevin1k/WeavePrompt.git
cd WeavePrompt
uv venv
uv sync
source .venv/bin/activate
.env
Put the following inside .env:WANDB_API_KEY and FAL_KEYWEAVE_PROJECTRun the demo app:
streamlit run src/app.py
Follow the instructions in the browser to upload an image and step through the optimization process.


Use the same prompt as the standard model, the target model yields the similar (high quality) output as a result.
Python
98.2%
Dockerfile
1.8%
Iterative prompt refinement for image generation models; by giving 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.
WeavePrompt is a research and development project designed to evaluate and refine text-to-image generation prompts across multiple state-of-the-art image generation models. The primary goal is to optimize prompts such that the generated images align closely with a given reference image, improving both fidelity and semantic consistency.
Procedure/Implementation: The process involves generating images from identical prompts using various image generation models, comparing the results to a reference image through a recognition and similarity evaluation pipeline, and iteratively adjusting the prompt to minimize perceptual differences. This feedback loop continues for a set number of iterations, progressively enhancing prompt effectiveness.
To achieve this, WeavePrompt integrates advanced tools:
Image recognition is powered by meta-llama/Llama-4-Scout-17B-16E-Instruct.
Similarity evaluation uses the LPIPS (alex) metric for perceptual comparison.
Image generation models under evaluation include:
By systematically combining prompt optimization with multi-model evaluation, WeavePrompt aims to advance the understanding of cross-model prompt effectiveness and improve controllability in image generation tasks.
git clone https://github.com/kevin1kevin1k/WeavePrompt.git
cd WeavePrompt
uv venv
uv sync
source .venv/bin/activate
.env
Put the following inside .env:WANDB_API_KEY and FAL_KEYWEAVE_PROJECTRun the demo app:
streamlit run src/app.py
Follow the instructions in the browser to upload an image and step through the optimization process.


Use the same prompt as the standard model, the target model yields the similar (high quality) output as a result.
Python
98.2%
Dockerfile
1.8%