magic_hour 0.15.0__tar.gz → 0.16.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 (152) hide show
  1. {magic_hour-0.15.0 → magic_hour-0.16.1}/PKG-INFO +5 -1
  2. {magic_hour-0.15.0 → magic_hour-0.16.1}/README.md +4 -0
  3. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/environment.py +1 -1
  4. magic_hour-0.16.1/magic_hour/resources/v1/ai_face_editor/README.md +67 -0
  5. magic_hour-0.16.1/magic_hour/resources/v1/ai_face_editor/__init__.py +4 -0
  6. magic_hour-0.16.1/magic_hour/resources/v1/ai_face_editor/client.py +157 -0
  7. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/client.py +6 -0
  8. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/lip_sync/client.py +52 -16
  9. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/models/__init__.py +2 -0
  10. magic_hour-0.16.1/magic_hour/types/models/v1_ai_face_editor_create_response.py +25 -0
  11. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/params/__init__.py +18 -0
  12. magic_hour-0.16.1/magic_hour/types/params/v1_ai_face_editor_create_body.py +52 -0
  13. magic_hour-0.16.1/magic_hour/types/params/v1_ai_face_editor_create_body_assets.py +28 -0
  14. magic_hour-0.16.1/magic_hour/types/params/v1_ai_face_editor_create_body_style.py +140 -0
  15. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/params/v1_lip_sync_create_body.py +20 -10
  16. {magic_hour-0.15.0 → magic_hour-0.16.1}/pyproject.toml +1 -1
  17. {magic_hour-0.15.0 → magic_hour-0.16.1}/LICENSE +0 -0
  18. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/__init__.py +0 -0
  19. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/client.py +0 -0
  20. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/core/__init__.py +0 -0
  21. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/core/api_error.py +0 -0
  22. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/core/auth.py +0 -0
  23. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/core/base_client.py +0 -0
  24. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/core/binary_response.py +0 -0
  25. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/core/query.py +0 -0
  26. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/core/request.py +0 -0
  27. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/core/response.py +0 -0
  28. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/core/type_utils.py +0 -0
  29. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/core/utils.py +0 -0
  30. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/__init__.py +0 -0
  31. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/ai_clothes_changer/README.md +0 -0
  32. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/ai_clothes_changer/__init__.py +0 -0
  33. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/ai_clothes_changer/client.py +0 -0
  34. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/ai_headshot_generator/README.md +0 -0
  35. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/ai_headshot_generator/__init__.py +0 -0
  36. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/ai_headshot_generator/client.py +0 -0
  37. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/ai_image_generator/README.md +0 -0
  38. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/ai_image_generator/__init__.py +0 -0
  39. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/ai_image_generator/client.py +0 -0
  40. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/ai_image_upscaler/README.md +0 -0
  41. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/ai_image_upscaler/__init__.py +0 -0
  42. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/ai_image_upscaler/client.py +0 -0
  43. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/ai_meme_generator/README.md +0 -0
  44. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/ai_meme_generator/__init__.py +0 -0
  45. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/ai_meme_generator/client.py +0 -0
  46. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/ai_photo_editor/README.md +0 -0
  47. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/ai_photo_editor/__init__.py +0 -0
  48. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/ai_photo_editor/client.py +0 -0
  49. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/ai_qr_code_generator/README.md +0 -0
  50. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/ai_qr_code_generator/__init__.py +0 -0
  51. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/ai_qr_code_generator/client.py +0 -0
  52. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/ai_talking_photo/README.md +0 -0
  53. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/ai_talking_photo/__init__.py +0 -0
  54. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/ai_talking_photo/client.py +0 -0
  55. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/animation/README.md +0 -0
  56. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/animation/__init__.py +0 -0
  57. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/animation/client.py +0 -0
  58. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/face_swap/README.md +0 -0
  59. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/face_swap/__init__.py +0 -0
  60. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/face_swap/client.py +0 -0
  61. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/face_swap_photo/README.md +0 -0
  62. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/face_swap_photo/__init__.py +0 -0
  63. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/face_swap_photo/client.py +0 -0
  64. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/files/__init__.py +0 -0
  65. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/files/client.py +0 -0
  66. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/files/upload_urls/README.md +0 -0
  67. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/files/upload_urls/__init__.py +0 -0
  68. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/files/upload_urls/client.py +0 -0
  69. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/image_background_remover/README.md +0 -0
  70. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/image_background_remover/__init__.py +0 -0
  71. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/image_background_remover/client.py +0 -0
  72. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/image_projects/README.md +0 -0
  73. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/image_projects/__init__.py +0 -0
  74. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/image_projects/client.py +0 -0
  75. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/image_to_video/README.md +0 -0
  76. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/image_to_video/__init__.py +0 -0
  77. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/image_to_video/client.py +0 -0
  78. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/lip_sync/README.md +4 -4
  79. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/lip_sync/__init__.py +0 -0
  80. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/text_to_video/README.md +0 -0
  81. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/text_to_video/__init__.py +0 -0
  82. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/text_to_video/client.py +0 -0
  83. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/video_projects/README.md +0 -0
  84. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/video_projects/__init__.py +0 -0
  85. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/video_projects/client.py +0 -0
  86. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/video_to_video/README.md +0 -0
  87. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/video_to_video/__init__.py +0 -0
  88. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/resources/v1/video_to_video/client.py +0 -0
  89. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/models/v1_ai_clothes_changer_create_response.py +0 -0
  90. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/models/v1_ai_headshot_generator_create_response.py +0 -0
  91. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/models/v1_ai_image_generator_create_response.py +0 -0
  92. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/models/v1_ai_image_upscaler_create_response.py +0 -0
  93. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/models/v1_ai_meme_generator_create_response.py +0 -0
  94. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/models/v1_ai_photo_editor_create_response.py +0 -0
  95. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/models/v1_ai_qr_code_generator_create_response.py +0 -0
  96. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/models/v1_ai_talking_photo_create_response.py +0 -0
  97. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/models/v1_animation_create_response.py +0 -0
  98. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/models/v1_face_swap_create_response.py +0 -0
  99. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/models/v1_face_swap_photo_create_response.py +0 -0
  100. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/models/v1_files_upload_urls_create_response.py +0 -0
  101. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/models/v1_files_upload_urls_create_response_items_item.py +0 -0
  102. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/models/v1_image_background_remover_create_response.py +0 -0
  103. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/models/v1_image_projects_get_response.py +0 -0
  104. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/models/v1_image_projects_get_response_downloads_item.py +0 -0
  105. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/models/v1_image_projects_get_response_error.py +0 -0
  106. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/models/v1_image_to_video_create_response.py +0 -0
  107. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/models/v1_lip_sync_create_response.py +0 -0
  108. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/models/v1_text_to_video_create_response.py +0 -0
  109. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/models/v1_video_projects_get_response.py +0 -0
  110. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/models/v1_video_projects_get_response_download.py +0 -0
  111. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/models/v1_video_projects_get_response_downloads_item.py +0 -0
  112. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/models/v1_video_projects_get_response_error.py +0 -0
  113. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/models/v1_video_to_video_create_response.py +0 -0
  114. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/params/v1_ai_clothes_changer_create_body.py +0 -0
  115. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/params/v1_ai_clothes_changer_create_body_assets.py +0 -0
  116. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/params/v1_ai_headshot_generator_create_body.py +0 -0
  117. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/params/v1_ai_headshot_generator_create_body_assets.py +0 -0
  118. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/params/v1_ai_headshot_generator_create_body_style.py +0 -0
  119. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/params/v1_ai_image_generator_create_body.py +0 -0
  120. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/params/v1_ai_image_generator_create_body_style.py +0 -0
  121. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/params/v1_ai_image_upscaler_create_body.py +0 -0
  122. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/params/v1_ai_image_upscaler_create_body_assets.py +0 -0
  123. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/params/v1_ai_image_upscaler_create_body_style.py +0 -0
  124. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/params/v1_ai_meme_generator_create_body.py +0 -0
  125. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/params/v1_ai_meme_generator_create_body_style.py +0 -0
  126. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/params/v1_ai_photo_editor_create_body.py +0 -0
  127. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/params/v1_ai_photo_editor_create_body_assets.py +0 -0
  128. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/params/v1_ai_photo_editor_create_body_style.py +0 -0
  129. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/params/v1_ai_qr_code_generator_create_body.py +0 -0
  130. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/params/v1_ai_qr_code_generator_create_body_style.py +0 -0
  131. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/params/v1_ai_talking_photo_create_body.py +0 -0
  132. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/params/v1_ai_talking_photo_create_body_assets.py +0 -0
  133. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/params/v1_animation_create_body.py +0 -0
  134. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/params/v1_animation_create_body_assets.py +0 -0
  135. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/params/v1_animation_create_body_style.py +0 -0
  136. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/params/v1_face_swap_create_body.py +0 -0
  137. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/params/v1_face_swap_create_body_assets.py +0 -0
  138. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/params/v1_face_swap_photo_create_body.py +0 -0
  139. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/params/v1_face_swap_photo_create_body_assets.py +0 -0
  140. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/params/v1_files_upload_urls_create_body.py +0 -0
  141. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/params/v1_files_upload_urls_create_body_items_item.py +0 -0
  142. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/params/v1_image_background_remover_create_body.py +0 -0
  143. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/params/v1_image_background_remover_create_body_assets.py +0 -0
  144. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/params/v1_image_to_video_create_body.py +0 -0
  145. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/params/v1_image_to_video_create_body_assets.py +0 -0
  146. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/params/v1_image_to_video_create_body_style.py +0 -0
  147. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/params/v1_lip_sync_create_body_assets.py +0 -0
  148. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/params/v1_text_to_video_create_body.py +0 -0
  149. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/params/v1_text_to_video_create_body_style.py +0 -0
  150. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/params/v1_video_to_video_create_body.py +0 -0
  151. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/params/v1_video_to_video_create_body_assets.py +0 -0
  152. {magic_hour-0.15.0 → magic_hour-0.16.1}/magic_hour/types/params/v1_video_to_video_create_body_style.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: magic_hour
