mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-15 08:40:50 +08:00
Fix: utils package shadowed by comfy/utils.py
Change sys.path.insert(0, ...) to sys.path.append(...) to prevent the comfy directory from being placed at the front of sys.path. When comfy/ is at position 0, importing 'utils' finds comfy/utils.py (a module file) instead of the top-level utils/ package, causing: ModuleNotFoundError: No module named 'utils.install_util'; 'utils' is not a package This affects imports in app/frontend_management.py and app/database/db.py which import from utils.install_util. By using append() instead of insert(0, ...), the comfy directory is added at the end of sys.path, preserving normal import resolution order.
This commit is contained in:
parent
ec0a832acb
commit
1ce6474eaf
2
nodes.py
2
nodes.py
@ -19,7 +19,7 @@ from PIL.PngImagePlugin import PngInfo
|
||||
import numpy as np
|
||||
import safetensors.torch
|
||||
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), "comfy"))
|
||||
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), "comfy"))
|
||||
|
||||
import comfy.diffusers_load
|
||||
import comfy.samplers
|
||||
|
||||
Loading…
Reference in New Issue
Block a user