magic_hour 0.11.0__tar.gz → 0.12.1__tar.gz

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 (139) hide show
  1. {magic_hour-0.11.0 → magic_hour-0.12.1}/PKG-INFO +5 -1
  2. {magic_hour-0.11.0 → magic_hour-0.12.1}/README.md +4 -0
  3. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/environment.py +1 -1
  4. magic_hour-0.12.1/magic_hour/resources/v1/ai_talking_photo/README.md +43 -0
  5. magic_hour-0.12.1/magic_hour/resources/v1/ai_talking_photo/__init__.py +4 -0
  6. magic_hour-0.12.1/magic_hour/resources/v1/ai_talking_photo/client.py +147 -0
  7. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/client.py +6 -0
  8. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/models/__init__.py +2 -0
  9. magic_hour-0.12.1/magic_hour/types/models/v1_ai_talking_photo_create_response.py +25 -0
  10. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/models/v1_video_projects_get_response.py +2 -2
  11. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/params/__init__.py +12 -0
  12. magic_hour-0.12.1/magic_hour/types/params/v1_ai_talking_photo_create_body.py +56 -0
  13. magic_hour-0.12.1/magic_hour/types/params/v1_ai_talking_photo_create_body_assets.py +36 -0
  14. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/params/v1_video_to_video_create_body_style.py +10 -0
  15. {magic_hour-0.11.0 → magic_hour-0.12.1}/pyproject.toml +1 -1
  16. {magic_hour-0.11.0 → magic_hour-0.12.1}/LICENSE +0 -0
  17. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/__init__.py +0 -0
  18. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/client.py +0 -0
  19. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/core/__init__.py +0 -0
  20. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/core/api_error.py +0 -0
  21. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/core/auth.py +0 -0
  22. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/core/base_client.py +0 -0
  23. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/core/binary_response.py +0 -0
  24. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/core/query.py +0 -0
  25. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/core/request.py +0 -0
  26. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/core/response.py +0 -0
  27. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/core/type_utils.py +0 -0
  28. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/core/utils.py +0 -0
  29. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/__init__.py +0 -0
  30. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/ai_clothes_changer/README.md +0 -0
  31. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/ai_clothes_changer/__init__.py +0 -0
  32. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/ai_clothes_changer/client.py +0 -0
  33. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/ai_headshot_generator/README.md +0 -0
  34. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/ai_headshot_generator/__init__.py +0 -0
  35. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/ai_headshot_generator/client.py +0 -0
  36. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/ai_image_generator/README.md +0 -0
  37. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/ai_image_generator/__init__.py +0 -0
  38. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/ai_image_generator/client.py +0 -0
  39. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/ai_image_upscaler/README.md +0 -0
  40. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/ai_image_upscaler/__init__.py +0 -0
  41. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/ai_image_upscaler/client.py +0 -0
  42. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/ai_photo_editor/README.md +0 -0
  43. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/ai_photo_editor/__init__.py +0 -0
  44. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/ai_photo_editor/client.py +0 -0
  45. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/ai_qr_code_generator/README.md +0 -0
  46. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/ai_qr_code_generator/__init__.py +0 -0
  47. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/ai_qr_code_generator/client.py +0 -0
  48. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/animation/README.md +0 -0
  49. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/animation/__init__.py +0 -0
  50. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/animation/client.py +0 -0
  51. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/face_swap/README.md +0 -0
  52. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/face_swap/__init__.py +0 -0
  53. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/face_swap/client.py +0 -0
  54. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/face_swap_photo/README.md +0 -0
  55. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/face_swap_photo/__init__.py +0 -0
  56. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/face_swap_photo/client.py +0 -0
  57. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/files/__init__.py +0 -0
  58. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/files/client.py +0 -0
  59. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/files/upload_urls/README.md +0 -0
  60. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/files/upload_urls/__init__.py +0 -0
  61. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/files/upload_urls/client.py +0 -0
  62. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/image_background_remover/README.md +0 -0
  63. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/image_background_remover/__init__.py +0 -0
  64. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/image_background_remover/client.py +0 -0
  65. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/image_projects/README.md +0 -0
  66. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/image_projects/__init__.py +0 -0
  67. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/image_projects/client.py +0 -0
  68. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/image_to_video/README.md +0 -0
  69. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/image_to_video/__init__.py +0 -0
  70. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/image_to_video/client.py +0 -0
  71. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/lip_sync/README.md +0 -0
  72. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/lip_sync/__init__.py +0 -0
  73. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/lip_sync/client.py +0 -0
  74. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/text_to_video/README.md +0 -0
  75. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/text_to_video/__init__.py +0 -0
  76. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/text_to_video/client.py +0 -0
  77. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/video_projects/README.md +0 -0
  78. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/video_projects/__init__.py +0 -0
  79. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/video_projects/client.py +0 -0
  80. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/video_to_video/README.md +0 -0
  81. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/video_to_video/__init__.py +0 -0
  82. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/resources/v1/video_to_video/client.py +0 -0
  83. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/models/v1_ai_clothes_changer_create_response.py +0 -0
  84. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/models/v1_ai_headshot_generator_create_response.py +0 -0
  85. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/models/v1_ai_image_generator_create_response.py +0 -0
  86. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/models/v1_ai_image_upscaler_create_response.py +0 -0
  87. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/models/v1_ai_photo_editor_create_response.py +0 -0
  88. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/models/v1_ai_qr_code_generator_create_response.py +0 -0
  89. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/models/v1_animation_create_response.py +0 -0
  90. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/models/v1_face_swap_create_response.py +0 -0
  91. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/models/v1_face_swap_photo_create_response.py +0 -0
  92. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/models/v1_files_upload_urls_create_response.py +0 -0
  93. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/models/v1_files_upload_urls_create_response_items_item.py +0 -0
  94. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/models/v1_image_background_remover_create_response.py +0 -0
  95. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/models/v1_image_projects_get_response.py +0 -0
  96. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/models/v1_image_projects_get_response_downloads_item.py +0 -0
  97. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/models/v1_image_projects_get_response_error.py +0 -0
  98. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/models/v1_image_to_video_create_response.py +0 -0
  99. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/models/v1_lip_sync_create_response.py +0 -0
  100. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/models/v1_text_to_video_create_response.py +0 -0
  101. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/models/v1_video_projects_get_response_download.py +0 -0
  102. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/models/v1_video_projects_get_response_downloads_item.py +0 -0
  103. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/models/v1_video_projects_get_response_error.py +0 -0
  104. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/models/v1_video_to_video_create_response.py +0 -0
  105. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/params/v1_ai_clothes_changer_create_body.py +0 -0
  106. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/params/v1_ai_clothes_changer_create_body_assets.py +0 -0
  107. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/params/v1_ai_headshot_generator_create_body.py +0 -0
  108. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/params/v1_ai_headshot_generator_create_body_assets.py +0 -0
  109. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/params/v1_ai_headshot_generator_create_body_style.py +0 -0
  110. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/params/v1_ai_image_generator_create_body.py +0 -0
  111. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/params/v1_ai_image_generator_create_body_style.py +0 -0
  112. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/params/v1_ai_image_upscaler_create_body.py +0 -0
  113. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/params/v1_ai_image_upscaler_create_body_assets.py +0 -0
  114. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/params/v1_ai_image_upscaler_create_body_style.py +0 -0
  115. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/params/v1_ai_photo_editor_create_body.py +0 -0
  116. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/params/v1_ai_photo_editor_create_body_assets.py +0 -0
  117. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/params/v1_ai_photo_editor_create_body_style.py +0 -0
  118. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/params/v1_ai_qr_code_generator_create_body.py +0 -0
  119. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/params/v1_ai_qr_code_generator_create_body_style.py +0 -0
  120. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/params/v1_animation_create_body.py +0 -0
  121. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/params/v1_animation_create_body_assets.py +0 -0
  122. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/params/v1_animation_create_body_style.py +0 -0
  123. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/params/v1_face_swap_create_body.py +0 -0
  124. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/params/v1_face_swap_create_body_assets.py +0 -0
  125. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/params/v1_face_swap_photo_create_body.py +0 -0
  126. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/params/v1_face_swap_photo_create_body_assets.py +0 -0
  127. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/params/v1_files_upload_urls_create_body.py +0 -0
  128. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/params/v1_files_upload_urls_create_body_items_item.py +0 -0
  129. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/params/v1_image_background_remover_create_body.py +0 -0
  130. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/params/v1_image_background_remover_create_body_assets.py +0 -0
  131. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/params/v1_image_to_video_create_body.py +0 -0
  132. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/params/v1_image_to_video_create_body_assets.py +0 -0
  133. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/params/v1_image_to_video_create_body_style.py +0 -0
  134. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/params/v1_lip_sync_create_body.py +0 -0
  135. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/params/v1_lip_sync_create_body_assets.py +0 -0
  136. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/params/v1_text_to_video_create_body.py +0 -0
  137. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/params/v1_text_to_video_create_body_style.py +0 -0
  138. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/params/v1_video_to_video_create_body.py +0 -0
  139. {magic_hour-0.11.0 → magic_hour-0.12.1}/magic_hour/types/params/v1_video_to_video_create_body_assets.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: magic_hour
