- Fixed types issues - Added: - Int2Tuple node - Deleted due to last ComfyUI update which made them nearly useless now: - ConditioningSetAreaEXT (modded) - EmptyLatentImage (modded) - NOT Deleted, but now might be useless (IMHO): - LatentComposite (modded) - ConditioningSetArea (modded) - TUPLES moved to their own subfolder in UI - ALL custom nodes with FLOAT, INT, STRING values now can use their own fields as inputs (use original conversion to points to connect) - Refactored nearly all code... again
49 lines
1.2 KiB
Python
49 lines
1.2 KiB
Python
import custom_nodes.Derfuu_ComfyUI_ModdedNodes.components.fields as field
|
|
|
|
from custom_nodes.Derfuu_ComfyUI_ModdedNodes.components.tree import TREE_FUNCTIONS
|
|
import custom_nodes.Derfuu_ComfyUI_ModdedNodes.components.sizes as sizes_DF
|
|
|
|
|
|
class GetLatentSize:
|
|
def __init__(self) -> None:
|
|
pass
|
|
|
|
@classmethod
|
|
def INPUT_TYPES(cls):
|
|
return {
|
|
"required": {
|
|
"LATENT": ("LATENT",),
|
|
"ORIGINAL_VALUES": ([False, True],),
|
|
}
|
|
}
|
|
|
|
RETURN_TYPES = ("TUPLE", "INT", "INT",)
|
|
CATEGORY = TREE_FUNCTIONS
|
|
|
|
FUNCTION = 'get_size'
|
|
|
|
def get_size(self, LATENT, ORIGINAL_VALUES=False):
|
|
size = sizes_DF.get_latent_size(LATENT, ORIGINAL_VALUES)
|
|
return (size, size[0], size[1],)
|
|
|
|
|
|
class GetImageSize:
|
|
def __init__(self) -> None:
|
|
pass
|
|
|
|
@classmethod
|
|
def INPUT_TYPES(cls):
|
|
return {
|
|
"required": {
|
|
"IMAGE": ("IMAGE",),
|
|
}
|
|
}
|
|
|
|
RETURN_TYPES = ("TUPLE", "INT", "INT",)
|
|
CATEGORY = TREE_FUNCTIONS
|
|
|
|
FUNCTION = 'get_size'
|
|
|
|
def get_size(self, IMAGE):
|
|
size = sizes_DF.get_image_size(IMAGE)
|
|
return (size, size[0], size[1],) |