Nodes/asyncdiff_comfyui/ADPipelineConfigurator
ComfyUI Node

ADPipelineConfigurator

The brains of the pack — ADPipelineConfigurator decides how your GPUs split the model

By SlackinJack·Created 2 years ago·Updated about a year ago· 0
ADPipelineConfigurator
    • AD_CONFIG
    nproc_per_node2
    model_n2
    stride1
    time_shiftfalse
    variantfp16
    scale_inputfalse
    scale_percentage75.00
    enable_tilingfalse
    enable_slicingfalse
    xformers_efficientfalse
    warm_up_steps40
    pipeline_init_timeout60

    Every sampler in asyncdiff_comfyui demands an AD_CONFIG input, and this is the node that makes one. It's the configuration heart of the pack - the thing that decides how AsyncDiff slices your diffusion model across your GPUs and how the asynchronous denoising runs. If you're coming from regular ComfyUI where you never think about this stuff, this node is where the pack stops feeling like ComfyUI and starts feeling like a distributed-computing project. Don't panic - four inputs matter, the rest can stay at defaults.

    What AsyncDiff actually is (in one paragraph)

    It's the NeurIPS 2024 framework by czg1225 and co. that turns the sequential denoising loop into a pipeline. Normally each denoising step finishes before the next starts - a serial chain. AsyncDiff exploits the fact that hidden states barely change between consecutive steps: after a warm-up phase, each component can predict roughly what its input will look like next step, so GPU 2 starts computing while GPU 1 is still finishing. The chain becomes a pipeline, and multiple GPUs work at once instead of one sitting idle. The paper's own demos: ~2.8x faster on SDXL with 4 devices, ~1.8x on AnimateDiff with 2. It's a latency trick, not a quality trick - output isn't bit-identical to a sequential run, and you trade a little fidelity for speed.

    The inputs that actually matter

    • model_n (default 2, range 2–4) - the important one. The number of pieces the denoiser is split into, which should match the GPUs you're throwing at it. 2 = split in half, 4 = quarters. This is where the speedup comes from, and it's also where people break things: asking for model_n 4 on two GPUs is asking for trouble.
    • nproc_per_node (default 2, range 1–4) - processes per node, one per GPU in a single-machine setup. Set it to your GPU count.
    • warm_up_steps (default 40) - how many sequential steps before the async pipeline kicks in. More warm-up = output closer to the non-accelerated version, at the cost of speed. The upstream example uses just 1; 40 is a conservative default that prioritizes fidelity.
    • time_shift (default off) - leave it off. The upstream docs say only flip this on if the accelerated output comes out with significant noise. If your images look clean, it stays off.
    • variant - precision: fp16 default, or bf16 / fp32. fp16 is the right call unless your GPUs choke on it.

    The rest are mostly memory and speed toggles: enable_tiling and enable_slicing are diffusers' attention tiling/slicing tricks for fitting bigger workloads into VRAM, xformers_efficient swaps in xformers attention if you have it installed, scale_input/scale_percentage scale the input down (handy when memory is tight), and pipeline_init_timeout is how long to wait for the distributed pipeline to spin up before declaring it dead.

    Install

    Standard for the pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/SlackinJack/asyncdiff_comfyui.git
    cd asyncdiff_comfyui
    ./clone_asyncdiff_repo.sh   # required - pulls the upstream AsyncDiff framework
    

    Restart ComfyUI (or ComfyUI Manager, search "asyncdiff_comfyui"). Heavy dependencies come along for the ride: torch.distributed, diffusers, accelerate, NVIDIA CUDA >= 12.0.

    Where people get burned

    This node is the source of most "it's broken" reports, and almost all of them are actually multi-GPU setup problems: NCCL failing to initialize, model_n not matching the real GPU count, or nproc_per_node set wrong. Verify with nvidia-smi before blaming the node. And the meta-warning applies to the whole pack: it's multi-GPU or nothing. One card, and all this configuration buys you a slower run than ComfyUI's native sampler. The author's README also flags stable-video-diffusion-img2vid as the currently-supported lane - so if the SD samplers act up, that's a frontier you're walking into, not a bug you caused.

    CategoryAsyncDiff/Configuration

    Inputs (12)

    NameTypeDefaultDescription
    nproc_per_nodeINT21–4
    model_nINT22–4
    strideINT11–2
    time_shiftBOOLEANfalse
    variantCOMBOfp163 options: bf16, fp16, fp32
    scale_inputBOOLEANfalse
    scale_percentageFLOAT75.000.01–4294967295
    enable_tilingBOOLEANfalse
    enable_slicingBOOLEANfalse
    xformers_efficientBOOLEANfalse
    warm_up_stepsINT400–4294967295
    pipeline_init_timeoutINT600–4294967295

    Outputs (1)

    NameTypeDescription
    AD_CONFIGAD_CONFIG