horde-engine 3.4.2__tar.gz → 3.6.0__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.
Files changed (241) hide show
  1. {horde_engine-3.4.2 → horde_engine-3.6.0}/PKG-INFO +1 -1
  2. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/_version.py +2 -2
  3. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/execution/comfy_patches.py +3 -0
  4. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/initialisation.py +26 -0
  5. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/model_manager/base.py +23 -10
  6. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipeline/families/image.py +22 -7
  7. horde_engine-3.6.0/hordelib/pipelines/pipeline_z_image.json +128 -0
  8. horde_engine-3.6.0/hordelib/utils/device_pinning.py +54 -0
  9. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/utils/gpuinfo.py +13 -3
  10. {horde_engine-3.4.2 → horde_engine-3.6.0}/pyproject.toml +1 -0
  11. {horde_engine-3.4.2 → horde_engine-3.6.0}/.gitignore +0 -0
  12. {horde_engine-3.4.2 → horde_engine-3.6.0}/LICENSE +0 -0
  13. {horde_engine-3.4.2 → horde_engine-3.6.0}/README.md +0 -0
  14. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/__init__.py +0 -0
  15. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/__pyinstaller.py +0 -0
  16. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/api.py +0 -0
  17. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/benchmark.py +0 -0
  18. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/beta_models.py +0 -0
  19. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/comfy_horde.py +0 -0
  20. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/config_path.py +0 -0
  21. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/consts.py +0 -0
  22. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/exceptions.py +0 -0
  23. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/execution/__init__.py +0 -0
  24. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/execution/graph_utils.py +0 -0
  25. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/execution/in_process.py +0 -0
  26. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/execution/interface.py +0 -0
  27. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/execution/phase_timing.py +0 -0
  28. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/execution/progress_hook.py +0 -0
  29. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/execution/sampling_lease.py +0 -0
  30. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/feature_impact.py +0 -0
  31. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/feature_requirements.py +0 -0
  32. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/horde.py +0 -0
  33. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/installation/__init__.py +0 -0
  34. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/installation/__main__.py +0 -0
  35. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/installation/installer.py +0 -0
  36. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/installation/manifest.json +0 -0
  37. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/installation/manifest.py +0 -0
  38. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/integrations/__init__.py +0 -0
  39. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/integrations/logfire_comfy_internals.py +0 -0
  40. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/integrations/logfire_setup.py +0 -0
  41. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/metrics.py +0 -0
  42. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/model_database/db_dep.json +0 -0
  43. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/model_database/db_embeds.json +0 -0
  44. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/model_database/diffusers.json +0 -0
  45. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/model_database/med_config.json +0 -0
  46. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/model_manager/__init__.py +0 -0
  47. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/model_manager/civitai_adhoc.py +0 -0
  48. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/model_manager/civitai_provider.py +0 -0
  49. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/model_manager/civitai_records.py +0 -0
  50. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/model_manager/codeformer.py +0 -0
  51. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/model_manager/compvis.py +0 -0
  52. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/model_manager/controlnet.py +0 -0
  53. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/model_manager/diffusers.py +0 -0
  54. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/model_manager/esrgan.py +0 -0
  55. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/model_manager/gfpgan.py +0 -0
  56. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/model_manager/hyper.py +0 -0
  57. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/model_manager/lora.py +0 -0
  58. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/model_manager/miscellaneous.py +0 -0
  59. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/model_manager/safety_checker.py +0 -0
  60. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/model_manager/ti.py +0 -0
  61. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/__init__.py +0 -0
  62. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/comfyui_layerdiffuse/LICENSE +0 -0
  63. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/comfyui_layerdiffuse/README.md +0 -0
  64. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/comfyui_layerdiffuse/__init__.py +0 -0
  65. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/comfyui_layerdiffuse/examples/layer_diffusion_cond_example.json +0 -0
  66. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/comfyui_layerdiffuse/examples/layer_diffusion_cond_fg_all.json +0 -0
  67. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/comfyui_layerdiffuse/examples/layer_diffusion_cond_joint_bg.json +0 -0
  68. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/comfyui_layerdiffuse/examples/layer_diffusion_cond_joint_fg.json +0 -0
  69. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/comfyui_layerdiffuse/examples/layer_diffusion_diff_bg.json +0 -0
  70. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/comfyui_layerdiffuse/examples/layer_diffusion_diff_bg_stop_at.json +0 -0
  71. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/comfyui_layerdiffuse/examples/layer_diffusion_diff_fg.json +0 -0
  72. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/comfyui_layerdiffuse/examples/layer_diffusion_fg_example.json +0 -0
  73. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/comfyui_layerdiffuse/examples/layer_diffusion_fg_example_rgba.json +0 -0
  74. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/comfyui_layerdiffuse/examples/layer_diffusion_joint.json +0 -0
  75. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/comfyui_layerdiffuse/layered_diffusion.py +0 -0
  76. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/comfyui_layerdiffuse/lib_layerdiffusion/__init__.py +0 -0
  77. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/comfyui_layerdiffuse/lib_layerdiffusion/attention_sharing.py +0 -0
  78. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/comfyui_layerdiffuse/lib_layerdiffusion/enums.py +0 -0
  79. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/comfyui_layerdiffuse/lib_layerdiffusion/models.py +0 -0
  80. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/comfyui_layerdiffuse/lib_layerdiffusion/utils.py +0 -0
  81. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/comfyui_layerdiffuse/pyproject.toml +0 -0
  82. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/comfyui_layerdiffuse/requirements.txt +0 -0
  83. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/LICENSE +0 -0
  84. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/README.md +0 -0
  85. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/__init__.py +0 -0
  86. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/VERSION +0 -0
  87. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/__init__.py +0 -0
  88. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/archs/__init__.py +0 -0
  89. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/archs/arcface_arch.py +0 -0
  90. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/archs/arch_util.py +0 -0
  91. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/archs/codeformer_arch.py +0 -0
  92. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/archs/rrdbnet_arch.py +0 -0
  93. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/archs/vgg_arch.py +0 -0
  94. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/archs/vqgan_arch.py +0 -0
  95. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/data/__init__.py +0 -0
  96. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/data/data_sampler.py +0 -0
  97. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/data/data_util.py +0 -0
  98. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/data/prefetch_dataloader.py +0 -0
  99. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/data/transforms.py +0 -0
  100. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/losses/__init__.py +0 -0
  101. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/losses/loss_util.py +0 -0
  102. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/losses/losses.py +0 -0
  103. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/metrics/__init__.py +0 -0
  104. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/metrics/metric_util.py +0 -0
  105. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/metrics/psnr_ssim.py +0 -0
  106. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/models/__init__.py +0 -0
  107. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/ops/__init__.py +0 -0
  108. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/ops/dcn/__init__.py +0 -0
  109. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/ops/dcn/deform_conv.py +0 -0
  110. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/ops/dcn/src/deform_conv_cuda.cpp +0 -0
  111. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/ops/dcn/src/deform_conv_cuda_kernel.cu +0 -0
  112. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/ops/dcn/src/deform_conv_ext.cpp +0 -0
  113. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/ops/fused_act/__init__.py +0 -0
  114. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/ops/fused_act/fused_act.py +0 -0
  115. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/ops/fused_act/src/fused_bias_act.cpp +0 -0
  116. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/ops/fused_act/src/fused_bias_act_kernel.cu +0 -0
  117. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/ops/upfirdn2d/__init__.py +0 -0
  118. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/ops/upfirdn2d/src/upfirdn2d.cpp +0 -0
  119. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/ops/upfirdn2d/src/upfirdn2d_kernel.cu +0 -0
  120. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/ops/upfirdn2d/upfirdn2d.py +0 -0
  121. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/setup.py +0 -0
  122. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/train.py +0 -0
  123. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/utils/__init__.py +0 -0
  124. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/utils/dist_util.py +0 -0
  125. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/utils/download_util.py +0 -0
  126. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/utils/file_client.py +0 -0
  127. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/utils/img_util.py +0 -0
  128. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/utils/lmdb_util.py +0 -0
  129. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/utils/logger.py +0 -0
  130. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/utils/matlab_functions.py +0 -0
  131. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/utils/misc.py +0 -0
  132. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/utils/options.py +0 -0
  133. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/utils/realesrgan_utils.py +0 -0
  134. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/utils/registry.py +0 -0
  135. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/basicsr/version.py +0 -0
  136. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/facelib/__init__.py +0 -0
  137. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/facelib/detection/__init__.py +0 -0
  138. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/facelib/detection/align_trans.py +0 -0
  139. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/facelib/detection/matlab_cp2tform.py +0 -0
  140. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/facelib/detection/retinaface/retinaface.py +0 -0
  141. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/facelib/detection/retinaface/retinaface_net.py +0 -0
  142. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/facelib/detection/retinaface/retinaface_utils.py +0 -0
  143. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/facelib/detection/yolov5face/__init__.py +0 -0
  144. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/facelib/detection/yolov5face/face_detector.py +0 -0
  145. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/facelib/detection/yolov5face/models/__init__.py +0 -0
  146. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/facelib/detection/yolov5face/models/common.py +0 -0
  147. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/facelib/detection/yolov5face/models/experimental.py +0 -0
  148. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/facelib/detection/yolov5face/models/yolo.py +0 -0
  149. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/facelib/detection/yolov5face/models/yolov5l.yaml +0 -0
  150. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/facelib/detection/yolov5face/models/yolov5n.yaml +0 -0
  151. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/facelib/detection/yolov5face/utils/__init__.py +0 -0
  152. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/facelib/detection/yolov5face/utils/autoanchor.py +0 -0
  153. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/facelib/detection/yolov5face/utils/datasets.py +0 -0
  154. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/facelib/detection/yolov5face/utils/extract_ckpt.py +0 -0
  155. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/facelib/detection/yolov5face/utils/general.py +0 -0
  156. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/facelib/detection/yolov5face/utils/torch_utils.py +0 -0
  157. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/facelib/parsing/__init__.py +0 -0
  158. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/facelib/parsing/bisenet.py +0 -0
  159. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/facelib/parsing/parsenet.py +0 -0
  160. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/facelib/parsing/resnet.py +0 -0
  161. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/facelib/utils/__init__.py +0 -0
  162. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/facelib/utils/face_restoration_helper.py +0 -0
  163. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/facelib/utils/face_utils.py +0 -0
  164. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/facelib/utils/misc.py +0 -0
  165. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/r_chainner/README.md +0 -0
  166. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/r_chainner/__init__.py +0 -0
  167. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/r_chainner/gfpganv1_clean_arch.py +0 -0
  168. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/r_chainner/model_loading.py +0 -0
  169. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/r_chainner/stylegan2_clean_arch.py +0 -0
  170. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/facerestore_cf/r_chainner/types.py +0 -0
  171. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/node_controlnet_model_loader.py +0 -0
  172. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/node_image_loader.py +0 -0
  173. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/node_image_output.py +0 -0
  174. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/node_lora_loader.py +0 -0
  175. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/node_model_loader.py +0 -0
  176. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/nodes/node_upscale_model_loader.py +0 -0
  177. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipeline/__init__.py +0 -0
  178. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipeline/constants.py +0 -0
  179. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipeline/context.py +0 -0
  180. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipeline/families/__init__.py +0 -0
  181. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipeline/families/post_processing.py +0 -0
  182. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipeline/graph.py +0 -0
  183. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipeline/horde_compat.py +0 -0
  184. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipeline/patches.py +0 -0
  185. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipeline/payload.py +0 -0
  186. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipeline/payload_pp.py +0 -0
  187. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipeline/registry.py +0 -0
  188. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipeline/resolution.py +0 -0
  189. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipeline/template.py +0 -0
  190. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipeline_designs/pipeline_controlnet.json +0 -0
  191. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipeline_designs/pipeline_controlnet_annotator.json +0 -0
  192. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipeline_designs/pipeline_controlnet_hires_fix.json +0 -0
  193. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipeline_designs/pipeline_flux.json +0 -0
  194. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipeline_designs/pipeline_image_facefix.json +0 -0
  195. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipeline_designs/pipeline_image_upscale.json +0 -0
  196. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipeline_designs/pipeline_qr_code.json +0 -0
  197. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipeline_designs/pipeline_qwen.json +0 -0
  198. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipeline_designs/pipeline_stable_cascade.json +0 -0
  199. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipeline_designs/pipeline_stable_cascade_2pass.json +0 -0
  200. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipeline_designs/pipeline_stable_cascade_remix.json +0 -0
  201. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipeline_designs/pipeline_stable_diffusion.json +0 -0
  202. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipeline_designs/pipeline_stable_diffusion_hires_fix.json +0 -0
  203. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipeline_designs/pipeline_stable_diffusion_img2img_mask.json +0 -0
  204. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipeline_designs/pipeline_stable_diffusion_paint.json +0 -0
  205. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipelines/pipeline_controlnet.json +0 -0
  206. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipelines/pipeline_controlnet_annotator.json +0 -0
  207. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipelines/pipeline_controlnet_hires_fix.json +0 -0
  208. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipelines/pipeline_flux.json +0 -0
  209. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipelines/pipeline_image_facefix.json +0 -0
  210. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipelines/pipeline_image_upscale.json +0 -0
  211. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipelines/pipeline_qr_code.json +0 -0
  212. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipelines/pipeline_qwen.json +0 -0
  213. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipelines/pipeline_stable_cascade.json +0 -0
  214. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipelines/pipeline_stable_cascade_2pass.json +0 -0
  215. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipelines/pipeline_stable_cascade_remix.json +0 -0
  216. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipelines/pipeline_stable_diffusion.json +0 -0
  217. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipelines/pipeline_stable_diffusion_hires_fix.json +0 -0
  218. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipelines/pipeline_stable_diffusion_img2img_mask.json +0 -0
  219. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pipelines/pipeline_stable_diffusion_paint.json +0 -0
  220. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/preload.py +0 -0
  221. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/py.typed +0 -0
  222. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pyinstaller_hooks/__init__.py +0 -0
  223. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/pyinstaller_hooks/hook-hordelib.horde.py +0 -0
  224. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/safety.py +0 -0
  225. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/safety_checker.py +0 -0
  226. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/settings.py +0 -0
  227. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/shared_model_manager.py +0 -0
  228. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/train.py +0 -0
  229. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/utils/__init__.py +0 -0
  230. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/utils/distance.py +0 -0
  231. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/utils/dynamicprompt.py +0 -0
  232. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/utils/image_utils.py +0 -0
  233. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/utils/ioredirect.py +0 -0
  234. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/utils/logger.py +0 -0
  235. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/utils/nvml.py +0 -0
  236. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/utils/optional_deps.py +0 -0
  237. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/utils/sanitizer.py +0 -0
  238. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/utils/switch.py +0 -0
  239. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/utils/torch_build.py +0 -0
  240. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/utils/torch_memory.py +0 -0
  241. {horde_engine-3.4.2 → horde_engine-3.6.0}/hordelib/vram_planning.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: horde-engine
3
- Version: 3.4.2
3
+ Version: 3.6.0
4
4
  Summary: A wrapper around ComfyUI to allow use by AI Horde.
5
5
  Project-URL: Homepage, https://github.com/Haidra-Org/hordelib
6
6
  Project-URL: Bug Tracker, https://github.com/Haidra-Org/hordelib/issues
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
18
18
  commit_id: str | None
19
19
  __commit_id__: str | None
20
20
 
21
- __version__ = version = '3.4.2'
22
- __version_tuple__ = version_tuple = (3, 4, 2)
21
+ __version__ = version = '3.6.0'
22
+ __version_tuple__ = version_tuple = (3, 6, 0)
23
23
 
24
24
  __commit_id__ = commit_id = None
@@ -33,6 +33,7 @@ FORCE_LOAD_SKIP_CLASS_NAMES: tuple[str, ...] = (
33
33
  "SDXLRefiner",
34
34
  "Flux",
35
35
  "QwenImage",
36
+ "Lumina2",
36
37
  )
37
38
  """The comfy ``model_base`` class names hordelib must keep in lockstep with ComfyUI.
38
39
 
@@ -88,6 +89,8 @@ def _baseline_class_names() -> dict:
88
89
  KNOWN_IMAGE_GENERATION_BASELINE.flux_schnell: ("Flux",),
89
90
  KNOWN_IMAGE_GENERATION_BASELINE.flux_dev: ("Flux",),
90
91
  KNOWN_IMAGE_GENERATION_BASELINE.qwen_image: ("QwenImage",),
92
+ # Z-Image (incl. Z-Image-Turbo) loads as comfy's Lumina2 model_base class.
93
+ KNOWN_IMAGE_GENERATION_BASELINE.z_image_turbo: ("Lumina2",),
91
94
  },
92
95
  )
93
96
  return BASELINE_FORCE_LOAD_CLASS_NAMES
@@ -10,6 +10,7 @@ from hordelib.config_path import get_comfyui_path, get_hordelib_path, set_system
10
10
  from hordelib.consts import RELEASE_VERSION
11
11
  from hordelib.installation import EnvironmentInstaller, load_packaged_manifest
12
12
  from hordelib.utils.logger import HordeLog
13
+ from hordelib.utils.torch_memory import AcceleratorKind
13
14
 
14
15
  _is_initialised = False
15
16
 
@@ -27,6 +28,8 @@ def initialise(
27
28
  do_not_load_model_mangers: bool = True,
28
29
  models_not_to_force_load: list[str] | None = None,
29
30
  reference_offline: bool | None = None,
31
+ device_index: int | None = None,
32
+ accelerator_kind: AcceleratorKind | None = None,
30
33
  ):
31
34
  """Initialise hordelib. This is required before using any other hordelib functions.
