← See All Custom Node Packs

comfyui-animatediff

734

Run ComfyUI Easily with InstaSD

Skip the complex setup. InstaSD helps creative professionals build workflows and deploy them to the world:

  • One-click deployment
  • Any model, any node
  • Powerful GPUs for rapid iteration
Get Started

AnimateDiffSampler

AnimateDiffSampler Node Documentation

Overview

The AnimateDiffSampler node is a part of the AnimateDiff integration for ComfyUI, a graphical user interface designed to facilitate the creation of animated graphics. This particular node extends the functionalities of traditional samplers like KSampler, allowing users to generate animations by applying motion modules on latent images. It is a central component for creating animated sequences from static prompts using advanced motion synthesis techniques.

Functionality

The AnimateDiffSampler node serves as a tool that incorporates motion dynamics into static images, allowing for the creation of frame sequences that can be compiled into an animation such as a GIF or video. By leveraging motion modules loaded through the AnimateDiffLoader, it can generate multi-frame outputs that visualize movement and dynamics derived from the original static content.

Inputs

The AnimateDiffSampler node accepts the following inputs:

  1. motion_module: This is a required input that takes a motion module loaded using the AnimateDiffLoader. The motion module provides the parameters and models required to introduce motion into the static images.

  2. inject_method: This input should be left at its default setting. It is used internally to determine how motion is integrated.

  3. frame_number: Specifies the length of the animation in terms of the number of frames. This input controls how many frames will be generated.

  4. latent_image: Accepts a latent image, such as an EmptyLatentImage, which serves as the base or canvas over which motion is applied.

  5. sliding_window_opts: Allows for customizing sliding window options, if applicable. Sliding windows can be used to generate animations larger than a specific frame limit by dynamically partitioning the sequence.

Outputs

The AnimateDiffSampler node produces a multi-frame output, which is essentially a series of images that can be combined into an animation. Each frame represents a step in the motion synthesis from the input latent image.

Usage in ComfyUI Workflows

In ComfyUI workflows, the AnimateDiffSampler node is employed to generate animated sequences from static images and textual prompts. It is typically used in conjunction with other nodes like AnimateDiffLoader and AnimateDiffCombine to create and process motion modules and compile the final animation.

Example Workflows

  • Basic Animation Workflow: Start with a static image or prompt, load a motion module using AnimateDiffLoader, then use AnimateDiffSampler to generate the frame sequence. Finally, use AnimateDiffCombine to compile the frames into a GIF or other animation formats.

  • Advanced Workflow with Sliding Window: For longer animations that exceed typical frame-length limitations, incorporate SlidingWindowOptions to manage the partitioning of the frame sequence for efficient processing.

Special Features and Considerations

  • Frame Management: The frame_number input allows for precise control over the length of the animation, making it easier to fit specific time constraints or artistic goals.

  • Dynamic Integration: By pairing with motion_module, the node dynamically integrates motion into static content, turning it into an animated sequence.

  • Sliding Window: When generating more than 16 frames, the sliding window feature is automatically activated, helping manage computational resources and ensuring smooth transitions in longer animations.

  • Compatibility: Ensure that the correct motion module version is used, as LoRAs are only compatible with AnimateDiff v2 modules.

This documentation provides a comprehensive understanding of the AnimateDiffSampler node, with insights into its inputs, outputs, typical usage, and features, enabling users to effectively utilize it within ComfyUI for creating dynamic animations.