Visit ComfyUI Online for ready-to-use ComfyUI environment
Optimizes memory usage by swapping computational blocks between GPU and CPU for efficient video processing.
The HyVideoBlockSwap
node is designed to optimize memory usage during video processing by strategically swapping computational blocks between the GPU and CPU. This node is particularly beneficial for managing VRAM (Video Random Access Memory) consumption, which is crucial when working with high-resolution video data or when the available GPU memory is limited. By offloading certain blocks to the CPU, the node helps in balancing the load and ensuring smoother processing without overwhelming the GPU. This approach is especially useful in scenarios where multiple video processing tasks are running concurrently, as it allows for more efficient resource allocation and can prevent potential bottlenecks caused by memory constraints.
This parameter specifies the number of double blocks to be swapped from the GPU to the CPU. Double blocks typically involve more complex operations and thus consume more memory. By default, this value is set to 20, with a minimum of 0 and a maximum of 20. Adjusting this parameter allows you to control how many of these resource-intensive blocks are offloaded, which can significantly impact the node's performance and memory usage.
This parameter determines the number of single blocks to be swapped. Single blocks are generally less memory-intensive compared to double blocks. The default value is 0, with a range from 0 to 40. Increasing this value can help further reduce VRAM usage by offloading less critical operations to the CPU, thus freeing up GPU resources for more demanding tasks.
A boolean parameter that, when set to true, offloads the text input layer to the CPU. This can be useful if the text processing component of your video workflow is consuming a significant amount of GPU memory. The default setting is false, meaning the text input layer remains on the GPU unless specified otherwise.
Similar to offload_txt_in
, this boolean parameter controls whether the image input layer is offloaded to the CPU. Offloading the image input layer can be beneficial in scenarios where image processing is a major component of the workflow and is consuming substantial GPU resources. By default, this parameter is set to false.
The output parameter block_swap_args
provides a dictionary containing the arguments used for block swapping. This includes the number of double and single blocks swapped, as well as the offloading status of the text and image input layers. This output is crucial for understanding the current configuration of the node and can be used for debugging or further optimization of the video processing pipeline.
double_blocks_to_swap
parameter, as double blocks typically consume more resources. Gradually increase the number of blocks swapped until you achieve a balance between performance and memory usage.offload_txt_in
and offload_img_in
parameters to offload less critical components of your workflow to the CPU, freeing up GPU resources for more demanding tasks.double_blocks_to_swap
and single_blocks_to_swap
parameters. Additionally, consider enabling offload_txt_in
and offload_img_in
to further reduce GPU memory usage.double_blocks_to_swap
and single_blocks_to_swap
do not exceed the total number of double and single blocks in your model. Adjust these parameters accordingly.RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Playground, enabling artists to harness the latest AI tools to create incredible art.