Astridkraft commited on
Commit
c92ac43
·
verified ·
1 Parent(s): 48aa073

Update controlnet_module.py

Browse files
Files changed (1) hide show
  1. controlnet_module.py +38 -0
controlnet_module.py CHANGED
@@ -891,6 +891,44 @@ class ControlNetProcessor:
891
  face_y = center_y - face_offset
892
  face_y = max(y1 + 10, min(face_y, y2 - 10)) # In BBox halten
893
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
894
  # NUR EIN Punkt: Der Gesichtspunkt in der Mitte der BBox
895
  input_points = [[[[center_x, center_y]]]] # EIN Punkt
896
  input_labels = [[[1]]] # Ein positiver Prompt
 
891
  face_y = center_y - face_offset
892
  face_y = max(y1 + 10, min(face_y, y2 - 10)) # In BBox halten
893
 
894
+
895
+ if is_back_head:
896
+ # 🔥 HINTERKOPF: ZWEI Punkte
897
+ back_offset = int(bbox_height * 0.4)
898
+ back_x = center_x
899
+ back_y = center_y + back_offset
900
+ back_y = min(back_y, y2 - 10)
901
+
902
+ input_points = [[[[face_x, face_y], [back_x, back_y]]]]
903
+ input_labels = [[[1, 0]]]
904
+
905
+ print(f" 🎯 HINTERKOPF-SAM: Positiv ({face_x},{face_y}), Negativ ({back_x},{back_y})")
906
+ else:
907
+ # 😊 GESICHT: NUR EIN Punkt
908
+ input_points = [[[[face_x, face_y]]]]
909
+ input_labels = [[[1]]]
910
+
911
+ print(f" 🎯 GESICHTS-SAM: Punkt ({face_x},{face_y})")
912
+
913
+
914
+
915
+
916
+
917
+
918
+
919
+
920
+
921
+
922
+
923
+
924
+
925
+
926
+
927
+
928
+
929
+
930
+
931
+
932
  # NUR EIN Punkt: Der Gesichtspunkt in der Mitte der BBox
933
  input_points = [[[[center_x, center_y]]]] # EIN Punkt
934
  input_labels = [[[1]]] # Ein positiver Prompt