johnmullan
commited on
Commit
•
62b1068
1
Parent(s):
c86bde1
Update README.md
Browse files
README.md
CHANGED
@@ -42,30 +42,28 @@ pip install invisible_watermark transformers accelerate safetensors
|
|
42 |
|
43 |
Running the pipeline (if you don't swap the scheduler it will run with the default **EulerDiscreteScheduler** in this example we are swapping it to **EulerAncestralDiscreteScheduler**:
|
44 |
```py
|
45 |
-
import torch
|
46 |
-
from torch import autocast
|
47 |
from diffusers import StableDiffusionXLPipeline, EulerAncestralDiscreteScheduler
|
48 |
-
|
49 |
pipe = StableDiffusionXLPipeline.from_pretrained(
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
)
|
55 |
pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
56 |
-
|
57 |
prompt = "a woman laughing"
|
58 |
negative_prompt = ""
|
|
|
59 |
image = pipe(
|
60 |
-
prompt,
|
61 |
-
negative_prompt=negative_prompt,
|
62 |
width=512,
|
63 |
height=512,
|
64 |
-
|
65 |
-
|
66 |
-
original_size=(4096,4096),
|
67 |
num_inference_steps=50
|
68 |
-
|
|
|
69 |
image.save("woman_laughing.png")
|
70 |
```
|
71 |
|
|
|
42 |
|
43 |
Running the pipeline (if you don't swap the scheduler it will run with the default **EulerDiscreteScheduler** in this example we are swapping it to **EulerAncestralDiscreteScheduler**:
|
44 |
```py
|
|
|
|
|
45 |
from diffusers import StableDiffusionXLPipeline, EulerAncestralDiscreteScheduler
|
46 |
+
|
47 |
pipe = StableDiffusionXLPipeline.from_pretrained(
|
48 |
+
"hotshotco/SDXL-512",
|
49 |
+
use_safetensors=True,
|
50 |
+
).to('cuda')
|
51 |
+
|
|
|
52 |
pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
|
53 |
+
|
54 |
prompt = "a woman laughing"
|
55 |
negative_prompt = ""
|
56 |
+
|
57 |
image = pipe(
|
58 |
+
prompt,
|
59 |
+
negative_prompt=negative_prompt,
|
60 |
width=512,
|
61 |
height=512,
|
62 |
+
target_size=(1024, 1024),
|
63 |
+
original_size=(4096, 4096),
|
|
|
64 |
num_inference_steps=50
|
65 |
+
).images[0]
|
66 |
+
|
67 |
image.save("woman_laughing.png")
|
68 |
```
|
69 |
|