Reverse Stable Diffusion: What prompt was used to generate this image?

Florinel-Alin Croitoru, Vlad Hondru, Radu Tudor Ionescu, Mubarak Shah
8/2/2023
cs.CVcs.CLcs.LG

Official code: CroitoruAlin/Reverse-Stable-Diffusion (9 stars, last commit 2023-10-18).

Abstract

Text-to-image diffusion models have recently attracted the interest of many researchers, and inverting the diffusion process can play an important role in better understanding the generative process and how to engineer prompts in order to obtain the desired images. To this end, we study the task of predicting the prompt embedding given an image generated by a generative diffusion model. We consider a series of white-box and black-box models (with and without access to the weights of the diffusion network) to deal with the proposed task. We propose a novel learning framework comprising a joint prompt regression and multi-label vocabulary classification objective that generates improved prompts. To further improve our method, we employ a curriculum learning procedure that promotes the learning of image-prompt pairs with lower labeling noise (i.e. that are better aligned). We conduct experiments on the DiffusionDB data set, predicting text prompts from images generated by Stable Diffusion. In addition, we make an interesting discovery: training a diffusion model on the prompt generation task can make the model generate images that are much better aligned with the input prompts, when the model is directly reused for text-to-image generation. Our code is publicly available for download at https://github.com/CroitoruAlin/Reverse-Stable-Diffusion.

View on arXivView PDF

Code Implementations(1)

91PythonAug 5, 20233 years ago

Similar Papers

Cite this paper

@article{croitoru2023reverse,
  title  = {Reverse Stable Diffusion: What prompt was used to generate this image?},
  author = {Florinel-Alin Croitoru and Vlad Hondru and Radu Tudor Ionescu and Mubarak Shah},
  year   = {2023},
  eprint = {2308.01472},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2308.01472v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2308.01472.svg)](https://codeofpaper.com/paper/2308.01472)

Discussion