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,67 @@
|
|
|
1
|
+
import typing
|
|
2
|
+
import typing_extensions
|
|
3
|
+
import pydantic
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class PostV1AiPhotoEditorBodyStyle(typing_extensions.TypedDict):
|
|
7
|
+
"""
|
|
8
|
+
PostV1AiPhotoEditorBodyStyle
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
image_description: typing_extensions.Required[str]
|
|
12
|
+
"""
|
|
13
|
+
Use this to describe what your input image is. This helps maintain aspects of the image you don't want to change.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
likeness_strength: typing_extensions.Required[float]
|
|
17
|
+
"""
|
|
18
|
+
Determines the input image's influence. Higher values align the output more with the initial image.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
negative_prompt: typing_extensions.NotRequired[str]
|
|
22
|
+
"""
|
|
23
|
+
What you want to avoid seeing in the final output; has a minor effect.
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
prompt: typing_extensions.Required[str]
|
|
27
|
+
"""
|
|
28
|
+
What you want your final output to look like. We recommend starting with the image description and making minor edits for best results.
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
prompt_strength: typing_extensions.Required[float]
|
|
32
|
+
"""
|
|
33
|
+
Determines the prompt's influence. Higher values align the output more with the prompt.
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
steps: typing_extensions.NotRequired[int]
|
|
37
|
+
"""
|
|
38
|
+
Number of iterations used to generate the output. Higher values improve quality and increase the strength of the prompt but increase processing time.
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class _SerializerPostV1AiPhotoEditorBodyStyle(pydantic.BaseModel):
|
|
43
|
+
"""
|
|
44
|
+
Serializer for PostV1AiPhotoEditorBodyStyle handling case conversions
|
|
45
|
+
and file omissions as dictated by the API
|
|
46
|
+
"""
|
|
47
|
+
|
|
48
|
+
model_config = pydantic.ConfigDict(
|
|
49
|
+
populate_by_name=True,
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
image_description: str = pydantic.Field(
|
|
53
|
+
alias="image_description",
|
|
54
|
+
)
|
|
55
|
+
likeness_strength: float = pydantic.Field(
|
|
56
|
+
alias="likeness_strength",
|
|
57
|
+
)
|
|
58
|
+
negative_prompt: typing.Optional[str] = pydantic.Field(
|
|
59
|
+
alias="negative_prompt", default=None
|
|
60
|
+
)
|
|
61
|
+
prompt: str = pydantic.Field(
|
|
62
|
+
alias="prompt",
|
|
63
|
+
)
|
|
64
|
+
prompt_strength: float = pydantic.Field(
|
|
65
|
+
alias="prompt_strength",
|
|
66
|
+
)
|
|
67
|
+
steps: typing.Optional[int] = pydantic.Field(alias="steps", default=None)
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import typing
|
|
2
|
+
import typing_extensions
|
|
3
|
+
import pydantic
|
|
4
|
+
|
|
5
|
+
from .post_v1_ai_qr_code_generator_body_style import (
|
|
6
|
+
PostV1AiQrCodeGeneratorBodyStyle,
|
|
7
|
+
_SerializerPostV1AiQrCodeGeneratorBodyStyle,
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class PostV1AiQrCodeGeneratorBody(typing_extensions.TypedDict):
|
|
12
|
+
"""
|
|
13
|
+
PostV1AiQrCodeGeneratorBody
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
content: typing_extensions.Required[str]
|
|
17
|
+
"""
|
|
18
|
+
The content of the QR code.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
name: typing_extensions.NotRequired[str]
|
|
22
|
+
"""
|
|
23
|
+
The name of image
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
style: typing_extensions.Required[PostV1AiQrCodeGeneratorBodyStyle]
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class _SerializerPostV1AiQrCodeGeneratorBody(pydantic.BaseModel):
|
|
30
|
+
"""
|
|
31
|
+
Serializer for PostV1AiQrCodeGeneratorBody handling case conversions
|
|
32
|
+
and file omissions as dictated by the API
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
model_config = pydantic.ConfigDict(
|
|
36
|
+
populate_by_name=True,
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
content: str = pydantic.Field(
|
|
40
|
+
alias="content",
|
|
41
|
+
)
|
|
42
|
+
name: typing.Optional[str] = pydantic.Field(alias="name", default=None)
|
|
43
|
+
style: _SerializerPostV1AiQrCodeGeneratorBodyStyle = pydantic.Field(
|
|
44
|
+
alias="style",
|
|
45
|
+
)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import typing_extensions
|
|
2
|
+
import pydantic
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class PostV1AiQrCodeGeneratorBodyStyle(typing_extensions.TypedDict):
|
|
6
|
+
"""
|
|
7
|
+
PostV1AiQrCodeGeneratorBodyStyle
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
art_style: typing_extensions.Required[str]
|
|
11
|
+
"""
|
|
12
|
+
To use our templates, pass in one of Watercolor, Cyberpunk City, Ink Landscape, Interior Painting, Japanese Street, Mech, Minecraft, Picasso Painting, Game Map, Spaceship, Chinese Painting, Winter Village, or pass any custom art style.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class _SerializerPostV1AiQrCodeGeneratorBodyStyle(pydantic.BaseModel):
|
|
17
|
+
"""
|
|
18
|
+
Serializer for PostV1AiQrCodeGeneratorBodyStyle 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
|
+
art_style: str = pydantic.Field(
|
|
27
|
+
alias="art_style",
|
|
28
|
+
)
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import typing
|
|
2
|
+
import typing_extensions
|
|
3
|
+
import pydantic
|
|
4
|
+
|
|
5
|
+
from .post_v1_animation_body_assets import (
|
|
6
|
+
PostV1AnimationBodyAssets,
|
|
7
|
+
_SerializerPostV1AnimationBodyAssets,
|
|
8
|
+
)
|
|
9
|
+
from .post_v1_animation_body_style import (
|
|
10
|
+
PostV1AnimationBodyStyle,
|
|
11
|
+
_SerializerPostV1AnimationBodyStyle,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class PostV1AnimationBody(typing_extensions.TypedDict):
|
|
16
|
+
"""
|
|
17
|
+
PostV1AnimationBody
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
assets: typing_extensions.Required[PostV1AnimationBodyAssets]
|
|
21
|
+
"""
|
|
22
|
+
Provide the assets for animation.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
end_seconds: typing_extensions.Required[float]
|
|
26
|
+
"""
|
|
27
|
+
The end time of the input video in seconds
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
fps: typing_extensions.Required[float]
|
|
31
|
+
"""
|
|
32
|
+
The desire output video frame rate
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
height: typing_extensions.Required[int]
|
|
36
|
+
"""
|
|
37
|
+
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
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
name: typing_extensions.NotRequired[str]
|
|
41
|
+
"""
|
|
42
|
+
The name of video
|
|
43
|
+
"""
|
|
44
|
+
|
|
45
|
+
style: typing_extensions.Required[PostV1AnimationBodyStyle]
|
|
46
|
+
"""
|
|
47
|
+
Defines the style of the output video
|
|
48
|
+
"""
|
|
49
|
+
|
|
50
|
+
width: typing_extensions.Required[int]
|
|
51
|
+
"""
|
|
52
|
+
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
|
|
53
|
+
"""
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
class _SerializerPostV1AnimationBody(pydantic.BaseModel):
|
|
57
|
+
"""
|
|
58
|
+
Serializer for PostV1AnimationBody handling case conversions
|
|
59
|
+
and file omissions as dictated by the API
|
|
60
|
+
"""
|
|
61
|
+
|
|
62
|
+
model_config = pydantic.ConfigDict(
|
|
63
|
+
populate_by_name=True,
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
assets: _SerializerPostV1AnimationBodyAssets = pydantic.Field(
|
|
67
|
+
alias="assets",
|
|
68
|
+
)
|
|
69
|
+
end_seconds: float = pydantic.Field(
|
|
70
|
+
alias="end_seconds",
|
|
71
|
+
)
|
|
72
|
+
fps: float = pydantic.Field(
|
|
73
|
+
alias="fps",
|
|
74
|
+
)
|
|
75
|
+
height: int = pydantic.Field(
|
|
76
|
+
alias="height",
|
|
77
|
+
)
|
|
78
|
+
name: typing.Optional[str] = pydantic.Field(alias="name", default=None)
|
|
79
|
+
style: _SerializerPostV1AnimationBodyStyle = pydantic.Field(
|
|
80
|
+
alias="style",
|
|
81
|
+
)
|
|
82
|
+
width: int = pydantic.Field(
|
|
83
|
+
alias="width",
|
|
84
|
+
)
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import typing
|
|
2
|
+
import typing_extensions
|
|
3
|
+
import pydantic
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class PostV1AnimationBodyAssets(typing_extensions.TypedDict):
|
|
7
|
+
"""
|
|
8
|
+
Provide the assets for animation.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
audio_file_path: typing_extensions.NotRequired[str]
|
|
12
|
+
"""
|
|
13
|
+
The path of the input audio. 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 `audio_source` is `file`
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
audio_source: typing_extensions.Required[
|
|
17
|
+
typing_extensions.Literal["file", "none", "youtube"]
|
|
18
|
+
]
|
|
19
|
+
"""
|
|
20
|
+
Optionally add an audio source if you'd like to incorporate audio into your video
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
image_file_path: typing_extensions.NotRequired[str]
|
|
24
|
+
"""
|
|
25
|
+
An initial image to use a the first frame of the video. This is the `file_path` field from the response of the [upload urls API](/docs/api/tag/files/post/v1/files/upload-urls)
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
youtube_url: typing_extensions.NotRequired[str]
|
|
29
|
+
"""
|
|
30
|
+
Using a youtube video as the input source. This field is required if `audio_source` is `youtube`
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class _SerializerPostV1AnimationBodyAssets(pydantic.BaseModel):
|
|
35
|
+
"""
|
|
36
|
+
Serializer for PostV1AnimationBodyAssets handling case conversions
|
|
37
|
+
and file omissions as dictated by the API
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
model_config = pydantic.ConfigDict(
|
|
41
|
+
populate_by_name=True,
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
audio_file_path: typing.Optional[str] = pydantic.Field(
|
|
45
|
+
alias="audio_file_path", default=None
|
|
46
|
+
)
|
|
47
|
+
audio_source: typing_extensions.Literal["file", "none", "youtube"] = pydantic.Field(
|
|
48
|
+
alias="audio_source",
|
|
49
|
+
)
|
|
50
|
+
image_file_path: typing.Optional[str] = pydantic.Field(
|
|
51
|
+
alias="image_file_path", default=None
|
|
52
|
+
)
|
|
53
|
+
youtube_url: typing.Optional[str] = pydantic.Field(
|
|
54
|
+
alias="youtube_url", default=None
|
|
55
|
+
)
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import typing
|
|
2
|
+
import typing_extensions
|
|
3
|
+
import pydantic
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class PostV1AnimationBodyStyle(typing_extensions.TypedDict):
|
|
7
|
+
"""
|
|
8
|
+
Defines the style of the output video
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
art_style: typing_extensions.Required[
|
|
12
|
+
typing_extensions.Literal[
|
|
13
|
+
"3D Render",
|
|
14
|
+
"90s Streets",
|
|
15
|
+
"Abstract Minimalist",
|
|
16
|
+
"Arcane",
|
|
17
|
+
"Art Deco",
|
|
18
|
+
"Bold Colored Illustration",
|
|
19
|
+
"Cinematic Landscape",
|
|
20
|
+
"Cinematic Miyazaki",
|
|
21
|
+
"Cosmic",
|
|
22
|
+
"Cubist",
|
|
23
|
+
"Custom",
|
|
24
|
+
"Cyberpunk",
|
|
25
|
+
"Dark Graphic Illustration",
|
|
26
|
+
"Dark Watercolor",
|
|
27
|
+
"Directed by AI",
|
|
28
|
+
"Double Exposure",
|
|
29
|
+
"Faded Illustration",
|
|
30
|
+
"Fantasy",
|
|
31
|
+
"Futuristic Anime",
|
|
32
|
+
"Impressionism",
|
|
33
|
+
"Ink and Watercolor Portrait",
|
|
34
|
+
"Inkpunk",
|
|
35
|
+
"Intricate Abstract Lines Portrait",
|
|
36
|
+
"Jackson Pollock",
|
|
37
|
+
"Landscape Painting",
|
|
38
|
+
"Low Poly",
|
|
39
|
+
"Miniatures",
|
|
40
|
+
"Minimal Cold Futurism",
|
|
41
|
+
"Oil Painting",
|
|
42
|
+
"Old School Comic",
|
|
43
|
+
"Overgrown",
|
|
44
|
+
"Painted Cityscape",
|
|
45
|
+
"Painterly Illustration",
|
|
46
|
+
"Photograph",
|
|
47
|
+
"Pixar",
|
|
48
|
+
"Pixel Art",
|
|
49
|
+
"Postapocalyptic",
|
|
50
|
+
"Sin City",
|
|
51
|
+
"Soft Delicate Matte Portrait",
|
|
52
|
+
"Spooky",
|
|
53
|
+
"Studio Ghibli Film Still",
|
|
54
|
+
"Synthwave",
|
|
55
|
+
"Traditional Watercolor",
|
|
56
|
+
"Van Gogh",
|
|
57
|
+
"Vibrant Matte Illustration",
|
|
58
|
+
"Vintage Japanese Anime",
|
|
59
|
+
"Woodcut",
|
|
60
|
+
]
|
|
61
|
+
]
|
|
62
|
+
"""
|
|
63
|
+
The art style of the final output video
|
|
64
|
+
"""
|
|
65
|
+
|
|
66
|
+
art_style_custom: typing_extensions.NotRequired[str]
|
|
67
|
+
"""
|
|
68
|
+
Describe custom art style. This field is required if `art_style` is `Custom`
|
|
69
|
+
"""
|
|
70
|
+
|
|
71
|
+
camera_effect: typing_extensions.Required[
|
|
72
|
+
typing_extensions.Literal[
|
|
73
|
+
"Accelerate",
|
|
74
|
+
"Aggressive Zoom In - Audio Sync",
|
|
75
|
+
"Aggressive Zoom Out - Audio Sync",
|
|
76
|
+
"Boost Zoom In",
|
|
77
|
+
"Boost Zoom Out",
|
|
78
|
+
"Bounce In And Out",
|
|
79
|
+
"Bounce Out",
|
|
80
|
+
"Bounce Out - Audio Sync",
|
|
81
|
+
"Bounce and Spin - Audio Sync",
|
|
82
|
+
"Bounce in Place",
|
|
83
|
+
"Cog in the Machine",
|
|
84
|
+
"Devolve - Audio Sync",
|
|
85
|
+
"Directed by AI",
|
|
86
|
+
"Dramatic Zoom In",
|
|
87
|
+
"Dramatic Zoom Out",
|
|
88
|
+
"Drift Spin",
|
|
89
|
+
"Earthquake Bounce",
|
|
90
|
+
"Earthquake Bounce - Audio Sync",
|
|
91
|
+
"Evolve - Audio Sync",
|
|
92
|
+
"Heartbeat",
|
|
93
|
+
"Hesitate In",
|
|
94
|
+
"Jump",
|
|
95
|
+
"Pan Left",
|
|
96
|
+
"Pan Right",
|
|
97
|
+
"Pulse - Audio Sync",
|
|
98
|
+
"Pusher",
|
|
99
|
+
"Pusher - Audio Sync",
|
|
100
|
+
"Quadrant",
|
|
101
|
+
"Rise and Climb",
|
|
102
|
+
"Road Trip",
|
|
103
|
+
"Rodeo",
|
|
104
|
+
"Roll In",
|
|
105
|
+
"Roll In - Audio Sync",
|
|
106
|
+
"Rolling Bounces",
|
|
107
|
+
"Rubber Band",
|
|
108
|
+
"Simple Zoom In",
|
|
109
|
+
"Simple Zoom Out",
|
|
110
|
+
"Slice Bounce",
|
|
111
|
+
"Slideshow",
|
|
112
|
+
"Speed of Light",
|
|
113
|
+
"Spin Bounce",
|
|
114
|
+
"Sway Out",
|
|
115
|
+
"Sway Out - Audio Sync",
|
|
116
|
+
"Tilt Down",
|
|
117
|
+
"Tilt Up",
|
|
118
|
+
"Traverse",
|
|
119
|
+
"Tron",
|
|
120
|
+
"Vertigo",
|
|
121
|
+
"Vertigo - Audio Sync",
|
|
122
|
+
"Zoom In - Audio Sync",
|
|
123
|
+
"Zoom In and Spin - Audio Sync",
|
|
124
|
+
"Zoom Out - Audio Sync",
|
|
125
|
+
]
|
|
126
|
+
]
|
|
127
|
+
|
|
128
|
+
prompt: typing_extensions.Required[typing.Optional[str]]
|
|
129
|
+
"""
|
|
130
|
+
The prompt used for the video. Prompt is required if `prompt_type` is `custom`. Otherwise this value is ignored
|
|
131
|
+
"""
|
|
132
|
+
|
|
133
|
+
prompt_type: typing_extensions.Required[
|
|
134
|
+
typing_extensions.Literal["ai_choose", "custom", "use_lyrics"]
|
|
135
|
+
]
|
|
136
|
+
"""
|
|
137
|
+
|
|
138
|
+
* `custom` - use your own prompt for the video.
|
|
139
|
+
* `use_lyrics` - Use the lyrics of the audio to create the prompt. If this option is selected, then `assets.audio_source` must be `file` or `youtube`.
|
|
140
|
+
* `ai_choose` - Let AI write the prompt. If this option is selected, then `assets.audio_source` must be `file` or `youtube`.
|
|
141
|
+
"""
|
|
142
|
+
|
|
143
|
+
transition_speed: typing_extensions.Required[int]
|
|
144
|
+
"""
|
|
145
|
+
Change determines how quickly the video's content changes across frames. Higher = more rapid transitions. Lower = more stable visual experience.
|
|
146
|
+
"""
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
class _SerializerPostV1AnimationBodyStyle(pydantic.BaseModel):
|
|
150
|
+
"""
|
|
151
|
+
Serializer for PostV1AnimationBodyStyle handling case conversions
|
|
152
|
+
and file omissions as dictated by the API
|
|
153
|
+
"""
|
|
154
|
+
|
|
155
|
+
model_config = pydantic.ConfigDict(
|
|
156
|
+
populate_by_name=True,
|
|
157
|
+
)
|
|
158
|
+
|
|
159
|
+
art_style: typing_extensions.Literal[
|
|
160
|
+
"3D Render",
|
|
161
|
+
"90s Streets",
|
|
162
|
+
"Abstract Minimalist",
|
|
163
|
+
"Arcane",
|
|
164
|
+
"Art Deco",
|
|
165
|
+
"Bold Colored Illustration",
|
|
166
|
+
"Cinematic Landscape",
|
|
167
|
+
"Cinematic Miyazaki",
|
|
168
|
+
"Cosmic",
|
|
169
|
+
"Cubist",
|
|
170
|
+
"Custom",
|
|
171
|
+
"Cyberpunk",
|
|
172
|
+
"Dark Graphic Illustration",
|
|
173
|
+
"Dark Watercolor",
|
|
174
|
+
"Directed by AI",
|
|
175
|
+
"Double Exposure",
|
|
176
|
+
"Faded Illustration",
|
|
177
|
+
"Fantasy",
|
|
178
|
+
"Futuristic Anime",
|
|
179
|
+
"Impressionism",
|
|
180
|
+
"Ink and Watercolor Portrait",
|
|
181
|
+
"Inkpunk",
|
|
182
|
+
"Intricate Abstract Lines Portrait",
|
|
183
|
+
"Jackson Pollock",
|
|
184
|
+
"Landscape Painting",
|
|
185
|
+
"Low Poly",
|
|
186
|
+
"Miniatures",
|
|
187
|
+
"Minimal Cold Futurism",
|
|
188
|
+
"Oil Painting",
|
|
189
|
+
"Old School Comic",
|
|
190
|
+
"Overgrown",
|
|
191
|
+
"Painted Cityscape",
|
|
192
|
+
"Painterly Illustration",
|
|
193
|
+
"Photograph",
|
|
194
|
+
"Pixar",
|
|
195
|
+
"Pixel Art",
|
|
196
|
+
"Postapocalyptic",
|
|
197
|
+
"Sin City",
|
|
198
|
+
"Soft Delicate Matte Portrait",
|
|
199
|
+
"Spooky",
|
|
200
|
+
"Studio Ghibli Film Still",
|
|
201
|
+
"Synthwave",
|
|
202
|
+
"Traditional Watercolor",
|
|
203
|
+
"Van Gogh",
|
|
204
|
+
"Vibrant Matte Illustration",
|
|
205
|
+
"Vintage Japanese Anime",
|
|
206
|
+
"Woodcut",
|
|
207
|
+
] = pydantic.Field(
|
|
208
|
+
alias="art_style",
|
|
209
|
+
)
|
|
210
|
+
art_style_custom: typing.Optional[str] = pydantic.Field(
|
|
211
|
+
alias="art_style_custom", default=None
|
|
212
|
+
)
|
|
213
|
+
camera_effect: typing_extensions.Literal[
|
|
214
|
+
"Accelerate",
|
|
215
|
+
"Aggressive Zoom In - Audio Sync",
|
|
216
|
+
"Aggressive Zoom Out - Audio Sync",
|
|
217
|
+
"Boost Zoom In",
|
|
218
|
+
"Boost Zoom Out",
|
|
219
|
+
"Bounce In And Out",
|
|
220
|
+
"Bounce Out",
|
|
221
|
+
"Bounce Out - Audio Sync",
|
|
222
|
+
"Bounce and Spin - Audio Sync",
|
|
223
|
+
"Bounce in Place",
|
|
224
|
+
"Cog in the Machine",
|
|
225
|
+
"Devolve - Audio Sync",
|
|
226
|
+
"Directed by AI",
|
|
227
|
+
"Dramatic Zoom In",
|
|
228
|
+
"Dramatic Zoom Out",
|
|
229
|
+
"Drift Spin",
|
|
230
|
+
"Earthquake Bounce",
|
|
231
|
+
"Earthquake Bounce - Audio Sync",
|
|
232
|
+
"Evolve - Audio Sync",
|
|
233
|
+
"Heartbeat",
|
|
234
|
+
"Hesitate In",
|
|
235
|
+
"Jump",
|
|
236
|
+
"Pan Left",
|
|
237
|
+
"Pan Right",
|
|
238
|
+
"Pulse - Audio Sync",
|
|
239
|
+
"Pusher",
|
|
240
|
+
"Pusher - Audio Sync",
|
|
241
|
+
"Quadrant",
|
|
242
|
+
"Rise and Climb",
|
|
243
|
+
"Road Trip",
|
|
244
|
+
"Rodeo",
|
|
245
|
+
"Roll In",
|
|
246
|
+
"Roll In - Audio Sync",
|
|
247
|
+
"Rolling Bounces",
|
|
248
|
+
"Rubber Band",
|
|
249
|
+
"Simple Zoom In",
|
|
250
|
+
"Simple Zoom Out",
|
|
251
|
+
"Slice Bounce",
|
|
252
|
+
"Slideshow",
|
|
253
|
+
"Speed of Light",
|
|
254
|
+
"Spin Bounce",
|
|
255
|
+
"Sway Out",
|
|
256
|
+
"Sway Out - Audio Sync",
|
|
257
|
+
"Tilt Down",
|
|
258
|
+
"Tilt Up",
|
|
259
|
+
"Traverse",
|
|
260
|
+
"Tron",
|
|
261
|
+
"Vertigo",
|
|
262
|
+
"Vertigo - Audio Sync",
|
|
263
|
+
"Zoom In - Audio Sync",
|
|
264
|
+
"Zoom In and Spin - Audio Sync",
|
|
265
|
+
"Zoom Out - Audio Sync",
|
|
266
|
+
] = pydantic.Field(
|
|
267
|
+
alias="camera_effect",
|
|
268
|
+
)
|
|
269
|
+
prompt: typing.Optional[str] = pydantic.Field(
|
|
270
|
+
alias="prompt",
|
|
271
|
+
)
|
|
272
|
+
prompt_type: typing_extensions.Literal["ai_choose", "custom", "use_lyrics"] = (
|
|
273
|
+
pydantic.Field(
|
|
274
|
+
alias="prompt_type",
|
|
275
|
+
)
|
|
276
|
+
)
|
|
277
|
+
transition_speed: int = pydantic.Field(
|
|
278
|
+
alias="transition_speed",
|
|
279
|
+
)
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import typing
|
|
2
|
+
import typing_extensions
|
|
3
|
+
import pydantic
|
|
4
|
+
|
|
5
|
+
from .post_v1_face_swap_body_assets import (
|
|
6
|
+
PostV1FaceSwapBodyAssets,
|
|
7
|
+
_SerializerPostV1FaceSwapBodyAssets,
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class PostV1FaceSwapBody(typing_extensions.TypedDict):
|
|
12
|
+
"""
|
|
13
|
+
PostV1FaceSwapBody
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
assets: typing_extensions.Required[PostV1FaceSwapBodyAssets]
|
|
17
|
+
"""
|
|
18
|
+
Provide the assets for face swap. 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
|
+
name: typing_extensions.NotRequired[str]
|
|
32
|
+
"""
|
|
33
|
+
The name of video
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
start_seconds: typing_extensions.Required[float]
|
|
37
|
+
"""
|
|
38
|
+
The start time of the input video in seconds
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
width: typing_extensions.Required[int]
|
|
42
|
+
"""
|
|
43
|
+
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
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class _SerializerPostV1FaceSwapBody(pydantic.BaseModel):
|
|
48
|
+
"""
|
|
49
|
+
Serializer for PostV1FaceSwapBody handling case conversions
|
|
50
|
+
and file omissions as dictated by the API
|
|
51
|
+
"""
|
|
52
|
+
|
|
53
|
+
model_config = pydantic.ConfigDict(
|
|
54
|
+
populate_by_name=True,
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
assets: _SerializerPostV1FaceSwapBodyAssets = pydantic.Field(
|
|
58
|
+
alias="assets",
|
|
59
|
+
)
|
|
60
|
+
end_seconds: float = pydantic.Field(
|
|
61
|
+
alias="end_seconds",
|
|
62
|
+
)
|
|
63
|
+
height: int = pydantic.Field(
|
|
64
|
+
alias="height",
|
|
65
|
+
)
|
|
66
|
+
name: typing.Optional[str] = pydantic.Field(alias="name", default=None)
|
|
67
|
+
start_seconds: float = pydantic.Field(
|
|
68
|
+
alias="start_seconds",
|
|
69
|
+
)
|
|
70
|
+
width: int = pydantic.Field(
|
|
71
|
+
alias="width",
|
|
72
|
+
)
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import typing
|
|
2
|
+
import typing_extensions
|
|
3
|
+
import pydantic
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class PostV1FaceSwapBodyAssets(typing_extensions.TypedDict):
|
|
7
|
+
"""
|
|
8
|
+
Provide the assets for face swap. For video, The `video_source` field determines whether `video_file_path` or `youtube_url` field is used
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
image_file_path: typing_extensions.Required[str]
|
|
12
|
+
"""
|
|
13
|
+
The path of the input image. 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.
|
|
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 _SerializerPostV1FaceSwapBodyAssets(pydantic.BaseModel):
|
|
32
|
+
"""
|
|
33
|
+
Serializer for PostV1FaceSwapBodyAssets 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
|
+
image_file_path: str = pydantic.Field(
|
|
42
|
+
alias="image_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
|
+
)
|