ComfyUI-WanVideoWrapper
Run ComfyUI Easily with InstaSD
Skip the complex setup and run ComfyUI online. InstaSD helps creative professionals build workflows and deploy them to the world:
- One-click deployment
- Any model, any node
- Powerful GPUs for rapid iteration
Available Nodes
WanVideoTeaCache
Documentation for WanVideoTeaCache Node
Overview
The WanVideoTeaCache node is part of the ComfyUI framework, specifically within the WanVideoWrapper category. This node is designed to enhance the performance of video models like WanVideo by utilizing TeaCache, a caching mechanism that improves inference speed. The node does this by temporarily storing the results of specific computations and reusing them in later stages, reducing the need for repeated calculations.
Functionality
The WanVideoTeaCache node is used to patch the WanVideo model, making its inference process faster and more efficient. It achieves this by caching the output of certain steps and then reapplying these cached results instead of recalculating them, thus speeding up the entire process.
Input Parameters
The node requires the following inputs to function effectively:
-
rel_l1_thresh (FLOAT)
- Description: Determines how aggressively caching is applied. Higher values increase speed but may risk introducing artifacts.
- Default Value: 0.3
- Range: 0.0 to 1.0
- Usage Tip: Good value ranges vary by model size. For a 1.3B model, use 0.05 - 0.08, and for other models, use 0.15 - 0.30.
-
start_step (INT)
- Description: The step percentage at which the TeaCache begins to be applied.
- Default Value: 1
- Allowed Range: 0 to 9999
-
end_step (INT)
- Description: The step at which the TeaCache stops being applied.
- Default Value: -1
- Allowed Range: -1 to 9999
-
cache_device
- Description: Specifies which device to use for caching.
- Options: "main_device", "offload_device"
- Default Value: "offload_device"
-
use_coefficients (BOOLEAN)
- Description: Decides whether to use calculated coefficients for improved accuracy. When activated, the
rel_l1_threshvalue should be around 10 times higher than if not using coefficients. - Default Value: True
- Description: Decides whether to use calculated coefficients for improved accuracy. When activated, the
-
mode
- Optional Parameter
- Description: Decides between using time embeds ("e") or modulated time embeds ("e0") for the caching process.
- Options: "e", "e0"
- Default Value: "e"
Output
The node outputs a single type, CACHEARGS, which includes all the necessary parameters for the caching process. This output serves as a configuration for applying TeaCache to the video model.
Usage in ComfyUI Workflows
In a ComfyUI workflow, the WanVideoTeaCache node can be used to optimize video models by leveraging the caching capabilities of TeaCache. By inputting the desired parameters, users can control the aggressiveness of caching, the steps at which it is applied, and which device executes the caching process. This node is particularly useful in scenarios where rapid inference speeds are needed without sacrificing accuracy.
Special Features and Considerations
-
Aggressiveness vs. Artifacts: While increasing the
rel_l1_threshvalue can speed up inference, it might introduce visual artifacts. Careful tuning based on recommended values is essential for balancing speed and quality. -
Timing of Cache Application: Early steps in the process should generally not be skipped, as this can negatively impact the motion quality of the video. Adjusting
start_stepandend_stepcan help manage this concern effectively. -
Using Coefficients: When
use_coefficientsis enabled, be sure to adjustrel_l1_threshaccordingly to ensure maximum accuracy in the caching process. -
Device Selection: The choice between the "main_device" and "offload_device" can affect both performance and operational efficiency based on the underlying hardware.
For more official recommendations regarding value settings, visit the TeaCache GitHub page.