Update README.md
Browse files
README.md
CHANGED
@@ -18,14 +18,21 @@ pip install diffusers transformers accelerate scipy safetensors
|
|
18 |
Running the pipeline (if you don't swap the scheduler it will run with the default DDIM, in this example we are swapping it to EulerDiscreteScheduler):
|
19 |
|
20 |
```python
|
|
|
21 |
from diffusers import StableDiffusionPipeline, EulerDiscreteScheduler
|
|
|
22 |
model_id = "lcybuaa/Text2Earth"
|
23 |
-
#
|
24 |
scheduler = EulerDiscreteScheduler.from_pretrained(model_id, subfolder="scheduler")
|
25 |
-
pipe = StableDiffusionPipeline.from_pretrained(model_id,
|
|
|
26 |
pipe = pipe.to("cuda")
|
27 |
prompt = "Seven green circular farmlands are neatly arranged on the ground"
|
28 |
-
image = pipe(prompt
|
29 |
-
|
|
|
|
|
|
|
|
|
30 |
image.save("circular.png")
|
31 |
```
|
|
|
18 |
Running the pipeline (if you don't swap the scheduler it will run with the default DDIM, in this example we are swapping it to EulerDiscreteScheduler):
|
19 |
|
20 |
```python
|
21 |
+
import torch
|
22 |
from diffusers import StableDiffusionPipeline, EulerDiscreteScheduler
|
23 |
+
|
24 |
model_id = "lcybuaa/Text2Earth"
|
25 |
+
# Running the pipeline (if you don't swap the scheduler it will run with the default DDIM, in this example we are swapping it to DPMSolverMultistepScheduler):
|
26 |
scheduler = EulerDiscreteScheduler.from_pretrained(model_id, subfolder="scheduler")
|
27 |
+
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16, scheduler=scheduler,
|
28 |
+
custom_pipeline="pipeline_text2earth_diffusion", safety_checker=None)
|
29 |
pipe = pipe.to("cuda")
|
30 |
prompt = "Seven green circular farmlands are neatly arranged on the ground"
|
31 |
+
image = pipe(prompt,
|
32 |
+
height=256,
|
33 |
+
width=256,
|
34 |
+
num_inference_steps=50,
|
35 |
+
guidance_scale=4.0).images[0]
|
36 |
+
|
37 |
image.save("circular.png")
|
38 |
```
|