Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,7 @@ import gradio as gr
|
|
3 |
import numpy as np
|
4 |
import spaces
|
5 |
import torch
|
6 |
-
from diffusers import AutoPipelineForText2Image, AutoencoderKL
|
7 |
|
8 |
if not torch.cuda.is_available():
|
9 |
DESCRIPTION += "\n<p>你现在运行在CPU上 但是只支持GPU.</p>"
|
@@ -21,7 +21,7 @@ if torch.cuda.is_available():
|
|
21 |
add_watermarker=False
|
22 |
)
|
23 |
|
24 |
-
|
25 |
pipe.to("cuda")
|
26 |
|
27 |
def randomize_seed_fn(seed: int, randomize_seed: bool) -> int:
|
|
|
3 |
import numpy as np
|
4 |
import spaces
|
5 |
import torch
|
6 |
+
from diffusers import AutoPipelineForText2Image, AutoencoderKL ,EulerDiscreteScheduler
|
7 |
|
8 |
if not torch.cuda.is_available():
|
9 |
DESCRIPTION += "\n<p>你现在运行在CPU上 但是只支持GPU.</p>"
|
|
|
21 |
add_watermarker=False
|
22 |
)
|
23 |
|
24 |
+
pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config, timestep_spacing="trailing")
|
25 |
pipe.to("cuda")
|
26 |
|
27 |
def randomize_seed_fn(seed: int, randomize_seed: bool) -> int:
|