Patch WanVideo model to use TeaCache. Speeds up inference by caching the output and
applying it instead of doing the step. Best results are achieved by choosing the
appropriate coefficients for the model. Early steps should never be skipped, with too
aggressive values this can happen and the motion suffers. Starting later can help with that too.
When NOT using coefficients, the threshold value should be
about 10 times smaller than the value used with coefficients.
explain to me what this value about
my model is Wan2.1 i2v 480P
Assistant
User
so I just type 0.13 for low?
Assistant
Yes, if you want to set the caching mechanism to the low aggressiveness level for the Wan2.1 i2v 480P model, you would configure it to use a coefficient of 0.13. This value is the recommended setting for a conservative approach that prioritizes the preservation of motion quality while still providing some speed enhancement through caching.
When you implement this option, keep an eye on the inference performance and the quality of the output to ensure it meets your expectations. If you later decide you want to experiment with different caching aggressiveness levels, you can try adjusting the coefficient to 0.19 for medium or 0.26 for high, depending on your needs for speed versus quality.
User
what is this mean "When NOT using coefficients, the threshold value should be
about 10 times smaller than the value used with coefficients."
Assistant
The statement "When NOT using coefficients, the threshold value should be about 10 times smaller than the value used with coefficients" refers to an alternative way to manage the caching mechanism in the TeaCache when you decide not to use the coefficient values provided.
Explanation:
Coefficients vs. Without Coefficients:
When you set coefficients (like , , or ), you're specifying how aggressive the caching should be and how many steps can potentially be skipped during inference while still maintaining some degree of quality.
User
can you explain using kid langauge
Assistant
Sure! Let’s break it down simply.
What Are Coefficients?
Imagine you have a magic box (your model) that helps you make videos. Sometimes, the box can be really quick, but sometimes it takes longer because it has to think hard to make everything look good.
Coefficients are like the settings on a dial that control how fast the box works. You have three settings to choose from:
Low (0.13): The box takes its time, but it makes sure everything looks nice.
Medium (0.19): The box is faster but still cares about how things look.
User
I want to choose medium setting, so what should I type, no need to explain, just answer
Assistant
You should type 0.19 for the medium setting.
User
thanks
Assistant
You're welcome! If you have any more questions, feel free to ask!
The values you see in the table represent the recommended coefficients for optimizing the inference speed of the Wan2.1 i2v 480P model when using TeaCache. These coefficients influence the caching mechanism, which aims to improve the inference performance by reusing previously computed outputs instead of recalculating them for similar inputs. Here's a breakdown of what these values mean and how to interpret them:
Model and Settings Overview
Model: The model you are using is Wan2.1 i2v 480P, which likely refers to a specific version of a video processing model designed for inputs at a resolution of 480 pixels in height.
Coefficient Values: The values listed in the table (Low, Medium, High) correspond to different levels of aggressiveness in caching. These coefficients determine how the model handles inference caching—whether it decides to skip certain computational steps based on previous results.
Coefficient Ranges
Low (0.13): This value means that the caching mechanism will be less aggressive. Early steps in the inference will generally be retained, ensuring that you maintain high motion quality, but it may not significantly speed up the inference time.
Medium (0.19): At this level, the caching becomes moderately aggressive. It aims to balance speed and quality, potentially skipping some computations later in the inference process while still preserving key early steps for motion fidelity.
High (0.26): This aggressive caching setting aims to speed up the computation considerably, but it may risk skipping critical early steps. While this can improve speed, it has the potential to impact the motion quality negatively if not managed properly.
Recommended Caching Strategy
Choosing Coefficients: The best approach to select a coefficient depends on the specific needs of your use case, such as the acceptable trade-off between speed and quality. If high-quality motion is critical, using lower coefficients would be advisable. If inference speed is a priority and you can tolerate some quality loss, you might experiment with higher coefficients.
Threshold Setting: If you decide not to use coefficients, the threshold values for skipping computations should be approximately ten times smaller than those used with coefficients. However, you should still prioritize early steps to maintain motion quality.
Conclusion
For the Wan2.1 i2v 480P model, you can use the recommended coefficients (0.13 for low, 0.19 for medium, 0.26 for high) to adjust how aggressive the caching is, depending on your performance needs and quality requirements. Always consider that too aggressive caching can negatively affect the motion quality, especially if you skip important early steps. Therefore, it is advisable to test different coefficients to find the right balance for your specific application.
0.13
0.19
0.26
If you choose not to use these coefficients, you still need a mechanism to control how caching works; this is where the threshold comes into play.
Threshold Values:
The threshold value acts as a cutoff level that determines whether to reuse cached outputs or to compute new results.
The recommendation is to set this threshold about 10 times smaller than the corresponding coefficient if you were using one. For example:
If you were using a coefficient value of 0.13 (for low aggressiveness), when not using coefficients, you should set your threshold to about 0.013.
If you were using 0.19 (for medium), then your threshold would be around 0.019.
For 0.26 (high), then the threshold should be about 0.026.
Why This Matters:
This guidance suggests that not using coefficients will likely lead to a different behavior of the caching mechanism, and the threshold needs to be set such that it compensates appropriately. A smaller threshold means the model will be less likely to skip computations, which helps maintain quality, but it gives you a way to control performance without the more nuanced adjustments that coefficients would provide.
In summary, if you're not utilizing the coefficients, you need to define a threshold that is approximately 10 times smaller than what you'd use with a coefficient. This helps ensure a balance, aiming for good quality output without completely sidelining the purpose of caching.
High (0.26): The box is super quick but might skip some details that can make it less smooth.
What Is a Threshold?
Now, when you don’t want to use those special settings (coefficients), you need to set a threshold. Think of this as a guideline or a rule for how the box should work when it decides to reuse old information instead of creating new stuff from scratch.
The Rule About the Threshold
The rule says that when you don't use the coefficients settings, your threshold number should be 10 times smaller than the number you would have used if you had picked a coefficient.
Example:
If you picked the low setting (0.13), when you don’t use the coefficient, you would set the threshold to 0.013 (which is very small).
If you picked the medium setting (0.19), the threshold would be 0.019.
If you picked the high setting (0.26), then the threshold is 0.026.
Why Smaller is Better Here
Making the threshold smaller means your magic box will still think carefully about how to make everything look good. It won’t skip too much important work, and it will try to keep the video nice even without the fast settings.
So, when you choose not to use the coefficient, you need to set your threshold lower, so the box does a good job without rushing and messing things up!