Skip to content

Commit 96cffd5

Browse files
install nodes in conda environments
1 parent f83c0a8 commit 96cffd5

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

server/api/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ async def models(request):
174174
'''
175175
workspace_dir = request.app["workspace"]
176176
try:
177-
nodes = await list_models(workspace_dir)
177+
models = await list_models(workspace_dir)
178178
return web.json_response({"error": None, "models": models})
179179
except Exception as e:
180180
return web.json_response({"error": str(e), "models": models}, status=500)

server/api/nodes/nodes.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,14 @@ async def install_node(node, workspace_dir):
9494
# Install requirements if present
9595
requirements_file = node_path / "requirements.txt"
9696
if requirements_file.exists():
97-
subprocess.run([sys.executable, "-m", "pip", "install", "-r", str(requirements_file)], check=True)
97+
subprocess.run(["conda", "run", "-n", "comfystream", "pip", "install", "-r", str(requirements_file)], check=True)
98+
subprocess.run(["conda", "run", "-n", "comfyui", "pip", "install", "-r", str(requirements_file)], check=True)
9899

99100
# Install additional dependencies if specified
100101
if "dependencies" in node:
101102
for dep in node["dependencies"].split(','):
102-
subprocess.run([sys.executable, "-m", "pip", "install", dep.strip()], check=True)
103+
subprocess.run(["conda", "run", "-n", "comfystream", "pip", "install", dep.strip()], check=True)
104+
subprocess.run(["conda", "run", "-n", "comfyui", "pip", "install", dep.strip()], check=True)
103105

104106
except Exception as e:
105107
logger.error(f"Error installing {dir_name} {e}")

0 commit comments

Comments
 (0)