From 1998f79be845cb11719d4bcb48d75ccb83235203 Mon Sep 17 00:00:00 2001 From: BlakeOne <30273164+BlakeOne@users.noreply.github.com> Date: Tue, 2 Apr 2024 17:44:28 -0700 Subject: [PATCH] Create __init__.py --- __init__.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 __init__.py diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..08bfbcf --- /dev/null +++ b/__init__.py @@ -0,0 +1,28 @@ +# Comfy mappings +from .node import CustomScheduler + +NODE_CLASS_MAPPINGS = {"CustomScheduler": CustomScheduler} +NODE_DISPLAY_NAME_MAPPINGS = {"CustomScheduler" : "CustomScheduler"} +__all__ = ['NODE_CLASS_MAPPINGS', 'NODE_DISPLAY_NAME_MAPPINGS'] + +# Copy extension to comfy +import folder_paths +import shutil +import os + +cwd_path = os.path.dirname(os.path.realpath(__file__)) +comfy_path = folder_paths.base_path +web_extension_path = os.path.join(comfy_path, "web", "extensions", "CustomScheduler") +widgets_js_file = os.path.join(cwd_path, "extension.js") + +if not os.path.exists(web_extension_path): + os.makedirs(web_extension_path) +else: + try: + shutil.rmtree(web_extension_path) + os.makedirs(web_extension_path) + except: + print("Unable to remove old web extension.") + pass + +shutil.copy(widgets_js_file, web_extension_path)