Astridkraft commited on
Commit
519b893
·
verified ·
1 Parent(s): ee78137

Update controlnet_module.py

Browse files
Files changed (1) hide show
  1. controlnet_module.py +12 -12
controlnet_module.py CHANGED
@@ -1248,19 +1248,19 @@ class ControlNetProcessor:
1248
  else: #keine use_crop_stategy Bild<=512
1249
  print("👤 POSTPROCESSING AUF ORIGINALGRÖSSE (≤512px)")
1250
 
1251
- # ANGEPASSTE Morphologische Operationen für Originalgröße
1252
- kernel_close = np.ones((5, 5), np.uint8)
1253
- mask_array = cv2.morphologyEx(mask_array, cv2.MORPH_CLOSE, kernel_close, iterations=1)
1254
- print(" • MORPH_CLOSE (5x5) - Löcher im Kopf füllen")
1255
 
1256
- kernel_open = np.ones((3, 3), np.uint8)
1257
- mask_array = cv2.morphologyEx(mask_array, cv2.MORPH_OPEN, kernel_open, iterations=1)
1258
- print(" • MORPH_OPEN (3x3) - Rauschen entfernen")
1259
-
1260
- # Leichter Dilate für mehr Abdeckung
1261
- kernel_dilate = np.ones((3, 3), np.uint8)
1262
- mask_array = cv2.dilate(mask_array, kernel_dilate, iterations=1)
1263
- print(" • DILATE (3x3) - Natürliche Abdeckung")
1264
 
1265
  # Binärmaske für Inpaint speichern (vor Blur)
1266
  inpaint_binary_mask = mask_array.copy()
 
1248
  else: #keine use_crop_stategy Bild<=512
1249
  print("👤 POSTPROCESSING AUF ORIGINALGRÖSSE (≤512px)")
1250
 
1251
+ # ANGEPASSTE Morphologische Operationen für Originalgröße
1252
+ kernel_close = np.ones((5, 5), np.uint8)
1253
+ mask_array = cv2.morphologyEx(mask_array, cv2.MORPH_CLOSE, kernel_close, iterations=1)
1254
+ print(" • MORPH_CLOSE (5x5) - Löcher im Kopf füllen")
1255
 
1256
+ kernel_open = np.ones((3, 3), np.uint8)
1257
+ mask_array = cv2.morphologyEx(mask_array, cv2.MORPH_OPEN, kernel_open, iterations=1)
1258
+ print(" • MORPH_OPEN (3x3) - Rauschen entfernen")
1259
+
1260
+ # Leichter Dilate für mehr Abdeckung
1261
+ kernel_dilate = np.ones((3, 3), np.uint8)
1262
+ mask_array = cv2.dilate(mask_array, kernel_dilate, iterations=1)
1263
+ print(" • DILATE (3x3) - Natürliche Abdeckung")
1264
 
1265
  # Binärmaske für Inpaint speichern (vor Blur)
1266
  inpaint_binary_mask = mask_array.copy()