magic_hour 0.9.5__py3-none-any.whl → 0.44.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- magic_hour/README.md +34 -0
- magic_hour/__init__.py +1 -1
- magic_hour/client.py +8 -17
- magic_hour/environment.py +13 -1
- magic_hour/helpers/__init__.py +4 -0
- magic_hour/helpers/download.py +77 -0
- magic_hour/helpers/logger.py +8 -0
- magic_hour/resources/v1/README.md +32 -0
- magic_hour/resources/v1/ai_clothes_changer/README.md +94 -5
- magic_hour/resources/v1/ai_clothes_changer/client.py +161 -16
- magic_hour/resources/v1/ai_face_editor/README.md +195 -0
- magic_hour/resources/v1/ai_face_editor/__init__.py +4 -0
- magic_hour/resources/v1/ai_face_editor/client.py +324 -0
- magic_hour/resources/v1/ai_gif_generator/README.md +116 -0
- magic_hour/resources/v1/ai_gif_generator/__init__.py +4 -0
- magic_hour/resources/v1/ai_gif_generator/client.py +257 -0
- magic_hour/resources/v1/ai_headshot_generator/README.md +81 -3
- magic_hour/resources/v1/ai_headshot_generator/client.py +167 -18
- magic_hour/resources/v1/ai_image_editor/README.md +125 -0
- magic_hour/resources/v1/ai_image_editor/__init__.py +4 -0
- magic_hour/resources/v1/ai_image_editor/client.py +290 -0
- magic_hour/resources/v1/ai_image_generator/README.md +99 -5
- magic_hour/resources/v1/ai_image_generator/client.py +170 -24
- magic_hour/resources/v1/ai_image_upscaler/README.md +89 -3
- magic_hour/resources/v1/ai_image_upscaler/client.py +173 -20
- magic_hour/resources/v1/ai_meme_generator/README.md +129 -0
- magic_hour/resources/v1/ai_meme_generator/__init__.py +4 -0
- magic_hour/resources/v1/ai_meme_generator/client.py +253 -0
- magic_hour/resources/v1/ai_photo_editor/README.md +119 -4
- magic_hour/resources/v1/ai_photo_editor/client.py +199 -18
- magic_hour/resources/v1/ai_qr_code_generator/README.md +84 -3
- magic_hour/resources/v1/ai_qr_code_generator/client.py +140 -18
- magic_hour/resources/v1/ai_talking_photo/README.md +137 -0
- magic_hour/resources/v1/ai_talking_photo/__init__.py +4 -0
- magic_hour/resources/v1/ai_talking_photo/client.py +326 -0
- magic_hour/resources/v1/ai_voice_cloner/README.md +62 -0
- magic_hour/resources/v1/ai_voice_cloner/__init__.py +4 -0
- magic_hour/resources/v1/ai_voice_cloner/client.py +272 -0
- magic_hour/resources/v1/ai_voice_generator/README.md +112 -0
- magic_hour/resources/v1/ai_voice_generator/__init__.py +4 -0
- magic_hour/resources/v1/ai_voice_generator/client.py +241 -0
- magic_hour/resources/v1/animation/README.md +128 -6
- magic_hour/resources/v1/animation/client.py +247 -22
- magic_hour/resources/v1/audio_projects/README.md +135 -0
- magic_hour/resources/v1/audio_projects/__init__.py +12 -0
- magic_hour/resources/v1/audio_projects/client.py +310 -0
- magic_hour/resources/v1/audio_projects/client_test.py +520 -0
- magic_hour/resources/v1/auto_subtitle_generator/README.md +128 -0
- magic_hour/resources/v1/auto_subtitle_generator/__init__.py +4 -0
- magic_hour/resources/v1/auto_subtitle_generator/client.py +346 -0
- magic_hour/resources/v1/client.py +75 -1
- magic_hour/resources/v1/face_detection/README.md +157 -0
- magic_hour/resources/v1/face_detection/__init__.py +12 -0
- magic_hour/resources/v1/face_detection/client.py +380 -0
- magic_hour/resources/v1/face_swap/README.md +137 -9
- magic_hour/resources/v1/face_swap/client.py +329 -38
- magic_hour/resources/v1/face_swap_photo/README.md +118 -3
- magic_hour/resources/v1/face_swap_photo/client.py +199 -14
- magic_hour/resources/v1/files/README.md +39 -0
- magic_hour/resources/v1/files/client.py +351 -1
- magic_hour/resources/v1/files/client_test.py +414 -0
- magic_hour/resources/v1/files/upload_urls/README.md +38 -17
- magic_hour/resources/v1/files/upload_urls/client.py +38 -34
- magic_hour/resources/v1/image_background_remover/README.md +96 -5
- magic_hour/resources/v1/image_background_remover/client.py +151 -16
- magic_hour/resources/v1/image_projects/README.md +82 -10
- magic_hour/resources/v1/image_projects/__init__.py +10 -2
- magic_hour/resources/v1/image_projects/client.py +154 -16
- magic_hour/resources/v1/image_projects/client_test.py +527 -0
- magic_hour/resources/v1/image_to_video/README.md +96 -11
- magic_hour/resources/v1/image_to_video/client.py +282 -38
- magic_hour/resources/v1/lip_sync/README.md +112 -9
- magic_hour/resources/v1/lip_sync/client.py +288 -34
- magic_hour/resources/v1/photo_colorizer/README.md +107 -0
- magic_hour/resources/v1/photo_colorizer/__init__.py +4 -0
- magic_hour/resources/v1/photo_colorizer/client.py +248 -0
- magic_hour/resources/v1/text_to_video/README.md +96 -7
- magic_hour/resources/v1/text_to_video/client.py +204 -18
- magic_hour/resources/v1/video_projects/README.md +81 -9
- magic_hour/resources/v1/video_projects/__init__.py +10 -2
- magic_hour/resources/v1/video_projects/client.py +151 -14
- magic_hour/resources/v1/video_projects/client_test.py +527 -0
- magic_hour/resources/v1/video_to_video/README.md +119 -15
- magic_hour/resources/v1/video_to_video/client.py +299 -46
- magic_hour/types/models/__init__.py +92 -56
- magic_hour/types/models/v1_ai_clothes_changer_create_response.py +33 -0
- magic_hour/types/models/v1_ai_face_editor_create_response.py +33 -0
- magic_hour/types/models/v1_ai_gif_generator_create_response.py +33 -0
- magic_hour/types/models/v1_ai_headshot_generator_create_response.py +33 -0
- magic_hour/types/models/v1_ai_image_editor_create_response.py +33 -0
- magic_hour/types/models/v1_ai_image_generator_create_response.py +33 -0
- magic_hour/types/models/v1_ai_image_upscaler_create_response.py +33 -0
- magic_hour/types/models/v1_ai_meme_generator_create_response.py +33 -0
- magic_hour/types/models/v1_ai_photo_editor_create_response.py +33 -0
- magic_hour/types/models/v1_ai_qr_code_generator_create_response.py +33 -0
- magic_hour/types/models/v1_ai_talking_photo_create_response.py +35 -0
- magic_hour/types/models/v1_ai_voice_cloner_create_response.py +27 -0
- magic_hour/types/models/v1_ai_voice_generator_create_response.py +27 -0
- magic_hour/types/models/v1_animation_create_response.py +35 -0
- magic_hour/types/models/v1_audio_projects_get_response.py +72 -0
- magic_hour/types/models/v1_audio_projects_get_response_downloads_item.py +19 -0
- magic_hour/types/models/{get_v1_image_projects_id_response_error.py → v1_audio_projects_get_response_error.py} +2 -2
- magic_hour/types/models/v1_auto_subtitle_generator_create_response.py +35 -0
- magic_hour/types/models/v1_face_detection_create_response.py +25 -0
- magic_hour/types/models/v1_face_detection_get_response.py +45 -0
- magic_hour/types/models/v1_face_detection_get_response_faces_item.py +25 -0
- magic_hour/types/models/v1_face_swap_create_response.py +35 -0
- magic_hour/types/models/v1_face_swap_photo_create_response.py +33 -0
- magic_hour/types/models/v1_files_upload_urls_create_response.py +24 -0
- magic_hour/types/models/{post_v1_files_upload_urls_response_items_item.py → v1_files_upload_urls_create_response_items_item.py} +2 -2
- magic_hour/types/models/v1_image_background_remover_create_response.py +33 -0
- magic_hour/types/models/{get_v1_image_projects_id_response.py → v1_image_projects_get_response.py} +20 -18
- magic_hour/types/models/{get_v1_video_projects_id_response_downloads_item.py → v1_image_projects_get_response_downloads_item.py} +1 -1
- magic_hour/types/models/{get_v1_video_projects_id_response_error.py → v1_image_projects_get_response_error.py} +2 -2
- magic_hour/types/models/v1_image_to_video_create_response.py +35 -0
- magic_hour/types/models/v1_lip_sync_create_response.py +35 -0
- magic_hour/types/models/v1_photo_colorizer_create_response.py +33 -0
- magic_hour/types/models/v1_text_to_video_create_response.py +35 -0
- magic_hour/types/models/{get_v1_video_projects_id_response.py → v1_video_projects_get_response.py} +26 -23
- magic_hour/types/models/{get_v1_video_projects_id_response_download.py → v1_video_projects_get_response_download.py} +1 -1
- magic_hour/types/models/{get_v1_image_projects_id_response_downloads_item.py → v1_video_projects_get_response_downloads_item.py} +1 -1
- magic_hour/types/models/v1_video_projects_get_response_error.py +25 -0
- magic_hour/types/models/v1_video_to_video_create_response.py +35 -0
- magic_hour/types/params/__init__.py +422 -176
- magic_hour/types/params/v1_ai_clothes_changer_create_body.py +40 -0
- magic_hour/types/params/v1_ai_clothes_changer_create_body_assets.py +58 -0
- magic_hour/types/params/v1_ai_clothes_changer_generate_body_assets.py +33 -0
- magic_hour/types/params/v1_ai_face_editor_create_body.py +52 -0
- magic_hour/types/params/v1_ai_face_editor_create_body_assets.py +33 -0
- magic_hour/types/params/v1_ai_face_editor_create_body_style.py +137 -0
- magic_hour/types/params/v1_ai_face_editor_generate_body_assets.py +17 -0
- magic_hour/types/params/v1_ai_gif_generator_create_body.py +47 -0
- magic_hour/types/params/{post_v1_ai_image_generator_body_style.py → v1_ai_gif_generator_create_body_style.py} +5 -5
- magic_hour/types/params/v1_ai_headshot_generator_create_body.py +49 -0
- magic_hour/types/params/v1_ai_headshot_generator_create_body_assets.py +33 -0
- magic_hour/types/params/v1_ai_headshot_generator_create_body_style.py +27 -0
- magic_hour/types/params/v1_ai_headshot_generator_generate_body_assets.py +17 -0
- magic_hour/types/params/v1_ai_image_editor_create_body.py +49 -0
- magic_hour/types/params/v1_ai_image_editor_create_body_assets.py +47 -0
- magic_hour/types/params/v1_ai_image_editor_create_body_style.py +41 -0
- magic_hour/types/params/v1_ai_image_editor_generate_body_assets.py +28 -0
- magic_hour/types/params/{post_v1_ai_image_generator_body.py → v1_ai_image_generator_create_body.py} +17 -11
- magic_hour/types/params/v1_ai_image_generator_create_body_style.py +127 -0
- magic_hour/types/params/v1_ai_image_upscaler_create_body.py +59 -0
- magic_hour/types/params/v1_ai_image_upscaler_create_body_assets.py +33 -0
- magic_hour/types/params/{post_v1_ai_image_upscaler_body_style.py → v1_ai_image_upscaler_create_body_style.py} +4 -4
- magic_hour/types/params/v1_ai_image_upscaler_generate_body_assets.py +17 -0
- magic_hour/types/params/v1_ai_meme_generator_create_body.py +37 -0
- magic_hour/types/params/v1_ai_meme_generator_create_body_style.py +73 -0
- magic_hour/types/params/{post_v1_ai_photo_editor_body.py → v1_ai_photo_editor_create_body.py} +15 -15
- magic_hour/types/params/v1_ai_photo_editor_create_body_assets.py +33 -0
- magic_hour/types/params/{post_v1_ai_photo_editor_body_style.py → v1_ai_photo_editor_create_body_style.py} +20 -4
- magic_hour/types/params/v1_ai_photo_editor_generate_body_assets.py +17 -0
- magic_hour/types/params/v1_ai_qr_code_generator_create_body.py +45 -0
- magic_hour/types/params/{post_v1_ai_qr_code_generator_body_style.py → v1_ai_qr_code_generator_create_body_style.py} +4 -4
- magic_hour/types/params/v1_ai_talking_photo_create_body.py +68 -0
- magic_hour/types/params/v1_ai_talking_photo_create_body_assets.py +46 -0
- magic_hour/types/params/v1_ai_talking_photo_create_body_style.py +44 -0
- magic_hour/types/params/v1_ai_talking_photo_generate_body_assets.py +26 -0
- magic_hour/types/params/v1_ai_voice_cloner_create_body.py +49 -0
- magic_hour/types/params/v1_ai_voice_cloner_create_body_assets.py +33 -0
- magic_hour/types/params/v1_ai_voice_cloner_create_body_style.py +28 -0
- magic_hour/types/params/v1_ai_voice_cloner_generate_body_assets.py +28 -0
- magic_hour/types/params/v1_ai_voice_generator_create_body.py +40 -0
- magic_hour/types/params/v1_ai_voice_generator_create_body_style.py +440 -0
- magic_hour/types/params/{post_v1_animation_body.py → v1_animation_create_body.py} +16 -16
- magic_hour/types/params/{post_v1_animation_body_assets.py → v1_animation_create_body_assets.py} +15 -5
- magic_hour/types/params/{post_v1_animation_body_style.py → v1_animation_create_body_style.py} +13 -10
- magic_hour/types/params/v1_animation_generate_body_assets.py +39 -0
- magic_hour/types/params/v1_auto_subtitle_generator_create_body.py +78 -0
- magic_hour/types/params/v1_auto_subtitle_generator_create_body_assets.py +33 -0
- magic_hour/types/params/v1_auto_subtitle_generator_create_body_style.py +56 -0
- magic_hour/types/params/v1_auto_subtitle_generator_create_body_style_custom_config.py +86 -0
- magic_hour/types/params/v1_auto_subtitle_generator_generate_body_assets.py +17 -0
- magic_hour/types/params/v1_face_detection_create_body.py +44 -0
- magic_hour/types/params/v1_face_detection_create_body_assets.py +33 -0
- magic_hour/types/params/v1_face_detection_generate_body_assets.py +17 -0
- magic_hour/types/params/v1_face_swap_create_body.py +92 -0
- magic_hour/types/params/v1_face_swap_create_body_assets.py +91 -0
- magic_hour/types/params/v1_face_swap_create_body_assets_face_mappings_item.py +44 -0
- magic_hour/types/params/v1_face_swap_create_body_style.py +33 -0
- magic_hour/types/params/v1_face_swap_generate_body_assets.py +56 -0
- magic_hour/types/params/v1_face_swap_generate_body_assets_face_mappings_item.py +25 -0
- magic_hour/types/params/v1_face_swap_photo_create_body.py +40 -0
- magic_hour/types/params/v1_face_swap_photo_create_body_assets.py +76 -0
- magic_hour/types/params/v1_face_swap_photo_create_body_assets_face_mappings_item.py +44 -0
- magic_hour/types/params/v1_face_swap_photo_generate_body_assets.py +47 -0
- magic_hour/types/params/v1_face_swap_photo_generate_body_assets_face_mappings_item.py +25 -0
- magic_hour/types/params/v1_files_upload_urls_create_body.py +36 -0
- magic_hour/types/params/v1_files_upload_urls_create_body_items_item.py +38 -0
- magic_hour/types/params/v1_image_background_remover_create_body.py +40 -0
- magic_hour/types/params/v1_image_background_remover_create_body_assets.py +49 -0
- magic_hour/types/params/v1_image_background_remover_generate_body_assets.py +27 -0
- magic_hour/types/params/v1_image_to_video_create_body.py +101 -0
- magic_hour/types/params/v1_image_to_video_create_body_assets.py +33 -0
- magic_hour/types/params/v1_image_to_video_create_body_style.py +53 -0
- magic_hour/types/params/v1_image_to_video_generate_body_assets.py +17 -0
- magic_hour/types/params/v1_lip_sync_create_body.py +100 -0
- magic_hour/types/params/{post_v1_lip_sync_body_assets.py → v1_lip_sync_create_body_assets.py} +15 -5
- magic_hour/types/params/v1_lip_sync_create_body_style.py +37 -0
- magic_hour/types/params/v1_lip_sync_generate_body_assets.py +36 -0
- magic_hour/types/params/v1_photo_colorizer_create_body.py +40 -0
- magic_hour/types/params/v1_photo_colorizer_create_body_assets.py +33 -0
- magic_hour/types/params/v1_photo_colorizer_generate_body_assets.py +17 -0
- magic_hour/types/params/v1_text_to_video_create_body.py +78 -0
- magic_hour/types/params/v1_text_to_video_create_body_style.py +43 -0
- magic_hour/types/params/v1_video_to_video_create_body.py +101 -0
- magic_hour/types/params/{post_v1_video_to_video_body_assets.py → v1_video_to_video_create_body_assets.py} +9 -4
- magic_hour/types/params/{post_v1_video_to_video_body_style.py → v1_video_to_video_create_body_style.py} +68 -26
- magic_hour/types/params/v1_video_to_video_generate_body_assets.py +27 -0
- magic_hour-0.44.0.dist-info/METADATA +328 -0
- magic_hour-0.44.0.dist-info/RECORD +231 -0
- magic_hour/core/__init__.py +0 -52
- magic_hour/core/api_error.py +0 -56
- magic_hour/core/auth.py +0 -314
- magic_hour/core/base_client.py +0 -618
- magic_hour/core/binary_response.py +0 -23
- magic_hour/core/query.py +0 -106
- magic_hour/core/request.py +0 -156
- magic_hour/core/response.py +0 -293
- magic_hour/core/type_utils.py +0 -28
- magic_hour/core/utils.py +0 -55
- magic_hour/types/models/post_v1_ai_clothes_changer_response.py +0 -25
- magic_hour/types/models/post_v1_ai_headshot_generator_response.py +0 -25
- magic_hour/types/models/post_v1_ai_image_generator_response.py +0 -25
- magic_hour/types/models/post_v1_ai_image_upscaler_response.py +0 -25
- magic_hour/types/models/post_v1_ai_photo_editor_response.py +0 -25
- magic_hour/types/models/post_v1_ai_qr_code_generator_response.py +0 -25
- magic_hour/types/models/post_v1_animation_response.py +0 -25
- magic_hour/types/models/post_v1_face_swap_photo_response.py +0 -25
- magic_hour/types/models/post_v1_face_swap_response.py +0 -25
- magic_hour/types/models/post_v1_files_upload_urls_response.py +0 -21
- magic_hour/types/models/post_v1_image_background_remover_response.py +0 -25
- magic_hour/types/models/post_v1_image_to_video_response.py +0 -25
- magic_hour/types/models/post_v1_lip_sync_response.py +0 -25
- magic_hour/types/models/post_v1_text_to_video_response.py +0 -25
- magic_hour/types/models/post_v1_video_to_video_response.py +0 -25
- magic_hour/types/params/post_v1_ai_clothes_changer_body.py +0 -40
- magic_hour/types/params/post_v1_ai_clothes_changer_body_assets.py +0 -45
- magic_hour/types/params/post_v1_ai_headshot_generator_body.py +0 -40
- magic_hour/types/params/post_v1_ai_headshot_generator_body_assets.py +0 -28
- magic_hour/types/params/post_v1_ai_image_upscaler_body.py +0 -57
- magic_hour/types/params/post_v1_ai_image_upscaler_body_assets.py +0 -28
- magic_hour/types/params/post_v1_ai_photo_editor_body_assets.py +0 -28
- magic_hour/types/params/post_v1_ai_qr_code_generator_body.py +0 -45
- magic_hour/types/params/post_v1_face_swap_body.py +0 -72
- magic_hour/types/params/post_v1_face_swap_body_assets.py +0 -52
- magic_hour/types/params/post_v1_face_swap_photo_body.py +0 -40
- magic_hour/types/params/post_v1_face_swap_photo_body_assets.py +0 -36
- magic_hour/types/params/post_v1_files_upload_urls_body.py +0 -31
- magic_hour/types/params/post_v1_files_upload_urls_body_items_item.py +0 -38
- magic_hour/types/params/post_v1_image_background_remover_body.py +0 -40
- magic_hour/types/params/post_v1_image_background_remover_body_assets.py +0 -28
- magic_hour/types/params/post_v1_image_to_video_body.py +0 -73
- magic_hour/types/params/post_v1_image_to_video_body_assets.py +0 -28
- magic_hour/types/params/post_v1_image_to_video_body_style.py +0 -37
- magic_hour/types/params/post_v1_lip_sync_body.py +0 -80
- magic_hour/types/params/post_v1_text_to_video_body.py +0 -57
- magic_hour/types/params/post_v1_text_to_video_body_style.py +0 -28
- magic_hour/types/params/post_v1_video_to_video_body.py +0 -93
- magic_hour-0.9.5.dist-info/METADATA +0 -133
- magic_hour-0.9.5.dist-info/RECORD +0 -132
- {magic_hour-0.9.5.dist-info → magic_hour-0.44.0.dist-info}/LICENSE +0 -0
- {magic_hour-0.9.5.dist-info → magic_hour-0.44.0.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import pydantic
|
|
2
|
+
import typing
|
|
3
|
+
import typing_extensions
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class V1ImageToVideoCreateBodyStyle(typing_extensions.TypedDict):
|
|
7
|
+
"""
|
|
8
|
+
Attributed used to dictate the style of the output
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
high_quality: typing_extensions.NotRequired[bool]
|
|
12
|
+
"""
|
|
13
|
+
Deprecated: Please use `resolution` instead. For backward compatibility,
|
|
14
|
+
* `false` maps to 720p resolution
|
|
15
|
+
* `true` maps to 1080p resolution
|
|
16
|
+
|
|
17
|
+
This field will be removed in a future version. Use the `resolution` field to directly specify the resolution.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
prompt: typing_extensions.NotRequired[str]
|
|
21
|
+
"""
|
|
22
|
+
The prompt used for the video.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
quality_mode: typing_extensions.NotRequired[
|
|
26
|
+
typing_extensions.Literal["quick", "studio"]
|
|
27
|
+
]
|
|
28
|
+
"""
|
|
29
|
+
DEPRECATED: Please use `resolution` field instead. For backward compatibility:
|
|
30
|
+
* `quick` maps to 720p resolution
|
|
31
|
+
* `studio` maps to 1080p resolution
|
|
32
|
+
|
|
33
|
+
This field will be removed in a future version. Use the `resolution` field to directly to specify the resolution.
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class _SerializerV1ImageToVideoCreateBodyStyle(pydantic.BaseModel):
|
|
38
|
+
"""
|
|
39
|
+
Serializer for V1ImageToVideoCreateBodyStyle handling case conversions
|
|
40
|
+
and file omissions as dictated by the API
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
model_config = pydantic.ConfigDict(
|
|
44
|
+
populate_by_name=True,
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
high_quality: typing.Optional[bool] = pydantic.Field(
|
|
48
|
+
alias="high_quality", default=None
|
|
49
|
+
)
|
|
50
|
+
prompt: typing.Optional[str] = pydantic.Field(alias="prompt", default=None)
|
|
51
|
+
quality_mode: typing.Optional[typing_extensions.Literal["quick", "studio"]] = (
|
|
52
|
+
pydantic.Field(alias="quality_mode", default=None)
|
|
53
|
+
)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import pydantic
|
|
2
|
+
import typing_extensions
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class V1ImageToVideoGenerateBodyAssets(typing_extensions.TypedDict):
|
|
6
|
+
"""
|
|
7
|
+
Provide the assets for image-to-video.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
image_file_path: typing_extensions.Required[str]
|
|
11
|
+
"""
|
|
12
|
+
The path of the image file. This value is either
|
|
13
|
+
- a direct URL to the image file
|
|
14
|
+
- a path to a local file
|
|
15
|
+
|
|
16
|
+
Note: if the path begins with `api-assets`, it will be assumed to already be uploaded to Magic Hour's storage, and will not be uploaded again.
|
|
17
|
+
"""
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import pydantic
|
|
2
|
+
import typing
|
|
3
|
+
import typing_extensions
|
|
4
|
+
|
|
5
|
+
from .v1_lip_sync_create_body_assets import (
|
|
6
|
+
V1LipSyncCreateBodyAssets,
|
|
7
|
+
_SerializerV1LipSyncCreateBodyAssets,
|
|
8
|
+
)
|
|
9
|
+
from .v1_lip_sync_create_body_style import (
|
|
10
|
+
V1LipSyncCreateBodyStyle,
|
|
11
|
+
_SerializerV1LipSyncCreateBodyStyle,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class V1LipSyncCreateBody(typing_extensions.TypedDict):
|
|
16
|
+
"""
|
|
17
|
+
V1LipSyncCreateBody
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
assets: typing_extensions.Required[V1LipSyncCreateBodyAssets]
|
|
21
|
+
"""
|
|
22
|
+
Provide the assets for lip-sync. For video, The `video_source` field determines whether `video_file_path` or `youtube_url` field is used
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
end_seconds: typing_extensions.Required[float]
|
|
26
|
+
"""
|
|
27
|
+
The end time of the input video in seconds. This value is used to trim the input video. The value must be greater than 0.1, and more than the start_seconds.
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
height: typing_extensions.NotRequired[typing.Optional[int]]
|
|
31
|
+
"""
|
|
32
|
+
`height` is deprecated and no longer influences the output video's resolution.
|
|
33
|
+
|
|
34
|
+
Output resolution is determined by the **minimum** of:
|
|
35
|
+
- The resolution of the input video
|
|
36
|
+
- The maximum resolution allowed by your subscription tier. See our [pricing page](https://magichour.ai/pricing) for more details.
|
|
37
|
+
|
|
38
|
+
This field is retained only for backward compatibility and will be removed in a future release.
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
max_fps_limit: typing_extensions.NotRequired[float]
|
|
42
|
+
"""
|
|
43
|
+
Defines the maximum FPS (frames per second) for the output video. If the input video's FPS is lower than this limit, the output video will retain the input FPS. This is useful for reducing unnecessary frame usage in scenarios where high FPS is not required.
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
name: typing_extensions.NotRequired[str]
|
|
47
|
+
"""
|
|
48
|
+
The name of video. This value is mainly used for your own identification of the video.
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
start_seconds: typing_extensions.Required[float]
|
|
52
|
+
"""
|
|
53
|
+
The start time of the input video in seconds. This value is used to trim the input video. The value must be greater than 0.
|
|
54
|
+
"""
|
|
55
|
+
|
|
56
|
+
style: typing_extensions.NotRequired[V1LipSyncCreateBodyStyle]
|
|
57
|
+
"""
|
|
58
|
+
Attributes used to dictate the style of the output
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
width: typing_extensions.NotRequired[typing.Optional[int]]
|
|
62
|
+
"""
|
|
63
|
+
`width` is deprecated and no longer influences the output video's resolution.
|
|
64
|
+
|
|
65
|
+
Output resolution is determined by the **minimum** of:
|
|
66
|
+
- The resolution of the input video
|
|
67
|
+
- The maximum resolution allowed by your subscription tier. See our [pricing page](https://magichour.ai/pricing) for more details.
|
|
68
|
+
|
|
69
|
+
This field is retained only for backward compatibility and will be removed in a future release.
|
|
70
|
+
"""
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
class _SerializerV1LipSyncCreateBody(pydantic.BaseModel):
|
|
74
|
+
"""
|
|
75
|
+
Serializer for V1LipSyncCreateBody handling case conversions
|
|
76
|
+
and file omissions as dictated by the API
|
|
77
|
+
"""
|
|
78
|
+
|
|
79
|
+
model_config = pydantic.ConfigDict(
|
|
80
|
+
populate_by_name=True,
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
assets: _SerializerV1LipSyncCreateBodyAssets = pydantic.Field(
|
|
84
|
+
alias="assets",
|
|
85
|
+
)
|
|
86
|
+
end_seconds: float = pydantic.Field(
|
|
87
|
+
alias="end_seconds",
|
|
88
|
+
)
|
|
89
|
+
height: typing.Optional[int] = pydantic.Field(alias="height", default=None)
|
|
90
|
+
max_fps_limit: typing.Optional[float] = pydantic.Field(
|
|
91
|
+
alias="max_fps_limit", default=None
|
|
92
|
+
)
|
|
93
|
+
name: typing.Optional[str] = pydantic.Field(alias="name", default=None)
|
|
94
|
+
start_seconds: float = pydantic.Field(
|
|
95
|
+
alias="start_seconds",
|
|
96
|
+
)
|
|
97
|
+
style: typing.Optional[_SerializerV1LipSyncCreateBodyStyle] = pydantic.Field(
|
|
98
|
+
alias="style", default=None
|
|
99
|
+
)
|
|
100
|
+
width: typing.Optional[int] = pydantic.Field(alias="width", default=None)
|
magic_hour/types/params/{post_v1_lip_sync_body_assets.py → v1_lip_sync_create_body_assets.py}
RENAMED
|
@@ -3,19 +3,29 @@ import typing
|
|
|
3
3
|
import typing_extensions
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
class
|
|
6
|
+
class V1LipSyncCreateBodyAssets(typing_extensions.TypedDict):
|
|
7
7
|
"""
|
|
8
8
|
Provide the assets for lip-sync. For video, The `video_source` field determines whether `video_file_path` or `youtube_url` field is used
|
|
9
9
|
"""
|
|
10
10
|
|
|
11
11
|
audio_file_path: typing_extensions.Required[str]
|
|
12
12
|
"""
|
|
13
|
-
The path of the audio file. This value
|
|
13
|
+
The path of the audio file. This value is either
|
|
14
|
+
- a direct URL to the video file
|
|
15
|
+
- `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls).
|
|
16
|
+
|
|
17
|
+
Please refer to the [Input File documentation](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) to learn more.
|
|
18
|
+
|
|
14
19
|
"""
|
|
15
20
|
|
|
16
21
|
video_file_path: typing_extensions.NotRequired[str]
|
|
17
22
|
"""
|
|
18
|
-
|
|
23
|
+
Required if `video_source` is `file`. This value is either
|
|
24
|
+
- a direct URL to the video file
|
|
25
|
+
- `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls).
|
|
26
|
+
|
|
27
|
+
Please refer to the [Input File documentation](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) to learn more.
|
|
28
|
+
|
|
19
29
|
"""
|
|
20
30
|
|
|
21
31
|
video_source: typing_extensions.Required[
|
|
@@ -28,9 +38,9 @@ class PostV1LipSyncBodyAssets(typing_extensions.TypedDict):
|
|
|
28
38
|
"""
|
|
29
39
|
|
|
30
40
|
|
|
31
|
-
class
|
|
41
|
+
class _SerializerV1LipSyncCreateBodyAssets(pydantic.BaseModel):
|
|
32
42
|
"""
|
|
33
|
-
Serializer for
|
|
43
|
+
Serializer for V1LipSyncCreateBodyAssets handling case conversions
|
|
34
44
|
and file omissions as dictated by the API
|
|
35
45
|
"""
|
|
36
46
|
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import pydantic
|
|
2
|
+
import typing
|
|
3
|
+
import typing_extensions
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class V1LipSyncCreateBodyStyle(typing_extensions.TypedDict):
|
|
7
|
+
"""
|
|
8
|
+
Attributes used to dictate the style of the output
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
generation_mode: typing_extensions.NotRequired[
|
|
12
|
+
typing_extensions.Literal["lite", "pro", "standard"]
|
|
13
|
+
]
|
|
14
|
+
"""
|
|
15
|
+
A specific version of our lip sync system, optimized for different needs.
|
|
16
|
+
* `lite` - Fast and affordable lip sync - best for simple videos. Costs 1 credit per frame of video.
|
|
17
|
+
* `standard` - Natural, accurate lip sync - best for most creators. Costs 1 credit per frame of video.
|
|
18
|
+
* `pro` - Premium fidelity with enhanced detail - best for professionals. Costs 2 credits per frame of video.
|
|
19
|
+
|
|
20
|
+
Note: `standard` and `pro` are only available for users on Creator, Pro, and Business tiers.
|
|
21
|
+
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class _SerializerV1LipSyncCreateBodyStyle(pydantic.BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
Serializer for V1LipSyncCreateBodyStyle handling case conversions
|
|
28
|
+
and file omissions as dictated by the API
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
model_config = pydantic.ConfigDict(
|
|
32
|
+
populate_by_name=True,
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
generation_mode: typing.Optional[
|
|
36
|
+
typing_extensions.Literal["lite", "pro", "standard"]
|
|
37
|
+
] = pydantic.Field(alias="generation_mode", default=None)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import pydantic
|
|
2
|
+
import typing
|
|
3
|
+
import typing_extensions
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class V1LipSyncGenerateBodyAssets(typing_extensions.TypedDict):
|
|
7
|
+
"""
|
|
8
|
+
Provide the assets for lip-sync. For video, The `video_source` field determines whether `video_file_path` or `youtube_url` field is used
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
audio_file_path: typing_extensions.Required[str]
|
|
12
|
+
"""
|
|
13
|
+
The path of the audio file. This value is either
|
|
14
|
+
- a direct URL to the video file
|
|
15
|
+
- a path to a local file
|
|
16
|
+
|
|
17
|
+
Note: if the path begins with `api-assets`, it will be assumed to already be uploaded to Magic Hour's storage, and will not be uploaded again.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
video_file_path: typing_extensions.NotRequired[str]
|
|
21
|
+
"""
|
|
22
|
+
Required if `video_source` is `file`. This value is either
|
|
23
|
+
- a direct URL to the video file
|
|
24
|
+
- a path to a local file
|
|
25
|
+
|
|
26
|
+
Note: if the path begins with `api-assets`, it will be assumed to already be uploaded to Magic Hour's storage, and will not be uploaded again.
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
video_source: typing_extensions.Required[
|
|
30
|
+
typing_extensions.Literal["file", "youtube"]
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
youtube_url: typing_extensions.NotRequired[str]
|
|
34
|
+
"""
|
|
35
|
+
Using a youtube video as the input source. This field is required if `video_source` is `youtube`
|
|
36
|
+
"""
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import pydantic
|
|
2
|
+
import typing
|
|
3
|
+
import typing_extensions
|
|
4
|
+
|
|
5
|
+
from .v1_photo_colorizer_create_body_assets import (
|
|
6
|
+
V1PhotoColorizerCreateBodyAssets,
|
|
7
|
+
_SerializerV1PhotoColorizerCreateBodyAssets,
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class V1PhotoColorizerCreateBody(typing_extensions.TypedDict):
|
|
12
|
+
"""
|
|
13
|
+
V1PhotoColorizerCreateBody
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
assets: typing_extensions.Required[V1PhotoColorizerCreateBodyAssets]
|
|
17
|
+
"""
|
|
18
|
+
Provide the assets for photo colorization
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
name: typing_extensions.NotRequired[str]
|
|
22
|
+
"""
|
|
23
|
+
The name of image. This value is mainly used for your own identification of the image.
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class _SerializerV1PhotoColorizerCreateBody(pydantic.BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
Serializer for V1PhotoColorizerCreateBody handling case conversions
|
|
30
|
+
and file omissions as dictated by the API
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
model_config = pydantic.ConfigDict(
|
|
34
|
+
populate_by_name=True,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
assets: _SerializerV1PhotoColorizerCreateBodyAssets = pydantic.Field(
|
|
38
|
+
alias="assets",
|
|
39
|
+
)
|
|
40
|
+
name: typing.Optional[str] = pydantic.Field(alias="name", default=None)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import pydantic
|
|
2
|
+
import typing_extensions
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class V1PhotoColorizerCreateBodyAssets(typing_extensions.TypedDict):
|
|
6
|
+
"""
|
|
7
|
+
Provide the assets for photo colorization
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
image_file_path: typing_extensions.Required[str]
|
|
11
|
+
"""
|
|
12
|
+
The image used to generate the colorized image. This value is either
|
|
13
|
+
- a direct URL to the video file
|
|
14
|
+
- `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls).
|
|
15
|
+
|
|
16
|
+
Please refer to the [Input File documentation](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) to learn more.
|
|
17
|
+
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class _SerializerV1PhotoColorizerCreateBodyAssets(pydantic.BaseModel):
|
|
22
|
+
"""
|
|
23
|
+
Serializer for V1PhotoColorizerCreateBodyAssets handling case conversions
|
|
24
|
+
and file omissions as dictated by the API
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
model_config = pydantic.ConfigDict(
|
|
28
|
+
populate_by_name=True,
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
image_file_path: str = pydantic.Field(
|
|
32
|
+
alias="image_file_path",
|
|
33
|
+
)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import pydantic
|
|
2
|
+
import typing_extensions
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class V1PhotoColorizerGenerateBodyAssets(typing_extensions.TypedDict):
|
|
6
|
+
"""
|
|
7
|
+
Provide the assets for photo colorization
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
image_file_path: typing_extensions.Required[str]
|
|
11
|
+
"""
|
|
12
|
+
The image used to generate the colorized image. This value is either
|
|
13
|
+
- a direct URL to the image file
|
|
14
|
+
- a path to a local file
|
|
15
|
+
|
|
16
|
+
Note: if the path begins with `api-assets`, it will be assumed to already be uploaded to Magic Hour's storage, and will not be uploaded again.
|
|
17
|
+
"""
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import pydantic
|
|
2
|
+
import typing
|
|
3
|
+
import typing_extensions
|
|
4
|
+
|
|
5
|
+
from .v1_text_to_video_create_body_style import (
|
|
6
|
+
V1TextToVideoCreateBodyStyle,
|
|
7
|
+
_SerializerV1TextToVideoCreateBodyStyle,
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class V1TextToVideoCreateBody(typing_extensions.TypedDict):
|
|
12
|
+
"""
|
|
13
|
+
V1TextToVideoCreateBody
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
end_seconds: typing_extensions.Required[float]
|
|
17
|
+
"""
|
|
18
|
+
The total duration of the output video in seconds.
|
|
19
|
+
|
|
20
|
+
The value must be greater than or equal to 5 seconds and less than or equal to 60 seconds.
|
|
21
|
+
|
|
22
|
+
Note: For 480p resolution, the value must be either 5 or 10.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
name: typing_extensions.NotRequired[str]
|
|
26
|
+
"""
|
|
27
|
+
The name of video. This value is mainly used for your own identification of the video.
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
orientation: typing_extensions.Required[
|
|
31
|
+
typing_extensions.Literal["landscape", "portrait", "square"]
|
|
32
|
+
]
|
|
33
|
+
"""
|
|
34
|
+
Determines the orientation of the output video
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
resolution: typing_extensions.NotRequired[
|
|
38
|
+
typing_extensions.Literal["1080p", "480p", "720p"]
|
|
39
|
+
]
|
|
40
|
+
"""
|
|
41
|
+
Controls the output video resolution. Defaults to `720p` if not specified.
|
|
42
|
+
|
|
43
|
+
480p and 720p are available on Creator, Pro, or Business tiers. However, 1080p require Pro or Business tier.
|
|
44
|
+
|
|
45
|
+
**Options:**
|
|
46
|
+
- `480p` - Supports only 5 or 10 second videos. Output: 24fps. Cost: 120 credits per 5 seconds.
|
|
47
|
+
- `720p` - Supports videos between 5-60 seconds. Output: 30fps. Cost: 300 credits per 5 seconds.
|
|
48
|
+
- `1080p` - Supports videos between 5-60 seconds. Output: 30fps. Cost: 600 credits per 5 seconds.
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
style: typing_extensions.Required[V1TextToVideoCreateBodyStyle]
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
class _SerializerV1TextToVideoCreateBody(pydantic.BaseModel):
|
|
55
|
+
"""
|
|
56
|
+
Serializer for V1TextToVideoCreateBody handling case conversions
|
|
57
|
+
and file omissions as dictated by the API
|
|
58
|
+
"""
|
|
59
|
+
|
|
60
|
+
model_config = pydantic.ConfigDict(
|
|
61
|
+
populate_by_name=True,
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
end_seconds: float = pydantic.Field(
|
|
65
|
+
alias="end_seconds",
|
|
66
|
+
)
|
|
67
|
+
name: typing.Optional[str] = pydantic.Field(alias="name", default=None)
|
|
68
|
+
orientation: typing_extensions.Literal["landscape", "portrait", "square"] = (
|
|
69
|
+
pydantic.Field(
|
|
70
|
+
alias="orientation",
|
|
71
|
+
)
|
|
72
|
+
)
|
|
73
|
+
resolution: typing.Optional[typing_extensions.Literal["1080p", "480p", "720p"]] = (
|
|
74
|
+
pydantic.Field(alias="resolution", default=None)
|
|
75
|
+
)
|
|
76
|
+
style: _SerializerV1TextToVideoCreateBodyStyle = pydantic.Field(
|
|
77
|
+
alias="style",
|
|
78
|
+
)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import pydantic
|
|
2
|
+
import typing
|
|
3
|
+
import typing_extensions
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class V1TextToVideoCreateBodyStyle(typing_extensions.TypedDict):
|
|
7
|
+
"""
|
|
8
|
+
V1TextToVideoCreateBodyStyle
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
prompt: typing_extensions.Required[str]
|
|
12
|
+
"""
|
|
13
|
+
The prompt used for the video.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
quality_mode: typing_extensions.NotRequired[
|
|
17
|
+
typing_extensions.Literal["quick", "studio"]
|
|
18
|
+
]
|
|
19
|
+
"""
|
|
20
|
+
DEPRECATED: Please use `resolution` field instead. For backward compatibility:
|
|
21
|
+
* `quick` maps to 720p resolution
|
|
22
|
+
* `studio` maps to 1080p resolution
|
|
23
|
+
|
|
24
|
+
This field will be removed in a future version. Use the `resolution` field to directly to specify the resolution.
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class _SerializerV1TextToVideoCreateBodyStyle(pydantic.BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
Serializer for V1TextToVideoCreateBodyStyle handling case conversions
|
|
31
|
+
and file omissions as dictated by the API
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
model_config = pydantic.ConfigDict(
|
|
35
|
+
populate_by_name=True,
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
prompt: str = pydantic.Field(
|
|
39
|
+
alias="prompt",
|
|
40
|
+
)
|
|
41
|
+
quality_mode: typing.Optional[typing_extensions.Literal["quick", "studio"]] = (
|
|
42
|
+
pydantic.Field(alias="quality_mode", default=None)
|
|
43
|
+
)
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import pydantic
|
|
2
|
+
import typing
|
|
3
|
+
import typing_extensions
|
|
4
|
+
|
|
5
|
+
from .v1_video_to_video_create_body_assets import (
|
|
6
|
+
V1VideoToVideoCreateBodyAssets,
|
|
7
|
+
_SerializerV1VideoToVideoCreateBodyAssets,
|
|
8
|
+
)
|
|
9
|
+
from .v1_video_to_video_create_body_style import (
|
|
10
|
+
V1VideoToVideoCreateBodyStyle,
|
|
11
|
+
_SerializerV1VideoToVideoCreateBodyStyle,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class V1VideoToVideoCreateBody(typing_extensions.TypedDict):
|
|
16
|
+
"""
|
|
17
|
+
V1VideoToVideoCreateBody
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
assets: typing_extensions.Required[V1VideoToVideoCreateBodyAssets]
|
|
21
|
+
"""
|
|
22
|
+
Provide the assets for video-to-video. For video, The `video_source` field determines whether `video_file_path` or `youtube_url` field is used
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
end_seconds: typing_extensions.Required[float]
|
|
26
|
+
"""
|
|
27
|
+
The end time of the input video in seconds. This value is used to trim the input video. The value must be greater than 0.1, and more than the start_seconds.
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
fps_resolution: typing_extensions.NotRequired[
|
|
31
|
+
typing_extensions.Literal["FULL", "HALF"]
|
|
32
|
+
]
|
|
33
|
+
"""
|
|
34
|
+
Determines whether the resulting video will have the same frame per second as the original video, or half.
|
|
35
|
+
* `FULL` - the result video will have the same FPS as the input video
|
|
36
|
+
* `HALF` - the result video will have half the FPS as the input video
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
height: typing_extensions.NotRequired[typing.Optional[int]]
|
|
40
|
+
"""
|
|
41
|
+
`height` is deprecated and no longer influences the output video's resolution.
|
|
42
|
+
|
|
43
|
+
Output resolution is determined by the **minimum** of:
|
|
44
|
+
- The resolution of the input video
|
|
45
|
+
- The maximum resolution allowed by your subscription tier. See our [pricing page](https://magichour.ai/pricing) for more details.
|
|
46
|
+
|
|
47
|
+
This field is retained only for backward compatibility and will be removed in a future release.
|
|
48
|
+
"""
|
|
49
|
+
|
|
50
|
+
name: typing_extensions.NotRequired[str]
|
|
51
|
+
"""
|
|
52
|
+
The name of video. This value is mainly used for your own identification of the video.
|
|
53
|
+
"""
|
|
54
|
+
|
|
55
|
+
start_seconds: typing_extensions.Required[float]
|
|
56
|
+
"""
|
|
57
|
+
The start time of the input video in seconds. This value is used to trim the input video. The value must be greater than 0.
|
|
58
|
+
"""
|
|
59
|
+
|
|
60
|
+
style: typing_extensions.Required[V1VideoToVideoCreateBodyStyle]
|
|
61
|
+
|
|
62
|
+
width: typing_extensions.NotRequired[typing.Optional[int]]
|
|
63
|
+
"""
|
|
64
|
+
`width` is deprecated and no longer influences the output video's resolution.
|
|
65
|
+
|
|
66
|
+
Output resolution is determined by the **minimum** of:
|
|
67
|
+
- The resolution of the input video
|
|
68
|
+
- The maximum resolution allowed by your subscription tier. See our [pricing page](https://magichour.ai/pricing) for more details.
|
|
69
|
+
|
|
70
|
+
This field is retained only for backward compatibility and will be removed in a future release.
|
|
71
|
+
"""
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
class _SerializerV1VideoToVideoCreateBody(pydantic.BaseModel):
|
|
75
|
+
"""
|
|
76
|
+
Serializer for V1VideoToVideoCreateBody handling case conversions
|
|
77
|
+
and file omissions as dictated by the API
|
|
78
|
+
"""
|
|
79
|
+
|
|
80
|
+
model_config = pydantic.ConfigDict(
|
|
81
|
+
populate_by_name=True,
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
assets: _SerializerV1VideoToVideoCreateBodyAssets = pydantic.Field(
|
|
85
|
+
alias="assets",
|
|
86
|
+
)
|
|
87
|
+
end_seconds: float = pydantic.Field(
|
|
88
|
+
alias="end_seconds",
|
|
89
|
+
)
|
|
90
|
+
fps_resolution: typing.Optional[typing_extensions.Literal["FULL", "HALF"]] = (
|
|
91
|
+
pydantic.Field(alias="fps_resolution", default=None)
|
|
92
|
+
)
|
|
93
|
+
height: typing.Optional[int] = pydantic.Field(alias="height", default=None)
|
|
94
|
+
name: typing.Optional[str] = pydantic.Field(alias="name", default=None)
|
|
95
|
+
start_seconds: float = pydantic.Field(
|
|
96
|
+
alias="start_seconds",
|
|
97
|
+
)
|
|
98
|
+
style: _SerializerV1VideoToVideoCreateBodyStyle = pydantic.Field(
|
|
99
|
+
alias="style",
|
|
100
|
+
)
|
|
101
|
+
width: typing.Optional[int] = pydantic.Field(alias="width", default=None)
|
|
@@ -3,14 +3,19 @@ import typing
|
|
|
3
3
|
import typing_extensions
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
class
|
|
6
|
+
class V1VideoToVideoCreateBodyAssets(typing_extensions.TypedDict):
|
|
7
7
|
"""
|
|
8
8
|
Provide the assets for video-to-video. For video, The `video_source` field determines whether `video_file_path` or `youtube_url` field is used
|
|
9
9
|
"""
|
|
10
10
|
|
|
11
11
|
video_file_path: typing_extensions.NotRequired[str]
|
|
12
12
|
"""
|
|
13
|
-
|
|
13
|
+
Required if `video_source` is `file`. This value is either
|
|
14
|
+
- a direct URL to the video file
|
|
15
|
+
- `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls).
|
|
16
|
+
|
|
17
|
+
Please refer to the [Input File documentation](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) to learn more.
|
|
18
|
+
|
|
14
19
|
"""
|
|
15
20
|
|
|
16
21
|
video_source: typing_extensions.Required[
|
|
@@ -23,9 +28,9 @@ class PostV1VideoToVideoBodyAssets(typing_extensions.TypedDict):
|
|
|
23
28
|
"""
|
|
24
29
|
|
|
25
30
|
|
|
26
|
-
class
|
|
31
|
+
class _SerializerV1VideoToVideoCreateBodyAssets(pydantic.BaseModel):
|
|
27
32
|
"""
|
|
28
|
-
Serializer for
|
|
33
|
+
Serializer for V1VideoToVideoCreateBodyAssets handling case conversions
|
|
29
34
|
and file omissions as dictated by the API
|
|
30
35
|
"""
|
|
31
36
|
|