magic_hour 0.14.0__py3-none-any.whl → 0.15.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/environment.py CHANGED
@@ -5,4 +5,4 @@ class Environment(enum.Enum):
5
5
  """Pre-defined base URLs for the API"""
6
6
 
7
7
  ENVIRONMENT = "https://api.magichour.ai"
8
- MOCK_SERVER = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.14.0"
8
+ MOCK_SERVER = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.15.0"
@@ -23,10 +23,10 @@ res = client.v1.face_swap.create(
23
23
  "video_source": "file",
24
24
  },
25
25
  end_seconds=15.0,
26
- height=960,
27
26
  start_seconds=0.0,
28
- width=512,
27
+ height=960,
29
28
  name="Face Swap video",
29
+ width=512,
30
30
  )
31
31
  ```
32
32
 
@@ -44,9 +44,9 @@ res = await client.v1.face_swap.create(
44
44
  "video_source": "file",
45
45
  },
46
46
  end_seconds=15.0,
47
- height=960,
48
47
  start_seconds=0.0,
49
- width=512,
48
+ height=960,
50
49
  name="Face Swap video",
50
+ width=512,
51
51
  )
52
52
  ```
@@ -20,12 +20,16 @@ class FaceSwapClient:
20
20
  *,
21
21
  assets: params.V1FaceSwapCreateBodyAssets,
22
22
  end_seconds: float,
23
- height: int,
24
23
  start_seconds: float,
25
- width: int,
24
+ height: typing.Union[
25
+ typing.Optional[int], type_utils.NotGiven
26
+ ] = type_utils.NOT_GIVEN,
26
27
  name: typing.Union[
27
28
  typing.Optional[str], type_utils.NotGiven
28
29
  ] = type_utils.NOT_GIVEN,
30
+ width: typing.Union[
31
+ typing.Optional[int], type_utils.NotGiven
32
+ ] = type_utils.NOT_GIVEN,
29
33
  request_options: typing.Optional[RequestOptions] = None,
30
34
  ) -> models.V1FaceSwapCreateResponse:
31
35
  """
@@ -39,12 +43,26 @@ class FaceSwapClient:
39
43
  POST /v1/face-swap
40
44
 
41
45
  Args:
46
+ height: Used to determine the dimensions of the output video.
47
+
48
+ * 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.
49
+ * If both height and width are omitted, the video will be resized according to your subscription's maximum resolution, while preserving aspect ratio.
50
+
51
+ Note: if the video's original resolution is less than the maximum, the video will not be resized.
52
+
53
+ See our [pricing page](https://magichour.ai/pricing) for more details.
42
54
  name: The name of video
55
+ width: Used to determine the dimensions of the output video.
56
+
57
+ * 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.
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.
43
63
  assets: Provide the assets for face swap. For video, The `video_source` field determines whether `video_file_path` or `youtube_url` field is used
44
64
  end_seconds: The end time of the input video in seconds
45
- height: 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
46
65
  start_seconds: The start time of the input video in seconds
47
- width: 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
48
66
  request_options: Additional options to customize the HTTP request
49
67
 
50
68
  Returns:
@@ -63,21 +81,21 @@ class FaceSwapClient:
63
81
  "video_source": "file",
64
82
  },
65
83
  end_seconds=15.0,
66
- height=960,
67
84
  start_seconds=0.0,
68
- width=512,
85
+ height=960,
69
86
  name="Face Swap video",
87
+ width=512,
70
88
  )
71
89
  ```
72
90
  """
73
91
  _json = to_encodable(
74
92
  item={
93
+ "height": height,
75
94
  "name": name,
95
+ "width": width,
76
96
  "assets": assets,
77
97
  "end_seconds": end_seconds,
78
- "height": height,
79
98
  "start_seconds": start_seconds,
80
- "width": width,
81
99
  },
82
100
  dump_with=params._SerializerV1FaceSwapCreateBody,
83
101
  )
@@ -100,12 +118,16 @@ class AsyncFaceSwapClient:
100
118
  *,
101
119
  assets: params.V1FaceSwapCreateBodyAssets,
102
120
  end_seconds: float,
103
- height: int,
104
121
  start_seconds: float,
