Spaces:
Runtime error
Runtime error
zhiweili
commited on
Commit
·
ad2fa8d
1
Parent(s):
9e6a15d
change adapter
Browse files
app_haircolor_inpaint_adapter_15.py
CHANGED
|
@@ -91,16 +91,17 @@ def image_to_image(
|
|
| 91 |
):
|
| 92 |
run_task_time = 0
|
| 93 |
time_cost_str = ''
|
|
|
|
| 94 |
run_task_time, time_cost_str = get_time_cost(run_task_time, time_cost_str)
|
| 95 |
# canny_image = canny_detector(input_image, int(generate_size*1), generate_size)
|
| 96 |
-
canny_image = custom_canny_detector(input_image)
|
| 97 |
# lineart_image = lineart_detector(input_image, int(generate_size*1), generate_size)
|
| 98 |
# run_task_time, time_cost_str = get_time_cost(run_task_time, time_cost_str)
|
| 99 |
-
pidiNet_image = pidiNet_detector(
|
| 100 |
# cond_image = [canny_image, pidiNet_image]
|
| 101 |
# cond_scale = [cond_scale1, cond_scale2]
|
| 102 |
|
| 103 |
-
cond_image =
|
| 104 |
cond_scale = cond_scale1
|
| 105 |
|
| 106 |
generator = torch.Generator(device=DEVICE).manual_seed(seed)
|
|
|
|
| 91 |
):
|
| 92 |
run_task_time = 0
|
| 93 |
time_cost_str = ''
|
| 94 |
+
detect_image = input_image.convert('L')
|
| 95 |
run_task_time, time_cost_str = get_time_cost(run_task_time, time_cost_str)
|
| 96 |
# canny_image = canny_detector(input_image, int(generate_size*1), generate_size)
|
| 97 |
+
# canny_image = custom_canny_detector(input_image)
|
| 98 |
# lineart_image = lineart_detector(input_image, int(generate_size*1), generate_size)
|
| 99 |
# run_task_time, time_cost_str = get_time_cost(run_task_time, time_cost_str)
|
| 100 |
+
pidiNet_image = pidiNet_detector(detect_image, int(generate_size*1), generate_size)
|
| 101 |
# cond_image = [canny_image, pidiNet_image]
|
| 102 |
# cond_scale = [cond_scale1, cond_scale2]
|
| 103 |
|
| 104 |
+
cond_image = pidiNet_image
|
| 105 |
cond_scale = cond_scale1
|
| 106 |
|
| 107 |
generator = torch.Generator(device=DEVICE).manual_seed(seed)
|