Update README.md
Browse files
README.md
CHANGED
@@ -23,19 +23,17 @@ Please raise any concerns you may have.
|
|
23 |
## Usage
|
24 |
|
25 |
```python
|
26 |
-
# !pip install diffusers
|
27 |
-
from diffusers import
|
28 |
-
import PIL.Image
|
29 |
-
import numpy as np
|
30 |
|
31 |
model_id = "CompVis/ldm-text2im-large-256"
|
32 |
|
33 |
# load model and scheduler
|
34 |
-
ldm =
|
35 |
|
36 |
# run pipeline in inference (sample random noise and denoise)
|
37 |
prompt = "A painting of a squirrel eating a burger"
|
38 |
-
images = ldm([prompt], num_inference_steps=50, eta=0.3, guidance_scale=
|
39 |
|
40 |
# save images
|
41 |
for idx, image in enumerate(images):
|
@@ -43,4 +41,12 @@ for idx, image in enumerate(images):
|
|
43 |
```
|
44 |
|
45 |
## Demo
|
46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
## Usage
|
24 |
|
25 |
```python
|
26 |
+
# !pip install diffusers transformers
|
27 |
+
from diffusers import DiffusionPipeline
|
|
|
|
|
28 |
|
29 |
model_id = "CompVis/ldm-text2im-large-256"
|
30 |
|
31 |
# load model and scheduler
|
32 |
+
ldm = DiffusionPipeline.from_pretrained(model_id)
|
33 |
|
34 |
# run pipeline in inference (sample random noise and denoise)
|
35 |
prompt = "A painting of a squirrel eating a burger"
|
36 |
+
images = ldm([prompt], num_inference_steps=50, eta=0.3, guidance_scale=6)["sample"]
|
37 |
|
38 |
# save images
|
39 |
for idx, image in enumerate(images):
|
|
|
41 |
```
|
42 |
|
43 |
## Demo
|
44 |
+
|
45 |
+
[Hugging Face Spaces](https://huggingface.co/spaces/CompVis/ldm-text2im-large-256-diffusers)
|
46 |
+
|
47 |
+
## Samples
|
48 |
+
|
49 |
+
1. 
|
50 |
+
2. 
|
51 |
+
3. 
|
52 |
+
4. 
|