add Invert Image Node

This commit is contained in:
AngelBottomless
2024-07-16 18:35:57 +09:00
committed by GitHub
parent 422194468c
commit 19a9c61cad
+19
View File
@@ -10,6 +10,7 @@ from .autonode import node_wrapper, get_node_names_mappings, validate, anytype,
import time
import os
from PIL import Image
from PIL import ImageOps
from PIL import ImageEnhance
from PIL.PngImagePlugin import PngInfo
import piexif
@@ -364,6 +365,24 @@ class ResizeImageResolution:
"method": (["NEAREST", "LANCZOS", "BICUBIC"],),
},
}
@fundamental_node
class InvertImageNode:
FUNCTION = "invert_image"
RETURN_TYPES = ("IMAGE",)
CATEGORY = "image"
custom_name = "Invert Image"
@staticmethod
@PILHandlingHodes.output_wrapper
def invert_image(image):
image = PILHandlingHodes.handle_input(image)
return (ImageOps.invert(image),)
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"image": ("IMAGE",),
}
}
@fundamental_node
class ResizeScaleImageNode: