57 lines
2.2 KiB
Markdown
57 lines
2.2 KiB
Markdown
# Sigma Schedule Weighted Mean 🎭🅐🅓
|
|
## Documentation
|
|
- Class name: ADE_SigmaScheduleWeightedAverage
|
|
- Category: Animate Diff 🎭🅐🅓/sample settings/sigma schedule
|
|
- Output node: False
|
|
- Repo Ref: https://github.com/Kosinkadink/ComfyUI-AnimateDiff-Evolved.git
|
|
|
|
此节点旨在通过计算两个提供的sigma计划的加权平均值来创建一个新的sigma计划。它允许根据指定的加权因子将两个计划的特性混合成一个新的计划。
|
|
|
|
## Input types
|
|
### Required
|
|
- schedule_A
|
|
- 第一个要混合的sigma计划。它是加权平均计算的基础之一。
|
|
- Comfy dtype: SIGMA_SCHEDULE
|
|
- Python dtype: SigmaSchedule
|
|
- schedule_B
|
|
- 第二个与第一个混合的sigma计划。它为加权平均计算做出贡献,补充第一个计划。
|
|
- Comfy dtype: SIGMA_SCHEDULE
|
|
- Python dtype: SigmaSchedule
|
|
- weight_A
|
|
- 第一个sigma计划的加权因子。它决定了第一个计划在最终混合计划中的特性比例。
|
|
- Comfy dtype: FLOAT
|
|
- Python dtype: float
|
|
|
|
## Output types
|
|
- sigma_schedule
|
|
- Comfy dtype: SIGMA_SCHEDULE
|
|
- 根据指定的加权因子混合两个输入计划后的结果sigma计划。
|
|
- Python dtype: SigmaSchedule
|
|
|
|
## Usage tips
|
|
- Infra type: CPU
|
|
- Common nodes: unknown
|
|
|
|
## Source code
|
|
```python
|
|
class WeightedAverageSigmaScheduleNode:
|
|
@classmethod
|
|
def INPUT_TYPES(s):
|
|
return {
|
|
"required": {
|
|
"schedule_A": ("SIGMA_SCHEDULE",),
|
|
"schedule_B": ("SIGMA_SCHEDULE",),
|
|
"weight_A": ("FLOAT", {"default": 0.5, "min": 0.0, "max": 1.0, "step": 0.001}),
|
|
}
|
|
}
|
|
|
|
RETURN_TYPES = ("SIGMA_SCHEDULE",)
|
|
CATEGORY = "Animate Diff 🎭🅐🅓/sample settings/sigma schedule"
|
|
FUNCTION = "get_sigma_schedule"
|
|
|
|
def get_sigma_schedule(self, schedule_A: SigmaSchedule, schedule_B: SigmaSchedule, weight_A: float):
|
|
validate_sigma_schedule_compatibility(schedule_A, schedule_B)
|
|
new_sigmas = schedule_A.model_sampling.sigmas * weight_A + schedule_B.model_sampling.sigmas * (1-weight_A)
|
|
combo_schedule = schedule_A.clone()
|
|
combo_schedule.model_sampling.set_sigmas(new_sigmas)
|
|
return (combo_schedule,) |