ComfyUI Single Image To Video icon

ComfyUI Single Image To Video

๐Ÿ–ผ๏ธโžก๏ธ๐ŸŽฌ Generate video from a single image input using ComfyUI workflows (image-to-video, animation, motion generation)

Overview

This node generates a video from a single input image using ComfyUI workflows designed for image-to-video, animation, or motion generation. It uploads the input image to the ComfyUI server, modifies the provided workflow JSON to include this image in the specified LoadImage node, adjusts frame count and rate parameters in relevant nodes, 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 file.

Common scenarios:

  • Creating short animated videos or motion effects starting from a single still image.
  • Generating video content for social media or creative projects where an image is transformed into dynamic visuals.
  • Automating video generation workflows integrated with ComfyUIโ€™s advanced animation nodes.

Practical example:
You provide a ComfyUI workflow JSON that includes nodes for loading an image and animating it. You supply an input image URL or binary data, specify how many frames and what frame rate you want, and the node outputs a video file (e.g., MP4) showing the animation generated by ComfyUI.


Properties

Name Meaning
Workflow JSON The ComfyUI workflow in JSON format. Must contain a LoadImage node for video generation.
Image Input Type How the input image is provided: URL, Base64 string, or Binary data from previous node input.
Input Image The image data as a URL or Base64 string (shown if Image Input Type is URL or Base64).
Image Binary Property The name of the binary property containing the image (shown if Image Input Type is Binary).
Image Node ID The node ID in the workflow JSON corresponding to the LoadImage node where the input image will be set.
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 video generation before timing out.

Output

The node outputs JSON and binary data representing the generated video:

  • json:

    • mimeType: MIME type of the video/image file (e.g., video/mp4, image/gif).
    • fileName: Filename of the generated video.
    • data: Base64-encoded string of the video file content.
    • status: Status object returned from ComfyUI about the generation.
    • frameCount: Number of frames generated.
    • frameRate: Frame rate used.
    • duration: Duration of the video calculated as frameCount/frameRate.
  • binary:

    • Contains the actual video file data encoded in base64.
    • Includes metadata such as fileName, fileType (video or image), fileSize (human-readable), fileExtension, and mimeType.

The node supports common video formats like MP4, WebM, MOV, and GIF animations.


Dependencies

  • Requires access to a ComfyUI API endpoint with an API key credential for authentication.
  • The ComfyUI server must support endpoints for system stats, image upload, prompt submission, and history retrieval.
  • The workflow JSON must be compatible with ComfyUI and include a LoadImage node identified by the user.
  • n8n environment must have internet access if using image URLs or uploading images.
  • Uses form-data package internally to upload images.

Troubleshooting

  • Invalid workflow JSON: If the workflow JSON is malformed or not a valid object, the node throws an error. Ensure the JSON syntax is correct and the structure matches ComfyUI expectations.
  • LoadImage node not found: If the specified Image Node ID does not exist or is not a LoadImage node, the node errors out. Verify the node ID matches exactly and corresponds to a LoadImage node.
  • No image binary data found: When using binary input, if the specified binary property is missing or not an image, the node tries to find alternatives but may fail. Check that the binary property name is correct and contains valid image data.
  • Video generation timeout: If the video is not generated within the specified timeout, the node throws a timeout error. Increase the timeout or check ComfyUI server performance.
  • API connection issues: Errors connecting to the ComfyUI API or invalid API keys result in errors. Confirm API URL and credentials are correct.
  • Video file not found: If the generated video file cannot be retrieved from the ComfyUI server, an error is thrown. This might indicate server-side issues or incorrect file paths.

Links and References


If you need further details on any part of the node or its usage, feel free to ask!

Discussion