magic_hour 0.24.0__tar.gz → 0.25.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 (172) hide show
  1. {magic_hour-0.24.0 → magic_hour-0.25.0}/PKG-INFO +5 -1
  2. {magic_hour-0.24.0 → magic_hour-0.25.0}/README.md +4 -0
  3. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/client.py +2 -2
  4. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/core/__init__.py +6 -10
  5. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/core/auth.py +136 -96
  6. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/environment.py +1 -1
  7. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/ai_clothes_changer/README.md +13 -5
  8. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/ai_face_editor/README.md +14 -6
  9. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/ai_gif_generator/README.md +13 -5
  10. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/ai_headshot_generator/README.md +14 -6
  11. magic_hour-0.25.0/magic_hour/resources/v1/ai_image_editor/README.md +52 -0
  12. magic_hour-0.25.0/magic_hour/resources/v1/ai_image_editor/__init__.py +4 -0
  13. magic_hour-0.25.0/magic_hour/resources/v1/ai_image_editor/client.py +125 -0
  14. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/ai_image_generator/README.md +15 -7
  15. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/ai_image_upscaler/README.md +15 -7
  16. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/ai_meme_generator/README.md +13 -5
  17. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/ai_photo_editor/README.md +16 -8
  18. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/ai_qr_code_generator/README.md +14 -6
  19. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/ai_talking_photo/README.md +16 -8
  20. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/animation/README.md +18 -10
  21. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/client.py +6 -0
  22. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/face_swap/README.md +17 -9
  23. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/face_swap_photo/README.md +13 -5
  24. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/files/upload_urls/README.md +15 -8
  25. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/files/upload_urls/client.py +6 -8
  26. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/image_background_remover/README.md +13 -5
  27. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/image_projects/README.md +18 -10
  28. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/image_to_video/README.md +17 -9
  29. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/lip_sync/README.md +18 -10
  30. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/photo_colorizer/README.md +13 -5
  31. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/text_to_video/README.md +15 -7
  32. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/video_projects/README.md +18 -10
  33. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/video_to_video/README.md +19 -11
  34. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/models/__init__.py +2 -0
  35. magic_hour-0.25.0/magic_hour/types/models/v1_ai_image_editor_create_response.py +33 -0
  36. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/models/v1_image_projects_get_response.py +1 -1
  37. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/__init__.py +18 -0
  38. magic_hour-0.25.0/magic_hour/types/params/v1_ai_image_editor_create_body.py +49 -0
  39. magic_hour-0.25.0/magic_hour/types/params/v1_ai_image_editor_create_body_assets.py +28 -0
  40. magic_hour-0.25.0/magic_hour/types/params/v1_ai_image_editor_create_body_style.py +28 -0
  41. {magic_hour-0.24.0 → magic_hour-0.25.0}/pyproject.toml +1 -1
  42. {magic_hour-0.24.0 → magic_hour-0.25.0}/LICENSE +0 -0
  43. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/__init__.py +0 -0
  44. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/core/api_error.py +0 -0
  45. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/core/base_client.py +0 -0
  46. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/core/binary_response.py +0 -0
  47. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/core/query.py +0 -0
  48. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/core/request.py +0 -0
  49. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/core/response.py +0 -0
  50. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/core/type_utils.py +0 -0
  51. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/core/utils.py +0 -0
  52. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/__init__.py +0 -0
  53. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/ai_clothes_changer/__init__.py +0 -0
  54. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/ai_clothes_changer/client.py +0 -0
  55. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/ai_face_editor/__init__.py +0 -0
  56. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/ai_face_editor/client.py +0 -0
  57. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/ai_gif_generator/__init__.py +0 -0
  58. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/ai_gif_generator/client.py +0 -0
  59. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/ai_headshot_generator/__init__.py +0 -0
  60. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/ai_headshot_generator/client.py +0 -0
  61. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/ai_image_generator/__init__.py +0 -0
  62. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/ai_image_generator/client.py +0 -0
  63. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/ai_image_upscaler/__init__.py +0 -0
  64. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/ai_image_upscaler/client.py +0 -0
  65. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/ai_meme_generator/__init__.py +0 -0
  66. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/ai_meme_generator/client.py +0 -0
  67. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/ai_photo_editor/__init__.py +0 -0
  68. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/ai_photo_editor/client.py +0 -0
  69. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/ai_qr_code_generator/__init__.py +0 -0
  70. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/ai_qr_code_generator/client.py +0 -0
  71. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/ai_talking_photo/__init__.py +0 -0
  72. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/ai_talking_photo/client.py +0 -0
  73. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/animation/__init__.py +0 -0
  74. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/animation/client.py +0 -0
  75. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/face_swap/__init__.py +0 -0
  76. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/face_swap/client.py +0 -0
  77. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/face_swap_photo/__init__.py +0 -0
  78. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/face_swap_photo/client.py +0 -0
  79. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/files/__init__.py +0 -0
  80. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/files/client.py +0 -0
  81. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/files/upload_urls/__init__.py +0 -0
  82. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/image_background_remover/__init__.py +0 -0
  83. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/image_background_remover/client.py +0 -0
  84. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/image_projects/__init__.py +0 -0
  85. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/image_projects/client.py +0 -0
  86. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/image_to_video/__init__.py +0 -0
  87. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/image_to_video/client.py +0 -0
  88. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/lip_sync/__init__.py +0 -0
  89. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/lip_sync/client.py +0 -0
  90. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/photo_colorizer/__init__.py +0 -0
  91. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/photo_colorizer/client.py +0 -0
  92. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/text_to_video/__init__.py +0 -0
  93. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/text_to_video/client.py +0 -0
  94. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/video_projects/__init__.py +0 -0
  95. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/video_projects/client.py +0 -0
  96. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/video_to_video/__init__.py +0 -0
  97. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/resources/v1/video_to_video/client.py +0 -0
  98. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/models/v1_ai_clothes_changer_create_response.py +0 -0
  99. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/models/v1_ai_face_editor_create_response.py +0 -0
  100. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/models/v1_ai_gif_generator_create_response.py +0 -0
  101. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/models/v1_ai_headshot_generator_create_response.py +0 -0
  102. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/models/v1_ai_image_generator_create_response.py +0 -0
  103. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/models/v1_ai_image_upscaler_create_response.py +0 -0
  104. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/models/v1_ai_meme_generator_create_response.py +0 -0
  105. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/models/v1_ai_photo_editor_create_response.py +0 -0
  106. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/models/v1_ai_qr_code_generator_create_response.py +0 -0
  107. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/models/v1_ai_talking_photo_create_response.py +0 -0
  108. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/models/v1_animation_create_response.py +0 -0
  109. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/models/v1_face_swap_create_response.py +0 -0
  110. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/models/v1_face_swap_photo_create_response.py +0 -0
  111. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/models/v1_files_upload_urls_create_response.py +0 -0
  112. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/models/v1_files_upload_urls_create_response_items_item.py +0 -0
  113. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/models/v1_image_background_remover_create_response.py +0 -0
  114. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/models/v1_image_projects_get_response_downloads_item.py +0 -0
  115. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/models/v1_image_projects_get_response_error.py +0 -0
  116. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/models/v1_image_to_video_create_response.py +0 -0
  117. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/models/v1_lip_sync_create_response.py +0 -0
  118. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/models/v1_photo_colorizer_create_response.py +0 -0
  119. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/models/v1_text_to_video_create_response.py +0 -0
  120. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/models/v1_video_projects_get_response.py +0 -0
  121. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/models/v1_video_projects_get_response_download.py +0 -0
  122. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/models/v1_video_projects_get_response_downloads_item.py +0 -0
  123. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/models/v1_video_projects_get_response_error.py +0 -0
  124. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/models/v1_video_to_video_create_response.py +0 -0
  125. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_ai_clothes_changer_create_body.py +0 -0
  126. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_ai_clothes_changer_create_body_assets.py +0 -0
  127. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_ai_face_editor_create_body.py +0 -0
  128. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_ai_face_editor_create_body_assets.py +0 -0
  129. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_ai_face_editor_create_body_style.py +0 -0
  130. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_ai_gif_generator_create_body.py +0 -0
  131. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_ai_gif_generator_create_body_style.py +0 -0
  132. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_ai_headshot_generator_create_body.py +0 -0
  133. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_ai_headshot_generator_create_body_assets.py +0 -0
  134. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_ai_headshot_generator_create_body_style.py +0 -0
  135. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_ai_image_generator_create_body.py +0 -0
  136. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_ai_image_generator_create_body_style.py +0 -0
  137. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_ai_image_upscaler_create_body.py +0 -0
  138. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_ai_image_upscaler_create_body_assets.py +0 -0
  139. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_ai_image_upscaler_create_body_style.py +0 -0
  140. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_ai_meme_generator_create_body.py +0 -0
  141. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_ai_meme_generator_create_body_style.py +0 -0
  142. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_ai_photo_editor_create_body.py +0 -0
  143. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_ai_photo_editor_create_body_assets.py +0 -0
  144. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_ai_photo_editor_create_body_style.py +0 -0
  145. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_ai_qr_code_generator_create_body.py +0 -0
  146. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_ai_qr_code_generator_create_body_style.py +0 -0
  147. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_ai_talking_photo_create_body.py +0 -0
  148. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_ai_talking_photo_create_body_assets.py +0 -0
  149. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_ai_talking_photo_create_body_style.py +0 -0
  150. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_animation_create_body.py +0 -0
  151. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_animation_create_body_assets.py +0 -0
  152. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_animation_create_body_style.py +0 -0
  153. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_face_swap_create_body.py +0 -0
  154. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_face_swap_create_body_assets.py +0 -0
  155. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_face_swap_photo_create_body.py +0 -0
  156. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_face_swap_photo_create_body_assets.py +0 -0
  157. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_files_upload_urls_create_body.py +0 -0
  158. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_files_upload_urls_create_body_items_item.py +0 -0
  159. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_image_background_remover_create_body.py +0 -0
  160. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_image_background_remover_create_body_assets.py +0 -0
  161. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_image_to_video_create_body.py +0 -0
  162. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_image_to_video_create_body_assets.py +0 -0
  163. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_image_to_video_create_body_style.py +0 -0
  164. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_lip_sync_create_body.py +0 -0
  165. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_lip_sync_create_body_assets.py +0 -0
  166. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_photo_colorizer_create_body.py +0 -0
  167. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_photo_colorizer_create_body_assets.py +0 -0
  168. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_text_to_video_create_body.py +0 -0
  169. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_text_to_video_create_body_style.py +0 -0
  170. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_video_to_video_create_body.py +0 -0
  171. {magic_hour-0.24.0 → magic_hour-0.25.0}/magic_hour/types/params/v1_video_to_video_create_body_assets.py +0 -0
  172. {magic_hour-0.24.0 → magic_hour-0.25.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.24.0
3
+ Version: 0.25.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_headshot_generator/README.md#create) - AI Headshots
77
77
 
78
+ ### [v1.ai_image_editor](magic_hour/resources/v1/ai_image_editor/README.md)
79
+
80
+ * [create](magic_hour/resources/v1/ai_image_editor/README.md#create) - AI Image Editor
81
+
78
82
  ### [v1.ai_image_generator](magic_hour/resources/v1/ai_image_generator/README.md)
79
83
 
80
84
  * [create](magic_hour/resources/v1/ai_image_generator/README.md#create) - AI Images
@@ -57,6 +57,10 @@ client = AsyncClient(token="my api key")
57
57
 
58
58
  * [create](magic_hour/resources/v1/ai_headshot_generator/README.md#create) - AI Headshots
59
59
 
60
+ ### [v1.ai_image_editor](magic_hour/resources/v1/ai_image_editor/README.md)
61
+
62
+ * [create](magic_hour/resources/v1/ai_image_editor/README.md#create) - AI Image Editor
63
+
60
64
  ### [v1.ai_image_generator](magic_hour/resources/v1/ai_image_generator/README.md)
61
65
 
62
66
  * [create](magic_hour/resources/v1/ai_image_generator/README.md#create) - AI Images
@@ -23,7 +23,7 @@ class Client:
23
23
  if httpx_client is None
24
24
  else httpx_client,
25
25
  )
26
- self._base_client.register_auth("bearerAuth", AuthBearer(val=token))
26
+ self._base_client.register_auth("bearerAuth", AuthBearer(token=token))
27
27
  self.v1 = V1Client(base_client=self._base_client)
28
28
 
29
29
 
@@ -44,5 +44,5 @@ class AsyncClient:
44
44
  if httpx_client is None
45
45
  else httpx_client,
46
46
  )
47
- self._base_client.register_auth("bearerAuth", AuthBearer(val=token))
47
+ self._base_client.register_auth("bearerAuth", AuthBearer(token=token))
48
48
  self.v1 = AsyncV1Client(base_client=self._base_client)
@@ -1,15 +1,13 @@
1
1
  from .api_error import ApiError
2
2
  from .auth import (
3
- AuthKeyQuery,
3
+ AuthKey,
4
4
  AuthBasic,
5
5
  AuthBearer,
6
6
  AuthProvider,
7
- AuthKeyCookie,
8
- AuthKeyHeader,
9
7
  GrantType,
10
8
  OAuth2,
11
- OAuth2ClientCredentialsForm,
12
- OAuth2PasswordForm,
9
+ OAuth2ClientCredentials,
10
+ OAuth2Password,
13
11
  )
14
12
  from .base_client import AsyncBaseClient, BaseClient, SyncBaseClient
15
13
  from .binary_response import BinaryResponse
@@ -32,16 +30,14 @@ __all__ = [
32
30
  "RequestOptions",
33
31
  "default_request_options",
34
32
  "SyncBaseClient",
35
- "AuthKeyQuery",
33
+ "AuthKey",
36
34
  "AuthBasic",
37
35
  "AuthBearer",
38
36
  "AuthProvider",
39
- "AuthKeyCookie",
40
- "AuthKeyHeader",
41
37
  "GrantType",
42
38
  "OAuth2",
43
- "OAuth2ClientCredentialsForm",
44
- "OAuth2PasswordForm",
39
+ "OAuth2ClientCredentials",
40
+ "OAuth2Password",
45
41
  "to_encodable",
46
42
  "to_form_urlencoded",
47
43
  "filter_not_given",
@@ -1,14 +1,15 @@
1
+ """Generated by Sideko (sideko.dev)"""
2
+
1
3
  import abc
2
4
  import datetime
3
- from typing import Any, Dict, TypedDict, Optional, List, Tuple, Literal
5
+ from typing import Any, Dict, TypedDict, Optional, List, Tuple, Literal, Union, cast
4
6
 
5
7
  import jsonpointer # type: ignore
6
8
  import httpx
7
- from pydantic import BaseModel
8
9
  from .request import RequestConfig
9
10
 
10
11
 
11
- class AuthProvider(abc.ABC, BaseModel):
12
+ class AuthProvider(abc.ABC):
12
13
  """
13
14
  Abstract base class defining the interface for authentication providers.
14
15
 
@@ -49,6 +50,13 @@ class AuthBasic(AuthProvider):
49
50
  username: Optional[str]
50
51
  password: Optional[str]
51
52
 
53
+ def __init__(
54
+ self, *, username: Optional[str] = None, password: Optional[str] = None
55
+ ):
56
+ super().__init__()
57
+ self.username = username
58
+ self.password = password
59
+
52
60
  def add_to_request(self, cfg: RequestConfig) -> RequestConfig:
53
61
  """
54
62
  Adds Basic Authentication credentials to the request configuration.
@@ -71,10 +79,14 @@ class AuthBearer(AuthProvider):
71
79
  Implements Bearer token authentication.
72
80
 
73
81
  Adds a Bearer token to the request's Authorization header following
74
- the OAuth 2.0 Bearer Token scheme.
82
+ a 'Bearer ' prefix
75
83
  """
76
84
 
77
- val: Optional[str]
85
+ token: Optional[str]
86
+
87
+ def __init__(self, *, token: Optional[str] = None):
88
+ super().__init__()
89
+ self.token = token
78
90
 
79
91
  def add_to_request(self, cfg: RequestConfig) -> RequestConfig:
80
92
  """
@@ -82,9 +94,9 @@ class AuthBearer(AuthProvider):
82
94
 
83
95
  Only modifies the configuration if a token value is provided.
84
96
  """
85
- if self.val is not None:
97
+ if self.token is not None:
86
98
  headers = cfg.get("headers", dict())
87
- headers["Authorization"] = f"Bearer {self.val}"
99
+ headers["Authorization"] = f"Bearer {self.token}"
88
100
  cfg["headers"] = headers
89
101
  return cfg
90
102
 
@@ -92,90 +104,51 @@ class AuthBearer(AuthProvider):
92
104
  """
93
105
  Sets value as the bearer token
94
106
  """
95
- self.val = val
107
+ self.token = val
96
108
 
97
109
 
98
- class AuthKeyQuery(AuthProvider):
110
+ class AuthKey(AuthProvider):
99
111
  """
100
- Implements query parameter-based authentication.
112
+ Implements query, header, or cookie based authentication.
101
113
 
102
- Adds an authentication token or key as a query parameter with a
103
- configurable parameter name.
114
+ Adds an authentication token to the request in the configured location
104
115
  """
105
116
 
106
- query_name: str
117
+ name: str
118
+ location: Literal["query", "header", "cookie"]
107
119
  val: Optional[str]
108
120
 
109
- def add_to_request(self, cfg: RequestConfig) -> RequestConfig:
110
- """
111
- Adds authentication value as a query parameter.
112
-
113
- Only modifies the configuration if a value is provided.
114
- """
115
- if self.val is not None:
116
- params = cfg.get("params", dict())
117
- params[self.query_name] = self.val
118
- cfg["params"] = params
119
- return cfg
120
-
121
- def set_value(self, val: Optional[str]) -> None:
122
- """
123
- Sets value as the key
124
- """
121
+ def __init__(
122
+ self,
123
+ *,
124
+ name: str,
125
+ location: Literal["query", "header", "cookie"],
126
+ val: Optional[str] = None,
127
+ ):
128
+ super().__init__()
129
+ self.name = name
130
+ self.location = location
125
131
  self.val = val
126
132
 
127
-
128
- class AuthKeyHeader(AuthProvider):
129
- """
130
- Implements header-based authentication.
131
-
132
- Adds an authentication token or key as a custom header with a
133
- configurable header name.
134
- """
135
-
136
- header_name: str
137
- val: Optional[str]
138
-
139
133
  def add_to_request(self, cfg: RequestConfig) -> RequestConfig:
140
134
  """
141
- Adds authentication value as a custom header.
142
-
143
- Only modifies the configuration if a value is provided.
135
+ Adds authentication value as a query/header/cookie parameter
144
136
  """
145
- if self.val is not None:
137
+ if self.val is None:
138
+ return cfg
139
+ elif self.location == "query":
140
+ params = cfg.get("params", dict())
141
+ params[self.name] = self.val
142
+ cfg["params"] = params
143
+ elif self.location == "header":
146
144
  headers = cfg.get("headers", {})
147
- headers[self.header_name] = self.val
145
+ headers[self.name] = self.val
148
146
  cfg["headers"] = headers
149
- return cfg
150
-
151
- def set_value(self, val: Optional[str]) -> None:
152
- """
153
- Sets value as the key
154
- """
155
- self.val = val
156
-
157
-
158
- class AuthKeyCookie(AuthProvider):
159
- """
160
- Implements cookie-based authentication.
161
-
162
- Adds an authentication token or key as a cookie with a
163
- configurable cookie name.
164
- """
165
-
166
- cookie_name: str
167
- val: Optional[str]
168
-
169
- def add_to_request(self, cfg: RequestConfig) -> RequestConfig:
170
- """
171
- Adds authentication value as a cookie.
172
-
173
- Only modifies the configuration if a value is provided.
174
- """
175
- if self.val is not None:
147
+ else:
176
148
  cookies = cfg.get("cookies", dict())
177
- cookies[self.cookie_name] = self.val
149
+ cookies[self.name] = self.val
178
150
  cfg["cookies"] = cookies
151
+
179
152
  return cfg
180
153
 
181
154
  def set_value(self, val: Optional[str]) -> None:
@@ -185,7 +158,12 @@ class AuthKeyCookie(AuthProvider):
185
158
  self.val = val
186
159
 
187
160
 
188
- class OAuth2PasswordForm(TypedDict, total=True):
161
+ GrantType = Literal["password", "client_credentials"]
162
+ CredentialsLocation = Literal["request_body", "basic_authorization_header"]
163
+ BodyContent = Literal["form", "json"]
164
+
165
+
166
+ class OAuth2Password(TypedDict, total=True):
189
167
  """
190
168
  OAuth2 authentication form for a password flow
191
169
 
@@ -197,11 +175,16 @@ class OAuth2PasswordForm(TypedDict, total=True):
197
175
  password: str
198
176
  client_id: Optional[str]
199
177
  client_secret: Optional[str]
200
- grant_type: Optional[str]
178
+ grant_type: Optional[Union[GrantType, str]]
201
179
  scope: Optional[List[str]]
202
180
 
181
+ token_url: Optional[str]
182
+ """
183
+ Overrides the default token url
184
+ """
185
+
203
186
 
204
- class OAuth2ClientCredentialsForm(TypedDict, total=True):
187
+ class OAuth2ClientCredentials(TypedDict, total=True):
205
188
  """
206
189
  OAuth2 authentication form for a client credentials flow
207
190
 
@@ -211,13 +194,13 @@ class OAuth2ClientCredentialsForm(TypedDict, total=True):
211
194
 
212
195
  client_id: str
213
196
  client_secret: str
214
- grant_type: Optional[str]
197
+ grant_type: Optional[Union[GrantType, str]]
215
198
  scope: Optional[List[str]]
216
199
 
217
-
218
- GrantType = Literal["password", "client_credentials"]
219
- CredentialsLocation = Literal["request_body", "basic_authorization_header"]
220
- BodyContent = Literal["form", "json"]
200
+ token_url: Optional[str]
201
+ """
202
+ Overrides the default token url
203
+ """
221
204
 
222
205
 
223
206
  class OAuth2(AuthProvider):
@@ -228,6 +211,7 @@ class OAuth2(AuthProvider):
228
211
  """
229
212
 
230
213
  # OAuth2 provider configuration
214
+ base_url: str
231
215
  token_url: str
232
216
  access_token_pointer: str
233
217
  expires_in_pointer: str
@@ -236,28 +220,76 @@ class OAuth2(AuthProvider):
236
220
  request_mutator: AuthProvider
237
221
 
238
222
  # OAuth2 access token request values
239
- grant_type: GrantType
240
- username: Optional[str] = None
241
- password: Optional[str] = None
242
- client_id: Optional[str] = None
243
- client_secret: Optional[str] = None
244
- scope: Optional[List[str]] = None
223
+ grant_type: Union[GrantType, str]
224
+ username: Optional[str]
225
+ password: Optional[str]
226
+ client_id: Optional[str]
227
+ client_secret: Optional[str]
228
+ scope: Optional[List[str]]
245
229
 
246
230
  # access_token storage
247
- access_token: Optional[str] = None
248
- expires_at: Optional[datetime.datetime] = None
231
+ access_token: Optional[str]
232
+ expires_at: Optional[datetime.datetime]
233
+
234
+ def __init__(
235
+ self,
236
+ *,
237
+ base_url: str,
238
+ default_token_url: str,
239
+ access_token_pointer: str,
240
+ expires_in_pointer: str,
241
+ credentials_location: CredentialsLocation,
242
+ body_content: BodyContent,
243
+ request_mutator: AuthProvider,
244
+ form: Optional[Union[OAuth2Password, OAuth2ClientCredentials]] = None,
245
+ ):
246
+ super().__init__()
247
+
248
+ form_data: Union[OAuth2Password, OAuth2ClientCredentials] = form or cast(
249
+ OAuth2ClientCredentials, {}
250
+ )
251
+
252
+ self.base_url = base_url
253
+ self.token_url = form_data.get("token_url") or default_token_url
254
+ self.access_token_pointer = access_token_pointer
255
+ self.expires_in_pointer = expires_in_pointer
256
+ self.credentials_location = credentials_location
257
+ self.body_content = body_content
258
+ self.request_mutator = request_mutator
259
+
260
+ default_grant_type: GrantType = (
261
+ "password"
262
+ if form_data.get("username") is not None
263
+ else "client_credentials"
264
+ )
265
+ self.grant_type = form_data.get("grant_type") or default_grant_type
266
+ self.username = cast(Optional[str], form_data.get("username"))
267
+ self.password = cast(Optional[str], form_data.get("password"))
268
+ self.client_id = form_data.get("client_id")
269
+ self.client_secret = form_data.get("client_secret")
270
+ self.scope = form_data.get("scope")
271
+
272
+ self.access_token = None
273
+ self.expires_at = None
249
274
 
250
275
  def _refresh(self) -> Tuple[str, datetime.datetime]:
251
- req_cfg: Dict[str, Any] = {"url": self.token_url}
252
- req_data: Dict[str, Any] = {"grant_type": self.grant_type}
276
+ # build token url using base_url if relative
277
+ url = self.token_url
278
+ if url.startswith("/"):
279
+ url = f"{self.base_url.strip('/')}/{self.token_url.strip('/')}"
280
+
281
+ req_cfg: Dict[str, Any] = {"url": url}
282
+ req_data: Dict[str, str] = {"grant_type": self.grant_type}
253
283
 
254
284
  # add client credentials
255
285
  if self.client_id is not None or self.client_secret is not None:
256
286
  if self.credentials_location == "basic_authorization_header":
257
- req_cfg["auth"] = (self.client_id, self.client_secret)
287
+ req_cfg["auth"] = (self.client_id or "", self.client_secret or "")
258
288
  else:
259
- req_data["client_id"] = self.client_id
260
- req_data["client_secret"] = self.client_secret
289
+ if self.client_id is not None:
290
+ req_data["client_id"] = self.client_id
291
+ if self.client_secret is not None:
292
+ req_data["client_secret"] = self.client_secret
261
293
 
262
294
  # construct request data
263
295
  if self.username is not None:
@@ -298,10 +330,18 @@ class OAuth2(AuthProvider):
298
330
  return (access_token, expires_at)
299
331
 
300
332
  def add_to_request(self, cfg: RequestConfig) -> RequestConfig:
333
+ if (
334
+ self.username is None
335
+ and self.password is None
336
+ and self.client_id is None
337
+ and self.client_secret is None
338
+ ):
339
+ # provider is not configured to make an oauth token request
340
+ return cfg
341
+
301
342
  token_expired = (
302
343
  self.expires_at is not None and self.expires_at <= datetime.datetime.now()
303
344
  )
304
-
305
345
  if self.access_token is None or token_expired:
306
346
  access_token, expires_at = self._refresh()
307
347
  self.expires_at = expires_at
@@ -6,7 +6,7 @@ class Environment(enum.Enum):
6
6
  """Pre-defined base URLs for the API"""
7
7
 
8
8
  ENVIRONMENT = "https://api.magichour.ai"
9
- MOCK_SERVER = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.24.0"
9
+ MOCK_SERVER = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.25.0"
10
10
 
11
11
 
12
12
  def _get_base_url(
@@ -5,6 +5,13 @@ Change outfits in photos in seconds with just a photo reference. Each photo cost
5
5
 
6
6
  **API Endpoint**: `POST /v1/ai-clothes-changer`
7
7
 
8
+ #### Parameters
9
+
10
+ | Parameter | Required | Description | Example |
11
+ |-----------|:--------:|-------------|--------|
12
+ | `assets` | ✓ | Provide the assets for clothes changer | `{"garment_file_path": "api-assets/id/outfit.png", "garment_type": "dresses", "person_file_path": "api-assets/id/model.png"}` |
13
+ | `name` | ✗ | The name of image | `"Clothes Changer image"` |
14
+
8
15
  #### Synchronous Client
9
16
 
10
17
  ```python
@@ -41,9 +48,10 @@ res = await client.v1.ai_clothes_changer.create(
41
48
 
42
49
  ```
43
50
 
44
- #### Parameters
51
+ #### Response
45
52
 
46
- | Parameter | Required | Description | Example |
47
- |-----------|:--------:|-------------|--------|
48
- | `assets` | ✓ | Provide the assets for clothes changer | `{"garment_file_path": "api-assets/id/outfit.png", "garment_type": "dresses", "person_file_path": "api-assets/id/model.png"}` |
49
- | `name` | ✗ | The name of image | `"Clothes Changer image"` |
53
+ ##### Type
54
+ [V1AiClothesChangerCreateResponse](/magic_hour/types/models/v1_ai_clothes_changer_create_response.py)
55
+
56
+ ##### Example
57
+ `{"credits_charged": 25, "frame_cost": 25, "id": "clx7uu86w0a5qp55yxz315r6r"}`
@@ -5,6 +5,14 @@ Edit facial features of an image using AI. Each edit costs 1 frame. The height/w
5
5
 
6
6
  **API Endpoint**: `POST /v1/ai-face-editor`
7
7
 
8
+ #### Parameters
9
+
10
+ | Parameter | Required | Description | Example |
11
+ |-----------|:--------:|-------------|--------|
12
+ | `assets` | ✓ | Provide the assets for face editor | `{"image_file_path": "api-assets/id/1234.png"}` |
13
+ | `style` | ✓ | Face editing parameters | `{"enhance_face": False, "eye_gaze_horizontal": 0.0, "eye_gaze_vertical": 0.0, "eye_open_ratio": 0.0, "eyebrow_direction": 0.0, "head_pitch": 0.0, "head_roll": 0.0, "head_yaw": 0.0, "lip_open_ratio": 0.0, "mouth_grim": 0.0, "mouth_position_horizontal": 0.0, "mouth_position_vertical": 0.0, "mouth_pout": 0.0, "mouth_purse": 0.0, "mouth_smile": 0.0}` |
14
+ | `name` | ✗ | The name of image | `"Face Editor image"` |
15
+
8
16
  #### Synchronous Client
9
17
 
10
18
  ```python
@@ -67,10 +75,10 @@ res = await client.v1.ai_face_editor.create(
67
75
 
68
76
  ```
69
77
 
70
- #### Parameters
78
+ #### Response
71
79
 
72
- | Parameter | Required | Description | Example |
73
- |-----------|:--------:|-------------|--------|
74
- | `assets` | ✓ | Provide the assets for face editor | `{"image_file_path": "api-assets/id/1234.png"}` |
75
- | `style` | ✓ | Face editing parameters | `{"enhance_face": False, "eye_gaze_horizontal": 0.0, "eye_gaze_vertical": 0.0, "eye_open_ratio": 0.0, "eyebrow_direction": 0.0, "head_pitch": 0.0, "head_roll": 0.0, "head_yaw": 0.0, "lip_open_ratio": 0.0, "mouth_grim": 0.0, "mouth_position_horizontal": 0.0, "mouth_position_vertical": 0.0, "mouth_pout": 0.0, "mouth_purse": 0.0, "mouth_smile": 0.0}` |
76
- | `name` | | The name of image | `"Face Editor image"` |
80
+ ##### Type
81
+ [V1AiFaceEditorCreateResponse](/magic_hour/types/models/v1_ai_face_editor_create_response.py)
82
+
83
+ ##### Example
84
+ `{"credits_charged": 1, "frame_cost": 1, "id": "clx7uu86w0a5qp55yxz315r6r"}`
@@ -5,6 +5,13 @@ Create an AI GIF. Each GIF costs 25 credits.
5
5
 
6
6
  **API Endpoint**: `POST /v1/ai-gif-generator`
7
7
 
8
+ #### Parameters
9
+
10
+ | Parameter | Required | Description | Example |
11
+ |-----------|:--------:|-------------|--------|
12
+ | `style` | ✓ | | `{"prompt": "Cute dancing cat, pixel art"}` |
13
+ | `name` | ✗ | The name of gif | `"Ai Gif gif"` |
14
+
8
15
  #### Synchronous Client
9
16
 
10
17
  ```python
@@ -31,9 +38,10 @@ res = await client.v1.ai_gif_generator.create(
31
38
 
32
39
  ```
33
40
 
34
- #### Parameters
41
+ #### Response
35
42
 
36
- | Parameter | Required | Description | Example |
37
- |-----------|:--------:|-------------|--------|
38
- | `style` | ✓ | | `{"prompt": "Cute dancing cat, pixel art"}` |
39
- | `name` | ✗ | The name of gif | `"Ai Gif gif"` |
43
+ ##### Type
44
+ [V1AiGifGeneratorCreateResponse](/magic_hour/types/models/v1_ai_gif_generator_create_response.py)
45
+
46
+ ##### Example
47
+ `{"credits_charged": 25, "frame_cost": 25, "id": "clx7uu86w0a5qp55yxz315r6r"}`
@@ -5,6 +5,14 @@ Create an AI headshot. Each headshot costs 50 credits.
5
5
 
6
6
  **API Endpoint**: `POST /v1/ai-headshot-generator`
7
7
 
8
+ #### Parameters
9
+
10
+ | Parameter | Required | Description | Example |
11
+ |-----------|:--------:|-------------|--------|
12
+ | `assets` | ✓ | Provide the assets for headshot photo | `{"image_file_path": "api-assets/id/1234.png"}` |
13
+ | `name` | ✗ | The name of image | `"Ai Headshot image"` |
14
+ | `style` | ✗ | | `{"prompt": "professional passport photo, business attire, smiling, good posture, light blue background, centered, plain background"}` |
15
+
8
16
  #### Synchronous Client
9
17
 
10
18
  ```python
@@ -31,10 +39,10 @@ res = await client.v1.ai_headshot_generator.create(
31
39
 
32
40
  ```
33
41
 
34
- #### Parameters
42
+ #### Response
35
43
 
36
- | Parameter | Required | Description | Example |
37
- |-----------|:--------:|-------------|--------|
38
- | `assets` | ✓ | Provide the assets for headshot photo | `{"image_file_path": "api-assets/id/1234.png"}` |
39
- | `name` | ✗ | The name of image | `"Ai Headshot image"` |
40
- | `style` | ✗ | | `{"prompt": "professional passport photo, business attire, smiling, good posture, light blue background, centered, plain background"}` |
44
+ ##### Type
45
+ [V1AiHeadshotGeneratorCreateResponse](/magic_hour/types/models/v1_ai_headshot_generator_create_response.py)
46
+
47
+ ##### Example
48
+ `{"credits_charged": 50, "frame_cost": 50, "id": "clx7uu86w0a5qp55yxz315r6r"}`
@@ -0,0 +1,52 @@
1
+
2
+ ### AI Image Editor <a name="create"></a>
3
+
4
+ Edit images with AI. Each edit costs 50 credits.
5
+
6
+ **API Endpoint**: `POST /v1/ai-image-editor`
7
+
8
+ #### Parameters
9
+
10
+ | Parameter | Required | Description | Example |
11
+ |-----------|:--------:|-------------|--------|
12
+ | `assets` | ✓ | Provide the assets for image edit | `{"image_file_path": "api-assets/id/1234.png"}` |
13
+ | `style` | ✓ | | `{"prompt": "Give me sunglasses"}` |
14
+ | `name` | ✗ | The name of image | `"Ai Image Editor image"` |
15
+
16
+ #### Synchronous Client
17
+
18
+ ```python
19
+ from magic_hour import Client
20
+ from os import getenv
21
+
22
+ client = Client(token=getenv("API_TOKEN"))
23
+ res = client.v1.ai_image_editor.create(
24
+ assets={"image_file_path": "api-assets/id/1234.png"},
25
+ style={"prompt": "Give me sunglasses"},
26
+ name="Ai Image Editor image",
27
+ )
28
+
29
+ ```
30
+
31
+ #### Asynchronous Client
32
+
33
+ ```python
34
+ from magic_hour import AsyncClient
35
+ from os import getenv
36
+
37
+ client = AsyncClient(token=getenv("API_TOKEN"))
38
+ res = await client.v1.ai_image_editor.create(
39
+ assets={"image_file_path": "api-assets/id/1234.png"},
40
+ style={"prompt": "Give me sunglasses"},
41
+ name="Ai Image Editor image",
42
+ )
43
+
44
+ ```
45
+
46
+ #### Response
47
+
48
+ ##### Type
49
+ [V1AiImageEditorCreateResponse](/magic_hour/types/models/v1_ai_image_editor_create_response.py)
50
+
51
+ ##### Example
52
+ `{"credits_charged": 50, "frame_cost": 50, "id": "clx7uu86w0a5qp55yxz315r6r"}`
@@ -0,0 +1,4 @@
1
+ from .client import AiImageEditorClient, AsyncAiImageEditorClient
2
+
3
+
4
+ __all__ = ["AiImageEditorClient", "AsyncAiImageEditorClient"]