MAI Video Out (file + sidecars + draft preview):
The MAIVideoOut node is designed to facilitate the creation and saving of video files from frames, with additional features that enhance the video production process. This node not only encodes frames into an MP4 format using ComfyUI's encoder but also generates sidecar files that provide valuable metadata and hold maps. These sidecar files include a JSON file containing the hold map, which acts as a timing guide, and another JSON file with metadata such as seeds, models, and steps used during the video creation process. An optional draft preview can be generated by decoding latent data through a tiny VAE, providing a quick look at the video without fully rendering it. This feature is only activated when specifically requested, ensuring that resources are used efficiently. The MAIVideoOut node is particularly beneficial for users who need a comprehensive record of their video creation process, as it provides both the final video and detailed documentation of the steps involved.
MAI Video Out (file + sidecars + draft preview) Input Parameters:
frames
The frames parameter represents the sequence of image frames that will be encoded into a video. These frames are typically in a tensor format and are the primary visual content of the video. The quality and content of these frames directly impact the final video output.
frame_rate
The frame_rate parameter specifies the number of frames displayed per second in the video. A higher frame rate results in smoother motion, while a lower frame rate can create a more choppy appearance. The default value is typically set to 24.0 frames per second, which is a standard for cinematic video.
hold_map
The hold_map parameter is a JSON string that contains timing information for the video frames. It specifies how long each frame should be held, allowing for precise control over the timing and pacing of the video. This parameter is optional but can be crucial for synchronizing video with other elements like audio.
notes
The notes parameter allows you to include additional information or annotations about the video creation process. This can be useful for documentation purposes or for providing context to others who may view or edit the video later.
prompt
The prompt parameter is a JSON object that contains information about the graph used to generate the video, including seeds, models, and steps. This metadata is saved alongside the video and can be used to reproduce or analyze the video creation process.
draft_preview
The draft_preview parameter is a boolean flag that, when enabled, generates a low-resolution preview of the video using a tiny VAE. This preview allows you to quickly assess the video without fully rendering it, saving time and computational resources.
latent
The latent parameter contains the latent data used for generating the draft preview. It is a tensor that represents the compressed form of the video frames, which can be decoded to produce a quick preview. This parameter is only used when draft_preview is enabled.
MAI Video Out (file + sidecars + draft preview) Output Parameters:
result
The result parameter is a dictionary containing the path to the saved video file and the metadata JSON. The video file is encoded in MP4 format, and the metadata JSON includes detailed information about the video creation process, such as frame count, seeds, and steps. This output is essential for accessing the final video and understanding the context of its creation.
ui
The ui parameter provides information for the user interface, including the filename of the saved video. This output is useful for integrating the video into a larger workflow or for displaying it within a user interface.
MAI Video Out (file + sidecars + draft preview) Usage Tips:
- To ensure efficient use of resources, only enable the
draft_previewoption when you need a quick assessment of the video. This can save time and computational power by avoiding a full render. - Utilize the
hold_mapparameter to synchronize your video with other elements, such as audio, by controlling the timing of each frame precisely. - Keep detailed notes in the
notesparameter to document the video creation process, which can be invaluable for future reference or collaboration with others.
MAI Video Out (file + sidecars + draft preview) Common Errors and Solutions:
FileNotFoundError: no vae_approx* in models/vae_approx
- Explanation: This error occurs when the tiny VAE model required for generating a draft preview is not found in the specified directory.
- Solution: Ensure that the VAE model files are correctly placed in the
models/vae_approxdirectory. If they are missing, download or copy the necessary files to this location.
AssertionError: Video file not saved correctly
- Explanation: This error indicates that the video file was not saved as expected, possibly due to incorrect file paths or permissions.
- Solution: Verify that the output directory exists and that you have the necessary permissions to write files to it. Check the file path for any typos or errors.
JSONDecodeError: Invalid JSON in hold_map or prompt
- Explanation: This error suggests that the JSON string provided in the
hold_maporpromptparameter is not properly formatted. - Solution: Double-check the JSON syntax for errors such as missing commas, brackets, or quotes. Use a JSON validator to ensure the format is correct.
