Update controlnet_module.py
Browse files- controlnet_module.py +6 -2
controlnet_module.py
CHANGED
|
@@ -1195,12 +1195,16 @@ class ControlNetProcessor:
|
|
| 1195 |
print(f" Offsets: x={-x_offset}, y={-y_offset}")
|
| 1196 |
|
| 1197 |
# RAW-Maske ebenfalls erweitern (für Debug-Anzeige)
|
| 1198 |
-
|
| 1199 |
(int(raw_mask_original.width * 1.3), int(raw_mask_original.height * 1.3)),
|
| 1200 |
Image.Resampling.NEAREST
|
| 1201 |
)
|
| 1202 |
temp = Image.new("L", original_image.size, 0)
|
| 1203 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1204 |
raw_mask_original = temp
|
| 1205 |
|
| 1206 |
# ============================================================
|
|
|
|
| 1195 |
print(f" Offsets: x={-x_offset}, y={-y_offset}")
|
| 1196 |
|
| 1197 |
# RAW-Maske ebenfalls erweitern (für Debug-Anzeige)
|
| 1198 |
+
raw_mask_expanded = raw_mask_original.resize(
|
| 1199 |
(int(raw_mask_original.width * 1.3), int(raw_mask_original.height * 1.3)),
|
| 1200 |
Image.Resampling.NEAREST
|
| 1201 |
)
|
| 1202 |
temp = Image.new("L", original_image.size, 0)
|
| 1203 |
+
# WICHTIG: Original-Position + Offset
|
| 1204 |
+
new_x = crop_x1 - 15
|
| 1205 |
+
new_y = crop_y1 - 15
|
| 1206 |
+
temp.paste(raw_mask_expanded, (new_x, new_y))
|
| 1207 |
+
|
| 1208 |
raw_mask_original = temp
|
| 1209 |
|
| 1210 |
# ============================================================
|