new init
This commit is contained in:
+12
-1
@@ -28,6 +28,17 @@ if 'PYTEST_CURRENT_TEST' not in os.environ:
|
||||
print("[GeomPack] CGAL and Blender operations will not be available")
|
||||
print("[GeomPack] Run 'comfy-env install' to create the isolated environment")
|
||||
|
||||
# Setup import stubs BEFORE importing nodes
|
||||
# This allows imports like 'import trimesh' to succeed even though
|
||||
# trimesh is only installed in the isolated pixi environment
|
||||
try:
|
||||
from comfy_env import setup_isolated_imports
|
||||
setup_isolated_imports(__file__)
|
||||
except ImportError:
|
||||
print("[GeomPack] comfy-env not installed, import stubbing disabled")
|
||||
except Exception as e:
|
||||
print(f"[GeomPack] Failed to setup import stubs: {e}")
|
||||
|
||||
from .nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
|
||||
|
||||
# Enable process isolation - all nodes run in pixi env (Python 3.11)
|
||||
@@ -35,7 +46,7 @@ if 'PYTEST_CURRENT_TEST' not in os.environ:
|
||||
from comfy_env import enable_isolation
|
||||
enable_isolation(NODE_CLASS_MAPPINGS)
|
||||
except ImportError:
|
||||
print("[GeomPack] comfy-env not installed, isolation disabled")
|
||||
pass # Already warned above
|
||||
except Exception as e:
|
||||
print(f"[GeomPack] Failed to enable isolation: {e}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user