magic_hour 0.22.0__py3-none-any.whl → 0.23.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
@@ -6,7 +6,7 @@ class Environment(enum.Enum):
6
6
  """Pre-defined base URLs for the API"""
7
7
 
8
8
  ENVIRONMENT = "https://api.magichour.ai"
9
- MOCK_SERVER = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.22.0"
9
+ MOCK_SERVER = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.23.0"
10
10
 
11
11
 
12
12
  def _get_base_url(
@@ -24,6 +24,9 @@ class AiTalkingPhotoClient:
24
24
  name: typing.Union[
25
25
  typing.Optional[str], type_utils.NotGiven
26
26
  ] = type_utils.NOT_GIVEN,
27
+ style: typing.Union[
28
+ typing.Optional[params.V1AiTalkingPhotoCreateBodyStyle], type_utils.NotGiven
29
+ ] = type_utils.NOT_GIVEN,
27
30
  request_options: typing.Optional[RequestOptions] = None,
28
31
  ) -> models.V1AiTalkingPhotoCreateResponse:
29
32
  """
@@ -35,9 +38,10 @@ class AiTalkingPhotoClient:
35
38
 
36
39
  Args:
37
40
  name: The name of image
41
+ style: Attributes used to dictate the style of the output
38
42
  assets: Provide the assets for creating a talking photo
39
- end_seconds: The end time of the input video in seconds
40
- start_seconds: The start time of the input video in seconds
43
+ end_seconds: The end time of the input audio in seconds. The maximum duration allowed is 30 seconds.
44
+ start_seconds: The start time of the input audio in seconds. The maximum duration allowed is 30 seconds.
41
45
  request_options: Additional options to customize the HTTP request
42
46
 
43
47
  Returns:
@@ -63,6 +67,7 @@ class AiTalkingPhotoClient:
63
67
  _json = to_encodable(
64
68
  item={
65
69
  "name": name,
70
+ "style": style,
66
71
  "assets": assets,
67
72
  "end_seconds": end_seconds,
68
73
  "start_seconds": start_seconds,
@@ -92,6 +97,9 @@ class AsyncAiTalkingPhotoClient:
92
97
  name: typing.Union[
93
98
  typing.Optional[str], type_utils.NotGiven
94
99
  ] = type_utils.NOT_GIVEN,
100
+ style: typing.Union[
101
+ typing.Optional[params.V1AiTalkingPhotoCreateBodyStyle], type_utils.NotGiven
102
+ ] = type_utils.NOT_GIVEN,
95
103
  request_options: typing.Optional[RequestOptions] = None,
96
104
  ) -> models.V1AiTalkingPhotoCreateResponse:
97
105
  """
@@ -103,9 +111,10 @@ class AsyncAiTalkingPhotoClient:
103
111
 
104
112
  Args:
105
113
  name: The name of image
114
+ style: Attributes used to dictate the style of the output
106
115
  assets: Provide the assets for creating a talking photo
107
- end_seconds: The end time of the input video in seconds
108
- start_seconds: The start time of the input video in seconds
116
+ end_seconds: The end time of the input audio in seconds. The maximum duration allowed is 30 seconds.
117
+ start_seconds: The start time of the input audio in seconds. The maximum duration allowed is 30 seconds.
109
118
  request_options: Additional options to customize the HTTP request
110
119
 
111
120
  Returns:
@@ -131,6 +140,7 @@ class AsyncAiTalkingPhotoClient:
131
140
  _json = to_encodable(
132
141
  item={
133
142
  "name": name,
143
+ "style": style,
134
144
  "assets": assets,
135
145
  "end_seconds": end_seconds,
136
146
  "start_seconds": start_seconds,
@@ -94,6 +94,10 @@ from .v1_ai_talking_photo_create_body_assets import (
94
94
  V1AiTalkingPhotoCreateBodyAssets,
95
95
  _SerializerV1AiTalkingPhotoCreateBodyAssets,
96
96
  )
97
+ from .v1_ai_talking_photo_create_body_style import (
98
+ V1AiTalkingPhotoCreateBodyStyle,
99
+ _SerializerV1AiTalkingPhotoCreateBodyStyle,
100
+ )
97
101
  from .v1_animation_create_body import (
98
102
  V1AnimationCreateBody,
99
103
  _SerializerV1AnimationCreateBody,
@@ -210,6 +214,7 @@ __all__ = [
210
214
  "V1AiQrCodeGeneratorCreateBodyStyle",
211
215
  "V1AiTalkingPhotoCreateBody",
212
216
  "V1AiTalkingPhotoCreateBodyAssets",
217
+ "V1AiTalkingPhotoCreateBodyStyle",
213
218
  "V1AnimationCreateBody",
214
219
  "V1AnimationCreateBodyAssets",
215
220
  "V1AnimationCreateBodyStyle",
@@ -257,6 +262,7 @@ __all__ = [
257
262
  "_SerializerV1AiQrCodeGeneratorCreateBodyStyle",
258
263
  "_SerializerV1AiTalkingPhotoCreateBody",
259
264
  "_SerializerV1AiTalkingPhotoCreateBodyAssets",
265
+ "_SerializerV1AiTalkingPhotoCreateBodyStyle",
260
266
  "_SerializerV1AnimationCreateBody",
261
267
  "_SerializerV1AnimationCreateBodyAssets",
262
268
  "_SerializerV1AnimationCreateBodyStyle",
@@ -6,6 +6,10 @@ from .v1_ai_talking_photo_create_body_assets import (
6
6
  V1AiTalkingPhotoCreateBodyAssets,
7
7
  _SerializerV1AiTalkingPhotoCreateBodyAssets,
8
8
  )
9
+ from .v1_ai_talking_photo_create_body_style import (
10
+ V1AiTalkingPhotoCreateBodyStyle,
11
+ _SerializerV1AiTalkingPhotoCreateBodyStyle,
12
+ )
9
13
 
10
14
 
11
15
  class V1AiTalkingPhotoCreateBody(typing_extensions.TypedDict):
@@ -20,7 +24,7 @@ class V1AiTalkingPhotoCreateBody(typing_extensions.TypedDict):
20
24
 
21
25
  end_seconds: typing_extensions.Required[float]
22
26
  """
23
- The end time of the input video in seconds
27
+ The end time of the input audio in seconds. The maximum duration allowed is 30 seconds.
24
28
  """
25
29
 
26
30
  name: typing_extensions.NotRequired[str]
@@ -30,7 +34,12 @@ class V1AiTalkingPhotoCreateBody(typing_extensions.TypedDict):
30
34
 
31
35
  start_seconds: typing_extensions.Required[float]
32
36
  """
33
- The start time of the input video in seconds
37
+ The start time of the input audio in seconds. The maximum duration allowed is 30 seconds.
38
+ """
39
+
40
+ style: typing_extensions.NotRequired[V1AiTalkingPhotoCreateBodyStyle]
41
+ """
42
+ Attributes used to dictate the style of the output
34
43
  """
35
44
 
36
45
 
@@ -54,3 +63,6 @@ class _SerializerV1AiTalkingPhotoCreateBody(pydantic.BaseModel):
54
63
  start_seconds: float = pydantic.Field(
55
64
  alias="start_seconds",
56
65
  )
66
+ style: typing.Optional[_SerializerV1AiTalkingPhotoCreateBodyStyle] = pydantic.Field(
67
+ alias="style", default=None
68
+ )
@@ -0,0 +1,41 @@
1
+ import pydantic
2
+ import typing
3
+ import typing_extensions
4
+
5
+
6
+ class V1AiTalkingPhotoCreateBodyStyle(typing_extensions.TypedDict):
7
+ """
8
+ Attributes used to dictate the style of the output
9
+ """
10
+
11
+ generation_mode: typing_extensions.NotRequired[
12
+ typing_extensions.Literal["expressive", "stable"]
13
+ ]
14
+ """
15
+ Controls overall motion style.
16
+ * `expressive` - More motion and facial expressiveness; may introduce visual artifacts.
17
+ * `stable` - Reduced motion for cleaner output; may result in minimal animation.
18
+ """
19
+
20
+ intensity: typing_extensions.NotRequired[float]
21
+ """
22
+ Note: this value is only applicable when generation_mode is `expressive`. The value can include up to 2 decimal places.
23
+ * Lower values yield more stability but can suppress mouth movement.
24
+ * Higher values increase motion and expressiveness, with a higher risk of distortion.
25
+ """
26
+
27
+
28
+ class _SerializerV1AiTalkingPhotoCreateBodyStyle(pydantic.BaseModel):
29
+ """
30
+ Serializer for V1AiTalkingPhotoCreateBodyStyle handling case conversions
31
+ and file omissions as dictated by the API
32
+ """
33
+
34
+ model_config = pydantic.ConfigDict(
35
+ populate_by_name=True,
36
+ )
37
+
38
+ generation_mode: typing.Optional[
39
+ typing_extensions.Literal["expressive", "stable"]
40
+ ] = pydantic.Field(alias="generation_mode", default=None)
41
+ intensity: typing.Optional[float] = pydantic.Field(alias="intensity", default=None)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: magic_hour
3
- Version: 0.22.0
3
+ Version: 0.23.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 @@ Classifier: Programming Language :: Python :: 3.10
10
10
  Classifier: Programming Language :: Python :: 3.11
11
11
  Classifier: Programming Language :: Python :: 3.12
12
12
  Classifier: Programming Language :: Python :: 3.13
13
- Requires-Dist: httpx (>=0.26.0,<0.27.0)
13
+ Requires-Dist: httpx (>=0.26.0,<1)
14
14
  Requires-Dist: jsonpointer (>=3.0.0,<4.0.0)
15
15
  Requires-Dist: pydantic (>=2.5.0,<3.0.0)
16
16
  Requires-Dist: typing_extensions (>=4.0.0,<5.0.0)
@@ -10,7 +10,7 @@ magic_hour/core/request.py,sha256=_ikn8iZ2fU9Ubqnt7M9hdEnXGV6AAFHJYmDKBtxEY4I,52
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=g0GH7PJoDf1UopPPNwPA6y2n3WeVAz8nLmwCykGAUHw,535
13
+ magic_hour/environment.py,sha256=e9Vh0yGfeTIQJk7Dw_0XB8R54n0Dp611FTW7m9guGRU,535
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=Bf0C0DQu-5tW696Ft7H4NYC3592XeZjl1RSbR-hw2ss,971
16
16
  magic_hour/resources/v1/ai_clothes_changer/__init__.py,sha256=6W_Y2HxG2sDOBiJyzngK3Q2S3xfQgpK-j8xFRmBAhbQ,142
@@ -41,7 +41,7 @@ magic_hour/resources/v1/ai_qr_code_generator/__init__.py,sha256=HnSTg7tB8M5LibZo
41
41
  magic_hour/resources/v1/ai_qr_code_generator/client.py,sha256=mmdGgUSVoMTazmGiB24mc2sXsfaAtx-Fbgcu_SncW-Q,3851
42
42
  magic_hour/resources/v1/ai_talking_photo/README.md,sha256=3IskEBX7J4mQO1ndzv3v1LdtNJxxEyS9ogPYAWt5IIo,935
43
43
  magic_hour/resources/v1/ai_talking_photo/__init__.py,sha256=ZTDD_IRBoR7GSdGWCVEK2-LOEsKUdGEHZZvDHa9MOnA,134
44
- magic_hour/resources/v1/ai_talking_photo/client.py,sha256=TQNwMP3DhDj5jb51diMxcONDbdMPsIe_GSnNahZg8AM,4623
44
+ magic_hour/resources/v1/ai_talking_photo/client.py,sha256=Y4p5HAlbCAe2NNqekdllSZ0jRhzwCcjAIHO0zlqxi3Q,5311
45
45
  magic_hour/resources/v1/animation/README.md,sha256=QQqzioZ8qnBlv6TiE2utyIxcpUnRheMz4vCJTROvdwM,1470
46
46
  magic_hour/resources/v1/animation/__init__.py,sha256=M6KUe6TEZl_DAdyn1HFQ2kHYanZo6xy3mvUdCN264hQ,114
47
47
  magic_hour/resources/v1/animation/client.py,sha256=YYjggl_hszTW-Sn9SFs3m7bz7PvtRTruhHSSnrkkD9c,6401
@@ -110,7 +110,7 @@ magic_hour/types/models/v1_video_projects_get_response_download.py,sha256=nudDCN
110
110
  magic_hour/types/models/v1_video_projects_get_response_downloads_item.py,sha256=DlUuLBSGa7jWoozxferkaOsGc4jASItcjjWbBXGu620,410
111
111
  magic_hour/types/models/v1_video_projects_get_response_error.py,sha256=49QxnXAmYHcvSWuuhbQZeGlUfqVcO4YwZ414GczQnvA,568
112
112
  magic_hour/types/models/v1_video_to_video_create_response.py,sha256=HCquU2Dciu6jCvhlpce8sGg1CypZngvtrvkwyCWOkSY,1346
113
- magic_hour/types/params/__init__.py,sha256=I8TdaEeRIiRwIkM8i8q4RlYWcYD8dGitWEGEDP9ryYs,10237
113
+ magic_hour/types/params/__init__.py,sha256=GvRYw3XDWkHLT-lgbGlC-WzCzSn5U2XeFzRk9VuJaGY,10466
114
114
  magic_hour/types/params/v1_ai_clothes_changer_create_body.py,sha256=X5koqrTxYLiKcRMqPF7r-VwQzy4r_7k81o1289zHJvo,1006
115
115
  magic_hour/types/params/v1_ai_clothes_changer_create_body_assets.py,sha256=GGnXOExxXtnHT9wQpDCEkLHQlQB5MbAbYuU47iHGf70,1509
116
116
  magic_hour/types/params/v1_ai_face_editor_create_body.py,sha256=sF7mJbqratllYwQ3slqUTctOndAYnH9BDMJu-49Db-4,1313
@@ -133,8 +133,9 @@ magic_hour/types/params/v1_ai_photo_editor_create_body_assets.py,sha256=xoDh4VwV
133
133
  magic_hour/types/params/v1_ai_photo_editor_create_body_style.py,sha256=EGPcoSjCDffoTbY3QB-85HVJ97p9swcZkMsYdW_O2JE,2752
134
134
  magic_hour/types/params/v1_ai_qr_code_generator_create_body.py,sha256=_O1654Mbl77SGi9lH4FmKkTwtCXCArH9BeSlgTuLyT0,1109
135
135
  magic_hour/types/params/v1_ai_qr_code_generator_create_body_style.py,sha256=i3ldwmoQPEnrw654PNIARmpsX-kUHZqaT8wjcc22JoA,839
136
- magic_hour/types/params/v1_ai_talking_photo_create_body.py,sha256=YOIaCrhespIr0Ue6cOF4R2bg00BGZXQeJwP7RwhJhRI,1408
136
+ magic_hour/types/params/v1_ai_talking_photo_create_body.py,sha256=D8zvwqOoNf8DlWa7EOkDNXHt2PqrGzup0uxXDYP5RCI,1915
137
137
  magic_hour/types/params/v1_ai_talking_photo_create_body_assets.py,sha256=_xNq6uVb6h7TYsNGesEbpAvrGKmVgqXwVV7Hq7jyEO4,1230
138
+ magic_hour/types/params/v1_ai_talking_photo_create_body_style.py,sha256=iXKnUrYrKC-9sRxZlthUpiqHgSSyQe0UjYNhhKRKI1Q,1434
138
139
  magic_hour/types/params/v1_animation_create_body.py,sha256=QB0zxAhNDV8BEd6vuTAUoZaF2E0PNKwfzV7OrsdueGk,2221
139
140
  magic_hour/types/params/v1_animation_create_body_assets.py,sha256=Iot5sbRKLlXCHZS1X5tGICSRKOneBcqaDijYm5_BaUA,1965
140
141
  magic_hour/types/params/v1_animation_create_body_style.py,sha256=1ujex1BXQq70rp10Pxs8wkb6pkM7fP6fojTW5ATdXyo,8045
@@ -158,7 +159,7 @@ magic_hour/types/params/v1_text_to_video_create_body_style.py,sha256=9NTboy7J4ef
158
159
  magic_hour/types/params/v1_video_to_video_create_body.py,sha256=Pgok6GUVHrpW6H3rwdVFA3O5YJvjgviCZkmmHddOSWo,3802
159
160
  magic_hour/types/params/v1_video_to_video_create_body_assets.py,sha256=_-6iA5d8ndka6iJWyWvlJwzRkQcmurJE6hkg-fDwBmQ,1531
160
161
  magic_hour/types/params/v1_video_to_video_create_body_style.py,sha256=RrDBhN2KQnCf9hGsnl3sAYvuFRsxth2JXfe5la0IYJg,5749
161
- magic_hour-0.22.0.dist-info/LICENSE,sha256=F3fxj7JXPgB2K0uj8YXRsVss4u-Dgt_-U3V4VXsivNI,1070
162
- magic_hour-0.22.0.dist-info/METADATA,sha256=Z6s0unSY6ORWQMQB9jNM01ErVLuce9fWwYOnBvx0W4g,5483
163
- magic_hour-0.22.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
164
- magic_hour-0.22.0.dist-info/RECORD,,
162
+ magic_hour-0.23.0.dist-info/LICENSE,sha256=F3fxj7JXPgB2K0uj8YXRsVss4u-Dgt_-U3V4VXsivNI,1070
163
+ magic_hour-0.23.0.dist-info/METADATA,sha256=W0vahZcyfUqxLtUDqSxjto2iy8wnmtZYRhTV_9pqpxQ,5478
164
+ magic_hour-0.23.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
165
+ magic_hour-0.23.0.dist-info/RECORD,,