🐳WanVideo Resource Cleaner:
The WanVideoResourceCleaner is a specialized node designed to optimize the performance and resource management of video processing models within the ComfyUI framework. Its primary purpose is to ensure that the computational resources are efficiently utilized by cleaning up various states and caches associated with video models, particularly those using diffusion models. This node is crucial for maintaining the smooth operation of video processing tasks by offloading unnecessary data to appropriate devices, clearing caches, and managing memory effectively. By doing so, it helps prevent memory leaks and ensures that the system remains responsive, even when handling complex video transformations. The node also provides options for more aggressive resource management, such as forcing garbage collection and unloading models, which can be particularly beneficial in environments with limited resources.
🐳WanVideo Resource Cleaner Input Parameters:
any_input
This parameter represents the input object that the node will process. It is expected to be a model or an object containing a model with a diffusion model attribute. The node uses this parameter to identify and manage the resources associated with the model, such as clearing block swap states and caches. There are no specific minimum, maximum, or default values for this parameter, as it is dependent on the model being used.
clear_cache
This boolean parameter determines whether the CUDA cache should be cleared. When set to True, it triggers the clearing of the CUDA cache, which can help free up GPU memory and improve performance. The default value is typically False, meaning the cache is not cleared unless explicitly specified.
force_gc
This boolean parameter controls whether garbage collection should be forced. Enabling this option (True) will initiate a garbage collection process to reclaim memory that is no longer in use, which can be useful in preventing memory leaks. The default value is usually False.
unload_model
This boolean parameter specifies whether the model should be completely unloaded from memory. When set to True, it unloads all models and cleans up associated resources, moving the transformer to the CPU if necessary. This can be beneficial in scenarios where memory conservation is critical. The default value is generally False.
🐳WanVideo Resource Cleaner Output Parameters:
The WanVideoResourceCleaner node does not explicitly define output parameters in the provided context. Its primary function is to manage resources and optimize memory usage, which indirectly affects the performance and responsiveness of the system rather than producing direct output values.
🐳WanVideo Resource Cleaner Usage Tips:
- Use the
clear_cacheoption when you notice that GPU memory is being heavily utilized, as this can help free up resources and improve performance. - Enable
force_gcin environments where memory leaks are a concern, as it can help reclaim unused memory and prevent system slowdowns. - Consider setting
unload_modeltoTruewhen working with limited memory resources or when you need to switch between different models frequently to ensure that memory is efficiently managed.
🐳WanVideo Resource Cleaner Common Errors and Solutions:
Model attribute error
- Explanation: This error occurs when the input object does not have the expected model attributes, such as
diffusion_model. - Solution: Ensure that the input object is a valid model or contains a model with the necessary attributes before passing it to the node.
CUDA out of memory
- Explanation: This error indicates that the GPU memory is insufficient for the current operation.
- Solution: Try enabling the
clear_cacheoption to free up GPU memory, or consider reducing the model size or complexity.
Garbage collection not effective
- Explanation: This issue arises when forced garbage collection does not reclaim the expected amount of memory.
- Solution: Verify that
force_gcis enabled and consider unloading models withunload_modelto further reduce memory usage.
