vinesmsuic
commited on
Commit
•
08ecd0d
1
Parent(s):
bd5db60
modified code example
Browse files
README.md
CHANGED
@@ -30,16 +30,18 @@ pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float
|
|
30 |
pipe = pipe.to("cuda")
|
31 |
|
32 |
prompt = "a classroom"
|
33 |
-
image = pipe(prompt).images[0]
|
|
|
|
|
34 |
image.save("./classroom.png")
|
35 |
|
36 |
prompt = "a hospital building, two trees"
|
37 |
-
image = pipe(prompt).images[0]
|
38 |
|
39 |
image.save("./hospital.png")
|
40 |
|
41 |
prompt = "a street at night with nobody around"
|
42 |
-
image = pipe(prompt).images[0]
|
43 |
|
44 |
image.save("./nightstreet.png")
|
45 |
```
|
|
|
30 |
pipe = pipe.to("cuda")
|
31 |
|
32 |
prompt = "a classroom"
|
33 |
+
image = pipe(prompt, height=512, width=512).images[0]
|
34 |
+
# ^ alternatively you can use for height=1920, width=1080 if you have enough CUDA memory
|
35 |
+
# make sure both height and width are divisible by 8
|
36 |
image.save("./classroom.png")
|
37 |
|
38 |
prompt = "a hospital building, two trees"
|
39 |
+
image = pipe(prompt, height=512, width=512).images[0]
|
40 |
|
41 |
image.save("./hospital.png")
|
42 |
|
43 |
prompt = "a street at night with nobody around"
|
44 |
+
image = pipe(prompt, height=512, width=512).images[0]
|
45 |
|
46 |
image.save("./nightstreet.png")
|
47 |
```
|