diff --git a/py/nodes/create_hook_lora.py b/py/nodes/create_hook_lora.py index 5796b4d5..a5f44fb8 100644 --- a/py/nodes/create_hook_lora.py +++ b/py/nodes/create_hook_lora.py @@ -9,9 +9,6 @@ from __future__ import annotations import logging import os -import comfy.hooks # type: ignore -import comfy.utils # type: ignore - from ..utils.utils import get_lora_info_absolute from .utils import ( FlexibleOptionalInputType, @@ -59,6 +56,10 @@ class CreateHookLoraLM: """ del text # used by the frontend widget only + # Lazy imports: comfy is not available in CI/test environment at module level + import comfy.hooks # type: ignore # noqa: C0415 + import comfy.utils # type: ignore # noqa: C0415 + prev_hooks: comfy.hooks.HookGroup | None = kwargs.get("prev_hooks") hook_group = prev_hooks.clone() if prev_hooks is not None else comfy.hooks.HookGroup()