Spaces:
Runtime error
Runtime error
zhiweili commited on
Commit ·
ca7b26c
1
Parent(s): 623b249
test p2p
Browse files- app_haircolor_img2img.py +5 -7
app_haircolor_img2img.py
CHANGED
|
@@ -44,12 +44,10 @@ pidiNet_detector = pidiNet_detector.to(DEVICE)
|
|
| 44 |
hed_detector = HEDdetector.from_pretrained('lllyasviel/Annotators')
|
| 45 |
hed_detector = hed_detector.to(DEVICE)
|
| 46 |
|
| 47 |
-
controlnet =
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
),
|
| 52 |
-
]
|
| 53 |
|
| 54 |
basepipeline = StableDiffusionControlNetImg2ImgPipeline.from_pretrained(
|
| 55 |
BASE_MODEL,
|
|
@@ -77,7 +75,7 @@ def image_to_image(
|
|
| 77 |
time_cost_str = ''
|
| 78 |
run_task_time, time_cost_str = get_time_cost(run_task_time, time_cost_str)
|
| 79 |
|
| 80 |
-
cond_image =
|
| 81 |
|
| 82 |
# generator = torch.Generator(device=DEVICE).manual_seed(seed)
|
| 83 |
generated_image = basepipeline(
|
|
|
|
| 44 |
hed_detector = HEDdetector.from_pretrained('lllyasviel/Annotators')
|
| 45 |
hed_detector = hed_detector.to(DEVICE)
|
| 46 |
|
| 47 |
+
controlnet = ControlNetModel.from_pretrained(
|
| 48 |
+
"lllyasviel/control_v11e_sd15_ip2p",
|
| 49 |
+
torch_dtype=torch.float16,
|
| 50 |
+
)
|
|
|
|
|
|
|
| 51 |
|
| 52 |
basepipeline = StableDiffusionControlNetImg2ImgPipeline.from_pretrained(
|
| 53 |
BASE_MODEL,
|
|
|
|
| 75 |
time_cost_str = ''
|
| 76 |
run_task_time, time_cost_str = get_time_cost(run_task_time, time_cost_str)
|
| 77 |
|
| 78 |
+
cond_image = input_image
|
| 79 |
|
| 80 |
# generator = torch.Generator(device=DEVICE).manual_seed(seed)
|
| 81 |
generated_image = basepipeline(
|