magic_hour 0.33.0__py3-none-any.whl → 0.34.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 (105) hide show
  1. magic_hour/client.py +4 -2
  2. magic_hour/core/base_client.py +10 -4
  3. magic_hour/environment.py +1 -1
  4. magic_hour/resources/v1/ai_clothes_changer/README.md +5 -5
  5. magic_hour/resources/v1/ai_clothes_changer/client.py +4 -4
  6. magic_hour/resources/v1/ai_face_editor/README.md +2 -2
  7. magic_hour/resources/v1/ai_face_editor/client.py +2 -2
  8. magic_hour/resources/v1/ai_gif_generator/README.md +2 -2
  9. magic_hour/resources/v1/ai_gif_generator/client.py +2 -2
  10. magic_hour/resources/v1/ai_headshot_generator/README.md +3 -3
  11. magic_hour/resources/v1/ai_headshot_generator/client.py +2 -2
  12. magic_hour/resources/v1/ai_image_editor/README.md +2 -2
  13. magic_hour/resources/v1/ai_image_editor/client.py +2 -2
  14. magic_hour/resources/v1/ai_image_generator/README.md +5 -5
  15. magic_hour/resources/v1/ai_image_generator/client.py +8 -8
  16. magic_hour/resources/v1/ai_image_upscaler/README.md +3 -3
  17. magic_hour/resources/v1/ai_image_upscaler/client.py +8 -4
  18. magic_hour/resources/v1/ai_meme_generator/README.md +1 -1
  19. magic_hour/resources/v1/ai_photo_editor/README.md +2 -2
  20. magic_hour/resources/v1/ai_photo_editor/client.py +2 -2
  21. magic_hour/resources/v1/ai_qr_code_generator/README.md +2 -2
  22. magic_hour/resources/v1/ai_qr_code_generator/client.py +2 -2
  23. magic_hour/resources/v1/ai_talking_photo/README.md +2 -2
  24. magic_hour/resources/v1/ai_talking_photo/client.py +2 -2
  25. magic_hour/resources/v1/animation/README.md +8 -8
  26. magic_hour/resources/v1/animation/client.py +8 -8
  27. magic_hour/resources/v1/auto_subtitle_generator/README.md +4 -4
  28. magic_hour/resources/v1/auto_subtitle_generator/client.py +6 -6
  29. magic_hour/resources/v1/face_detection/README.md +10 -6
  30. magic_hour/resources/v1/face_detection/client.py +12 -4
  31. magic_hour/resources/v1/face_swap/README.md +4 -4
  32. magic_hour/resources/v1/face_swap/client.py +6 -6
  33. magic_hour/resources/v1/face_swap_photo/README.md +2 -2
  34. magic_hour/resources/v1/face_swap_photo/client.py +2 -2
  35. magic_hour/resources/v1/files/upload_urls/README.md +7 -6
  36. magic_hour/resources/v1/files/upload_urls/client.py +14 -12
  37. magic_hour/resources/v1/image_background_remover/README.md +2 -2
  38. magic_hour/resources/v1/image_background_remover/client.py +2 -2
  39. magic_hour/resources/v1/image_projects/README.md +8 -8
  40. magic_hour/resources/v1/image_projects/client.py +10 -10
  41. magic_hour/resources/v1/image_to_video/README.md +7 -9
  42. magic_hour/resources/v1/image_to_video/client.py +10 -8
  43. magic_hour/resources/v1/lip_sync/README.md +4 -4
  44. magic_hour/resources/v1/lip_sync/client.py +6 -6
  45. magic_hour/resources/v1/photo_colorizer/README.md +2 -2
  46. magic_hour/resources/v1/photo_colorizer/client.py +2 -2
  47. magic_hour/resources/v1/text_to_video/README.md +6 -4
  48. magic_hour/resources/v1/text_to_video/client.py +18 -4
  49. magic_hour/resources/v1/video_projects/README.md +7 -7
  50. magic_hour/resources/v1/video_projects/client.py +8 -8
  51. magic_hour/resources/v1/video_to_video/README.md +9 -9
  52. magic_hour/resources/v1/video_to_video/client.py +10 -10
  53. magic_hour/types/models/v1_face_detection_create_response.py +1 -1
  54. magic_hour/types/models/v1_face_detection_get_response.py +1 -1
  55. magic_hour/types/models/v1_files_upload_urls_create_response.py +3 -0
  56. magic_hour/types/models/v1_video_projects_get_response.py +2 -2
  57. magic_hour/types/params/v1_ai_clothes_changer_create_body.py +1 -1
  58. magic_hour/types/params/v1_ai_clothes_changer_create_body_assets.py +15 -2
  59. magic_hour/types/params/v1_ai_face_editor_create_body.py +1 -1
  60. magic_hour/types/params/v1_ai_face_editor_create_body_assets.py +6 -1
  61. magic_hour/types/params/v1_ai_face_editor_create_body_style.py +44 -47
  62. magic_hour/types/params/v1_ai_gif_generator_create_body.py +1 -1
  63. magic_hour/types/params/v1_ai_headshot_generator_create_body.py +1 -1
  64. magic_hour/types/params/v1_ai_headshot_generator_create_body_assets.py +6 -1
  65. magic_hour/types/params/v1_ai_headshot_generator_create_body_style.py +1 -1
  66. magic_hour/types/params/v1_ai_image_editor_create_body.py +1 -1
  67. magic_hour/types/params/v1_ai_image_editor_create_body_assets.py +6 -1
  68. magic_hour/types/params/v1_ai_image_generator_create_body.py +8 -2
  69. magic_hour/types/params/v1_ai_image_generator_create_body_style.py +2 -2
  70. magic_hour/types/params/v1_ai_image_upscaler_create_body.py +4 -2
  71. magic_hour/types/params/v1_ai_image_upscaler_create_body_assets.py +6 -1
  72. magic_hour/types/params/v1_ai_photo_editor_create_body.py +1 -1
  73. magic_hour/types/params/v1_ai_photo_editor_create_body_assets.py +6 -1
  74. magic_hour/types/params/v1_ai_qr_code_generator_create_body.py +1 -1
  75. magic_hour/types/params/v1_ai_talking_photo_create_body.py +1 -1
  76. magic_hour/types/params/v1_ai_talking_photo_create_body_assets.py +12 -2
  77. magic_hour/types/params/v1_animation_create_body.py +2 -2
  78. magic_hour/types/params/v1_animation_create_body_assets.py +12 -2
  79. magic_hour/types/params/v1_animation_create_body_style.py +10 -7
  80. magic_hour/types/params/v1_auto_subtitle_generator_create_body.py +3 -3
  81. magic_hour/types/params/v1_auto_subtitle_generator_create_body_assets.py +6 -1
  82. magic_hour/types/params/v1_face_detection_create_body_assets.py +6 -1
  83. magic_hour/types/params/v1_face_swap_create_body.py +3 -3
  84. magic_hour/types/params/v1_face_swap_create_body_assets.py +12 -2
  85. magic_hour/types/params/v1_face_swap_create_body_assets_face_mappings_item.py +6 -1
  86. magic_hour/types/params/v1_face_swap_photo_create_body.py +1 -1
  87. magic_hour/types/params/v1_face_swap_photo_create_body_assets.py +12 -2
  88. magic_hour/types/params/v1_face_swap_photo_create_body_assets_face_mappings_item.py +6 -1
  89. magic_hour/types/params/v1_files_upload_urls_create_body.py +3 -0
  90. magic_hour/types/params/v1_files_upload_urls_create_body_items_item.py +2 -2
  91. magic_hour/types/params/v1_image_background_remover_create_body.py +1 -1
  92. magic_hour/types/params/v1_image_background_remover_create_body_assets.py +12 -2
  93. magic_hour/types/params/v1_image_to_video_create_body.py +4 -2
  94. magic_hour/types/params/v1_image_to_video_create_body_assets.py +6 -1
  95. magic_hour/types/params/v1_lip_sync_create_body.py +3 -3
  96. magic_hour/types/params/v1_lip_sync_create_body_assets.py +12 -2
  97. magic_hour/types/params/v1_photo_colorizer_create_body.py +1 -1
  98. magic_hour/types/params/v1_photo_colorizer_create_body_assets.py +6 -1
  99. magic_hour/types/params/v1_text_to_video_create_body.py +8 -2
  100. magic_hour/types/params/v1_video_to_video_create_body.py +3 -3
  101. magic_hour/types/params/v1_video_to_video_create_body_assets.py +6 -1
  102. {magic_hour-0.33.0.dist-info → magic_hour-0.34.0.dist-info}/METADATA +1 -1
  103. {magic_hour-0.33.0.dist-info → magic_hour-0.34.0.dist-info}/RECORD +105 -105
  104. {magic_hour-0.33.0.dist-info → magic_hour-0.34.0.dist-info}/LICENSE +0 -0
  105. {magic_hour-0.33.0.dist-info → magic_hour-0.34.0.dist-info}/WHEEL +0 -0
