magic_hour 0.12.1__tar.gz → 0.13.0__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 (145) hide show
  1. {magic_hour-0.12.1 → magic_hour-0.13.0}/PKG-INFO +5 -1
  2. {magic_hour-0.12.1 → magic_hour-0.13.0}/README.md +4 -0
  3. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/environment.py +1 -1
  4. magic_hour-0.13.0/magic_hour/resources/v1/ai_meme_generator/README.md +41 -0
  5. magic_hour-0.13.0/magic_hour/resources/v1/ai_meme_generator/__init__.py +4 -0
  6. magic_hour-0.13.0/magic_hour/resources/v1/ai_meme_generator/client.py +127 -0
  7. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/ai_photo_editor/client.py +4 -0
  8. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/animation/client.py +10 -2
  9. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/client.py +8 -0
  10. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/face_swap/client.py +10 -2
  11. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/image_to_video/README.md +2 -2
  12. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/lip_sync/client.py +2 -0
  13. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/video_to_video/README.md +2 -2
  14. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/video_to_video/client.py +8 -2
  15. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/models/__init__.py +2 -0
  16. magic_hour-0.13.0/magic_hour/types/models/v1_ai_meme_generator_create_response.py +25 -0
  17. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/models/v1_image_projects_get_response.py +4 -10
  18. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/models/v1_video_projects_get_response.py +4 -10
  19. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/params/__init__.py +12 -0
  20. magic_hour-0.13.0/magic_hour/types/params/v1_ai_meme_generator_create_body.py +37 -0
  21. magic_hour-0.13.0/magic_hour/types/params/v1_ai_meme_generator_create_body_style.py +73 -0
  22. {magic_hour-0.12.1 → magic_hour-0.13.0}/pyproject.toml +1 -1
  23. {magic_hour-0.12.1 → magic_hour-0.13.0}/LICENSE +0 -0
  24. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/__init__.py +0 -0
  25. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/client.py +0 -0
  26. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/core/__init__.py +0 -0
  27. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/core/api_error.py +0 -0
  28. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/core/auth.py +0 -0
  29. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/core/base_client.py +0 -0
  30. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/core/binary_response.py +0 -0
  31. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/core/query.py +0 -0
  32. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/core/request.py +0 -0
  33. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/core/response.py +0 -0
  34. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/core/type_utils.py +0 -0
  35. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/core/utils.py +0 -0
  36. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/__init__.py +0 -0
  37. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/ai_clothes_changer/README.md +0 -0
  38. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/ai_clothes_changer/__init__.py +0 -0
  39. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/ai_clothes_changer/client.py +0 -0
  40. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/ai_headshot_generator/README.md +0 -0
  41. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/ai_headshot_generator/__init__.py +0 -0
  42. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/ai_headshot_generator/client.py +0 -0
  43. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/ai_image_generator/README.md +0 -0
  44. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/ai_image_generator/__init__.py +0 -0
  45. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/ai_image_generator/client.py +0 -0
  46. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/ai_image_upscaler/README.md +0 -0
  47. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/ai_image_upscaler/__init__.py +0 -0
  48. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/ai_image_upscaler/client.py +0 -0
  49. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/ai_photo_editor/README.md +0 -0
  50. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/ai_photo_editor/__init__.py +0 -0
  51. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/ai_qr_code_generator/README.md +0 -0
  52. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/ai_qr_code_generator/__init__.py +0 -0
  53. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/ai_qr_code_generator/client.py +0 -0
  54. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/ai_talking_photo/README.md +0 -0
  55. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/ai_talking_photo/__init__.py +0 -0
  56. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/ai_talking_photo/client.py +0 -0
  57. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/animation/README.md +0 -0
  58. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/animation/__init__.py +0 -0
  59. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/face_swap/README.md +0 -0
  60. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/face_swap/__init__.py +0 -0
  61. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/face_swap_photo/README.md +0 -0
  62. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/face_swap_photo/__init__.py +0 -0
  63. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/face_swap_photo/client.py +0 -0
  64. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/files/__init__.py +0 -0
  65. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/files/client.py +0 -0
  66. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/files/upload_urls/README.md +0 -0
  67. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/files/upload_urls/__init__.py +0 -0
  68. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/files/upload_urls/client.py +0 -0
  69. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/image_background_remover/README.md +0 -0
  70. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/image_background_remover/__init__.py +0 -0
  71. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/image_background_remover/client.py +0 -0
  72. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/image_projects/README.md +0 -0
  73. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/image_projects/__init__.py +0 -0
  74. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/image_projects/client.py +0 -0
  75. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/image_to_video/__init__.py +0 -0
  76. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/image_to_video/client.py +0 -0
  77. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/lip_sync/README.md +0 -0
  78. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/lip_sync/__init__.py +0 -0
  79. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/text_to_video/README.md +0 -0
  80. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/text_to_video/__init__.py +0 -0
  81. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/text_to_video/client.py +0 -0
  82. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/video_projects/README.md +0 -0
  83. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/video_projects/__init__.py +0 -0
  84. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/video_projects/client.py +0 -0
  85. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/resources/v1/video_to_video/__init__.py +0 -0
  86. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/models/v1_ai_clothes_changer_create_response.py +0 -0
  87. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/models/v1_ai_headshot_generator_create_response.py +0 -0
  88. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/models/v1_ai_image_generator_create_response.py +0 -0
  89. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/models/v1_ai_image_upscaler_create_response.py +0 -0
  90. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/models/v1_ai_photo_editor_create_response.py +0 -0
  91. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/models/v1_ai_qr_code_generator_create_response.py +0 -0
  92. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/models/v1_ai_talking_photo_create_response.py +0 -0
  93. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/models/v1_animation_create_response.py +0 -0
  94. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/models/v1_face_swap_create_response.py +0 -0
  95. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/models/v1_face_swap_photo_create_response.py +0 -0
  96. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/models/v1_files_upload_urls_create_response.py +0 -0
  97. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/models/v1_files_upload_urls_create_response_items_item.py +0 -0
  98. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/models/v1_image_background_remover_create_response.py +0 -0
  99. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/models/v1_image_projects_get_response_downloads_item.py +0 -0
  100. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/models/v1_image_projects_get_response_error.py +0 -0
  101. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/models/v1_image_to_video_create_response.py +0 -0
  102. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/models/v1_lip_sync_create_response.py +0 -0
  103. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/models/v1_text_to_video_create_response.py +0 -0
  104. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/models/v1_video_projects_get_response_download.py +0 -0
  105. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/models/v1_video_projects_get_response_downloads_item.py +0 -0
  106. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/models/v1_video_projects_get_response_error.py +0 -0
  107. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/models/v1_video_to_video_create_response.py +0 -0
  108. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/params/v1_ai_clothes_changer_create_body.py +0 -0
  109. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/params/v1_ai_clothes_changer_create_body_assets.py +0 -0
  110. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/params/v1_ai_headshot_generator_create_body.py +0 -0
  111. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/params/v1_ai_headshot_generator_create_body_assets.py +0 -0
  112. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/params/v1_ai_headshot_generator_create_body_style.py +0 -0
  113. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/params/v1_ai_image_generator_create_body.py +0 -0
  114. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/params/v1_ai_image_generator_create_body_style.py +0 -0
  115. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/params/v1_ai_image_upscaler_create_body.py +0 -0
  116. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/params/v1_ai_image_upscaler_create_body_assets.py +0 -0
  117. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/params/v1_ai_image_upscaler_create_body_style.py +0 -0
  118. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/params/v1_ai_photo_editor_create_body.py +0 -0
  119. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/params/v1_ai_photo_editor_create_body_assets.py +0 -0
  120. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/params/v1_ai_photo_editor_create_body_style.py +0 -0
  121. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/params/v1_ai_qr_code_generator_create_body.py +0 -0
  122. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/params/v1_ai_qr_code_generator_create_body_style.py +0 -0
  123. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/params/v1_ai_talking_photo_create_body.py +0 -0
  124. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/params/v1_ai_talking_photo_create_body_assets.py +0 -0
  125. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/params/v1_animation_create_body.py +0 -0
  126. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/params/v1_animation_create_body_assets.py +0 -0
  127. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/params/v1_animation_create_body_style.py +0 -0
  128. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/params/v1_face_swap_create_body.py +0 -0
  129. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/params/v1_face_swap_create_body_assets.py +0 -0
  130. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/params/v1_face_swap_photo_create_body.py +0 -0
  131. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/params/v1_face_swap_photo_create_body_assets.py +0 -0
  132. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/params/v1_files_upload_urls_create_body.py +0 -0
  133. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/params/v1_files_upload_urls_create_body_items_item.py +0 -0
  134. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/params/v1_image_background_remover_create_body.py +0 -0
  135. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/params/v1_image_background_remover_create_body_assets.py +0 -0
  136. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/params/v1_image_to_video_create_body.py +0 -0
  137. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/params/v1_image_to_video_create_body_assets.py +0 -0
  138. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/params/v1_image_to_video_create_body_style.py +0 -0
  139. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/params/v1_lip_sync_create_body.py +0 -0
  140. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/params/v1_lip_sync_create_body_assets.py +0 -0
  141. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/params/v1_text_to_video_create_body.py +0 -0
  142. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/params/v1_text_to_video_create_body_style.py +0 -0
  143. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/params/v1_video_to_video_create_body.py +0 -0
  144. {magic_hour-0.12.1 → magic_hour-0.13.0}/magic_hour/types/params/v1_video_to_video_create_body_assets.py +0 -0
  145. {magic_hour-0.12.1 → magic_hour-0.13.0}/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.12.1
3
+ Version: 0.13.0
4
4
  Summary: Python SDK for Magic Hour API
5
5
  Requires-Python: >=3.8,<4.0
6
6
  Classifier: Programming Language :: Python :: 3
@@ -75,6 +75,10 @@ client = AsyncClient(token="my api key")
75
75
 
76
76
  * [create](magic_hour/resources/v1/ai_image_upscaler/README.md#create) - AI Image Upscaler
77
77
 
78
+ ### [v1.ai_meme_generator](magic_hour/resources/v1/ai_meme_generator/README.md)
79
+
80
+ * [create](magic_hour/resources/v1/ai_meme_generator/README.md#create) - AI Meme Generator
81
+
78
82
  ### [v1.ai_photo_editor](magic_hour/resources/v1/ai_photo_editor/README.md)
79
83
 
80
84
  * [create](magic_hour/resources/v1/ai_photo_editor/README.md#create) - AI Photo Editor
@@ -57,6 +57,10 @@ client = AsyncClient(token="my api key")
57
57
 
58
58
  * [create](magic_hour/resources/v1/ai_image_upscaler/README.md#create) - AI Image Upscaler
59
59
 
60
+ ### [v1.ai_meme_generator](magic_hour/resources/v1/ai_meme_generator/README.md)
61
+
62
+ * [create](magic_hour/resources/v1/ai_meme_generator/README.md#create) - AI Meme Generator
63
+
60
64
  ### [v1.ai_photo_editor](magic_hour/resources/v1/ai_photo_editor/README.md)
61
65
 
62
66
  * [create](magic_hour/resources/v1/ai_photo_editor/README.md#create) - AI Photo Editor
@@ -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.12.1"
8
+ MOCK_SERVER = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.13.0"
@@ -0,0 +1,41 @@
1
+
2
+ ### create <a name="create"></a>
3
+ AI Meme Generator
4
+
5
+ Create an AI generated meme. Each meme costs 10 frames.
6
+
7
+ **API Endpoint**: `POST /v1/ai-meme-generator`
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_meme_generator.create(
17
+ style={
18
+ "search_web": False,
19
+ "template": "Drake Hotline Bling",
20
+ "topic": "When the code finally works",
21
+ },
22
+ name="My Funny Meme",
23
+ )
24
+ ```
25
+
26
+ #### Asynchronous Client
27
+
28
+ ```python
29
+ from magic_hour import AsyncClient
30
+ from os import getenv
31
+
32
+ client = AsyncClient(token=getenv("API_TOKEN"))
33
+ res = await client.v1.ai_meme_generator.create(
34
+ style={
35
+ "search_web": False,
36
+ "template": "Drake Hotline Bling",
37
+ "topic": "When the code finally works",
38
+ },
39
+ name="My Funny Meme",
40
+ )
41
+ ```
@@ -0,0 +1,4 @@
1
+ from .client import AiMemeGeneratorClient, AsyncAiMemeGeneratorClient
2
+
3
+
4
+ __all__ = ["AiMemeGeneratorClient", "AsyncAiMemeGeneratorClient"]
@@ -0,0 +1,127 @@
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 AiMemeGeneratorClient:
15
+ def __init__(self, *, base_client: SyncBaseClient):
16
+ self._base_client = base_client
17
+
18
+ def create(
19
+ self,
20
+ *,
21
+ style: params.V1AiMemeGeneratorCreateBodyStyle,
22
+ name: typing.Union[
23
+ typing.Optional[str], type_utils.NotGiven
24
+ ] = type_utils.NOT_GIVEN,
25
+ request_options: typing.Optional[RequestOptions] = None,
26
+ ) -> models.V1AiMemeGeneratorCreateResponse:
27
+ """
28
+ AI Meme Generator
29
+
30
+ Create an AI generated meme. Each meme costs 10 frames.
31
+
32
+ POST /v1/ai-meme-generator
33
+
34
+ Args:
35
+ name: The name of the meme.
36
+ style: V1AiMemeGeneratorCreateBodyStyle
37
+ request_options: Additional options to customize the HTTP request
38
+
39
+ Returns:
40
+ Success
41
+
42
+ Raises:
43
+ ApiError: A custom exception class that provides additional context
44
+ for API errors, including the HTTP status code and response body.
45
+
46
+ Examples:
47
+ ```py
48
+ client.v1.ai_meme_generator.create(
49
+ style={
50
+ "search_web": False,
51
+ "template": "Drake Hotline Bling",
52
+ "topic": "When the code finally works",
53
+ },
54
+ name="My Funny Meme",
55
+ )
56
+ ```
57
+ """
58
+ _json = to_encodable(
59
+ item={"name": name, "style": style},
60
+ dump_with=params._SerializerV1AiMemeGeneratorCreateBody,
61
+ )
62
+ return self._base_client.request(
63
+ method="POST",
64
+ path="/v1/ai-meme-generator",
65
+ auth_names=["bearerAuth"],
66
+ json=_json,
67
+ cast_to=models.V1AiMemeGeneratorCreateResponse,
68
+ request_options=request_options or default_request_options(),
69
+ )
70
+
71
+
72
+ class AsyncAiMemeGeneratorClient:
73
+ def __init__(self, *, base_client: AsyncBaseClient):
74
+ self._base_client = base_client
75
+
76
+ async def create(
77
+ self,
78
+ *,
79
+ style: params.V1AiMemeGeneratorCreateBodyStyle,
80
+ name: typing.Union[
81
+ typing.Optional[str], type_utils.NotGiven
82
+ ] = type_utils.NOT_GIVEN,
83
+ request_options: typing.Optional[RequestOptions] = None,
84
+ ) -> models.V1AiMemeGeneratorCreateResponse:
85
+ """
86
+ AI Meme Generator
87
+
88
+ Create an AI generated meme. Each meme costs 10 frames.
89
+
90
+ POST /v1/ai-meme-generator
91
+
92
+ Args:
93
+ name: The name of the meme.
94
+ style: V1AiMemeGeneratorCreateBodyStyle
95
+ request_options: Additional options to customize the HTTP request
96
+
97
+ Returns:
98
+ Success
99
+
100
+ Raises:
101
+ ApiError: A custom exception class that provides additional context
102
+ for API errors, including the HTTP status code and response body.
103
+
104
+ Examples:
105
+ ```py
106
+ await client.v1.ai_meme_generator.create(
107
+ style={
108
+ "search_web": False,
109
+ "template": "Drake Hotline Bling",
110
+ "topic": "When the code finally works",
111
+ },
112
+ name="My Funny Meme",
113
+ )
114
+ ```
115
+ """
116
+ _json = to_encodable(
117
+ item={"name": name, "style": style},
118
+ dump_with=params._SerializerV1AiMemeGeneratorCreateBody,
119
+ )
120
+ return await self._base_client.request(
121
+ method="POST",
122
+ path="/v1/ai-meme-generator",
123
+ auth_names=["bearerAuth"],
124
+ json=_json,
125
+ cast_to=models.V1AiMemeGeneratorCreateResponse,
126
+ request_options=request_options or default_request_options(),
127
+ )
@@ -61,8 +61,10 @@ class AiPhotoEditorClient:
61
61
  style={
62
62
  "image_description": "A photo of a person",
63
63
  "likeness_strength": 5.2,
64
+ "negative_prompt": "painting, cartoon, sketch",
64
65
  "prompt": "A photo portrait of a person wearing a hat",
65
66
  "prompt_strength": 3.75,
67
+ "steps": 4,
66
68
  },
67
69
  name="Photo Editor image",
68
70
  )
@@ -138,8 +140,10 @@ class AsyncAiPhotoEditorClient:
138
140
  style={
139
141
  "image_description": "A photo of a person",
140
142
  "likeness_strength": 5.2,
143
+ "negative_prompt": "painting, cartoon, sketch",
141
144
  "prompt": "A photo portrait of a person wearing a hat",
142
145
  "prompt_strength": 3.75,
146
+ "steps": 4,
143
147
  },
144
148
  name="Photo Editor image",
145
149
  )
@@ -56,7 +56,11 @@ class AnimationClient:
56
56
  Examples:
57
57
  ```py
58
58
  client.v1.animation.create(
59
- assets={"audio_source": "file"},
59
+ assets={
60
+ "audio_file_path": "api-assets/id/1234.mp3",
61
+ "audio_source": "file",
62
+ "image_file_path": "api-assets/id/1234.png",
63
+ },
60
64
  end_seconds=15.0,
61
65
  fps=12.0,
62
66
  height=960,
@@ -139,7 +143,11 @@ class AsyncAnimationClient:
139
143
  Examples:
140
144
  ```py
141
145
  await client.v1.animation.create(
142
- assets={"audio_source": "file"},
146
+ assets={
147
+ "audio_file_path": "api-assets/id/1234.mp3",
148
+ "audio_source": "file",
149
+ "image_file_path": "api-assets/id/1234.png",
150
+ },
143
151
  end_seconds=15.0,
144
152
  fps=12.0,
145
153
  height=960,
@@ -15,6 +15,10 @@ from magic_hour.resources.v1.ai_image_upscaler import (
15
15
  AiImageUpscalerClient,
16
16
  AsyncAiImageUpscalerClient,
17
17
  )
18
+ from magic_hour.resources.v1.ai_meme_generator import (
19
+ AiMemeGeneratorClient,
20
+ AsyncAiMemeGeneratorClient,
21
+ )
18
22
  from magic_hour.resources.v1.ai_photo_editor import (
19
23
  AiPhotoEditorClient,
20
24
  AsyncAiPhotoEditorClient,
@@ -72,6 +76,7 @@ class V1Client:
72
76
  )
73
77
  self.ai_image_generator = AiImageGeneratorClient(base_client=self._base_client)
74
78
  self.ai_image_upscaler = AiImageUpscalerClient(base_client=self._base_client)
79
+ self.ai_meme_generator = AiMemeGeneratorClient(base_client=self._base_client)
75
80
  self.ai_photo_editor = AiPhotoEditorClient(base_client=self._base_client)
76
81
  self.ai_qr_code_generator = AiQrCodeGeneratorClient(
77
82
  base_client=self._base_client
@@ -107,6 +112,9 @@ class AsyncV1Client:
107
112
  self.ai_image_upscaler = AsyncAiImageUpscalerClient(
108
113
  base_client=self._base_client
109
114
  )
115
+ self.ai_meme_generator = AsyncAiMemeGeneratorClient(
116
+ base_client=self._base_client
117
+ )
110
118
  self.ai_photo_editor = AsyncAiPhotoEditorClient(base_client=self._base_client)
111
119
  self.ai_qr_code_generator = AsyncAiQrCodeGeneratorClient(
112
120
  base_client=self._base_client
@@ -57,7 +57,11 @@ class FaceSwapClient:
57
57
  Examples:
58
58
  ```py
59
59
  client.v1.face_swap.create(
60
- assets={"image_file_path": "image/id/1234.png", "video_source": "file"},
60
+ assets={
61
+ "image_file_path": "image/id/1234.png",
62
+ "video_file_path": "api-assets/id/1234.mp4",
63
+ "video_source": "file",
64
+ },
61
65
  end_seconds=15.0,
62
66
  height=960,
63
67
  start_seconds=0.0,
@@ -133,7 +137,11 @@ class AsyncFaceSwapClient:
133
137
  Examples:
134
138
  ```py
135
139
  await client.v1.face_swap.create(
136
- assets={"image_file_path": "image/id/1234.png", "video_source": "file"},
140
+ assets={
141
+ "image_file_path": "image/id/1234.png",
142
+ "video_file_path": "api-assets/id/1234.mp4",
143
+ "video_source": "file",
144
+ },
137
145
  end_seconds=15.0,
138
146
  height=960,
139
147
  start_seconds=0.0,
@@ -20,7 +20,7 @@ res = client.v1.image_to_video.create(
20
20
  assets={"image_file_path": "api-assets/id/1234.png"},
21
21
  end_seconds=5.0,
22
22
  height=960,
23
- style={"prompt": None},
23
+ style={"prompt": "string"},
24
24
  width=512,
25
25
  name="Image To Video video",
26
26
  )
@@ -37,7 +37,7 @@ res = await client.v1.image_to_video.create(
37
37
  assets={"image_file_path": "api-assets/id/1234.png"},
38
38
  end_seconds=5.0,
39
39
  height=960,
40
- style={"prompt": None},
40
+ style={"prompt": "string"},
41
41
  width=512,
42
42
  name="Image To Video video",
43
43
  )
@@ -63,6 +63,7 @@ class LipSyncClient:
63
63
  client.v1.lip_sync.create(
64
64
  assets={
65
65
  "audio_file_path": "api-assets/id/1234.mp3",
66
+ "video_file_path": "api-assets/id/1234.mp4",
66
67
  "video_source": "file",
67
68
  },
68
69
  end_seconds=15.0,
@@ -148,6 +149,7 @@ class AsyncLipSyncClient:
148
149
  await client.v1.lip_sync.create(
149
150
  assets={
150
151
  "audio_file_path": "api-assets/id/1234.mp3",
152
+ "video_file_path": "api-assets/id/1234.mp4",
151
153
  "video_source": "file",
152
154
  },
153
155
  end_seconds=15.0,
@@ -24,7 +24,7 @@ res = client.v1.video_to_video.create(
24
24
  style={
25
25
  "art_style": "3D Render",
26
26
  "model": "Absolute Reality",
27
- "prompt": None,
27
+ "prompt": "string",
28
28
  "prompt_type": "append_default",
29
29
  "version": "default",
30
30
  },
@@ -49,7 +49,7 @@ res = await client.v1.video_to_video.create(
49
49
  style={
50
50
  "art_style": "3D Render",
51
51
  "model": "Absolute Reality",
52
- "prompt": None,
52
+ "prompt": "string",
53
53
  "prompt_type": "append_default",
54
54
  "version": "default",
55
55
  },
@@ -67,7 +67,10 @@ class VideoToVideoClient:
67
67
  Examples:
68
68
  ```py
69
69
  client.v1.video_to_video.create(
70
- assets={"video_source": "file"},
70
+ assets={
71
+ "video_file_path": "api-assets/id/1234.mp4",
72
+ "video_source": "file",
73
+ },
71
74
  end_seconds=15.0,
72
75
  height=960,
73
76
  start_seconds=0.0,
@@ -162,7 +165,10 @@ class AsyncVideoToVideoClient:
162
165
  Examples:
163
166
  ```py
164
167
  await client.v1.video_to_video.create(
165
- assets={"video_source": "file"},
168
+ assets={
169
+ "video_file_path": "api-assets/id/1234.mp4",
170
+ "video_source": "file",
171
+ },
166
172
  end_seconds=15.0,
167
173
  height=960,
168
174
  start_seconds=0.0,
@@ -4,6 +4,7 @@ from .v1_ai_headshot_generator_create_response import (
4
4
  )
5
5
  from .v1_ai_image_generator_create_response import V1AiImageGeneratorCreateResponse
6
6
  from .v1_ai_image_upscaler_create_response import V1AiImageUpscalerCreateResponse
7
+ from .v1_ai_meme_generator_create_response import V1AiMemeGeneratorCreateResponse
7
8
  from .v1_ai_photo_editor_create_response import V1AiPhotoEditorCreateResponse
8
9
  from .v1_ai_qr_code_generator_create_response import V1AiQrCodeGeneratorCreateResponse
9
10
  from .v1_ai_talking_photo_create_response import V1AiTalkingPhotoCreateResponse
@@ -39,6 +40,7 @@ __all__ = [
39
40
  "V1AiHeadshotGeneratorCreateResponse",
40
41
  "V1AiImageGeneratorCreateResponse",
41
42
  "V1AiImageUpscalerCreateResponse",
43
+ "V1AiMemeGeneratorCreateResponse",
42
44
  "V1AiPhotoEditorCreateResponse",
43
45
  "V1AiQrCodeGeneratorCreateResponse",
44
46
  "V1AiTalkingPhotoCreateResponse",
@@ -0,0 +1,25 @@
1
+ import pydantic
2
+
3
+
4
+ class V1AiMemeGeneratorCreateResponse(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
+ """
@@ -68,15 +68,9 @@ class V1ImageProjectsGetResponse(pydantic.BaseModel):
68
68
  """
69
69
  The amount of frames used to generate the image.
70
70
  """
71
- type_: typing_extensions.Literal[
72
- "AI_HEADSHOT",
73
- "AI_IMAGE",
74
- "BACKGROUND_REMOVER",
75
- "CLOTHES_CHANGER",
76
- "FACE_SWAP",
77
- "IMAGE_UPSCALER",
78
- "PHOTO_EDITOR",
79
- "QR_CODE",
80
- ] = pydantic.Field(
71
+ type_: str = pydantic.Field(
81
72
  alias="type",
82
73
  )
74
+ """
75
+ The type of the image project. Possible values are AI_HEADSHOT, AI_IMAGE, IMAGE_UPSCALER, FACE_SWAP, PHOTO_EDITOR, QR_CODE, BACKGROUND_REMOVER, CLOTHES_CHANGER, AI_MEME, FACE_EDITOR
76
+ """
@@ -93,18 +93,12 @@ class V1VideoProjectsGetResponse(pydantic.BaseModel):
93
93
  """
94
94
  The amount of frames used to generate the video. If the status is not 'complete', the cost is an estimate and will be adjusted when the video completes.
95
95
  """
96
- type_: typing_extensions.Literal[
97
- "ANIMATION",
98
- "AUTO_SUBTITLE",
99
- "FACE_SWAP",
100
- "IMAGE_TO_VIDEO",
101
- "LIP_SYNC",
102
- "TALKING_PHOTO",
103
- "TEXT_TO_VIDEO",
104
- "VIDEO_TO_VIDEO",
105
- ] = pydantic.Field(
96
+ type_: str = pydantic.Field(
106
97
  alias="type",
107
98
  )
99
+ """
100
+ The type of the video project. Possible values are ANIMATION, IMAGE_TO_VIDEO, VIDEO_TO_VIDEO, TEXT_TO_VIDEO, FACE_SWAP, LIP_SYNC, AUTO_SUBTITLE, TALKING_PHOTO
101
+ """
108
102
  width: int = pydantic.Field(
109
103
  alias="width",
110
104
  )
@@ -38,6 +38,14 @@ from .v1_ai_image_upscaler_create_body_style import (
38
38
  V1AiImageUpscalerCreateBodyStyle,
39
39
  _SerializerV1AiImageUpscalerCreateBodyStyle,
40
40
  )
41
+ from .v1_ai_meme_generator_create_body import (
42
+ V1AiMemeGeneratorCreateBody,
43
+ _SerializerV1AiMemeGeneratorCreateBody,
44
+ )
45
+ from .v1_ai_meme_generator_create_body_style import (
46
+ V1AiMemeGeneratorCreateBodyStyle,
47
+ _SerializerV1AiMemeGeneratorCreateBodyStyle,
48
+ )
41
49
  from .v1_ai_photo_editor_create_body import (
42
50
  V1AiPhotoEditorCreateBody,
43
51
  _SerializerV1AiPhotoEditorCreateBody,
@@ -160,6 +168,8 @@ __all__ = [
160
168
  "V1AiImageUpscalerCreateBody",
161
169
  "V1AiImageUpscalerCreateBodyAssets",
162
170
  "V1AiImageUpscalerCreateBodyStyle",
171
+ "V1AiMemeGeneratorCreateBody",
172
+ "V1AiMemeGeneratorCreateBodyStyle",
163
173
  "V1AiPhotoEditorCreateBody",
164
174
  "V1AiPhotoEditorCreateBodyAssets",
165
175
  "V1AiPhotoEditorCreateBodyStyle",
@@ -198,6 +208,8 @@ __all__ = [
198
208
  "_SerializerV1AiImageUpscalerCreateBody",
199
209
  "_SerializerV1AiImageUpscalerCreateBodyAssets",
200
210
  "_SerializerV1AiImageUpscalerCreateBodyStyle",
211
+ "_SerializerV1AiMemeGeneratorCreateBody",
212
+ "_SerializerV1AiMemeGeneratorCreateBodyStyle",
201
213
  "_SerializerV1AiPhotoEditorCreateBody",
202
214
  "_SerializerV1AiPhotoEditorCreateBodyAssets",
203
215
  "_SerializerV1AiPhotoEditorCreateBodyStyle",
@@ -0,0 +1,37 @@
1
+ import pydantic
2
+ import typing
3
+ import typing_extensions
4
+
5
+ from .v1_ai_meme_generator_create_body_style import (
6
+ V1AiMemeGeneratorCreateBodyStyle,
7
+ _SerializerV1AiMemeGeneratorCreateBodyStyle,
8
+ )
9
+
10
+
11
+ class V1AiMemeGeneratorCreateBody(typing_extensions.TypedDict):
12
+ """
13
+ V1AiMemeGeneratorCreateBody
14
+ """
15
+
16
+ name: typing_extensions.NotRequired[str]
17
+ """
18
+ The name of the meme.
19
+ """
20
+
21
+ style: typing_extensions.Required[V1AiMemeGeneratorCreateBodyStyle]
22
+
23
+
24
+ class _SerializerV1AiMemeGeneratorCreateBody(pydantic.BaseModel):
25
+ """
26
+ Serializer for V1AiMemeGeneratorCreateBody handling case conversions
27
+ and file omissions as dictated by the API
28
+ """
29
+
30
+ model_config = pydantic.ConfigDict(
31
+ populate_by_name=True,
32
+ )
33
+
34
+ name: typing.Optional[str] = pydantic.Field(alias="name", default=None)
35
+ style: _SerializerV1AiMemeGeneratorCreateBodyStyle = pydantic.Field(
36
+ alias="style",
37
+ )
@@ -0,0 +1,73 @@
1
+ import pydantic
2
+ import typing
3
+ import typing_extensions
4
+
5
+
6
+ class V1AiMemeGeneratorCreateBodyStyle(typing_extensions.TypedDict):
7
+ """
8
+ V1AiMemeGeneratorCreateBodyStyle
9
+ """
10
+
11
+ search_web: typing_extensions.NotRequired[bool]
12
+ """
13
+ Whether to search the web for meme content.
14
+ """
15
+
16
+ template: typing_extensions.Required[
17
+ typing_extensions.Literal[
18
+ "Bike Fall",
19
+ "Change My Mind",
20
+ "Disappointed Guy",
21
+ "Drake Hotline Bling",
22
+ "Galaxy Brain",
23
+ "Gru's Plan",
24
+ "Is This a Pigeon",
25
+ "Panik Kalm Panik",
26
+ "Random",
27
+ "Side Eyeing Chloe",
28
+ "Tuxedo Winnie The Pooh",
29
+ "Two Buttons",
30
+ "Waiting Skeleton",
31
+ ]
32
+ ]
33
+ """
34
+ To use our templates, pass in one of the enum values.
35
+ """
36
+
37
+ topic: typing_extensions.Required[str]
38
+ """
39
+ The topic of the meme.
40
+ """
41
+
42
+
43
+ class _SerializerV1AiMemeGeneratorCreateBodyStyle(pydantic.BaseModel):
44
+ """
45
+ Serializer for V1AiMemeGeneratorCreateBodyStyle handling case conversions
46
+ and file omissions as dictated by the API
47
+ """
48
+
49
+ model_config = pydantic.ConfigDict(
50
+ populate_by_name=True,
51
+ )
52
+
53
+ search_web: typing.Optional[bool] = pydantic.Field(alias="searchWeb", default=None)
54
+ template: typing_extensions.Literal[
55
+ "Bike Fall",
56
+ "Change My Mind",
57
+ "Disappointed Guy",
58
+ "Drake Hotline Bling",
59
+ "Galaxy Brain",
60
+ "Gru's Plan",
61
+ "Is This a Pigeon",
62
+ "Panik Kalm Panik",
63
+ "Random",
64
+ "Side Eyeing Chloe",
65
+ "Tuxedo Winnie The Pooh",
66
+ "Two Buttons",
67
+ "Waiting Skeleton",
68
+ ] = pydantic.Field(
69
+ alias="template",
70
+ )
71
+ topic: str = pydantic.Field(
72
+ alias="topic",
73
+ )
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "magic_hour"
3
- version = "0.12.1"
3
+ version = "0.13.0"
4
4
  description = "Python SDK for Magic Hour API"
5
5
  readme = "README.md"
6
6
  authors = []
File without changes