comfy-env 0.0.59__py3-none-any.whl → 0.0.61__py3-none-any.whl

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/pixi.py CHANGED
@@ -188,16 +188,31 @@ def _build_cuda_vars(env_config: IsolatedEnv) -> dict:
188
188
  Returns a dict with CUDA, PyTorch, Python, and platform variables
189
189
  for template substitution.
190
190
  """
191
- # Use fixed CUDA 12.8 / PyTorch 2.8 for pixi environments (modern GPU default)
191
+ # Get CUDA/PyTorch versions from env_config (resolved from "auto" based on GPU arch)
192
+ # Pascal or below: CUDA 12.4, PyTorch 2.4.0
193
+ # Turing+: CUDA 12.8, PyTorch 2.8.0
194
+ cuda_version = env_config.cuda_version or "12.8"
195
+ torch_version = env_config.pytorch_version or "2.8.0"
196
+
197
+ # Parse CUDA version
198
+ cuda_parts = cuda_version.split(".")
199
+ cuda_short = "".join(cuda_parts[:2]) # "12.8" -> "128"
200
+
201
+ # Parse PyTorch version
202
+ torch_parts = torch_version.split(".")
203
+ torch_short = "".join(torch_parts) # "2.8.0" -> "280"
204
+ torch_mm = "".join(torch_parts[:2]) # "2.8.0" -> "28"
205
+ torch_dotted_mm = ".".join(torch_parts[:2]) # "2.8.0" -> "2.8"
206
+
192
207
  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",
208
+ "cuda_version": cuda_version,
209
+ "cuda_short": cuda_short,
210
+ "cuda_short2": cuda_short,
211
+ "cuda_major": cuda_parts[0],
212
+ "torch_version": torch_version,
213
+ "torch_short": torch_short,
214
+ "torch_mm": torch_mm,
215
+ "torch_dotted_mm": torch_dotted_mm,
201
216
  }
202
217
 
203
218
  # Platform detection
@@ -314,19 +329,25 @@ def create_pixi_toml(
314
329
  lines.append(f'name = "{env_config.name}"')
315
330
  lines.append('version = "0.1.0"')
316
331
 
317
- # Channels
318
- channels = conda.channels or ["conda-forge"]
332
+ # Channels - add pytorch channel, and nvidia if CUDA GPU detected
333
+ base_channels = conda.channels or ["conda-forge"]
334
+ if env_config.cuda_version:
335
+ # GPU detected - add pytorch and nvidia channels for CUDA support
336
+ channels = ["pytorch", "nvidia"] + [ch for ch in base_channels if ch not in ["pytorch", "nvidia"]]
337
+ else:
338
+ # No GPU - just add pytorch channel for CPU-only pytorch
339
+ channels = ["pytorch"] + [ch for ch in base_channels if ch != "pytorch"]
319
340
  channels_str = ", ".join(f'"{ch}"' for ch in channels)
320
341
  lines.append(f"channels = [{channels_str}]")
321
342
 
322
343
  # Platforms
323
- # Note: On macOS we always use osx-64 (x86_64) even on ARM64 Macs.
324
- # This runs under Rosetta 2 but ensures compatibility with packages
325
- # that only have x86_64 wheels (e.g., embreex for trimesh raytracing).
326
344
  if sys.platform == "linux":
327
345
  lines.append('platforms = ["linux-64"]')
328
346
  elif sys.platform == "darwin":
329
- lines.append('platforms = ["osx-64"]')
347
+ if platform.machine() == "arm64":
348
+ lines.append('platforms = ["osx-arm64"]')
349
+ else:
350
+ lines.append('platforms = ["osx-64"]')
330
351
  elif sys.platform == "win32":
331
352
  lines.append('platforms = ["win-64"]')
332
353
 
@@ -344,6 +365,20 @@ def create_pixi_toml(
344
365
  lines.append(f'python = "{env_config.python}.*"')
345
366
  lines.append('pip = "*"') # Required for installing CUDA packages with --no-deps
346
367
 
368
+ # Add PyTorch via conda
369
+ # - With GPU: pytorch + pytorch-cuda for CUDA support
370
+ # - No GPU: pytorch 2.8.0 CPU-only (default)
371
+ torch_version = env_config.pytorch_version or "2.8.0"
372
+ torch_parts = torch_version.split(".")
373
+ torch_mm = ".".join(torch_parts[:2]) # "2.8.0" -> "2.8"
374
+ lines.append(f'pytorch = "{torch_mm}.*"')
375
+
376
+ if env_config.cuda_version:
377
+ # GPU detected - add pytorch-cuda for CUDA runtime
378
+ cuda_parts = env_config.cuda_version.split(".")
379
+ cuda_mm = ".".join(cuda_parts[:2]) # "12.8" -> "12.8"
380
+ lines.append(f'pytorch-cuda = "{cuda_mm}"')
381
+
347
382
  # On Windows, use MKL BLAS to avoid OpenBLAS crashes (numpy blas_fpe_check issue)
348
383
  if sys.platform == "win32":
349
384
  lines.append('libblas = { version = "*", build = "*mkl" }')
@@ -580,6 +615,9 @@ def pixi_install(
580
615
  install_env = os.environ.copy()
581
616
  if env_config.env_vars:
582
617
  install_env.update(env_config.env_vars)
618
+ # Disable build isolation so CMAKE_ARGS propagates to builds
619
+ if 'CMAKE_ARGS' in env_config.env_vars:
620
+ install_env['UV_NO_BUILD_ISOLATION'] = '1'
583
621
  log(f" Using custom env vars: {list(env_config.env_vars.keys())}")
584
622
 
585
623
  result = subprocess.run(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: comfy-env
3
- Version: 0.0.59
3
+ Version: 0.0.61
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
@@ -5,7 +5,7 @@ comfy_env/errors.py,sha256=q-C3vyrPa_kk_Ao8l17mIGfJiG2IR0hCFV0GFcNLmcI,9924
5
5
  comfy_env/install.py,sha256=nfzGifXVd87a6dnwY3GtktrXpS7fjWuWF-QV9hh2e94,15657
6
6
  comfy_env/isolation.py,sha256=a-q6mA9tzD27kZSZCTioSKlK-3kpRFKYA23V_75OmaI,9286
7
7
  comfy_env/nodes.py,sha256=CWUe35jU5SKk4ur-SddZePdqWgxJDlxGhpcJiu5pAK4,4354
8
- comfy_env/pixi.py,sha256=47l0UjEPd-VfFgagu7iH1LsMcWrCXtZSXYW0Mfm8-4I,25688
8
+ comfy_env/pixi.py,sha256=lI3S0g_md6WMR1NizXBbXtOr1gtQNhsv90ocWYNIbGk,27472
9
9
  comfy_env/registry.py,sha256=w-QwvAPFlCrBYRAv4cXkp2zujQPZn8Fk5DUxKCtox8o,3430
10
10
  comfy_env/resolver.py,sha256=WoNIo2IfTR2RlEf_HQl66eAeMa2R2pmLof_UdK-0RNE,6714
11
11
  comfy_env/stub_imports.py,sha256=qOYxCJ8BbIfMHGBfqC5KGZSK6AK-iqmSjWi8ZCP8SAM,8425
@@ -41,8 +41,8 @@ comfy_env/workers/tensor_utils.py,sha256=TCuOAjJymrSbkgfyvcKtQ_KbVWTqSwP9VH_bCaF
41
41
  comfy_env/workers/torch_mp.py,sha256=TnsCoBHEJBXEoBkx7WiCd9tBAlzFtMOw1dk_7_zGJZY,22288
42
42
  comfy_env/workers/venv.py,sha256=RIW1EzWHnC4EBvfQCduYf2BVp3fND3SUZC1yJVfscxI,59325
43
43
  comfy_env/wheel_sources.yml,sha256=uU0YJmWaiLAicQNN9VYS8PZevlP2NOH6mBUE294dvAo,8156
44
- comfy_env-0.0.59.dist-info/METADATA,sha256=xjGBgAtpS7ybnE5cgUy2MpNv6BwmQmhiEd42MF7Bquo,8735
45
- comfy_env-0.0.59.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
46
- comfy_env-0.0.59.dist-info/entry_points.txt,sha256=J4fXeqgxU_YenuW_Zxn_pEL7J-3R0--b6MS5t0QmAr0,49
47
- comfy_env-0.0.59.dist-info/licenses/LICENSE,sha256=E68QZMMpW4P2YKstTZ3QU54HRQO8ecew09XZ4_Vn870,1093
48
- comfy_env-0.0.59.dist-info/RECORD,,
44
+ comfy_env-0.0.61.dist-info/METADATA,sha256=6fj4BJzmMfpfbfJK3MUrJ6I6OFNQJAMiLurGcT3slD0,8735
45
+ comfy_env-0.0.61.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
46
+ comfy_env-0.0.61.dist-info/entry_points.txt,sha256=J4fXeqgxU_YenuW_Zxn_pEL7J-3R0--b6MS5t0QmAr0,49
47
+ comfy_env-0.0.61.dist-info/licenses/LICENSE,sha256=E68QZMMpW4P2YKstTZ3QU54HRQO8ecew09XZ4_Vn870,1093
48
+ comfy_env-0.0.61.dist-info/RECORD,,