Compare commits

...

2 Commits

Author SHA1 Message Date
robotR
4ab2cd3901
Merge 1ce6474eaf into 0da5a0fe58 2026-01-19 22:15:22 -05:00
robotR
1ce6474eaf 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.
2026-01-10 23:51:19 +11:00

View File

@ -20,7 +20,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