The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.
Fix RepeatLatentBatch not working on multi dim latents. (#9227)
comfyanonymous05df2df489f6
diff --git a/nodes.py b/nodes.pyindex 9bedbcaca..9448f9c1b 100644--- a/nodes.py+++ b/nodes.py@@ -1229,12 +1229,12 @@ class RepeatLatentBatch:s = samples.copy()s_in = samples["samples"]- s["samples"] = s_in.repeat((amount, 1,1,1))+ s["samples"] = s_in.repeat((amount,) + ((1,) * (s_in.ndim - 1)))if "noise_mask" in samples and samples["noise_mask"].shape[0] > 1:masks = samples["noise_mask"]if masks.shape[0] < s_in.shape[0]:- masks = masks.repeat(math.ceil(s_in.shape[0] / masks.shape[0]), 1, 1, 1)[:s_in.shape[0]]- s["noise_mask"] = samples["noise_mask"].repeat((amount, 1,1,1))+ masks = masks.repeat((math.ceil(s_in.shape[0] / masks.shape[0]),) + ((1,) * (masks.ndim - 1)))[:s_in.shape[0]]+ s["noise_mask"] = samples["noise_mask"].repeat((amount,) + ((1,) * (samples["noise_mask"].ndim - 1)))if "batch_index" in s:offset = max(s["batch_index"]) - min(s["batch_index"]) + 1s["batch_index"] = s["batch_index"] + [x + (i * offset) for i in range(1, amount) for x in s["batch_index"]]