@@ -35,10 +35,10 @@ class AutoSubtitleGeneratorClient:
35
35
  POST /v1/auto-subtitle-generator
36
36
 
37
37
  Args:
38
- name: The name of video
38
+ name: The name of video. This value is mainly used for your own identification of the video.
39
39
  assets: Provide the assets for auto subtitle generator
40
- end_seconds: The end time of the input video in seconds
41
- start_seconds: The start time of the input video in seconds
40
+ end_seconds: The end time of the input video in seconds. This value is used to trim the input video. The value must be greater than 0.1, and more than the start_seconds.
41
+ start_seconds: The start time of the input video in seconds. This value is used to trim the input video. The value must be greater than 0.
42
42
  style: Style of the subtitle. At least one of `.style.template` or `.style.custom_config` must be provided.
43
43
  * If only `.style.template` is provided, default values for the template will be used.
44
44
  * If both are provided, the fields in `.style.custom_config` will be used to overwrite the fields in `.style.template`.
@@ -114,10 +114,10 @@ class AsyncAutoSubtitleGeneratorClient:
114
114
  POST /v1/auto-subtitle-generator
115
115
 
116
116
  Args:
117
- name: The name of video
117
+ name: The name of video. This value is mainly used for your own identification of the video.
118
118
  assets: Provide the assets for auto subtitle generator
