Update controlnet_module.py
Browse files- controlnet_module.py +15 -3
controlnet_module.py
CHANGED
|
@@ -160,9 +160,21 @@ class ControlNetProcessor:
|
|
| 160 |
print(f"🔍 Reshaped_input_sizes parameter (in inputs): {inputs.get('reshaped_input_sizes', 'NOT FOUND')}")
|
| 161 |
|
| 162 |
|
| 163 |
-
|
| 164 |
-
#
|
| 165 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 166 |
|
| 167 |
# 2. Konvertiere die Größen-Parameter zu CPU und als Python-Liste
|
| 168 |
original_size = inputs['original_sizes'].cpu().numpy().tolist()[0] # [512, 512]
|
|
|
|
| 160 |
print(f"🔍 Reshaped_input_sizes parameter (in inputs): {inputs.get('reshaped_input_sizes', 'NOT FOUND')}")
|
| 161 |
|
| 162 |
|
| 163 |
+
|
| 164 |
+
# Debug: Vollständige Dimensionsanalyse
|
| 165 |
+
print(f"🔍 outputs.pred_masks shape: {outputs.pred_masks.shape}")
|
| 166 |
+
print(f"🔍 outputs.pred_masks dimensions: {outputs.pred_masks.dim()}")
|
| 167 |
+
|
| 168 |
+
# Nach der Auswahl
|
| 169 |
+
single_mask = outputs.pred_masks[:, :, 0, :, :]
|
| 170 |
+
print(f"🔍 single_mask shape: {single_mask.shape}")
|
| 171 |
+
print(f"🔍 single_mask dimensions: {single_mask.dim()}")
|
| 172 |
+
|
| 173 |
+
# Wichtig: Ist es wirklich [1, 1, 256, 256] oder [1, 256, 256]?
|
| 174 |
+
if single_mask.dim() == 3:
|
| 175 |
+
print("⚠️ WARNUNG: Maske hat nur 3 Dimensionen! Korrigiere...")
|
| 176 |
+
single_mask = single_mask.unsqueeze(1) # Fügt Channel-Dimension hinzu
|
| 177 |
+
|
| 178 |
|
| 179 |
# 2. Konvertiere die Größen-Parameter zu CPU und als Python-Liste
|
| 180 |
original_size = inputs['original_sizes'].cpu().numpy().tolist()[0] # [512, 512]
|