From 3d74fefc104d3db8cc63e63a0e5c271b3beb8215 Mon Sep 17 00:00:00 2001 From: RyanOnTheInside <7623207+ryanontheinside@users.noreply.github.com> Date: Fri, 17 Jan 2025 08:14:41 -0500 Subject: [PATCH] dummy node, anticipatory toml --- LICENSE | 21 +++++++++++++++++++++ README.md | 2 +- __init__.py | 36 +++++++++++++++++++++++++++++++----- pyproject.toml | 15 +++++++++++++++ 4 files changed, 68 insertions(+), 6 deletions(-) create mode 100644 LICENSE create mode 100644 pyproject.toml diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..cdf9136 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 RyanOnTheInside + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index 330fe4b..a1f5bbc 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ A performance profiling suite for ComfyUI that automatically tracks execution ti ## Requirements -- ComfyUI (latest version recommended) +- ComfyUI (latest version) - Python 3.8+ - CUDA-capable GPU (for VRAM monitoring) - Modern web browser diff --git a/__init__.py b/__init__.py index 058b720..4e2155f 100644 --- a/__init__.py +++ b/__init__.py @@ -2,12 +2,23 @@ import os import logging +# Configure logging before imports +logger = logging.getLogger('ComfyUI-ProfilerX') +logger.setLevel(logging.ERROR) # Set to DEBUG level for maximum info + +# Add console handler if not already added +if not logger.handlers: + ch = logging.StreamHandler() + ch.setLevel(logging.DEBUG) # Also set handler to DEBUG + formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') + ch.setFormatter(formatter) + logger.addHandler(ch) + +logger.info("Initializing ComfyUI-ProfilerX...") + from .prestartup import inject_profiling, PROFILER_ENABLED # Import but don't auto-inject from . import server # Register API routes -logger = logging.getLogger('ComfyUI-ProfilerX') -logger.setLevel(logging.ERROR) - # Set up web directory WEB_DIRECTORY = "./web" @@ -17,13 +28,28 @@ if not inject_profiling(): logger.warning("Disabling profiler nodes due to initialization failure") NODE_CLASS_MAPPINGS = {} NODE_DISPLAY_NAME_MAPPINGS = {} - +else: + logger.info("ProfilerX initialization complete - profiler is enabled") + # Add empty mappings to satisfy ComfyUI's import check + NODE_CLASS_MAPPINGS = { + "ProfilerX": type("ProfilerX", (), { + "CATEGORY": "profiling", + "RETURN_TYPES": tuple(), + "FUNCTION": "noop", + "OUTPUT_NODE": True, + "INPUT_TYPES": lambda: {"required": {}} + }) + } + NODE_DISPLAY_NAME_MAPPINGS = { + "ProfilerX": "ProfilerX" + } def setup_js(): """Register web extension with profiler status""" + logger.debug(f"Setting up web extension (enabled={PROFILER_ENABLED})") return { "name": "ComfyUI-ProfilerX", "module": "index.js", "enabled": PROFILER_ENABLED, "status": "active" if PROFILER_ENABLED else "disabled" - } \ No newline at end of file + } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..4b98d20 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,15 @@ +[project] +name = "comfyui_profilerx" +description = "Node and workflow profiling. Find bottlenecks in your workflows. See trends over time." +version = "1.0.0" +license = {file = "LICENSE"} +dependencies = ["psutil"] + +[project.urls] +Repository = "https://github.com/ryanontheinside/ComfyUI_ProfilerX" +# Used by Comfy Registry https://comfyregistry.org + +[tool.comfy] +PublisherId = "ryanontheinside" +DisplayName = "ComfyUI_ProfilerX" +Icon = "📈"