diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 1abd715..aab82c2 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "5.14.0" + ".": "5.15.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 53d280f..9d90380 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 63 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runwayml/runwayml-61ede23e7f824f2713cf355317945b22af4ce8c00e247dff73695506569b7f09.yml -openapi_spec_hash: 377f276334721ace39ca5f97395bb336 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runwayml/runwayml-673462285f9cc77f80b538a726a55a7d003ce89b0dd5aeacf45b3901459abfa7.yml +openapi_spec_hash: 130cf273e4489beb3b7e2922f1ff26ae config_hash: 8bd51a43d85b7a841080e78e6f673b63 diff --git a/CHANGELOG.md b/CHANGELOG.md index f1d9c87..9f0b40c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 5.15.0 (2026-08-18) + +Full Changelog: [v5.14.0...v5.15.0](https://github.com/runwayml/sdk-python/compare/v5.14.0...v5.15.0) + +### Features + +* **api:** Seedance 2.5 1080p, Grok Imagine Video 1.5, Grok Imagine Image 2 ([46f53db](https://github.com/runwayml/sdk-python/commit/46f53dbc5ea2a643bacaf4a702974c5baebd45a0)) + + +### Bug Fixes + +* **client:** make grok_imagine_1_5 and grok_imagine_image_2 responses awaitable ([87046d8](https://github.com/runwayml/sdk-python/commit/87046d8135245b0b694ff03b8344c2c53a0ce012)) + ## 5.14.0 (2026-08-13) Full Changelog: [v5.13.0...v5.14.0](https://github.com/runwayml/sdk-python/compare/v5.13.0...v5.14.0) diff --git a/pyproject.toml b/pyproject.toml index 3147b3b..61d041f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runwayml" -version = "5.14.0" +version = "5.15.0" description = "The official Python library for the runwayml API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/runwayml/_version.py b/src/runwayml/_version.py index 98917ed..b915d04 100644 --- a/src/runwayml/_version.py +++ b/src/runwayml/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runwayml" -__version__ = "5.14.0" # x-release-please-version +__version__ = "5.15.0" # x-release-please-version diff --git a/src/runwayml/resources/image_to_video.py b/src/runwayml/resources/image_to_video.py index 5c1b51e..01b1e5a 100644 --- a/src/runwayml/resources/image_to_video.py +++ b/src/runwayml/resources/image_to_video.py @@ -603,6 +603,12 @@ def create( "960:960", "834:1112", "720:1280", + "2206:946", + "1920:1080", + "1664:1248", + "1440:1440", + "1248:1664", + "1080:1920", ] | Omit = omit, reference_audio: Iterable[image_to_video_create_params.Seedance2_5ReferenceAudio] | Omit = omit, @@ -627,7 +633,7 @@ def create( prompt_text: An optional text prompt up to 15000 characters describing what should appear in the output. - ratio: The resolution of the output video. Seedance 2.5 supports 480p and 720p only. + ratio: The resolution of the output video. Seedance 2.5 supports 480p, 720p, and 1080p. reference_audio: An optional array of audio references. The total combined duration must not exceed 30 seconds. @@ -642,6 +648,46 @@ def create( """ ... + @overload + def create( + self, + *, + model: Literal["grok_imagine_1_5"], + prompt_image: Union[str, Iterable[image_to_video_create_params.GrokImagine1_5PromptImagePromptImage]], + duration: int | Omit = omit, + prompt_text: str | Omit = omit, + resolution: Literal["480p", "720p", "1080p"] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> NewTaskCreatedResponse: + """ + This endpoint will start a new task to generate a video from an image. + + Args: + prompt_image: A HTTPS URL, Runway upload URI, or base64 data URI (e.g. + `data:image/png;base64,...`, up to 5MB) containing an encoded image. See + [our docs](/assets/inputs#images) on image inputs for more information. + + duration: The number of seconds of duration for the output video. + + prompt_text: An optional text prompt describing motion or changes in the output video. + + resolution: The output resolution. Output aspect ratio follows the input image. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + @required_args( ["duration", "model", "prompt_image", "prompt_text", "ratio"], ["model", "prompt_image", "ratio"], @@ -662,7 +708,8 @@ def create( | Literal["seedance2_fast"] | Literal["seedance2_mini"] | Literal["gemini_omni_flash"] - | Literal["seedance2_5"], + | Literal["seedance2_5"] + | Literal["grok_imagine_1_5"], prompt_image: Union[str, Iterable[image_to_video_create_params.Gen4_5PromptImagePromptImage]] | Union[str, Iterable[image_to_video_create_params.Gen4TurboPromptImagePromptImage]] | Union[str, Iterable[image_to_video_create_params.Veo3_1PromptImagePromptImage]] @@ -673,7 +720,8 @@ def create( | Union[str, Iterable[image_to_video_create_params.Seedance2FastPromptImagePromptImage]] | Union[str, Iterable[image_to_video_create_params.Seedance2MiniPromptImagePromptImage]] | Union[str, Iterable[image_to_video_create_params.GeminiOmniFlashPromptImagePromptImage]] - | Union[str, Iterable[image_to_video_create_params.Seedance2_5PromptImagePromptImage]], + | Union[str, Iterable[image_to_video_create_params.Seedance2_5PromptImagePromptImage]] + | Union[str, Iterable[image_to_video_create_params.GrokImagine1_5PromptImagePromptImage]], prompt_text: str | Omit = omit, ratio: Literal["1280:720", "720:1280", "1104:832", "960:960", "832:1104", "1584:672"] | Literal["1280:720", "720:1280", "1104:832", "832:1104", "960:960", "1584:672"] @@ -733,6 +781,12 @@ def create( "960:960", "834:1112", "720:1280", + "2206:946", + "1920:1080", + "1664:1248", + "1440:1440", + "1248:1664", + "1080:1920", ] | Omit = omit, content_moderation: image_to_video_create_params.Gen4_5ContentModeration @@ -749,7 +803,7 @@ def create( | Iterable[image_to_video_create_params.Seedance2MiniReferenceAudio] | Iterable[image_to_video_create_params.Seedance2_5ReferenceAudio] | Omit = omit, - resolution: Literal["2K", "768P"] | Literal["720P", "1080P"] | Omit = omit, + resolution: Literal["2K", "768P"] | Literal["720P", "1080P"] | Literal["480p", "720p", "1080p"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1357,6 +1411,12 @@ async def create( "960:960", "834:1112", "720:1280", + "2206:946", + "1920:1080", + "1664:1248", + "1440:1440", + "1248:1664", + "1080:1920", ] | Omit = omit, reference_audio: Iterable[image_to_video_create_params.Seedance2_5ReferenceAudio] | Omit = omit, @@ -1381,7 +1441,7 @@ async def create( prompt_text: An optional text prompt up to 15000 characters describing what should appear in the output. - ratio: The resolution of the output video. Seedance 2.5 supports 480p and 720p only. + ratio: The resolution of the output video. Seedance 2.5 supports 480p, 720p, and 1080p. reference_audio: An optional array of audio references. The total combined duration must not exceed 30 seconds. @@ -1396,6 +1456,46 @@ async def create( """ ... + @overload + async def create( + self, + *, + model: Literal["grok_imagine_1_5"], + prompt_image: Union[str, Iterable[image_to_video_create_params.GrokImagine1_5PromptImagePromptImage]], + duration: int | Omit = omit, + prompt_text: str | Omit = omit, + resolution: Literal["480p", "720p", "1080p"] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncNewTaskCreatedResponse: + """ + This endpoint will start a new task to generate a video from an image. + + Args: + prompt_image: A HTTPS URL, Runway upload URI, or base64 data URI (e.g. + `data:image/png;base64,...`, up to 5MB) containing an encoded image. See + [our docs](/assets/inputs#images) on image inputs for more information. + + duration: The number of seconds of duration for the output video. + + prompt_text: An optional text prompt describing motion or changes in the output video. + + resolution: The output resolution. Output aspect ratio follows the input image. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + @required_args( ["duration", "model", "prompt_image", "prompt_text", "ratio"], ["model", "prompt_image", "ratio"], @@ -1416,7 +1516,8 @@ async def create( | Literal["seedance2_fast"] | Literal["seedance2_mini"] | Literal["gemini_omni_flash"] - | Literal["seedance2_5"], + | Literal["seedance2_5"] + | Literal["grok_imagine_1_5"], prompt_image: Union[str, Iterable[image_to_video_create_params.Gen4_5PromptImagePromptImage]] | Union[str, Iterable[image_to_video_create_params.Gen4TurboPromptImagePromptImage]] | Union[str, Iterable[image_to_video_create_params.Veo3_1PromptImagePromptImage]] @@ -1427,7 +1528,8 @@ async def create( | Union[str, Iterable[image_to_video_create_params.Seedance2FastPromptImagePromptImage]] | Union[str, Iterable[image_to_video_create_params.Seedance2MiniPromptImagePromptImage]] | Union[str, Iterable[image_to_video_create_params.GeminiOmniFlashPromptImagePromptImage]] - | Union[str, Iterable[image_to_video_create_params.Seedance2_5PromptImagePromptImage]], + | Union[str, Iterable[image_to_video_create_params.Seedance2_5PromptImagePromptImage]] + | Union[str, Iterable[image_to_video_create_params.GrokImagine1_5PromptImagePromptImage]], prompt_text: str | Omit = omit, ratio: Literal["1280:720", "720:1280", "1104:832", "960:960", "832:1104", "1584:672"] | Literal["1280:720", "720:1280", "1104:832", "832:1104", "960:960", "1584:672"] @@ -1487,6 +1589,12 @@ async def create( "960:960", "834:1112", "720:1280", + "2206:946", + "1920:1080", + "1664:1248", + "1440:1440", + "1248:1664", + "1080:1920", ] | Omit = omit, content_moderation: image_to_video_create_params.Gen4_5ContentModeration @@ -1503,7 +1611,7 @@ async def create( | Iterable[image_to_video_create_params.Seedance2MiniReferenceAudio] | Iterable[image_to_video_create_params.Seedance2_5ReferenceAudio] | Omit = omit, - resolution: Literal["2K", "768P"] | Literal["720P", "1080P"] | Omit = omit, + resolution: Literal["2K", "768P"] | Literal["720P", "1080P"] | Literal["480p", "720p", "1080p"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/runwayml/resources/text_to_image.py b/src/runwayml/resources/text_to_image.py index 303aad8..63fce8e 100644 --- a/src/runwayml/resources/text_to_image.py +++ b/src/runwayml/resources/text_to_image.py @@ -562,6 +562,87 @@ def create( """ ... + @overload + def create( + self, + *, + model: Literal["grok_imagine_image_2"], + prompt_text: str, + ratio: Literal[ + "1024:1024", + "1280:720", + "720:1280", + "1152:864", + "864:1152", + "1248:832", + "832:1248", + "1248:576", + "576:1248", + "1280:576", + "576:1280", + "1408:704", + "704:1408", + "2048:2048", + "2816:1584", + "1584:2816", + "2368:1776", + "1776:2368", + "2496:1664", + "1664:2496", + "2912:1344", + "1344:2912", + "3200:1440", + "1440:3200", + "2912:1456", + "1456:2912", + "auto_1k", + "auto_2k", + ], + edit: bool | Omit = omit, + output_count: int | Omit = omit, + quality: Literal["low", "medium"] | Omit = omit, + reference_images: Iterable[text_to_image_create_params.GrokImagineImage2ReferenceImage] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> NewTaskCreatedResponse: + """ + This endpoint will start a new task to generate images from text and/or image(s) + + Args: + prompt_text: A non-empty text prompt describing what should appear in the output image. + + ratio: The resolution of the output image, expressed as `:`. 2K ratios + cost 2 additional credits per image. Use `auto_1k` or `auto_2k` to pick a + resolution tier and let the model choose the framing from the prompt. + + edit: When true with exactly one reference image, edit that image directly instead of + using it as a loose visual reference. With several reference images the prompt + describes how they should be edited or combined. Requires at least one reference + image. + + output_count: The number of images to generate. Increasing this number will affect the number + of credits consumed by the generation. + + quality: How much rendering effort the model spends on the output. Defaults to `medium`; + `low` is faster and costs 2 fewer credits per image. + + reference_images: Up to 3 images to guide the generation. Reference them from `promptText` to + describe how each should be used. Each adds 1 credit to the generation. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + @overload def create( self, @@ -620,6 +701,7 @@ def create( | Literal["gemini_image3.1_flash"] | Literal["seedream5_pro"] | Literal["seedream5_lite"] + | Literal["grok_imagine_image_2"] | Literal["gemini_2.5_flash"], prompt_text: str, ratio: Literal[ @@ -799,6 +881,36 @@ def create( "2496:3744", "4704:2016", ] + | Literal[ + "1024:1024", + "1280:720", + "720:1280", + "1152:864", + "864:1152", + "1248:832", + "832:1248", + "1248:576", + "576:1248", + "1280:576", + "576:1280", + "1408:704", + "704:1408", + "2048:2048", + "2816:1584", + "1584:2816", + "2368:1776", + "1776:2368", + "2496:1664", + "1664:2496", + "2912:1344", + "1344:2912", + "3200:1440", + "1440:3200", + "2912:1456", + "1456:2912", + "auto_1k", + "auto_2k", + ] | Literal[ "1344:768", "768:1344", @@ -818,6 +930,7 @@ def create( | Iterable[text_to_image_create_params.GeminiImage3_1FlashReferenceImage] | Iterable[text_to_image_create_params.Seedream5ProReferenceImage] | Iterable[text_to_image_create_params.Seedream5LiteReferenceImage] + | Iterable[text_to_image_create_params.GrokImagineImage2ReferenceImage] | Iterable[text_to_image_create_params.Gemini2_5FlashReferenceImage] | Omit = omit, content_moderation: text_to_image_create_params.Gen4ImageTurboContentModeration @@ -826,9 +939,10 @@ def create( seed: int | Omit = omit, background: Literal["opaque", "auto"] | Omit = omit, output_count: int | Literal[1, 4] | Omit = omit, - quality: Literal["low", "medium", "high", "auto"] | Omit = omit, + quality: Literal["low", "medium", "high", "auto"] | Literal["low", "medium"] | Omit = omit, grounding: bool | Omit = omit, output_format: Literal["png", "jpeg"] | Omit = omit, + edit: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -851,6 +965,7 @@ def create( "quality": quality, "grounding": grounding, "output_format": output_format, + "edit": edit, }, text_to_image_create_params.TextToImageCreateParams, ), @@ -1393,6 +1508,87 @@ async def create( """ ... + @overload + async def create( + self, + *, + model: Literal["grok_imagine_image_2"], + prompt_text: str, + ratio: Literal[ + "1024:1024", + "1280:720", + "720:1280", + "1152:864", + "864:1152", + "1248:832", + "832:1248", + "1248:576", + "576:1248", + "1280:576", + "576:1280", + "1408:704", + "704:1408", + "2048:2048", + "2816:1584", + "1584:2816", + "2368:1776", + "1776:2368", + "2496:1664", + "1664:2496", + "2912:1344", + "1344:2912", + "3200:1440", + "1440:3200", + "2912:1456", + "1456:2912", + "auto_1k", + "auto_2k", + ], + edit: bool | Omit = omit, + output_count: int | Omit = omit, + quality: Literal["low", "medium"] | Omit = omit, + reference_images: Iterable[text_to_image_create_params.GrokImagineImage2ReferenceImage] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncNewTaskCreatedResponse: + """ + This endpoint will start a new task to generate images from text and/or image(s) + + Args: + prompt_text: A non-empty text prompt describing what should appear in the output image. + + ratio: The resolution of the output image, expressed as `:`. 2K ratios + cost 2 additional credits per image. Use `auto_1k` or `auto_2k` to pick a + resolution tier and let the model choose the framing from the prompt. + + edit: When true with exactly one reference image, edit that image directly instead of + using it as a loose visual reference. With several reference images the prompt + describes how they should be edited or combined. Requires at least one reference + image. + + output_count: The number of images to generate. Increasing this number will affect the number + of credits consumed by the generation. + + quality: How much rendering effort the model spends on the output. Defaults to `medium`; + `low` is faster and costs 2 fewer credits per image. + + reference_images: Up to 3 images to guide the generation. Reference them from `promptText` to + describe how each should be used. Each adds 1 credit to the generation. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + @overload async def create( self, @@ -1451,6 +1647,7 @@ async def create( | Literal["gemini_image3.1_flash"] | Literal["seedream5_pro"] | Literal["seedream5_lite"] + | Literal["grok_imagine_image_2"] | Literal["gemini_2.5_flash"], prompt_text: str, ratio: Literal[ @@ -1630,6 +1827,36 @@ async def create( "2496:3744", "4704:2016", ] + | Literal[ + "1024:1024", + "1280:720", + "720:1280", + "1152:864", + "864:1152", + "1248:832", + "832:1248", + "1248:576", + "576:1248", + "1280:576", + "576:1280", + "1408:704", + "704:1408", + "2048:2048", + "2816:1584", + "1584:2816", + "2368:1776", + "1776:2368", + "2496:1664", + "1664:2496", + "2912:1344", + "1344:2912", + "3200:1440", + "1440:3200", + "2912:1456", + "1456:2912", + "auto_1k", + "auto_2k", + ] | Literal[ "1344:768", "768:1344", @@ -1649,6 +1876,7 @@ async def create( | Iterable[text_to_image_create_params.GeminiImage3_1FlashReferenceImage] | Iterable[text_to_image_create_params.Seedream5ProReferenceImage] | Iterable[text_to_image_create_params.Seedream5LiteReferenceImage] + | Iterable[text_to_image_create_params.GrokImagineImage2ReferenceImage] | Iterable[text_to_image_create_params.Gemini2_5FlashReferenceImage] | Omit = omit, content_moderation: text_to_image_create_params.Gen4ImageTurboContentModeration @@ -1657,9 +1885,10 @@ async def create( seed: int | Omit = omit, background: Literal["opaque", "auto"] | Omit = omit, output_count: int | Literal[1, 4] | Omit = omit, - quality: Literal["low", "medium", "high", "auto"] | Omit = omit, + quality: Literal["low", "medium", "high", "auto"] | Literal["low", "medium"] | Omit = omit, grounding: bool | Omit = omit, output_format: Literal["png", "jpeg"] | Omit = omit, + edit: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1682,6 +1911,7 @@ async def create( "quality": quality, "grounding": grounding, "output_format": output_format, + "edit": edit, }, text_to_image_create_params.TextToImageCreateParams, ), diff --git a/src/runwayml/resources/text_to_video.py b/src/runwayml/resources/text_to_video.py index 53e12cc..e698b56 100644 --- a/src/runwayml/resources/text_to_video.py +++ b/src/runwayml/resources/text_to_video.py @@ -560,6 +560,12 @@ def create( "960:960", "834:1112", "720:1280", + "2206:946", + "1920:1080", + "1664:1248", + "1440:1440", + "1248:1664", + "1080:1920", ] | Omit = omit, reference_audio: Iterable[text_to_video_create_params.Seedance2_5ReferenceAudio] | Omit = omit, @@ -583,7 +589,7 @@ def create( prompt_text: An optional text prompt up to 15000 characters describing what should appear in the output. - ratio: The resolution of the output video. Seedance 2.5 supports 480p and 720p only. + ratio: The resolution of the output video. Seedance 2.5 supports 480p, 720p, and 1080p. reference_audio: An optional array of audio references. The total combined duration must be less than 30 seconds. @@ -605,6 +611,53 @@ def create( """ ... + @overload + def create( + self, + *, + model: Literal["grok_imagine_1_5"], + prompt_text: str, + duration: int | Omit = omit, + ratio: Literal["1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3"] | Omit = omit, + reference_audio: Iterable[text_to_video_create_params.GrokImagine1_5ReferenceAudio] | Omit = omit, + references: Iterable[text_to_video_create_params.GrokImagine1_5Reference] | Omit = omit, + resolution: Literal["480p", "720p", "1080p"] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> NewTaskCreatedResponse: + """ + This endpoint will start a new task to generate a video from a text prompt. + + Args: + prompt_text: A non-empty text prompt describing what should appear in the output. + + duration: The number of seconds of duration for the output video. + + ratio: The aspect ratio of the output video. + + reference_audio: An optional array of audio references. Audio references require at least one + image reference, and each clip must be between 3 and 15 seconds. + + references: An optional array of image references. Referenced images can be addressed in the + prompt as [Image 1], [Image 2], and so on. See [our docs](/assets/inputs#images) + on image inputs for more information. + + resolution: The output resolution. Requests with image references are capped at 720p. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + @required_args( ["duration", "model", "prompt_text", "ratio"], ["model", "prompt_text", "ratio"], @@ -624,7 +677,8 @@ def create( | Literal["seedance2_fast"] | Literal["seedance2_mini"] | Literal["gemini_omni_flash"] - | Literal["seedance2_5"], + | Literal["seedance2_5"] + | Literal["grok_imagine_1_5"], prompt_text: str | Omit = omit, ratio: Literal["1280:720", "720:1280"] | Literal["1280:720", "720:1280", "1080:1920", "1920:1080"] @@ -694,7 +748,14 @@ def create( "960:960", "834:1112", "720:1280", + "2206:946", + "1920:1080", + "1664:1248", + "1440:1440", + "1248:1664", + "1080:1920", ] + | Literal["1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3"] | Omit = omit, content_moderation: text_to_video_create_params.Gen4_5ContentModeration | Omit = omit, output_format: Literal["mp4", "prores", "png_sequence"] | Omit = omit, @@ -707,12 +768,14 @@ def create( | Iterable[text_to_video_create_params.Seedance2FastReferenceAudio] | Iterable[text_to_video_create_params.Seedance2MiniReferenceAudio] | Iterable[text_to_video_create_params.Seedance2_5ReferenceAudio] + | Iterable[text_to_video_create_params.GrokImagine1_5ReferenceAudio] | Omit = omit, references: Iterable[text_to_video_create_params.Hailuo3Reference] | Iterable[text_to_video_create_params.Seedance2Reference] | Iterable[text_to_video_create_params.Seedance2FastReference] | Iterable[text_to_video_create_params.Seedance2MiniReference] | Iterable[text_to_video_create_params.Seedance2_5Reference] + | Iterable[text_to_video_create_params.GrokImagine1_5Reference] | Omit = omit, reference_videos: Iterable[text_to_video_create_params.Hailuo3ReferenceVideo] | Iterable[text_to_video_create_params.Seedance2ReferenceVideo] @@ -720,7 +783,7 @@ def create( | Iterable[text_to_video_create_params.Seedance2MiniReferenceVideo] | Iterable[text_to_video_create_params.Seedance2_5ReferenceVideo] | Omit = omit, - resolution: Literal["2K", "768P"] | Omit = omit, + resolution: Literal["2K", "768P"] | Literal["480p", "720p", "1080p"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1286,6 +1349,12 @@ async def create( "960:960", "834:1112", "720:1280", + "2206:946", + "1920:1080", + "1664:1248", + "1440:1440", + "1248:1664", + "1080:1920", ] | Omit = omit, reference_audio: Iterable[text_to_video_create_params.Seedance2_5ReferenceAudio] | Omit = omit, @@ -1309,7 +1378,7 @@ async def create( prompt_text: An optional text prompt up to 15000 characters describing what should appear in the output. - ratio: The resolution of the output video. Seedance 2.5 supports 480p and 720p only. + ratio: The resolution of the output video. Seedance 2.5 supports 480p, 720p, and 1080p. reference_audio: An optional array of audio references. The total combined duration must be less than 30 seconds. @@ -1331,6 +1400,53 @@ async def create( """ ... + @overload + async def create( + self, + *, + model: Literal["grok_imagine_1_5"], + prompt_text: str, + duration: int | Omit = omit, + ratio: Literal["1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3"] | Omit = omit, + reference_audio: Iterable[text_to_video_create_params.GrokImagine1_5ReferenceAudio] | Omit = omit, + references: Iterable[text_to_video_create_params.GrokImagine1_5Reference] | Omit = omit, + resolution: Literal["480p", "720p", "1080p"] | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncNewTaskCreatedResponse: + """ + This endpoint will start a new task to generate a video from a text prompt. + + Args: + prompt_text: A non-empty text prompt describing what should appear in the output. + + duration: The number of seconds of duration for the output video. + + ratio: The aspect ratio of the output video. + + reference_audio: An optional array of audio references. Audio references require at least one + image reference, and each clip must be between 3 and 15 seconds. + + references: An optional array of image references. Referenced images can be addressed in the + prompt as [Image 1], [Image 2], and so on. See [our docs](/assets/inputs#images) + on image inputs for more information. + + resolution: The output resolution. Requests with image references are capped at 720p. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + @required_args( ["duration", "model", "prompt_text", "ratio"], ["model", "prompt_text", "ratio"], @@ -1350,7 +1466,8 @@ async def create( | Literal["seedance2_fast"] | Literal["seedance2_mini"] | Literal["gemini_omni_flash"] - | Literal["seedance2_5"], + | Literal["seedance2_5"] + | Literal["grok_imagine_1_5"], prompt_text: str | Omit = omit, ratio: Literal["1280:720", "720:1280"] | Literal["1280:720", "720:1280", "1080:1920", "1920:1080"] @@ -1420,7 +1537,14 @@ async def create( "960:960", "834:1112", "720:1280", + "2206:946", + "1920:1080", + "1664:1248", + "1440:1440", + "1248:1664", + "1080:1920", ] + | Literal["1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3"] | Omit = omit, content_moderation: text_to_video_create_params.Gen4_5ContentModeration | Omit = omit, output_format: Literal["mp4", "prores", "png_sequence"] | Omit = omit, @@ -1433,12 +1557,14 @@ async def create( | Iterable[text_to_video_create_params.Seedance2FastReferenceAudio] | Iterable[text_to_video_create_params.Seedance2MiniReferenceAudio] | Iterable[text_to_video_create_params.Seedance2_5ReferenceAudio] + | Iterable[text_to_video_create_params.GrokImagine1_5ReferenceAudio] | Omit = omit, references: Iterable[text_to_video_create_params.Hailuo3Reference] | Iterable[text_to_video_create_params.Seedance2Reference] | Iterable[text_to_video_create_params.Seedance2FastReference] | Iterable[text_to_video_create_params.Seedance2MiniReference] | Iterable[text_to_video_create_params.Seedance2_5Reference] + | Iterable[text_to_video_create_params.GrokImagine1_5Reference] | Omit = omit, reference_videos: Iterable[text_to_video_create_params.Hailuo3ReferenceVideo] | Iterable[text_to_video_create_params.Seedance2ReferenceVideo] @@ -1446,7 +1572,7 @@ async def create( | Iterable[text_to_video_create_params.Seedance2MiniReferenceVideo] | Iterable[text_to_video_create_params.Seedance2_5ReferenceVideo] | Omit = omit, - resolution: Literal["2K", "768P"] | Omit = omit, + resolution: Literal["2K", "768P"] | Literal["480p", "720p", "1080p"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/runwayml/resources/video_to_video.py b/src/runwayml/resources/video_to_video.py index 80e5902..b2ca4ae 100644 --- a/src/runwayml/resources/video_to_video.py +++ b/src/runwayml/resources/video_to_video.py @@ -457,6 +457,12 @@ def create( "960:960", "834:1112", "720:1280", + "2206:946", + "1920:1080", + "1664:1248", + "1440:1440", + "1248:1664", + "1080:1920", ] | Omit = omit, reference_audio: Iterable[video_to_video_create_params.Seedance2_5ReferenceAudio] | Omit = omit, @@ -489,7 +495,7 @@ def create( prompt_text: An optional text prompt up to 15000 characters describing what should appear in the output. - ratio: The resolution of the output video. Seedance 2.5 supports 480p and 720p only. + ratio: The resolution of the output video. Seedance 2.5 supports 480p, 720p, and 1080p. reference_audio: An optional array of audio references. The total combined duration must be less than 30 seconds. @@ -588,6 +594,12 @@ def create( "960:960", "834:1112", "720:1280", + "2206:946", + "1920:1080", + "1664:1248", + "1440:1440", + "1248:1664", + "1080:1920", ] | Omit = omit, seed: int | Omit = omit, @@ -1082,6 +1094,12 @@ async def create( "960:960", "834:1112", "720:1280", + "2206:946", + "1920:1080", + "1664:1248", + "1440:1440", + "1248:1664", + "1080:1920", ] | Omit = omit, reference_audio: Iterable[video_to_video_create_params.Seedance2_5ReferenceAudio] | Omit = omit, @@ -1114,7 +1132,7 @@ async def create( prompt_text: An optional text prompt up to 15000 characters describing what should appear in the output. - ratio: The resolution of the output video. Seedance 2.5 supports 480p and 720p only. + ratio: The resolution of the output video. Seedance 2.5 supports 480p, 720p, and 1080p. reference_audio: An optional array of audio references. The total combined duration must be less than 30 seconds. @@ -1213,6 +1231,12 @@ async def create( "960:960", "834:1112", "720:1280", + "2206:946", + "1920:1080", + "1664:1248", + "1440:1440", + "1248:1664", + "1080:1920", ] | Omit = omit, seed: int | Omit = omit, diff --git a/src/runwayml/types/image_to_video_create_params.py b/src/runwayml/types/image_to_video_create_params.py index 3c7adef..53b7148 100644 --- a/src/runwayml/types/image_to_video_create_params.py +++ b/src/runwayml/types/image_to_video_create_params.py @@ -37,6 +37,8 @@ "Seedance2_5", "Seedance2_5PromptImagePromptImage", "Seedance2_5ReferenceAudio", + "GrokImagine1_5", + "GrokImagine1_5PromptImagePromptImage", ] @@ -696,8 +698,17 @@ class Seedance2_5(TypedDict, total=False): "960:960", "834:1112", "720:1280", + "2206:946", + "1920:1080", + "1664:1248", + "1440:1440", + "1248:1664", + "1080:1920", ] - """The resolution of the output video. Seedance 2.5 supports 480p and 720p only.""" + """The resolution of the output video. + + Seedance 2.5 supports 480p, 720p, and 1080p. + """ reference_audio: Annotated[Iterable[Seedance2_5ReferenceAudio], PropertyInfo(alias="referenceAudio")] """An optional array of audio references. @@ -737,6 +748,43 @@ class Seedance2_5ReferenceAudio(TypedDict, total=False): """ +class GrokImagine1_5(TypedDict, total=False): + model: Required[Literal["grok_imagine_1_5"]] + + prompt_image: Required[ + Annotated[Union[str, Iterable[GrokImagine1_5PromptImagePromptImage]], PropertyInfo(alias="promptImage")] + ] + """A HTTPS URL, Runway upload URI, or base64 data URI (e.g. + + `data:image/png;base64,...`, up to 5MB) containing an encoded image. See + [our docs](/assets/inputs#images) on image inputs for more information. + """ + + duration: int + """The number of seconds of duration for the output video.""" + + prompt_text: Annotated[str, PropertyInfo(alias="promptText")] + """An optional text prompt describing motion or changes in the output video.""" + + resolution: Literal["480p", "720p", "1080p"] + """The output resolution. Output aspect ratio follows the input image.""" + + +class GrokImagine1_5PromptImagePromptImage(TypedDict, total=False): + position: Required[Literal["first"]] + """The position of the image in the output video. + + "first" will use the image as the first frame of the video. + """ + + uri: Required[str] + """A HTTPS URL, Runway upload URI, or base64 data URI (e.g. + + `data:image/png;base64,...`, up to 5MB) containing an encoded image. See + [our docs](/assets/inputs#images) on image inputs for more information. + """ + + ImageToVideoCreateParams: TypeAlias = Union[ Gen4_5, Gen4Turbo, @@ -749,4 +797,5 @@ class Seedance2_5ReferenceAudio(TypedDict, total=False): Seedance2Mini, GeminiOmniFlash, Seedance2_5, + GrokImagine1_5, ] diff --git a/src/runwayml/types/text_to_image_create_params.py b/src/runwayml/types/text_to_image_create_params.py index 69cb0f9..d7008ab 100644 --- a/src/runwayml/types/text_to_image_create_params.py +++ b/src/runwayml/types/text_to_image_create_params.py @@ -25,6 +25,8 @@ "Seedream5ProReferenceImage", "Seedream5Lite", "Seedream5LiteReferenceImage", + "GrokImagineImage2", + "GrokImagineImage2ReferenceImage", "Gemini2_5Flash", "Gemini2_5FlashReferenceImage", ] @@ -583,6 +585,88 @@ class Seedream5LiteReferenceImage(TypedDict, total=False): """ +class GrokImagineImage2(TypedDict, total=False): + model: Required[Literal["grok_imagine_image_2"]] + + prompt_text: Required[Annotated[str, PropertyInfo(alias="promptText")]] + """A non-empty text prompt describing what should appear in the output image.""" + + ratio: Required[ + Literal[ + "1024:1024", + "1280:720", + "720:1280", + "1152:864", + "864:1152", + "1248:832", + "832:1248", + "1248:576", + "576:1248", + "1280:576", + "576:1280", + "1408:704", + "704:1408", + "2048:2048", + "2816:1584", + "1584:2816", + "2368:1776", + "1776:2368", + "2496:1664", + "1664:2496", + "2912:1344", + "1344:2912", + "3200:1440", + "1440:3200", + "2912:1456", + "1456:2912", + "auto_1k", + "auto_2k", + ] + ] + """The resolution of the output image, expressed as `:`. + + 2K ratios cost 2 additional credits per image. Use `auto_1k` or `auto_2k` to + pick a resolution tier and let the model choose the framing from the prompt. + """ + + edit: bool + """ + When true with exactly one reference image, edit that image directly instead of + using it as a loose visual reference. With several reference images the prompt + describes how they should be edited or combined. Requires at least one reference + image. + """ + + output_count: Annotated[int, PropertyInfo(alias="outputCount")] + """The number of images to generate. + + Increasing this number will affect the number of credits consumed by the + generation. + """ + + quality: Literal["low", "medium"] + """How much rendering effort the model spends on the output. + + Defaults to `medium`; `low` is faster and costs 2 fewer credits per image. + """ + + reference_images: Annotated[Iterable[GrokImagineImage2ReferenceImage], PropertyInfo(alias="referenceImages")] + """Up to 3 images to guide the generation. + + Reference them from `promptText` to describe how each should be used. Each adds + 1 credit to the generation. + """ + + +class GrokImagineImage2ReferenceImage(TypedDict, total=False): + uri: Required[str] + """A HTTPS URL, Runway upload URI, or base64 data URI (e.g. + + `data:image/png;base64,...`, up to 5MB) containing an encoded image. See + [our docs](/assets/inputs#images) on image inputs for more information. + """ + + class Gemini2_5Flash(TypedDict, total=False): model: Required[Literal["gemini_2.5_flash"]] @@ -637,5 +721,6 @@ class Gemini2_5FlashReferenceImage(TypedDict, total=False): GeminiImage3_1Flash, Seedream5Pro, Seedream5Lite, + GrokImagineImage2, Gemini2_5Flash, ] diff --git a/src/runwayml/types/text_to_video_create_params.py b/src/runwayml/types/text_to_video_create_params.py index f35ff12..c618ce7 100644 --- a/src/runwayml/types/text_to_video_create_params.py +++ b/src/runwayml/types/text_to_video_create_params.py @@ -35,6 +35,9 @@ "Seedance2_5ReferenceAudio", "Seedance2_5Reference", "Seedance2_5ReferenceVideo", + "GrokImagine1_5", + "GrokImagine1_5ReferenceAudio", + "GrokImagine1_5Reference", ] @@ -577,8 +580,17 @@ class Seedance2_5(TypedDict, total=False): "960:960", "834:1112", "720:1280", + "2206:946", + "1920:1080", + "1664:1248", + "1440:1440", + "1248:1664", + "1080:1920", ] - """The resolution of the output video. Seedance 2.5 supports 480p and 720p only.""" + """The resolution of the output video. + + Seedance 2.5 supports 480p, 720p, and 1080p. + """ reference_audio: Annotated[Iterable[Seedance2_5ReferenceAudio], PropertyInfo(alias="referenceAudio")] """An optional array of audio references. @@ -639,6 +651,60 @@ class Seedance2_5ReferenceVideo(TypedDict, total=False): """ +class GrokImagine1_5(TypedDict, total=False): + model: Required[Literal["grok_imagine_1_5"]] + + prompt_text: Required[Annotated[str, PropertyInfo(alias="promptText")]] + """A non-empty text prompt describing what should appear in the output.""" + + duration: int + """The number of seconds of duration for the output video.""" + + ratio: Literal["1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3"] + """The aspect ratio of the output video.""" + + reference_audio: Annotated[Iterable[GrokImagine1_5ReferenceAudio], PropertyInfo(alias="referenceAudio")] + """An optional array of audio references. + + Audio references require at least one image reference, and each clip must be + between 3 and 15 seconds. + """ + + references: Iterable[GrokImagine1_5Reference] + """An optional array of image references. + + Referenced images can be addressed in the prompt as [Image 1], [Image 2], and so + on. See [our docs](/assets/inputs#images) on image inputs for more information. + """ + + resolution: Literal["480p", "720p", "1080p"] + """The output resolution. Requests with image references are capped at 720p.""" + + +class GrokImagine1_5ReferenceAudio(TypedDict, total=False): + """ + An audio reference allows the model to drive the output with the supplied audio. + """ + + type: Required[Literal["audio"]] + + uri: Required[str] + """A HTTPS URL, Runway upload URI, or base64 data URI (e.g. + + `data:audio/mp3;base64,...`, up to 16MB) containing an encoded audio. See + [our docs](/assets/inputs#audio) on audio inputs for more information. + """ + + +class GrokImagine1_5Reference(TypedDict, total=False): + uri: Required[str] + """A HTTPS URL, Runway upload URI, or base64 data URI (e.g. + + `data:image/png;base64,...`, up to 5MB) containing an encoded image. See + [our docs](/assets/inputs#images) on image inputs for more information. + """ + + TextToVideoCreateParams: TypeAlias = Union[ Gen4_5, Veo3_1, @@ -650,4 +716,5 @@ class Seedance2_5ReferenceVideo(TypedDict, total=False): Seedance2Mini, GeminiOmniFlash, Seedance2_5, + GrokImagine1_5, ] diff --git a/src/runwayml/types/video_to_video_create_params.py b/src/runwayml/types/video_to_video_create_params.py index 6ee10c7..559b93f 100644 --- a/src/runwayml/types/video_to_video_create_params.py +++ b/src/runwayml/types/video_to_video_create_params.py @@ -653,8 +653,17 @@ class Seedance2_5(TypedDict, total=False): "960:960", "834:1112", "720:1280", + "2206:946", + "1920:1080", + "1664:1248", + "1440:1440", + "1248:1664", + "1080:1920", ] - """The resolution of the output video. Seedance 2.5 supports 480p and 720p only.""" + """The resolution of the output video. + + Seedance 2.5 supports 480p, 720p, and 1080p. + """ reference_audio: Annotated[Iterable[Seedance2_5ReferenceAudio], PropertyInfo(alias="referenceAudio")] """An optional array of audio references. diff --git a/tests/api_resources/test_image_to_video.py b/tests/api_resources/test_image_to_video.py index d0e4186..10e561d 100644 --- a/tests/api_resources/test_image_to_video.py +++ b/tests/api_resources/test_image_to_video.py @@ -578,6 +578,51 @@ def test_streaming_response_create_overload_11(self, client: RunwayML) -> None: assert cast(Any, response.is_closed) is True + @parametrize + def test_method_create_overload_12(self, client: RunwayML) -> None: + image_to_video = client.image_to_video.create( + model="grok_imagine_1_5", + prompt_image="https://example.com/image.jpg", + ) + assert_matches_type(ImageToVideoCreateResponse, image_to_video, path=["response"]) + + @parametrize + def test_method_create_with_all_params_overload_12(self, client: RunwayML) -> None: + image_to_video = client.image_to_video.create( + model="grok_imagine_1_5", + prompt_image="https://example.com/image.jpg", + duration=1, + prompt_text="x", + resolution="480p", + ) + assert_matches_type(ImageToVideoCreateResponse, image_to_video, path=["response"]) + + @parametrize + def test_raw_response_create_overload_12(self, client: RunwayML) -> None: + response = client.image_to_video.with_raw_response.create( + model="grok_imagine_1_5", + prompt_image="https://example.com/image.jpg", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + image_to_video = response.parse() + assert_matches_type(ImageToVideoCreateResponse, image_to_video, path=["response"]) + + @parametrize + def test_streaming_response_create_overload_12(self, client: RunwayML) -> None: + with client.image_to_video.with_streaming_response.create( + model="grok_imagine_1_5", + prompt_image="https://example.com/image.jpg", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + image_to_video = response.parse() + assert_matches_type(ImageToVideoCreateResponse, image_to_video, path=["response"]) + + assert cast(Any, response.is_closed) is True + class TestAsyncImageToVideo: parametrize = pytest.mark.parametrize( @@ -1144,3 +1189,48 @@ async def test_streaming_response_create_overload_11(self, async_client: AsyncRu assert_matches_type(ImageToVideoCreateResponse, image_to_video, path=["response"]) assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_create_overload_12(self, async_client: AsyncRunwayML) -> None: + image_to_video = await async_client.image_to_video.create( + model="grok_imagine_1_5", + prompt_image="https://example.com/image.jpg", + ) + assert_matches_type(ImageToVideoCreateResponse, image_to_video, path=["response"]) + + @parametrize + async def test_method_create_with_all_params_overload_12(self, async_client: AsyncRunwayML) -> None: + image_to_video = await async_client.image_to_video.create( + model="grok_imagine_1_5", + prompt_image="https://example.com/image.jpg", + duration=1, + prompt_text="x", + resolution="480p", + ) + assert_matches_type(ImageToVideoCreateResponse, image_to_video, path=["response"]) + + @parametrize + async def test_raw_response_create_overload_12(self, async_client: AsyncRunwayML) -> None: + response = await async_client.image_to_video.with_raw_response.create( + model="grok_imagine_1_5", + prompt_image="https://example.com/image.jpg", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + image_to_video = await response.parse() + assert_matches_type(ImageToVideoCreateResponse, image_to_video, path=["response"]) + + @parametrize + async def test_streaming_response_create_overload_12(self, async_client: AsyncRunwayML) -> None: + async with async_client.image_to_video.with_streaming_response.create( + model="grok_imagine_1_5", + prompt_image="https://example.com/image.jpg", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + image_to_video = await response.parse() + assert_matches_type(ImageToVideoCreateResponse, image_to_video, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_text_to_image.py b/tests/api_resources/test_text_to_image.py index eb2a989..3aea243 100644 --- a/tests/api_resources/test_text_to_image.py +++ b/tests/api_resources/test_text_to_image.py @@ -393,6 +393,56 @@ def test_streaming_response_create_overload_7(self, client: RunwayML) -> None: @parametrize def test_method_create_overload_8(self, client: RunwayML) -> None: + text_to_image = client.text_to_image.create( + model="grok_imagine_image_2", + prompt_text="x", + ratio="1024:1024", + ) + assert_matches_type(TextToImageCreateResponse, text_to_image, path=["response"]) + + @parametrize + def test_method_create_with_all_params_overload_8(self, client: RunwayML) -> None: + text_to_image = client.text_to_image.create( + model="grok_imagine_image_2", + prompt_text="x", + ratio="1024:1024", + edit=True, + output_count=1, + quality="low", + reference_images=[{"uri": "https://example.com/image.jpg"}], + ) + assert_matches_type(TextToImageCreateResponse, text_to_image, path=["response"]) + + @parametrize + def test_raw_response_create_overload_8(self, client: RunwayML) -> None: + response = client.text_to_image.with_raw_response.create( + model="grok_imagine_image_2", + prompt_text="x", + ratio="1024:1024", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + text_to_image = response.parse() + assert_matches_type(TextToImageCreateResponse, text_to_image, path=["response"]) + + @parametrize + def test_streaming_response_create_overload_8(self, client: RunwayML) -> None: + with client.text_to_image.with_streaming_response.create( + model="grok_imagine_image_2", + prompt_text="x", + ratio="1024:1024", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + text_to_image = response.parse() + assert_matches_type(TextToImageCreateResponse, text_to_image, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_create_overload_9(self, client: RunwayML) -> None: text_to_image = client.text_to_image.create( model="gemini_2.5_flash", prompt_text="x", @@ -401,7 +451,7 @@ def test_method_create_overload_8(self, client: RunwayML) -> None: assert_matches_type(TextToImageCreateResponse, text_to_image, path=["response"]) @parametrize - def test_method_create_with_all_params_overload_8(self, client: RunwayML) -> None: + def test_method_create_with_all_params_overload_9(self, client: RunwayML) -> None: text_to_image = client.text_to_image.create( model="gemini_2.5_flash", prompt_text="x", @@ -416,7 +466,7 @@ def test_method_create_with_all_params_overload_8(self, client: RunwayML) -> Non assert_matches_type(TextToImageCreateResponse, text_to_image, path=["response"]) @parametrize - def test_raw_response_create_overload_8(self, client: RunwayML) -> None: + def test_raw_response_create_overload_9(self, client: RunwayML) -> None: response = client.text_to_image.with_raw_response.create( model="gemini_2.5_flash", prompt_text="x", @@ -429,7 +479,7 @@ def test_raw_response_create_overload_8(self, client: RunwayML) -> None: assert_matches_type(TextToImageCreateResponse, text_to_image, path=["response"]) @parametrize - def test_streaming_response_create_overload_8(self, client: RunwayML) -> None: + def test_streaming_response_create_overload_9(self, client: RunwayML) -> None: with client.text_to_image.with_streaming_response.create( model="gemini_2.5_flash", prompt_text="x", @@ -825,6 +875,56 @@ async def test_streaming_response_create_overload_7(self, async_client: AsyncRun @parametrize async def test_method_create_overload_8(self, async_client: AsyncRunwayML) -> None: + text_to_image = await async_client.text_to_image.create( + model="grok_imagine_image_2", + prompt_text="x", + ratio="1024:1024", + ) + assert_matches_type(TextToImageCreateResponse, text_to_image, path=["response"]) + + @parametrize + async def test_method_create_with_all_params_overload_8(self, async_client: AsyncRunwayML) -> None: + text_to_image = await async_client.text_to_image.create( + model="grok_imagine_image_2", + prompt_text="x", + ratio="1024:1024", + edit=True, + output_count=1, + quality="low", + reference_images=[{"uri": "https://example.com/image.jpg"}], + ) + assert_matches_type(TextToImageCreateResponse, text_to_image, path=["response"]) + + @parametrize + async def test_raw_response_create_overload_8(self, async_client: AsyncRunwayML) -> None: + response = await async_client.text_to_image.with_raw_response.create( + model="grok_imagine_image_2", + prompt_text="x", + ratio="1024:1024", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + text_to_image = await response.parse() + assert_matches_type(TextToImageCreateResponse, text_to_image, path=["response"]) + + @parametrize + async def test_streaming_response_create_overload_8(self, async_client: AsyncRunwayML) -> None: + async with async_client.text_to_image.with_streaming_response.create( + model="grok_imagine_image_2", + prompt_text="x", + ratio="1024:1024", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + text_to_image = await response.parse() + assert_matches_type(TextToImageCreateResponse, text_to_image, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_create_overload_9(self, async_client: AsyncRunwayML) -> None: text_to_image = await async_client.text_to_image.create( model="gemini_2.5_flash", prompt_text="x", @@ -833,7 +933,7 @@ async def test_method_create_overload_8(self, async_client: AsyncRunwayML) -> No assert_matches_type(TextToImageCreateResponse, text_to_image, path=["response"]) @parametrize - async def test_method_create_with_all_params_overload_8(self, async_client: AsyncRunwayML) -> None: + async def test_method_create_with_all_params_overload_9(self, async_client: AsyncRunwayML) -> None: text_to_image = await async_client.text_to_image.create( model="gemini_2.5_flash", prompt_text="x", @@ -848,7 +948,7 @@ async def test_method_create_with_all_params_overload_8(self, async_client: Asyn assert_matches_type(TextToImageCreateResponse, text_to_image, path=["response"]) @parametrize - async def test_raw_response_create_overload_8(self, async_client: AsyncRunwayML) -> None: + async def test_raw_response_create_overload_9(self, async_client: AsyncRunwayML) -> None: response = await async_client.text_to_image.with_raw_response.create( model="gemini_2.5_flash", prompt_text="x", @@ -861,7 +961,7 @@ async def test_raw_response_create_overload_8(self, async_client: AsyncRunwayML) assert_matches_type(TextToImageCreateResponse, text_to_image, path=["response"]) @parametrize - async def test_streaming_response_create_overload_8(self, async_client: AsyncRunwayML) -> None: + async def test_streaming_response_create_overload_9(self, async_client: AsyncRunwayML) -> None: async with async_client.text_to_image.with_streaming_response.create( model="gemini_2.5_flash", prompt_text="x", diff --git a/tests/api_resources/test_text_to_video.py b/tests/api_resources/test_text_to_video.py index 05a6d86..3747b64 100644 --- a/tests/api_resources/test_text_to_video.py +++ b/tests/api_resources/test_text_to_video.py @@ -544,6 +544,58 @@ def test_streaming_response_create_overload_10(self, client: RunwayML) -> None: assert cast(Any, response.is_closed) is True + @parametrize + def test_method_create_overload_11(self, client: RunwayML) -> None: + text_to_video = client.text_to_video.create( + model="grok_imagine_1_5", + prompt_text="x", + ) + assert_matches_type(TextToVideoCreateResponse, text_to_video, path=["response"]) + + @parametrize + def test_method_create_with_all_params_overload_11(self, client: RunwayML) -> None: + text_to_video = client.text_to_video.create( + model="grok_imagine_1_5", + prompt_text="x", + duration=1, + ratio="1:1", + reference_audio=[ + { + "type": "audio", + "uri": "https://example.com/audio.mp3", + } + ], + references=[{"uri": "https://example.com/image.jpg"}], + resolution="480p", + ) + assert_matches_type(TextToVideoCreateResponse, text_to_video, path=["response"]) + + @parametrize + def test_raw_response_create_overload_11(self, client: RunwayML) -> None: + response = client.text_to_video.with_raw_response.create( + model="grok_imagine_1_5", + prompt_text="x", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + text_to_video = response.parse() + assert_matches_type(TextToVideoCreateResponse, text_to_video, path=["response"]) + + @parametrize + def test_streaming_response_create_overload_11(self, client: RunwayML) -> None: + with client.text_to_video.with_streaming_response.create( + model="grok_imagine_1_5", + prompt_text="x", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + text_to_video = response.parse() + assert_matches_type(TextToVideoCreateResponse, text_to_video, path=["response"]) + + assert cast(Any, response.is_closed) is True + class TestAsyncTextToVideo: parametrize = pytest.mark.parametrize( @@ -1076,3 +1128,55 @@ async def test_streaming_response_create_overload_10(self, async_client: AsyncRu assert_matches_type(TextToVideoCreateResponse, text_to_video, path=["response"]) assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_create_overload_11(self, async_client: AsyncRunwayML) -> None: + text_to_video = await async_client.text_to_video.create( + model="grok_imagine_1_5", + prompt_text="x", + ) + assert_matches_type(TextToVideoCreateResponse, text_to_video, path=["response"]) + + @parametrize + async def test_method_create_with_all_params_overload_11(self, async_client: AsyncRunwayML) -> None: + text_to_video = await async_client.text_to_video.create( + model="grok_imagine_1_5", + prompt_text="x", + duration=1, + ratio="1:1", + reference_audio=[ + { + "type": "audio", + "uri": "https://example.com/audio.mp3", + } + ], + references=[{"uri": "https://example.com/image.jpg"}], + resolution="480p", + ) + assert_matches_type(TextToVideoCreateResponse, text_to_video, path=["response"]) + + @parametrize + async def test_raw_response_create_overload_11(self, async_client: AsyncRunwayML) -> None: + response = await async_client.text_to_video.with_raw_response.create( + model="grok_imagine_1_5", + prompt_text="x", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + text_to_video = await response.parse() + assert_matches_type(TextToVideoCreateResponse, text_to_video, path=["response"]) + + @parametrize + async def test_streaming_response_create_overload_11(self, async_client: AsyncRunwayML) -> None: + async with async_client.text_to_video.with_streaming_response.create( + model="grok_imagine_1_5", + prompt_text="x", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + text_to_video = await response.parse() + assert_matches_type(TextToVideoCreateResponse, text_to_video, path=["response"]) + + assert cast(Any, response.is_closed) is True