|
22 | 22 | download_url_to_video_output, |
23 | 23 | upload_images_to_comfyapi, |
24 | 24 | upload_video_to_comfyapi, |
| 25 | + validate_container_format_is_mp4, |
25 | 26 | ) |
26 | 27 |
|
27 | 28 | from comfy_api.input import VideoInput |
28 | | -from comfy_api.latest import ComfyExtension, InputImpl, io as comfy_io |
| 29 | +from comfy_api.latest import ComfyExtension, InputImpl, comfy_io |
29 | 30 | import av |
30 | 31 | import io |
31 | 32 |
|
@@ -144,7 +145,7 @@ def validate_video_to_video_input(video: VideoInput) -> VideoInput: |
144 | 145 | """ |
145 | 146 | width, height = _get_video_dimensions(video) |
146 | 147 | _validate_video_dimensions(width, height) |
147 | | - _validate_container_format(video) |
| 148 | + validate_container_format_is_mp4(video) |
148 | 149 |
|
149 | 150 | return _validate_and_trim_duration(video) |
150 | 151 |
|
@@ -177,15 +178,6 @@ def _validate_video_dimensions(width: int, height: int) -> None: |
177 | 178 | ) |
178 | 179 |
|
179 | 180 |
|
180 | | -def _validate_container_format(video: VideoInput) -> None: |
181 | | - """Validates video container format is MP4.""" |
182 | | - container_format = video.get_container_format() |
183 | | - if container_format not in ["mp4", "mov,mp4,m4a,3gp,3g2,mj2"]: |
184 | | - raise ValueError( |
185 | | - f"Only MP4 container format supported. Got: {container_format}" |
186 | | - ) |
187 | | - |
188 | | - |
189 | 181 | def _validate_and_trim_duration(video: VideoInput) -> VideoInput: |
190 | 182 | """Validates video duration and trims to 5 seconds if needed.""" |
191 | 183 | duration = video.get_duration() |
|
0 commit comments