Spaces:
Running
Running
import comfy.sample as comfy_sample | |
from .sampling import motion_sample_factory | |
from .nodes_gen1 import (AnimateDiffLoaderGen1, LegacyAnimateDiffLoaderWithContext, AnimateDiffModelSettings, | |
AnimateDiffModelSettingsSimple, AnimateDiffModelSettingsAdvanced, AnimateDiffModelSettingsAdvancedAttnStrengths) | |
from .nodes_gen2 import UseEvolvedSamplingNode, ApplyAnimateDiffModelNode, ApplyAnimateDiffModelBasicNode, LoadAnimateDiffModelNode, ADKeyframeNode | |
from .nodes_multival import MultivalDynamicNode, MultivalScaledMaskNode | |
from .nodes_sample import (FreeInitOptionsNode, NoiseLayerAddWeightedNode, SampleSettingsNode, NoiseLayerAddNode, NoiseLayerReplaceNode, IterationOptionsNode, | |
CustomCFGNode, CustomCFGKeyframeNode) | |
from .nodes_sigma_schedule import (SigmaScheduleNode, RawSigmaScheduleNode, WeightedAverageSigmaScheduleNode, InterpolatedWeightedAverageSigmaScheduleNode, SplitAndCombineSigmaScheduleNode) | |
from .nodes_context import (LegacyLoopedUniformContextOptionsNode, LoopedUniformContextOptionsNode, LoopedUniformViewOptionsNode, StandardUniformContextOptionsNode, StandardStaticContextOptionsNode, BatchedContextOptionsNode, | |
StandardStaticViewOptionsNode, StandardUniformViewOptionsNode, ViewAsContextOptionsNode) | |
from .nodes_ad_settings import AnimateDiffSettingsNode, ManualAdjustPENode, SweetspotStretchPENode, FullStretchPENode | |
from .nodes_extras import AnimateDiffUnload, EmptyLatentImageLarge, CheckpointLoaderSimpleWithNoiseSelect | |
from .nodes_deprecated import AnimateDiffLoader_Deprecated, AnimateDiffLoaderAdvanced_Deprecated, AnimateDiffCombine_Deprecated | |
from .nodes_lora import AnimateDiffLoraLoader, MaskedLoraLoader | |
from .logger import logger | |
# override comfy_sample.sample with animatediff-support version | |
comfy_sample.sample = motion_sample_factory(comfy_sample.sample) | |
comfy_sample.sample_custom = motion_sample_factory(comfy_sample.sample_custom, is_custom=True) | |
NODE_CLASS_MAPPINGS = { | |
# Unencapsulated | |
"ADE_AnimateDiffLoRALoader": AnimateDiffLoraLoader, | |
"ADE_AnimateDiffSamplingSettings": SampleSettingsNode, | |
"ADE_AnimateDiffKeyframe": ADKeyframeNode, | |
# Multival Nodes | |
"ADE_MultivalDynamic": MultivalDynamicNode, | |
"ADE_MultivalScaledMask": MultivalScaledMaskNode, | |
# Context Opts | |
"ADE_StandardStaticContextOptions": StandardStaticContextOptionsNode, | |
"ADE_StandardUniformContextOptions": StandardUniformContextOptionsNode, | |
"ADE_LoopedUniformContextOptions": LoopedUniformContextOptionsNode, | |
"ADE_ViewsOnlyContextOptions": ViewAsContextOptionsNode, | |
"ADE_BatchedContextOptions": BatchedContextOptionsNode, | |
"ADE_AnimateDiffUniformContextOptions": LegacyLoopedUniformContextOptionsNode, # Legacy | |
# View Opts | |
"ADE_StandardStaticViewOptions": StandardStaticViewOptionsNode, | |
"ADE_StandardUniformViewOptions": StandardUniformViewOptionsNode, | |
"ADE_LoopedUniformViewOptions": LoopedUniformViewOptionsNode, | |
# Iteration Opts | |
"ADE_IterationOptsDefault": IterationOptionsNode, | |
"ADE_IterationOptsFreeInit": FreeInitOptionsNode, | |
# Noise Layer Nodes | |
"ADE_NoiseLayerAdd": NoiseLayerAddNode, | |
"ADE_NoiseLayerAddWeighted": NoiseLayerAddWeightedNode, | |
"ADE_NoiseLayerReplace": NoiseLayerReplaceNode, | |
# AnimateDiff Settings | |
"ADE_AnimateDiffSettings": AnimateDiffSettingsNode, | |
"ADE_AdjustPESweetspotStretch": SweetspotStretchPENode, | |
"ADE_AdjustPEFullStretch": FullStretchPENode, | |
"ADE_AdjustPEManual": ManualAdjustPENode, | |
# Sample Settings | |
"ADE_CustomCFG": CustomCFGNode, | |
"ADE_CustomCFGKeyframe": CustomCFGKeyframeNode, | |
"ADE_SigmaSchedule": SigmaScheduleNode, | |
"ADE_RawSigmaSchedule": RawSigmaScheduleNode, | |
"ADE_SigmaScheduleWeightedAverage": WeightedAverageSigmaScheduleNode, | |
"ADE_SigmaScheduleWeightedAverageInterp": InterpolatedWeightedAverageSigmaScheduleNode, | |
"ADE_SigmaScheduleSplitAndCombine": SplitAndCombineSigmaScheduleNode, | |
# Extras Nodes | |
"ADE_AnimateDiffUnload": AnimateDiffUnload, | |
"ADE_EmptyLatentImageLarge": EmptyLatentImageLarge, | |
"CheckpointLoaderSimpleWithNoiseSelect": CheckpointLoaderSimpleWithNoiseSelect, | |
# Gen1 Nodes | |
"ADE_AnimateDiffLoaderGen1": AnimateDiffLoaderGen1, | |
"ADE_AnimateDiffLoaderWithContext": LegacyAnimateDiffLoaderWithContext, | |
"ADE_AnimateDiffModelSettings_Release": AnimateDiffModelSettings, | |
"ADE_AnimateDiffModelSettingsSimple": AnimateDiffModelSettingsSimple, | |
"ADE_AnimateDiffModelSettings": AnimateDiffModelSettingsAdvanced, | |
"ADE_AnimateDiffModelSettingsAdvancedAttnStrengths": AnimateDiffModelSettingsAdvancedAttnStrengths, | |
# Gen2 Nodes | |
"ADE_UseEvolvedSampling": UseEvolvedSamplingNode, | |
"ADE_ApplyAnimateDiffModelSimple": ApplyAnimateDiffModelBasicNode, | |
"ADE_ApplyAnimateDiffModel": ApplyAnimateDiffModelNode, | |
"ADE_LoadAnimateDiffModel": LoadAnimateDiffModelNode, | |
# MaskedLoraLoader | |
#"ADE_MaskedLoadLora": MaskedLoraLoader, | |
# Deprecated Nodes | |
"AnimateDiffLoaderV1": AnimateDiffLoader_Deprecated, | |
"ADE_AnimateDiffLoaderV1Advanced": AnimateDiffLoaderAdvanced_Deprecated, | |
"ADE_AnimateDiffCombine": AnimateDiffCombine_Deprecated, | |
} | |
NODE_DISPLAY_NAME_MAPPINGS = { | |
# Unencapsulated | |
"ADE_AnimateDiffLoRALoader": "Load AnimateDiff LoRA ππ π ", | |
"ADE_AnimateDiffSamplingSettings": "Sample Settings ππ π ", | |
"ADE_AnimateDiffKeyframe": "AnimateDiff Keyframe ππ π ", | |
# Multival Nodes | |
"ADE_MultivalDynamic": "Multival Dynamic ππ π ", | |
"ADE_MultivalScaledMask": "Multival Scaled Mask ππ π ", | |
# Context Opts | |
"ADE_StandardStaticContextOptions": "Context OptionsβStandard Static ππ π ", | |
"ADE_StandardUniformContextOptions": "Context OptionsβStandard Uniform ππ π ", | |
"ADE_LoopedUniformContextOptions": "Context OptionsβLooped Uniform ππ π ", | |
"ADE_ViewsOnlyContextOptions": "Context OptionsβViews Only [VRAMβ] ππ π ", | |
"ADE_BatchedContextOptions": "Context OptionsβBatched [Non-AD] ππ π ", | |
"ADE_AnimateDiffUniformContextOptions": "Context OptionsβLooped Uniform ππ π ", # Legacy | |
# View Opts | |
"ADE_StandardStaticViewOptions": "View OptionsβStandard Static ππ π ", | |
"ADE_StandardUniformViewOptions": "View OptionsβStandard Uniform ππ π ", | |
"ADE_LoopedUniformViewOptions": "View OptionsβLooped Uniform ππ π ", | |
# Iteration Opts | |
"ADE_IterationOptsDefault": "Default Iteration Options ππ π ", | |
"ADE_IterationOptsFreeInit": "FreeInit Iteration Options ππ π ", | |
# Noise Layer Nodes | |
"ADE_NoiseLayerAdd": "Noise Layer [Add] ππ π ", | |
"ADE_NoiseLayerAddWeighted": "Noise Layer [Add Weighted] ππ π ", | |
"ADE_NoiseLayerReplace": "Noise Layer [Replace] ππ π ", | |
# AnimateDiff Settings | |
"ADE_AnimateDiffSettings": "AnimateDiff Settings ππ π ", | |
"ADE_AdjustPESweetspotStretch": "Adjust PE [Sweetspot Stretch] ππ π ", | |
"ADE_AdjustPEFullStretch": "Adjust PE [Full Stretch] ππ π ", | |
"ADE_AdjustPEManual": "Adjust PE [Manual] ππ π ", | |
# Sample Settings | |
"ADE_CustomCFG": "Custom CFG ππ π ", | |
"ADE_CustomCFGKeyframe": "Custom CFG Keyframe ππ π ", | |
"ADE_SigmaSchedule": "Create Sigma Schedule ππ π ", | |
"ADE_RawSigmaSchedule": "Create Raw Sigma Schedule ππ π ", | |
"ADE_SigmaScheduleWeightedAverage": "Sigma Schedule Weighted Mean ππ π ", | |
"ADE_SigmaScheduleWeightedAverageInterp": "Sigma Schedule Interpolated Mean ππ π ", | |
"ADE_SigmaScheduleSplitAndCombine": "Sigma Schedule Split Combine ππ π ", | |
# Extras Nodes | |
"ADE_AnimateDiffUnload": "AnimateDiff Unload ππ π ", | |
"ADE_EmptyLatentImageLarge": "Empty Latent Image (Big Batch) ππ π ", | |
"CheckpointLoaderSimpleWithNoiseSelect": "Load Checkpoint w/ Noise Select ππ π ", | |
# Gen1 Nodes | |
"ADE_AnimateDiffLoaderGen1": "AnimateDiff Loader ππ π β ", | |
"ADE_AnimateDiffLoaderWithContext": "AnimateDiff Loader [Legacy] ππ π β ", | |
"ADE_AnimateDiffModelSettings_Release": "[DEPR] Motion Model Settings ππ π β ", | |
"ADE_AnimateDiffModelSettingsSimple": "[DEPR] Motion Model Settings (Simple) ππ π β ", | |
"ADE_AnimateDiffModelSettings": "[DEPR] Motion Model Settings (Advanced) ππ π β ", | |
"ADE_AnimateDiffModelSettingsAdvancedAttnStrengths": "[DEPR] Motion Model Settings (Adv. Attn) ππ π β ", | |
# Gen2 Nodes | |
"ADE_UseEvolvedSampling": "Use Evolved Sampling ππ π β‘", | |
"ADE_ApplyAnimateDiffModelSimple": "Apply AnimateDiff Model ππ π β‘", | |
"ADE_ApplyAnimateDiffModel": "Apply AnimateDiff Model (Adv.) ππ π β‘", | |
"ADE_LoadAnimateDiffModel": "Load AnimateDiff Model ππ π β‘", | |
# MaskedLoraLoader | |
#"ADE_MaskedLoadLora": "Load LoRA (Masked) ππ π ", | |
# Deprecated Nodes | |
"AnimateDiffLoaderV1": "AnimateDiff Loader [DEPRECATED] ππ π ", | |
"ADE_AnimateDiffLoaderV1Advanced": "AnimateDiff Loader (Advanced) [DEPRECATED] ππ π ", | |
"ADE_AnimateDiffCombine": "AnimateDiff Combine [DEPRECATED, Use Video Combine (VHS) Instead!] ππ π ", | |
} | |