119
- end_seconds: The end time of the input video in seconds
120
- start_seconds: The start time of the input video in seconds
119
+ end_seconds: The end time of the input video in seconds. This value is used to trim the input video. The value must be greater than 0.1, and more than the start_seconds.
120
+ start_seconds: The start time of the input video in seconds. This value is used to trim the input video. The value must be greater than 0.
121
121
  style: Style of the subtitle. At least one of `.style.template` or `.style.custom_config` must be provided.
122
122
  * If only `.style.template` is provided, default values for the template will be used.
123
123
  * If both are provided, the fields in `.style.custom_config` will be used to overwrite the fields in `.style.template`.
@@ -1,7 +1,9 @@
1
1
 
2
2
  ### Get face detection details <a name="get"></a>
3
3
 
4
- Get the details of a face detection task.
4
+ Get the details of a face detection task.
5
+
6
+ Use this API to get the list of faces detected in the image or video to use in the [face swap photo](/api-reference/face-swap-photo/face-swap-photo) or [face swap video](/api-reference/face-swap/face-swap-video) API calls for multi-face swaps.
5
7
 
6
8
  **API Endpoint**: `GET /v1/face-detection/{id}`
7
9
 
@@ -9,7 +11,7 @@ Get the details of a face detection task.
9
11
 
10
12
  | Parameter | Required | Description | Example |
11
13
  |-----------|:--------:|-------------|--------|
