Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions magic_hour/resources/v1/ai_clothes_changer/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def generate(
wait_for_completion=wait_for_completion,
download_outputs=download_outputs,
download_directory=download_directory,
request_options=request_options,
)

return response
Expand Down Expand Up @@ -214,6 +215,7 @@ async def generate(
wait_for_completion=wait_for_completion,
download_outputs=download_outputs,
download_directory=download_directory,
request_options=request_options,
)

return response
Expand Down
2 changes: 2 additions & 0 deletions magic_hour/resources/v1/ai_face_editor/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ def generate(
wait_for_completion=wait_for_completion,
download_outputs=download_outputs,
download_directory=download_directory,
request_options=request_options,
)

return response
Expand Down Expand Up @@ -251,6 +252,7 @@ async def generate(
wait_for_completion=wait_for_completion,
download_outputs=download_outputs,
download_directory=download_directory,
request_options=request_options,
)

return response
Expand Down
2 changes: 2 additions & 0 deletions magic_hour/resources/v1/ai_gif_generator/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def generate(
wait_for_completion=wait_for_completion,
download_outputs=download_outputs,
download_directory=download_directory,
request_options=request_options,
)

return response
Expand Down Expand Up @@ -204,6 +205,7 @@ async def generate(
wait_for_completion=wait_for_completion,
download_outputs=download_outputs,
download_directory=download_directory,
request_options=request_options,
)

return response
Expand Down
2 changes: 2 additions & 0 deletions magic_hour/resources/v1/ai_headshot_generator/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ def generate(
wait_for_completion=wait_for_completion,
download_outputs=download_outputs,
download_directory=download_directory,
request_options=request_options,
)

return response
Expand Down Expand Up @@ -209,6 +210,7 @@ async def generate(
wait_for_completion=wait_for_completion,
download_outputs=download_outputs,
download_directory=download_directory,
request_options=request_options,
)

return response
Expand Down
2 changes: 2 additions & 0 deletions magic_hour/resources/v1/ai_image_editor/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ def generate(
wait_for_completion=wait_for_completion,
download_outputs=download_outputs,
download_directory=download_directory,
request_options=request_options,
)

return response
Expand Down Expand Up @@ -456,6 +457,7 @@ async def generate(
wait_for_completion=wait_for_completion,
download_outputs=download_outputs,
download_directory=download_directory,
request_options=request_options,
)

return response
Expand Down
2 changes: 2 additions & 0 deletions magic_hour/resources/v1/ai_image_generator/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ def generate(
wait_for_completion=wait_for_completion,
download_outputs=download_outputs,
download_directory=download_directory,
request_options=request_options,
)

return response
Expand Down Expand Up @@ -434,6 +435,7 @@ async def generate(
wait_for_completion=wait_for_completion,
download_outputs=download_outputs,
download_directory=download_directory,
request_options=request_options,
)

return response
Expand Down
2 changes: 2 additions & 0 deletions magic_hour/resources/v1/ai_image_upscaler/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def generate(
wait_for_completion=wait_for_completion,
download_outputs=download_outputs,
download_directory=download_directory,
request_options=request_options,
)

return response
Expand Down Expand Up @@ -235,6 +236,7 @@ async def generate(
wait_for_completion=wait_for_completion,
download_outputs=download_outputs,
download_directory=download_directory,
request_options=request_options,
)

return response
Expand Down
2 changes: 2 additions & 0 deletions magic_hour/resources/v1/ai_meme_generator/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def generate(
wait_for_completion=wait_for_completion,
download_outputs=download_outputs,
download_directory=download_directory,
request_options=request_options,
)

return response
Expand Down Expand Up @@ -195,6 +196,7 @@ async def generate(
wait_for_completion=wait_for_completion,
download_outputs=download_outputs,
download_directory=download_directory,
request_options=request_options,
)

return response
Expand Down
2 changes: 2 additions & 0 deletions magic_hour/resources/v1/ai_qr_code_generator/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def generate(
wait_for_completion=wait_for_completion,
download_outputs=download_outputs,
download_directory=download_directory,
request_options=request_options,
)

return response
Expand Down Expand Up @@ -190,6 +191,7 @@ async def generate(
wait_for_completion=wait_for_completion,
download_outputs=download_outputs,
download_directory=download_directory,
request_options=request_options,
)

return response
Expand Down
2 changes: 2 additions & 0 deletions magic_hour/resources/v1/ai_talking_photo/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ def generate(
wait_for_completion=wait_for_completion,
download_outputs=download_outputs,
download_directory=download_directory,
request_options=request_options,
)

return response
Expand Down Expand Up @@ -269,6 +270,7 @@ async def generate(
wait_for_completion=wait_for_completion,
download_outputs=download_outputs,
download_directory=download_directory,
request_options=request_options,
)

return response
Expand Down
2 changes: 2 additions & 0 deletions magic_hour/resources/v1/ai_video_editor/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ def generate(
wait_for_completion=wait_for_completion,
download_outputs=download_outputs,
download_directory=download_directory,
request_options=request_options,
)

return response
Expand Down Expand Up @@ -311,6 +312,7 @@ async def generate(
wait_for_completion=wait_for_completion,
download_outputs=download_outputs,
download_directory=download_directory,
request_options=request_options,
)

return response
Expand Down
2 changes: 2 additions & 0 deletions magic_hour/resources/v1/ai_video_translator/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ def generate(
wait_for_completion=wait_for_completion,
download_outputs=download_outputs,
download_directory=download_directory,
request_options=request_options,
)

