Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,8 @@ import gradio as gr
|
|
2 |
import numpy as np
|
3 |
import random
|
4 |
import spaces #[uncomment to use ZeroGPU]
|
5 |
-
|
|
|
6 |
import torch
|
7 |
|
8 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
@@ -14,6 +15,7 @@ else:
|
|
14 |
torch_dtype = torch.float32
|
15 |
|
16 |
pipe = DiffusionPipeline.from_pretrained(model_repo_id, torch_dtype=torch_dtype)
|
|
|
17 |
pipe.scheduler = DPMSolverSDEScheduler.from_config(pipe.scheduler.config, algorithm_type="dpmsolver++", solver_order=2, use_karras_sigmas=True)
|
18 |
pipe = pipe.to(device)
|
19 |
|
|
|
2 |
import numpy as np
|
3 |
import random
|
4 |
import spaces #[uncomment to use ZeroGPU]
|
5 |
+
#added DPMSolverSDEScheduler
|
6 |
+
from diffusers import DiffusionPipeline, DPMSolverSDEScheduler
|
7 |
import torch
|
8 |
|
9 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
|
15 |
torch_dtype = torch.float32
|
16 |
|
17 |
pipe = DiffusionPipeline.from_pretrained(model_repo_id, torch_dtype=torch_dtype)
|
18 |
+
#added full line below pipe.scheduler...
|
19 |
pipe.scheduler = DPMSolverSDEScheduler.from_config(pipe.scheduler.config, algorithm_type="dpmsolver++", solver_order=2, use_karras_sigmas=True)
|
20 |
pipe = pipe.to(device)
|
21 |
|