Move comfy sys path insert to custom node loading.

This commit is contained in:
comfyanonymous 2026-06-13 19:34:58 -07:00 committed by GitHub
parent a1d95f3f82
commit decdeecac6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -20,8 +20,6 @@ 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"))
import comfy.diffusers_load
import comfy.samplers
import comfy.sample
@ -2295,6 +2293,9 @@ async def init_external_custom_nodes():
Returns:
None
"""
# TODO: remove at some point when custom nodes don't break.
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), "comfy"))
base_node_names = set(NODE_CLASS_MAPPINGS.keys())
node_paths = folder_paths.get_folder_paths("custom_nodes")
node_import_times = []