Update controlnet_module.py
Browse files- controlnet_module.py +3 -3
controlnet_module.py
CHANGED
|
@@ -595,8 +595,8 @@ class ControlNetProcessor:
|
|
| 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((
|
| 600 |
|
| 601 |
print(f"🔳 [FOCUS] Inpainting-Maske gespeichert: {np.unique(inpaint_binary_mask)}")
|
| 602 |
|
|
@@ -618,7 +618,7 @@ class ControlNetProcessor:
|
|
| 618 |
# Konvertierung von NumPy-Array auf PIL-Image
|
| 619 |
mask_original = Image.fromarray(mask_array).convert("L")
|
| 620 |
raw_mask = Image.fromarray(raw_mask_array).convert("L")
|
| 621 |
-
inpaint_binary_pil = Image.fromarray(inpaint_binary_mask).convert("L")
|
| 622 |
|
| 623 |
# Finale Maske für ControlNet
|
| 624 |
mask = mask_original
|
|
|
|
| 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 auf 3x3 herunter da Rahmen bei 512x512
|
| 599 |
+
inpaint_binary_mask = cv2.dilate(clean_mask, np.ones((3,3), np.uint8), 1)
|
| 600 |
|
| 601 |
print(f"🔳 [FOCUS] Inpainting-Maske gespeichert: {np.unique(inpaint_binary_mask)}")
|
| 602 |
|
|
|
|
| 618 |
# Konvertierung von NumPy-Array auf PIL-Image
|
| 619 |
mask_original = Image.fromarray(mask_array).convert("L")
|
| 620 |
raw_mask = Image.fromarray(raw_mask_array).convert("L")
|
| 621 |
+
inpaint_binary_pil = Image.fromarray(inpaint_binary_mask).convert("L")
|
| 622 |
|
| 623 |
# Finale Maske für ControlNet
|
| 624 |
mask = mask_original
|