Nodes/raylight/Ray Init Actor (Advanced)
ComfyUI Node

Ray Init Actor (Advanced)

The Ray init node for people with a second GPU AND opinions

By komikndr·Created about a year ago·Updated 2 days ago· 409
Ray Init Actor (Advanced)
    • ray_actors_init
    ray_cluster_addresslocal
    ray_cluster_namespacedefault
    GPU2
    GPU_SELECT
    ulysses_degree2
    ring_degree1
    clear_vram_after_samplingfalse
    cfg_degree1
    dp_degree1
    sync_ulyssesfalse
    FSDPfalse
    FSDP_CPU_OFFLOADfalse
    XFuser_attentionTORCH_FLASH
    skip_comm_testfalse
    use_mmapfalse
    ray_object_store_gb2.00
    ray_dashboard_addressNone
    torch_dist_address127.0.0.1:29500

    Ray Initializer (Advanced) is the same Raylight entry node as the plain Ray Initializer, plus the knobs you actually want once your setup stops being "two identical cards in the same slot" and starts being "two cards, one of which I also need for CLIP, VAE, and the rest of my graph."

    If you only have one way to arrange your GPUs, use the basic version. If you've ever muttered "I wish I could keep GPU 0 out of this," this is the node you want - it's the only initializer with a GPU_SELECT input, and that alone is worth the switch on most multi-GPU boxes.

    What the advanced inputs add

    Everything from the regular initializer is here - GPU count, ulysses/ring/cfg/dp degrees, FSDP, FSDP CPU offload, attention backend, mmap loading - so I won't repeat it. The new bits:

    • GPU_SELECT - a comma-separated list like 1,2 that restricts Ray workers to those GPUs. Leave it empty to use everything. This is the whole reason to pick Advanced: reserve GPU 0 for the CLIP encoder, VAE, or a controlnet pass while the workers chew on the diffusion model. The README literally suggests this use case.
    • ray_object_store_gb - Ray's object-store size. The 2GB default is fine unless you're shuttling big tensors through Ray itself.
    • ray_dashboard_address - point it at 127.0.0.1:8265 to watch worker memory and activity in Ray's dashboard while you debug.
    • torch_dist_address - the master address for worker-side NCCL init (default 127.0.0.1:29500). The tooltip's warning is real: restart ComfyUI if you change it, it's read at startup.

    Why you'd use this over the basic node

    Honestly? Two reasons. First, GPU_SELECT is the difference between "add a second GPU" being a gift and being a headache - without it, Ray grabs every visible card and your VAE/CLIP ends up fighting the sampler for the same VRAM. Second, the dashboard hookup turns the whole "which worker is doing what and how much memory is it using" mystery into something you can watch live. For a tool whose failure mode is "silently slow because one worker is starved," that visibility is worth more than the name "Advanced" suggests.

    Everything else is identical to the regular node: output is ray_actors_init, feeding the XFuser / Data Parallel / Unified Parallel samplers, and it's the same install path (ComfyUI Manager → "raylight", or clone + pip install -r requirements.txt). PyTorch 2.8.x is still the recommended version for FSDP, and the NCCL fix (pip install nvidia-nccl-cu12==2.28.9) applies here too.

    Troubleshooting

    • If a worker OOMs during NCCL collectives, the README notes Ray workers strip cudaMallocAsync from the allocator config - that's intentional, and RAYLIGHT_KEEP_CUDA_MALLOC_ASYNC=1 preserves it if you need it.
    • New to Raylight entirely? Start with the basic initializer and the pack's example workflows (Wan T2V is the gentlest), then swap in Advanced once you know the degrees you need. The GPU_SELECT field defaults to empty, which means "all GPUs," so it behaves like the basic node until you tell it otherwise.
    CategoryRaylight

    Inputs (18)

    NameTypeDefaultDescription
    ray_cluster_addressSTRINGlocalRay cluster address. Use `local` for one machine, or a Ray head address for a remote cluster.
    ray_cluster_namespaceSTRINGdefaultRay namespace used to isolate this session from other Ray jobs.
    GPUINT2How many GPUs / Ray workers to launch.
    GPU_SELECTSTRINGGPU indices for Ray workers. Use comma separated values like 0,1,2 to limit Ray to those GPUs, or leave empty to use all visible GPUs. Useful if you want to reserve GPU 0 for CLIP or VAE.
    ulysses_degreeINT2Sequence parallel degree for Ulysses. Set above 1 to split sequence work across GPUs.
    ring_degreeINT1Ring attention degree. Usually leave at 1 unless you are intentionally testing ring parallelism.
    clear_vram_after_samplingBOOLEANfalseRelease Ray worker VRAM after sampling so regular Comfy nodes can use the GPU.
    cfg_degreeINT1CFG parallel degree. `2` splits conditional and unconditional passes across GPUs.
    dp_degreeINT1Data-parallel degree. Default 1 keeps the legacy layout. Leave 0 when using Unified Parallel Sampler to auto use the remaining GPUs after ulysses/ring/cfg.
    sync_ulyssesBOOLEANfalseForce a more synchronized Ulysses path. Can help with some VRAM spikes, but may be slower.
    FSDPBOOLEANfalseEnable FSDP weight sharding across GPUs.
    FSDP_CPU_OFFLOADBOOLEANfalseWhen FSDP is on, offload inactive model shards to CPU RAM.
    XFuser_attentionCOMBOTORCH_FLASHAttention backend used by xFuser-enabled execution.
    skip_comm_testBOOLEANfalseSkip the startup NCCL communication test. Faster startup, but distributed issues are caught later.
    use_mmapBOOLEANfalseUse mmap-backed safetensor loading. This can reduce RAM spikes during model load, especially for large checkpoints.
    ray_object_store_gboptFLOAT2.00Ray object-store size in GB. Usually the default is enough unless you move large tensors through Ray.
    ray_dashboard_addressoptSTRINGNoneOptional Ray dashboard bind address like `127.0.0.1:8265` for monitoring.
    torch_dist_addressoptSTRING127.0.0.1:29500Torch distributed master address used by worker-side NCCL init. Restart ComfyUI if you change it.

    Outputs (1)

    NameTypeDescription
    ray_actors_initRAY_ACTORS_INIT