Save 4 hours! We auto-setup your workflow! Free!

Drop your workflow.json — we handle every dependency, custom node, and model. Just open the link and run.

Auto-Setup Workflow Json (Free) Now!
ComfyUI > Nodes > XB_ToolBox > XB-BOX - Checkpoint Block Swap

ComfyUI Node: XB-BOX - Checkpoint Block Swap

Class Name

XB_CheckpointBlockSwap

Category
XB_ToolBox/VRAM_Hacks
Author
WJLUOXIAO (Account age: 324days)
Extension
XB_ToolBox
Latest Updated
2026-05-19
Github Stars
0.04K

How to Install XB_ToolBox

Install this extension via the ComfyUI Manager by searching for XB_ToolBox
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter XB_ToolBox in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

XB-BOX - Checkpoint Block Swap Description

Enhances model execution by dynamically swapping blocks between devices for efficient resource management.

XB-BOX - Checkpoint Block Swap:

The XB_CheckpointBlockSwap node is designed to enhance the flexibility and efficiency of model execution by allowing dynamic swapping of model blocks between devices. This node is particularly useful in scenarios where memory management is crucial, such as when working with large models or limited VRAM resources. By enabling the swapping of specific blocks of a model to different devices, it optimizes the use of available hardware resources, ensuring smoother and more efficient model execution. The node automatically detects if the dynamic VRAM flag is used and adjusts its behavior accordingly, providing a seamless experience for users. This capability is essential for AI artists who need to manage computational resources effectively while working on complex projects.

XB-BOX - Checkpoint Block Swap Input Parameters:

checkpoint_model

The checkpoint_model parameter represents the model that is subject to block swapping. It is crucial for the node's operation as it determines which model's blocks will be swapped between devices. This parameter must be an instance of ModelPatcher, ensuring that the model is compatible with the swapping mechanism. The node will not proceed if this condition is not met, highlighting the importance of providing a correctly patched model.

blocks_to_swap

The blocks_to_swap parameter specifies the number of blocks within the model that should be swapped to a different device. This parameter directly impacts the node's execution by determining how many blocks are offloaded to manage VRAM usage effectively. The choice of this parameter should be based on the available hardware resources and the specific requirements of the task at hand.

offload_txt_emb

The offload_txt_emb parameter indicates whether the text embeddings should be offloaded during the block swapping process. This option is beneficial when working with models that include text processing components, as it allows for more efficient memory management by offloading less critical components.

offload_img_emb

The offload_img_emb parameter functions similarly to offload_txt_emb, but it applies to image embeddings. By enabling this option, users can offload image-related components, optimizing memory usage and potentially improving performance when dealing with image-heavy models.

use_non_blocking

The use_non_blocking parameter determines whether non-blocking operations should be used during the block swapping process. Non-blocking operations can enhance performance by allowing other processes to continue executing while waiting for the swap to complete. This parameter is particularly useful in environments where maximizing throughput is a priority.

XB-BOX - Checkpoint Block Swap Output Parameters:

checkpoint_model

The output checkpoint_model is the modified version of the input model, with specified blocks swapped to different devices as per the input parameters. This output is crucial as it represents the optimized model ready for execution, reflecting the changes made to enhance memory management and performance.

XB-BOX - Checkpoint Block Swap Usage Tips:

  • Ensure that the checkpoint_model is an instance of ModelPatcher to avoid execution errors and ensure compatibility with the block swapping mechanism.
  • Adjust the blocks_to_swap parameter based on your available VRAM and the complexity of the model to optimize performance and resource usage.
  • Consider enabling offload_txt_emb and offload_img_emb if your model includes text or image components, respectively, to further enhance memory management.

XB-BOX - Checkpoint Block Swap Common Errors and Solutions:

"Model is not an instance of ModelPatcher"

  • Explanation: This error occurs when the provided checkpoint_model is not compatible with the block swapping mechanism.
  • Solution: Ensure that the model is correctly patched and is an instance of ModelPatcher before using it with this node.

"Detected parameter [--enable-dynamic-vram], block swap node auto-sleeping"

  • Explanation: The node detected that the dynamic VRAM flag is enabled, which may conflict with its operation.
  • Solution: Consider disabling the dynamic VRAM flag if you wish to use the block swapping feature, or acknowledge that the node will not perform swaps in this mode.

XB-BOX - Checkpoint Block Swap Related Nodes

Go back to the extension to check out more related nodes.
XB_ToolBox
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.

XB-BOX - Checkpoint Block Swap