Manipulating Embeddings of Stable Diffusion Prompts

Niklas Deckers, Julia Peters, Martin Potthast
8/23/2023
cs.CVcs.LG

No official code found. Best implementation: webis-de/ijcai24-manipulating-embeddings-stable-diffusion (15 stars, MIT, last commit 2024-08-08).

Abstract

Prompt engineering is still the primary way for users of generative text-to-image models to manipulate generated images in a targeted way. Based on treating the model as a continuous function and by passing gradients between the image space and the prompt embedding space, we propose and analyze a new method to directly manipulate the embedding of a prompt instead of the prompt text. We then derive three practical interaction tools to support users with image generation: (1) Optimization of a metric defined in the image space that measures, for example, the image style. (2) Supporting a user in creative tasks by allowing them to navigate in the image space along a selection of directions of "near" prompt embeddings. (3) Changing the embedding of the prompt to include information that a user has seen in a particular seed but has difficulty describing in the prompt. Compared to prompt engineering, user-driven prompt embedding manipulation enables a more fine-grained, targeted control that integrates a user's intentions. Our user study shows that our methods are considered less tedious and that the resulting images are often preferred.

View on arXivView PDF

Code Implementations(1)

MIT

Code for the paper "Manipulating Embeddings of Stable Diffusion Prompts".

152Python, DockerfileAug 23, 20232 years agoMIT

Similar Papers

Cite this paper

@article{deckers2023manipulating,
  title  = {Manipulating Embeddings of Stable Diffusion Prompts},
  author = {Niklas Deckers and Julia Peters and Martin Potthast},
  year   = {2023},
  eprint = {2308.12059},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2308.12059v2}
}

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.12059.svg)](https://codeofpaper.com/paper/2308.12059)

Discussion