English
art
Stable Diffusion
File size: 2,251 Bytes
ae89015
 
9ced76e
 
 
 
 
 
 
 
ae89015
ddb8777
9ced76e
5507be0
 
 
9ced76e
2dd77b1
b8227c1
 
 
76d6b62
 
ddb8777
9ced76e
3046469
 
 
 
 
 
 
 
 
 
ddb8777
3046469
 
 
 
 
 
 
 
ddb8777
 
 
 
 
 
9ced76e
 
 
 
 
76d6b62
25dabe4
 
 
0007b0f
9ced76e
 
25dabe4
 
 
0007b0f
 
76d6b62
0007b0f
 
 
65ea183
0007b0f
 
 
65ea183
0007b0f
65ea183
0007b0f
 
9ced76e
b8227c1
 
 
 
 
 
 
 
394166f
ce7511f
394166f
 
 
 
 
 
b8efce6
394166f
b8227c1
 
 
 
9ced76e
 
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
---
license: creativeml-openrail-m
language:
- zh
- en
library_name: diffusers
pipeline_tag: text-to-image
tags:
- art
- tensorRT
---
## Model Card for lyraSD

lyraSD is currently the **fastest Stable Diffusion model** available, boasting an inference cost of only **0.36 seconds** for a 512x512 image, accelerating the process up to **10 times faster** than the original version. 

Among its main features are:

- weights: original Stable Diffusion 1.5 weights
- input image: 512x512 (in img2img mode)
- output image: 512x512
- device requirements: Nvidia Ampere architecture (A100) or compatable
- super-resultion: 4x by default, optional.

## Speed

### test environment

- device: Nvidia A100 40G
- img size: 512x512
- percision:fp16
- steps: 30
- solver: LMSD

### text2img
|model|time cost(ms)|memory(MB)|
|:-:|:-:|:-:|
|Pytorch|~5000ms|~10240|
|LyraSD|~435ms|~4026|

### superResolution
|model|time cost(ms)|memory(MB)|
|:-:|:-:|:-:|
|Pytorch|720ms|~6650|
|LyraSD|~26ms|~1600|





## Model Sources [optional]

- **Repository:** [https://huggingface.co/runwayml/stable-diffusion-v1-5]

## Uses

```python
from lyraSD import LyraSD

t2imodel = LyraSD("text2img", "./sd1.5-engine")
t2imodel.inference(prompt="A fantasy landscape, trending on artstation", use_super=False)


from PIL import Image
i2imodel = LyraSD("img2img", "./sd1.5-engine")
demo_img = Image.open("output/text2img_demo.jpg")
i2imodel.inference(prompt="A fantasy landscape, trending on artstation", image=demo_img)

```
## Demo output

### text2img
![text2img_demo](./output/text2img_demo.jpg)

### img2img

![text2img_demo](./output/img2img_input.jpg)

![text2img_demo](./output/img2img_demo.jpg)



## environment

- hardware: Nvidia Ampere architecture (A100) or compatable
- docker image avaible: https://hub.docker.com/r/bigmoyan/lyra_aigc/tags
```
docker pull bigmoyan/lyra_aigc:v0.1
```

## citation
``` bibtex
@Misc{xFormers2022,
  author =       {Bin Wu, Kangjian Wu, Zhengtao Wang},
  title =        {LyraSD},
  howpublished = {\url{https://huggingface.co/TMElyralab/lyraSD}},
  year =         {2023}
}
```

## report bug
- start a discussion to report any bugs!--> https://huggingface.co/TMElyralab/lyraSD/discussions
- report bug with a `[bug]` mark in the title.