3
- Version: 0.15.0
3
+ Version: 0.16.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
@@ -63,6 +63,10 @@ client = AsyncClient(token="my api key")
63
63
 
64
64
  * [create](magic_hour/resources/v1/ai_clothes_changer/README.md#create) - AI Clothes Changer
65
65
 
66
+ ### [v1.ai_face_editor](magic_hour/resources/v1/ai_face_editor/README.md)
67
+
68
+ * [create](magic_hour/resources/v1/ai_face_editor/README.md#create) - AI Face Editor
69
+
66
70
  ### [v1.ai_headshot_generator](magic_hour/resources/v1/ai_headshot_generator/README.md)
67
71
 
68
72
  * [create](magic_hour/resources/v1/ai_headshot_generator/README.md#create) - AI Headshots
@@ -45,6 +45,10 @@ client = AsyncClient(token="my api key")
45
45
 
46
46
  * [create](magic_hour/resources/v1/ai_clothes_changer/README.md#create) - AI Clothes Changer
47
47
 
48
+ ### [v1.ai_face_editor](magic_hour/resources/v1/ai_face_editor/README.md)
49
+
50
+ * [create](magic_hour/resources/v1/ai_face_editor/README.md#create) - AI Face Editor
51
+
48
52
  ### [v1.ai_headshot_generator](magic_hour/resources/v1/ai_headshot_generator/README.md)
49
53
 
50
54
  * [create](magic_hour/resources/v1/ai_headshot_generator/README.md#create) - AI Headshots
@@ -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.15.0"
8
+ MOCK_SERVER = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.16.1"
@@ -0,0 +1,67 @@
1
+
2
+ ### create <a name="create"></a>
3
+ AI Face Editor
4
+
5
+ Edit facial features of an image using AI. Each edit costs 1 frame. The height/width of the output image depends on your subscription. Please refer to our [pricing](/pricing) page for more details
6
+
7
+ **API Endpoint**: `POST /v1/ai-face-editor`
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_face_editor.create(
17
+ assets={"image_file_path": "api-assets/id/1234.png"},
18
+ style={
19
+ "enhance_face": False,
20
+ "eye_gaze_horizontal": 0.0,
21
+ "eye_gaze_vertical": 0.0,
22
+ "eye_open_ratio": 0.0,
23
+ "eyebrow_direction": 0.0,
24
+ "head_pitch": 0.0,
25
+ "head_roll": 0.0,
26
+ "head_yaw": 0.0,
27
+ "lip_open_ratio": 0.0,
28
+ "mouth_grim": 0.0,
29
+ "mouth_position_horizontal": 0.0,
30
+ "mouth_position_vertical": 0.0,
31
+ "mouth_pout": 0.0,
32
+ "mouth_purse": 0.0,
33
+ "mouth_smile": 0.0,
34
+ },
35
+ name="Face Editor image",
36
+ )
37
+ ```
38
+
39
+ #### Asynchronous Client
40
+
41
+ ```python
42
+ from magic_hour import AsyncClient
43
+ from os import getenv
44
+
45
+ client = AsyncClient(token=getenv("API_TOKEN"))
46
+ res = await client.v1.ai_face_editor.create(
47
+ assets={"image_file_path": "api-assets/id/1234.png"},
48
+ style={
49
+ "enhance_face": False,
50
+ "eye_gaze_horizontal": 0.0,
51
+ "eye_gaze_vertical": 0.0,
52
+ "eye_open_ratio": 0.0,
53
+ "eyebrow_direction": 0.0,
54
+ "head_pitch": 0.0,
55
+ "head_roll": 0.0,
56
+ "head_yaw": 0.0,
57
+ "lip_open_ratio": 0.0,
58
+ "mouth_grim": 0.0,
59
+ "mouth_position_horizontal": 0.0,
60
+ "mouth_position_vertical": 0.0,
61
+ "mouth_pout": 0.0,
62
+ "mouth_purse": 0.0,
63
+ "mouth_smile": 0.0,
64
+ },
65
+ name="Face Editor image",
66
+ )
67
+ ```
@@ -0,0 +1,4 @@
1
+ from .client import AiFaceEditorClient, AsyncAiFaceEditorClient
2
+
3
+
4
+ __all__ = ["AiFaceEditorClient", "AsyncAiFaceEditorClient"]
@@ -0,0 +1,157 @@
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 AiFaceEditorClient:
15
+ def __init__(self, *, base_client: SyncBaseClient):
16
+ self._base_client = base_client
17
+
18
+ def create(
19
+ self,
20
+ *,
21
+ assets: params.V1AiFaceEditorCreateBodyAssets,
22
+ style: params.V1AiFaceEditorCreateBodyStyle,
23
+ name: typing.Union[
24
+ typing.Optional[str], type_utils.NotGiven
25
+ ] = type_utils.NOT_GIVEN,
26
+ request_options: typing.Optional[RequestOptions] = None,
27
+ ) -> models.V1AiFaceEditorCreateResponse:
28
+ """
29
+ AI Face Editor
30
+
31
+ Edit facial features of an image using AI. Each edit costs 1 frame. The height/width of the output image depends on your subscription. Please refer to our [pricing](/pricing) page for more details
32
+
33
+ POST /v1/ai-face-editor
34
+
35
+ Args:
36
+ name: The name of image
37
+ assets: Provide the assets for face editor
38
+ style: Face editing parameters
39
+ request_options: Additional options to customize the HTTP request
40
+
41
+ Returns:
42
+ Success
43
+
44
+ Raises:
45
+ ApiError: A custom exception class that provides additional context
46
+ for API errors, including the HTTP status code and response body.
47
+
48
+ Examples:
49
+ ```py
50
+ client.v1.ai_face_editor.create(
51
+ assets={"image_file_path": "api-assets/id/1234.png"},
52
+ style={
53
+ "enhance_face": False,
54
+ "eye_gaze_horizontal": 0.0,
55
+ "eye_gaze_vertical": 0.0,
56
+ "eye_open_ratio": 0.0,
57
+ "eyebrow_direction": 0.0,
58
+ "head_pitch": 0.0,
59
+ "head_roll": 0.0,
60
+ "head_yaw": 0.0,
61
+ "lip_open_ratio": 0.0,
62
+ "mouth_grim": 0.0,
63
+ "mouth_position_horizontal": 0.0,
64
+ "mouth_position_vertical": 0.0,
65
+ "mouth_pout": 0.0,
66
+ "mouth_purse": 0.0,
67
+ "mouth_smile": 0.0,
68
+ },
69
+ name="Face Editor image",
70
+ )
71
+ ```
72
+ """
73
+ _json = to_encodable(
74
+ item={"name": name, "assets": assets, "style": style},
75
+ dump_with=params._SerializerV1AiFaceEditorCreateBody,
76
+ )
77
+ return self._base_client.request(
78
+ method="POST",
79
+ path="/v1/ai-face-editor",
80
+ auth_names=["bearerAuth"],
81
+ json=_json,
82
+ cast_to=models.V1AiFaceEditorCreateResponse,
83
+ request_options=request_options or default_request_options(),
84
+ )
85
+
86
+
87
+ class AsyncAiFaceEditorClient:
88
+ def __init__(self, *, base_client: AsyncBaseClient):
89
+ self._base_client = base_client
90
+
91
+ async def create(
92
+ self,
93
+ *,
94
+ assets: params.V1AiFaceEditorCreateBodyAssets,
95
+ style: params.V1AiFaceEditorCreateBodyStyle,
96
+ name: typing.Union[
97
+ typing.Optional[str], type_utils.NotGiven
98
+ ] = type_utils.NOT_GIVEN,
99
+ request_options: typing.Optional[RequestOptions] = None,
100
+ ) -> models.V1AiFaceEditorCreateResponse:
101
+ """
102
+ AI Face Editor
103
+
104
+ Edit facial features of an image using AI. Each edit costs 1 frame. The height/width of the output image depends on your subscription. Please refer to our [pricing](/pricing) page for more details
105
+
106
+ POST /v1/ai-face-editor
107
+
108
+ Args:
109
+ name: The name of image
110
+ assets: Provide the assets for face editor
111
+ style: Face editing parameters
112
+ request_options: Additional options to customize the HTTP request
113
+
114
+ Returns:
115
+ Success
116
+
117
+ Raises:
118
+ ApiError: A custom exception class that provides additional context
119
+ for API errors, including the HTTP status code and response body.
120
+
121
+ Examples:
122
+ ```py
123
+ await client.v1.ai_face_editor.create(
124
+ assets={"image_file_path": "api-assets/id/1234.png"},
125
+ style={
126
+ "enhance_face": False,
127
+ "eye_gaze_horizontal": 0.0,
128
+ "eye_gaze_vertical": 0.0,
129
+ "eye_open_ratio": 0.0,
130
+ "eyebrow_direction": 0.0,
131
+ "head_pitch": 0.0,
132
+ "head_roll": 0.0,
133
+ "head_yaw": 0.0,
134
+ "lip_open_ratio": 0.0,
135
+ "mouth_grim": 0.0,
136
+ "mouth_position_horizontal": 0.0,
137
+ "mouth_position_vertical": 0.0,
138
+ "mouth_pout": 0.0,
139
+ "mouth_purse": 0.0,
140
+ "mouth_smile": 0.0,
141
+ },
142
+ name="Face Editor image",
143
+ )
144
+ ```
145
+ """
146
+ _json = to_encodable(
147
+ item={"name": name, "assets": assets, "style": style},
148
+ dump_with=params._SerializerV1AiFaceEditorCreateBody,
149
+ )
150
+ return await self._base_client.request(
151
+ method="POST",
152
+ path="/v1/ai-face-editor",
153
+ auth_names=["bearerAuth"],
154
+ json=_json,
155
+ cast_to=models.V1AiFaceEditorCreateResponse,
156
+ request_options=request_options or default_request_options(),
157
+ )
@@ -3,6 +3,10 @@ from magic_hour.resources.v1.ai_clothes_changer import (
3
3
  AiClothesChangerClient,
4
4
  AsyncAiClothesChangerClient,
5
5
  )
6
+ from magic_hour.resources.v1.ai_face_editor import (
7
+ AiFaceEditorClient,
8
+ AsyncAiFaceEditorClient,
9
+ )
6
10
  from magic_hour.resources.v1.ai_headshot_generator import (
7
11
  AiHeadshotGeneratorClient,
8
12
  AsyncAiHeadshotGeneratorClient,
@@ -71,6 +75,7 @@ class V1Client:
71
75
  self.image_projects = ImageProjectsClient(base_client=self._base_client)
72
76
  self.video_projects = VideoProjectsClient(base_client=self._base_client)
73
77
  self.ai_clothes_changer = AiClothesChangerClient(base_client=self._base_client)
78
+ self.ai_face_editor = AiFaceEditorClient(base_client=self._base_client)
74
79
  self.ai_headshot_generator = AiHeadshotGeneratorClient(
75
80
  base_client=self._base_client
76
81
  )
@@ -103,6 +108,7 @@ class AsyncV1Client:
103
108
  self.ai_clothes_changer = AsyncAiClothesChangerClient(
104
109
  base_client=self._base_client
105
110
  )
111
+ self.ai_face_editor = AsyncAiFaceEditorClient(base_client=self._base_client)
106
112
  self.ai_headshot_generator = AsyncAiHeadshotGeneratorClient(
107
113
  base_client=self._base_client
108
114
  )
@@ -20,15 +20,19 @@ class LipSyncClient:
20
20
  *,
21
21
  assets: params.V1LipSyncCreateBodyAssets,
22
22
  end_seconds: float,
23
- height: int,
24
23
  start_seconds: float,
25
- width: int,
24
+ height: typing.Union[
25
+ typing.Optional[int], type_utils.NotGiven
26
+ ] = type_utils.NOT_GIVEN,
26
27
  max_fps_limit: typing.Union[
27
28
  typing.Optional[float], type_utils.NotGiven
28
29
  ] = type_utils.NOT_GIVEN,
29
30
  name: typing.Union[
30
31
  typing.Optional[str], type_utils.NotGiven
31
32
  ] = type_utils.NOT_GIVEN,
33
+ width: typing.Union[
34
+ typing.Optional[int], type_utils.NotGiven
35
+ ] = type_utils.NOT_GIVEN,
32
36
  request_options: typing.Optional[RequestOptions] = None,
33
37
  ) -> models.V1LipSyncCreateResponse:
34
38
  """
@@ -42,13 +46,27 @@ class LipSyncClient:
42
46
  POST /v1/lip-sync
43
47
 
44
48
  Args:
49
+ height: Used to determine the dimensions of the output video.
50
+
51
+ * 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.
52
+ * If both height and width are omitted, the video will be resized according to your subscription's maximum resolution, while preserving aspect ratio.
53
+
54
+ Note: if the video's original resolution is less than the maximum, the video will not be resized.
55
+
56
+ See our [pricing page](https://magichour.ai/pricing) for more details.
45
57
  max_fps_limit: Defines the maximum FPS (frames per second) for the output video. If the input video's FPS is lower than this limit, the output video will retain the input FPS. This is useful for reducing unnecessary frame usage in scenarios where high FPS is not required.
46
58
  name: The name of video
59
+ width: Used to determine the dimensions of the output video.
60
+
61
+ * 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.
62
+ * If both height and width are omitted, the video will be resized according to your subscription's maximum resolution, while preserving aspect ratio.
63
+
64
+ Note: if the video's original resolution is less than the maximum, the video will not be resized.
65
+
66
+ See our [pricing page](https://magichour.ai/pricing) for more details.
47
67
  assets: Provide the assets for lip-sync. For video, The `video_source` field determines whether `video_file_path` or `youtube_url` field is used
48
68
  end_seconds: The end time of the input video in seconds
49
- height: 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
50
69
  start_seconds: The start time of the input video in seconds
51
- width: 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
52
70
  request_options: Additional options to customize the HTTP request
53
71
 
54
72
  Returns:
@@ -67,23 +85,23 @@ class LipSyncClient:
67
85
  "video_source": "file",
68
86
  },
69
87
  end_seconds=15.0,
70
- height=960,
71
88
  start_seconds=0.0,
72
- width=512,
89
+ height=960,
73
90
  max_fps_limit=12.0,
74
91
  name="Lip Sync video",
92
+ width=512,
75
93
  )
76
94
  ```
77
95
  """
78
96
  _json = to_encodable(
79
97
  item={
98
+ "height": height,
80
99
  "max_fps_limit": max_fps_limit,
81
100
  "name": name,
101
+ "width": width,
82
102
  "assets": assets,
83
103
  "end_seconds": end_seconds,
84
- "height": height,
85
104
  "start_seconds": start_seconds,
86
- "width": width,
87
105
  },
88
106
  dump_with=params._SerializerV1LipSyncCreateBody,
89
107
  )
@@ -106,15 +124,19 @@ class AsyncLipSyncClient:
106
124
  *,
107
125
  assets: params.V1LipSyncCreateBodyAssets,
108
126
  end_seconds: float,
109
- height: int,
110
127
  start_seconds: float,
111
- width: int,
128
+ height: typing.Union[
129
+ typing.Optional[int], type_utils.NotGiven
130
+ ] = type_utils.NOT_GIVEN,
112
131
  max_fps_limit: typing.Union[
113
132
  typing.Optional[float], type_utils.NotGiven
114
133
  ] = type_utils.NOT_GIVEN,
115
134
  name: typing.Union[
116
135
  typing.Optional[str], type_utils.NotGiven
117
136
  ] = type_utils.NOT_GIVEN,
137
+ width: typing.Union[
138
+ typing.Optional[int], type_utils.NotGiven
139
+ ] = type_utils.NOT_GIVEN,
118
140
  request_options: typing.Optional[RequestOptions] = None,
119
141
  ) -> models.V1LipSyncCreateResponse:
120
142
  """
@@ -128,13 +150,27 @@ class AsyncLipSyncClient:
128
150
  POST /v1/lip-sync
129
151
 
130
152
  Args:
153
+ height: Used to determine the dimensions of the output video.
154
+
155
+ * 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.
156
+ * If both height and width are omitted, the video will be resized according to your subscription's maximum resolution, while preserving aspect ratio.
157
+
158
+ Note: if the video's original resolution is less than the maximum, the video will not be resized.
159
+
160
+ See our [pricing page](https://magichour.ai/pricing) for more details.
131
161
  max_fps_limit: Defines the maximum FPS (frames per second) for the output video. If the input video's FPS is lower than this limit, the output video will retain the input FPS. This is useful for reducing unnecessary frame usage in scenarios where high FPS is not required.
132
162
  name: The name of video
163
+ width: Used to determine the dimensions of the output video.
164
+
165
+ * 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
+ * If both height and width are omitted, the video will be resized according to your subscription's maximum resolution, while preserving aspect ratio.
167
+
168
+ Note: if the video's original resolution is less than the maximum, the video will not be resized.
169
+
170
+ See our [pricing page](https://magichour.ai/pricing) for more details.
133
171
  assets: Provide the assets for lip-sync. For video, The `video_source` field determines whether `video_file_path` or `youtube_url` field is used
134
172
  end_seconds: The end time of the input video in seconds
135
- height: 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
136
173
  start_seconds: The start time of the input video in seconds
137
- width: 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
138
174
  request_options: Additional options to customize the HTTP request
139
175
 
140
176
  Returns:
@@ -153,23 +189,23 @@ class AsyncLipSyncClient:
153
189
  "video_source": "file",
154
190
  },
155
191
  end_seconds=15.0,
156
- height=960,
157
192
  start_seconds=0.0,
158
- width=512,
193
+ height=960,
159
194
  max_fps_limit=12.0,
160
195
  name="Lip Sync video",
196
+ width=512,
161
197
  )
162
198
  ```
163
199
  """
164
200
  _json = to_encodable(
165
201
  item={
202
+ "height": height,
166
203
  "max_fps_limit": max_fps_limit,
167
204
  "name": name,
205
+ "width": width,
168
206
  "assets": assets,
169
207
  "end_seconds": end_seconds,
170
- "height": height,
171
208
  "start_seconds": start_seconds,
172
- "width": width,
173
209
  },
174
210
  dump_with=params._SerializerV1LipSyncCreateBody,
175
211
  )
@@ -1,4 +1,5 @@
1
1
  from .v1_ai_clothes_changer_create_response import V1AiClothesChangerCreateResponse
2
+ from .v1_ai_face_editor_create_response import V1AiFaceEditorCreateResponse
2
3
  from .v1_ai_headshot_generator_create_response import (
3
4
  V1AiHeadshotGeneratorCreateResponse,
4
5
  )
@@ -37,6 +38,7 @@ from .v1_video_to_video_create_response import V1VideoToVideoCreateResponse
37
38
 
38
39
  __all__ = [
39
40
  "V1AiClothesChangerCreateResponse",
41
+ "V1AiFaceEditorCreateResponse",
40
42
  "V1AiHeadshotGeneratorCreateResponse",
41
43
  "V1AiImageGeneratorCreateResponse",
42
44
  "V1AiImageUpscalerCreateResponse",
@@ -0,0 +1,25 @@
1
+ import pydantic
2
+
3
+
4
+ class V1AiFaceEditorCreateResponse(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
+ frame_cost: int = pydantic.Field(
15
+ alias="frame_cost",
16
+ )
17
+ """
18
+ The frame cost of the image generation
19
+ """
20
+ id: str = pydantic.Field(
21
+ alias="id",
22
+ )
23
+ """
24
+ Unique ID of the image. This value can be used in the [get image project API](https://docs.magichour.ai/api-reference/image-projects/get-image-details) to fetch additional details such as status
25
+ """
@@ -6,6 +6,18 @@ from .v1_ai_clothes_changer_create_body_assets import (
6
6
  V1AiClothesChangerCreateBodyAssets,
7
7
  _SerializerV1AiClothesChangerCreateBodyAssets,
8
8
  )
9
+ from .v1_ai_face_editor_create_body import (
10
+ V1AiFaceEditorCreateBody,
11
+ _SerializerV1AiFaceEditorCreateBody,
12
+ )
13
+ from .v1_ai_face_editor_create_body_assets import (
14
+ V1AiFaceEditorCreateBodyAssets,
15
+ _SerializerV1AiFaceEditorCreateBodyAssets,
16
+ )
17
+ from .v1_ai_face_editor_create_body_style import (
18
+ V1AiFaceEditorCreateBodyStyle,
19
+ _SerializerV1AiFaceEditorCreateBodyStyle,
20
+ )
9
21
  from .v1_ai_headshot_generator_create_body import (
10
22
  V1AiHeadshotGeneratorCreateBody,
11
23
  _SerializerV1AiHeadshotGeneratorCreateBody,
@@ -160,6 +172,9 @@ from .v1_video_to_video_create_body_style import (
160
172
  __all__ = [
161
173
  "V1AiClothesChangerCreateBody",
162
174
  "V1AiClothesChangerCreateBodyAssets",
175
+ "V1AiFaceEditorCreateBody",
176
+ "V1AiFaceEditorCreateBodyAssets",
177
+ "V1AiFaceEditorCreateBodyStyle",
163
178
  "V1AiHeadshotGeneratorCreateBody",
164
179
  "V1AiHeadshotGeneratorCreateBodyAssets",
165
180
  "V1AiHeadshotGeneratorCreateBodyStyle",
@@ -200,6 +215,9 @@ __all__ = [
200
215
  "V1VideoToVideoCreateBodyStyle",
201
216
  "_SerializerV1AiClothesChangerCreateBody",
202
217
  "_SerializerV1AiClothesChangerCreateBodyAssets",
218
+ "_SerializerV1AiFaceEditorCreateBody",
219
+ "_SerializerV1AiFaceEditorCreateBodyAssets",
220
+ "_SerializerV1AiFaceEditorCreateBodyStyle",
203
221
  "_SerializerV1AiHeadshotGeneratorCreateBody",
204
222
  "_SerializerV1AiHeadshotGeneratorCreateBodyAssets",
205
223
  "_SerializerV1AiHeadshotGeneratorCreateBodyStyle",
@@ -0,0 +1,52 @@
1
+ import pydantic
2
+ import typing
3
+ import typing_extensions
4
+
5
+ from .v1_ai_face_editor_create_body_assets import (
6
+ V1AiFaceEditorCreateBodyAssets,
7
+ _SerializerV1AiFaceEditorCreateBodyAssets,
8
+ )
9
+ from .v1_ai_face_editor_create_body_style import (
10
+ V1AiFaceEditorCreateBodyStyle,
11
+ _SerializerV1AiFaceEditorCreateBodyStyle,
12
+ )
13
+
14
+
15
+ class V1AiFaceEditorCreateBody(typing_extensions.TypedDict):
16
+ """
17
+ V1AiFaceEditorCreateBody
18
+ """
19
+
20
+ assets: typing_extensions.Required[V1AiFaceEditorCreateBodyAssets]
21
+ """
22
+ Provide the assets for face editor
23
+ """
24
+
25
+ name: typing_extensions.NotRequired[str]
26
+ """
27
+ The name of image
28
+ """
29
+
30
+ style: typing_extensions.Required[V1AiFaceEditorCreateBodyStyle]
31
+ """
32
+ Face editing parameters
33
+ """
34
+
35
+
36
+ class _SerializerV1AiFaceEditorCreateBody(pydantic.BaseModel):
37
+ """
38
+ Serializer for V1AiFaceEditorCreateBody handling case conversions
39
+ and file omissions as dictated by the API
40
+ """
41
+
42
+ model_config = pydantic.ConfigDict(
43
+ populate_by_name=True,
44
+ )
45
+
46
+ assets: _SerializerV1AiFaceEditorCreateBodyAssets = pydantic.Field(
47
+ alias="assets",
48
+ )
49
+ name: typing.Optional[str] = pydantic.Field(alias="name", default=None)
50
+ style: _SerializerV1AiFaceEditorCreateBodyStyle = pydantic.Field(
51
+ alias="style",
52
+ )
@@ -0,0 +1,28 @@
1
+ import pydantic
2
+ import typing_extensions
3
+
4
+
5
+ class V1AiFaceEditorCreateBodyAssets(typing_extensions.TypedDict):
6
+ """
7
+ Provide the assets for face editor
8
+ """
9
+
10
+ image_file_path: typing_extensions.Required[str]
11
+ """
12
+ This is the image whose face will be edited. 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
+
16
+ class _SerializerV1AiFaceEditorCreateBodyAssets(pydantic.BaseModel):
17
+ """
18
+ Serializer for V1AiFaceEditorCreateBodyAssets handling case conversions
19
+ and file omissions as dictated by the API
20
+ """
21
+
22
+ model_config = pydantic.ConfigDict(
23
+ populate_by_name=True,
24
+ )
25
+
26
+ image_file_path: str = pydantic.Field(
27
+ alias="image_file_path",
28
+ )