Update controlnet_module.py
Browse files- controlnet_module.py +9 -6
controlnet_module.py
CHANGED
|
@@ -591,16 +591,19 @@ 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 |
|
| 596 |
-
|
| 597 |
-
kernel_dilate = np.ones((15, 15), np.uint8)
|
| 598 |
-
mask_array = cv2.dilate(mask_array, kernel_dilate, iterations=1)
|
| 599 |
|
| 600 |
|
| 601 |
-
#
|
| 602 |
-
|
| 603 |
-
|
| 604 |
|
| 605 |
|
| 606 |
# 3. Weiche Übergänge mittlerer Blur für natürliche Übergänge
|
|
|
|
| 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 |
+
# Für jeweils einen anderen Dilate-Wert für Inpaint und Composition
|
| 596 |
+
clean_mask = mask_array.copy()
|
| 597 |
|
| 598 |
+
# 1. FÜR INPAINT: 5×5 Dilate auf clean_mask
|
| 599 |
+
inpaint_binary_mask = cv2.dilate(clean_mask, np.ones((5,5), np.uint8), 1)
|
| 600 |
|
| 601 |
+
print(f"🔳 [FOCUS] Inpainting-Maske gespeichert: {np.unique(inpaint_binary_mask)}")
|
|
|
|
|
|
|
| 602 |
|
| 603 |
|
| 604 |
+
# 2. FÜR COMPOSITING: 15×15 Dilate + Blur AUF mask_array (nach close)
|
| 605 |
+
kernel_dilate = np.ones((15, 15), np.uint8)
|
| 606 |
+
mask_array = cv2.dilate(mask_array, kernel_dilate, iterations=1)
|
| 607 |
|
| 608 |
|
| 609 |
# 3. Weiche Übergänge mittlerer Blur für natürliche Übergänge
|