The most common problem with LLI models is that when you change the prompt slightly, the whole image changes unpredictably (even when using the same seed). The method in the paper "Prompt-to-Prompt Image Editing with Cross Attention Control" allows far more stable generation when editing a prompt by fixing and modifying the Cross-Attention layers during the diffusion process.
I'm still working on the code to make everything work (especially with img2img and inpainting), however, I hope that I will be able to release the code soon on github.
Awesome, I can't wait to combine this with cross attention control, this will actually allow people to edit an image however they want at any diffusion strengths! No more the problem of img2img ignoring the initial image at high strengths. I will take a look at the code tomorrow...
Also I believe (and hope) that inpainting with this method with cross attention control would yield far superior results than simply masking out parts of an image and adding random noise. What a time to be alive!
Yes, it's the method from this paper https://arxiv.org/abs/2208.01626. There's no code available yet but I started to implement it from scratch in pytorch, this is the first results that I got and I'm very excited to implement and try out the other methods the paper describes.
It's not my paper, I've simply implemented the paper as is. You should ask these questions to the original authors and give your thanks! This is indeed a great work! https://amirhertz.github.io/https://rmokady.github.io/
First question: Yes, right now the control mechanisms are really basic, you have a initial prompt (that you can generate to see what the image looks like), then a second prompt that is an edit of the first. The algorithm will generate your second prompt so that it looks as "close" as possible to the first (with the concept of closeness being encoded inside of the network). You can also tweak the weights of each token, such that you can reduce or increase its contribution on the final image (e.g you want less clouds, more trees). Note that tweaking the weights in attention space gives much better results than editing the prompt embeddings, as the prompt embeddings are highly nonlinear and often editing them will break the image.
Second question: Yes, but not right now. What everyone is using as "img2img" is actually a crude approximation of the correct "inverse" process for the network (not to be confused with textual inversion). What we actually want for prompt editing is not to add random noise to an image but find which noise will reconstruct our intended image and use that to modify our prompt or generate variations. I was hoping someone would have already implemented it but I guess I can give it a try when I have more time.
Also, because stable diffusion is slightly different to what I guess was Imagen used in the paper, we have a second self-cross-attention layer, which can be controlled by using an additional mask (that is not yet implemented right now), that means that if image inversion is implemented correctly, we could actually "inpaint" using the cross-attention layers themselves and modify the prompt, this should give us much better results than simply masking out the image and adding random noise...
The most common problem with LLI models is that when you change the prompt slightly, the whole image changes unpredictably (even when using the same seed). The method in the paper "Prompt-to-Prompt Image Editing with Cross Attention Control" allows far more stable generation when editing a prompt by fixing and modifying the Cross-Attention layers during the diffusion process.
I'm still working on the code to make everything work (especially with img2img and inpainting), however, I hope that I will be able to release the code soon on github.
Awesome, I can't wait to combine this with cross attention control, this will actually allow people to edit an image however they want at any diffusion strengths! No more the problem of img2img ignoring the initial image at high strengths. I will take a look at the code tomorrow...
Also I believe (and hope) that inpainting with this method with cross attention control would yield far superior results than simply masking out parts of an image and adding random noise. What a time to be alive!
Yes, it's the method from this paper https://arxiv.org/abs/2208.01626. There's no code available yet but I started to implement it from scratch in pytorch, this is the first results that I got and I'm very excited to implement and try out the other methods the paper describes.
It's not my paper, I've simply implemented the paper as is. You should ask these questions to the original authors and give your thanks! This is indeed a great work! https://amirhertz.github.io/ https://rmokady.github.io/
First question: Yes, right now the control mechanisms are really basic, you have a initial prompt (that you can generate to see what the image looks like), then a second prompt that is an edit of the first. The algorithm will generate your second prompt so that it looks as "close" as possible to the first (with the concept of closeness being encoded inside of the network). You can also tweak the weights of each token, such that you can reduce or increase its contribution on the final image (e.g you want less clouds, more trees). Note that tweaking the weights in attention space gives much better results than editing the prompt embeddings, as the prompt embeddings are highly nonlinear and often editing them will break the image.
Second question: Yes, but not right now. What everyone is using as "img2img" is actually a crude approximation of the correct "inverse" process for the network (not to be confused with textual inversion). What we actually want for prompt editing is not to add random noise to an image but find which noise will reconstruct our intended image and use that to modify our prompt or generate variations. I was hoping someone would have already implemented it but I guess I can give it a try when I have more time.
Also, because stable diffusion is slightly different to what I guess was Imagen used in the paper, we have a second self-cross-attention layer, which can be controlled by using an additional mask (that is not yet implemented right now), that means that if image inversion is implemented correctly, we could actually "inpaint" using the cross-attention layers themselves and modify the prompt, this should give us much better results than simply masking out the image and adding random noise...
Exciting times ahead!