File size: 4,595 Bytes
80b0234
fdf6aae
5f081b6
fdf6aae
 
 
 
5f081b6
 
 
 
fdf6aae
80b0234
5f081b6
80b0234
5f081b6
 
80b0234
5f081b6
80b0234
5f081b6
80b0234
5f081b6
80b0234
fdf6aae
80b0234
 
 
 
 
 
5f081b6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fdf6aae
62df52f
80b0234
5f081b6
80b0234
5f081b6
80b0234
5f081b6
80b0234
5f081b6
80b0234
5f081b6
80b0234
fdf6aae
 
 
 
 
 
 
 
 
 
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
72
73
74
75
76
77
78
79
80
---
language: en
license: creativeml-openrail-m
tags:
- stable-diffusion
- stable-diffusion-diffusers
- text-to-image
- RyzenAI
- Quantization
- ONNX
- Computer Vision
inference: true
---
# πŸš€ Stable Diffusion 1.5 on AMD AI PC NPU

"Stable Diffusion is a latent text-to-image diffusion model capable of generating photo-realistic images given any text input. For more information about how Stable Diffusion functions, please have a look at [πŸ€—'s Stable Diffusion blog](https://huggingface.co/blog/stable_diffusion)". 
More details about this model can be found on the original Hugging Face model card: [stable-diffusion-v1-5/stable-diffusion-v1-5](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5).

This model repo contains the optimized ONNX models required to run the image generation pipeline for Stable Diffusion 1.5 on AMD NPUs. 

## Model Details

The folder structure is organized to mirror the main components of the diffusion pipeline (scheduler, text encoder, tokenizer, UNet, and VAE decoder).

```text
β”œβ”€ scheduler/
β”œβ”€ text_encoder/
β”œβ”€ tokenizer/
β”œβ”€ unet/
└─ vae_decoder/
```
The [scheduler](scheduler) folder contains the scheduler configuration (timesteps, betas, alphas, etc.) used during the diffusion sampling process.

The [text_encoder](text_encoder) folder contains the text encoder model used to convert the input prompt into conditioning embeddings for the diffusion model.

The [tokenizer](tokenizer) contains the tokenizer configuration and vocabulary files required to preprocess the text prompt before it is fed to the text encoder.

The [unet](unet) folder contains the UNet model used in the diffusion process. The UNet is exported and structured specifically to leverage the AMD NPU accelerator for the denoising steps.

The [vae_decoder](vae_decoder) folder contains the VAE decoder model used to map latent representations back to the image space. The VAE decoder is also structured to make use of the NPU accelerator for efficient image reconstruction.

> Note: UNet and VAE decoder models are optimized and structured to run on AMD NPUs. The other components (text encoder, tokenizer and scheduler) are shared between GPU and NPU pipelines, but are provided here for completeness.

| Model Details | Description |
| ----------- | ----------- | 
| Person or organization developing model | [Giovanni Guasti (AMD)](https://huggingface.co/gguasti), [Benjamin Consolvo (AMD)](https://huggingface.co/bconsolvo) | 
| Original model authors | [Robin Rombach](https://huggingface.co/rromb), [Patrick Esser](https://huggingface.co/pesser) | 
| Model date | January 2026 | 
| Model version | 1.7.0 | 
| Model type | Diffusion-based text-to-image generation model | 
| Information about training algorithms, parameters, fairness constraints or other applied approaches, and features | This is a model that can be used to generate and modify images based on text prompts. It is a [Latent Diffusion Model](https://arxiv.org/abs/2112.10752) that uses a fixed, pretrained text encoder ([CLIP ViT-L/14](https://arxiv.org/abs/2103.00020)) as suggested in the [Imagen paper](https://arxiv.org/abs/2205.11487). | 
| License | [CreativeML OpenRAIL-M](LICENSE) |
| Where to send questions or comments about the model | [Community Tab](https://hf.co/amd/stable-diffusion-1.5-amdnpu/discussions) and [AMD Developer Community Discord](https://discord.gg/amd-dev) |

## ⚑ Intended Use

#### Getting Started

To get started on with this model, visit [github.com/amd/sd-sandbox](https://github.com/amd/sd-sandbox). 

## βš“ Ethical Considerations

AMD is committed to conducting our business in a fair, ethical and honest manner and in compliance with all applicable laws, rules and regulations. You can find out more at the [AMD Ethics and Compliance](https://www.amd.com/en/corporate/corporate-responsibility/ethics-and-compliance.html) page.

## ⚠️ Caveats and Recommendations

Please visit the original model card for more details: [stable-diffusion-v1-5/stable-diffusion-v1-5](https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5).

## πŸ“Œ Citation Details

```bibtex
    @InProceedings{Rombach_2022_CVPR,
        author    = {Rombach, Robin and Blattmann, Andreas and Lorenz, Dominik and Esser, Patrick and Ommer, Bj\"orn},
        title     = {High-Resolution Image Synthesis With Latent Diffusion Models},
        booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
        month     = {June},
        year      = {2022},
        pages     = {10684-10695}
    }
```