105
- width: int,
122
+ height: typing.Union[
123
+ typing.Optional[int], type_utils.NotGiven
124
+ ] = type_utils.NOT_GIVEN,
106
125
  name: typing.Union[
107
126
  typing.Optional[str], type_utils.NotGiven
108
127
  ] = type_utils.NOT_GIVEN,
128
+ width: typing.Union[
129
+ typing.Optional[int], type_utils.NotGiven
130
+ ] = type_utils.NOT_GIVEN,
109
131
  request_options: typing.Optional[RequestOptions] = None,
110
132
  ) -> models.V1FaceSwapCreateResponse:
111
133
  """
@@ -119,12 +141,26 @@ class AsyncFaceSwapClient:
119
141
  POST /v1/face-swap
120
142
 
121
143
  Args:
144
+ height: Used to determine the dimensions of the output video.
145
+
146
+ * 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.
147
+ * If both height and width are omitted, the video will be resized according to your subscription's maximum resolution, while preserving aspect ratio.
148
+
149
+ Note: if the video's original resolution is less than the maximum, the video will not be resized.
150
+
151
+ See our [pricing page](https://magichour.ai/pricing) for more details.
122
152
  name: The name of video
153
+ width: Used to determine the dimensions of the output video.
154
+
155
+ * 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.
156
+ * If both height and width are omitted, the video will be resized according to your subscription's maximum resolution, while preserving aspect ratio.
157
+
158
+ Note: if the video's original resolution is less than the maximum, the video will not be resized.
159
+
160
+ See our [pricing page](https://magichour.ai/pricing) for more details.
123
161
  assets: Provide the assets for face swap. For video, The `video_source` field determines whether `video_file_path` or `youtube_url` field is used
124
162
  end_seconds: The end time of the input video in seconds
125
- height: 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
126
163
  start_seconds: The start time of the input video in seconds
127
- width: 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
128
164
  request_options: Additional options to customize the HTTP request
129
165
 
130
166
  Returns:
@@ -143,21 +179,21 @@ class AsyncFaceSwapClient:
143
179
  "video_source": "file",
144
180
  },
145
181
  end_seconds=15.0,
146
- height=960,
147
182
  start_seconds=0.0,
148
- width=512,
183
+ height=960,
149
184
  name="Face Swap video",
185
+ width=512,
150
186
  )
151
187
  ```
152
188
  """
153
189
  _json = to_encodable(
154
190
  item={
191
+ "height": height,
155
192
  "name": name,
193
+ "width": width,
156
194
  "assets": assets,
157
195
  "end_seconds": end_seconds,
158
- "height": height,
159
196
  "start_seconds": start_seconds,
160
- "width": width,
161
197
  },
162
198
  dump_with=params._SerializerV1FaceSwapCreateBody,
163
199
  )
@@ -23,9 +23,16 @@ class V1FaceSwapCreateBody(typing_extensions.TypedDict):
23
23
  The end time of the input video in seconds
24
24
  """
25
25
 
26
- height: typing_extensions.Required[int]
26
+ height: typing_extensions.NotRequired[int]
27
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
28
+ Used to determine the dimensions of the output video.
29
+
30
+ * 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.
31
+ * If both height and width are omitted, the video will be resized according to your subscription's maximum resolution, while preserving aspect ratio.
32
+
33
+ Note: if the video's original resolution is less than the maximum, the video will not be resized.
34
+
35
+ See our [pricing page](https://magichour.ai/pricing) for more details.
29
36
  """
30
37
 
31
38
  name: typing_extensions.NotRequired[str]
@@ -38,9 +45,16 @@ class V1FaceSwapCreateBody(typing_extensions.TypedDict):
38
45
  The start time of the input video in seconds
