magic_hour 0.8.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.
Potentially problematic release.
This version of magic_hour might be problematic. Click here for more details.
- magic_hour/__init__.py +6 -0
- magic_hour/client.py +61 -0
- magic_hour/core/__init__.py +53 -0
- magic_hour/core/api_error.py +48 -0
- magic_hour/core/auth.py +314 -0
- magic_hour/core/base_client.py +600 -0
- magic_hour/core/binary_response.py +23 -0
- magic_hour/core/request.py +158 -0
- magic_hour/core/response.py +293 -0
- magic_hour/core/type_utils.py +28 -0
- magic_hour/core/utils.py +38 -0
- magic_hour/environment.py +6 -0
- magic_hour/resources/v1/__init__.py +4 -0
- magic_hour/resources/v1/ai_clothes_changer/README.md +41 -0
- magic_hour/resources/v1/ai_clothes_changer/__init__.py +4 -0
- magic_hour/resources/v1/ai_clothes_changer/client.py +129 -0
- magic_hour/resources/v1/ai_headshot_generator/README.md +31 -0
- magic_hour/resources/v1/ai_headshot_generator/__init__.py +4 -0
- magic_hour/resources/v1/ai_headshot_generator/client.py +119 -0
- magic_hour/resources/v1/ai_image_generator/README.md +37 -0
- magic_hour/resources/v1/ai_image_generator/__init__.py +4 -0
- magic_hour/resources/v1/ai_image_generator/client.py +144 -0
- magic_hour/resources/v1/ai_image_upscaler/README.md +37 -0
- magic_hour/resources/v1/ai_image_upscaler/__init__.py +4 -0
- magic_hour/resources/v1/ai_image_upscaler/client.py +143 -0
- magic_hour/resources/v1/ai_photo_editor/README.md +53 -0
- magic_hour/resources/v1/ai_photo_editor/__init__.py +4 -0
- magic_hour/resources/v1/ai_photo_editor/client.py +167 -0
- magic_hour/resources/v1/ai_qr_code_generator/README.md +35 -0
- magic_hour/resources/v1/ai_qr_code_generator/__init__.py +4 -0
- magic_hour/resources/v1/ai_qr_code_generator/client.py +127 -0
- magic_hour/resources/v1/animation/README.md +63 -0
- magic_hour/resources/v1/animation/__init__.py +4 -0
- magic_hour/resources/v1/animation/client.py +179 -0
- magic_hour/resources/v1/client.py +153 -0
- magic_hour/resources/v1/face_swap/README.md +52 -0
- magic_hour/resources/v1/face_swap/__init__.py +4 -0
- magic_hour/resources/v1/face_swap/client.py +165 -0
- magic_hour/resources/v1/face_swap_photo/README.md +39 -0
- magic_hour/resources/v1/face_swap_photo/__init__.py +4 -0
- magic_hour/resources/v1/face_swap_photo/client.py +127 -0
- magic_hour/resources/v1/files/__init__.py +4 -0
- magic_hour/resources/v1/files/client.py +19 -0
- magic_hour/resources/v1/files/upload_urls/README.md +56 -0
- magic_hour/resources/v1/files/upload_urls/__init__.py +4 -0
- magic_hour/resources/v1/files/upload_urls/client.py +142 -0
- magic_hour/resources/v1/image_background_remover/README.md +31 -0
- magic_hour/resources/v1/image_background_remover/__init__.py +4 -0
- magic_hour/resources/v1/image_background_remover/client.py +121 -0
- magic_hour/resources/v1/image_projects/README.md +63 -0
- magic_hour/resources/v1/image_projects/__init__.py +4 -0
- magic_hour/resources/v1/image_projects/client.py +177 -0
- magic_hour/resources/v1/image_to_video/README.md +44 -0
- magic_hour/resources/v1/image_to_video/__init__.py +4 -0
- magic_hour/resources/v1/image_to_video/client.py +165 -0
- magic_hour/resources/v1/lip_sync/README.md +54 -0
- magic_hour/resources/v1/lip_sync/__init__.py +4 -0
- magic_hour/resources/v1/lip_sync/client.py +177 -0
- magic_hour/resources/v1/text_to_video/README.md +40 -0
- magic_hour/resources/v1/text_to_video/__init__.py +4 -0
- magic_hour/resources/v1/text_to_video/client.py +150 -0
- magic_hour/resources/v1/video_projects/README.md +63 -0
- magic_hour/resources/v1/video_projects/__init__.py +4 -0
- magic_hour/resources/v1/video_projects/client.py +177 -0
- magic_hour/resources/v1/video_to_video/README.md +60 -0
- magic_hour/resources/v1/video_to_video/__init__.py +4 -0
- magic_hour/resources/v1/video_to_video/client.py +204 -0
- magic_hour/types/models/__init__.py +60 -0
- magic_hour/types/models/get_v1_image_projects_id_response.py +82 -0
- magic_hour/types/models/get_v1_image_projects_id_response_downloads_item.py +19 -0
- magic_hour/types/models/get_v1_image_projects_id_response_error.py +25 -0
- magic_hour/types/models/get_v1_video_projects_id_response.py +114 -0
- magic_hour/types/models/get_v1_video_projects_id_response_download.py +19 -0
- magic_hour/types/models/get_v1_video_projects_id_response_downloads_item.py +19 -0
- magic_hour/types/models/get_v1_video_projects_id_response_error.py +25 -0
- magic_hour/types/models/post_v1_ai_clothes_changer_response.py +25 -0
- magic_hour/types/models/post_v1_ai_headshot_generator_response.py +25 -0
- magic_hour/types/models/post_v1_ai_image_generator_response.py +25 -0
- magic_hour/types/models/post_v1_ai_image_upscaler_response.py +25 -0
- magic_hour/types/models/post_v1_ai_photo_editor_response.py +25 -0
- magic_hour/types/models/post_v1_ai_qr_code_generator_response.py +25 -0
- magic_hour/types/models/post_v1_animation_response.py +25 -0
- magic_hour/types/models/post_v1_face_swap_photo_response.py +25 -0
- magic_hour/types/models/post_v1_face_swap_response.py +25 -0
- magic_hour/types/models/post_v1_files_upload_urls_response.py +21 -0
- magic_hour/types/models/post_v1_files_upload_urls_response_items_item.py +31 -0
- magic_hour/types/models/post_v1_image_background_remover_response.py +25 -0
- magic_hour/types/models/post_v1_image_to_video_response.py +25 -0
- magic_hour/types/models/post_v1_lip_sync_response.py +25 -0
- magic_hour/types/models/post_v1_text_to_video_response.py +25 -0
- magic_hour/types/models/post_v1_video_to_video_response.py +25 -0
- magic_hour/types/params/__init__.py +205 -0
- magic_hour/types/params/post_v1_ai_clothes_changer_body.py +40 -0
- magic_hour/types/params/post_v1_ai_clothes_changer_body_assets.py +45 -0
- magic_hour/types/params/post_v1_ai_headshot_generator_body.py +40 -0
- magic_hour/types/params/post_v1_ai_headshot_generator_body_assets.py +28 -0
- magic_hour/types/params/post_v1_ai_image_generator_body.py +54 -0
- magic_hour/types/params/post_v1_ai_image_generator_body_style.py +28 -0
- magic_hour/types/params/post_v1_ai_image_upscaler_body.py +54 -0
- magic_hour/types/params/post_v1_ai_image_upscaler_body_assets.py +28 -0
- magic_hour/types/params/post_v1_ai_image_upscaler_body_style.py +36 -0
- magic_hour/types/params/post_v1_ai_photo_editor_body.py +63 -0
- magic_hour/types/params/post_v1_ai_photo_editor_body_assets.py +28 -0
- magic_hour/types/params/post_v1_ai_photo_editor_body_style.py +67 -0
- magic_hour/types/params/post_v1_ai_qr_code_generator_body.py +45 -0
- magic_hour/types/params/post_v1_ai_qr_code_generator_body_style.py +28 -0
- magic_hour/types/params/post_v1_animation_body.py +84 -0
- magic_hour/types/params/post_v1_animation_body_assets.py +55 -0
- magic_hour/types/params/post_v1_animation_body_style.py +279 -0
- magic_hour/types/params/post_v1_face_swap_body.py +72 -0
- magic_hour/types/params/post_v1_face_swap_body_assets.py +52 -0
- magic_hour/types/params/post_v1_face_swap_photo_body.py +40 -0
- magic_hour/types/params/post_v1_face_swap_photo_body_assets.py +36 -0
- magic_hour/types/params/post_v1_files_upload_urls_body.py +31 -0
- magic_hour/types/params/post_v1_files_upload_urls_body_items_item.py +38 -0
- magic_hour/types/params/post_v1_image_background_remover_body.py +40 -0
- magic_hour/types/params/post_v1_image_background_remover_body_assets.py +28 -0
- magic_hour/types/params/post_v1_image_to_video_body.py +73 -0
- magic_hour/types/params/post_v1_image_to_video_body_assets.py +28 -0
- magic_hour/types/params/post_v1_image_to_video_body_style.py +29 -0
- magic_hour/types/params/post_v1_lip_sync_body.py +80 -0
- magic_hour/types/params/post_v1_lip_sync_body_assets.py +52 -0
- magic_hour/types/params/post_v1_text_to_video_body.py +57 -0
- magic_hour/types/params/post_v1_text_to_video_body_style.py +28 -0
- magic_hour/types/params/post_v1_video_to_video_body.py +93 -0
- magic_hour/types/params/post_v1_video_to_video_body_assets.py +44 -0
- magic_hour/types/params/post_v1_video_to_video_body_style.py +199 -0
- magic_hour-0.8.0.dist-info/LICENSE +21 -0
- magic_hour-0.8.0.dist-info/METADATA +138 -0
- magic_hour-0.8.0.dist-info/RECORD +131 -0
- magic_hour-0.8.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import typing
|
|
2
|
+
import typing_extensions
|
|
3
|
+
import pydantic
|
|
4
|
+
|
|
5
|
+
from .post_v1_face_swap_photo_body_assets import (
|
|
6
|
+
PostV1FaceSwapPhotoBodyAssets,
|
|
7
|
+
_SerializerPostV1FaceSwapPhotoBodyAssets,
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class PostV1FaceSwapPhotoBody(typing_extensions.TypedDict):
|
|
12
|
+
"""
|
|
13
|
+
PostV1FaceSwapPhotoBody
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
assets: typing_extensions.Required[PostV1FaceSwapPhotoBodyAssets]
|
|
17
|
+
"""
|
|
18
|
+
Provide the assets for face swap photo
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
name: typing_extensions.NotRequired[str]
|
|
22
|
+
"""
|
|
23
|
+
The name of image
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class _SerializerPostV1FaceSwapPhotoBody(pydantic.BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
Serializer for PostV1FaceSwapPhotoBody 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: _SerializerPostV1FaceSwapPhotoBodyAssets = pydantic.Field(
|
|
38
|
+
alias="assets",
|
|
39
|
+
)
|
|
40
|
+
name: typing.Optional[str] = pydantic.Field(alias="name", default=None)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import typing_extensions
|
|
2
|
+
import pydantic
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class PostV1FaceSwapPhotoBodyAssets(typing_extensions.TypedDict):
|
|
6
|
+
"""
|
|
7
|
+
Provide the assets for face swap photo
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
source_file_path: typing_extensions.Required[str]
|
|
11
|
+
"""
|
|
12
|
+
This is the image from which the face is extracted. This value can be either the `file_path` field from the response of the [upload urls API](/docs/api/tag/files/post/v1/files/upload-urls), or the url of the file.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
target_file_path: typing_extensions.Required[str]
|
|
16
|
+
"""
|
|
17
|
+
This is the image where the face from the source image will be placed. This value can be either the `file_path` field from the response of the [upload urls API](/docs/api/tag/files/post/v1/files/upload-urls), or the url of the file.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class _SerializerPostV1FaceSwapPhotoBodyAssets(pydantic.BaseModel):
|
|
22
|
+
"""
|
|
23
|
+
Serializer for PostV1FaceSwapPhotoBodyAssets 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
|
+
source_file_path: str = pydantic.Field(
|
|
32
|
+
alias="source_file_path",
|
|
33
|
+
)
|
|
34
|
+
target_file_path: str = pydantic.Field(
|
|
35
|
+
alias="target_file_path",
|
|
36
|
+
)
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import typing
|
|
2
|
+
import typing_extensions
|
|
3
|
+
import pydantic
|
|
4
|
+
|
|
5
|
+
from .post_v1_files_upload_urls_body_items_item import (
|
|
6
|
+
PostV1FilesUploadUrlsBodyItemsItem,
|
|
7
|
+
_SerializerPostV1FilesUploadUrlsBodyItemsItem,
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class PostV1FilesUploadUrlsBody(typing_extensions.TypedDict):
|
|
12
|
+
"""
|
|
13
|
+
PostV1FilesUploadUrlsBody
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
items: typing_extensions.Required[typing.List[PostV1FilesUploadUrlsBodyItemsItem]]
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class _SerializerPostV1FilesUploadUrlsBody(pydantic.BaseModel):
|
|
20
|
+
"""
|
|
21
|
+
Serializer for PostV1FilesUploadUrlsBody handling case conversions
|
|
22
|
+
and file omissions as dictated by the API
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
model_config = pydantic.ConfigDict(
|
|
26
|
+
populate_by_name=True,
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
items: typing.List[_SerializerPostV1FilesUploadUrlsBodyItemsItem] = pydantic.Field(
|
|
30
|
+
alias="items",
|
|
31
|
+
)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import typing_extensions
|
|
2
|
+
import pydantic
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class PostV1FilesUploadUrlsBodyItemsItem(typing_extensions.TypedDict):
|
|
6
|
+
"""
|
|
7
|
+
PostV1FilesUploadUrlsBodyItemsItem
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
extension: typing_extensions.Required[str]
|
|
11
|
+
"""
|
|
12
|
+
the extension of the file to upload. Do not include the dot (.) before the extension.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
type_field: typing_extensions.Required[
|
|
16
|
+
typing_extensions.Literal["audio", "image", "video"]
|
|
17
|
+
]
|
|
18
|
+
"""
|
|
19
|
+
The type of asset to upload
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class _SerializerPostV1FilesUploadUrlsBodyItemsItem(pydantic.BaseModel):
|
|
24
|
+
"""
|
|
25
|
+
Serializer for PostV1FilesUploadUrlsBodyItemsItem handling case conversions
|
|
26
|
+
and file omissions as dictated by the API
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
model_config = pydantic.ConfigDict(
|
|
30
|
+
populate_by_name=True,
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
extension: str = pydantic.Field(
|
|
34
|
+
alias="extension",
|
|
35
|
+
)
|
|
36
|
+
type_field: typing_extensions.Literal["audio", "image", "video"] = pydantic.Field(
|
|
37
|
+
alias="type",
|
|
38
|
+
)
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import typing
|
|
2
|
+
import typing_extensions
|
|
3
|
+
import pydantic
|
|
4
|
+
|
|
5
|
+
from .post_v1_image_background_remover_body_assets import (
|
|
6
|
+
PostV1ImageBackgroundRemoverBodyAssets,
|
|
7
|
+
_SerializerPostV1ImageBackgroundRemoverBodyAssets,
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class PostV1ImageBackgroundRemoverBody(typing_extensions.TypedDict):
|
|
12
|
+
"""
|
|
13
|
+
PostV1ImageBackgroundRemoverBody
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
assets: typing_extensions.Required[PostV1ImageBackgroundRemoverBodyAssets]
|
|
17
|
+
"""
|
|
18
|
+
Provide the assets for background removal
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
name: typing_extensions.NotRequired[str]
|
|
22
|
+
"""
|
|
23
|
+
The name of image
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class _SerializerPostV1ImageBackgroundRemoverBody(pydantic.BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
Serializer for PostV1ImageBackgroundRemoverBody 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: _SerializerPostV1ImageBackgroundRemoverBodyAssets = pydantic.Field(
|
|
38
|
+
alias="assets",
|
|
39
|
+
)
|
|
40
|
+
name: typing.Optional[str] = pydantic.Field(alias="name", default=None)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import typing_extensions
|
|
2
|
+
import pydantic
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class PostV1ImageBackgroundRemoverBodyAssets(typing_extensions.TypedDict):
|
|
6
|
+
"""
|
|
7
|
+
Provide the assets for background removal
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
image_file_path: typing_extensions.Required[str]
|
|
11
|
+
"""
|
|
12
|
+
The image used to generate the image. This is the `file_path` field from the response of the [upload urls API](/docs/api/tag/files/post/v1/files/upload-urls)
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class _SerializerPostV1ImageBackgroundRemoverBodyAssets(pydantic.BaseModel):
|
|
17
|
+
"""
|
|
18
|
+
Serializer for PostV1ImageBackgroundRemoverBodyAssets handling case conversions
|
|
19
|
+
and file omissions as dictated by the API
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
model_config = pydantic.ConfigDict(
|
|
23
|
+
populate_by_name=True,
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
image_file_path: str = pydantic.Field(
|
|
27
|
+
alias="image_file_path",
|
|
28
|
+
)
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import typing
|
|
2
|
+
import typing_extensions
|
|
3
|
+
import pydantic
|
|
4
|
+
|
|
5
|
+
from .post_v1_image_to_video_body_assets import (
|
|
6
|
+
PostV1ImageToVideoBodyAssets,
|
|
7
|
+
_SerializerPostV1ImageToVideoBodyAssets,
|
|
8
|
+
)
|
|
9
|
+
from .post_v1_image_to_video_body_style import (
|
|
10
|
+
PostV1ImageToVideoBodyStyle,
|
|
11
|
+
_SerializerPostV1ImageToVideoBodyStyle,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class PostV1ImageToVideoBody(typing_extensions.TypedDict):
|
|
16
|
+
"""
|
|
17
|
+
PostV1ImageToVideoBody
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
assets: typing_extensions.Required[PostV1ImageToVideoBodyAssets]
|
|
21
|
+
"""
|
|
22
|
+
Provide the assets for image-to-video.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
end_seconds: typing_extensions.Required[float]
|
|
26
|
+
"""
|
|
27
|
+
The total duration of the output video in seconds.
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
height: typing_extensions.Required[int]
|
|
31
|
+
"""
|
|
32
|
+
The height of the input video. This value will help determine the final orientation of the output video. The output video resolution may not match the input.
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
name: typing_extensions.NotRequired[str]
|
|
36
|
+
"""
|
|
37
|
+
The name of video
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
style: typing_extensions.Required[PostV1ImageToVideoBodyStyle]
|
|
41
|
+
|
|
42
|
+
width: typing_extensions.Required[int]
|
|
43
|
+
"""
|
|
44
|
+
The width of the input video. This value will help determine the final orientation of the output video. The output video resolution may not match the input.
|
|
45
|
+
"""
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class _SerializerPostV1ImageToVideoBody(pydantic.BaseModel):
|
|
49
|
+
"""
|
|
50
|
+
Serializer for PostV1ImageToVideoBody handling case conversions
|
|
51
|
+
and file omissions as dictated by the API
|
|
52
|
+
"""
|
|
53
|
+
|
|
54
|
+
model_config = pydantic.ConfigDict(
|
|
55
|
+
populate_by_name=True,
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
assets: _SerializerPostV1ImageToVideoBodyAssets = pydantic.Field(
|
|
59
|
+
alias="assets",
|
|
60
|
+
)
|
|
61
|
+
end_seconds: float = pydantic.Field(
|
|
62
|
+
alias="end_seconds",
|
|
63
|
+
)
|
|
64
|
+
height: int = pydantic.Field(
|
|
65
|
+
alias="height",
|
|
66
|
+
)
|
|
67
|
+
name: typing.Optional[str] = pydantic.Field(alias="name", default=None)
|
|
68
|
+
style: _SerializerPostV1ImageToVideoBodyStyle = pydantic.Field(
|
|
69
|
+
alias="style",
|
|
70
|
+
)
|
|
71
|
+
width: int = pydantic.Field(
|
|
72
|
+
alias="width",
|
|
73
|
+
)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import typing_extensions
|
|
2
|
+
import pydantic
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class PostV1ImageToVideoBodyAssets(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 is the `file_path` field from the response of the [upload urls API](/docs/api/tag/files/post/v1/files/upload-urls)
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class _SerializerPostV1ImageToVideoBodyAssets(pydantic.BaseModel):
|
|
17
|
+
"""
|
|
18
|
+
Serializer for PostV1ImageToVideoBodyAssets handling case conversions
|
|
19
|
+
and file omissions as dictated by the API
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
model_config = pydantic.ConfigDict(
|
|
23
|
+
populate_by_name=True,
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
image_file_path: str = pydantic.Field(
|
|
27
|
+
alias="image_file_path",
|
|
28
|
+
)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import typing
|
|
2
|
+
import typing_extensions
|
|
3
|
+
import pydantic
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class PostV1ImageToVideoBodyStyle(typing_extensions.TypedDict):
|
|
7
|
+
"""
|
|
8
|
+
PostV1ImageToVideoBodyStyle
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
prompt: typing_extensions.Required[typing.Optional[str]]
|
|
12
|
+
"""
|
|
13
|
+
The prompt used for the video.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class _SerializerPostV1ImageToVideoBodyStyle(pydantic.BaseModel):
|
|
18
|
+
"""
|
|
19
|
+
Serializer for PostV1ImageToVideoBodyStyle 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(
|
|
28
|
+
alias="prompt",
|
|
29
|
+
)
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import typing
|
|
2
|
+
import typing_extensions
|
|
3
|
+
import pydantic
|
|
4
|
+
|
|
5
|
+
from .post_v1_lip_sync_body_assets import (
|
|
6
|
+
PostV1LipSyncBodyAssets,
|
|
7
|
+
_SerializerPostV1LipSyncBodyAssets,
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class PostV1LipSyncBody(typing_extensions.TypedDict):
|
|
12
|
+
"""
|
|
13
|
+
PostV1LipSyncBody
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
assets: typing_extensions.Required[PostV1LipSyncBodyAssets]
|
|
17
|
+
"""
|
|
18
|
+
Provide the assets for lip-sync. For video, The `video_source` field determines whether `video_file_path` or `youtube_url` field is used
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
end_seconds: typing_extensions.Required[float]
|
|
22
|
+
"""
|
|
23
|
+
The end time of the input video in seconds
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
height: typing_extensions.Required[int]
|
|
27
|
+
"""
|
|
28
|
+
The height of the final output video. The maximum height depends on your subscription. Please refer to our [pricing page](https://magichour.ai/pricing) for more details
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
max_fps_limit: typing_extensions.NotRequired[float]
|
|
32
|
+
"""
|
|
33
|
+
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.
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
name: typing_extensions.NotRequired[str]
|
|
37
|
+
"""
|
|
38
|
+
The name of video
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
start_seconds: typing_extensions.Required[float]
|
|
42
|
+
"""
|
|
43
|
+
The start time of the input video in seconds
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
width: typing_extensions.Required[int]
|
|
47
|
+
"""
|
|
48
|
+
The width of the final output video. The maximum width depends on your subscription. Please refer to our [pricing page](https://magichour.ai/pricing) for more details
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class _SerializerPostV1LipSyncBody(pydantic.BaseModel):
|
|
53
|
+
"""
|
|
54
|
+
Serializer for PostV1LipSyncBody handling case conversions
|
|
55
|
+
and file omissions as dictated by the API
|
|
56
|
+
"""
|
|
57
|
+
|
|
58
|
+
model_config = pydantic.ConfigDict(
|
|
59
|
+
populate_by_name=True,
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
assets: _SerializerPostV1LipSyncBodyAssets = pydantic.Field(
|
|
63
|
+
alias="assets",
|
|
64
|
+
)
|
|
65
|
+
end_seconds: float = pydantic.Field(
|
|
66
|
+
alias="end_seconds",
|
|
67
|
+
)
|
|
68
|
+
height: int = pydantic.Field(
|
|
69
|
+
alias="height",
|
|
70
|
+
)
|
|
71
|
+
max_fps_limit: typing.Optional[float] = pydantic.Field(
|
|
72
|
+
alias="max_fps_limit", default=None
|
|
73
|
+
)
|
|
74
|
+
name: typing.Optional[str] = pydantic.Field(alias="name", default=None)
|
|
75
|
+
start_seconds: float = pydantic.Field(
|
|
76
|
+
alias="start_seconds",
|
|
77
|
+
)
|
|
78
|
+
width: int = pydantic.Field(
|
|
79
|
+
alias="width",
|
|
80
|
+
)
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import typing
|
|
2
|
+
import typing_extensions
|
|
3
|
+
import pydantic
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class PostV1LipSyncBodyAssets(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 is the `file_path` field from the response of the [upload urls API](/docs/api/tag/files/post/v1/files/upload-urls)
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
video_file_path: typing_extensions.NotRequired[str]
|
|
17
|
+
"""
|
|
18
|
+
The path of the input video. This is the `file_path` field from the response of the [upload urls API](/docs/api/tag/files/post/v1/files/upload-urls). This field is required if `video_source` is `file`
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
video_source: typing_extensions.Required[
|
|
22
|
+
typing_extensions.Literal["file", "youtube"]
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
youtube_url: typing_extensions.NotRequired[str]
|
|
26
|
+
"""
|
|
27
|
+
Using a youtube video as the input source. This field is required if `video_source` is `youtube`
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class _SerializerPostV1LipSyncBodyAssets(pydantic.BaseModel):
|
|
32
|
+
"""
|
|
33
|
+
Serializer for PostV1LipSyncBodyAssets 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
|
+
audio_file_path: str = pydantic.Field(
|
|
42
|
+
alias="audio_file_path",
|
|
43
|
+
)
|
|
44
|
+
video_file_path: typing.Optional[str] = pydantic.Field(
|
|
45
|
+
alias="video_file_path", default=None
|
|
46
|
+
)
|
|
47
|
+
video_source: typing_extensions.Literal["file", "youtube"] = pydantic.Field(
|
|
48
|
+
alias="video_source",
|
|
49
|
+
)
|
|
50
|
+
youtube_url: typing.Optional[str] = pydantic.Field(
|
|
51
|
+
alias="youtube_url", default=None
|
|
52
|
+
)
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import typing
|
|
2
|
+
import typing_extensions
|
|
3
|
+
import pydantic
|
|
4
|
+
|
|
5
|
+
from .post_v1_text_to_video_body_style import (
|
|
6
|
+
PostV1TextToVideoBodyStyle,
|
|
7
|
+
_SerializerPostV1TextToVideoBodyStyle,
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class PostV1TextToVideoBody(typing_extensions.TypedDict):
|
|
12
|
+
"""
|
|
13
|
+
PostV1TextToVideoBody
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
end_seconds: typing_extensions.Required[float]
|
|
17
|
+
"""
|
|
18
|
+
The total duration of the output video in seconds.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
name: typing_extensions.NotRequired[str]
|
|
22
|
+
"""
|
|
23
|
+
The name of video
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
orientation: typing_extensions.Required[
|
|
27
|
+
typing_extensions.Literal["landscape", "portrait", "square"]
|
|
28
|
+
]
|
|
29
|
+
"""
|
|
30
|
+
Determines the orientation of the output video
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
style: typing_extensions.Required[PostV1TextToVideoBodyStyle]
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class _SerializerPostV1TextToVideoBody(pydantic.BaseModel):
|
|
37
|
+
"""
|
|
38
|
+
Serializer for PostV1TextToVideoBody 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
|
+
end_seconds: float = pydantic.Field(
|
|
47
|
+
alias="end_seconds",
|
|
48
|
+
)
|
|
49
|
+
name: typing.Optional[str] = pydantic.Field(alias="name", default=None)
|
|
50
|
+
orientation: typing_extensions.Literal["landscape", "portrait", "square"] = (
|
|
51
|
+
pydantic.Field(
|
|
52
|
+
alias="orientation",
|
|
53
|
+
)
|
|
54
|
+
)
|
|
55
|
+
style: _SerializerPostV1TextToVideoBodyStyle = pydantic.Field(
|
|
56
|
+
alias="style",
|
|
57
|
+
)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import typing_extensions
|
|
2
|
+
import pydantic
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class PostV1TextToVideoBodyStyle(typing_extensions.TypedDict):
|
|
6
|
+
"""
|
|
7
|
+
PostV1TextToVideoBodyStyle
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
prompt: typing_extensions.Required[str]
|
|
11
|
+
"""
|
|
12
|
+
The prompt used for the video.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class _SerializerPostV1TextToVideoBodyStyle(pydantic.BaseModel):
|
|
17
|
+
"""
|
|
18
|
+
Serializer for PostV1TextToVideoBodyStyle handling case conversions
|
|
19
|
+
and file omissions as dictated by the API
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
model_config = pydantic.ConfigDict(
|
|
23
|
+
populate_by_name=True,
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
prompt: str = pydantic.Field(
|
|
27
|
+
alias="prompt",
|
|
28
|
+
)
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import typing
|
|
2
|
+
import typing_extensions
|
|
3
|
+
import pydantic
|
|
4
|
+
|
|
5
|
+
from .post_v1_video_to_video_body_assets import (
|
|
6
|
+
PostV1VideoToVideoBodyAssets,
|
|
7
|
+
_SerializerPostV1VideoToVideoBodyAssets,
|
|
8
|
+
)
|
|
9
|
+
from .post_v1_video_to_video_body_style import (
|
|
10
|
+
PostV1VideoToVideoBodyStyle,
|
|
11
|
+
_SerializerPostV1VideoToVideoBodyStyle,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class PostV1VideoToVideoBody(typing_extensions.TypedDict):
|
|
16
|
+
"""
|
|
17
|
+
PostV1VideoToVideoBody
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
assets: typing_extensions.Required[PostV1VideoToVideoBodyAssets]
|
|
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
|
|
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.Required[int]
|
|
40
|
+
"""
|
|
41
|
+
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
|
|
42
|
+
"""
|
|
43
|
+
|
|
44
|
+
name: typing_extensions.NotRequired[str]
|
|
45
|
+
"""
|
|
46
|
+
The name of video
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
start_seconds: typing_extensions.Required[float]
|
|
50
|
+
"""
|
|
51
|
+
The start time of the input video in seconds
|
|
52
|
+
"""
|
|
53
|
+
|
|
54
|
+
style: typing_extensions.Required[PostV1VideoToVideoBodyStyle]
|
|
55
|
+
|
|
56
|
+
width: typing_extensions.Required[int]
|
|
57
|
+
"""
|
|
58
|
+
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
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class _SerializerPostV1VideoToVideoBody(pydantic.BaseModel):
|
|
63
|
+
"""
|
|
64
|
+
Serializer for PostV1VideoToVideoBody handling case conversions
|
|
65
|
+
and file omissions as dictated by the API
|
|
66
|
+
"""
|
|
67
|
+
|
|
68
|
+
model_config = pydantic.ConfigDict(
|
|
69
|
+
populate_by_name=True,
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
assets: _SerializerPostV1VideoToVideoBodyAssets = pydantic.Field(
|
|
73
|
+
alias="assets",
|
|
74
|
+
)
|
|
75
|
+
end_seconds: float = pydantic.Field(
|
|
76
|
+
alias="end_seconds",
|
|
77
|
+
)
|
|
78
|
+
fps_resolution: typing.Optional[typing_extensions.Literal["FULL", "HALF"]] = (
|
|
79
|
+
pydantic.Field(alias="fps_resolution", default=None)
|
|
80
|
+
)
|
|
81
|
+
height: int = pydantic.Field(
|
|
82
|
+
alias="height",
|
|
83
|
+
)
|
|
84
|
+
name: typing.Optional[str] = pydantic.Field(alias="name", default=None)
|
|
85
|
+
start_seconds: float = pydantic.Field(
|
|
86
|
+
alias="start_seconds",
|
|
87
|
+
)
|
|
88
|
+
style: _SerializerPostV1VideoToVideoBodyStyle = pydantic.Field(
|
|
89
|
+
alias="style",
|
|
90
|
+
)
|
|
91
|
+
width: int = pydantic.Field(
|
|
92
|
+
alias="width",
|
|
93
|
+
)
|