Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Unofficial implementation of "Prompt-to-Prompt Image Editing with Cross Attention Control" with Stable Diffusion
| Date | Stars |
|---|---|
| 2026-07-24 | 1338 |
| 2026-07-25 | 1338 |
| 2026-07-28 | 1338 |
| 2026-07-30 | 1338 |
| 2026-07-31 | 1337 |
| 2026-08-06 | 1337 |
Today
— stars today
This week
-1 stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# Cross Attention Control with Stable Diffusion Unofficial implementation of "Prompt-to-Prompt Image Editing with Cross Attention Control" with Stable Diffusion, some modifications were made to the methods described in the paper in order to make them work with Stable Diffusion. Paper: https://arxiv.org/abs/2208.01626 Official implementation: https://github.com/google/prompt-to-prompt ## What is Cross Attention Control? Large-scale language-image models (eg. Stable Diffusion) are usually hard to control just with editing the prompts alone and can be very unpredictable and unintuitive for users. Most existing methods require the user to input a mask which is cumbersome and might not yield good results if the mask has an inadequate shape. Cross Attention Control allows much finer control of the prompt by modifying the internal attention maps of the diffusion model during inference without the need for the user to input a mask and does so with minimal performance penalities (compared to clip guidance) and no additional training or fine-tuning of the diffusion model. ## Getting started This notebook uses the following libraries: `torch transformers diffusers numpy PIL tqdm difflib` The last known working version of `diffusers` for the notebook is `diffusers==0.4.1`. A different version of diffusers might cause errors as this notebook injects code into the model and any code change from the `diffusers` library is likely to break compatibility. Simply install the required libraries using `pip` and run the jupyter notebook, some examples are given inside. A description of the parameters are given at the end of the readme. Alternatively there is this easy-to-follow colab demo by [Lewington-pitsos](https://github.com/Lewington-pitsos): [](https://colab.research.google.com/drive/1PsWKXtqAAoDz-KGB45VeCXdTsqW-Mumo) # Results/Demonstrations **All images shown below are generated using the same seed. The initial and target images must be generated with the same seed for cross attention control to work.** ## New: Image inversion This method takes an existing image and finds its corresponding gaussian latent vector using a modified inverse DDIM process that keeps compatibility with other ODE schedulers such as K-LMS, then edits using prompt to prompt editing with cross attention control. A finite difference gradient descent method that corrects for high CFG values is also provided. It allows inversion with higher CFG values (eg. 3.0-5.0), while without it only CFG values below 3.0 are usable. Middle: Original image Top left: Reconstructed image using the prompt `a photo of a woman with blonde hair` Clockwise: See [InverseCrossAttention_Release.ipynb](https://github.com/bloc97/CrossAttentionControl/blob/main/InverseCrossAttention_Release.ipynb) for the prompts in order. Note that some fine tuning on the prompts have been done to make these images consistent. For example, when changing the hair color, sometimes the person starts smiling, which can be removed by adding a `smile` token in the prompt and adjust its weight downwards using cross attention control.  ## Target replacement Top left prompt: `[a cat] sitting on a car` Clockwise: `a smiling dog...`, `a hamster...`, `a tiger...` Note: different strength values for `prompt_edit_spatial_start` were used, clockwise: `0.7`, `0.5`, `1.0`  ## Style injection Top left prompt: `a fantasy landscape with a maple forest` Clockwise: `a watercolor painting of...`, `a van gogh painting of...`, `a charcoal pencil sketch of...`  ## Global editing Top left prompt: `a fantasy landscape with a pine forest` Clockwi
Excerpt of 11,527 characters
Read on GitHubUniversité de Montréal · Canada
47
apolinário
1
1
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:7d5e3593b6afaf72, topic:stable-diffusion, topic:diffusion-models, readme:diffusion model