Nodes/ComfyUI-TaylorSeer/QwenimageBlockSwap
ComfyUI Node

QwenimageBlockSwap

Free VRAM on Qwen-Image before TaylorSeer-Lite runs

By philipy1219·Created about a year ago·Updated 7 months ago· 60
QwenimageBlockSwap
    • block_swap_args
    double_block_swap0

    Qwen-Image joined the TaylorSeer party in October 2025 via TaylorSeer-Lite, and it's a good fit: a single-stream DiT with a clean architecture that caches cheaply. But Qwen-Image is still a 20B-parameter class model - 6B backbone plus a chunky text encoder - and on consumer cards every megabyte counts. QwenimageBlockSwap is the memory trim for that combo: it offloads leading transformer blocks to CPU so the generation actually fits alongside the Taylor cache.

    The standard trade applies: you're buying VRAM with speed. Offloaded blocks shuffle between CPU and GPU, so expect the run to slow down in proportion to how much you swap.

    How it works

    Qwen-Image's transformer is a row of 16 double-stream blocks and no separate single-stream stage - which is why this node has exactly one input where the Flux and HiDream versions have two:

    • double_block_swap (0–16) - the first N transformer blocks parked off-GPU

    The console prints total_offload_memory: xxx MB at cache init so you can see what you freed, and the blocks move back to the GPU when sampling finishes.

    Like every BlockSwap node in this pack, it's a config carrier, not an actor. It outputs a block_swap_args value that you plug into the optional block_swap_args input of TaylorSeerLite with model_type set to qwenimage. Standalone it does nothing.

    What to set

    Start with 2–4 blocks and read the total_offload_memory line. Since the Qwen-Image-Lite cache is already nearly VRAM-free, you usually only need a light swap to get comfortable headroom rather than the wholesale offload a standard HiDream run demands. If you're swapping more than half the blocks just to boot, something upstream (resolution, batch, other nodes) is the real problem - fix that instead.

    Install

    Same pack, same zero-dependency install:

    cd ComfyUI/custom_nodes
    git clone https://github.com/philipy1219/ComfyUI-TaylorSeer
    

    Restart ComfyUI, or use Manager (search "ComfyUI-TaylorSeer"). No model files, no pip packages. Same house rule as the rest of the pack: ComfyUI must be newer than commit c496e53, because these hooks reach into ComfyUI's model internals.

    Troubleshooting

    • No offload happening - block_swap_args isn't wired into a TaylorSeerLite node, or model_type isn't qwenimage. Both need to be right.
    • Slower than you'd like - over-swapped. Pull double_block_swap down; Qwen-Image's Lite cache doesn't need much relief to begin with.
    • Cache flickering between runs - Qwen-Image-Lite keeps a separate negative-pass cache; if output quality is inconsistent, raise first_enhance before blaming blockswap.
    CategoryTaylorSeer

    Inputs (1)

    NameTypeDefaultDescription
    double_block_swapINT00–16Double block swap.

    Outputs (1)

    NameTypeDescription
    block_swap_argsBLOCKSWAPARGS