magic_hour 0.39.0__py3-none-any.whl → 0.41.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.

Files changed (53) hide show
  1. magic_hour/README.md +2 -0
  2. magic_hour/environment.py +1 -1
  3. magic_hour/resources/v1/README.md +2 -0
  4. magic_hour/resources/v1/ai_clothes_changer/README.md +2 -0
  5. magic_hour/resources/v1/ai_face_editor/README.md +2 -0
  6. magic_hour/resources/v1/ai_gif_generator/README.md +2 -0
  7. magic_hour/resources/v1/ai_headshot_generator/README.md +2 -0
  8. magic_hour/resources/v1/ai_image_editor/README.md +2 -0
  9. magic_hour/resources/v1/ai_image_generator/README.md +2 -0
  10. magic_hour/resources/v1/ai_image_upscaler/README.md +2 -0
  11. magic_hour/resources/v1/ai_meme_generator/README.md +2 -0
  12. magic_hour/resources/v1/ai_photo_editor/README.md +2 -0
  13. magic_hour/resources/v1/ai_qr_code_generator/README.md +2 -0
  14. magic_hour/resources/v1/ai_talking_photo/README.md +4 -2
  15. magic_hour/resources/v1/ai_voice_generator/README.md +56 -0
  16. magic_hour/resources/v1/ai_voice_generator/__init__.py +4 -0
  17. magic_hour/resources/v1/ai_voice_generator/client.py +119 -0
  18. magic_hour/resources/v1/animation/README.md +2 -0
  19. magic_hour/resources/v1/audio_projects/README.md +90 -0
  20. magic_hour/resources/v1/audio_projects/__init__.py +4 -0
  21. magic_hour/resources/v1/audio_projects/client.py +173 -0
  22. magic_hour/resources/v1/auto_subtitle_generator/README.md +2 -0
  23. magic_hour/resources/v1/client.py +14 -0
  24. magic_hour/resources/v1/face_detection/README.md +2 -0
  25. magic_hour/resources/v1/face_swap/README.md +2 -0
  26. magic_hour/resources/v1/face_swap_photo/README.md +2 -0
  27. magic_hour/resources/v1/files/README.md +2 -0
  28. magic_hour/resources/v1/image_background_remover/README.md +2 -0
  29. magic_hour/resources/v1/image_projects/README.md +2 -0
  30. magic_hour/resources/v1/image_to_video/README.md +2 -0
  31. magic_hour/resources/v1/lip_sync/README.md +4 -0
  32. magic_hour/resources/v1/lip_sync/client.py +10 -0
  33. magic_hour/resources/v1/photo_colorizer/README.md +2 -0
  34. magic_hour/resources/v1/text_to_video/README.md +2 -0
  35. magic_hour/resources/v1/video_projects/README.md +2 -0
  36. magic_hour/resources/v1/video_to_video/README.md +7 -7
  37. magic_hour/resources/v1/video_to_video/client.py +0 -2
  38. magic_hour/types/models/__init__.py +10 -0
  39. magic_hour/types/models/v1_ai_voice_generator_create_response.py +27 -0
  40. magic_hour/types/models/v1_audio_projects_get_response.py +72 -0
  41. magic_hour/types/models/v1_audio_projects_get_response_downloads_item.py +19 -0
  42. magic_hour/types/models/v1_audio_projects_get_response_error.py +25 -0
  43. magic_hour/types/params/__init__.py +18 -0
  44. magic_hour/types/params/v1_ai_talking_photo_create_body_style.py +6 -4
  45. magic_hour/types/params/v1_ai_voice_generator_create_body.py +40 -0
  46. magic_hour/types/params/v1_ai_voice_generator_create_body_style.py +60 -0
  47. magic_hour/types/params/v1_lip_sync_create_body.py +12 -0
  48. magic_hour/types/params/v1_lip_sync_create_body_style.py +37 -0
  49. magic_hour/types/params/v1_video_to_video_create_body_style.py +19 -19
  50. {magic_hour-0.39.0.dist-info → magic_hour-0.41.0.dist-info}/METADATA +11 -1
  51. {magic_hour-0.39.0.dist-info → magic_hour-0.41.0.dist-info}/RECORD +53 -40
  52. {magic_hour-0.39.0.dist-info → magic_hour-0.41.0.dist-info}/LICENSE +0 -0
  53. {magic_hour-0.39.0.dist-info → magic_hour-0.41.0.dist-info}/WHEEL +0 -0
