From ef7e885fe46dab5aaa9706ca338c48dd3dc2d995 Mon Sep 17 00:00:00 2001 From: filtered <176114999+webfiltered@users.noreply.github.com> Date: Thu, 12 Jun 2025 11:10:48 -0700 Subject: [PATCH 1/4] Revert "Update requirements.txt (#8487)" (#8502) This reverts commit 373a9386a438327d230a99b6a875c6aa6a589fb6. --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 4a0a7d7fde7..3e02c7494db 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ comfyui-frontend-package==1.21.7 -comfyui-workflow-templates==0.1.27 +comfyui-workflow-templates==0.1.25 comfyui-embedded-docs==0.2.0 torch torchsde From d2566eb4b262709324eac944f5b58177687401bf Mon Sep 17 00:00:00 2001 From: comfyanonymous <121283862+comfyanonymous@users.noreply.github.com> Date: Thu, 12 Jun 2025 12:38:33 -0700 Subject: [PATCH 2/4] Add a warning for old python versions. (#8504) --- main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 7dfc7bc23e7..c8c4194d446 100644 --- a/main.py +++ b/main.py @@ -17,7 +17,6 @@ os.environ['HF_HUB_DISABLE_TELEMETRY'] = '1' os.environ['DO_NOT_TRACK'] = '1' - setup_logger(log_level=args.verbose, use_stdout=args.log_stdout) def apply_custom_paths(): @@ -310,6 +309,9 @@ async def start_all(): logging.info("Python version: {}".format(sys.version)) logging.info("ComfyUI version: {}".format(comfyui_version.__version__)) + if sys.version_info.major == 3 and sys.version_info.minor < 10: + logging.warning("WARNING: You are using a python version older than 3.10, please upgrade to a newer one. 3.12 and above is recommended.") + event_loop, _, start_all_func = start_comfyui() try: x = start_all_func() From 4d1c4b9797465dd32d50a7ae60c139965c19310c Mon Sep 17 00:00:00 2001 From: Terry Jia Date: Thu, 12 Jun 2025 16:24:39 -0400 Subject: [PATCH 3/4] Auto register web folder (#8505) * auto register web folder from pyproject * need pydantic-settings as dependency * wrapped try/except for config_parser * sf --- comfy_config/types.py | 15 ++++++++++++++- nodes.py | 19 +++++++++++++++++++ requirements.txt | 1 + 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/comfy_config/types.py b/comfy_config/types.py index 61198208304..11261a1365b 100644 --- a/comfy_config/types.py +++ b/comfy_config/types.py @@ -1,4 +1,4 @@ -from pydantic import BaseModel, Field +from pydantic import BaseModel, Field, field_validator from pydantic_settings import BaseSettings, SettingsConfigDict from typing import List, Optional @@ -50,6 +50,7 @@ class ComfyConfig(BaseModel): icon: str = Field(default="", alias="Icon") models: List[Model] = Field(default_factory=list, alias="Models") includes: List[str] = Field(default_factory=list) + web: Optional[str] = None class License(BaseModel): @@ -66,6 +67,18 @@ class ProjectConfig(BaseModel): license: License = Field(default_factory=License) urls: URLs = Field(default_factory=URLs) + @field_validator('license', mode='before') + @classmethod + def validate_license(cls, v): + if isinstance(v, str): + return License(text=v) + elif isinstance(v, dict): + return License(**v) + elif isinstance(v, License): + return v + else: + return License() + class PyProjectConfig(BaseModel): project: ProjectConfig = Field(default_factory=ProjectConfig) diff --git a/nodes.py b/nodes.py index 637279ffbd6..89201cc7231 100644 --- a/nodes.py +++ b/nodes.py @@ -2125,6 +2125,25 @@ def load_custom_node(module_path: str, ignore=set(), module_parent="custom_nodes LOADED_MODULE_DIRS[module_name] = os.path.abspath(module_dir) + try: + from comfy_config import config_parser + + project_config = config_parser.extract_node_configuration(module_path) + + web_dir_name = project_config.tool_comfy.web + + if web_dir_name: + web_dir_path = os.path.join(module_path, web_dir_name) + + if os.path.isdir(web_dir_path): + project_name = project_config.project.name + + EXTENSION_WEB_DIRS[project_name] = web_dir_path + + logging.info("Automatically register web folder {} for {}".format(web_dir_name, project_name)) + except Exception as e: + logging.debug(f"Unable to parse pyproject.toml due to lack dependency pydantic-settings, please run 'pip install -r requirements.txt': {e}") + if hasattr(module, "WEB_DIRECTORY") and getattr(module, "WEB_DIRECTORY") is not None: web_dir = os.path.abspath(os.path.join(module_dir, getattr(module, "WEB_DIRECTORY"))) if os.path.isdir(web_dir): diff --git a/requirements.txt b/requirements.txt index 3e02c7494db..94dafea5849 100644 --- a/requirements.txt +++ b/requirements.txt @@ -27,3 +27,4 @@ spandrel soundfile av>=14.2.0 pydantic~=2.0 +pydantic-settings~=2.0 From 40fd39c7cb16702d60aa84c89add56cf7d2f52b7 Mon Sep 17 00:00:00 2001 From: comfyanonymous <121283862+comfyanonymous@users.noreply.github.com> Date: Thu, 12 Jun 2025 14:14:59 -0700 Subject: [PATCH 4/4] debug -> warning (#8506) --- nodes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodes.py b/nodes.py index 89201cc7231..8e5b47b37cd 100644 --- a/nodes.py +++ b/nodes.py @@ -2142,7 +2142,7 @@ def load_custom_node(module_path: str, ignore=set(), module_parent="custom_nodes logging.info("Automatically register web folder {} for {}".format(web_dir_name, project_name)) except Exception as e: - logging.debug(f"Unable to parse pyproject.toml due to lack dependency pydantic-settings, please run 'pip install -r requirements.txt': {e}") + logging.warning(f"Unable to parse pyproject.toml due to lack dependency pydantic-settings, please run 'pip install -r requirements.txt': {e}") if hasattr(module, "WEB_DIRECTORY") and getattr(module, "WEB_DIRECTORY") is not None: web_dir = os.path.abspath(os.path.join(module_dir, getattr(module, "WEB_DIRECTORY")))