ComfyUI Dual Image Video Generator icon

ComfyUI Dual Image Video Generator

πŸ–ΌοΈπŸ–ΌοΈβž‘οΈπŸŽ¬ Generate video from two image inputs using ComfyUI workflows (AnimateDiff, motion generation, interpolation)

Overview

This node generates a video by interpolating between two input images using a ComfyUI workflow designed for motion generation or animation (e.g., AnimateDiff). It uploads the two images to a ComfyUI server, modifies the provided workflow JSON to include these images in specified LoadImage nodes, sets video parameters like frame count and frame rate, then queues the video generation task on the ComfyUI API. The node polls the API until the video is ready or a timeout occurs, then returns the generated video.

Common scenarios:

  • Creating smooth animated transitions between two images.
  • Generating short videos from still images using AI-based interpolation.
  • Using custom ComfyUI workflows for advanced video synthesis.

Practical example:
You have two concept art images and want to create an animation morphing from the first to the second. You provide these images and a compatible ComfyUI workflow JSON with two LoadImage nodes, specify frame count and rate, and get back a video file showing the transition.

Properties

Name Meaning
Workflow JSON The ComfyUI workflow in JSON format. Must contain two LoadImage nodes for the two input images.
First Image Input Type How the first image is provided: URL, Base64 string, or binary data.
First Input Image URL or base64 data of the first input image (shown if input type is URL or Base64).
First Image Binary Property Name of the binary property containing the first image (shown if input type is binary).
Second Image Input Type How the second image is provided: URL, Base64 string, or binary data.
Second Input Image URL or base64 data of the second input image (shown if input type is URL or Base64).
Second Image Binary Property Name of the binary property containing the second image (shown if input type is binary).
First Image Node ID Node ID in the workflow JSON corresponding to the first LoadImage node to update with the first image.
Second Image Node ID Node ID in the workflow JSON corresponding to the second LoadImage node to update with the second image.
Video Frame Count Number of frames to generate for the output video.
Video Frame Rate Frame rate (frames per second) for the output video.
Timeout Maximum time in minutes to wait for the video generation before failing.

Output

The node outputs one item containing:

  • json:

    • mimeType: MIME type of the generated video (e.g., "video/mp4", "image/gif").
    • fileName: Filename of the generated video.
    • data: Base64-encoded video content.
    • status: Status object from ComfyUI indicating completion.
    • frameCount: Number of frames generated.
    • frameRate: Frame rate used.
    • duration: Duration of the video in seconds (frameCount / frameRate).
    • inputImages: Object with filenames of the uploaded first and second input images.
  • binary:

    • Contains the actual video file data under a property named data, including metadata such as filename, file size, file extension, and MIME type.

This allows downstream nodes to access the video either as base64 JSON data or as binary data for saving or further processing.

Dependencies

  • Requires a running ComfyUI server with its API accessible.
  • Needs an API key credential for authenticating requests to the ComfyUI API.
  • Uses HTTP requests to upload images, submit workflows, and poll for results.
  • Requires the workflow JSON to be compatible with ComfyUI and contain two LoadImage nodes identified by user-specified IDs.

Troubleshooting

  • Invalid workflow JSON: If the workflow JSON is malformed or not an object, the node throws an error. Ensure valid JSON syntax and structure.
  • Missing LoadImage nodes: If the specified LoadImage node IDs are not found or do not correspond to LoadImage nodes, errors occur. Verify node IDs in the workflow.
  • Image binary property not found: When using binary input types, if the specified binary property does not exist or does not contain image data, the node tries alternative properties but may fail. Check that the binary input contains valid image data.
  • API connection issues: Failure to connect or authenticate with the ComfyUI API will cause errors. Confirm API URL and API key correctness.
  • Timeouts: If video generation takes longer than the specified timeout, the node fails with a timeout error. Increase timeout or check server performance.
  • No video outputs found: If the ComfyUI response does not contain any recognized video or GIF outputs, the node throws an error. Make sure the workflow produces video outputs.
  • Video file not found: If the generated video file cannot be retrieved from the ComfyUI server, an error is thrown.

Links and References

Discussion