Skip to content

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

Make MaskToImage support masks with a batch size.

comfyanonymous51583164ef08
diff --git a/comfy_extras/nodes_mask.py b/comfy_extras/nodes_mask.py
index 131cd6a9f..9916f3b21 100644
--- a/comfy_extras/nodes_mask.py
+++ b/comfy_extras/nodes_mask.py
@@ -72,7 +72,7 @@ class MaskToImage:
FUNCTION = "mask_to_image"
def mask_to_image(self, mask):
- result = mask[None, :, :, None].expand(-1, -1, -1, 3)
+ result = mask.reshape((-1, 1, mask.shape[-2], mask.shape[-1])).movedim(1, -1).expand(-1, -1, -1, 3)
return (result,)
class ImageToMask: