magic_hour 0.18.0__tar.gz → 0.20.0__tar.gz
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.
Potentially problematic release.
This version of magic_hour might be problematic. Click here for more details.
- {magic_hour-0.18.0 → magic_hour-0.20.0}/PKG-INFO +5 -1
- {magic_hour-0.18.0 → magic_hour-0.20.0}/README.md +4 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/core/__init__.py +2 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/core/query.py +23 -10
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/core/request.py +27 -21
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/environment.py +1 -1
- magic_hour-0.20.0/magic_hour/resources/v1/ai_gif_generator/README.md +31 -0
- magic_hour-0.20.0/magic_hour/resources/v1/ai_gif_generator/__init__.py +4 -0
- magic_hour-0.20.0/magic_hour/resources/v1/ai_gif_generator/client.py +117 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/client.py +6 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/video_to_video/client.py +52 -16
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/models/__init__.py +2 -0
- magic_hour-0.20.0/magic_hour/types/models/v1_ai_gif_generator_create_response.py +25 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/models/v1_image_projects_get_response.py +1 -1
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/__init__.py +12 -0
- magic_hour-0.20.0/magic_hour/types/params/v1_ai_gif_generator_create_body.py +37 -0
- magic_hour-0.20.0/magic_hour/types/params/v1_ai_gif_generator_create_body_style.py +28 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_video_to_video_create_body.py +20 -10
- {magic_hour-0.18.0 → magic_hour-0.20.0}/pyproject.toml +1 -1
- {magic_hour-0.18.0 → magic_hour-0.20.0}/LICENSE +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/__init__.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/client.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/core/api_error.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/core/auth.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/core/base_client.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/core/binary_response.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/core/response.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/core/type_utils.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/core/utils.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/__init__.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/ai_clothes_changer/README.md +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/ai_clothes_changer/__init__.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/ai_clothes_changer/client.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/ai_face_editor/README.md +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/ai_face_editor/__init__.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/ai_face_editor/client.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/ai_headshot_generator/README.md +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/ai_headshot_generator/__init__.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/ai_headshot_generator/client.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/ai_image_generator/README.md +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/ai_image_generator/__init__.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/ai_image_generator/client.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/ai_image_upscaler/README.md +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/ai_image_upscaler/__init__.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/ai_image_upscaler/client.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/ai_meme_generator/README.md +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/ai_meme_generator/__init__.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/ai_meme_generator/client.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/ai_photo_editor/README.md +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/ai_photo_editor/__init__.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/ai_photo_editor/client.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/ai_qr_code_generator/README.md +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/ai_qr_code_generator/__init__.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/ai_qr_code_generator/client.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/ai_talking_photo/README.md +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/ai_talking_photo/__init__.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/ai_talking_photo/client.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/animation/README.md +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/animation/__init__.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/animation/client.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/face_swap/README.md +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/face_swap/__init__.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/face_swap/client.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/face_swap_photo/README.md +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/face_swap_photo/__init__.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/face_swap_photo/client.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/files/__init__.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/files/client.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/files/upload_urls/README.md +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/files/upload_urls/__init__.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/files/upload_urls/client.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/image_background_remover/README.md +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/image_background_remover/__init__.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/image_background_remover/client.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/image_projects/README.md +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/image_projects/__init__.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/image_projects/client.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/image_to_video/README.md +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/image_to_video/__init__.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/image_to_video/client.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/lip_sync/README.md +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/lip_sync/__init__.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/lip_sync/client.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/photo_colorizer/README.md +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/photo_colorizer/__init__.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/photo_colorizer/client.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/text_to_video/README.md +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/text_to_video/__init__.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/text_to_video/client.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/video_projects/README.md +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/video_projects/__init__.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/video_projects/client.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/video_to_video/README.md +4 -4
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/resources/v1/video_to_video/__init__.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/models/v1_ai_clothes_changer_create_response.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/models/v1_ai_face_editor_create_response.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/models/v1_ai_headshot_generator_create_response.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/models/v1_ai_image_generator_create_response.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/models/v1_ai_image_upscaler_create_response.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/models/v1_ai_meme_generator_create_response.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/models/v1_ai_photo_editor_create_response.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/models/v1_ai_qr_code_generator_create_response.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/models/v1_ai_talking_photo_create_response.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/models/v1_animation_create_response.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/models/v1_face_swap_create_response.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/models/v1_face_swap_photo_create_response.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/models/v1_files_upload_urls_create_response.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/models/v1_files_upload_urls_create_response_items_item.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/models/v1_image_background_remover_create_response.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/models/v1_image_projects_get_response_downloads_item.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/models/v1_image_projects_get_response_error.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/models/v1_image_to_video_create_response.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/models/v1_lip_sync_create_response.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/models/v1_photo_colorizer_create_response.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/models/v1_text_to_video_create_response.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/models/v1_video_projects_get_response.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/models/v1_video_projects_get_response_download.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/models/v1_video_projects_get_response_downloads_item.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/models/v1_video_projects_get_response_error.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/models/v1_video_to_video_create_response.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_ai_clothes_changer_create_body.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_ai_clothes_changer_create_body_assets.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_ai_face_editor_create_body.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_ai_face_editor_create_body_assets.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_ai_face_editor_create_body_style.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_ai_headshot_generator_create_body.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_ai_headshot_generator_create_body_assets.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_ai_headshot_generator_create_body_style.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_ai_image_generator_create_body.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_ai_image_generator_create_body_style.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_ai_image_upscaler_create_body.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_ai_image_upscaler_create_body_assets.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_ai_image_upscaler_create_body_style.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_ai_meme_generator_create_body.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_ai_meme_generator_create_body_style.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_ai_photo_editor_create_body.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_ai_photo_editor_create_body_assets.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_ai_photo_editor_create_body_style.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_ai_qr_code_generator_create_body.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_ai_qr_code_generator_create_body_style.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_ai_talking_photo_create_body.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_ai_talking_photo_create_body_assets.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_animation_create_body.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_animation_create_body_assets.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_animation_create_body_style.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_face_swap_create_body.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_face_swap_create_body_assets.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_face_swap_photo_create_body.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_face_swap_photo_create_body_assets.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_files_upload_urls_create_body.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_files_upload_urls_create_body_items_item.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_image_background_remover_create_body.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_image_background_remover_create_body_assets.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_image_to_video_create_body.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_image_to_video_create_body_assets.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_image_to_video_create_body_style.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_lip_sync_create_body.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_lip_sync_create_body_assets.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_photo_colorizer_create_body.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_photo_colorizer_create_body_assets.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_text_to_video_create_body.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_text_to_video_create_body_style.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_video_to_video_create_body_assets.py +0 -0
- {magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/params/v1_video_to_video_create_body_style.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: magic_hour
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.20.0
|
|
4
4
|
Summary: Python SDK for Magic Hour API
|
|
5
5
|
Requires-Python: >=3.8,<4.0
|
|
6
6
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -67,6 +67,10 @@ client = AsyncClient(token="my api key")
|
|
|
67
67
|
|
|
68
68
|
* [create](magic_hour/resources/v1/ai_face_editor/README.md#create) - AI Face Editor
|
|
69
69
|
|
|
70
|
+
### [v1.ai_gif_generator](magic_hour/resources/v1/ai_gif_generator/README.md)
|
|
71
|
+
|
|
72
|
+
* [create](magic_hour/resources/v1/ai_gif_generator/README.md#create) - AI GIFs
|
|
73
|
+
|
|
70
74
|
### [v1.ai_headshot_generator](magic_hour/resources/v1/ai_headshot_generator/README.md)
|
|
71
75
|
|
|
72
76
|
* [create](magic_hour/resources/v1/ai_headshot_generator/README.md#create) - AI Headshots
|
|
@@ -49,6 +49,10 @@ client = AsyncClient(token="my api key")
|
|
|
49
49
|
|
|
50
50
|
* [create](magic_hour/resources/v1/ai_face_editor/README.md#create) - AI Face Editor
|
|
51
51
|
|
|
52
|
+
### [v1.ai_gif_generator](magic_hour/resources/v1/ai_gif_generator/README.md)
|
|
53
|
+
|
|
54
|
+
* [create](magic_hour/resources/v1/ai_gif_generator/README.md#create) - AI GIFs
|
|
55
|
+
|
|
52
56
|
### [v1.ai_headshot_generator](magic_hour/resources/v1/ai_headshot_generator/README.md)
|
|
53
57
|
|
|
54
58
|
* [create](magic_hour/resources/v1/ai_headshot_generator/README.md#create) - AI Headshots
|
|
@@ -18,6 +18,7 @@ from .request import (
|
|
|
18
18
|
filter_not_given,
|
|
19
19
|
to_content,
|
|
20
20
|
to_encodable,
|
|
21
|
+
to_form_urlencoded,
|
|
21
22
|
RequestOptions,
|
|
22
23
|
default_request_options,
|
|
23
24
|
)
|
|
@@ -42,6 +43,7 @@ __all__ = [
|
|
|
42
43
|
"OAuth2ClientCredentialsForm",
|
|
43
44
|
"OAuth2PasswordForm",
|
|
44
45
|
"to_encodable",
|
|
46
|
+
"to_form_urlencoded",
|
|
45
47
|
"filter_not_given",
|
|
46
48
|
"to_content",
|
|
47
49
|
"encode_query_param",
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import json
|
|
2
|
+
|
|
1
3
|
from typing import Any, Dict, Union
|
|
2
4
|
from typing_extensions import Literal, Sequence
|
|
3
5
|
from urllib.parse import quote_plus, quote
|
|
@@ -9,13 +11,14 @@ import httpx
|
|
|
9
11
|
QueryParams = Dict[
|
|
10
12
|
str, Union[httpx._types.PrimitiveData, Sequence[httpx._types.PrimitiveData]]
|
|
11
13
|
]
|
|
14
|
+
QueryParamStyle = Literal["form", "spaceDelimited", "pipeDelimited", "deepObject"]
|
|
12
15
|
|
|
13
16
|
|
|
14
17
|
def encode_query_param(
|
|
15
18
|
params: QueryParams,
|
|
16
19
|
name: str,
|
|
17
20
|
value: Any,
|
|
18
|
-
style:
|
|
21
|
+
style: QueryParamStyle = "form",
|
|
19
22
|
explode: bool = True,
|
|
20
23
|
):
|
|
21
24
|
if style == "form":
|
|
@@ -30,6 +33,13 @@ def encode_query_param(
|
|
|
30
33
|
raise NotImplementedError(f"query param style '{style}' not implemented")
|
|
31
34
|
|
|
32
35
|
|
|
36
|
+
def _query_str(val: Any) -> str:
|
|
37
|
+
"""jsonify value without wrapping quotes for strings"""
|
|
38
|
+
if isinstance(val, str):
|
|
39
|
+
return val
|
|
40
|
+
return json.dumps(val)
|
|
41
|
+
|
|
42
|
+
|
|
33
43
|
def _encode_form(params: QueryParams, name: str, value: Any, explode: bool):
|
|
34
44
|
"""
|
|
35
45
|
Encodes query params in the `form` style as defined by OpenAPI with both explode and non-explode
|
|
@@ -37,18 +47,18 @@ def _encode_form(params: QueryParams, name: str, value: Any, explode: bool):
|
|
|
37
47
|
"""
|
|
38
48
|
if isinstance(value, list) and not explode:
|
|
39
49
|
# non-explode form lists should be encoded like /users?id=3,4,5
|
|
40
|
-
params[name] = quote_plus(",".join(map(
|
|
50
|
+
params[name] = quote_plus(",".join(map(_query_str, value)))
|
|
41
51
|
elif isinstance(value, dict):
|
|
42
52
|
if explode:
|
|
43
53
|
# explode form objects should be encoded like /users?key0=val0&key1=val1
|
|
44
54
|
# the input param name will be omitted
|
|
45
55
|
for k, v in value.items():
|
|
46
|
-
params[k] = quote_plus(
|
|
56
|
+
params[k] = quote_plus(_query_str(v))
|
|
47
57
|
else:
|
|
48
58
|
# non-explode form objects should be encoded like /users?id=key0,val0,key1,val1
|
|
49
59
|
encoded_chunks = []
|
|
50
60
|
for k, v in value.items():
|
|
51
|
-
encoded_chunks.extend([str(k),
|
|
61
|
+
encoded_chunks.extend([str(k), _query_str(v)])
|
|
52
62
|
params[name] = quote_plus(",".join(encoded_chunks))
|
|
53
63
|
else:
|
|
54
64
|
params[name] = value
|
|
@@ -61,7 +71,7 @@ def _encode_spaced_delimited(params: QueryParams, name: str, value: Any, explode
|
|
|
61
71
|
"""
|
|
62
72
|
if isinstance(value, list) and not explode:
|
|
63
73
|
# non-explode spaceDelimited lists should be encoded like /users?id=3%204%205
|
|
64
|
-
params[name] = quote(" ".join(map(
|
|
74
|
+
params[name] = quote(" ".join(map(_query_str, value)))
|
|
65
75
|
else:
|
|
66
76
|
# according to the docs, spaceDelimited + explode=false only effects lists,
|
|
67
77
|
# all other encodings are marked as n/a or are the same as `form` style
|
|
@@ -76,7 +86,7 @@ def _encode_pipe_delimited(params: QueryParams, name: str, value: Any, explode:
|
|
|
76
86
|
"""
|
|
77
87
|
if isinstance(value, list) and not explode:
|
|
78
88
|
# non-explode pipeDelimited lists should be encoded like /users?id=3|4|5
|
|
79
|
-
params[name] = quote("|".join(map(
|
|
89
|
+
params[name] = quote("|".join(map(_query_str, value)))
|
|
80
90
|
else:
|
|
81
91
|
# according to the docs, pipeDelimited + explode=false only effects lists,
|
|
82
92
|
# all other encodings are marked as n/a or are the same as `form` style
|
|
@@ -85,12 +95,15 @@ def _encode_pipe_delimited(params: QueryParams, name: str, value: Any, explode:
|
|
|
85
95
|
|
|
86
96
|
|
|
87
97
|
def _encode_deep_object(params: QueryParams, name: str, value: Any, explode: bool):
|
|
88
|
-
"""
|
|
89
|
-
|
|
98
|
+
"""
|
|
99
|
+
Encodes query params in the `deepObject` style as defined by with both explode and non-explode
|
|
100
|
+
variants.
|
|
101
|
+
"""
|
|
102
|
+
if isinstance(value, (dict, list)):
|
|
90
103
|
_encode_deep_object_key(params, name, value)
|
|
91
104
|
else:
|
|
92
105
|
# according to the docs, deepObject style only applies to
|
|
93
|
-
# object encodes, encodings for primitives
|
|
106
|
+
# object encodes, encodings for primitives are listed as n/a,
|
|
94
107
|
# fall back on form style as it is the default for query params
|
|
95
108
|
_encode_form(params, name, value, explode)
|
|
96
109
|
|
|
@@ -103,4 +116,4 @@ def _encode_deep_object_key(params: QueryParams, key: str, value: Any):
|
|
|
103
116
|
for i, v in enumerate(value):
|
|
104
117
|
_encode_deep_object_key(params, f"{key}[{i}]", v)
|
|
105
118
|
else:
|
|
106
|
-
params[key] = value
|
|
119
|
+
params[key] = _query_str(value)
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
from typing import Any, Dict, Type, Union,
|
|
2
|
-
from urllib.parse import quote_plus
|
|
1
|
+
from typing import Any, Dict, Type, Union, List, Mapping
|
|
3
2
|
|
|
4
3
|
import httpx
|
|
5
4
|
from typing_extensions import TypedDict, Required, NotRequired
|
|
6
5
|
from pydantic import TypeAdapter, BaseModel
|
|
7
6
|
|
|
8
7
|
from .type_utils import NotGiven
|
|
9
|
-
from .query import QueryParams
|
|
8
|
+
from .query import QueryParams, QueryParamStyle, encode_query_param
|
|
10
9
|
|
|
11
10
|
"""
|
|
12
11
|
Request configuration and utility functions for handling HTTP requests.
|
|
@@ -96,6 +95,31 @@ def to_encodable(
|
|
|
96
95
|
return model_dump(validated_item)
|
|
97
96
|
|
|
98
97
|
|
|
98
|
+
def to_form_urlencoded(
|
|
99
|
+
*,
|
|
100
|
+
item: Any,
|
|
101
|
+
dump_with: Union[Type, Union[Type, Any]],
|
|
102
|
+
style: Mapping[str, QueryParamStyle],
|
|
103
|
+
explode: Mapping[str, bool],
|
|
104
|
+
) -> Mapping[str, Any]:
|
|
105
|
+
"""
|
|
106
|
+
Encodes object as x-www-form-urlencoded according to style and explode options
|
|
107
|
+
"""
|
|
108
|
+
encoded = to_encodable(item=item, dump_with=dump_with)
|
|
109
|
+
|
|
110
|
+
if not isinstance(encoded, dict):
|
|
111
|
+
raise TypeError("x-www-form-urlencoded data must be an object at the top level")
|
|
112
|
+
|
|
113
|
+
form_data: QueryParams = {}
|
|
114
|
+
|
|
115
|
+
for key, val in encoded.items():
|
|
116
|
+
key_style = style.get(key, "form")
|
|
117
|
+
key_explode = explode.get(key, key_style == "form")
|
|
118
|
+
encode_query_param(form_data, key, val, style=key_style, explode=key_explode)
|
|
119
|
+
|
|
120
|
+
return form_data
|
|
121
|
+
|
|
122
|
+
|
|
99
123
|
def to_content(*, file: httpx._types.FileTypes) -> httpx._types.RequestContent:
|
|
100
124
|
"""
|
|
101
125
|
Converts the various ways files can be provided to something that is accepted by
|
|
@@ -112,24 +136,6 @@ def to_content(*, file: httpx._types.FileTypes) -> httpx._types.RequestContent:
|
|
|
112
136
|
return file_content
|
|
113
137
|
|
|
114
138
|
|
|
115
|
-
def encode_param(
|
|
116
|
-
value: Any, explode: bool
|
|
117
|
-
) -> Union[httpx._types.PrimitiveData, Sequence[httpx._types.PrimitiveData]]:
|
|
118
|
-
"""
|
|
119
|
-
Encodes parameter values for use in URLs.
|
|
120
|
-
|
|
121
|
-
Handles both simple values and collections, with special handling for
|
|
122
|
-
unexploded collections (combining them with commas) versus exploded ones.
|
|
123
|
-
|
|
124
|
-
Args:
|
|
125
|
-
explode: Whether to explode collections into separate parameters
|
|
126
|
-
"""
|
|
127
|
-
if isinstance(value, (list, dict)) and not explode:
|
|
128
|
-
return quote_plus(",".join(map(str, value)))
|
|
129
|
-
else:
|
|
130
|
-
return value
|
|
131
|
-
|
|
132
|
-
|
|
133
139
|
def filter_not_given(value: Any) -> Any:
|
|
134
140
|
"""Helper function to recursively filter out NotGiven values"""
|
|
135
141
|
if isinstance(value, NotGiven):
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
|
|
2
|
+
### create <a name="create"></a>
|
|
3
|
+
AI GIFs
|
|
4
|
+
|
|
5
|
+
Create an AI GIF. Each GIF costs 25 frames.
|
|
6
|
+
|
|
7
|
+
**API Endpoint**: `POST /v1/ai-gif-generator`
|
|
8
|
+
|
|
9
|
+
#### Synchronous Client
|
|
10
|
+
|
|
11
|
+
```python
|
|
12
|
+
from magic_hour import Client
|
|
13
|
+
from os import getenv
|
|
14
|
+
|
|
15
|
+
client = Client(token=getenv("API_TOKEN"))
|
|
16
|
+
res = client.v1.ai_gif_generator.create(
|
|
17
|
+
style={"prompt": "Cute dancing cat, pixel art"}, name="Ai Gif gif"
|
|
18
|
+
)
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
#### Asynchronous Client
|
|
22
|
+
|
|
23
|
+
```python
|
|
24
|
+
from magic_hour import AsyncClient
|
|
25
|
+
from os import getenv
|
|
26
|
+
|
|
27
|
+
client = AsyncClient(token=getenv("API_TOKEN"))
|
|
28
|
+
res = await client.v1.ai_gif_generator.create(
|
|
29
|
+
style={"prompt": "Cute dancing cat, pixel art"}, name="Ai Gif gif"
|
|
30
|
+
)
|
|
31
|
+
```
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import typing
|
|
2
|
+
|
|
3
|
+
from magic_hour.core import (
|
|
4
|
+
AsyncBaseClient,
|
|
5
|
+
RequestOptions,
|
|
6
|
+
SyncBaseClient,
|
|
7
|
+
default_request_options,
|
|
8
|
+
to_encodable,
|
|
9
|
+
type_utils,
|
|
10
|
+
)
|
|
11
|
+
from magic_hour.types import models, params
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class AiGifGeneratorClient:
|
|
15
|
+
def __init__(self, *, base_client: SyncBaseClient):
|
|
16
|
+
self._base_client = base_client
|
|
17
|
+
|
|
18
|
+
def create(
|
|
19
|
+
self,
|
|
20
|
+
*,
|
|
21
|
+
style: params.V1AiGifGeneratorCreateBodyStyle,
|
|
22
|
+
name: typing.Union[
|
|
23
|
+
typing.Optional[str], type_utils.NotGiven
|
|
24
|
+
] = type_utils.NOT_GIVEN,
|
|
25
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
26
|
+
) -> models.V1AiGifGeneratorCreateResponse:
|
|
27
|
+
"""
|
|
28
|
+
AI GIFs
|
|
29
|
+
|
|
30
|
+
Create an AI GIF. Each GIF costs 25 frames.
|
|
31
|
+
|
|
32
|
+
POST /v1/ai-gif-generator
|
|
33
|
+
|
|
34
|
+
Args:
|
|
35
|
+
name: The name of gif
|
|
36
|
+
style: V1AiGifGeneratorCreateBodyStyle
|
|
37
|
+
request_options: Additional options to customize the HTTP request
|
|
38
|
+
|
|
39
|
+
Returns:
|
|
40
|
+
Success
|
|
41
|
+
|
|
42
|
+
Raises:
|
|
43
|
+
ApiError: A custom exception class that provides additional context
|
|
44
|
+
for API errors, including the HTTP status code and response body.
|
|
45
|
+
|
|
46
|
+
Examples:
|
|
47
|
+
```py
|
|
48
|
+
client.v1.ai_gif_generator.create(
|
|
49
|
+
style={"prompt": "Cute dancing cat, pixel art"}, name="Ai Gif gif"
|
|
50
|
+
)
|
|
51
|
+
```
|
|
52
|
+
"""
|
|
53
|
+
_json = to_encodable(
|
|
54
|
+
item={"name": name, "style": style},
|
|
55
|
+
dump_with=params._SerializerV1AiGifGeneratorCreateBody,
|
|
56
|
+
)
|
|
57
|
+
return self._base_client.request(
|
|
58
|
+
method="POST",
|
|
59
|
+
path="/v1/ai-gif-generator",
|
|
60
|
+
auth_names=["bearerAuth"],
|
|
61
|
+
json=_json,
|
|
62
|
+
cast_to=models.V1AiGifGeneratorCreateResponse,
|
|
63
|
+
request_options=request_options or default_request_options(),
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
class AsyncAiGifGeneratorClient:
|
|
68
|
+
def __init__(self, *, base_client: AsyncBaseClient):
|
|
69
|
+
self._base_client = base_client
|
|
70
|
+
|
|
71
|
+
async def create(
|
|
72
|
+
self,
|
|
73
|
+
*,
|
|
74
|
+
style: params.V1AiGifGeneratorCreateBodyStyle,
|
|
75
|
+
name: typing.Union[
|
|
76
|
+
typing.Optional[str], type_utils.NotGiven
|
|
77
|
+
] = type_utils.NOT_GIVEN,
|
|
78
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
79
|
+
) -> models.V1AiGifGeneratorCreateResponse:
|
|
80
|
+
"""
|
|
81
|
+
AI GIFs
|
|
82
|
+
|
|
83
|
+
Create an AI GIF. Each GIF costs 25 frames.
|
|
84
|
+
|
|
85
|
+
POST /v1/ai-gif-generator
|
|
86
|
+
|
|
87
|
+
Args:
|
|
88
|
+
name: The name of gif
|
|
89
|
+
style: V1AiGifGeneratorCreateBodyStyle
|
|
90
|
+
request_options: Additional options to customize the HTTP request
|
|
91
|
+
|
|
92
|
+
Returns:
|
|
93
|
+
Success
|
|
94
|
+
|
|
95
|
+
Raises:
|
|
96
|
+
ApiError: A custom exception class that provides additional context
|
|
97
|
+
for API errors, including the HTTP status code and response body.
|
|
98
|
+
|
|
99
|
+
Examples:
|
|
100
|
+
```py
|
|
101
|
+
await client.v1.ai_gif_generator.create(
|
|
102
|
+
style={"prompt": "Cute dancing cat, pixel art"}, name="Ai Gif gif"
|
|
103
|
+
)
|
|
104
|
+
```
|
|
105
|
+
"""
|
|
106
|
+
_json = to_encodable(
|
|
107
|
+
item={"name": name, "style": style},
|
|
108
|
+
dump_with=params._SerializerV1AiGifGeneratorCreateBody,
|
|
109
|
+
)
|
|
110
|
+
return await self._base_client.request(
|
|
111
|
+
method="POST",
|
|
112
|
+
path="/v1/ai-gif-generator",
|
|
113
|
+
auth_names=["bearerAuth"],
|
|
114
|
+
json=_json,
|
|
115
|
+
cast_to=models.V1AiGifGeneratorCreateResponse,
|
|
116
|
+
request_options=request_options or default_request_options(),
|
|
117
|
+
)
|
|
@@ -7,6 +7,10 @@ from magic_hour.resources.v1.ai_face_editor import (
|
|
|
7
7
|
AiFaceEditorClient,
|
|
8
8
|
AsyncAiFaceEditorClient,
|
|
9
9
|
)
|
|
10
|
+
from magic_hour.resources.v1.ai_gif_generator import (
|
|
11
|
+
AiGifGeneratorClient,
|
|
12
|
+
AsyncAiGifGeneratorClient,
|
|
13
|
+
)
|
|
10
14
|
from magic_hour.resources.v1.ai_headshot_generator import (
|
|
11
15
|
AiHeadshotGeneratorClient,
|
|
12
16
|
AsyncAiHeadshotGeneratorClient,
|
|
@@ -80,6 +84,7 @@ class V1Client:
|
|
|
80
84
|
self.video_projects = VideoProjectsClient(base_client=self._base_client)
|
|
81
85
|
self.ai_clothes_changer = AiClothesChangerClient(base_client=self._base_client)
|
|
82
86
|
self.ai_face_editor = AiFaceEditorClient(base_client=self._base_client)
|
|
87
|
+
self.ai_gif_generator = AiGifGeneratorClient(base_client=self._base_client)
|
|
83
88
|
self.ai_headshot_generator = AiHeadshotGeneratorClient(
|
|
84
89
|
base_client=self._base_client
|
|
85
90
|
)
|
|
@@ -114,6 +119,7 @@ class AsyncV1Client:
|
|
|
114
119
|
base_client=self._base_client
|
|
115
120
|
)
|
|
116
121
|
self.ai_face_editor = AsyncAiFaceEditorClient(base_client=self._base_client)
|
|
122
|
+
self.ai_gif_generator = AsyncAiGifGeneratorClient(base_client=self._base_client)
|
|
117
123
|
self.ai_headshot_generator = AsyncAiHeadshotGeneratorClient(
|
|
118
124
|
base_client=self._base_client
|
|
119
125
|
)
|
|
@@ -21,17 +21,21 @@ class VideoToVideoClient:
|
|
|
21
21
|
*,
|
|
22
22
|
assets: params.V1VideoToVideoCreateBodyAssets,
|
|
23
23
|
end_seconds: float,
|
|
24
|
-
height: int,
|
|
25
24
|
start_seconds: float,
|
|
26
25
|
style: params.V1VideoToVideoCreateBodyStyle,
|
|
27
|
-
width: int,
|
|
28
26
|
fps_resolution: typing.Union[
|
|
29
27
|
typing.Optional[typing_extensions.Literal["FULL", "HALF"]],
|
|
30
28
|
type_utils.NotGiven,
|
|
31
29
|
] = type_utils.NOT_GIVEN,
|
|
30
|
+
height: typing.Union[
|
|
31
|
+
typing.Optional[int], type_utils.NotGiven
|
|
32
|
+
] = type_utils.NOT_GIVEN,
|
|
32
33
|
name: typing.Union[
|
|
33
34
|
typing.Optional[str], type_utils.NotGiven
|
|
34
35
|
] = type_utils.NOT_GIVEN,
|
|
36
|
+
width: typing.Union[
|
|
37
|
+
typing.Optional[int], type_utils.NotGiven
|
|
38
|
+
] = type_utils.NOT_GIVEN,
|
|
35
39
|
request_options: typing.Optional[RequestOptions] = None,
|
|
36
40
|
) -> models.V1VideoToVideoCreateResponse:
|
|
37
41
|
"""
|
|
@@ -48,13 +52,27 @@ class VideoToVideoClient:
|
|
|
48
52
|
fps_resolution: Determines whether the resulting video will have the same frame per second as the original video, or half.
|
|
49
53
|
* `FULL` - the result video will have the same FPS as the input video
|
|
50
54
|
* `HALF` - the result video will have half the FPS as the input video
|
|
55
|
+
height: Used to determine the dimensions of the output video.
|
|
56
|
+
|
|
57
|
+
* If height is provided, width will also be required. The larger value between width and height will be used to determine the maximum output resolution while maintaining the original aspect ratio.
|
|
58
|
+
* If both height and width are omitted, the video will be resized according to your subscription's maximum resolution, while preserving aspect ratio.
|
|
59
|
+
|
|
60
|
+
Note: if the video's original resolution is less than the maximum, the video will not be resized.
|
|
61
|
+
|
|
62
|
+
See our [pricing page](https://magichour.ai/pricing) for more details.
|
|
51
63
|
name: The name of video
|
|
64
|
+
width: Used to determine the dimensions of the output video.
|
|
65
|
+
|
|
66
|
+
* If width is provided, height will also be required. The larger value between width and height will be used to determine the maximum output resolution while maintaining the original aspect ratio.
|
|
67
|
+
* If both height and width are omitted, the video will be resized according to your subscription's maximum resolution, while preserving aspect ratio.
|
|
68
|
+
|
|
69
|
+
Note: if the video's original resolution is less than the maximum, the video will not be resized.
|
|
70
|
+
|
|
71
|
+
See our [pricing page](https://magichour.ai/pricing) for more details.
|
|
52
72
|
assets: Provide the assets for video-to-video. For video, The `video_source` field determines whether `video_file_path` or `youtube_url` field is used
|
|
53
73
|
end_seconds: The end time of the input video in seconds
|
|
54
|
-
height: The height of the final output video. Must be divisible by 64. The maximum height depends on your subscription. Please refer to our [pricing page](https://magichour.ai/pricing) for more details
|
|
55
74
|
start_seconds: The start time of the input video in seconds
|
|
56
75
|
style: V1VideoToVideoCreateBodyStyle
|
|
57
|
-
width: The width of the final output video. Must be divisible by 64. The maximum width depends on your subscription. Please refer to our [pricing page](https://magichour.ai/pricing) for more details
|
|
58
76
|
request_options: Additional options to customize the HTTP request
|
|
59
77
|
|
|
60
78
|
Returns:
|
|
@@ -72,7 +90,6 @@ class VideoToVideoClient:
|
|
|
72
90
|
"video_source": "file",
|
|
73
91
|
},
|
|
74
92
|
end_seconds=15.0,
|
|
75
|
-
height=960,
|
|
76
93
|
start_seconds=0.0,
|
|
77
94
|
style={
|
|
78
95
|
"art_style": "3D Render",
|
|
@@ -81,22 +98,23 @@ class VideoToVideoClient:
|
|
|
81
98
|
"prompt_type": "append_default",
|
|
82
99
|
"version": "default",
|
|
83
100
|
},
|
|
84
|
-
width=512,
|
|
85
101
|
fps_resolution="HALF",
|
|
102
|
+
height=960,
|
|
86
103
|
name="Video To Video video",
|
|
104
|
+
width=512,
|
|
87
105
|
)
|
|
88
106
|
```
|
|
89
107
|
"""
|
|
90
108
|
_json = to_encodable(
|
|
91
109
|
item={
|
|
92
110
|
"fps_resolution": fps_resolution,
|
|
111
|
+
"height": height,
|
|
93
112
|
"name": name,
|
|
113
|
+
"width": width,
|
|
94
114
|
"assets": assets,
|
|
95
115
|
"end_seconds": end_seconds,
|
|
96
|
-
"height": height,
|
|
97
116
|
"start_seconds": start_seconds,
|
|
98
117
|
"style": style,
|
|
99
|
-
"width": width,
|
|
100
118
|
},
|
|
101
119
|
dump_with=params._SerializerV1VideoToVideoCreateBody,
|
|
102
120
|
)
|
|
@@ -119,17 +137,21 @@ class AsyncVideoToVideoClient:
|
|
|
119
137
|
*,
|
|
120
138
|
assets: params.V1VideoToVideoCreateBodyAssets,
|
|
121
139
|
end_seconds: float,
|
|
122
|
-
height: int,
|
|
123
140
|
start_seconds: float,
|
|
124
141
|
style: params.V1VideoToVideoCreateBodyStyle,
|
|
125
|
-
width: int,
|
|
126
142
|
fps_resolution: typing.Union[
|
|
127
143
|
typing.Optional[typing_extensions.Literal["FULL", "HALF"]],
|
|
128
144
|
type_utils.NotGiven,
|
|
129
145
|
] = type_utils.NOT_GIVEN,
|
|
146
|
+
height: typing.Union[
|
|
147
|
+
typing.Optional[int], type_utils.NotGiven
|
|
148
|
+
] = type_utils.NOT_GIVEN,
|
|
130
149
|
name: typing.Union[
|
|
131
150
|
typing.Optional[str], type_utils.NotGiven
|
|
132
151
|
] = type_utils.NOT_GIVEN,
|
|
152
|
+
width: typing.Union[
|
|
153
|
+
typing.Optional[int], type_utils.NotGiven
|
|
154
|
+
] = type_utils.NOT_GIVEN,
|
|
133
155
|
request_options: typing.Optional[RequestOptions] = None,
|
|
134
156
|
) -> models.V1VideoToVideoCreateResponse:
|
|
135
157
|
"""
|
|
@@ -146,13 +168,27 @@ class AsyncVideoToVideoClient:
|
|
|
146
168
|
fps_resolution: Determines whether the resulting video will have the same frame per second as the original video, or half.
|
|
147
169
|
* `FULL` - the result video will have the same FPS as the input video
|
|
148
170
|
* `HALF` - the result video will have half the FPS as the input video
|
|
171
|
+
height: Used to determine the dimensions of the output video.
|
|
172
|
+
|
|
173
|
+
* If height is provided, width will also be required. The larger value between width and height will be used to determine the maximum output resolution while maintaining the original aspect ratio.
|
|
174
|
+
* If both height and width are omitted, the video will be resized according to your subscription's maximum resolution, while preserving aspect ratio.
|
|
175
|
+
|
|
176
|
+
Note: if the video's original resolution is less than the maximum, the video will not be resized.
|
|
177
|
+
|
|
178
|
+
See our [pricing page](https://magichour.ai/pricing) for more details.
|
|
149
179
|
name: The name of video
|
|
180
|
+
width: Used to determine the dimensions of the output video.
|
|
181
|
+
|
|
182
|
+
* If width is provided, height will also be required. The larger value between width and height will be used to determine the maximum output resolution while maintaining the original aspect ratio.
|
|
183
|
+
* If both height and width are omitted, the video will be resized according to your subscription's maximum resolution, while preserving aspect ratio.
|
|
184
|
+
|
|
185
|
+
Note: if the video's original resolution is less than the maximum, the video will not be resized.
|
|
186
|
+
|
|
187
|
+
See our [pricing page](https://magichour.ai/pricing) for more details.
|
|
150
188
|
assets: Provide the assets for video-to-video. For video, The `video_source` field determines whether `video_file_path` or `youtube_url` field is used
|
|
151
189
|
end_seconds: The end time of the input video in seconds
|
|
152
|
-
height: The height of the final output video. Must be divisible by 64. The maximum height depends on your subscription. Please refer to our [pricing page](https://magichour.ai/pricing) for more details
|
|
153
190
|
start_seconds: The start time of the input video in seconds
|
|
154
191
|
style: V1VideoToVideoCreateBodyStyle
|
|
155
|
-
width: The width of the final output video. Must be divisible by 64. The maximum width depends on your subscription. Please refer to our [pricing page](https://magichour.ai/pricing) for more details
|
|
156
192
|
request_options: Additional options to customize the HTTP request
|
|
157
193
|
|
|
158
194
|
Returns:
|
|
@@ -170,7 +206,6 @@ class AsyncVideoToVideoClient:
|
|
|
170
206
|
"video_source": "file",
|
|
171
207
|
},
|
|
172
208
|
end_seconds=15.0,
|
|
173
|
-
height=960,
|
|
174
209
|
start_seconds=0.0,
|
|
175
210
|
style={
|
|
176
211
|
"art_style": "3D Render",
|
|
@@ -179,22 +214,23 @@ class AsyncVideoToVideoClient:
|
|
|
179
214
|
"prompt_type": "append_default",
|
|
180
215
|
"version": "default",
|
|
181
216
|
},
|
|
182
|
-
width=512,
|
|
183
217
|
fps_resolution="HALF",
|
|
218
|
+
height=960,
|
|
184
219
|
name="Video To Video video",
|
|
220
|
+
width=512,
|
|
185
221
|
)
|
|
186
222
|
```
|
|
187
223
|
"""
|
|
188
224
|
_json = to_encodable(
|
|
189
225
|
item={
|
|
190
226
|
"fps_resolution": fps_resolution,
|
|
227
|
+
"height": height,
|
|
191
228
|
"name": name,
|
|
229
|
+
"width": width,
|
|
192
230
|
"assets": assets,
|
|
193
231
|
"end_seconds": end_seconds,
|
|
194
|
-
"height": height,
|
|
195
232
|
"start_seconds": start_seconds,
|
|
196
233
|
"style": style,
|
|
197
|
-
"width": width,
|
|
198
234
|
},
|
|
199
235
|
dump_with=params._SerializerV1VideoToVideoCreateBody,
|
|
200
236
|
)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from .v1_ai_clothes_changer_create_response import V1AiClothesChangerCreateResponse
|
|
2
2
|
from .v1_ai_face_editor_create_response import V1AiFaceEditorCreateResponse
|
|
3
|
+
from .v1_ai_gif_generator_create_response import V1AiGifGeneratorCreateResponse
|
|
3
4
|
from .v1_ai_headshot_generator_create_response import (
|
|
4
5
|
V1AiHeadshotGeneratorCreateResponse,
|
|
5
6
|
)
|
|
@@ -40,6 +41,7 @@ from .v1_video_to_video_create_response import V1VideoToVideoCreateResponse
|
|
|
40
41
|
__all__ = [
|
|
41
42
|
"V1AiClothesChangerCreateResponse",
|
|
42
43
|
"V1AiFaceEditorCreateResponse",
|
|
44
|
+
"V1AiGifGeneratorCreateResponse",
|
|
43
45
|
"V1AiHeadshotGeneratorCreateResponse",
|
|
44
46
|
"V1AiImageGeneratorCreateResponse",
|
|
45
47
|
"V1AiImageUpscalerCreateResponse",
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import pydantic
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class V1AiGifGeneratorCreateResponse(pydantic.BaseModel):
|
|
5
|
+
"""
|
|
6
|
+
Success
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
model_config = pydantic.ConfigDict(
|
|
10
|
+
arbitrary_types_allowed=True,
|
|
11
|
+
populate_by_name=True,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
frame_cost: int = pydantic.Field(
|
|
15
|
+
alias="frame_cost",
|
|
16
|
+
)
|
|
17
|
+
"""
|
|
18
|
+
The frame cost of the image generation
|
|
19
|
+
"""
|
|
20
|
+
id: str = pydantic.Field(
|
|
21
|
+
alias="id",
|
|
22
|
+
)
|
|
23
|
+
"""
|
|
24
|
+
Unique ID of the image. This value can be used in the [get image project API](https://docs.magichour.ai/api-reference/image-projects/get-image-details) to fetch additional details such as status
|
|
25
|
+
"""
|
{magic_hour-0.18.0 → magic_hour-0.20.0}/magic_hour/types/models/v1_image_projects_get_response.py
RENAMED
|
@@ -72,5 +72,5 @@ class V1ImageProjectsGetResponse(pydantic.BaseModel):
|
|
|
72
72
|
alias="type",
|
|
73
73
|
)
|
|
74
74
|
"""
|
|
75
|
-
The type of the image project. Possible values are AI_HEADSHOT, AI_IMAGE, IMAGE_UPSCALER, FACE_SWAP, PHOTO_EDITOR, QR_CODE, BACKGROUND_REMOVER, CLOTHES_CHANGER, AI_MEME, FACE_EDITOR, PHOTO_COLORIZER
|
|
75
|
+
The type of the image project. Possible values are AI_HEADSHOT, AI_IMAGE, IMAGE_UPSCALER, FACE_SWAP, PHOTO_EDITOR, QR_CODE, BACKGROUND_REMOVER, CLOTHES_CHANGER, AI_MEME, FACE_EDITOR, PHOTO_COLORIZER, AI_GIF
|
|
76
76
|
"""
|
|
@@ -18,6 +18,14 @@ from .v1_ai_face_editor_create_body_style import (
|
|
|
18
18
|
V1AiFaceEditorCreateBodyStyle,
|
|
19
19
|
_SerializerV1AiFaceEditorCreateBodyStyle,
|
|
20
20
|
)
|
|
21
|
+
from .v1_ai_gif_generator_create_body import (
|
|
22
|
+
V1AiGifGeneratorCreateBody,
|
|
23
|
+
_SerializerV1AiGifGeneratorCreateBody,
|
|
24
|
+
)
|
|
25
|
+
from .v1_ai_gif_generator_create_body_style import (
|
|
26
|
+
V1AiGifGeneratorCreateBodyStyle,
|
|
27
|
+
_SerializerV1AiGifGeneratorCreateBodyStyle,
|
|
28
|
+
)
|
|
21
29
|
from .v1_ai_headshot_generator_create_body import (
|
|
22
30
|
V1AiHeadshotGeneratorCreateBody,
|
|
23
31
|
_SerializerV1AiHeadshotGeneratorCreateBody,
|
|
@@ -183,6 +191,8 @@ __all__ = [
|
|
|
183
191
|
"V1AiFaceEditorCreateBody",
|
|
184
192
|
"V1AiFaceEditorCreateBodyAssets",
|
|
185
193
|
"V1AiFaceEditorCreateBodyStyle",
|
|
194
|
+
"V1AiGifGeneratorCreateBody",
|
|
195
|
+
"V1AiGifGeneratorCreateBodyStyle",
|
|
186
196
|
"V1AiHeadshotGeneratorCreateBody",
|
|
187
197
|
"V1AiHeadshotGeneratorCreateBodyAssets",
|
|
188
198
|
"V1AiHeadshotGeneratorCreateBodyStyle",
|
|
@@ -228,6 +238,8 @@ __all__ = [
|
|
|
228
238
|
"_SerializerV1AiFaceEditorCreateBody",
|
|
229
239
|
"_SerializerV1AiFaceEditorCreateBodyAssets",
|
|
230
240
|
"_SerializerV1AiFaceEditorCreateBodyStyle",
|
|
241
|
+
"_SerializerV1AiGifGeneratorCreateBody",
|
|
242
|
+
"_SerializerV1AiGifGeneratorCreateBodyStyle",
|
|
231
243
|
"_SerializerV1AiHeadshotGeneratorCreateBody",
|
|
232
244
|
"_SerializerV1AiHeadshotGeneratorCreateBodyAssets",
|
|
233
245
|
"_SerializerV1AiHeadshotGeneratorCreateBodyStyle",
|