magic_hour/README.md CHANGED
@@ -14,7 +14,9 @@
14
14
  - [ai_photo_editor](resources/v1/ai_photo_editor/README.md) - ai_photo_editor
15
15
  - [ai_qr_code_generator](resources/v1/ai_qr_code_generator/README.md) - ai_qr_code_generator
16
16
  - [ai_talking_photo](resources/v1/ai_talking_photo/README.md) - ai_talking_photo
17
+ - [ai_voice_generator](resources/v1/ai_voice_generator/README.md) - ai_voice_generator
17
18
  - [animation](resources/v1/animation/README.md) - animation
19
+ - [audio_projects](resources/v1/audio_projects/README.md) - audio_projects
18
20
  - [auto_subtitle_generator](resources/v1/auto_subtitle_generator/README.md) - auto_subtitle_generator
19
21
  - [face_detection](resources/v1/face_detection/README.md) - face_detection
20
22
  - [face_swap](resources/v1/face_swap/README.md) - face_swap
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.39.1"
9
+ MOCK_SERVER = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.41.0"
10
10
 
11
11
 
12
12
  def _get_base_url(
@@ -14,7 +14,9 @@
14
14
  - [ai_photo_editor](ai_photo_editor/README.md) - ai_photo_editor
15
15
  - [ai_qr_code_generator](ai_qr_code_generator/README.md) - ai_qr_code_generator
16
16
  - [ai_talking_photo](ai_talking_photo/README.md) - ai_talking_photo
17
+ - [ai_voice_generator](ai_voice_generator/README.md) - ai_voice_generator
17
18
  - [animation](animation/README.md) - animation
19
+ - [audio_projects](audio_projects/README.md) - audio_projects
18
20
  - [auto_subtitle_generator](auto_subtitle_generator/README.md) - auto_subtitle_generator
19
21
  - [face_detection](face_detection/README.md) - face_detection
20
22
  - [face_swap](face_swap/README.md) - face_swap
@@ -3,6 +3,8 @@
3
3
  ## Module Functions
4
4
 
5
5
 
6
+
7
+
6
8
  <!-- CUSTOM DOCS START -->
7
9
 
8
10
  ### AI Clothes Changer Generate Workflow <a name="generate"></a>
@@ -3,6 +3,8 @@
3
3
  ## Module Functions
4
4
 
5
5
 
6
+
7
+
6
8
  <!-- CUSTOM DOCS START -->
7
9
 
8
10
  ### Ai Face Editor Generate Workflow <a name="generate"></a>
@@ -3,6 +3,8 @@
3
3
  ## Module Functions
4
4
 
5
5
 
6
+
7
+
6
8
  <!-- CUSTOM DOCS START -->
7
9
 
8
10
  ### Ai Gif Generator Generate Workflow <a name="generate"></a>
@@ -3,6 +3,8 @@
3
3
  ## Module Functions
4
4
 
5
5
 
6
+
7
+
6
8
  <!-- CUSTOM DOCS START -->
7
9
 
8
10
  ### Ai Headshot Generator Generate Workflow <a name="generate"></a>
@@ -3,6 +3,8 @@
3
3
  ## Module Functions
4
4
 
5
5
 
6
+
7
+
6
8
  <!-- CUSTOM DOCS START -->
7
9
 
8
10
  ### Ai Image Editor Generate Workflow <a name="generate"></a>
@@ -3,6 +3,8 @@
3
3
  ## Module Functions
4
4
 
5
5
 
6
+
7
+
6
8
  <!-- CUSTOM DOCS START -->
7
9
 
8
10
  ### Ai Image Generator Generate Workflow <a name="generate"></a>
@@ -3,6 +3,8 @@
3
3
  ## Module Functions
4
4
 
5
5
 
6
+
7
+
6
8
  <!-- CUSTOM DOCS START -->
7
9
 
8
10
  ### Ai Image Upscaler Generate Workflow <a name="generate"></a>
@@ -3,6 +3,8 @@
3
3
  ## Module Functions
4
4
 
5
5
 
6
+
7
+
6
8
  <!-- CUSTOM DOCS START -->
7
9
 
8
10
  ### Ai Meme Generator Generate Workflow <a name="generate"></a>
@@ -3,6 +3,8 @@
3
3
  ## Module Functions
4
4
 
5
5
 
6
+
7
+
6
8
  <!-- CUSTOM DOCS START -->
7
9
 
8
10
  ### Ai Photo Editor Generate Workflow <a name="generate"></a>
@@ -3,6 +3,8 @@
3
3
  ## Module Functions
4
4
 
5
5
 
6
+
7
+
6
8
  <!-- CUSTOM DOCS START -->
7
9
 
8
10
  ### Ai Qr Code Generator Generate Workflow <a name="generate"></a>
@@ -3,6 +3,8 @@
3
3
  ## Module Functions
4
4
 
5
5
 
6
+
7
+
6
8
  <!-- CUSTOM DOCS START -->
7
9
 
8
10
  ### Ai Talking Photo Generate Workflow <a name="generate"></a>
@@ -84,8 +86,8 @@ Create a talking photo from an image and audio or text input.
84
86
  | `end_seconds` | ✓ | The end time of the input audio in seconds. The maximum duration allowed is 60 seconds. | `15.0` |
85
87
  | `start_seconds` | ✓ | The start time of the input audio in seconds. The maximum duration allowed is 60 seconds. | `0.0` |
86
88
  | `name` | ✗ | The name of image. This value is mainly used for your own identification of the image. | `"Talking Photo image"` |
87
- | `style` | ✗ | Attributes used to dictate the style of the output | `{"generation_mode": "expressive", "intensity": 1.5}` |
88
- | `└─ generation_mode` | ✗ | Controls overall motion style. * `pro` - Realistic, high fidelity, accurate lip sync, slower. * `expressive` - More motion and facial expressiveness; may introduce visual artifacts. * `stable` - Reduced motion for cleaner output; may result in minimal animation. (Deprecated: passing this value will be treated as `pro`) | `"expressive"` |
89
+ | `style` | ✗ | Attributes used to dictate the style of the output | `{"generation_mode": "pro", "intensity": 1.5}` |
90
+ | `└─ generation_mode` | ✗ | Controls overall motion style. * `pro` - Higher fidelity, realistic detail, accurate lip sync, and faster generation. * `standard` - More expressive motion, but lower visual fidelity. * `expressive` - More motion and facial expressiveness; may introduce visual artifacts. (Deprecated: passing this value will be treated as `standard`) * `stable` - Reduced motion for cleaner output; may result in minimal animation. (Deprecated: passing this value will be treated as `pro`) | `"pro"` |
89
91
  | `└─ intensity` | ✗ | Note: this value is only applicable when generation_mode is `expressive`. The value can include up to 2 decimal places. * Lower values yield more stability but can suppress mouth movement. * Higher values increase motion and expressiveness, with a higher risk of distortion. | `1.5` |
90
92
 
91
93
  #### Synchronous Client
@@ -0,0 +1,56 @@
1
+ # v1.ai_voice_generator
2
+
3
+ ## Module Functions
4
+
5
+ ### AI Voice Generator <a name="create"></a>
6
+
7
+ Generate speech from text. Each character costs 0.05 credits. The cost is rounded up to the nearest whole number.
8
+
9
+ **API Endpoint**: `POST /v1/ai-voice-generator`
10
+
11
+ #### Parameters
12
+
13
+ | Parameter | Required | Description | Example |
14
+ |-----------|:--------:|-------------|--------|
15
+ | `style` | ✓ | The content used to generate speech. | `{"prompt": "Hello, how are you?", "voice_name": "Elon Musk"}` |
16
+ | `└─ prompt` | ✓ | Text used to generate speech. Starter tier users can use up to 200 characters, while Creator, Pro, or Business users can use up to 1000. | `"Hello, how are you?"` |
17
+ | `└─ voice_name` | ✓ | The voice to use for the speech. Available voices: Elon Musk, Mark Zuckerberg, Joe Rogan, Barack Obama, Morgan Freeman, Kanye West, Donald Trump, Joe Biden, Kim Kardashian, Taylor Swift | `"Elon Musk"` |
18
+ | `name` | ✗ | The name of audio. This value is mainly used for your own identification of the audio. | `"Voice Generator audio"` |
19
+
20
+ #### Synchronous Client
21
+
22
+ ```python
23
+ from magic_hour import Client
24
+ from os import getenv
25
+
26
+ client = Client(token=getenv("API_TOKEN"))
27
+ res = client.v1.ai_voice_generator.create(
28
+ style={"prompt": "Hello, how are you?", "voice_name": "Elon Musk"},
29
+ name="Voice Generator audio",
30
+ )
31
+
32
+ ```
33
+
34
+ #### Asynchronous Client
35
+
36
+ ```python
37
+ from magic_hour import AsyncClient
38
+ from os import getenv
39
+
40
+ client = AsyncClient(token=getenv("API_TOKEN"))
41
+ res = await client.v1.ai_voice_generator.create(
42
+ style={"prompt": "Hello, how are you?", "voice_name": "Elon Musk"},
43
+ name="Voice Generator audio",
44
+ )
45
+
46
+ ```
47
+
48
+ #### Response
49
+
50
+ ##### Type
51
+ [V1AiVoiceGeneratorCreateResponse](/magic_hour/types/models/v1_ai_voice_generator_create_response.py)
52
+
53
+ ##### Example
54
+ `{"credits_charged": 1, "id": "cuid-example"}`
55
+
56
+
@@ -0,0 +1,4 @@
1
+ from .client import AiVoiceGeneratorClient, AsyncAiVoiceGeneratorClient
2
+
3
+
4
+ __all__ = ["AiVoiceGeneratorClient", "AsyncAiVoiceGeneratorClient"]
@@ -0,0 +1,119 @@
1
+ import typing
2
+
3
+ from magic_hour.types import models, params
4
+ from make_api_request import (
5
+ AsyncBaseClient,
6
+ RequestOptions,
7
+ SyncBaseClient,
8
+ default_request_options,
9
+ to_encodable,
10
+ type_utils,
11
+ )
12
+
13
+
14
+ class AiVoiceGeneratorClient:
15
+ def __init__(self, *, base_client: SyncBaseClient):
16
+ self._base_client = base_client
17
+
18
+ def create(
19
+ self,
20
+ *,
21
+ style: params.V1AiVoiceGeneratorCreateBodyStyle,
22
+ name: typing.Union[
23
+ typing.Optional[str], type_utils.NotGiven
24
+ ] = type_utils.NOT_GIVEN,
25
+ request_options: typing.Optional[RequestOptions] = None,
26
+ ) -> models.V1AiVoiceGeneratorCreateResponse:
27
+ """
28
+ AI Voice Generator
29
+
30
+ Generate speech from text. Each character costs 0.05 credits. The cost is rounded up to the nearest whole number.
31
+
32
+ POST /v1/ai-voice-generator
33
+
34
+ Args:
35
+ name: The name of audio. This value is mainly used for your own identification of the audio.
36
+ style: The content used to generate speech.
37
+ request_options: Additional options to customize the HTTP request
38
+
39
+ Returns:
40
+ Success
41
+
42
+ Raises:
43
+ ApiError: A custom exception class that provides additional context
44
+ for API errors, including the HTTP status code and response body.
45
+
46
+ Examples:
47
+ ```py
48
+ client.v1.ai_voice_generator.create(
49
+ style={"prompt": "Hello, how are you?", "voice_name": "Elon Musk"},
50
+ name="Voice Generator audio",
51
+ )
52
+ ```
53
+ """
54
+ _json = to_encodable(
55
+ item={"name": name, "style": style},
56
+ dump_with=params._SerializerV1AiVoiceGeneratorCreateBody,
57
+ )
58
+ return self._base_client.request(
59
+ method="POST",
60
+ path="/v1/ai-voice-generator",
61
+ auth_names=["bearerAuth"],
62
+ json=_json,
63
+ cast_to=models.V1AiVoiceGeneratorCreateResponse,
64
+ request_options=request_options or default_request_options(),
65
+ )
66
+
67
+
68
+ class AsyncAiVoiceGeneratorClient:
69
+ def __init__(self, *, base_client: AsyncBaseClient):
70
+ self._base_client = base_client
71
+
72
+ async def create(
73
+ self,
74
+ *,
75
+ style: params.V1AiVoiceGeneratorCreateBodyStyle,
76
+ name: typing.Union[
77
+ typing.Optional[str], type_utils.NotGiven
78
+ ] = type_utils.NOT_GIVEN,
79
+ request_options: typing.Optional[RequestOptions] = None,
80
+ ) -> models.V1AiVoiceGeneratorCreateResponse:
81
+ """
82
+ AI Voice Generator
83
+
84
+ Generate speech from text. Each character costs 0.05 credits. The cost is rounded up to the nearest whole number.
85
+
86
+ POST /v1/ai-voice-generator
87
+
88
+ Args:
89
+ name: The name of audio. This value is mainly used for your own identification of the audio.
90
+ style: The content used to generate speech.
91
+ request_options: Additional options to customize the HTTP request
92
+
93
+ Returns:
94
+ Success
95
+
96
+ Raises:
97
+ ApiError: A custom exception class that provides additional context
98
+ for API errors, including the HTTP status code and response body.
99
+
100
+ Examples:
101
+ ```py
102
+ await client.v1.ai_voice_generator.create(
103
+ style={"prompt": "Hello, how are you?", "voice_name": "Elon Musk"},
104
+ name="Voice Generator audio",
105
+ )
106
+ ```
107
+ """
108
+ _json = to_encodable(
109
+ item={"name": name, "style": style},
110
+ dump_with=params._SerializerV1AiVoiceGeneratorCreateBody,
111
+ )
112
+ return await self._base_client.request(
113
+ method="POST",
114
+ path="/v1/ai-voice-generator",
115
+ auth_names=["bearerAuth"],
116
+ json=_json,
117
+ cast_to=models.V1AiVoiceGeneratorCreateResponse,
118
+ request_options=request_options or default_request_options(),
119
+ )
@@ -3,6 +3,8 @@
3
3
  ## Module Functions
4
4
 
5
5
 
6
+
7
+
6
8
  <!-- CUSTOM DOCS START -->
7
9
 
8
10
  ### Animation Generate Workflow <a name="generate"></a>
@@ -0,0 +1,90 @@
1
+ # v1.audio_projects
2
+
3
+ ## Module Functions
4
+
5
+ ### Delete audio <a name="delete"></a>
6
+
7
+ Permanently delete the rendered audio file(s). This action is not reversible, please be sure before deleting.
8
+
9
+ **API Endpoint**: `DELETE /v1/audio-projects/{id}`
10
+
11
+ #### Parameters
12
+
13
+ | Parameter | Required | Description | Example |
14
+ |-----------|:--------:|-------------|--------|
15
+ | `id` | ✓ | Unique ID of the audio project. This value is returned by all of the POST APIs that create an audio. | `"cuid-example"` |
16
+
17
+ #### Synchronous Client
18
+
19
+ ```python
20
+ from magic_hour import Client
21
+ from os import getenv
22
+
23
+ client = Client(token=getenv("API_TOKEN"))
24
+ res = client.v1.audio_projects.delete(id="cuid-example")
25
+
26
+ ```
27
+
28
+ #### Asynchronous Client
29
+
30
+ ```python
31
+ from magic_hour import AsyncClient
32
+ from os import getenv
33
+
34
+ client = AsyncClient(token=getenv("API_TOKEN"))
35
+ res = await client.v1.audio_projects.delete(id="cuid-example")
36
+
37
+ ```
38
+
39
+ ### Get audio details <a name="get"></a>
40
+
41
+ Get the details of a audio project. The `downloads` field will be empty unless the audio was successfully rendered.
42
+
43
+ The audio can be one of the following status
44
+ - `draft` - not currently used
45
+ - `queued` - the job is queued and waiting for a GPU
46
+ - `rendering` - the generation is in progress
47
+ - `complete` - the audio is successful created
48
+ - `error` - an error occurred during rendering
49
+ - `canceled` - audio render is canceled by the user
50
+
51
+
52
+ **API Endpoint**: `GET /v1/audio-projects/{id}`
53
+
54
+ #### Parameters
55
+
56
+ | Parameter | Required | Description | Example |
57
+ |-----------|:--------:|-------------|--------|
58
+ | `id` | ✓ | Unique ID of the audio project. This value is returned by all of the POST APIs that create an audio. | `"cuid-example"` |
59
+
60
+ #### Synchronous Client
61
+
62
+ ```python
63
+ from magic_hour import Client
64
+ from os import getenv
65
+
66
+ client = Client(token=getenv("API_TOKEN"))
67
+ res = client.v1.audio_projects.get(id="cuid-example")
68
+
69
+ ```
70
+
71
+ #### Asynchronous Client
72
+
73
+ ```python
74
+ from magic_hour import AsyncClient
75
+ from os import getenv
76
+
77
+ client = AsyncClient(token=getenv("API_TOKEN"))
78
+ res = await client.v1.audio_projects.get(id="cuid-example")
79
+
80
+ ```
81
+
82
+ #### Response
83
+
84
+ ##### Type
85
+ [V1AudioProjectsGetResponse](/magic_hour/types/models/v1_audio_projects_get_response.py)
86
+
87
+ ##### Example
88
+ `{"created_at": "1970-01-01T00:00:00", "credits_charged": 2, "downloads": [{"expires_at": "2024-10-19T05:16:19.027Z", "url": "https://videos.magichour.ai/id/output.wav"}], "enabled": True, "error": {"code": "no_source_face", "message": "Please use an image with a detectable face"}, "id": "cuid-example", "name": "Example Name", "status": "complete", "type_": "VOICE_GENERATOR"}`
89
+
90
+
@@ -0,0 +1,4 @@
1
+ from .client import AsyncAudioProjectsClient, AudioProjectsClient
2
+
3
+
4
+ __all__ = ["AsyncAudioProjectsClient", "AudioProjectsClient"]
@@ -0,0 +1,173 @@
1
+ import typing
2
+
3
+ from magic_hour.types import models
4
+ from make_api_request import (
5
+ AsyncBaseClient,
6
+ RequestOptions,
7
+ SyncBaseClient,
8
+ default_request_options,
9
+ )
10
+
11
+
12
+ class AudioProjectsClient:
13
+ def __init__(self, *, base_client: SyncBaseClient):
14
+ self._base_client = base_client
15
+
16
+ def delete(
17
+ self, *, id: str, request_options: typing.Optional[RequestOptions] = None
18
+ ) -> None:
19
+ """
20
+ Delete audio
21
+
22
+ Permanently delete the rendered audio file(s). This action is not reversible, please be sure before deleting.
23
+
24
+ DELETE /v1/audio-projects/{id}
25
+
26
+ Args:
27
+ id: Unique ID of the audio project. This value is returned by all of the POST APIs that create an audio.
28
+ request_options: Additional options to customize the HTTP request
29
+
30
+ Returns:
31
+ 204
32
+
33
+ Raises:
34
+ ApiError: A custom exception class that provides additional context
35
+ for API errors, including the HTTP status code and response body.
36
+
37
+ Examples:
38
+ ```py
39
+ client.v1.audio_projects.delete(id="cuid-example")
40
+ ```
41
+ """
42
+ self._base_client.request(
43
+ method="DELETE",
44
+ path=f"/v1/audio-projects/{id}",
45
+ auth_names=["bearerAuth"],
46
+ cast_to=type(None),
47
+ request_options=request_options or default_request_options(),
48
+ )
49
+
50
+ def get(
51
+ self, *, id: str, request_options: typing.Optional[RequestOptions] = None
52
+ ) -> models.V1AudioProjectsGetResponse:
53
+ """
54
+ Get audio details
55
+
56
+ Get the details of a audio project. The `downloads` field will be empty unless the audio was successfully rendered.
57
+
58
+ The audio can be one of the following status
59
+ - `draft` - not currently used
60
+ - `queued` - the job is queued and waiting for a GPU
61
+ - `rendering` - the generation is in progress
62
+ - `complete` - the audio is successful created
63
+ - `error` - an error occurred during rendering
64
+ - `canceled` - audio render is canceled by the user
65
+
66
+
67
+ GET /v1/audio-projects/{id}
68
+
69
+ Args:
70
+ id: Unique ID of the audio project. This value is returned by all of the POST APIs that create an audio.
71
+ request_options: Additional options to customize the HTTP request
72
+
73
+ Returns:
74
+ Success
75
+
76
+ Raises:
77
+ ApiError: A custom exception class that provides additional context
78
+ for API errors, including the HTTP status code and response body.
79
+
80
+ Examples:
81
+ ```py
82
+ client.v1.audio_projects.get(id="cuid-example")
83
+ ```
84
+ """
85
+ return self._base_client.request(
86
+ method="GET",
87
+ path=f"/v1/audio-projects/{id}",
88
+ auth_names=["bearerAuth"],
89
+ cast_to=models.V1AudioProjectsGetResponse,
90
+ request_options=request_options or default_request_options(),
91
+ )
92
+
93
+
94
+ class AsyncAudioProjectsClient:
95
+ def __init__(self, *, base_client: AsyncBaseClient):
96
+ self._base_client = base_client
97
+
98
+ async def delete(
99
+ self, *, id: str, request_options: typing.Optional[RequestOptions] = None
100
+ ) -> None:
101
+ """
102
+ Delete audio
103
+
104
+ Permanently delete the rendered audio file(s). This action is not reversible, please be sure before deleting.
105
+
106
+ DELETE /v1/audio-projects/{id}
107
+
108
+ Args:
109
+ id: Unique ID of the audio project. This value is returned by all of the POST APIs that create an audio.
110
+ request_options: Additional options to customize the HTTP request
111
+
112
+ Returns:
113
+ 204
114
+
115
+ Raises:
116
+ ApiError: A custom exception class that provides additional context
117
+ for API errors, including the HTTP status code and response body.
118
+
119
+ Examples:
120
+ ```py
121
+ await client.v1.audio_projects.delete(id="cuid-example")
122
+ ```
123
+ """
124
+ await self._base_client.request(
125
+ method="DELETE",
126
+ path=f"/v1/audio-projects/{id}",
127
+ auth_names=["bearerAuth"],
128
+ cast_to=type(None),
129
+ request_options=request_options or default_request_options(),
130
+ )
131
+
132
+ async def get(
133
+ self, *, id: str, request_options: typing.Optional[RequestOptions] = None
134
+ ) -> models.V1AudioProjectsGetResponse:
135
+ """
136
+ Get audio details
137
+
138
+ Get the details of a audio project. The `downloads` field will be empty unless the audio was successfully rendered.
139
+
140
+ The audio can be one of the following status
141
+ - `draft` - not currently used
142
+ - `queued` - the job is queued and waiting for a GPU
143
+ - `rendering` - the generation is in progress
144
+ - `complete` - the audio is successful created
145
+ - `error` - an error occurred during rendering
146
+ - `canceled` - audio render is canceled by the user
147
+
148
+
149
+ GET /v1/audio-projects/{id}
150
+
151
+ Args:
152
+ id: Unique ID of the audio project. This value is returned by all of the POST APIs that create an audio.
153
+ request_options: Additional options to customize the HTTP request
154
+
155
+ Returns:
156
+ Success
157
+
158
+ Raises:
159
+ ApiError: A custom exception class that provides additional context
160
+ for API errors, including the HTTP status code and response body.
161
+
162
+ Examples:
163
+ ```py
164
+ await client.v1.audio_projects.get(id="cuid-example")
165
+ ```
166
+ """
167
+ return await self._base_client.request(
168
+ method="GET",
169
+ path=f"/v1/audio-projects/{id}",
170
+ auth_names=["bearerAuth"],
171
+ cast_to=models.V1AudioProjectsGetResponse,
172
+ request_options=request_options or default_request_options(),
173
+ )
@@ -3,6 +3,8 @@
3
3
  ## Module Functions
4
4
 
5
5
 
6
+
7
+
6
8
  <!-- CUSTOM DOCS START -->
7
9
 
8
10
  ### Auto Subtitle Generator Generate Workflow <a name="generate"></a>
@@ -42,7 +42,15 @@ from magic_hour.resources.v1.ai_talking_photo import (
42
42
  AiTalkingPhotoClient,
43
43
  AsyncAiTalkingPhotoClient,
44
44
  )
45
+ from magic_hour.resources.v1.ai_voice_generator import (
46
+ AiVoiceGeneratorClient,
47
+ AsyncAiVoiceGeneratorClient,
48
+ )
45
49
  from magic_hour.resources.v1.animation import AnimationClient, AsyncAnimationClient
50
+ from magic_hour.resources.v1.audio_projects import (
51
+ AsyncAudioProjectsClient,
52
+ AudioProjectsClient,
53
+ )
46
54
  from magic_hour.resources.v1.auto_subtitle_generator import (
47
55
  AsyncAutoSubtitleGeneratorClient,
48
56
  AutoSubtitleGeneratorClient,
@@ -125,6 +133,8 @@ class V1Client:
125
133
  self.photo_colorizer = PhotoColorizerClient(base_client=self._base_client)
126
134
  self.text_to_video = TextToVideoClient(base_client=self._base_client)
127
135
  self.video_to_video = VideoToVideoClient(base_client=self._base_client)
136
+ self.audio_projects = AudioProjectsClient(base_client=self._base_client)
137
+ self.ai_voice_generator = AiVoiceGeneratorClient(base_client=self._base_client)
128
138
 
129
139
 
130
140
  class AsyncV1Client:
@@ -171,3 +181,7 @@ class AsyncV1Client:
171
181
  self.photo_colorizer = AsyncPhotoColorizerClient(base_client=self._base_client)
172
182
  self.text_to_video = AsyncTextToVideoClient(base_client=self._base_client)
173
183
  self.video_to_video = AsyncVideoToVideoClient(base_client=self._base_client)
184
+ self.audio_projects = AsyncAudioProjectsClient(base_client=self._base_client)
185
+ self.ai_voice_generator = AsyncAiVoiceGeneratorClient(
186
+ base_client=self._base_client
187
+ )
@@ -3,6 +3,8 @@
3
3
  ## Module Functions
4
4
 
5
5
 
6
+
7
+
6
8
  <!-- CUSTOM DOCS START -->
7
9
 
8
10
  ### Face Detection Generate Workflow <a name="generate"></a>
@@ -3,6 +3,8 @@
3
3
  ## Module Functions
4
4
 
5
5
 
6
+
7
+
6
8
  <!-- CUSTOM DOCS START -->
7
9
 
8
10
  ### Face Swap Generate Workflow <a name="generate"></a>