32
35
 
@@ -46,9 +49,32 @@ def initialise(
46
49
  reference_offline (bool | None, optional): If True, the model reference manager reads references \
47
50
  from local disk only and never downloads them (the caller/parent process owns downloading). \
48
51
  If None, defers to ``HORDE_MODEL_REFERENCE_OFFLINE``. Defaults to None.
52
+ device_index (int | None, optional): Pin this process to a single device by global index. \
53
+ When set, applies the env-var mask and any required ComfyUI CLI args via \
54
+ :func:`~hordelib.utils.device_pinning.device_pin_env` before torch is imported. \
55
+ ``None`` (default) leaves the current environment untouched (today's behavior). \
56
+ ``accelerator_kind`` must also be provided when this is set.
57
+ accelerator_kind (AcceleratorKind | None, optional): The backend kind of ``device_index``, \
58
+ required when ``device_index`` is set. Obtain from \
59
+ :func:`~hordelib.utils.torch_memory.enumerate_accelerators`. Defaults to None.
49
60
  """
50
61
  global _is_initialised
51
62
 
63
+ # Device pinning must happen before ComfyUI (and torch) is imported; CUDA_VISIBLE_DEVICES
64
+ # has no effect after torch.cuda is initialised. Apply the mask here, ahead of everything else.
65
+ if device_index is not None:
66
+ if accelerator_kind is None:
67
+ raise ValueError("accelerator_kind must be provided when device_index is set")
68
+ from hordelib.utils.device_pinning import device_pin_env
69
+
70
+ pin_env, pin_args = device_pin_env(accelerator_kind, device_index)
71
+ os.environ.update(pin_env)
72
+ if extra_comfyui_args is None:
73
+ extra_comfyui_args = list(pin_args)
74
+ else:
75
+ extra_comfyui_args = list(extra_comfyui_args) + pin_args
76
+ logger.debug("Pinned process to device index={} kind={}: env={}", device_index, accelerator_kind, pin_env)
77
+
52
78
  # Opt the CUDA/ROCm caching allocator into expandable segments before ComfyUI imports torch.
53
79
  # Fragmentation (a large "reserved but unallocated" pool) is a common cause of an out-of-memory
54
80
  # error even when the device still reports free memory; torch's own OOM message recommends this
@@ -1,3 +1,4 @@
1
+ import os
1
2
  import threading
2
3
  from abc import ABC
3
4
  from collections.abc import Callable, Iterable
@@ -14,6 +15,7 @@ from horde_model_reference import (
14
15
  file_paths_for,
15
16
  get_category_descriptor,
16
17
  horde_model_reference_paths,
18
+ is_present,
17
19
  )
18
20
  from horde_model_reference.model_reference_manager import ModelReferenceManager
19
21
  from horde_model_reference.model_reference_records import GenericModelRecord
@@ -539,11 +541,23 @@ class BaseModelManager[RecordT: GenericModelRecord | dict[str, Any]](ABC):
539
541
  self.validate_model(model)
540
542
  return True
541
543
 
542
- def is_model_available(self, model_name: str) -> bool:
544
+ def _extra_weights_roots(self) -> list[Path]:
545
+ """Additional weights roots to search for already-present files, from the environment.
546
+
547
+ Mirrors the worker's ``AIWORKER_EXTRA_MODEL_DIRECTORIES`` (an ``os.pathsep``-separated list of
548
+ weights-root directories) so a model spread across disks is judged present here exactly as the
549
+ worker's download planner judges it.
543
550
  """
544
- :param model_name: Name of the model
545
- Checks if the model is available.
546
- Returns True if the model is available, False otherwise.
551
+ raw = os.environ.get("AIWORKER_EXTRA_MODEL_DIRECTORIES", "")
552
+ return [Path(entry) for entry in raw.split(os.pathsep) if entry.strip()]
553
+
554
+ def is_model_available(self, model_name: str) -> bool:
555
+ """Return whether *model_name*'s declared files all exist on disk (existence-only).
556
+
557
+ Presence is delegated to horde_model_reference's canonical on-disk layout, so every consumer
558
+ (the worker's download plan, the TUI picker, this manager) answers "is it on disk?" the same way
559
+ and a model placed on disk is never reported as needing download. Integrity is a separate concern:
560
+ a present-but-corrupt file counts as available here and is caught by ``validate_model`` (or at load).
547
561
  """
548
562
  if model_name not in self.model_reference:
549
563
  return False
@@ -551,12 +565,11 @@ class BaseModelManager[RecordT: GenericModelRecord | dict[str, Any]](ABC):
551
565
  if model_name in self.tainted_models:
552
566
  return False
553
567
 
554
- model_files = self.get_model_filenames(model_name)
555
- for file_entry in model_files:
556
- if not self.is_file_available(file_entry["file_path"]):
557
- logger.debug([file_entry["file_path"], self.is_file_available(file_entry["file_path"])])
558
- return False
559
- return True
568
+ record = self._get_generic_record(model_name)
569
+ if record is None:
570
+ return False
571
+
572
+ return is_present(record, self._weights_root, extra_roots=self._extra_weights_roots())
560
573
 
561
574
  def is_model_url_from_civitai(self, url: str) -> bool:
562
575
  return CIVITAI_API_PATH in url
@@ -7,10 +7,11 @@ The predicates and priorities reproduce the legacy decision tree in
7
7
  2. cascade (remix / 2pass / base)
8
8
  3. flux
9
9
  4. qwen
10
- 5. controlnet (annotator / hires / base)
11
- 6. img2img-with-mask / inpainting / outpainting
12
- 7. hires fix
13
- 8. generic stable diffusion (also plain img2img)
10
+ 5. z-image
11
+ 6. controlnet (annotator / hires / base)
12
+ 7. img2img-with-mask / inpainting / outpainting
13
+ 8. hires fix
14
+ 9. generic stable diffusion (also plain img2img)
14
15
 
15
16
  The bindings are the typed port of the legacy ``PAYLOAD_TO_PIPELINE_PARAMETER_MAPPING``: the
16
17
  full candidate set is declared once and each template keeps the bindings whose target node
@@ -62,6 +63,15 @@ FLUX_BASELINES: frozenset[KNOWN_IMAGE_GENERATION_BASELINE] = frozenset(
62
63
  },
63
64
  )
64
65
 
66
+ # Split-files baselines whose diffusion weights load through the bare diffusion-model loader
67
+ # (file_type "unet") with CLIP/VAE wired from their own loader nodes, rather than a fused checkpoint.
68
+ UNET_LOADER_BASELINES: frozenset[KNOWN_IMAGE_GENERATION_BASELINE] = frozenset(
69
+ {
70
+ KNOWN_IMAGE_GENERATION_BASELINE.qwen_image,
71
+ KNOWN_IMAGE_GENERATION_BASELINE.z_image_turbo,
72
+ },
73
+ )
74
+
65
75
 
66
76
  def _has_img2img_mask(payload: ImageGenPayload) -> bool:
67
77
  if payload.source_processing != "img2img":
@@ -167,9 +177,9 @@ def _apply_model_context_step(graph: ComfyGraph, payload: ImageGenPayload, conte
167
177
  "model_loader.model_name": context.main_file,
168
178
  "model_loader.horde_model_name": context.horde_model_name,
169
179
  "model_loader.will_load_loras": context.will_load_loras,
170
- # The HordeCheckpointLoader needs to know what file to load; "unet" routes qwen
171
- # through the diffusion-model loader, None keeps normal SD checkpoints working.
172
- "model_loader.file_type": "unet" if context.baseline is KNOWN_IMAGE_GENERATION_BASELINE.qwen_image else None,
180
+ # The HordeCheckpointLoader needs to know what file to load; "unet" routes the split-files
181
+ # baselines (qwen, z-image) through the diffusion-model loader, None keeps normal SD checkpoints working.
182
+ "model_loader.file_type": "unet" if context.baseline in UNET_LOADER_BASELINES else None,
173
183
  "model_loader_stage_c.ckpt_name": context.extra_files.get("stable_cascade_stage_c"),
174
184
  "model_loader_stage_c.model_name": context.extra_files.get("stable_cascade_stage_c"),
175
185
  "model_loader_stage_c.horde_model_name": context.horde_model_name,
@@ -376,6 +386,11 @@ def build_default_registry() -> PipelineRegistry[ImageGenPayload, ModelContext]:
376
386
  predicate=lambda p, c: c.baseline is KNOWN_IMAGE_GENERATION_BASELINE.qwen_image,
377
387
  priority=86,
378
388
  ),
389
+ PipelineSpec(
390
+ template=_template("z_image"),
391
+ predicate=lambda p, c: c.baseline is KNOWN_IMAGE_GENERATION_BASELINE.z_image_turbo,
392
+ priority=85,
393
+ ),
379
394
  # ControlNet
380
395
  PipelineSpec(
381
396
  template=_template("controlnet_annotator"),
@@ -0,0 +1,128 @@
1
+ {
2
+ "3": {
3
+ "inputs": {
4
+ "seed": 556312751097931,
5
+ "steps": 9,
6
+ "cfg": 1,
7
+ "sampler_name": "euler",
8
+ "scheduler": "simple",
9
+ "denoise": 1,
10
+ "model": [
11
+ "37",
12
+ 0
13
+ ],
14
+ "positive": [
15
+ "6",
16
+ 0
17
+ ],
18
+ "negative": [
19
+ "7",
20
+ 0
21
+ ],
22
+ "latent_image": [
23
+ "58",
24
+ 0
25
+ ]
26
+ },
27
+ "class_type": "KSampler",
28
+ "_meta": {
29
+ "title": "sampler"
30
+ }
31
+ },
32
+ "6": {
33
+ "inputs": {
34
+ "text": "a photograph of a horse",
35
+ "clip": [
36
+ "38",
37
+ 0
38
+ ]
39
+ },
40
+ "class_type": "CLIPTextEncode",
41
+ "_meta": {
42
+ "title": "prompt"
43
+ }
44
+ },
45
+ "7": {
46
+ "inputs": {
47
+ "text": "",
48
+ "clip": [
49
+ "38",
50
+ 0
51
+ ]
52
+ },
53
+ "class_type": "CLIPTextEncode",
54
+ "_meta": {
55
+ "title": "negative_prompt"
56
+ }
57
+ },
58
+ "8": {
59
+ "inputs": {
60
+ "samples": [
61
+ "3",
62
+ 0
63
+ ],
64
+ "vae": [
65
+ "39",
66
+ 0
67
+ ]
68
+ },
69
+ "class_type": "VAEDecode",
70
+ "_meta": {
71
+ "title": "vae_decode"
72
+ }
73
+ },
74
+ "37": {
75
+ "inputs": {
76
+ "unet_name": "z_image_turbo_bf16.safetensors",
77
+ "weight_dtype": "default"
78
+ },
79
+ "class_type": "UNETLoader",
80
+ "_meta": {
81
+ "title": "model_loader"
82
+ }
83
+ },
84
+ "38": {
85
+ "inputs": {
86
+ "clip_name": "qwen_3_4b.safetensors",
87
+ "type": "lumina2",
88
+ "device": "default"
89
+ },
90
+ "class_type": "CLIPLoader",
91
+ "_meta": {
92
+ "title": "clip_loader"
93
+ }
94
+ },
95
+ "39": {
96
+ "inputs": {
97
+ "vae_name": "ae.safetensors"
98
+ },
99
+ "class_type": "VAELoader",
100
+ "_meta": {
101
+ "title": "vae_loader"
102
+ }
103
+ },
104
+ "58": {
105
+ "inputs": {
106
+ "width": 1024,
107
+ "height": 1024,
108
+ "batch_size": 1
109
+ },
110
+ "class_type": "EmptySD3LatentImage",
111
+ "_meta": {
112
+ "title": "empty_latent_image"
113
+ }
114
+ },
115
+ "75": {
116
+ "inputs": {
117
+ "filename_prefix": "ComfyUI",
118
+ "images": [
119
+ "8",
120
+ 0
121
+ ]
122
+ },
123
+ "class_type": "SaveImage",
124
+ "_meta": {
125
+ "title": "output_image"
126
+ }
127
+ }
128
+ }
@@ -0,0 +1,54 @@
1
+ """Single source of truth for masking a subprocess to one compute device.
2
+
3
+ Each inference child process is pinned to exactly one device so that every
4
+ single-device assumption in ComfyUI and hordelib (``cuda:0``, module-level
5
+ ``total_vram``, ``UserSettings._vram_to_leave_free_mb``) stays correct without
6
+ modification inside that child. The orchestrator (which is torch-free) calls
7
+ :func:`device_pin_env` to get the env-var patch and extra ComfyUI CLI args it
8
+ must apply before spawning the child; the child itself applies them before
9
+ calling ``hordelib.initialise()``.
10
+
11
+ :func:`device_pin_env` is the only function here. All callers (worker entry
12
+ points, ``hordelib.initialise``'s optional convenience path) must go through
13
+ it so that backend-specific masking details stay in one place.
14
+ """
15
+
16
+ from __future__ import annotations
17
+
18
+ from hordelib.utils.torch_memory import AcceleratorKind
19
+
20
+
21
+ def device_pin_env(kind: AcceleratorKind, index: int) -> tuple[dict[str, str], list[str]]:
22
+ """Return the env-var patch and extra ComfyUI args that restrict a process to device ``index``.
23
+
24
+ After applying both, the OS/driver presents only that one device to the process and it
25
+ becomes ``cuda:0`` (or the backend equivalent), so all single-device assumptions inside
26
+ hordelib and the vendored ComfyUI remain correct without any code changes there.
27
+
28
+ Args:
29
+ kind: The :class:`~hordelib.utils.torch_memory.AcceleratorKind` of the target device.
30
+ index: The **global** device index (as reported by
31
+ :func:`~hordelib.utils.torch_memory.enumerate_accelerators`).
32
+
33
+ Returns:
34
+ A 2-tuple ``(env_vars, extra_args)`` where ``env_vars`` is a dict to merge into
35
+ ``os.environ`` and ``extra_args`` is a list of CLI arguments to append to
36
+ ``extra_comfyui_args``. Either or both may be empty when the backend needs no masking
37
+ (cpu, mps).
38
+ """
39
+ if kind is AcceleratorKind.cuda:
40
+ return {"CUDA_VISIBLE_DEVICES": str(index)}, []
41
+
42
+ if kind is AcceleratorKind.rocm:
43
+ # ROCm presents through torch.cuda, so CUDA_VISIBLE_DEVICES is honoured too; keep them in sync.
44
+ return {"HIP_VISIBLE_DEVICES": str(index), "CUDA_VISIBLE_DEVICES": str(index)}, []
45
+
46
+ if kind is AcceleratorKind.xpu:
47
+ return {"ZE_AFFINITY_MASK": str(index)}, []
48
+
49
+ if kind is AcceleratorKind.directml:
50
+ # DirectML device selection happens via a ComfyUI CLI flag, not an env var.
51
+ return {}, ["--directml", str(index)]
52
+
53
+ # cpu and mps have no multi-device isolation mechanism; masking is a no-op.
54
+ return {}, []
@@ -25,15 +25,25 @@ _AVERAGE_WINDOW_SECONDS = 60 * 5
25
25
  class GPUInfo:
26
26
  """Collects per-device GPU statistics, keeping rolling averages of load, temperature, and power."""
27
27
 
28
- def __init__(self) -> None:
29
- """Initialize the collector for the device named by ``CUDA_VISIBLE_DEVICES`` (default 0)."""
28
+ def __init__(self, device_index: int | None = None) -> None:
29
+ """Initialize the collector for the given device index.
30
+
31
+ Args:
32
+ device_index: The global NVML/CUDA device index to query. When ``None`` (default), reads
33
+ ``CUDA_VISIBLE_DEVICES`` (which is ``0`` inside a pinned subprocess, and the real
34
+ device index in the unmasked orchestrator). Pass an explicit index when an unmasked
35
+ caller needs to survey a specific card without masking the process.
36
+ """
30
37
  self.avg_load: list[int] = []
31
38
  self.avg_temp: list[int] = []
32
39
  self.avg_power: list[int] = []
33
40
  self._average_window_samples = _AVERAGE_SAMPLES_PER_SECOND * _AVERAGE_WINDOW_SECONDS
34
41
  if not self.is_nvidia():
35
42
  logger.warning("Detailed GPU info (load/temp/power) is only available on NVIDIA GPUs")
36
- self.device = int(os.getenv("CUDA_VISIBLE_DEVICES", "0"))
43
+ if device_index is not None:
44
+ self.device = device_index
45
+ else:
46
+ self.device = int(os.getenv("CUDA_VISIBLE_DEVICES", "0"))
37
47
 
38
48
  def is_nvidia(self) -> bool:
39
49
  """Return whether the active torch build targets NVIDIA CUDA (not ROCm/HIP)."""
@@ -298,6 +298,7 @@ markers = [
298
298
  "default_sd15_model: marks tests as default_sd15_model (deselect with '-m \"not default_sd15_model\"')",
299
299
  "default_sdxl_model: marks tests as default_sdxl_model (deselect with '-m \"not default_sdxl_model\"')",
300
300
  "default_qwen_model: marks tests as default_qwen_model (deselect with '-m \"not default_qwen_model\"')",
301
+ "default_z_image_turbo_model: marks tests as default_z_image_turbo_model (deselect with '-m \"not default_z_image_turbo_model\"')",
301
302
  "refined_sdxl_model: marks tests as refined_sdxl_model (deselect with '-m \"not refined_sdxl_model\"')",
302
303
  "patch_harness: instrumentation-only tests for ComfyUI monkeypatch impact",
303
304
  ]
File without changes
File without changes
File without changes