def create(
Expand Down Expand Up @@ -380,6 +381,7 @@ async def generate(
wait_for_completion=wait_for_completion,
download_outputs=download_outputs,
download_directory=download_directory,
request_options=request_options,
)

async def create(
Expand Down
2 changes: 2 additions & 0 deletions magic_hour/resources/v1/ai_voice_cloner/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def generate(
wait_for_completion=wait_for_completion,
download_outputs=download_outputs,
download_directory=download_directory,
request_options=request_options,
)

return response
Expand Down Expand Up @@ -213,6 +214,7 @@ async def generate(
wait_for_completion=wait_for_completion,
download_outputs=download_outputs,
download_directory=download_directory,
request_options=request_options,
)

return response
Expand Down
2 changes: 2 additions & 0 deletions magic_hour/resources/v1/ai_voice_generator/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def generate(
wait_for_completion=wait_for_completion,
download_outputs=download_outputs,
download_directory=download_directory,
request_options=request_options,
)

return response
Expand Down Expand Up @@ -187,6 +188,7 @@ async def generate(
wait_for_completion=wait_for_completion,
download_outputs=download_outputs,
download_directory=download_directory,
request_options=request_options,
)

return response
Expand Down
2 changes: 2 additions & 0 deletions magic_hour/resources/v1/animation/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ def generate(
wait_for_completion=wait_for_completion,
download_outputs=download_outputs,
download_directory=download_directory,
request_options=request_options,
)

return response
Expand Down Expand Up @@ -315,6 +316,7 @@ async def generate(
wait_for_completion=wait_for_completion,
download_outputs=download_outputs,
download_directory=download_directory,
request_options=request_options,
)

return response
Expand Down
12 changes: 8 additions & 4 deletions magic_hour/resources/v1/audio_projects/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def check_result(
wait_for_completion: bool,
download_outputs: bool,
download_directory: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> V1AudioProjectsGetResponseWithDownloads:
"""
Check the result of an audio project with optional waiting and downloading.
Expand All @@ -51,12 +52,13 @@ def check_result(
download_outputs: Whether to download the outputs
download_directory: The directory to download the outputs to. If not provided,
the outputs will be downloaded to the current working directory
request_options: Additional options to customize each project-status HTTP request.

Returns:
V1AudioProjectsGetResponseWithDownloads: The audio project response with optional
downloaded file paths included
"""
api_response = self.get(id=id)
api_response = self.get(id=id, request_options=request_options)
if not wait_for_completion:
response = V1AudioProjectsGetResponseWithDownloads(
**api_response.model_dump()
Expand All @@ -68,7 +70,7 @@ def check_result(
status = api_response.status

while status not in ["complete", "error", "canceled"]:
api_response = self.get(id=id)
api_response = self.get(id=id, request_options=request_options)
status = api_response.status
time.sleep(poll_interval)

Expand Down Expand Up @@ -178,6 +180,7 @@ async def check_result(
wait_for_completion: bool,
download_outputs: bool,
download_directory: typing.Optional[str] = None,
request_options: typing.Optional[RequestOptions] = None,
) -> V1AudioProjectsGetResponseWithDownloads:
"""
Check the result of an audio project with optional waiting and downloading.
Expand All @@ -191,12 +194,13 @@ async def check_result(
download_outputs: Whether to download the outputs
download_directory: The directory to download the outputs to. If not provided,
the outputs will be downloaded to the current working directory
request_options: Additional options to customize each project-status HTTP request.

Returns:
V1AudioProjectsGetResponseWithDownloads: The audio project response with optional
downloaded file paths included
"""
api_response = await self.get(id=id)
api_response = await self.get(id=id, request_options=request_options)
if not wait_for_completion:
response = V1AudioProjectsGetResponseWithDownloads(
**api_response.model_dump()
Expand All @@ -208,7 +212,7 @@ async def check_result(
status = api_response.status

while status not in ["complete", "error", "canceled"]:
api_response = await self.get(id=id)
api_response = await self.get(id=id, request_options=request_options)
status = api_response.status
time.sleep(poll_interval)

Expand Down
2 changes: 2 additions & 0 deletions magic_hour/resources/v1/audio_to_video/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ def generate(
wait_for_completion=wait_for_completion,
download_outputs=download_outputs,
download_directory=download_directory,
request_options=request_options,
)

return response
Expand Down Expand Up @@ -308,6 +309,7 @@ async def generate(
wait_for_completion=wait_for_completion,
download_outputs=download_outputs,
download_directory=download_directory,
request_options=request_options,
)

return response
Expand Down
2 changes: 2 additions & 0 deletions magic_hour/resources/v1/auto_subtitle_generator/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ def generate(
wait_for_completion=wait_for_completion,
download_outputs=download_outputs,
download_directory=download_directory,
request_options=request_options,
)

return response
Expand Down Expand Up @@ -267,6 +268,7 @@ async def generate(
wait_for_completion=wait_for_completion,
download_outputs=download_outputs,
download_directory=download_directory,
request_options=request_options,
)

return response
Expand Down
2 changes: 2 additions & 0 deletions magic_hour/resources/v1/body_swap/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def generate(
wait_for_completion=wait_for_completion,
download_outputs=download_outputs,
download_directory=download_directory,
request_options=request_options,
)

return response
Expand Down Expand Up @@ -225,6 +226,7 @@ async def generate(
wait_for_completion=wait_for_completion,
download_outputs=download_outputs,
download_directory=download_directory,
request_options=request_options,
)

return response
Expand Down
2 changes: 2 additions & 0 deletions magic_hour/resources/v1/character_replace/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ def generate(
wait_for_completion=wait_for_completion,
download_outputs=download_outputs,
download_directory=download_directory,
request_options=request_options,
)

return response
Expand Down Expand Up @@ -338,6 +339,7 @@ async def generate(
wait_for_completion=wait_for_completion,
download_outputs=download_outputs,
download_directory=download_directory,
request_options=request_options,
)

return response
Expand Down
Loading
Loading