comfy-env 0.0.56__tar.gz → 0.0.57__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {comfy_env-0.0.56 → comfy_env-0.0.57}/PKG-INFO +1 -1
- {comfy_env-0.0.56 → comfy_env-0.0.57}/pyproject.toml +1 -1
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/pixi.py +129 -62
- {comfy_env-0.0.56 → comfy_env-0.0.57}/.github/workflows/publish.yml +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/.gitignore +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/LICENSE +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/README.md +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/__init__.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/cli.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/decorator.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/env/__init__.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/env/config.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/env/config_file.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/env/cuda_gpu_detection.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/env/manager.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/env/platform/__init__.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/env/platform/base.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/env/platform/darwin.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/env/platform/linux.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/env/platform/windows.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/env/security.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/errors.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/install.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/ipc/__init__.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/ipc/bridge.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/ipc/protocol.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/ipc/tensor.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/ipc/torch_bridge.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/ipc/transport.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/ipc/worker.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/isolation.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/nodes.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/registry.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/resolver.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/stub_imports.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/stubs/__init__.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/stubs/comfy/__init__.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/stubs/comfy/model_management.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/stubs/comfy/utils.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/stubs/folder_paths.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/templates/comfy-env-instructions.txt +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/templates/comfy-env.toml +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/wheel_sources.yml +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/workers/__init__.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/workers/base.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/workers/pool.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/workers/tensor_utils.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/workers/torch_mp.py +0 -0
- {comfy_env-0.0.56 → comfy_env-0.0.57}/src/comfy_env/workers/venv.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: comfy-env
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.57
|
|
4
4
|
Summary: Environment management for ComfyUI custom nodes - CUDA wheel resolution and process isolation
|
|
5
5
|
Project-URL: Homepage, https://github.com/PozzettiAndrea/comfy-env
|
|
6
6
|
Project-URL: Repository, https://github.com/PozzettiAndrea/comfy-env
|
|
@@ -181,6 +181,97 @@ def _parse_pypi_requirement(dep: str) -> Tuple[str, Optional[str], List[str]]:
|
|
|
181
181
|
return name, version_spec, extras
|
|
182
182
|
|
|
183
183
|
|
|
184
|
+
def _build_cuda_vars(env_config: IsolatedEnv) -> dict:
|
|
185
|
+
"""
|
|
186
|
+
Build variable dict for CUDA wheel URL resolution.
|
|
187
|
+
|
|
188
|
+
Returns a dict with CUDA, PyTorch, Python, and platform variables
|
|
189
|
+
for template substitution.
|
|
190
|
+
"""
|
|
191
|
+
# Use fixed CUDA 12.8 / PyTorch 2.8 for pixi environments (modern GPU default)
|
|
192
|
+
vars_dict = {
|
|
193
|
+
"cuda_version": "12.8",
|
|
194
|
+
"cuda_short": "128",
|
|
195
|
+
"cuda_short2": "128",
|
|
196
|
+
"cuda_major": "12",
|
|
197
|
+
"torch_version": "2.8.0",
|
|
198
|
+
"torch_short": "280",
|
|
199
|
+
"torch_mm": "28",
|
|
200
|
+
"torch_dotted_mm": "2.8",
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
# Platform detection
|
|
204
|
+
if sys.platform == "linux":
|
|
205
|
+
vars_dict["platform"] = "linux_x86_64"
|
|
206
|
+
elif sys.platform == "darwin":
|
|
207
|
+
vars_dict["platform"] = "macosx_arm64" if platform.machine() == "arm64" else "macosx_x86_64"
|
|
208
|
+
elif sys.platform == "win32":
|
|
209
|
+
vars_dict["platform"] = "win_amd64"
|
|
210
|
+
|
|
211
|
+
# Python version from env config
|
|
212
|
+
if env_config.python:
|
|
213
|
+
py_parts = env_config.python.split(".")
|
|
214
|
+
py_major = py_parts[0]
|
|
215
|
+
py_minor = py_parts[1] if len(py_parts) > 1 else "0"
|
|
216
|
+
vars_dict["py_version"] = env_config.python
|
|
217
|
+
vars_dict["py_short"] = f"{py_major}{py_minor}"
|
|
218
|
+
vars_dict["py_minor"] = py_minor
|
|
219
|
+
vars_dict["py_tag"] = f"cp{py_major}{py_minor}"
|
|
220
|
+
|
|
221
|
+
return vars_dict
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
def _resolve_cuda_wheel_url(
|
|
225
|
+
req: str,
|
|
226
|
+
vars_dict: dict,
|
|
227
|
+
log: Callable[[str], None] = print,
|
|
228
|
+
) -> Optional[str]:
|
|
229
|
+
"""
|
|
230
|
+
Resolve a CUDA package requirement to a wheel URL.
|
|
231
|
+
|
|
232
|
+
Args:
|
|
233
|
+
req: Package requirement (e.g., "cumesh" or "cumesh==0.0.1")
|
|
234
|
+
vars_dict: Variable dict for URL template substitution
|
|
235
|
+
log: Logging callback
|
|
236
|
+
|
|
237
|
+
Returns:
|
|
238
|
+
Resolved wheel URL, or None if package not in registry.
|
|
239
|
+
"""
|
|
240
|
+
from .registry import PACKAGE_REGISTRY
|
|
241
|
+
|
|
242
|
+
# Parse requirement (e.g., "cumesh" or "cumesh==0.0.1")
|
|
243
|
+
if "==" in req:
|
|
244
|
+
pkg_name, version = req.split("==", 1)
|
|
245
|
+
else:
|
|
246
|
+
pkg_name = req
|
|
247
|
+
version = None
|
|
248
|
+
|
|
249
|
+
pkg_lower = pkg_name.lower()
|
|
250
|
+
if pkg_lower not in PACKAGE_REGISTRY:
|
|
251
|
+
log(f" Warning: CUDA package {pkg_name} not in registry")
|
|
252
|
+
return None
|
|
253
|
+
|
|
254
|
+
config = PACKAGE_REGISTRY[pkg_lower]
|
|
255
|
+
template = config.get("wheel_template")
|
|
256
|
+
if not template:
|
|
257
|
+
log(f" Warning: No wheel template for {pkg_name}")
|
|
258
|
+
return None
|
|
259
|
+
|
|
260
|
+
# Use version from requirement or default
|
|
261
|
+
v = version or config.get("default_version")
|
|
262
|
+
if v:
|
|
263
|
+
vars_dict = vars_dict.copy() # Don't mutate original
|
|
264
|
+
vars_dict["version"] = v
|
|
265
|
+
|
|
266
|
+
# Resolve URL template
|
|
267
|
+
url = template
|
|
268
|
+
for key, value in vars_dict.items():
|
|
269
|
+
if value:
|
|
270
|
+
url = url.replace(f"{{{key}}}", str(value))
|
|
271
|
+
|
|
272
|
+
return url
|
|
273
|
+
|
|
274
|
+
|
|
184
275
|
def create_pixi_toml(
|
|
185
276
|
env_config: IsolatedEnv,
|
|
186
277
|
node_dir: Path,
|
|
@@ -193,7 +284,11 @@ def create_pixi_toml(
|
|
|
193
284
|
- Project metadata
|
|
194
285
|
- Conda channels
|
|
195
286
|
- Conda dependencies
|
|
196
|
-
- PyPI dependencies (from requirements
|
|
287
|
+
- PyPI dependencies (from requirements)
|
|
288
|
+
|
|
289
|
+
Note: CUDA packages (no_deps_requirements) are NOT included in pixi.toml.
|
|
290
|
+
They are installed separately with pip --no-deps after pixi install
|
|
291
|
+
to avoid transitive dependency conflicts.
|
|
197
292
|
|
|
198
293
|
Args:
|
|
199
294
|
env_config: The isolated environment configuration.
|
|
@@ -312,67 +407,9 @@ def create_pixi_toml(
|
|
|
312
407
|
if env_config.requirements:
|
|
313
408
|
pypi_deps.extend(env_config.requirements)
|
|
314
409
|
|
|
315
|
-
#
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
# Use fixed CUDA 12.8 / PyTorch 2.8 for pixi environments (modern GPU default)
|
|
320
|
-
# This ensures wheels match what pixi will install, not what the host has
|
|
321
|
-
vars_dict = {
|
|
322
|
-
"cuda_version": "12.8",
|
|
323
|
-
"cuda_short": "128",
|
|
324
|
-
"cuda_short2": "128",
|
|
325
|
-
"cuda_major": "12",
|
|
326
|
-
"torch_version": "2.8.0",
|
|
327
|
-
"torch_short": "280",
|
|
328
|
-
"torch_mm": "28",
|
|
329
|
-
"torch_dotted_mm": "2.8",
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
# Platform detection
|
|
333
|
-
if sys.platform == "linux":
|
|
334
|
-
vars_dict["platform"] = "linux_x86_64"
|
|
335
|
-
elif sys.platform == "darwin":
|
|
336
|
-
vars_dict["platform"] = "macosx_arm64" if platform.machine() == "arm64" else "macosx_x86_64"
|
|
337
|
-
elif sys.platform == "win32":
|
|
338
|
-
vars_dict["platform"] = "win_amd64"
|
|
339
|
-
|
|
340
|
-
# Python version from pixi env config
|
|
341
|
-
if env_config.python:
|
|
342
|
-
py_parts = env_config.python.split(".")
|
|
343
|
-
py_major = py_parts[0]
|
|
344
|
-
py_minor = py_parts[1] if len(py_parts) > 1 else "0"
|
|
345
|
-
vars_dict["py_version"] = env_config.python
|
|
346
|
-
vars_dict["py_short"] = f"{py_major}{py_minor}"
|
|
347
|
-
vars_dict["py_minor"] = py_minor
|
|
348
|
-
vars_dict["py_tag"] = f"cp{py_major}{py_minor}"
|
|
349
|
-
|
|
350
|
-
for req in env_config.no_deps_requirements:
|
|
351
|
-
# Parse requirement (e.g., "cumesh" or "cumesh==0.0.1")
|
|
352
|
-
if "==" in req:
|
|
353
|
-
pkg_name, version = req.split("==", 1)
|
|
354
|
-
else:
|
|
355
|
-
pkg_name = req
|
|
356
|
-
version = None
|
|
357
|
-
|
|
358
|
-
pkg_lower = pkg_name.lower()
|
|
359
|
-
if pkg_lower in PACKAGE_REGISTRY:
|
|
360
|
-
config = PACKAGE_REGISTRY[pkg_lower]
|
|
361
|
-
template = config.get("wheel_template")
|
|
362
|
-
if template:
|
|
363
|
-
# Use version from requirement or default
|
|
364
|
-
v = version or config.get("default_version")
|
|
365
|
-
if v:
|
|
366
|
-
vars_dict["version"] = v
|
|
367
|
-
|
|
368
|
-
# Resolve URL
|
|
369
|
-
url = template
|
|
370
|
-
for key, value in vars_dict.items():
|
|
371
|
-
if value:
|
|
372
|
-
url = url.replace(f"{{{key}}}", str(value))
|
|
373
|
-
|
|
374
|
-
special_deps[pkg_name] = f'{{ url = "{url}" }}'
|
|
375
|
-
log(f" CUDA package {pkg_name}: resolved wheel URL")
|
|
410
|
+
# NOTE: CUDA packages (no_deps_requirements) are NOT added to pixi.toml.
|
|
411
|
+
# They are installed separately with pip --no-deps after pixi install
|
|
412
|
+
# to avoid transitive dependency conflicts. See pixi_install().
|
|
376
413
|
|
|
377
414
|
# Add platform-specific requirements
|
|
378
415
|
if sys.platform == "linux" and env_config.linux_requirements:
|
|
@@ -557,6 +594,36 @@ def pixi_install(
|
|
|
557
594
|
|
|
558
595
|
log("pixi install completed successfully!")
|
|
559
596
|
|
|
597
|
+
# Phase 2: Install CUDA packages with pip --no-deps
|
|
598
|
+
# These are kept out of pixi.toml to avoid transitive dependency conflicts
|
|
599
|
+
# Skip on macOS - CUDA is not supported
|
|
600
|
+
if env_config.no_deps_requirements:
|
|
601
|
+
if sys.platform == "darwin":
|
|
602
|
+
log("Skipping CUDA packages (not supported on macOS)")
|
|
603
|
+
else:
|
|
604
|
+
log("Installing CUDA packages with --no-deps...")
|
|
605
|
+
python_path = get_pixi_python(node_dir)
|
|
606
|
+
if not python_path:
|
|
607
|
+
raise RuntimeError("Failed to find Python in pixi environment")
|
|
608
|
+
|
|
609
|
+
vars_dict = _build_cuda_vars(env_config)
|
|
610
|
+
|
|
611
|
+
for req in env_config.no_deps_requirements:
|
|
612
|
+
url = _resolve_cuda_wheel_url(req, vars_dict, log)
|
|
613
|
+
if url:
|
|
614
|
+
log(f" Installing {req} (--no-deps)...")
|
|
615
|
+
result = subprocess.run(
|
|
616
|
+
[str(python_path), "-m", "pip", "install", "--no-deps", url],
|
|
617
|
+
capture_output=True,
|
|
618
|
+
text=True,
|
|
619
|
+
)
|
|
620
|
+
if result.returncode != 0:
|
|
621
|
+
log(f" Failed to install {req}:")
|
|
622
|
+
log(result.stderr)
|
|
623
|
+
raise RuntimeError(f"Failed to install {req} with --no-deps: {result.stderr}")
|
|
624
|
+
else:
|
|
625
|
+
log(f" Warning: Could not resolve wheel URL for {req}, skipping")
|
|
626
|
+
|
|
560
627
|
# Create _env_{name} link for compatibility with uv backend
|
|
561
628
|
# This ensures code that expects _env_envname/bin/python works with pixi
|
|
562
629
|
symlink_path = node_dir / f"_env_{env_config.name}"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|