Spaces:
Running
on
Zero
Running
on
Zero
zhiweili
commited on
Commit
•
2f57cfb
1
Parent(s):
760912a
change base model
Browse files
app_haircolor_inpaint_15.py
CHANGED
@@ -13,6 +13,7 @@ from diffusers import (
|
|
13 |
StableDiffusionControlNetInpaintPipeline,
|
14 |
ControlNetModel,
|
15 |
DDIMScheduler,
|
|
|
16 |
)
|
17 |
|
18 |
from controlnet_aux import (
|
@@ -22,7 +23,8 @@ from controlnet_aux import (
|
|
22 |
HEDdetector,
|
23 |
)
|
24 |
|
25 |
-
BASE_MODEL = "stable-diffusion-v1-5/stable-diffusion-v1-5"
|
|
|
26 |
|
27 |
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
|
28 |
|
@@ -58,7 +60,11 @@ basepipeline = StableDiffusionControlNetInpaintPipeline.from_pretrained(
|
|
58 |
use_safetensors=True,
|
59 |
controlnet=controlnet,
|
60 |
)
|
61 |
-
basepipeline.scheduler = DDIMScheduler.from_config(basepipeline.scheduler.config)
|
|
|
|
|
|
|
|
|
62 |
|
63 |
basepipeline = basepipeline.to(DEVICE)
|
64 |
|
|
|
13 |
StableDiffusionControlNetInpaintPipeline,
|
14 |
ControlNetModel,
|
15 |
DDIMScheduler,
|
16 |
+
DPMSolverMultistepScheduler,
|
17 |
)
|
18 |
|
19 |
from controlnet_aux import (
|
|
|
23 |
HEDdetector,
|
24 |
)
|
25 |
|
26 |
+
# BASE_MODEL = "stable-diffusion-v1-5/stable-diffusion-v1-5"
|
27 |
+
BASE_MODEL = "SG161222/Realistic_Vision_V2.0"
|
28 |
|
29 |
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
|
30 |
|
|
|
60 |
use_safetensors=True,
|
61 |
controlnet=controlnet,
|
62 |
)
|
63 |
+
# basepipeline.scheduler = DDIMScheduler.from_config(basepipeline.scheduler.config)
|
64 |
+
basepipeline.scheduler = DPMSolverMultistepScheduler.from_config(
|
65 |
+
basepipeline.scheduler.config,
|
66 |
+
use_karras_sigmas=True,
|
67 |
+
)
|
68 |
|
69 |
basepipeline = basepipeline.to(DEVICE)
|
70 |
|