Update controlnet_module.py
Browse files- controlnet_module.py +10 -5
controlnet_module.py
CHANGED
|
@@ -202,6 +202,11 @@ class ControlNetProcessor:
|
|
| 202 |
controlnet_conditioning_scale = [controlnet_strength * 0.6, # OpenPose: 60% für Person
|
| 203 |
controlnet_strength * 0.4] # Canny: 40% für Umgebung
|
| 204 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 205 |
else:
|
| 206 |
# PERSON BEIBEHALTEN, UMGEBUNG ÄNDERN → NUR OPENPOSE
|
| 207 |
controlnet_type = "openpose"
|
|
@@ -209,12 +214,12 @@ class ControlNetProcessor:
|
|
| 209 |
conditioning_images = self.extract_pose(image)
|
| 210 |
controlnet_conditioning_scale = controlnet_strength
|
| 211 |
|
| 212 |
-
|
|
|
|
|
|
|
|
|
|
| 213 |
|
| 214 |
-
|
| 215 |
-
seed = random.randint(0, 2**32 - 1)
|
| 216 |
-
generator = torch.Generator(device=self.device).manual_seed(seed)
|
| 217 |
-
print(f"ControlNet Seed: {seed}")
|
| 218 |
|
| 219 |
# Fortschritt-Callback
|
| 220 |
callback = ControlNetProgressCallback(progress, int(steps)) if progress is not None else None
|
|
|
|
| 202 |
controlnet_conditioning_scale = [controlnet_strength * 0.6, # OpenPose: 60% für Person
|
| 203 |
controlnet_strength * 0.4] # Canny: 40% für Umgebung
|
| 204 |
|
| 205 |
+
# Zufälliger Seed
|
| 206 |
+
seed = random.randint(0, 2**32 - 1)
|
| 207 |
+
generator = torch.Generator(device=self.device).manual_seed(seed)
|
| 208 |
+
print(f"ControlNet Seed: {seed}")
|
| 209 |
+
|
| 210 |
else:
|
| 211 |
# PERSON BEIBEHALTEN, UMGEBUNG ÄNDERN → NUR OPENPOSE
|
| 212 |
controlnet_type = "openpose"
|
|
|
|
| 214 |
conditioning_images = self.extract_pose(image)
|
| 215 |
controlnet_conditioning_scale = controlnet_strength
|
| 216 |
|
| 217 |
+
# Zufälliger Seed
|
| 218 |
+
seed = random.randint(0, 2**32 - 1)
|
| 219 |
+
generator = torch.Generator(device=self.device).manual_seed(seed)
|
| 220 |
+
print(f"ControlNet Seed: {seed}")
|
| 221 |
|
| 222 |
+
pipe = self.load_controlnet_pipeline(controlnet_type)
|
|
|
|
|
|
|
|
|
|
| 223 |
|
| 224 |
# Fortschritt-Callback
|
| 225 |
callback = ControlNetProgressCallback(progress, int(steps)) if progress is not None else None
|