Spaces:
Running
Running
zhiweili
commited on
Commit
·
1036005
1
Parent(s):
5869b35
add multi contronet
Browse files
app_haircolor_inpaint_15.py
CHANGED
@@ -11,7 +11,6 @@ from segment_utils import(
|
|
11 |
)
|
12 |
from diffusers import (
|
13 |
StableDiffusionControlNetInpaintPipeline,
|
14 |
-
StableDiffusionXLControlNetInpaintPipeline,
|
15 |
ControlNetModel,
|
16 |
DDIMScheduler,
|
17 |
)
|
@@ -42,7 +41,7 @@ controlnet = [
|
|
42 |
),
|
43 |
]
|
44 |
|
45 |
-
basepipeline =
|
46 |
BASE_MODEL,
|
47 |
torch_dtype=torch.float16,
|
48 |
use_safetensors=True,
|
@@ -85,7 +84,7 @@ def image_to_image(
|
|
85 |
width=generate_size,
|
86 |
guidance_scale=guidance_scale,
|
87 |
num_inference_steps=num_steps,
|
88 |
-
controlnet_conditioning_scale=[inpaint_scale, canny_scale]
|
89 |
).images[0]
|
90 |
|
91 |
run_task_time, time_cost_str = get_time_cost(run_task_time, time_cost_str)
|
|
|
11 |
)
|
12 |
from diffusers import (
|
13 |
StableDiffusionControlNetInpaintPipeline,
|
|
|
14 |
ControlNetModel,
|
15 |
DDIMScheduler,
|
16 |
)
|
|
|
41 |
),
|
42 |
]
|
43 |
|
44 |
+
basepipeline = StableDiffusionControlNetInpaintPipeline.from_pretrained(
|
45 |
BASE_MODEL,
|
46 |
torch_dtype=torch.float16,
|
47 |
use_safetensors=True,
|
|
|
84 |
width=generate_size,
|
85 |
guidance_scale=guidance_scale,
|
86 |
num_inference_steps=num_steps,
|
87 |
+
# controlnet_conditioning_scale=[inpaint_scale, canny_scale]
|
88 |
).images[0]
|
89 |
|
90 |
run_task_time, time_cost_str = get_time_cost(run_task_time, time_cost_str)
|