12
- | `id` | ✓ | The id of the task | `"string"` |
14
+ | `id` | ✓ | The id of the task. This value is returned by the [face detection API](/api-reference/files/face-detection#response-id). | `"uuid-example"` |
13
15
 
14
16
  #### Synchronous Client
15
17
 
@@ -18,7 +20,7 @@ from magic_hour import Client
18
20
  from os import getenv
19
21
 
20
22
  client = Client(token=getenv("API_TOKEN"))
21
- res = client.v1.face_detection.get(id="string")
23
+ res = client.v1.face_detection.get(id="uuid-example")
22
24
 
23
25
  ```
24
26
 
@@ -29,7 +31,7 @@ from magic_hour import AsyncClient
29
31
  from os import getenv
30
32
 
31
33
  client = AsyncClient(token=getenv("API_TOKEN"))
32
- res = await client.v1.face_detection.get(id="string")
34
+ res = await client.v1.face_detection.get(id="uuid-example")
33
35
 
34
36
  ```
35
37
 
@@ -39,11 +41,13 @@ res = await client.v1.face_detection.get(id="string")
39
41
  [V1FaceDetectionGetResponse](/magic_hour/types/models/v1_face_detection_get_response.py)
40
42
 
41
43
  ##### Example
42
- `{"credits_charged": 123, "faces": [{"path": "api-assets/id/0-0.png", "url": "https://videos.magichour.ai/api-assets/id/0-0.png"}], "id": "string", "status": "complete"}`
44
+ `{"credits_charged": 0, "faces": [{"path": "api-assets/id/0-0.png", "url": "https://videos.magichour.ai/api-assets/id/0-0.png"}], "id": "uuid-example", "status": "complete"}`
43
45
 
44
46
  ### Face Detection <a name="create"></a>
45
47
 
46
48
  Detect faces in an image or video.
49
+
50
+ Use this API to get the list of faces detected in the image or video to use in the [face swap photo](/api-reference/face-swap-photo/face-swap-photo) or [face swap video](/api-reference/face-swap/face-swap-video) API calls for multi-face swaps.
47
51
 
48
52
  Note: Face detection is free to use for the near future. Pricing may change in the future.
49
53
 
@@ -88,4 +92,4 @@ res = await client.v1.face_detection.create(
88
92
  [V1FaceDetectionCreateResponse](/magic_hour/types/models/v1_face_detection_create_response.py)
89
93
 
90
94
  ##### Example
91
- `{"credits_charged": 123, "id": "string"}`
95
+ `{"credits_charged": 123, "id": "uuid-example"}`
@@ -23,10 +23,12 @@ class FaceDetectionClient:
23
23
 
24
24
  Get the details of a face detection task.
25
25
 
26
+ Use this API to get the list of faces detected in the image or video to use in the [face swap photo](/api-reference/face-swap-photo/face-swap-photo) or [face swap video](/api-reference/face-swap/face-swap-video) API calls for multi-face swaps.
27
+
26
28
  GET /v1/face-detection/{id}
27
29
 
28
30
  Args:
29
- id: The id of the task
31
+ id: The id of the task. This value is returned by the [face detection API](/api-reference/files/face-detection#response-id).
30
32
  request_options: Additional options to customize the HTTP request
31
33
 
32
34
  Returns:
@@ -38,7 +40,7 @@ class FaceDetectionClient:
38
40
 
39
41
  Examples:
40
42
  ```py
41
- client.v1.face_detection.get(id="string")
43
+ client.v1.face_detection.get(id="uuid-example")
42
44
  ```
43
45
  """
44
46
  return self._base_client.request(
@@ -63,6 +65,8 @@ class FaceDetectionClient:
63
65
 
64
66
  Detect faces in an image or video.
65
67
 
68
+ Use this API to get the list of faces detected in the image or video to use in the [face swap photo](/api-reference/face-swap-photo/face-swap-photo) or [face swap video](/api-reference/face-swap/face-swap-video) API calls for multi-face swaps.
69
+
66
70
  Note: Face detection is free to use for the near future. Pricing may change in the future.
67
71
 
68
72
  POST /v1/face-detection
@@ -114,10 +118,12 @@ class AsyncFaceDetectionClient:
114
118
 
115
119
  Get the details of a face detection task.
116
120
 
121
+ Use this API to get the list of faces detected in the image or video to use in the [face swap photo](/api-reference/face-swap-photo/face-swap-photo) or [face swap video](/api-reference/face-swap/face-swap-video) API calls for multi-face swaps.
122
+
117
123
  GET /v1/face-detection/{id}
118
124
 
119
125
  Args:
120
- id: The id of the task
126
+ id: The id of the task. This value is returned by the [face detection API](/api-reference/files/face-detection#response-id).
121
127
  request_options: Additional options to customize the HTTP request
122
128
 
123
129
  Returns:
@@ -129,7 +135,7 @@ class AsyncFaceDetectionClient:
129
135
 
130
136
  Examples:
131
137
  ```py
132
- await client.v1.face_detection.get(id="string")
138
+ await client.v1.face_detection.get(id="uuid-example")
133
139
  ```
134
140
  """
135
141
  return await self._base_client.request(
@@ -154,6 +160,8 @@ class AsyncFaceDetectionClient:
154
160
 
155
161
  Detect faces in an image or video.
156
162
 
163
+ Use this API to get the list of faces detected in the image or video to use in the [face swap photo](/api-reference/face-swap-photo/face-swap-photo) or [face swap video](/api-reference/face-swap/face-swap-video) API calls for multi-face swaps.
164
+
157
165
  Note: Face detection is free to use for the near future. Pricing may change in the future.
158
166
 
159
167
  POST /v1/face-detection
@@ -13,10 +13,10 @@ Get more information about this mode at our [product page](https://magichour.ai/
13
13
  | Parameter | Required | Description | Example |
14
14
  |-----------|:--------:|-------------|--------|
15
15
  | `assets` | ✓ | Provide the assets for face swap. For video, The `video_source` field determines whether `video_file_path` or `youtube_url` field is used | `{"face_mappings": [{"new_face": "api-assets/id/1234.png", "original_face": "api-assets/id/0-0.png"}], "face_swap_mode": "all-faces", "image_file_path": "image/id/1234.png", "video_file_path": "api-assets/id/1234.mp4", "video_source": "file"}` |
16
- | `end_seconds` | ✓ | The end time of the input video in seconds | `15.0` |
17
- | `start_seconds` | ✓ | The start time of the input video in seconds | `0.0` |
16
+ | `end_seconds` | ✓ | The end time of the input video in seconds. This value is used to trim the input video. The value must be greater than 0.1, and more than the start_seconds. | `15.0` |
17
+ | `start_seconds` | ✓ | The start time of the input video in seconds. This value is used to trim the input video. The value must be greater than 0. | `0.0` |
18
18
  | `height` | ✗ | Used to determine the dimensions of the output video. * 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. * If both height and width are omitted, the video will be resized according to your subscription's maximum resolution, while preserving aspect ratio. Note: if the video's original resolution is less than the maximum, the video will not be resized. See our [pricing page](https://magichour.ai/pricing) for more details. | `960` |
19
- | `name` | ✗ | The name of video | `"Face Swap video"` |
19
+ | `name` | ✗ | The name of video. This value is mainly used for your own identification of the video. | `"Face Swap video"` |
20
20
  | `width` | ✗ | Used to determine the dimensions of the output video. * 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. * If both height and width are omitted, the video will be resized according to your subscription's maximum resolution, while preserving aspect ratio. Note: if the video's original resolution is less than the maximum, the video will not be resized. See our [pricing page](https://magichour.ai/pricing) for more details. | `512` |
21
21
 
22
22
  #### Synchronous Client
@@ -83,4 +83,4 @@ res = await client.v1.face_swap.create(
83
83
  [V1FaceSwapCreateResponse](/magic_hour/types/models/v1_face_swap_create_response.py)
84
84
 
85
85
  ##### Example
86
- `{"credits_charged": 450, "estimated_frame_cost": 450, "id": "clx7uu86w0a5qp55yxz315r6r"}`
86
+ `{"credits_charged": 450, "estimated_frame_cost": 450, "id": "cuid-example"}`
@@ -51,7 +51,7 @@ class FaceSwapClient:
51
51
  Note: if the video's original resolution is less than the maximum, the video will not be resized.
52
52
 
53
53
  See our [pricing page](https://magichour.ai/pricing) for more details.
54
- name: The name of video
54
+ name: The name of video. This value is mainly used for your own identification of the video.
55
55
  width: Used to determine the dimensions of the output video.
56
56
 
57
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.
@@ -61,8 +61,8 @@ class FaceSwapClient:
61
61
 
62
62
  See our [pricing page](https://magichour.ai/pricing) for more details.
63
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
64
- end_seconds: The end time of the input video in seconds
65
- start_seconds: The start time of the input video in seconds
64
+ end_seconds: The end time of the input video in seconds. This value is used to trim the input video. The value must be greater than 0.1, and more than the start_seconds.
65
+ start_seconds: The start time of the input video in seconds. This value is used to trim the input video. The value must be greater than 0.
66
66
  request_options: Additional options to customize the HTTP request
67
67
 
68
68
  Returns:
@@ -156,7 +156,7 @@ class AsyncFaceSwapClient:
156
156
  Note: if the video's original resolution is less than the maximum, the video will not be resized.
157
157
 
158
158
  See our [pricing page](https://magichour.ai/pricing) for more details.
159
- name: The name of video
159
+ name: The name of video. This value is mainly used for your own identification of the video.
160
160
  width: Used to determine the dimensions of the output video.
161
161
 
162
162
  * 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.
@@ -166,8 +166,8 @@ class AsyncFaceSwapClient:
166
166
 
167
167
  See our [pricing page](https://magichour.ai/pricing) for more details.
168
168
  assets: Provide the assets for face swap. For video, The `video_source` field determines whether `video_file_path` or `youtube_url` field is used
169
- end_seconds: The end time of the input video in seconds
170
- start_seconds: The start time of the input video in seconds
169
+ end_seconds: The end time of the input video in seconds. This value is used to trim the input video. The value must be greater than 0.1, and more than the start_seconds.
170
+ start_seconds: The start time of the input video in seconds. This value is used to trim the input video. The value must be greater than 0.
171
171
  request_options: Additional options to customize the HTTP request
172
172
 
173
173
  Returns:
@@ -10,7 +10,7 @@ Create a face swap photo. Each photo costs 5 credits. The height/width of the ou
10
10
  | Parameter | Required | Description | Example |
11
11
  |-----------|:--------:|-------------|--------|
12
12
  | `assets` | ✓ | Provide the assets for face swap photo | `{"face_mappings": [{"new_face": "api-assets/id/1234.png", "original_face": "api-assets/id/0-0.png"}], "face_swap_mode": "all-faces", "source_file_path": "api-assets/id/1234.png", "target_file_path": "api-assets/id/1234.png"}` |
13
- | `name` | ✗ | The name of image | `"Face Swap image"` |
13
+ | `name` | ✗ | The name of image. This value is mainly used for your own identification of the image. | `"Face Swap image"` |
14
14
 
15
15
  #### Synchronous Client
16
16
 
@@ -66,4 +66,4 @@ res = await client.v1.face_swap_photo.create(
66
66
  [V1FaceSwapPhotoCreateResponse](/magic_hour/types/models/v1_face_swap_photo_create_response.py)
67
67
 
68
68
  ##### Example
69
- `{"credits_charged": 5, "frame_cost": 5, "id": "clx7uu86w0a5qp55yxz315r6r"}`
69
+ `{"credits_charged": 5, "frame_cost": 5, "id": "cuid-example"}`
@@ -32,7 +32,7 @@ class FaceSwapPhotoClient:
32
32
  POST /v1/face-swap-photo
33
33
 
34
34
  Args:
35
- name: The name of image
35
+ name: The name of image. This value is mainly used for your own identification of the image.
36
36
  assets: Provide the assets for face swap photo
37
37
  request_options: Additional options to customize the HTTP request
38
38
 
@@ -96,7 +96,7 @@ class AsyncFaceSwapPhotoClient:
96
96
  POST /v1/face-swap-photo
97
97
 
98
98
  Args:
99
- name: The name of image
99
+ name: The name of image. This value is mainly used for your own identification of the image.
100
100
  assets: Provide the assets for face swap photo
101
101
  request_options: Additional options to customize the HTTP request
102
102
 
@@ -1,19 +1,20 @@
1
1
 
2
2
  ### Generate asset upload urls <a name="create"></a>
3
3
 
4
- Create a list of urls used to upload the assets needed to generate a video. Each video type has their own requirements on what assets are required. Please refer to the specific mode API for more details. The response array will be in the same order as the request body.
4
+ Generates a list of pre-signed upload URLs for the assets required. This API is only necessary if you want to upload to Magic Hour's storage. Refer to the [Input Files Guide](/integration/input-files) for more details.
5
5
 
6
- Below is the list of valid extensions for each asset type:
6
+ The response array will match the order of items in the request body.
7
7
 
8
+ **Valid file extensions per asset type**:
8
9
  - video: mp4, m4v, mov, webm
9
10
  - audio: mp3, mpeg, wav, aac, aiff, flac
10
11
  - image: png, jpg, jpeg, webp, avif, jp2, tiff, bmp
11
12
 
12
- Note: `.gif` is supported for face swap API `video_file_path` field.
13
+ > Note: `gif` is only supported for face swap API `video_file_path` field.
13
14
 
14
- After receiving the upload url, you can upload the file by sending a PUT request.
15
+ Once you receive an upload URL, send a `PUT` request to upload the file directly.
15
16
 
16
- For example using curl
17
+ Example:
17
18
 
18
19
  ```
19
20
  curl -X PUT --data '@/path/to/file/video.mp4' \
@@ -27,7 +28,7 @@ curl -X PUT --data '@/path/to/file/video.mp4' \
27
28
 
28
29
  | Parameter | Required | Description | Example |
29
30
  |-----------|:--------:|-------------|--------|
30
- | `items` | ✓ | | `[{"extension": "mp4", "type_": "video"}, {"extension": "mp3", "type_": "audio"}]` |
31
+ | `items` | ✓ | The list of assets to upload. The response array will match the order of items in the request body. | `[{"extension": "mp4", "type_": "video"}, {"extension": "mp3", "type_": "audio"}]` |
31
32
 
32
33
  #### Synchronous Client
33
34
 
@@ -23,19 +23,20 @@ class UploadUrlsClient:
23
23
  """
24
24
  Generate asset upload urls
25
25
 
26
- Create a list of urls used to upload the assets needed to generate a video. Each video type has their own requirements on what assets are required. Please refer to the specific mode API for more details. The response array will be in the same order as the request body.
26
+ Generates a list of pre-signed upload URLs for the assets required. This API is only necessary if you want to upload to Magic Hour's storage. Refer to the [Input Files Guide](/integration/input-files) for more details.
27
27
 
28
- Below is the list of valid extensions for each asset type:
28
+ The response array will match the order of items in the request body.
29
29
 
30
+ **Valid file extensions per asset type**:
30
31
  - video: mp4, m4v, mov, webm
31
32
  - audio: mp3, mpeg, wav, aac, aiff, flac
32
33
  - image: png, jpg, jpeg, webp, avif, jp2, tiff, bmp
33
34
 
34
- Note: `.gif` is supported for face swap API `video_file_path` field.
35
+ > Note: `gif` is only supported for face swap API `video_file_path` field.
35
36
 
36
- After receiving the upload url, you can upload the file by sending a PUT request.
37
+ Once you receive an upload URL, send a `PUT` request to upload the file directly.
37
38
 
38
- For example using curl
39
+ Example:
39
40
 
40
41
  ```
41
42
  curl -X PUT --data '@/path/to/file/video.mp4' \
@@ -46,7 +47,7 @@ class UploadUrlsClient:
46
47
  POST /v1/files/upload-urls
47
48
 
48
49
  Args:
49
- items: typing.List[V1FilesUploadUrlsCreateBodyItemsItem]
50
+ items: The list of assets to upload. The response array will match the order of items in the request body.
50
51
  request_options: Additional options to customize the HTTP request
51
52
 
52
53
  Returns:
@@ -88,19 +89,20 @@ class AsyncUploadUrlsClient:
88
89
  """
89
90
  Generate asset upload urls
90
91
 
91
- Create a list of urls used to upload the assets needed to generate a video. Each video type has their own requirements on what assets are required. Please refer to the specific mode API for more details. The response array will be in the same order as the request body.
92
+ Generates a list of pre-signed upload URLs for the assets required. This API is only necessary if you want to upload to Magic Hour's storage. Refer to the [Input Files Guide](/integration/input-files) for more details.
92
93
 
93
- Below is the list of valid extensions for each asset type:
94
+ The response array will match the order of items in the request body.
94
95
 
96
+ **Valid file extensions per asset type**:
95
97
  - video: mp4, m4v, mov, webm
96
98
  - audio: mp3, mpeg, wav, aac, aiff, flac
97
99
  - image: png, jpg, jpeg, webp, avif, jp2, tiff, bmp
98
100
 
99
- Note: `.gif` is supported for face swap API `video_file_path` field.
101
+ > Note: `gif` is only supported for face swap API `video_file_path` field.
100
102
 
101
- After receiving the upload url, you can upload the file by sending a PUT request.
103
+ Once you receive an upload URL, send a `PUT` request to upload the file directly.
102
104
 
103
- For example using curl
105
+ Example:
104
106
 
105
107
  ```
106
108
  curl -X PUT --data '@/path/to/file/video.mp4' \
@@ -111,7 +113,7 @@ class AsyncUploadUrlsClient:
111
113
  POST /v1/files/upload-urls
112
114
 
113
115
  Args:
114
- items: typing.List[V1FilesUploadUrlsCreateBodyItemsItem]
116
+ items: The list of assets to upload. The response array will match the order of items in the request body.
115
117
  request_options: Additional options to customize the HTTP request
116
118
 
117
119
  Returns:
@@ -10,7 +10,7 @@ Remove background from image. Each image costs 5 credits.
10
10
  | Parameter | Required | Description | Example |
11
11
  |-----------|:--------:|-------------|--------|
12
12
  | `assets` | ✓ | Provide the assets for background removal | `{"background_image_file_path": "api-assets/id/1234.png", "image_file_path": "api-assets/id/1234.png"}` |
13
- | `name` | ✗ | The name of image | `"Background Remover image"` |
13
+ | `name` | ✗ | The name of image. This value is mainly used for your own identification of the image. | `"Background Remover image"` |
14
14
 
15
15
  #### Synchronous Client
16
16
 
@@ -52,4 +52,4 @@ res = await client.v1.image_background_remover.create(
52
52
  [V1ImageBackgroundRemoverCreateResponse](/magic_hour/types/models/v1_image_background_remover_create_response.py)
53
53
 
54
54
  ##### Example
55
- `{"credits_charged": 5, "frame_cost": 5, "id": "clx7uu86w0a5qp55yxz315r6r"}`
55
+ `{"credits_charged": 5, "frame_cost": 5, "id": "cuid-example"}`
@@ -32,7 +32,7 @@ class ImageBackgroundRemoverClient:
32
32
  POST /v1/image-background-remover
33
33
 
34
34
  Args:
35
- name: The name of image
35
+ name: The name of image. This value is mainly used for your own identification of the image.
36
36
  assets: Provide the assets for background removal
37
37
  request_options: Additional options to customize the HTTP request
38
38
 
@@ -89,7 +89,7 @@ class AsyncImageBackgroundRemoverClient:
89
89
  POST /v1/image-background-remover
90
90
 
91
91
  Args:
92
- name: The name of image
92
+ name: The name of image. This value is mainly used for your own identification of the image.
93
93
  assets: Provide the assets for background removal
94
94
  request_options: Additional options to customize the HTTP request
95
95
 
@@ -1,7 +1,7 @@
1
1
 
2
2
  ### Delete image <a name="delete"></a>
3
3
 
4
- Permanently delete the rendered image. This action is not reversible, please be sure before deleting.
4
+ Permanently delete the rendered image(s). This action is not reversible, please be sure before deleting.
5
5
 
6
6
  **API Endpoint**: `DELETE /v1/image-projects/{id}`
7
7
 
@@ -9,7 +9,7 @@ Permanently delete the rendered image. This action is not reversible, please be
9
9
 
10
10
  | Parameter | Required | Description | Example |
11
11
  |-----------|:--------:|-------------|--------|
12
- | `id` | ✓ | The id of the image project | `"cm6pvghix03bvyz0zwash6noj"` |
12
+ | `id` | ✓ | Unique ID of the image project. This value is returned by all of the POST APIs that create an image. | `"cuid-example"` |
13
13
 
14
14
  #### Synchronous Client
15
15
 
@@ -18,7 +18,7 @@ from magic_hour import Client
18
18
  from os import getenv
19
19
 
20
20
  client = Client(token=getenv("API_TOKEN"))
21
- res = client.v1.image_projects.delete(id="cm6pvghix03bvyz0zwash6noj")
21
+ res = client.v1.image_projects.delete(id="cuid-example")
22
22
 
23
23
  ```
24
24
 
@@ -29,7 +29,7 @@ from magic_hour import AsyncClient
29
29
  from os import getenv
30
30
 
31
31
  client = AsyncClient(token=getenv("API_TOKEN"))
32
- res = await client.v1.image_projects.delete(id="cm6pvghix03bvyz0zwash6noj")
32
+ res = await client.v1.image_projects.delete(id="cuid-example")
33
33
 
34
34
  ```
35
35
 
@@ -52,7 +52,7 @@ The image can be one of the following status
52
52
 
53
53
  | Parameter | Required | Description | Example |
54
54
  |-----------|:--------:|-------------|--------|
55
- | `id` | ✓ | The id of the image project | `"cm6pvghix03bvyz0zwash6noj"` |
55
+ | `id` | ✓ | Unique ID of the image project. This value is returned by all of the POST APIs that create an image. | `"cuid-example"` |
56
56
 
57
57
  #### Synchronous Client
58
58
 
@@ -61,7 +61,7 @@ from magic_hour import Client
61
61
  from os import getenv
62
62
 
63
63
  client = Client(token=getenv("API_TOKEN"))
64
- res = client.v1.image_projects.get(id="cm6pvghix03bvyz0zwash6noj")
64
+ res = client.v1.image_projects.get(id="cuid-example")
65
65
 
66
66
  ```
67
67
 
@@ -72,7 +72,7 @@ from magic_hour import AsyncClient
72
72
  from os import getenv
73
73
 
74
74
  client = AsyncClient(token=getenv("API_TOKEN"))
75
- res = await client.v1.image_projects.get(id="cm6pvghix03bvyz0zwash6noj")
75
+ res = await client.v1.image_projects.get(id="cuid-example")
76
76
 
77
77
  ```
78
78
 
@@ -82,4 +82,4 @@ res = await client.v1.image_projects.get(id="cm6pvghix03bvyz0zwash6noj")
82
82
  [V1ImageProjectsGetResponse](/magic_hour/types/models/v1_image_projects_get_response.py)
83
83
 
84
84
  ##### Example
85
- `{"created_at": "1970-01-01T00:00:00", "credits_charged": 5, "downloads": [{"expires_at": "2024-10-19T05:16:19.027Z", "url": "https://videos.magichour.ai/id/output.png"}], "enabled": True, "error": {"code": "no_source_face", "message": "Please use an image with a detectable face"}, "id": "clx7uu86w0a5qp55yxz315r6r", "image_count": 1, "name": "Example Name", "status": "complete", "total_frame_cost": 5, "type_": "AI_IMAGE"}`
85
+ `{"created_at": "1970-01-01T00:00:00", "credits_charged": 5, "downloads": [{"expires_at": "2024-10-19T05:16:19.027Z", "url": "https://videos.magichour.ai/id/output.png"}], "enabled": True, "error": {"code": "no_source_face", "message": "Please use an image with a detectable face"}, "id": "cuid-example", "image_count": 1, "name": "Example Name", "status": "complete", "total_frame_cost": 5, "type_": "AI_IMAGE"}`
@@ -19,12 +19,12 @@ class ImageProjectsClient:
19
19
  """
20
20
  Delete image
21
21
 
22
- Permanently delete the rendered image. This action is not reversible, please be sure before deleting.
22
+ Permanently delete the rendered image(s). This action is not reversible, please be sure before deleting.
23
23
 
24
24
  DELETE /v1/image-projects/{id}
25
25
 
26
26
  Args:
27
- id: The id of the image project
27
+ id: Unique ID of the image project. This value is returned by all of the POST APIs that create an image.
28
28
  request_options: Additional options to customize the HTTP request
29
29
 
30
30
  Returns:
@@ -36,7 +36,7 @@ class ImageProjectsClient:
36
36
 
37
37
  Examples:
38
38
  ```py
39
- client.v1.image_projects.delete(id="cm6pvghix03bvyz0zwash6noj")
39
+ client.v1.image_projects.delete(id="cuid-example")
40
40
  ```
41
41
  """
42
42
  self._base_client.request(
@@ -67,7 +67,7 @@ class ImageProjectsClient:
67
67
  GET /v1/image-projects/{id}
68
68
 
69
69
  Args:
70
- id: The id of the image project
70
+ id: Unique ID of the image project. This value is returned by all of the POST APIs that create an image.
71
71
  request_options: Additional options to customize the HTTP request
72
72
 
73
73
  Returns:
@@ -79,7 +79,7 @@ class ImageProjectsClient:
79
79
 
80
80
  Examples:
81
81
  ```py
82
- client.v1.image_projects.get(id="cm6pvghix03bvyz0zwash6noj")
82
+ client.v1.image_projects.get(id="cuid-example")
83
83
  ```
84
84
  """
85
85
  return self._base_client.request(
@@ -101,12 +101,12 @@ class AsyncImageProjectsClient:
101
101
  """
102
102
  Delete image
103
103
 
104
- Permanently delete the rendered image. This action is not reversible, please be sure before deleting.
104
+ Permanently delete the rendered image(s). This action is not reversible, please be sure before deleting.
105
105
 
106
106
  DELETE /v1/image-projects/{id}
107
107
 
108
108
  Args:
109
- id: The id of the image project
109
+ id: Unique ID of the image project. This value is returned by all of the POST APIs that create an image.
110
110
  request_options: Additional options to customize the HTTP request
111
111
 
112
112
  Returns:
@@ -118,7 +118,7 @@ class AsyncImageProjectsClient:
118
118
 
119
119
  Examples:
120
120
  ```py
121
- await client.v1.image_projects.delete(id="cm6pvghix03bvyz0zwash6noj")
121
+ await client.v1.image_projects.delete(id="cuid-example")
122
122
  ```
123
123
  """
124
124
  await self._base_client.request(
@@ -149,7 +149,7 @@ class AsyncImageProjectsClient:
149
149
  GET /v1/image-projects/{id}
150
150
 
151
151
  Args:
152
- id: The id of the image project
152
+ id: Unique ID of the image project. This value is returned by all of the POST APIs that create an image.
153
153
  request_options: Additional options to customize the HTTP request
154
154
 
155
155
  Returns:
@@ -161,7 +161,7 @@ class AsyncImageProjectsClient:
161
161
 
162
162
  Examples:
163
163
  ```py
164
- await client.v1.image_projects.get(id="cm6pvghix03bvyz0zwash6noj")
164
+ await client.v1.image_projects.get(id="cuid-example")
165
165
  ```
166
166
  """
167
167
  return await self._base_client.request(
@@ -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. | `960` |
18
- | `name` | ✗ | The name of video | `"Image To Video video"` |
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"` |
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
+ | `name` | ✗ | The name of video. This value is mainly used for your own identification of the video. | `"Image To Video video"` |
19
+ | `resolution` | ✗ | Controls the output video resolution. Defaults to `720p` if not specified. 480p and 720p are available on Creator, Pro, or Business tiers. However, 1080p require Pro or Business tier. **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. | `"720p"` |
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. | `512` |
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,8 @@ 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,
34
+ resolution="720p",
36
35
  )
37
36
 
38
37
  ```
@@ -47,9 +46,8 @@ client = AsyncClient(token=getenv("API_TOKEN"))
47
46
  res = await client.v1.image_to_video.create(
48
47
  assets={"image_file_path": "api-assets/id/1234.png"},
49
48
  end_seconds=5.0,
50
- height=960,
51
49
  name="Image To Video video",
52
- width=512,
50
+ resolution="720p",
53
51
  )
54
52
 
55
53
  ```
@@ -60,4 +58,4 @@ res = await client.v1.image_to_video.create(
60
58
  [V1ImageToVideoCreateResponse](/magic_hour/types/models/v1_image_to_video_create_response.py)
61
59
 
62
60
  ##### Example
63
- `{"credits_charged": 450, "estimated_frame_cost": 450, "id": "clx7uu86w0a5qp55yxz315r6r"}`
61
+ `{"credits_charged": 450, "estimated_frame_cost": 450, "id": "cuid-example"}`