diff --git a/__init__.py b/__init__.py index 06c0f77..af13844 100644 --- a/__init__.py +++ b/__init__.py @@ -27,4 +27,13 @@ is_installed("keyframed") from .nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS +print(os.environ.get('COMFYUI_DEBUG_MODE')) + +from .debug import NODE_CLASS_MAPPINGS as ncm0, NODE_DISPLAY_NAME_MAPPINGS as ndnm0 + +# there's probably a cleaner, more-dummy-proof way to do this. +# feels like an accident waiting to happen. low risk though. +NODE_CLASS_MAPPINGS.update(ncm0) +NODE_DISPLAY_NAME_MAPPINGS.update(ndnm0) + __all__ =["NODE_CLASS_MAPPINGS", "NODE_DISPLAY_NAME_MAPPINGS"] diff --git a/debug.py b/debug.py new file mode 100644 index 0000000..dda3fcf --- /dev/null +++ b/debug.py @@ -0,0 +1,47 @@ +import logging + +logging.basicConfig(level=logging.INFO, + format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') +logger = logging.getLogger(__name__) + +CATEGORY="keyframed/debug" + +class KfDebug_Passthrough: + CATEGORY=CATEGORY + FUNCTION = 'main' + # RETURN_TYPES = ("FLOAT","INT") + + # @classmethod + # def INPUT_TYPES(s): + # return { + # "required": { + # "curve": ("KEYFRAMED_CURVE",{"forceInput": True,}), + # "t": ("INT",{"default":0}) + # }, + # } + + def main(self, item): + logger.info(f"type: {type(item)}") + logger.info(f"item: {item}") + return (item,) # pretty sure it's gotta be a tuple? + +class KfDebug_Float(KfDebug_Passthrough): + CATEGORY=CATEGORY + FUNCTION = 'main' + RETURN_TYPES = ("FLOAT",) + + @classmethod + def INPUT_TYPES(s): + return { + "required": { + "item": ("FLOAT",{"forceInput": True,}), + }, + } + +NODE_CLASS_MAPPINGS = { + #"KfDebug_Passthrough": KfDebug_Passthrough, + "KfDebug_Float": KfDebug_Float, +} + +# A dictionary that contains the friendly/humanly readable titles for the nodes +NODE_DISPLAY_NAME_MAPPINGS = {k:k for k in NODE_CLASS_MAPPINGS} \ No newline at end of file