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,58 @@
|
|
|
1
|
+
import pydantic
|
|
2
|
+
import typing_extensions
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class V1AiClothesChangerCreateBodyAssets(typing_extensions.TypedDict):
|
|
6
|
+
"""
|
|
7
|
+
Provide the assets for clothes changer
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
garment_file_path: typing_extensions.Required[str]
|
|
11
|
+
"""
|
|
12
|
+
The image of the outfit. 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
|
+
garment_type: typing_extensions.Required[
|
|
21
|
+
typing_extensions.Literal["dresses", "lower_body", "upper_body"]
|
|
22
|
+
]
|
|
23
|
+
"""
|
|
24
|
+
The type of the outfit.
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
person_file_path: typing_extensions.Required[str]
|
|
28
|
+
"""
|
|
29
|
+
The image with the person. This value is either
|
|
30
|
+
- a direct URL to the video file
|
|
31
|
+
- `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls).
|
|
32
|
+
|
|
33
|
+
Please refer to the [Input File documentation](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) to learn more.
|
|
34
|
+
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class _SerializerV1AiClothesChangerCreateBodyAssets(pydantic.BaseModel):
|
|
39
|
+
"""
|
|
40
|
+
Serializer for V1AiClothesChangerCreateBodyAssets handling case conversions
|
|
41
|
+
and file omissions as dictated by the API
|
|
42
|
+
"""
|
|
43
|
+
|
|
44
|
+
model_config = pydantic.ConfigDict(
|
|
45
|
+
populate_by_name=True,
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
garment_file_path: str = pydantic.Field(
|
|
49
|
+
alias="garment_file_path",
|
|
50
|
+
)
|
|
51
|
+
garment_type: typing_extensions.Literal["dresses", "lower_body", "upper_body"] = (
|
|
52
|
+
pydantic.Field(
|
|
53
|
+
alias="garment_type",
|
|
54
|
+
)
|
|
55
|
+
)
|
|
56
|
+
person_file_path: str = pydantic.Field(
|
|
57
|
+
alias="person_file_path",
|
|
58
|
+
)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import pydantic
|
|
2
|
+
import typing_extensions
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class V1AiClothesChangerGenerateBodyAssets(typing_extensions.TypedDict):
|
|
6
|
+
"""
|
|
7
|
+
Provide the assets for clothes changer
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
garment_file_path: typing_extensions.Required[str]
|
|
11
|
+
"""
|
|
12
|
+
The image of the outfit. 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
|
+
"""
|
|
18
|
+
|
|
19
|
+
garment_type: typing_extensions.Required[
|
|
20
|
+
typing_extensions.Literal["dresses", "lower_body", "upper_body"]
|
|
21
|
+
]
|
|
22
|
+
"""
|
|
23
|
+
The type of the outfit.
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
person_file_path: typing_extensions.Required[str]
|
|
27
|
+
"""
|
|
28
|
+
The image with the person. This value is either
|
|
29
|
+
- a direct URL to the image file
|
|
30
|
+
- a path to a local file
|
|
31
|
+
|
|
32
|
+
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.
|
|
33
|
+
"""
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import pydantic
|
|
2
|
+
import typing
|
|
3
|
+
import typing_extensions
|
|
4
|
+
|
|
5
|
+
from .v1_ai_face_editor_create_body_assets import (
|
|
6
|
+
V1AiFaceEditorCreateBodyAssets,
|
|
7
|
+
_SerializerV1AiFaceEditorCreateBodyAssets,
|
|
8
|
+
)
|
|
9
|
+
from .v1_ai_face_editor_create_body_style import (
|
|
10
|
+
V1AiFaceEditorCreateBodyStyle,
|
|
11
|
+
_SerializerV1AiFaceEditorCreateBodyStyle,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class V1AiFaceEditorCreateBody(typing_extensions.TypedDict):
|
|
16
|
+
"""
|
|
17
|
+
V1AiFaceEditorCreateBody
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
assets: typing_extensions.Required[V1AiFaceEditorCreateBodyAssets]
|
|
21
|
+
"""
|
|
22
|
+
Provide the assets for face editor
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
name: typing_extensions.NotRequired[str]
|
|
26
|
+
"""
|
|
27
|
+
The name of image. This value is mainly used for your own identification of the image.
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
style: typing_extensions.Required[V1AiFaceEditorCreateBodyStyle]
|
|
31
|
+
"""
|
|
32
|
+
Face editing parameters
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class _SerializerV1AiFaceEditorCreateBody(pydantic.BaseModel):
|
|
37
|
+
"""
|
|
38
|
+
Serializer for V1AiFaceEditorCreateBody handling case conversions
|
|
39
|
+
and file omissions as dictated by the API
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
model_config = pydantic.ConfigDict(
|
|
43
|
+
populate_by_name=True,
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
assets: _SerializerV1AiFaceEditorCreateBodyAssets = pydantic.Field(
|
|
47
|
+
alias="assets",
|
|
48
|
+
)
|
|
49
|
+
name: typing.Optional[str] = pydantic.Field(alias="name", default=None)
|
|
50
|
+
style: _SerializerV1AiFaceEditorCreateBodyStyle = pydantic.Field(
|
|
51
|
+
alias="style",
|
|
52
|
+
)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import pydantic
|
|
2
|
+
import typing_extensions
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class V1AiFaceEditorCreateBodyAssets(typing_extensions.TypedDict):
|
|
6
|
+
"""
|
|
7
|
+
Provide the assets for face editor
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
image_file_path: typing_extensions.Required[str]
|
|
11
|
+
"""
|
|
12
|
+
This is the image whose face will be edited. 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 _SerializerV1AiFaceEditorCreateBodyAssets(pydantic.BaseModel):
|
|
22
|
+
"""
|
|
23
|
+
Serializer for V1AiFaceEditorCreateBodyAssets 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,137 @@
|
|
|
1
|
+
import pydantic
|
|
2
|
+
import typing
|
|
3
|
+
import typing_extensions
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class V1AiFaceEditorCreateBodyStyle(typing_extensions.TypedDict):
|
|
7
|
+
"""
|
|
8
|
+
Face editing parameters
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
enhance_face: typing_extensions.NotRequired[bool]
|
|
12
|
+
"""
|
|
13
|
+
Enhance face features
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
eye_gaze_horizontal: typing_extensions.NotRequired[float]
|
|
17
|
+
"""
|
|
18
|
+
Horizontal eye gaze (-100 to 100), in increments of 5
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
eye_gaze_vertical: typing_extensions.NotRequired[float]
|
|
22
|
+
"""
|
|
23
|
+
Vertical eye gaze (-100 to 100), in increments of 5
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
eye_open_ratio: typing_extensions.NotRequired[float]
|
|
27
|
+
"""
|
|
28
|
+
Eye open ratio (-100 to 100), in increments of 5
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
eyebrow_direction: typing_extensions.NotRequired[float]
|
|
32
|
+
"""
|
|
33
|
+
Eyebrow direction (-100 to 100), in increments of 5
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
head_pitch: typing_extensions.NotRequired[float]
|
|
37
|
+
"""
|
|
38
|
+
Head pitch (-100 to 100), in increments of 5
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
head_roll: typing_extensions.NotRequired[float]
|
|
42
|
+
"""
|
|
43
|
+
Head roll (-100 to 100), in increments of 5
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
head_yaw: typing_extensions.NotRequired[float]
|
|
47
|
+
"""
|
|
48
|
+
Head yaw (-100 to 100), in increments of 5
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
lip_open_ratio: typing_extensions.NotRequired[float]
|
|
52
|
+
"""
|
|
53
|
+
Lip open ratio (-100 to 100), in increments of 5
|
|
54
|
+
"""
|
|
55
|
+
|
|
56
|
+
mouth_grim: typing_extensions.NotRequired[float]
|
|
57
|
+
"""
|
|
58
|
+
Mouth grim (-100 to 100), in increments of 5
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
mouth_position_horizontal: typing_extensions.NotRequired[float]
|
|
62
|
+
"""
|
|
63
|
+
Horizontal mouth position (-100 to 100), in increments of 5
|
|
64
|
+
"""
|
|
65
|
+
|
|
66
|
+
mouth_position_vertical: typing_extensions.NotRequired[float]
|
|
67
|
+
"""
|
|
68
|
+
Vertical mouth position (-100 to 100), in increments of 5
|
|
69
|
+
"""
|
|
70
|
+
|
|
71
|
+
mouth_pout: typing_extensions.NotRequired[float]
|
|
72
|
+
"""
|
|
73
|
+
Mouth pout (-100 to 100), in increments of 5
|
|
74
|
+
"""
|
|
75
|
+
|
|
76
|
+
mouth_purse: typing_extensions.NotRequired[float]
|
|
77
|
+
"""
|
|
78
|
+
Mouth purse (-100 to 100), in increments of 5
|
|
79
|
+
"""
|
|
80
|
+
|
|
81
|
+
mouth_smile: typing_extensions.NotRequired[float]
|
|
82
|
+
"""
|
|
83
|
+
Mouth smile (-100 to 100), in increments of 5
|
|
84
|
+
"""
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
class _SerializerV1AiFaceEditorCreateBodyStyle(pydantic.BaseModel):
|
|
88
|
+
"""
|
|
89
|
+
Serializer for V1AiFaceEditorCreateBodyStyle handling case conversions
|
|
90
|
+
and file omissions as dictated by the API
|
|
91
|
+
"""
|
|
92
|
+
|
|
93
|
+
model_config = pydantic.ConfigDict(
|
|
94
|
+
populate_by_name=True,
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
enhance_face: typing.Optional[bool] = pydantic.Field(
|
|
98
|
+
alias="enhance_face", default=None
|
|
99
|
+
)
|
|
100
|
+
eye_gaze_horizontal: typing.Optional[float] = pydantic.Field(
|
|
101
|
+
alias="eye_gaze_horizontal", default=None
|
|
102
|
+
)
|
|
103
|
+
eye_gaze_vertical: typing.Optional[float] = pydantic.Field(
|
|
104
|
+
alias="eye_gaze_vertical", default=None
|
|
105
|
+
)
|
|
106
|
+
eye_open_ratio: typing.Optional[float] = pydantic.Field(
|
|
107
|
+
alias="eye_open_ratio", default=None
|
|
108
|
+
)
|
|
109
|
+
eyebrow_direction: typing.Optional[float] = pydantic.Field(
|
|
110
|
+
alias="eyebrow_direction", default=None
|
|
111
|
+
)
|
|
112
|
+
head_pitch: typing.Optional[float] = pydantic.Field(
|
|
113
|
+
alias="head_pitch", default=None
|
|
114
|
+
)
|
|
115
|
+
head_roll: typing.Optional[float] = pydantic.Field(alias="head_roll", default=None)
|
|
116
|
+
head_yaw: typing.Optional[float] = pydantic.Field(alias="head_yaw", default=None)
|
|
117
|
+
lip_open_ratio: typing.Optional[float] = pydantic.Field(
|
|
118
|
+
alias="lip_open_ratio", default=None
|
|
119
|
+
)
|
|
120
|
+
mouth_grim: typing.Optional[float] = pydantic.Field(
|
|
121
|
+
alias="mouth_grim", default=None
|
|
122
|
+
)
|
|
123
|
+
mouth_position_horizontal: typing.Optional[float] = pydantic.Field(
|
|
124
|
+
alias="mouth_position_horizontal", default=None
|
|
125
|
+
)
|
|
126
|
+
mouth_position_vertical: typing.Optional[float] = pydantic.Field(
|
|
127
|
+
alias="mouth_position_vertical", default=None
|
|
128
|
+
)
|
|
129
|
+
mouth_pout: typing.Optional[float] = pydantic.Field(
|
|
130
|
+
alias="mouth_pout", default=None
|
|
131
|
+
)
|
|
132
|
+
mouth_purse: typing.Optional[float] = pydantic.Field(
|
|
133
|
+
alias="mouth_purse", default=None
|
|
134
|
+
)
|
|
135
|
+
mouth_smile: typing.Optional[float] = pydantic.Field(
|
|
136
|
+
alias="mouth_smile", default=None
|
|
137
|
+
)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import pydantic
|
|
2
|
+
import typing_extensions
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class V1AiFaceEditorGenerateBodyAssets(typing_extensions.TypedDict):
|
|
6
|
+
"""
|
|
7
|
+
Provide the assets for face editor
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
image_file_path: typing_extensions.Required[str]
|
|
11
|
+
"""
|
|
12
|
+
This is the image whose face will be edited. 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,47 @@
|
|
|
1
|
+
import pydantic
|
|
2
|
+
import typing
|
|
3
|
+
import typing_extensions
|
|
4
|
+
|
|
5
|
+
from .v1_ai_gif_generator_create_body_style import (
|
|
6
|
+
V1AiGifGeneratorCreateBodyStyle,
|
|
7
|
+
_SerializerV1AiGifGeneratorCreateBodyStyle,
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class V1AiGifGeneratorCreateBody(typing_extensions.TypedDict):
|
|
12
|
+
"""
|
|
13
|
+
V1AiGifGeneratorCreateBody
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
name: typing_extensions.NotRequired[str]
|
|
17
|
+
"""
|
|
18
|
+
The name of gif. This value is mainly used for your own identification of the gif.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
output_format: typing_extensions.NotRequired[
|
|
22
|
+
typing_extensions.Literal["gif", "mp4", "webm"]
|
|
23
|
+
]
|
|
24
|
+
"""
|
|
25
|
+
The output file format for the generated animation.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
style: typing_extensions.Required[V1AiGifGeneratorCreateBodyStyle]
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class _SerializerV1AiGifGeneratorCreateBody(pydantic.BaseModel):
|
|
32
|
+
"""
|
|
33
|
+
Serializer for V1AiGifGeneratorCreateBody handling case conversions
|
|
34
|
+
and file omissions as dictated by the API
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
model_config = pydantic.ConfigDict(
|
|
38
|
+
populate_by_name=True,
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
name: typing.Optional[str] = pydantic.Field(alias="name", default=None)
|
|
42
|
+
output_format: typing.Optional[typing_extensions.Literal["gif", "mp4", "webm"]] = (
|
|
43
|
+
pydantic.Field(alias="output_format", default=None)
|
|
44
|
+
)
|
|
45
|
+
style: _SerializerV1AiGifGeneratorCreateBodyStyle = pydantic.Field(
|
|
46
|
+
alias="style",
|
|
47
|
+
)
|
|
@@ -2,20 +2,20 @@ import pydantic
|
|
|
2
2
|
import typing_extensions
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
class
|
|
5
|
+
class V1AiGifGeneratorCreateBodyStyle(typing_extensions.TypedDict):
|
|
6
6
|
"""
|
|
7
|
-
|
|
7
|
+
V1AiGifGeneratorCreateBodyStyle
|
|
8
8
|
"""
|
|
9
9
|
|
|
10
10
|
prompt: typing_extensions.Required[str]
|
|
11
11
|
"""
|
|
12
|
-
The prompt used for the
|
|
12
|
+
The prompt used for the GIF.
|
|
13
13
|
"""
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
class
|
|
16
|
+
class _SerializerV1AiGifGeneratorCreateBodyStyle(pydantic.BaseModel):
|
|
17
17
|
"""
|
|
18
|
-
Serializer for
|
|
18
|
+
Serializer for V1AiGifGeneratorCreateBodyStyle handling case conversions
|
|
19
19
|
and file omissions as dictated by the API
|
|
20
20
|
"""
|
|
21
21
|
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import pydantic
|
|
2
|
+
import typing
|
|
3
|
+
import typing_extensions
|
|
4
|
+
|
|
5
|
+
from .v1_ai_headshot_generator_create_body_assets import (
|
|
6
|
+
V1AiHeadshotGeneratorCreateBodyAssets,
|
|
7
|
+
_SerializerV1AiHeadshotGeneratorCreateBodyAssets,
|
|
8
|
+
)
|
|
9
|
+
from .v1_ai_headshot_generator_create_body_style import (
|
|
10
|
+
V1AiHeadshotGeneratorCreateBodyStyle,
|
|
11
|
+
_SerializerV1AiHeadshotGeneratorCreateBodyStyle,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class V1AiHeadshotGeneratorCreateBody(typing_extensions.TypedDict):
|
|
16
|
+
"""
|
|
17
|
+
V1AiHeadshotGeneratorCreateBody
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
assets: typing_extensions.Required[V1AiHeadshotGeneratorCreateBodyAssets]
|
|
21
|
+
"""
|
|
22
|
+
Provide the assets for headshot photo
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
name: typing_extensions.NotRequired[str]
|
|
26
|
+
"""
|
|
27
|
+
The name of image. This value is mainly used for your own identification of the image.
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
style: typing_extensions.NotRequired[V1AiHeadshotGeneratorCreateBodyStyle]
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class _SerializerV1AiHeadshotGeneratorCreateBody(pydantic.BaseModel):
|
|
34
|
+
"""
|
|
35
|
+
Serializer for V1AiHeadshotGeneratorCreateBody handling case conversions
|
|
36
|
+
and file omissions as dictated by the API
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
model_config = pydantic.ConfigDict(
|
|
40
|
+
populate_by_name=True,
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
assets: _SerializerV1AiHeadshotGeneratorCreateBodyAssets = pydantic.Field(
|
|
44
|
+
alias="assets",
|
|
45
|
+
)
|
|
46
|
+
name: typing.Optional[str] = pydantic.Field(alias="name", default=None)
|
|
47
|
+
style: typing.Optional[_SerializerV1AiHeadshotGeneratorCreateBodyStyle] = (
|
|
48
|
+
pydantic.Field(alias="style", default=None)
|
|
49
|
+
)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import pydantic
|
|
2
|
+
import typing_extensions
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class V1AiHeadshotGeneratorCreateBodyAssets(typing_extensions.TypedDict):
|
|
6
|
+
"""
|
|
7
|
+
Provide the assets for headshot photo
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
image_file_path: typing_extensions.Required[str]
|
|
11
|
+
"""
|
|
12
|
+
The image used to generate the headshot. This image must contain one detectable face. 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 _SerializerV1AiHeadshotGeneratorCreateBodyAssets(pydantic.BaseModel):
|
|
22
|
+
"""
|
|
23
|
+
Serializer for V1AiHeadshotGeneratorCreateBodyAssets 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,27 @@
|
|
|
1
|
+
import pydantic
|
|
2
|
+
import typing
|
|
3
|
+
import typing_extensions
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class V1AiHeadshotGeneratorCreateBodyStyle(typing_extensions.TypedDict):
|
|
7
|
+
"""
|
|
8
|
+
V1AiHeadshotGeneratorCreateBodyStyle
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
prompt: typing_extensions.NotRequired[str]
|
|
12
|
+
"""
|
|
13
|
+
Prompt used to guide the style of your headshot. We recommend omitting the prompt unless you want to customize your headshot. You can visit [AI headshot generator](https://magichour.ai/create/ai-headshot-generator) to view an example of a good prompt used for our 'Professional' style.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class _SerializerV1AiHeadshotGeneratorCreateBodyStyle(pydantic.BaseModel):
|
|
18
|
+
"""
|
|
19
|
+
Serializer for V1AiHeadshotGeneratorCreateBodyStyle handling case conversions
|
|
20
|
+
and file omissions as dictated by the API
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
model_config = pydantic.ConfigDict(
|
|
24
|
+
populate_by_name=True,
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
prompt: typing.Optional[str] = pydantic.Field(alias="prompt", default=None)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import pydantic
|
|
2
|
+
import typing_extensions
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class V1AiHeadshotGeneratorGenerateBodyAssets(typing_extensions.TypedDict):
|
|
6
|
+
"""
|
|
7
|
+
Provide the assets for headshot photo
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
image_file_path: typing_extensions.Required[str]
|
|
11
|
+
"""
|
|
12
|
+
The image used to generate the headshot. This image must contain one detectable face. 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,49 @@
|
|
|
1
|
+
import pydantic
|
|
2
|
+
import typing
|
|
3
|
+
import typing_extensions
|
|
4
|
+
|
|
5
|
+
from .v1_ai_image_editor_create_body_assets import (
|
|
6
|
+
V1AiImageEditorCreateBodyAssets,
|
|
7
|
+
_SerializerV1AiImageEditorCreateBodyAssets,
|
|
8
|
+
)
|
|
9
|
+
from .v1_ai_image_editor_create_body_style import (
|
|
10
|
+
V1AiImageEditorCreateBodyStyle,
|
|
11
|
+
_SerializerV1AiImageEditorCreateBodyStyle,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class V1AiImageEditorCreateBody(typing_extensions.TypedDict):
|
|
16
|
+
"""
|
|
17
|
+
V1AiImageEditorCreateBody
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
assets: typing_extensions.Required[V1AiImageEditorCreateBodyAssets]
|
|
21
|
+
"""
|
|
22
|
+
Provide the assets for image edit
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
name: typing_extensions.NotRequired[str]
|
|
26
|
+
"""
|
|
27
|
+
The name of image. This value is mainly used for your own identification of the image.
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
style: typing_extensions.Required[V1AiImageEditorCreateBodyStyle]
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class _SerializerV1AiImageEditorCreateBody(pydantic.BaseModel):
|
|
34
|
+
"""
|
|
35
|
+
Serializer for V1AiImageEditorCreateBody handling case conversions
|
|
36
|
+
and file omissions as dictated by the API
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
model_config = pydantic.ConfigDict(
|
|
40
|
+
populate_by_name=True,
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
assets: _SerializerV1AiImageEditorCreateBodyAssets = pydantic.Field(
|
|
44
|
+
alias="assets",
|
|
45
|
+
)
|
|
46
|
+
name: typing.Optional[str] = pydantic.Field(alias="name", default=None)
|
|
47
|
+
style: _SerializerV1AiImageEditorCreateBodyStyle = pydantic.Field(
|
|
48
|
+
alias="style",
|
|
49
|
+
)
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import pydantic
|
|
2
|
+
import typing
|
|
3
|
+
import typing_extensions
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class V1AiImageEditorCreateBodyAssets(typing_extensions.TypedDict):
|
|
7
|
+
"""
|
|
8
|
+
Provide the assets for image edit
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
image_file_path: typing_extensions.NotRequired[str]
|
|
12
|
+
"""
|
|
13
|
+
Deprecated: Please use `image_file_paths` instead as edits with multiple images are now supported. The image used in the edit. 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
|
+
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
image_file_paths: typing_extensions.NotRequired[typing.List[str]]
|
|
22
|
+
"""
|
|
23
|
+
The image(s) used in the edit, maximum of 10 images. 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
|
+
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class _SerializerV1AiImageEditorCreateBodyAssets(pydantic.BaseModel):
|
|
33
|
+
"""
|
|
34
|
+
Serializer for V1AiImageEditorCreateBodyAssets handling case conversions
|
|
35
|
+
and file omissions as dictated by the API
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
model_config = pydantic.ConfigDict(
|
|
39
|
+
populate_by_name=True,
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
image_file_path: typing.Optional[str] = pydantic.Field(
|
|
43
|
+
alias="image_file_path", default=None
|
|
44
|
+
)
|
|
45
|
+
image_file_paths: typing.Optional[typing.List[str]] = pydantic.Field(
|
|
46
|
+
alias="image_file_paths", default=None
|
|
47
|
+
)
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import pydantic
|
|
2
|
+
import typing
|
|
3
|
+
import typing_extensions
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class V1AiImageEditorCreateBodyStyle(typing_extensions.TypedDict):
|
|
7
|
+
"""
|
|
8
|
+
V1AiImageEditorCreateBodyStyle
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
model: typing_extensions.NotRequired[
|
|
12
|
+
typing_extensions.Literal["Nano Banana", "Seedream", "default"]
|
|
13
|
+
]
|
|
14
|
+
"""
|
|
15
|
+
The AI model to use for image editing. * `Nano Banana` - Precise, realistic edits with consistent results
|
|
16
|
+
* `Seedream` - Creative, imaginative images with artistic freedom
|
|
17
|
+
* `default` - Use the model we recommend, which will change over time. This is recommended unless you need a specific model. This is the default behavior.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
prompt: typing_extensions.Required[str]
|
|
21
|
+
"""
|
|
22
|
+
The prompt used to edit the image.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class _SerializerV1AiImageEditorCreateBodyStyle(pydantic.BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
Serializer for V1AiImageEditorCreateBodyStyle handling case conversions
|
|
29
|
+
and file omissions as dictated by the API
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
model_config = pydantic.ConfigDict(
|
|
33
|
+
populate_by_name=True,
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
model: typing.Optional[
|
|
37
|
+
typing_extensions.Literal["Nano Banana", "Seedream", "default"]
|
|
38
|
+
] = pydantic.Field(alias="model", default=None)
|
|
39
|
+
prompt: str = pydantic.Field(
|
|
40
|
+
alias="prompt",
|
|
41
|
+
)
|