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.

use slice instead of torch.select()

missionfloyde1d289c1ec68
diff --git a/nodes.py b/nodes.py
index ecd931d69..815631f58 100644
--- a/nodes.py
+++ b/nodes.py
@@ -1076,7 +1076,7 @@ class ImageToMask:
def image_to_mask(self, image, channel):
channels = ["red", "green", "blue"]
- mask = torch.select(image[0], 2, channels.index(channel))
+ mask = image[0, :, :, channels.index(channel)]
return (mask,)
class MaskToImage: