comfy-env 0.1.17__py3-none-any.whl → 0.1.19__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.
@@ -193,6 +193,32 @@ from multiprocessing import shared_memory as shm
193
193
  import numpy as np
194
194
 
195
195
 
196
+ def _prepare_trimesh_for_pickle(mesh):
197
+ """
198
+ Prepare a trimesh object for cross-Python-version pickling.
199
+
200
+ Trimesh attaches helper objects (ray tracer, proximity query) that may use
201
+ native extensions like embreex. These cause import errors when unpickling
202
+ on a system without those extensions. We strip them - they'll be recreated
203
+ lazily when needed.
204
+
205
+ Note: Do NOT strip _cache - trimesh needs it to function properly.
206
+ """
207
+ # Make a copy to avoid modifying the original
208
+ mesh = mesh.copy()
209
+
210
+ # Remove helper objects that may have unpickleable native code references
211
+ # These are lazily recreated on first access anyway
212
+ # Do NOT remove _cache - it's needed for trimesh to work
213
+ for attr in ('ray', '_ray', 'permutate', 'nearest'):
214
+ try:
215
+ delattr(mesh, attr)
216
+ except AttributeError:
217
+ pass
218
+
219
+ return mesh
220
+
221
+
196
222
  def _to_shm(obj, registry, visited=None):
197
223
  """
198
224
  Serialize object to shared memory. Returns JSON-safe metadata.
@@ -231,6 +257,7 @@ def _to_shm(obj, registry, visited=None):
231
257
  # trimesh.Trimesh -> pickle -> shared memory (preserves visual, metadata, normals)
232
258
  if t == 'Trimesh':
233
259
  import pickle
260
+ obj = _prepare_trimesh_for_pickle(obj)
234
261
  mesh_bytes = pickle.dumps(obj)
235
262
 
236
263
  block = shm.SharedMemory(create=True, size=len(mesh_bytes))
@@ -506,6 +533,21 @@ if sys.platform == "win32":
506
533
  from multiprocessing import shared_memory as shm
507
534
  import numpy as np
508
535
 
536
+
537
+ def _prepare_trimesh_for_pickle(mesh):
538
+ """
539
+ Prepare a trimesh object for cross-Python-version pickling.
540
+ Strips native extension helpers that cause import errors.
541
+ """
542
+ mesh = mesh.copy()
543
+ for attr in ('ray', '_ray', 'permutate', 'nearest'):
544
+ try:
545
+ delattr(mesh, attr)
546
+ except AttributeError:
547
+ pass
548
+ return mesh
549
+
550
+
509
551
  def _to_shm(obj, registry, visited=None):
510
552
  """Serialize to shared memory. Returns JSON-safe metadata."""
511
553
  if visited is None:
@@ -533,6 +575,7 @@ def _to_shm(obj, registry, visited=None):
533
575
  # trimesh.Trimesh -> pickle -> shared memory (preserves visual, metadata, normals)
534
576
  if t == 'Trimesh':
535
577
  import pickle
578
+ obj = _prepare_trimesh_for_pickle(obj)
536
579
  mesh_bytes = pickle.dumps(obj)
537
580
 
538
581
  block = shm.SharedMemory(create=True, size=len(mesh_bytes))
@@ -642,31 +685,6 @@ def _should_use_reference(obj):
642
685
  # Everything else (custom classes) - pass by reference
643
686
  return True
644
687
 
645
- def _prepare_trimesh_for_pickle(mesh):
646
- """
647
- Prepare a trimesh object for cross-Python-version pickling.
648
-
649
- Trimesh attaches helper objects (ray tracer, proximity query) that may use
650
- native extensions like embreex. These cause import errors when unpickling
651
- on a system without those extensions. We strip them - they'll be recreated
652
- lazily when needed.
653
-
654
- Note: Do NOT strip _cache - trimesh needs it to function properly.
655
- """
656
- # Make a copy to avoid modifying the original
657
- mesh = mesh.copy()
658
-
659
- # Remove helper objects that may have unpickleable native code references
660
- # These are lazily recreated on first access anyway
661
- # Do NOT remove _cache - it's needed for trimesh to work
662
- for attr in ('ray', '_ray', 'permutate', 'nearest'):
663
- try:
664
- delattr(mesh, attr)
665
- except AttributeError:
666
- pass
667
-
668
- return mesh
669
-
670
688
 
671
689
  def _serialize_result(obj, visited=None):
672
690
  """Convert result for IPC - complex objects become references."""
@@ -5,7 +5,6 @@ Handles pixi, CUDA wheels, apt packages, and node dependencies.
5
5
  """
6
6
 
7
7
  from .pixi import (
8
- PIXI_VERSION,
9
8
  ensure_pixi,
10
9
  get_pixi_path,
11
10
  get_pixi_python,
@@ -35,7 +34,6 @@ from .node_dependencies import (
35
34
 
36
35
  __all__ = [
37
36
  # Pixi package manager
38
- "PIXI_VERSION",
39
37
  "ensure_pixi",
40
38
  "get_pixi_path",
41
39
  "get_pixi_python",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: comfy-env
3
- Version: 0.1.17
3
+ Version: 0.1.19
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
@@ -20,8 +20,8 @@ comfy_env/isolation/wrap.py,sha256=K7GAkqU_Uxe717eUtPsFv5kcr_Jfbh3x79A-8vbY1nY,8
20
20
  comfy_env/isolation/workers/__init__.py,sha256=Zp6sZSRBcb5Negqgzqs3jPjfO9T1u3nNrQhp6WqTAuc,325
21
21
  comfy_env/isolation/workers/base.py,sha256=4ZYTaQ4J0kBHCoO_OfZnsowm4rJCoqinZUaOtgkOPbw,2307
22
22
  comfy_env/isolation/workers/mp.py,sha256=ygOgx2iyLN7l5fWkKI4lqzQsDyfAAd9Gb4gTYLp7o1A,34061
23
- comfy_env/isolation/workers/subprocess.py,sha256=ML6I9IenReagP8iT0Cd2ipet6JPK1gnDbOianOuFwOw,57164
24
- comfy_env/packages/__init__.py,sha256=6PTwUfUdJDTbIw46dCiA42qk4zUe_gw29xOaklBiMMc,1193
23
+ comfy_env/isolation/workers/subprocess.py,sha256=15G4rQA7bO-mmVkkeeR3we9ytHIw6kHLNdjc9XWXCu8,57650
24
+ comfy_env/packages/__init__.py,sha256=4pRCUnfcVFVgy7hkbPz9BPVXELtSFHha6L7n-hqNuZA,1155
25
25
  comfy_env/packages/apt.py,sha256=pxy3A5ZHv3X8ExCVyohODY8Fcy9ji4izIVPfYoxhqT4,1027
26
26
  comfy_env/packages/cuda_wheels.py,sha256=G_CnlwNcfeWlEU24aCVBpeqQQ05y8_02dDLBwBFNwII,3980
27
27
  comfy_env/packages/node_dependencies.py,sha256=AX_CY6j43tTY5KhyPfU7Wz6zgLAfWF0o0JkTrcNSecg,2966
@@ -29,8 +29,8 @@ comfy_env/packages/pixi.py,sha256=RPu8x5sSOLE1CYAhWMMjoQrbFGGt00fdsbqtRcTz7LQ,38
29
29
  comfy_env/packages/toml_generator.py,sha256=Vhc8F9euHhMTwH1TV6t96-D9Pjrn9jIN4e9WXrCIFE8,3414
30
30
  comfy_env/templates/comfy-env-instructions.txt,sha256=ve1RAthW7ouumU9h6DM7mIRX1MS8_Tyonq2U4tcrFu8,1031
31
31
  comfy_env/templates/comfy-env.toml,sha256=ROIqi4BlPL1MEdL1VgebfTHpdwPNYGHwWeigI9Kw-1I,4831
32
- comfy_env-0.1.17.dist-info/METADATA,sha256=XlM9mAERf1U2q9sBbrmY7jIgqrl8IsLrs8vK9CmLnpw,4808
33
- comfy_env-0.1.17.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
34
- comfy_env-0.1.17.dist-info/entry_points.txt,sha256=J4fXeqgxU_YenuW_Zxn_pEL7J-3R0--b6MS5t0QmAr0,49
35
- comfy_env-0.1.17.dist-info/licenses/LICENSE,sha256=E68QZMMpW4P2YKstTZ3QU54HRQO8ecew09XZ4_Vn870,1093
36
- comfy_env-0.1.17.dist-info/RECORD,,
32
+ comfy_env-0.1.19.dist-info/METADATA,sha256=H3iq92VDNsR5lP_EndbQq9S0ldsB2-WUzNb8PBByE7I,4808
33
+ comfy_env-0.1.19.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
34
+ comfy_env-0.1.19.dist-info/entry_points.txt,sha256=J4fXeqgxU_YenuW_Zxn_pEL7J-3R0--b6MS5t0QmAr0,49
35
+ comfy_env-0.1.19.dist-info/licenses/LICENSE,sha256=E68QZMMpW4P2YKstTZ3QU54HRQO8ecew09XZ4_Vn870,1093
36
+ comfy_env-0.1.19.dist-info/RECORD,,