Update controlnet_module.py
Browse files- controlnet_module.py +5 -4
controlnet_module.py
CHANGED
|
@@ -591,14 +591,15 @@ class ControlNetProcessor:
|
|
| 591 |
# 2. Morphologische Operationen
|
| 592 |
kernel_close = np.ones((5, 5), np.uint8)
|
| 593 |
mask_array = cv2.morphologyEx(mask_array, cv2.MORPH_CLOSE, kernel_close, iterations=2)
|
| 594 |
-
|
| 595 |
-
kernel_dilate = np.ones((15, 15), np.uint8)
|
| 596 |
-
mask_array = cv2.dilate(mask_array, kernel_dilate, iterations=1)
|
| 597 |
|
| 598 |
#Sicherung der Binärmaske für Inpaint ohne Graupixel
|
| 599 |
inpaint_binary_mask = mask_array.copy()
|
| 600 |
-
|
| 601 |
print(f"🔳 [FOCUS] Inpainting-Maske gespeichert: {np.unique(inpaint_binary_mask)}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 602 |
|
| 603 |
# 3. Weiche Übergänge mittlerer Blur für natürliche Übergänge
|
| 604 |
mask_array = cv2.GaussianBlur(mask_array, (9, 9), 2.0)
|
|
|
|
| 591 |
# 2. Morphologische Operationen
|
| 592 |
kernel_close = np.ones((5, 5), np.uint8)
|
| 593 |
mask_array = cv2.morphologyEx(mask_array, cv2.MORPH_CLOSE, kernel_close, iterations=2)
|
|
|
|
|
|
|
|
|
|
| 594 |
|
| 595 |
#Sicherung der Binärmaske für Inpaint ohne Graupixel
|
| 596 |
inpaint_binary_mask = mask_array.copy()
|
|
|
|
| 597 |
print(f"🔳 [FOCUS] Inpainting-Maske gespeichert: {np.unique(inpaint_binary_mask)}")
|
| 598 |
+
|
| 599 |
+
#Dilate erweitert die Person um 7 weiße Pixel
|
| 600 |
+
kernel_dilate = np.ones((15, 15), np.uint8)
|
| 601 |
+
mask_array = cv2.dilate(mask_array, kernel_dilate, iterations=1)
|
| 602 |
+
|
| 603 |
|
| 604 |
# 3. Weiche Übergänge mittlerer Blur für natürliche Übergänge
|
| 605 |
mask_array = cv2.GaussianBlur(mask_array, (9, 9), 2.0)
|