zhiweili commited on
Commit
f3d17f0
1 Parent(s): b6c2393

fix canny image

Browse files
Files changed (1) hide show
  1. app_haircolor_pix2pix.py +2 -1
app_haircolor_pix2pix.py CHANGED
@@ -36,7 +36,7 @@ DEFAULT_CATEGORY = "hair"
36
  canny_detector = CannyDetector()
37
 
38
  adapter = T2IAdapter.from_pretrained(
39
- "TencentARC/t2i-adapter-canny-sdxl-1.0",
40
  torch_dtype=torch.float16,
41
  varient="fp16",
42
  )
@@ -70,6 +70,7 @@ def image_to_image(
70
  time_cost_str = ''
71
  run_task_time, time_cost_str = get_time_cost(run_task_time, time_cost_str)
72
  canny_image = canny_detector(input_image)
 
73
 
74
  cond_image = canny_image
75
  cond_scale = cond_scale1
 
36
  canny_detector = CannyDetector()
37
 
38
  adapter = T2IAdapter.from_pretrained(
39
+ "TencentARC/t2iadapter_canny_sd15v2",
40
  torch_dtype=torch.float16,
41
  varient="fp16",
42
  )
 
70
  time_cost_str = ''
71
  run_task_time, time_cost_str = get_time_cost(run_task_time, time_cost_str)
72
  canny_image = canny_detector(input_image)
73
+ canny_image = canny_image.convert("L")
74
 
75
  cond_image = canny_image
76
  cond_scale = cond_scale1