The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.
Change a few things in #1578.
comfyanonymous9212bea87c47
diff --git a/comfy_extras/nodes_compositing.py b/comfy_extras/nodes_compositing.pyindex f39daa009..f8901eca1 100644--- a/comfy_extras/nodes_compositing.py+++ b/comfy_extras/nodes_compositing.py@@ -102,7 +102,7 @@ class PorterDuffImageComposite:RETURN_TYPES = ("IMAGE", "MASK")FUNCTION = "composite"- CATEGORY = "compositing"+ CATEGORY = "mask/compositing"def composite(self, source: torch.Tensor, source_alpha: torch.Tensor, destination: torch.Tensor, destination_alpha: torch.Tensor, mode):batch_size = min(len(source), len(source_alpha), len(destination), len(destination_alpha))@@ -149,7 +149,7 @@ class SplitImageWithAlpha:}}- CATEGORY = "compositing"+ CATEGORY = "mask/compositing"RETURN_TYPES = ("IMAGE", "MASK")FUNCTION = "split_image_with_alpha"@@ -170,7 +170,7 @@ class JoinImageWithAlpha:}}- CATEGORY = "compositing"+ CATEGORY = "mask/compositing"RETURN_TYPES = ("IMAGE",)FUNCTION = "join_image_with_alpha"diff --git a/nodes.py b/nodes.pyindex 9f8e58d0f..16bf07cca 100644--- a/nodes.py+++ b/nodes.py@@ -1372,31 +1372,6 @@ class LoadImage:return True-class LoadImageWithAlpha(LoadImage):- @classmethod- def INPUT_TYPES(s):- input_dir = folder_paths.get_input_directory()- files = [f for f in os.listdir(input_dir) if os.path.isfile(os.path.join(input_dir, f))]- return {"required":- {"image": (sorted(files), {"image_upload": True})},- }-- CATEGORY = "compositing"-- RETURN_TYPES = ("IMAGE", "MASK")-- FUNCTION = "load_image"- def load_image(self, image):- image_path = folder_paths.get_annotated_filepath(image)- i = Image.open(image_path)- i = ImageOps.exif_transpose(i)- image = i.convert("RGBA")- alpha = np.array(image.getchannel("A")).astype(np.float32) / 255.0- alpha = torch.from_numpy(alpha)[None,]- image = np.array(image).astype(np.float32) / 255.0- image = torch.from_numpy(image)[None,]- return (image, alpha)-class LoadImageMask:_color_channels = ["alpha", "red", "green", "blue"]@classmethod@@ -1631,7 +1606,6 @@ NODE_CLASS_MAPPINGS = {"SaveImage": SaveImage,"PreviewImage": PreviewImage,"LoadImage": LoadImage,- "LoadImageWithAlpha": LoadImageWithAlpha,"LoadImageMask": LoadImageMask,"ImageScale": ImageScale,"ImageScaleBy": ImageScaleBy,@@ -1728,7 +1702,6 @@ NODE_DISPLAY_NAME_MAPPINGS = {"SaveImage": "Save Image","PreviewImage": "Preview Image","LoadImage": "Load Image",- "LoadImageWithAlpha": "Load Image with Alpha","LoadImageMask": "Load Image (as Mask)","ImageScale": "Upscale Image","ImageScaleBy": "Upscale Image By",