3
- Version: 0.11.0
3
+ Version: 0.12.1
4
4
  Summary: Python SDK for Magic Hour API
5
5
  Requires-Python: >=3.8,<4.0
6
6
  Classifier: Programming Language :: Python :: 3
@@ -83,6 +83,10 @@ client = AsyncClient(token="my api key")
83
83
 
84
84
  * [create](magic_hour/resources/v1/ai_qr_code_generator/README.md#create) - AI QR Code
85
85
 
86
+ ### [v1.ai_talking_photo](magic_hour/resources/v1/ai_talking_photo/README.md)
87
+
88
+ * [create](magic_hour/resources/v1/ai_talking_photo/README.md#create) - AI Talking Photo
89
+
86
90
  ### [v1.animation](magic_hour/resources/v1/animation/README.md)
87
91
 
88
92
  * [create](magic_hour/resources/v1/animation/README.md#create) - Animation
@@ -65,6 +65,10 @@ client = AsyncClient(token="my api key")
65
65
 
66
66
  * [create](magic_hour/resources/v1/ai_qr_code_generator/README.md#create) - AI QR Code
67
67
 
68
+ ### [v1.ai_talking_photo](magic_hour/resources/v1/ai_talking_photo/README.md)
69
+
70
+ * [create](magic_hour/resources/v1/ai_talking_photo/README.md#create) - AI Talking Photo
71
+
68
72
  ### [v1.animation](magic_hour/resources/v1/animation/README.md)
69
73
 
70
74
  * [create](magic_hour/resources/v1/animation/README.md#create) - Animation
@@ -5,4 +5,4 @@ class Environment(enum.Enum):
5
5
  """Pre-defined base URLs for the API"""
6
6
 
7
7
  ENVIRONMENT = "https://api.magichour.ai"
8
- MOCK_SERVER = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.11.0"
8
+ MOCK_SERVER = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.12.1"
@@ -0,0 +1,43 @@
1
+
2
+ ### create <a name="create"></a>
3
+ AI Talking Photo
4
+
5
+ Create a talking photo from an image and audio or text input.
6
+
7
+ **API Endpoint**: `POST /v1/ai-talking-photo`
8
+
9
+ #### Synchronous Client
10
+
11
+ ```python
12
+ from magic_hour import Client
13
+ from os import getenv
14
+
15
+ client = Client(token=getenv("API_TOKEN"))
16
+ res = client.v1.ai_talking_photo.create(
17
+ assets={
18
+ "audio_file_path": "api-assets/id/1234.mp3",
19
+ "image_file_path": "api-assets/id/1234.png",
20
+ },
21
+ end_seconds=15.0,
22
+ start_seconds=0.0,
23
+ name="Talking Photo image",
24
+ )
25
+ ```
26
+
27
+ #### Asynchronous Client
28
+
29
+ ```python
30
+ from magic_hour import AsyncClient
31
+ from os import getenv
32
+
33
+ client = AsyncClient(token=getenv("API_TOKEN"))
34
+ res = await client.v1.ai_talking_photo.create(
35
+ assets={
36
+ "audio_file_path": "api-assets/id/1234.mp3",
37
+ "image_file_path": "api-assets/id/1234.png",
38
+ },
39
+ end_seconds=15.0,
40
+ start_seconds=0.0,
41
+ name="Talking Photo image",
42
+ )
43
+ ```
@@ -0,0 +1,4 @@
1
+ from .client import AiTalkingPhotoClient, AsyncAiTalkingPhotoClient
2
+
3
+
4
+ __all__ = ["AiTalkingPhotoClient", "AsyncAiTalkingPhotoClient"]
@@ -0,0 +1,147 @@
1
+ import typing
2
+
3
+ from magic_hour.core import (
4
+ AsyncBaseClient,
5
+ RequestOptions,
6
+ SyncBaseClient,
7
+ default_request_options,
8
+ to_encodable,
9
+ type_utils,
10
+ )
11
+ from magic_hour.types import models, params
12
+
13
+
14
+ class AiTalkingPhotoClient:
15
+ def __init__(self, *, base_client: SyncBaseClient):
16
+ self._base_client = base_client
17
+
18
+ def create(
19
+ self,
20
+ *,
21
+ assets: params.V1AiTalkingPhotoCreateBodyAssets,
22
+ end_seconds: float,
23
+ start_seconds: float,
24
+ name: typing.Union[
25
+ typing.Optional[str], type_utils.NotGiven
26
+ ] = type_utils.NOT_GIVEN,
27
+ request_options: typing.Optional[RequestOptions] = None,
28
+ ) -> models.V1AiTalkingPhotoCreateResponse:
29
+ """
30
+ AI Talking Photo
31
+
32
+ Create a talking photo from an image and audio or text input.
33
+
34
+ POST /v1/ai-talking-photo
35
+
36
+ Args:
37
+ name: The name of image
38
+ 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
41
+ request_options: Additional options to customize the HTTP request
42
+
43
+ Returns:
44
+ Success
45
+
46
+ Raises:
47
+ ApiError: A custom exception class that provides additional context
48
+ for API errors, including the HTTP status code and response body.
49
+
50
+ Examples:
51
+ ```py
52
+ client.v1.ai_talking_photo.create(
53
+ assets={
54
+ "audio_file_path": "api-assets/id/1234.mp3",
55
+ "image_file_path": "api-assets/id/1234.png",
56
+ },
57
+ end_seconds=15.0,
58
+ start_seconds=0.0,
59
+ name="Talking Photo image",
60
+ )
61
+ ```
62
+ """
63
+ _json = to_encodable(
64
+ item={
65
+ "name": name,
66
+ "assets": assets,
67
+ "end_seconds": end_seconds,
68
+ "start_seconds": start_seconds,
69
+ },
70
+ dump_with=params._SerializerV1AiTalkingPhotoCreateBody,
71
+ )
72
+ return self._base_client.request(
73
+ method="POST",
74
+ path="/v1/ai-talking-photo",
75
+ auth_names=["bearerAuth"],
76
+ json=_json,
77
+ cast_to=models.V1AiTalkingPhotoCreateResponse,
78
+ request_options=request_options or default_request_options(),
79
+ )
80
+
81
+
82
+ class AsyncAiTalkingPhotoClient:
83
+ def __init__(self, *, base_client: AsyncBaseClient):
84
+ self._base_client = base_client
85
+
86
+ async def create(
87
+ self,
88
+ *,
89
+ assets: params.V1AiTalkingPhotoCreateBodyAssets,
90
+ end_seconds: float,
91
+ start_seconds: float,
92
+ name: typing.Union[
93
+ typing.Optional[str], type_utils.NotGiven
94
+ ] = type_utils.NOT_GIVEN,
95
+ request_options: typing.Optional[RequestOptions] = None,
96
+ ) -> models.V1AiTalkingPhotoCreateResponse:
97
+ """
98
+ AI Talking Photo
99
+
100
+ Create a talking photo from an image and audio or text input.
101
+
102
+ POST /v1/ai-talking-photo
103
+
104
+ Args:
105
+ name: The name of image
106
+ 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
109
+ request_options: Additional options to customize the HTTP request
110
+
111
+ Returns:
112
+ Success
113
+
114
+ Raises:
115
+ ApiError: A custom exception class that provides additional context
116
+ for API errors, including the HTTP status code and response body.
117
+
118
+ Examples:
119
+ ```py
120
+ await client.v1.ai_talking_photo.create(
121
+ assets={
122
+ "audio_file_path": "api-assets/id/1234.mp3",
123
+ "image_file_path": "api-assets/id/1234.png",
124
+ },
125
+ end_seconds=15.0,
126
+ start_seconds=0.0,
127
+ name="Talking Photo image",
128
+ )
129
+ ```
130
+ """
131
+ _json = to_encodable(
132
+ item={
133
+ "name": name,
134
+ "assets": assets,
135
+ "end_seconds": end_seconds,
136
+ "start_seconds": start_seconds,
137
+ },
138
+ dump_with=params._SerializerV1AiTalkingPhotoCreateBody,
139
+ )
140
+ return await self._base_client.request(
141
+ method="POST",
142
+ path="/v1/ai-talking-photo",
143
+ auth_names=["bearerAuth"],
144
+ json=_json,
145
+ cast_to=models.V1AiTalkingPhotoCreateResponse,
146
+ request_options=request_options or default_request_options(),
147
+ )
@@ -23,6 +23,10 @@ from magic_hour.resources.v1.ai_qr_code_generator import (
23
23
  AiQrCodeGeneratorClient,
24
24
  AsyncAiQrCodeGeneratorClient,
25
25
  )
26
+ from magic_hour.resources.v1.ai_talking_photo import (
27
+ AiTalkingPhotoClient,
28
+ AsyncAiTalkingPhotoClient,
29
+ )
26
30
  from magic_hour.resources.v1.animation import AnimationClient, AsyncAnimationClient
27
31
  from magic_hour.resources.v1.face_swap import AsyncFaceSwapClient, FaceSwapClient
28
32
  from magic_hour.resources.v1.face_swap_photo import (
@@ -72,6 +76,7 @@ class V1Client:
72
76
  self.ai_qr_code_generator = AiQrCodeGeneratorClient(
73
77
  base_client=self._base_client
74
78
  )
79
+ self.ai_talking_photo = AiTalkingPhotoClient(base_client=self._base_client)
75
80
  self.animation = AnimationClient(base_client=self._base_client)
76
81
  self.face_swap = FaceSwapClient(base_client=self._base_client)
77
82
  self.face_swap_photo = FaceSwapPhotoClient(base_client=self._base_client)
@@ -106,6 +111,7 @@ class AsyncV1Client:
106
111
  self.ai_qr_code_generator = AsyncAiQrCodeGeneratorClient(
107
112
  base_client=self._base_client
108
113
  )
114
+ self.ai_talking_photo = AsyncAiTalkingPhotoClient(base_client=self._base_client)
109
115
  self.animation = AsyncAnimationClient(base_client=self._base_client)
110
116
  self.face_swap = AsyncFaceSwapClient(base_client=self._base_client)
111
117
  self.face_swap_photo = AsyncFaceSwapPhotoClient(base_client=self._base_client)
@@ -6,6 +6,7 @@ from .v1_ai_image_generator_create_response import V1AiImageGeneratorCreateRespo
6
6
  from .v1_ai_image_upscaler_create_response import V1AiImageUpscalerCreateResponse
7
7
  from .v1_ai_photo_editor_create_response import V1AiPhotoEditorCreateResponse
8
8
  from .v1_ai_qr_code_generator_create_response import V1AiQrCodeGeneratorCreateResponse
9
+ from .v1_ai_talking_photo_create_response import V1AiTalkingPhotoCreateResponse
9
10
  from .v1_animation_create_response import V1AnimationCreateResponse
10
11
  from .v1_face_swap_create_response import V1FaceSwapCreateResponse
11
12
  from .v1_face_swap_photo_create_response import V1FaceSwapPhotoCreateResponse
@@ -40,6 +41,7 @@ __all__ = [
40
41
  "V1AiImageUpscalerCreateResponse",
41
42
  "V1AiPhotoEditorCreateResponse",
42
43
  "V1AiQrCodeGeneratorCreateResponse",
44
+ "V1AiTalkingPhotoCreateResponse",
43
45
  "V1AnimationCreateResponse",
44
46
  "V1FaceSwapCreateResponse",
45
47
  "V1FaceSwapPhotoCreateResponse",
@@ -0,0 +1,25 @@
1
+ import pydantic
2
+
3
+
4
+ class V1AiTalkingPhotoCreateResponse(pydantic.BaseModel):
5
+ """
6
+ Success
7
+ """
8
+
9
+ model_config = pydantic.ConfigDict(
10
+ arbitrary_types_allowed=True,
11
+ populate_by_name=True,
12
+ )
13
+
14
+ estimated_frame_cost: int = pydantic.Field(
15
+ alias="estimated_frame_cost",
16
+ )
17
+ """
18
+ Estimated cost of the video in terms of number of frames needed to render the video. Frames will be adjusted when the video completes
19
+ """
20
+ id: str = pydantic.Field(
21
+ alias="id",
22
+ )
23
+ """
24
+ Unique ID of the video. This value can be used in the [get video project API](https://docs.magichour.ai/api-reference/video-projects/get-video-details) to fetch additional details such as status
25
+ """
@@ -59,7 +59,7 @@ class V1VideoProjectsGetResponse(pydantic.BaseModel):
59
59
  alias="height",
60
60
  )
61
61
  """
62
- The height of the final output video. The maximum height depends on your subscription. Please refer to our [pricing page](https://magichour.ai/pricing) for more details
62
+ The height of the final output video. A value of -1 indicates the height can be ignored.
63
63
  """
64
64
  id: str = pydantic.Field(
65
65
  alias="id",
@@ -109,5 +109,5 @@ class V1VideoProjectsGetResponse(pydantic.BaseModel):
109
109
  alias="width",
110
110
  )
111
111
  """
112
- The width of the final output video. The maximum width depends on your subscription. Please refer to our [pricing page](https://magichour.ai/pricing) for more details
112
+ The width of the final output video. A value of -1 indicates the width can be ignored.
113
113
  """
@@ -58,6 +58,14 @@ from .v1_ai_qr_code_generator_create_body_style import (
58
58
  V1AiQrCodeGeneratorCreateBodyStyle,
59
59
  _SerializerV1AiQrCodeGeneratorCreateBodyStyle,
60
60
  )
61
+ from .v1_ai_talking_photo_create_body import (
62
+ V1AiTalkingPhotoCreateBody,
63
+ _SerializerV1AiTalkingPhotoCreateBody,
64
+ )
65
+ from .v1_ai_talking_photo_create_body_assets import (
66
+ V1AiTalkingPhotoCreateBodyAssets,
67
+ _SerializerV1AiTalkingPhotoCreateBodyAssets,
68
+ )
61
69
  from .v1_animation_create_body import (
62
70
  V1AnimationCreateBody,
63
71
  _SerializerV1AnimationCreateBody,
@@ -157,6 +165,8 @@ __all__ = [
157
165
  "V1AiPhotoEditorCreateBodyStyle",
158
166
  "V1AiQrCodeGeneratorCreateBody",
159
167
  "V1AiQrCodeGeneratorCreateBodyStyle",
168
+ "V1AiTalkingPhotoCreateBody",
169
+ "V1AiTalkingPhotoCreateBodyAssets",
160
170
  "V1AnimationCreateBody",
161
171
  "V1AnimationCreateBodyAssets",
162
172
  "V1AnimationCreateBodyStyle",
@@ -193,6 +203,8 @@ __all__ = [
193
203
  "_SerializerV1AiPhotoEditorCreateBodyStyle",
194
204
  "_SerializerV1AiQrCodeGeneratorCreateBody",
195
205
  "_SerializerV1AiQrCodeGeneratorCreateBodyStyle",
206
+ "_SerializerV1AiTalkingPhotoCreateBody",
207
+ "_SerializerV1AiTalkingPhotoCreateBodyAssets",
196
208
  "_SerializerV1AnimationCreateBody",
197
209
  "_SerializerV1AnimationCreateBodyAssets",
198
210
  "_SerializerV1AnimationCreateBodyStyle",
@@ -0,0 +1,56 @@
1
+ import pydantic
2
+ import typing
3
+ import typing_extensions
4
+
5
+ from .v1_ai_talking_photo_create_body_assets import (
6
+ V1AiTalkingPhotoCreateBodyAssets,
7
+ _SerializerV1AiTalkingPhotoCreateBodyAssets,
8
+ )
9
+
10
+
11
+ class V1AiTalkingPhotoCreateBody(typing_extensions.TypedDict):
12
+ """
13
+ Provide the assets for creating a talking photo
14
+ """
15
+
16
+ assets: typing_extensions.Required[V1AiTalkingPhotoCreateBodyAssets]
17
+ """
18
+ Provide the assets for creating a talking photo
19
+ """
20
+
21
+ end_seconds: typing_extensions.Required[float]
22
+ """
23
+ The end time of the input video in seconds
24
+ """
25
+
26
+ name: typing_extensions.NotRequired[str]
27
+ """
28
+ The name of image
29
+ """
30
+
31
+ start_seconds: typing_extensions.Required[float]
32
+ """
33
+ The start time of the input video in seconds
34
+ """
35
+
36
+
37
+ class _SerializerV1AiTalkingPhotoCreateBody(pydantic.BaseModel):
38
+ """
39
+ Serializer for V1AiTalkingPhotoCreateBody handling case conversions
40
+ and file omissions as dictated by the API
41
+ """
42
+
43
+ model_config = pydantic.ConfigDict(
44
+ populate_by_name=True,
45
+ )
46
+
47
+ assets: _SerializerV1AiTalkingPhotoCreateBodyAssets = pydantic.Field(
48
+ alias="assets",
49
+ )
50
+ end_seconds: float = pydantic.Field(
51
+ alias="end_seconds",
52
+ )
53
+ name: typing.Optional[str] = pydantic.Field(alias="name", default=None)
54
+ start_seconds: float = pydantic.Field(
55
+ alias="start_seconds",
56
+ )
@@ -0,0 +1,36 @@
1
+ import pydantic
2
+ import typing_extensions
3
+
4
+
5
+ class V1AiTalkingPhotoCreateBodyAssets(typing_extensions.TypedDict):
6
+ """
7
+ Provide the assets for creating a talking photo
8
+ """
9
+
10
+ audio_file_path: typing_extensions.Required[str]
11
+ """
12
+ The audio file to sync with the image. This value can be either the `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls), or the url of the file.
13
+ """
14
+
15
+ image_file_path: typing_extensions.Required[str]
16
+ """
17
+ The source image to animate. This value can be either the `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls), or the url of the file.
18
+ """
19
+
20
+
21
+ class _SerializerV1AiTalkingPhotoCreateBodyAssets(pydantic.BaseModel):
22
+ """
23
+ Serializer for V1AiTalkingPhotoCreateBodyAssets handling case conversions
24
+ and file omissions as dictated by the API
25
+ """
26
+
27
+ model_config = pydantic.ConfigDict(
28
+ populate_by_name=True,
29
+ )
30
+
31
+ audio_file_path: str = pydantic.Field(
32
+ alias="audio_file_path",
33
+ )
34
+ image_file_path: str = pydantic.Field(
35
+ alias="image_file_path",
36
+ )
@@ -20,6 +20,7 @@ class V1VideoToVideoCreateBodyStyle(typing_extensions.TypedDict):
20
20
  "Black Spiderman",
21
21
  "Boba Fett",
22
22
  "Celestial Skin",
23
+ "Chinese Swordsmen",
23
24
  "Clay",
24
25
  "Comic",
25
26
  "Cyberpunk",
@@ -41,14 +42,17 @@ class V1VideoToVideoCreateBodyStyle(typing_extensions.TypedDict):
41
42
  "Lego",
42
43
  "Link",
43
44
  "Marble",
45
+ "Mario",
44
46
  "Master Chief",
45
47
  "Mech",
46
48
  "Minecraft",
49
+ "Mystique",
47
50
  "Naruto",
48
51
  "Neon Dream",
49
52
  "Oil Painting",
50
53
  "On Fire",
51
54
  "Origami",
55
+ "Pixar",
52
56
  "Pixel",
53
57
  "Power Armor",
54
58
  "Power Ranger",
@@ -63,6 +67,7 @@ class V1VideoToVideoCreateBodyStyle(typing_extensions.TypedDict):
63
67
  "Studio Ghibli",
64
68
  "Sub-Zero",
65
69
  "The Void",
70
+ "Tomb Raider",
66
71
  "Underwater",
67
72
  "Van Gogh",
68
73
  "Viking",
@@ -129,6 +134,7 @@ class _SerializerV1VideoToVideoCreateBodyStyle(pydantic.BaseModel):
129
134
  "Black Spiderman",
130
135
  "Boba Fett",
131
136
  "Celestial Skin",
137
+ "Chinese Swordsmen",
132
138
  "Clay",
133
139
  "Comic",
134
140
  "Cyberpunk",
@@ -150,14 +156,17 @@ class _SerializerV1VideoToVideoCreateBodyStyle(pydantic.BaseModel):
150
156
  "Lego",
151
157
  "Link",
152
158
  "Marble",
159
+ "Mario",
153
160
  "Master Chief",
154
161
  "Mech",
155
162
  "Minecraft",
163
+ "Mystique",
156
164
  "Naruto",
157
165
  "Neon Dream",
158
166
  "Oil Painting",
159
167
  "On Fire",
160
168
  "Origami",
169
+ "Pixar",
161
170
  "Pixel",
162
171
  "Power Armor",
163
172
  "Power Ranger",
@@ -172,6 +181,7 @@ class _SerializerV1VideoToVideoCreateBodyStyle(pydantic.BaseModel):
172
181
  "Studio Ghibli",
173
182
  "Sub-Zero",
174
183
  "The Void",
184
+ "Tomb Raider",
175
185
  "Underwater",
176
186
  "Van Gogh",
177
187
  "Viking",
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "magic_hour"
3
- version = "0.11.0"
3
+ version = "0.12.1"
4
4
  description = "Python SDK for Magic Hour API"
5
5
  readme = "README.md"
6
6
  authors = []
File without changes