ComfyUI Image to Video icon

ComfyUI Image to Video

Convert images to videos using ComfyUI workflow

Overview

This node converts images into videos using a ComfyUI workflow. It uploads an input image to the ComfyUI API, injects it into a user-provided JSON workflow, triggers video generation, and waits for the process to complete within a specified timeout. Once done, it retrieves the generated video or animation output and returns it.

Common scenarios include:

  • Creating animated videos from static images using AI-driven workflows.
  • Automating video content generation in creative pipelines.
  • Integrating ComfyUI's image-to-video capabilities into larger automation workflows.

Example: You provide a ComfyUI workflow JSON that defines how to transform an image into a video sequence. The node uploads your input image (from URL, base64, or binary), runs the workflow, and outputs the resulting video file.

Properties

Name Meaning
Workflow JSON The ComfyUI workflow definition in JSON format. This controls how the image is processed into a video.
Input Type Specifies the format of the input image. Options: URL (image fetched from a web address), Base64 (image data encoded as base64 string), Binary (image data from incoming binary property).
Input Image The actual input image data, either a URL or base64 string. Required if Input Type is url or base64.
Binary Property The name of the binary property containing the image data when Input Type is binary. Defaults to "data".
Timeout Maximum time in minutes to wait for the video generation to complete before timing out. Default is 30 minutes.

Output

The node outputs a single item with the following structure:

  • json:

    • mimeType: MIME type of the output media (e.g., video/mp4, image/webp, image/gif).
    • fileName: The filename of the generated video or animation.
    • data: Base64-encoded string of the video/image content.
    • status: Status object returned by ComfyUI about the generation process.
  • binary:

    • data: Contains the raw binary data of the generated video or animation.
    • Additional metadata such as fileName, fileType (always "video"), fileSize (approximate size in kB), fileExtension (e.g., mp4, webp, gif), and mimeType.

This allows downstream nodes to access both the metadata and the actual video content for further processing or saving.

Dependencies

  • Requires connection to a ComfyUI API endpoint with valid credentials including an API URL and optionally an API key for authentication.
  • The node uses HTTP requests to interact with the ComfyUI API for uploading images, submitting workflows, checking status, and downloading results.
  • Requires n8n helper functions for HTTP requests and binary data handling.
  • The ComfyUI API must support endpoints /system_stats, /upload/image, /prompt, and /history/{prompt_id}.

Troubleshooting

  • Invalid workflow JSON: If the provided workflow JSON is malformed or not a valid object, the node throws an error. Ensure the JSON syntax is correct and the workflow contains a LoadImage node with an image input.
  • No LoadImage node found: The workflow must contain a node that loads the input image; otherwise, the node will fail.
  • Binary property missing or invalid: When using binary input, if the specified binary property does not exist or is not an image, the node tries to find an alternative image property. If none found, it errors out.
  • Video generation timeout: If the video is not generated within the specified timeout, the node throws a timeout error. Increase the timeout if needed.
  • API errors: Network issues, invalid API keys, or server errors from ComfyUI will cause the node to throw errors with messages prefixed by "ComfyUI API Error".
  • Output media not found: If no video or animation files are found in the results, the node reports an error.

Links and References

Discussion