Added ImageProperties and LatentProperties
This commit is contained in:
@@ -2,12 +2,15 @@ from .negi.openai_dalle3 import OpenAiDalle3
|
||||
from .negi.openai_translate import OpenAiTranslate
|
||||
from .negi.string_function import StringFunction
|
||||
from .negi.seed_generator import SeedGenerator
|
||||
from .negi.image_properties import ImageProperties, LatentProperties
|
||||
|
||||
NODE_CLASS_MAPPINGS = {
|
||||
"NegiTools_OpenAiDalle3": OpenAiDalle3,
|
||||
"NegiTools_OpenAiTranslate": OpenAiTranslate,
|
||||
"NegiTools_StringFunction": StringFunction,
|
||||
"NegiTools_SeedGenerator": SeedGenerator,
|
||||
"NegiTools_ImageProperties": ImageProperties,
|
||||
"NegiTools_LatentProperties": LatentProperties,
|
||||
}
|
||||
|
||||
NODE_DISPLAY_NAME_MAPPINGS = {
|
||||
@@ -15,4 +18,6 @@ NODE_DISPLAY_NAME_MAPPINGS = {
|
||||
"NegiTools_OpenAiTranslate": "OpenAI Translate to English 🧅",
|
||||
"NegiTools_StringFunction": "String Function 🧅",
|
||||
"NegiTools_SeedGenerator": "Seed Generator 🧅",
|
||||
"NegiTools_ImageProperties": "Image Properties 🧅",
|
||||
"NegiTools_LatentProperties": "Latent Properties 🧅",
|
||||
}
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
class ImageProperties:
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {
|
||||
"image": ("IMAGE",)
|
||||
},
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("INT", "INT",)
|
||||
RETURN_NAMES = ("WIDTH", "HEIGHT",)
|
||||
FUNCTION = "doit"
|
||||
OUTPUT_NODE = False
|
||||
CATEGORY = "utils"
|
||||
|
||||
def doit(self, image):
|
||||
# print("shape = " + str(list(image.shape)))
|
||||
return (image.shape[2], image.shape[1],)
|
||||
|
||||
|
||||
class LatentProperties:
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
@classmethod
|
||||
def INPUT_TYPES(cls):
|
||||
return {
|
||||
"required": {
|
||||
"latent": ("LATENT",)
|
||||
},
|
||||
}
|
||||
|
||||
RETURN_TYPES = ("INT", "INT",)
|
||||
RETURN_NAMES = ("WIDTH", "HEIGHT",)
|
||||
FUNCTION = "doit"
|
||||
OUTPUT_NODE = False
|
||||
CATEGORY = "utils"
|
||||
|
||||
def doit(self, latent):
|
||||
image = latent["samples"]
|
||||
# print("shape = " + str(list(image.shape)))
|
||||
return (image.shape[3] * 8, image.shape[2] * 8,)
|
||||
Reference in New Issue
Block a user