Skip to content

AnimateDiff-PIA Keyframe 🎭🅐🅓

Documentation

  • Class name: ADE_PIA_AnimateDiffKeyframe
  • Category: Animate Diff 🎭🅐🅓/② Gen2 nodes ②/PIA
  • Output node: False

This node is designed for creating and managing keyframes within the AnimateDiff-PIA framework, specifically tailored for PIA (Pose Interpolation Animation) inputs. It facilitates the dynamic adjustment of animation parameters over time, enabling users to define specific animation behaviors at different points in the animation sequence.

Input types

Required

  • start_percent
    • Specifies the starting point of the keyframe as a percentage of the total animation duration, allowing for precise timing control within the animation sequence.
    • Comfy dtype: FLOAT
    • Python dtype: float

Optional

  • prev_ad_keyframes
    • An optional list of previous ADKeyframes to be considered in the animation sequence, enabling the chaining and layering of animation effects.
    • Comfy dtype: AD_KEYFRAMES
    • Python dtype: ADKeyframeGroup or None
  • scale_multival
    • A multiplier for scaling effects, applicable to the keyframe. It can be a single value or vary over time if provided as a tensor. This input directly influences the visual scale of animated elements, affecting the node's execution by adjusting the size of elements within the keyframe.
    • Comfy dtype: MULTIVAL
    • Python dtype: Union[float, torch.Tensor] or None
  • effect_multival
    • A multiplier for effect intensities, applicable to the keyframe. It can be a single value or vary over time if provided as a tensor. This input modifies the intensity of specified effects in the animation, impacting the node's execution by altering how pronounced these effects are within the keyframe.
    • Comfy dtype: MULTIVAL
    • Python dtype: Union[float, torch.Tensor] or None
  • pia_input
    • Specifies the PIA input settings for the keyframe, allowing for detailed control over the animation's pose interpolation aspects.
    • Comfy dtype: PIA_INPUT
    • Python dtype: InputPIA or None
  • inherit_missing
    • Determines whether missing values for scale, effect, and camera control effects should be inherited from previous keyframes, ensuring continuity in the animation.
    • Comfy dtype: BOOLEAN
    • Python dtype: bool
  • guarantee_steps
    • The minimum number of steps to guarantee for the keyframe, ensuring that certain animation effects are applied for at least a specified duration.
    • Comfy dtype: INT
    • Python dtype: int

Output types

  • ad_keyframes
    • Comfy dtype: AD_KEYFRAMES
    • Outputs a sequence of ADKeyframes, incorporating the newly created or modified keyframe into the animation sequence.
    • Python dtype: ADKeyframeGroup

Usage tips

  • Infra type: CPU
  • Common nodes: unknown

Source code

class PIA_ADKeyframeNode:
    @classmethod
    def INPUT_TYPES(s):
        return {
            "required": {
                "start_percent": ("FLOAT", {"default": 0.0, "min": 0.0, "max": 1.0, "step": 0.001}, ),
            },
            "optional": {
                "prev_ad_keyframes": ("AD_KEYFRAMES", ),
                "scale_multival": ("MULTIVAL",),
                "effect_multival": ("MULTIVAL",),
                "pia_input": ("PIA_INPUT",),
                "inherit_missing": ("BOOLEAN", {"default": True}, ),
                "guarantee_steps": ("INT", {"default": 1, "min": 0, "max": BIGMAX}),
            }
        }

    RETURN_TYPES = ("AD_KEYFRAMES", )
    FUNCTION = "load_keyframe"

    CATEGORY = "Animate Diff 🎭🅐🅓/② Gen2 nodes ②/PIA"

    def load_keyframe(self,
                      start_percent: float, prev_ad_keyframes=None,
                      scale_multival: Union[float, torch.Tensor]=None, effect_multival: Union[float, torch.Tensor]=None,
                      pia_input: InputPIA=None,
                      inherit_missing: bool=True, guarantee_steps: int=1):
        return ADKeyframeNode.load_keyframe(self,
                    start_percent=start_percent, prev_ad_keyframes=prev_ad_keyframes,
                    scale_multival=scale_multival, effect_multival=effect_multival, pia_input=pia_input,
                    inherit_missing=inherit_missing, guarantee_steps=guarantee_steps
                )