signsur4739379373 commited on
Commit
bd4fb2d
·
1 Parent(s): 0bc6d3a

Fix Comfy utils import resolution

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -236,8 +236,12 @@ def _init_comfy_nodes() -> None:
236
  if _nodes_ready:
237
  return
238
 
239
- if str(COMFY) not in sys.path:
240
- sys.path.insert(0, str(COMFY))
 
 
 
 
241
  os.chdir(COMFY)
242
 
243
  import execution
 
236
  if _nodes_ready:
237
  return
238
 
239
+ comfy_path = str(COMFY)
240
+ sys.path = [p for p in sys.path if p != comfy_path]
241
+ sys.path.insert(0, comfy_path)
242
+ for module_name in list(sys.modules):
243
+ if module_name == "utils" or module_name.startswith("utils."):
244
+ del sys.modules[module_name]
245
  os.chdir(COMFY)
246
 
247
  import execution