File size: 2,812 Bytes
2974fbc ac2913f 2974fbc 0fe00e0 2974fbc b5d138c 2974fbc 475edd8 2974fbc 0fe00e0 2974fbc ac0ed6e 2974fbc a5ee948 2974fbc ac0ed6e 2974fbc |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
---
base_model:
- stabilityai/stable-diffusion-xl-base-1.0
pipeline_tag: text-to-image
tags:
- art
---
<h1 align="center">The Superposition of Diffusion Models Using the It么 Density Estimator: <em>Pipeline</em></h1>
<p align="center">
<a href="https://arxiv.org/abs/2412.17762"><img src="https://img.shields.io/badge/Arxiv-2412.17762-red?style=for-the-badge&logo=Arxiv" alt="arXiv"/></a>
</p>
This pipeline shows how to superimpose different text prompts from [Stable Diffusion-XL 1.0](https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0) based the paper [The Superposition of Diffusion Models Using the It么 Density Estimator](https://www.arxiv.org/abs/2412.17762). The authors would like to thank Viktor Ohanesian for developing the SD-XL pipeline.
<p align="center">
<img src="https://huggingface.co/superdiff/superdiff-sdxl-v1-0/resolve/main/sdxl_higlights.jpg" alt="drawing" style="width:700px;">
</p>
## Requirements
This pipeline can be run with the following packages & versions:
- `PyTorch 2.5.1`
- `Diffusers 0.32.1`
- `Accelerate 1.2.1`
- `Transformers 4.47.1`
You can install these with:
```
pip install torch
pip install diffusers accelerate transformers
```
## Example usage
```
from PIL import Image
from diffusers import DiffusionPipeline
pipeline = DiffusionPipeline.from_pretrained("superdiff/superdiff-sdxl-v1-0", custom_pipeline='pipeline', trust_remote_code=True)
output = pipeline("a flamingo", "a candy cane", seed=1, num_inference_steps=200, batch_size=1)
image = Image.fromarray(output[0])
image.save("superdiff_output.png")
```
Arguments that can be set by user in `pipeline()`:
- `prompt_1` [required]: text prompt describing first concept to superimpose (e.g. "a flamingo")
- `prompt_2`[required]: text prompt describing second concept to superimpose (e.g. "a candy cane")
- `seed`[optional: default=None]: seed for random noise generator for reproducibility; for non-deterministic outputs, set to `None`
- `num_inference_steps`[optional: default=200]: number of denoising steps
- `batch_size` [optional: default=1]: batch size
- `guidance_scale` [optional: default=7.5]: scale for classifier-free guidance
- `height`, `width` [optional: default=1024]: height and width of generated images (we recommend leaving it at 1024!)
Note: for generating realistic photos with SDXL, we recommend using prompts such as `"teapot, high quality photography"` or `"a highly realistic photo of a volcano"`.
## Citation
**BibTeX:**
```
@article{skreta2025superposition,
title={The Superposition of Diffusion Models Using the It$\backslash$\^{} o Density Estimator},
author={Skreta, Marta and Atanackovic, Lazar and Bose, Avishek Joey and Tong, Alexander and Neklyudov, Kirill},
journal={International Conference on Learning Representations},
year={2025}
}
``` |