mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-01-25 15:55:18 +00:00
use slice instead of torch.select()
This commit is contained in:
parent
e12fb88b1b
commit
e1d289c1ec
2
nodes.py
2
nodes.py
@ -1076,7 +1076,7 @@ class ImageToMask:
|
|||||||
|
|
||||||
def image_to_mask(self, image, channel):
|
def image_to_mask(self, image, channel):
|
||||||
channels = ["red", "green", "blue"]
|
channels = ["red", "green", "blue"]
|
||||||
mask = torch.select(image[0], 2, channels.index(channel))
|
mask = image[0, :, :, channels.index(channel)]
|
||||||
return (mask,)
|
return (mask,)
|
||||||
|
|
||||||
class MaskToImage:
|
class MaskToImage:
|
||||||
|
Loading…
Reference in New Issue
Block a user