39
46
  """
40
47
 
41
- width: typing_extensions.Required[int]
48
+ width: typing_extensions.NotRequired[int]
42
49
  """
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
50
+ Used to determine the dimensions of the output video.
51
+
52
+ * 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.
53
+ * If both height and width are omitted, the video will be resized according to your subscription's maximum resolution, while preserving aspect ratio.
54
+
55
+ Note: if the video's original resolution is less than the maximum, the video will not be resized.
56
+
57
+ See our [pricing page](https://magichour.ai/pricing) for more details.
44
58
  """
45
59
 
46
60
 
@@ -60,13 +74,9 @@ class _SerializerV1FaceSwapCreateBody(pydantic.BaseModel):
60
74
  end_seconds: float = pydantic.Field(
61
75
  alias="end_seconds",
62
76
  )
63
- height: int = pydantic.Field(
64
- alias="height",
65
- )
77
+ height: typing.Optional[int] = pydantic.Field(alias="height", default=None)
66
78
  name: typing.Optional[str] = pydantic.Field(alias="name", default=None)
67
79
  start_seconds: float = pydantic.Field(
68
80
  alias="start_seconds",
69
81
  )
70
- width: int = pydantic.Field(
71
- alias="width",
72
- )
82
+ width: typing.Optional[int] = pydantic.Field(alias="width", default=None)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: magic_hour
3
- Version: 0.14.0
3
+ Version: 0.15.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
@@ -10,7 +10,7 @@ magic_hour/core/request.py,sha256=lyHrh2VWY238D7JPbgZJlodTqBlHSmQn4fBJiBfE1Es,50
10
10
  magic_hour/core/response.py,sha256=Sl7nPL2axmz7em_6d9TkFSnQQKUpalWaVWbPPWoXJgM,10180
11
11
  magic_hour/core/type_utils.py,sha256=4bU9WXnMXJ6YTtuqOMiB8t6Xw0RlfVWJ-IDBONlqEtQ,461
12
12
  magic_hour/core/utils.py,sha256=34SiC1vw2A0TkYHONgMA_d09soIIYiiBWRXCZGdwGIk,1669
13
- magic_hour/environment.py,sha256=f6sXlVm-SfxzdDLBMF2uFwouyMuLK7wm329NvbtRwRA,213
13
+ magic_hour/environment.py,sha256=_uag_rbbVmwykIg00RAOUAJnraLbBtFWIbdvLs9ytxw,213
14
14
  magic_hour/resources/v1/__init__.py,sha256=Aj0sjVcoijjQyieNBxv2_uewPYC2vO2UG-ehoBgCz5E,86
15
15
  magic_hour/resources/v1/ai_clothes_changer/README.md,sha256=KQTvbttct5GcdOJW3NG5gCsWF6G2qlwIoBjBd92TjUs,977
16
16
  magic_hour/resources/v1/ai_clothes_changer/__init__.py,sha256=6W_Y2HxG2sDOBiJyzngK3Q2S3xfQgpK-j8xFRmBAhbQ,142
@@ -40,9 +40,9 @@ magic_hour/resources/v1/animation/README.md,sha256=uIVfUwD7iAOe2eJDgrxj4UyYmq9R3
40
40
  magic_hour/resources/v1/animation/__init__.py,sha256=M6KUe6TEZl_DAdyn1HFQ2kHYanZo6xy3mvUdCN264hQ,114
41
41
  magic_hour/resources/v1/animation/client.py,sha256=YYjggl_hszTW-Sn9SFs3m7bz7PvtRTruhHSSnrkkD9c,6401
42
42
  magic_hour/resources/v1/client.py,sha256=ml5WQYIOi5GMw6fAa1e1JXJaRoA19U5ZYBcPoERILGM,5782
43
- magic_hour/resources/v1/face_swap/README.md,sha256=7b6OeNBhMHJkxaQ7NFEuGUtgDUHOkpasXlU05KE5jkQ,1306
43
+ magic_hour/resources/v1/face_swap/README.md,sha256=g5e_eZu3OsrIuc6ISpXbliIX1uVeYX7MwOfdw74dIoI,1306
44
44
  magic_hour/resources/v1/face_swap/__init__.py,sha256=lyg5uAHyYHEUVAiAZtP3zwjGCEGqq8IWbQKexVdhr00,110
45
- magic_hour/resources/v1/face_swap/client.py,sha256=yhBmF1CrYZQfd4W_oerU96W7z-2oza_D83aqliEOsxY,6383
45
+ magic_hour/resources/v1/face_swap/client.py,sha256=-BpJae7J4PZPUG45BMA3HBB2XhrbHpgWqwwyaDFH88A,8519
46
46
  magic_hour/resources/v1/face_swap_photo/README.md,sha256=9iGINuGkWn60ZaZgZ4xz0Iho0lvfE-e_YVEA2vId6QU,964
47
47
  magic_hour/resources/v1/face_swap_photo/__init__.py,sha256=NZEplYX5kDPL_0qY0Q5tuxhDevipN0otByTYKMmF_1k,130
48
48
  magic_hour/resources/v1/face_swap_photo/client.py,sha256=wRkC3o5fJoATrCYvnlw4PfVoSXU_fPDyKtzBozn01Rk,4027
@@ -121,7 +121,7 @@ magic_hour/types/params/v1_ai_talking_photo_create_body_assets.py,sha256=_xNq6uV
121
121
  magic_hour/types/params/v1_animation_create_body.py,sha256=QB0zxAhNDV8BEd6vuTAUoZaF2E0PNKwfzV7OrsdueGk,2221
122
122
  magic_hour/types/params/v1_animation_create_body_assets.py,sha256=Iot5sbRKLlXCHZS1X5tGICSRKOneBcqaDijYm5_BaUA,1965
123
123
  magic_hour/types/params/v1_animation_create_body_style.py,sha256=1ujex1BXQq70rp10Pxs8wkb6pkM7fP6fojTW5ATdXyo,8045
124
- magic_hour/types/params/v1_face_swap_create_body.py,sha256=c4unmCpqQl0ZoW08u5ts1WqgacSkalwPZIHFIiASTcU,2013
124
+ magic_hour/types/params/v1_face_swap_create_body.py,sha256=ZLxWHSs5NHHeBxBAE-8AEgUwEpEhpYQC4fW9dkmDXxQ,2923
125
125
  magic_hour/types/params/v1_face_swap_create_body_assets.py,sha256=CYcleQ4o_YLxRjRiVRwB-L_Cr0WTjsb6417uwdT0fas,1888
126
126
  magic_hour/types/params/v1_face_swap_photo_create_body.py,sha256=OYsrz7d7i7eg28bR_YS5ucl6k_bMhmNrOt2dF7MYdM4,979
127
127
  magic_hour/types/params/v1_face_swap_photo_create_body_assets.py,sha256=6UV78qJPwT9fgZ-26Zfko8alO4QlN88l5u7gm82Rz60,1279
@@ -139,7 +139,7 @@ magic_hour/types/params/v1_text_to_video_create_body_style.py,sha256=9NTboy7J4ef
139
139
  magic_hour/types/params/v1_video_to_video_create_body.py,sha256=iOb3qGXySlI4unyWPAXDmiLMUSHH6ymuDHeiwpmhKeE,2942
140
140
  magic_hour/types/params/v1_video_to_video_create_body_assets.py,sha256=_-6iA5d8ndka6iJWyWvlJwzRkQcmurJE6hkg-fDwBmQ,1531
141
141
  magic_hour/types/params/v1_video_to_video_create_body_style.py,sha256=2jgpJ3A8LNXksTPQ5pp1tWXtd753zBuhBjA22qqCsTE,5697
142
- magic_hour-0.14.0.dist-info/LICENSE,sha256=F3fxj7JXPgB2K0uj8YXRsVss4u-Dgt_-U3V4VXsivNI,1070
143
- magic_hour-0.14.0.dist-info/METADATA,sha256=eLoBI-qD410IkJndKZydTo7CTO141nMZmvS7_NabfVg,4997
144
- magic_hour-0.14.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
145
- magic_hour-0.14.0.dist-info/RECORD,,
142
+ magic_hour-0.15.0.dist-info/LICENSE,sha256=F3fxj7JXPgB2K0uj8YXRsVss4u-Dgt_-U3V4VXsivNI,1070
143
+ magic_hour-0.15.0.dist-info/METADATA,sha256=oS15F_OGakNy_WYZGGfdOZYQGyl8w_22MQf4R_RD-0w,4997
144
+ magic_hour-0.15.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
145
+ magic_hour-0.15.0.dist-info/RECORD,,