multimodalart HF Staff commited on
Commit
55dd9ea
·
verified ·
1 Parent(s): 34e0161

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -10,7 +10,7 @@ from PIL import Image
10
  from diffusers import QwenImageControlNetPipeline, QwenImageControlNetModel
11
 
12
  # --- Preprocessor Imports ---
13
- from controlnet_aux import OpenposeDetector, AnylineDetector
14
  from depth_anything_v2.dpt import DepthAnythingV2
15
 
16
  # --- Prompt Enhancement Imports ---
@@ -98,7 +98,7 @@ depth_anything = depth_anything.to(device).eval()
98
  # Load Pose and Soft Edge Detectors
99
  print("Loading other detectors...")
100
  openpose_detector = OpenposeDetector.from_pretrained("lllyasviel/Annotators")
101
- anyline_detector = AnylineDetector.from_pretrained("lllyasviel/Annotators", filename="anyline.pth").to(device)
102
 
103
  print("All models loaded.")
104
 
@@ -106,8 +106,8 @@ def get_control_image(input_image, control_mode):
106
  """A master function to select and run the correct preprocessor."""
107
  if control_mode == "Canny":
108
  return extract_canny(input_image)
109
- elif control_mode == "Soft Edge":
110
- return anyline_detector(input_image, to_pil=True)
111
  elif control_mode == "Depth":
112
  image_np = np.array(input_image)
113
  with torch.no_grad():
 
10
  from diffusers import QwenImageControlNetPipeline, QwenImageControlNetModel
11
 
12
  # --- Preprocessor Imports ---
13
+ from controlnet_aux import OpenposeDetector #, AnylineDetector
14
  from depth_anything_v2.dpt import DepthAnythingV2
15
 
16
  # --- Prompt Enhancement Imports ---
 
98
  # Load Pose and Soft Edge Detectors
99
  print("Loading other detectors...")
100
  openpose_detector = OpenposeDetector.from_pretrained("lllyasviel/Annotators")
101
+ #anyline_detector = AnylineDetector.from_pretrained("lllyasviel/Annotators", filename="anyline.pth").to(device)
102
 
103
  print("All models loaded.")
104
 
 
106
  """A master function to select and run the correct preprocessor."""
107
  if control_mode == "Canny":
108
  return extract_canny(input_image)
109
+ #elif control_mode == "Soft Edge":
110
+ # return anyline_detector(input_image, to_pil=True)
111
  elif control_mode == "Depth":
112
  image_np = np.array(input_image)
113
  with torch.no_grad():