Skip to content

Conversation

peter064226
Copy link

Add logic to handle gif video outputs from ComfyUI nodes, including uploading to S3 bucket and cleaning up local files. The implementation follows the same pattern as image handling but with video-specific content type handling.

Motivation

​​User Demand​​: Support animated outputs (e.g., GIFs/MP4s) from video-generation nodes (e.g., AnimateDiff, GIF-compatible savers).
​​Scalability​​: Videos are larger than images and require dedicated S3 handling (e.g., multipart uploads for big files).
​​Maintenance​​: Unify media-handling logic (images + videos) to reduce tech debt.

Add logic to handle gif video outputs from ComfyUI nodes, including uploading to S3 bucket and cleaning up local files. The implementation follows the same pattern as image handling but with video-specific content type handling.
Split the output_data list into separate lists for images and videos to improve data organization and clarity. This allows for better handling of different media types in the final result.

Update the final result structure to include separate "images" and "videos" fields when present, and modify the completion log message to reflect both media types.
The error messages and status field were only referencing images when checking for empty output data. This change updates them to explicitly mention both images and videos to accurately reflect the possible output types and avoid confusion.
The handler function was not including an empty "videos" array in the final_result when no images or videos were processed, which could cause issues with clients expecting this field. This change ensures consistent response structure by initializing the field similar to how "images" is handled.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant