John Pollock 56e2e61e52 refactor: streamline MultiGPU node initialization
Code Changes (__init__.py):
- Switches from deepcopy to standard copy for better efficiency
- Initializes current_device from model_management instead of hardcoded "cuda:0"
- Simplifies node class mapping by removing intermediate TARGET_NODE_CLASS_MAPPINGS
- Updates node naming convention: removes underscore from MultiGPU suffix
- Adds new supported nodes: "CheckpointLoaderSimple", "ControlNetLoader", "LoadFluxControlNet"
- Improves code organization with better comment clarity

COMPATIBILITY NOTE: This version restores backward compatibility with workflows
using the previous node naming scheme. Both old and new node names will work.

Documentation Changes (README.md):
- Updates node list to reflect automatic detection system
- Adds proper attribution links for required dependencies (ComfyUI-GGUF, x-flux-comfy)
- Links to example quantized models like flux1-dev-gguf
- Reorganizes loader sections with clear dependency requirements
- Updates support links to new maintainer
- Removes business/commercial references
- Updates credits section to reflect current project status
2024-12-22 22:36:59 -06:00
2024-08-04 19:36:59 +03:00
2024-08-04 19:36:59 +03:00
2024-08-04 19:36:59 +03:00

ComfyUI-MultiGPU

Experimental nodes for using multiple GPUs in a single ComfyUI workflow.

This extension adds device selection capabilities to model loading nodes in ComfyUI. It monkey patches the memory management of ComfyUI in a hacky way and is neither a comprehensive solution nor a well-tested one. Use at your own risk.

Note that this does not add parallelism. The workflow steps are still executed sequentially just on different GPUs. Any potential speedup comes from not having to constantly load and unload models from VRAM.

Installation

Clone this repository inside ComfyUI/custom_nodes/.

Nodes

The extension automatically creates MultiGPU versions of loader nodes. Each MultiGPU node has the same functionality as its original counterpart but adds a device parameter that allows you to specify the GPU to use.

Currently supported nodes (automatically detected if available):

  • Standard ComfyUI loaders:

    • CheckpointLoaderSimpleMultiGPU
    • CLIPLoaderMultiGPU
    • ControlNetLoaderMultiGPU
    • DualCLIPLoaderMultiGPU
    • TripleCLIPLoaderMultiGPU
    • UNETLoaderMultiGPU
    • VAELoaderMultiGPU
  • GGUF loaders (requires ComfyUI-GGUF):

    • UnetLoaderGGUFMultiGPU (supports quantized models like flux1-dev-gguf)
    • UnetLoaderGGUFAdvancedMultiGPU
    • CLIPLoaderGGUFMultiGPU
    • DualCLIPLoaderGGUFMultiGPU
    • TripleCLIPLoaderGGUFMultiGPU
  • Additional supported nodes:

All MultiGPU nodes can be found in the "multigpu" category in the node menu.

Example workflows

All workflows have been tested on a 2x 3090 setup.

Loading two SDXL checkpoints on different GPUs

This workflow loads two SDXL checkpoints on two different GPUs. The first checkpoint is loaded on GPU 0, and the second checkpoint is loaded on GPU 1.

Split FLUX.1-dev across two GPUs

This workflow loads a FLUX.1-dev model and splits it across two GPUs. The UNet model is loaded on GPU 0 while the text encoders and VAE are loaded on GPU 1.

FLUX.1-dev and SDXL in the same workflow

This workflow loads a FLUX.1-dev model and an SDXL model in the same workflow. The FLUX.1-dev model is loaded on GPU 0, and the SDXL model is loaded on GPU 1.

Support

If you encounter problems, please open an issue. Attach the workflow if possible.

Credits

Originally created by Alexander Dzhoganov.
Implementation improved by City96.
Currently maintained by pollockjj.

S
Description
No description provided
Readme GPL-3.0
24 MiB
Languages
Python 99.6%
Shell 0.4%