Text-to-image generation has progressed rapidly, but faithfully generating complex scenes requires extensive trial-and-error to find the exact prompt. In the prompt inversion task, the goal is to recover a textual prompt that can faithfully reconstruct a given target image. Currently, existing methods frequently yield suboptimal reconstructions and produce unnatural, hard-to-interpret prompts that hinder transparency and controllability. In this work, we present PromptEvolver, a prompt inversion approach that generates natural-language prompts while achieving high-fidelity reconstructions of the target image. Our method uses a genetic algorithm to optimize the prompt, leveraging a strong vision-language model to guide the evolution process. Importantly, it works on black-box generation models by requiring only image outputs. Finally, we evaluate PromptEvolver across multiple prompt inversion benchmarks and show that it consistently outperforms competing methods.
Figures & tables
Figure 1: Reconstruction comparison : PromptEvolver versus a VLM baseline. We demonstrate the robustness of PromptEvolver to challenging T2I concepts such as colors, counting, object positioning, and camera orientation.
Figure 2: Overview of PromptEvolver. Given a target image, a VLM generates an initial population of N diverse candidate prompts. The evolutionary loop then repeats for T generations: ( A ) two parents are selected via tournament selection and combined by the VLM into a child prompt through crossover , conditioned on the target image; ( B ) the child optionally undergoes mutation , where the VLM applies targeted edits; ( C ) the child prompt is evaluated by generating K images via the T2I model and computing the mean image-to-image similarity to the target; ( D ) the top- N individuals from parents and offspring are retained. After T generations, the highest-fitness prompt and its best reconstruction are returned.
Figure 3: Prompt evolution flow example in PromptEvolver. A VLM generates an initial population of N candidate prompts. Each generation, two parents (orange) are selected, combined through crossover , and optionally refined via mutation , where all VLM operations are guided by the target image.
Figure 4: Per-image comparison of VLM-Baseline ( x -axis) versus PromptEvolver ( y -axis) across all 500 evaluation images, for four similarity metrics. Each point is one image, colored by source dataset; the dashed line is y=x . Points above the diagonal are images where evolution improved the reconstruction. The legend in the top-left of each panel reports the per-metric win counts (PromptEvolver vs. VLM-Baseline). For each panel we use the PromptEvolver variant that was guided by that metric.
Figure 5: Qualitative comparison across five diverse datasets. Given a target image (top), we show reconstructions from PromptEvolver (middle) and VLM-Baseline (bottom). Our evolutionary approach produces more faithful reconstructions, better preserving scene composition, style, and fine-grained details.
Template
VLM Variant
CLIP ↑
Runtime (s) ↓
Structured
Instruct
0.83±0.007
381.18
Structured
Thinking
0.83±0.007
885.6
Minimal
Instruct
0.82±0.007
420.72
Minimal
Thinking
0.83±0.007
822.72
Table 2: Ablation: VLM template style vs. reasoning mode. We compare structured and minimal prompting templates with instruct and thinking VLM variants, reporting CLIP similarity and runtime (seconds per image).
Crossover Input
CLIP ↑
Target image only (PromptEvolver)
0.829
Target image + generated parent images
0.827
Table 3: Ablation: effect of providing generated parent images during crossover. In the default setting, the VLM observes only the target image when combining two parent prompts. We compare this against additionally providing the images generated by each parent prompt. Evaluated with CLIP guidance on 100 random MS-COCO 2017 images.
Mutation Rate ( pm )
CLIP ↑
BLIP ↑
OpenCLIP ↑
DreamSim ↑
0.1 (default)
0.829
0.859
0.810
0.754
0.3
0.831
0.861
0.810
0.754
0.5
0.834
0.861
0.811
0.756
Table 5: Ablation: effect of mutation rate pm . We vary the probability with which offspring undergo mutation after crossover. The default rate used by PromptEvolver is 0.1 . Evaluated with CLIP guidance on 100 random MS-COCO 2017 images.
Appendix figures & tables8 assets
Supplementary material from the paper’s appendix.
Appendix
Figure C1 : Prompt evolution example (Flickr8K, DreamSim guidance). The evolved prompt adds specific details such as “red star decals” and “golden hour” that improve reconstruction fidelity.
Figure C2 : Prompt evolution example (MS-COCO, CLIP guidance). The initial prompt was truncated by the CLIP truncation mechanism detailed in A . Evolution produces a complete, structured description that better captures both signs.
Figure C3 : Prompt evolution example (MS-COCO, SigLIP guidance). The evolved prompt corrects the camera angle to “low-angle, slightly elevated” and adds texture details like “weathered green grill” and “sharp shadows.”
Figure C4 : Prompt evolution example (MS-COCO, SigLIP guidance). Evolution recovers fine-grained text details (“LTD,” license plate “EX52 XRT,” “green recycling logos”) absent from the initial prompt.
Figure D5 : Failure case: The T2I model inferred the bowtie correctly without specific mention in the prompt (presumably because of the tuxedo), however, the fact that it is open was not mentioned in any of the prompts throughout the evolution process. We hypothesize that this is due to the fact that the unnatural state of the bowtie receives a lot of human attention, however modern foundational models have a bias towards the more common state.
Figure E6 : Screenshot of the human evaluation interface for a single comparison. The reference image is shown at the top, with two reconstruction options displayed below. Evaluators select the option that more faithfully matches the reference.
Dataset
Ours
VLM-Baseline
Total
Pref. (%)
Lexica
124
73
197
62.9
CelebA
84
108
192
43.8
Flickr8K
111
85
196
56.6
LAION-400M
106
91
197
53.8
MS-COCO
96
78
174
55.2
Total
521
435
956
54.5
Appendix
Table E1 : Per-dataset breakdown of the human preference study. We report the number of comparisons favoring PromptEvolver out of the total for each dataset.
Method
NLL ↓
PEZ
6.88±0.70
VGD
4.52±0.51
CLIP Interrogator
4.05±0.36
STEPS
7.10±0.73
VLM-Baseline
2.80±0.32
PromptEvolver-CLIP
2.93±0.30
Appendix
Table F6 : Prompt naturalness measured by negative log-likelihood (NLL ↓ ) under Mistral-7B-v0.3. Lower values indicate more natural, fluent prompts. We report mean ± std over all 500 evaluation images.