magic_hour 0.33.0__py3-none-any.whl → 0.33.1__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/client.py +4 -2
- magic_hour/core/base_client.py +10 -4
- magic_hour/environment.py +1 -1
- magic_hour/resources/v1/image_to_video/README.md +2 -6
- magic_hour/resources/v1/image_to_video/client.py +0 -4
- {magic_hour-0.33.0.dist-info → magic_hour-0.33.1.dist-info}/METADATA +1 -1
- {magic_hour-0.33.0.dist-info → magic_hour-0.33.1.dist-info}/RECORD +9 -9
- {magic_hour-0.33.0.dist-info → magic_hour-0.33.1.dist-info}/LICENSE +0 -0
- {magic_hour-0.33.0.dist-info → magic_hour-0.33.1.dist-info}/WHEEL +0 -0
magic_hour/client.py
CHANGED
|
@@ -22,8 +22,9 @@ class Client:
|
|
|
22
22
|
httpx_client=httpx.Client(timeout=timeout)
|
|
23
23
|
if httpx_client is None
|
|
24
24
|
else httpx_client,
|
|
25
|
+
auths={"bearerAuth": AuthBearer(token=token)},
|
|
25
26
|
)
|
|
26
|
-
|
|
27
|
+
|
|
27
28
|
self.v1 = V1Client(base_client=self._base_client)
|
|
28
29
|
|
|
29
30
|
|
|
@@ -43,6 +44,7 @@ class AsyncClient:
|
|
|
43
44
|
httpx_client=httpx.AsyncClient(timeout=timeout)
|
|
44
45
|
if httpx_client is None
|
|
45
46
|
else httpx_client,
|
|
47
|
+
auths={"bearerAuth": AuthBearer(token=token)},
|
|
46
48
|
)
|
|
47
|
-
|
|
49
|
+
|
|
48
50
|
self.v1 = AsyncV1Client(base_client=self._base_client)
|
magic_hour/core/base_client.py
CHANGED
|
@@ -38,14 +38,18 @@ class BaseClient:
|
|
|
38
38
|
_auths: Dictionary mapping auth provider IDs to AuthProvider instances
|
|
39
39
|
"""
|
|
40
40
|
|
|
41
|
-
def __init__(
|
|
41
|
+
def __init__(
|
|
42
|
+
self,
|
|
43
|
+
base_url: Union[str, Dict[str, str]],
|
|
44
|
+
auths: Optional[Dict[str, AuthProvider]] = None,
|
|
45
|
+
):
|
|
42
46
|
"""Initialize the base client"""
|
|
43
47
|
self._base_url = (
|
|
44
48
|
base_url
|
|
45
49
|
if isinstance(base_url, dict)
|
|
46
50
|
else {_DEFAULT_SERVICE_NAME: base_url}
|
|
47
51
|
)
|
|
48
|
-
self._auths: Dict[str, AuthProvider] = {}
|
|
52
|
+
self._auths: Dict[str, AuthProvider] = auths or {}
|
|
49
53
|
|
|
50
54
|
def register_auth(self, auth_id: str, provider: AuthProvider):
|
|
51
55
|
"""Register an authentication provider.
|
|
@@ -345,13 +349,14 @@ class SyncBaseClient(BaseClient):
|
|
|
345
349
|
*,
|
|
346
350
|
base_url: Union[str, Dict[str, str]],
|
|
347
351
|
httpx_client: httpx.Client,
|
|
352
|
+
auths: Optional[Dict[str, AuthProvider]] = None,
|
|
348
353
|
):
|
|
349
354
|
"""Initialize the synchronous client.
|
|
350
355
|
|
|
351
356
|
Args:
|
|
352
357
|
httpx_client: Synchronous HTTPX client instance
|
|
353
358
|
"""
|
|
354
|
-
super().__init__(base_url=base_url)
|
|
359
|
+
super().__init__(base_url=base_url, auths=auths)
|
|
355
360
|
self.httpx_client = httpx_client
|
|
356
361
|
|
|
357
362
|
def request(
|
|
@@ -488,13 +493,14 @@ class AsyncBaseClient(BaseClient):
|
|
|
488
493
|
*,
|
|
489
494
|
base_url: Union[str, Dict[str, str]],
|
|
490
495
|
httpx_client: httpx.AsyncClient,
|
|
496
|
+
auths: Optional[Dict[str, AuthProvider]] = None,
|
|
491
497
|
):
|
|
492
498
|
"""Initialize the asynchronous client.
|
|
493
499
|
|
|
494
500
|
Args:
|
|
495
501
|
httpx_client: Asynchronous HTTPX client instance
|
|
496
502
|
"""
|
|
497
|
-
super().__init__(base_url=base_url)
|
|
503
|
+
super().__init__(base_url=base_url, auths=auths)
|
|
498
504
|
self.httpx_client = httpx_client
|
|
499
505
|
|
|
500
506
|
async def request(
|
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.33.
|
|
9
|
+
MOCK_SERVER = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.33.1"
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
def _get_base_url(
|
|
@@ -14,11 +14,11 @@ Get more information about this mode at our [product page](https://magichour.ai/
|
|
|
14
14
|
|-----------|:--------:|-------------|--------|
|
|
15
15
|
| `assets` | ✓ | Provide the assets for image-to-video. | `{"image_file_path": "api-assets/id/1234.png"}` |
|
|
16
16
|
| `end_seconds` | ✓ | The total duration of the output video in seconds. | `5.0` |
|
|
17
|
-
| `height` | ✗ | This field does not affect the output video's resolution. The video's orientation will match that of the input image. It is retained solely for backward compatibility and will be deprecated in the future. | `
|
|
17
|
+
| `height` | ✗ | This field does not affect the output video's resolution. The video's orientation will match that of the input image. It is retained solely for backward compatibility and will be deprecated in the future. | `123` |
|
|
18
18
|
| `name` | ✗ | The name of video | `"Image To Video video"` |
|
|
19
19
|
| `resolution` | ✗ | Controls the output video resolution. Defaults to `720p` if not specified. **Options:** - `480p` - Supports only 5 or 10 second videos. Output: 24fps. Cost: 120 credits per 5 seconds. - `720p` - Supports videos between 5-60 seconds. Output: 30fps. Cost: 300 credits per 5 seconds. - `1080p` - Supports videos between 5-60 seconds. Output: 30fps. Cost: 600 credits per 5 seconds. **Requires** `pro` or `business` tier. | `"1080p"` |
|
|
20
20
|
| `style` | ✗ | Attributed used to dictate the style of the output | `{"prompt": "a dog running"}` |
|
|
21
|
-
| `width` | ✗ | This field does not affect the output video's resolution. The video's orientation will match that of the input image. It is retained solely for backward compatibility and will be deprecated in the future. | `
|
|
21
|
+
| `width` | ✗ | This field does not affect the output video's resolution. The video's orientation will match that of the input image. It is retained solely for backward compatibility and will be deprecated in the future. | `123` |
|
|
22
22
|
|
|
23
23
|
#### Synchronous Client
|
|
24
24
|
|
|
@@ -30,9 +30,7 @@ client = Client(token=getenv("API_TOKEN"))
|
|
|
30
30
|
res = client.v1.image_to_video.create(
|
|
31
31
|
assets={"image_file_path": "api-assets/id/1234.png"},
|
|
32
32
|
end_seconds=5.0,
|
|
33
|
-
height=960,
|
|
34
33
|
name="Image To Video video",
|
|
35
|
-
width=512,
|
|
36
34
|
)
|
|
37
35
|
|
|
38
36
|
```
|
|
@@ -47,9 +45,7 @@ client = AsyncClient(token=getenv("API_TOKEN"))
|
|
|
47
45
|
res = await client.v1.image_to_video.create(
|
|
48
46
|
assets={"image_file_path": "api-assets/id/1234.png"},
|
|
49
47
|
end_seconds=5.0,
|
|
50
|
-
height=960,
|
|
51
48
|
name="Image To Video video",
|
|
52
|
-
width=512,
|
|
53
49
|
)
|
|
54
50
|
|
|
55
51
|
```
|
|
@@ -80,9 +80,7 @@ class ImageToVideoClient:
|
|
|
80
80
|
client.v1.image_to_video.create(
|
|
81
81
|
assets={"image_file_path": "api-assets/id/1234.png"},
|
|
82
82
|
end_seconds=5.0,
|
|
83
|
-
height=960,
|
|
84
83
|
name="Image To Video video",
|
|
85
|
-
width=512,
|
|
86
84
|
)
|
|
87
85
|
```
|
|
88
86
|
"""
|
|
@@ -176,9 +174,7 @@ class AsyncImageToVideoClient:
|
|
|
176
174
|
await client.v1.image_to_video.create(
|
|
177
175
|
assets={"image_file_path": "api-assets/id/1234.png"},
|
|
178
176
|
end_seconds=5.0,
|
|
179
|
-
height=960,
|
|
180
177
|
name="Image To Video video",
|
|
181
|
-
width=512,
|
|
182
178
|
)
|
|
183
179
|
```
|
|
184
180
|
"""
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
magic_hour/__init__.py,sha256=KIpC-OAJjT6m-WLHmdIdUlsYyicCiX4WHVIwfPG-e0c,203
|
|
2
|
-
magic_hour/client.py,sha256=
|
|
2
|
+
magic_hour/client.py,sha256=jqk0QeToxwDJcHfqXsWkyzApInGJ39s5HZWaLdGS7tI,1711
|
|
3
3
|
magic_hour/core/__init__.py,sha256=ch-4Pxoz0-fe6_H1zo0iCeQK34MZI1WU4x2mPAhgQhM,1111
|
|
4
4
|
magic_hour/core/api_error.py,sha256=K1d47qRbhLBNEaUVbs0NPgxee24X3qGZ37gBhleUzEE,1760
|
|
5
5
|
magic_hour/core/auth.py,sha256=GA0lyYYXG_q-nRB8W0omRZ7DLbdXvhYeVzEc-WRI0G0,10774
|
|
6
|
-
magic_hour/core/base_client.py,sha256=
|
|
6
|
+
magic_hour/core/base_client.py,sha256=nWTsGulkW686_Nlk4EcJsI2LlTOldnYhmDiy9cq1c6w,19718
|
|
7
7
|
magic_hour/core/binary_response.py,sha256=T-DATvb21P2ZRnYa4LlXmF77VfM8Tut2951QHEQct_U,681
|
|
8
8
|
magic_hour/core/query.py,sha256=ibD41bf-Yc1iOFNaRzSR97dK-mIpy1VwXcFCyI4vovc,4534
|
|
9
9
|
magic_hour/core/request.py,sha256=_ikn8iZ2fU9Ubqnt7M9hdEnXGV6AAFHJYmDKBtxEY4I,5263
|
|
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=
|
|
13
|
+
magic_hour/environment.py,sha256=EVphevg0iwzdaDhaLnP7NcTJxU5CgzMi-Aes42z3RcE,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=x9cVTx9nHsyIutYjoUk1DeJg55cti6DAN_C-kBI_47Q,1564
|
|
16
16
|
magic_hour/resources/v1/ai_clothes_changer/__init__.py,sha256=6W_Y2HxG2sDOBiJyzngK3Q2S3xfQgpK-j8xFRmBAhbQ,142
|
|
@@ -72,9 +72,9 @@ magic_hour/resources/v1/image_background_remover/client.py,sha256=PEYBUFtaHITyTa
|
|
|
72
72
|
magic_hour/resources/v1/image_projects/README.md,sha256=iarr0Cu2a_ls4A6_NtjeDxNVhIsP5ZuFHMNidUh2oiE,2524
|
|
73
73
|
magic_hour/resources/v1/image_projects/__init__.py,sha256=oBlV4e5IVYe8SclhoEy2VOYB53kKP2DORXwcztAwU3E,130
|
|
74
74
|
magic_hour/resources/v1/image_projects/client.py,sha256=FbqvgvoLFcAjBtqgGtQZMNT8jG5f2bJH7Poxod446sw,5527
|
|
75
|
-
magic_hour/resources/v1/image_to_video/README.md,sha256=
|
|
75
|
+
magic_hour/resources/v1/image_to_video/README.md,sha256=x0nKgaU-KSpzdIzMUByc5A7CxBVl0K_kc64tQIxThHw,2684
|
|
76
76
|
magic_hour/resources/v1/image_to_video/__init__.py,sha256=tY_ABo6evwKQBRSq-M84lNX-pXqmxoozukmrO6NhCgA,126
|
|
77
|
-
magic_hour/resources/v1/image_to_video/client.py,sha256=
|
|
77
|
+
magic_hour/resources/v1/image_to_video/client.py,sha256=xA9sQuZAa_hT4Jyko-38QWtGgjGt2svEv7bnIzTpwws,8126
|
|
78
78
|
magic_hour/resources/v1/lip_sync/README.md,sha256=nOBX3e_B5Wfy-BTMJN7kABAgdKmsSWQ_v7IQg_r7gcg,3694
|
|
79
79
|
magic_hour/resources/v1/lip_sync/__init__.py,sha256=MlKUAoHNSKcuNzVyqNfLnLtD_PsqEn3l1TtVpPC1JqQ,106
|
|
80
80
|
magic_hour/resources/v1/lip_sync/client.py,sha256=WpNGwvk0EEI8qjIlDVOdIUH7lZHV_ODOAfe7hNPPSns,9515
|
|
@@ -184,7 +184,7 @@ magic_hour/types/params/v1_text_to_video_create_body_style.py,sha256=cEZO917hipE
|
|
|
184
184
|
magic_hour/types/params/v1_video_to_video_create_body.py,sha256=Pgok6GUVHrpW6H3rwdVFA3O5YJvjgviCZkmmHddOSWo,3802
|
|
185
185
|
magic_hour/types/params/v1_video_to_video_create_body_assets.py,sha256=_-6iA5d8ndka6iJWyWvlJwzRkQcmurJE6hkg-fDwBmQ,1531
|
|
186
186
|
magic_hour/types/params/v1_video_to_video_create_body_style.py,sha256=RrDBhN2KQnCf9hGsnl3sAYvuFRsxth2JXfe5la0IYJg,5749
|
|
187
|
-
magic_hour-0.33.
|
|
188
|
-
magic_hour-0.33.
|
|
189
|
-
magic_hour-0.33.
|
|
190
|
-
magic_hour-0.33.
|
|
187
|
+
magic_hour-0.33.1.dist-info/LICENSE,sha256=F3fxj7JXPgB2K0uj8YXRsVss4u-Dgt_-U3V4VXsivNI,1070
|
|
188
|
+
magic_hour-0.33.1.dist-info/METADATA,sha256=QFO3UcNA_LaKnEAJPSo3zQtPJEixphLehOhQ3K6wqus,6092
|
|
189
|
+
magic_hour-0.33.1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
190
|
+
magic_hour-0.33.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|