runwayml 3.0.3__py3-none-any.whl → 3.0.5__py3-none-any.whl
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.
- runwayml/__init__.py +5 -0
- runwayml/_utils/_proxy.py +4 -1
- runwayml/_utils/_resources_proxy.py +24 -0
- runwayml/_version.py +1 -1
- runwayml/resources/image_to_video.py +42 -12
- runwayml/types/image_to_video_create_params.py +25 -2
- {runwayml-3.0.3.dist-info → runwayml-3.0.5.dist-info}/METADATA +8 -1
- {runwayml-3.0.3.dist-info → runwayml-3.0.5.dist-info}/RECORD +10 -9
- {runwayml-3.0.3.dist-info → runwayml-3.0.5.dist-info}/WHEEL +0 -0
- {runwayml-3.0.3.dist-info → runwayml-3.0.5.dist-info}/licenses/LICENSE +0 -0
runwayml/__init__.py
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
2
|
|
3
|
+
import typing as _t
|
4
|
+
|
3
5
|
from . import types
|
4
6
|
from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes
|
5
7
|
from ._utils import file_from_path
|
@@ -78,6 +80,9 @@ __all__ = [
|
|
78
80
|
"DefaultAsyncHttpxClient",
|
79
81
|
]
|
80
82
|
|
83
|
+
if not _t.TYPE_CHECKING:
|
84
|
+
from ._utils._resources_proxy import resources as resources
|
85
|
+
|
81
86
|
_setup_logging()
|
82
87
|
|
83
88
|
# Update the __module__ attribute for exported symbols so that
|
runwayml/_utils/_proxy.py
CHANGED
@@ -46,7 +46,10 @@ class LazyProxy(Generic[T], ABC):
|
|
46
46
|
@property # type: ignore
|
47
47
|
@override
|
48
48
|
def __class__(self) -> type: # pyright: ignore
|
49
|
-
|
49
|
+
try:
|
50
|
+
proxied = self.__get_proxied__()
|
51
|
+
except Exception:
|
52
|
+
return type(self)
|
50
53
|
if issubclass(type(proxied), LazyProxy):
|
51
54
|
return type(proxied)
|
52
55
|
return proxied.__class__
|
@@ -0,0 +1,24 @@
|
|
1
|
+
from __future__ import annotations
|
2
|
+
|
3
|
+
from typing import Any
|
4
|
+
from typing_extensions import override
|
5
|
+
|
6
|
+
from ._proxy import LazyProxy
|
7
|
+
|
8
|
+
|
9
|
+
class ResourcesProxy(LazyProxy[Any]):
|
10
|
+
"""A proxy for the `runwayml.resources` module.
|
11
|
+
|
12
|
+
This is used so that we can lazily import `runwayml.resources` only when
|
13
|
+
needed *and* so that users can just import `runwayml` and reference `runwayml.resources`
|
14
|
+
"""
|
15
|
+
|
16
|
+
@override
|
17
|
+
def __load__(self) -> Any:
|
18
|
+
import importlib
|
19
|
+
|
20
|
+
mod = importlib.import_module("runwayml.resources")
|
21
|
+
return mod
|
22
|
+
|
23
|
+
|
24
|
+
resources = ResourcesProxy().__as_proxied__()
|
runwayml/_version.py
CHANGED
@@ -49,10 +49,9 @@ class ImageToVideoResource(SyncAPIResource):
|
|
49
49
|
*,
|
50
50
|
model: Literal["gen4_turbo", "gen3a_turbo"],
|
51
51
|
prompt_image: Union[str, Iterable[image_to_video_create_params.PromptImagePromptImage]],
|
52
|
+
ratio: Literal["1280:720", "720:1280", "1104:832", "832:1104", "960:960", "1584:672", "1280:768", "768:1280"],
|
52
53
|
duration: Literal[5, 10] | NotGiven = NOT_GIVEN,
|
53
54
|
prompt_text: str | NotGiven = NOT_GIVEN,
|
54
|
-
ratio: Literal["1280:720", "720:1280", "1104:832", "832:1104", "960:960", "1584:672", "1280:768", "768:1280"]
|
55
|
-
| NotGiven = NOT_GIVEN,
|
56
55
|
seed: int | NotGiven = NOT_GIVEN,
|
57
56
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
58
57
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
@@ -71,11 +70,27 @@ class ImageToVideoResource(SyncAPIResource):
|
|
71
70
|
frame of the generated video. See [our docs](/assets/inputs#images) on image
|
72
71
|
inputs for more information.
|
73
72
|
|
74
|
-
|
73
|
+
ratio: The resolution of the output video.
|
74
|
+
|
75
|
+
`gen4_turbo` supports the following values:
|
76
|
+
|
77
|
+
- `1280:720`
|
78
|
+
- `720:1280`
|
79
|
+
- `1104:832`
|
80
|
+
- `832:1104`
|
81
|
+
- `960:960`
|
82
|
+
- `1584:672`
|
83
|
+
|
84
|
+
`gen3a_turbo` supports the following values:
|
75
85
|
|
76
|
-
|
86
|
+
- `1280:768`
|
87
|
+
- `768:1280`
|
77
88
|
|
78
|
-
|
89
|
+
duration: The number of seconds of duration for the output video.
|
90
|
+
|
91
|
+
prompt_text: A non-empty string up to 1000 UTF-16 code points in length (that is,
|
92
|
+
`promptText.length === 1000` in JavaScript). This should describe in detail what
|
93
|
+
should appear in the output.
|
79
94
|
|
80
95
|
seed: If unspecified, a random number is chosen. Varying the seed integer is a way to
|
81
96
|
get different results for the same other request parameters. Using the same seed
|
@@ -95,9 +110,9 @@ class ImageToVideoResource(SyncAPIResource):
|
|
95
110
|
{
|
96
111
|
"model": model,
|
97
112
|
"prompt_image": prompt_image,
|
113
|
+
"ratio": ratio,
|
98
114
|
"duration": duration,
|
99
115
|
"prompt_text": prompt_text,
|
100
|
-
"ratio": ratio,
|
101
116
|
"seed": seed,
|
102
117
|
},
|
103
118
|
image_to_video_create_params.ImageToVideoCreateParams,
|
@@ -134,10 +149,9 @@ class AsyncImageToVideoResource(AsyncAPIResource):
|
|
134
149
|
*,
|
135
150
|
model: Literal["gen4_turbo", "gen3a_turbo"],
|
136
151
|
prompt_image: Union[str, Iterable[image_to_video_create_params.PromptImagePromptImage]],
|
152
|
+
ratio: Literal["1280:720", "720:1280", "1104:832", "832:1104", "960:960", "1584:672", "1280:768", "768:1280"],
|
137
153
|
duration: Literal[5, 10] | NotGiven = NOT_GIVEN,
|
138
154
|
prompt_text: str | NotGiven = NOT_GIVEN,
|
139
|
-
ratio: Literal["1280:720", "720:1280", "1104:832", "832:1104", "960:960", "1584:672", "1280:768", "768:1280"]
|
140
|
-
| NotGiven = NOT_GIVEN,
|
141
155
|
seed: int | NotGiven = NOT_GIVEN,
|
142
156
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
143
157
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
@@ -156,11 +170,27 @@ class AsyncImageToVideoResource(AsyncAPIResource):
|
|
156
170
|
frame of the generated video. See [our docs](/assets/inputs#images) on image
|
157
171
|
inputs for more information.
|
158
172
|
|
159
|
-
|
173
|
+
ratio: The resolution of the output video.
|
174
|
+
|
175
|
+
`gen4_turbo` supports the following values:
|
176
|
+
|
177
|
+
- `1280:720`
|
178
|
+
- `720:1280`
|
179
|
+
- `1104:832`
|
180
|
+
- `832:1104`
|
181
|
+
- `960:960`
|
182
|
+
- `1584:672`
|
183
|
+
|
184
|
+
`gen3a_turbo` supports the following values:
|
160
185
|
|
161
|
-
|
186
|
+
- `1280:768`
|
187
|
+
- `768:1280`
|
162
188
|
|
163
|
-
|
189
|
+
duration: The number of seconds of duration for the output video.
|
190
|
+
|
191
|
+
prompt_text: A non-empty string up to 1000 UTF-16 code points in length (that is,
|
192
|
+
`promptText.length === 1000` in JavaScript). This should describe in detail what
|
193
|
+
should appear in the output.
|
164
194
|
|
165
195
|
seed: If unspecified, a random number is chosen. Varying the seed integer is a way to
|
166
196
|
get different results for the same other request parameters. Using the same seed
|
@@ -180,9 +210,9 @@ class AsyncImageToVideoResource(AsyncAPIResource):
|
|
180
210
|
{
|
181
211
|
"model": model,
|
182
212
|
"prompt_image": prompt_image,
|
213
|
+
"ratio": ratio,
|
183
214
|
"duration": duration,
|
184
215
|
"prompt_text": prompt_text,
|
185
|
-
"ratio": ratio,
|
186
216
|
"seed": seed,
|
187
217
|
},
|
188
218
|
image_to_video_create_params.ImageToVideoCreateParams,
|
@@ -21,12 +21,35 @@ class ImageToVideoCreateParams(TypedDict, total=False):
|
|
21
21
|
inputs for more information.
|
22
22
|
"""
|
23
23
|
|
24
|
+
ratio: Required[
|
25
|
+
Literal["1280:720", "720:1280", "1104:832", "832:1104", "960:960", "1584:672", "1280:768", "768:1280"]
|
26
|
+
]
|
27
|
+
"""The resolution of the output video.
|
28
|
+
|
29
|
+
`gen4_turbo` supports the following values:
|
30
|
+
|
31
|
+
- `1280:720`
|
32
|
+
- `720:1280`
|
33
|
+
- `1104:832`
|
34
|
+
- `832:1104`
|
35
|
+
- `960:960`
|
36
|
+
- `1584:672`
|
37
|
+
|
38
|
+
`gen3a_turbo` supports the following values:
|
39
|
+
|
40
|
+
- `1280:768`
|
41
|
+
- `768:1280`
|
42
|
+
"""
|
43
|
+
|
24
44
|
duration: Literal[5, 10]
|
25
45
|
"""The number of seconds of duration for the output video."""
|
26
46
|
|
27
47
|
prompt_text: Annotated[str, PropertyInfo(alias="promptText")]
|
28
|
-
|
29
|
-
|
48
|
+
"""
|
49
|
+
A non-empty string up to 1000 UTF-16 code points in length (that is,
|
50
|
+
`promptText.length === 1000` in JavaScript). This should describe in detail what
|
51
|
+
should appear in the output.
|
52
|
+
"""
|
30
53
|
|
31
54
|
seed: int
|
32
55
|
"""If unspecified, a random number is chosen.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: runwayml
|
3
|
-
Version: 3.0.
|
3
|
+
Version: 3.0.5
|
4
4
|
Summary: The official Python library for the runwayml API
|
5
5
|
Project-URL: Homepage, https://github.com/runwayml/sdk-python
|
6
6
|
Project-URL: Repository, https://github.com/runwayml/sdk-python
|
@@ -65,6 +65,7 @@ client = RunwayML(
|
|
65
65
|
image_to_video = client.image_to_video.create(
|
66
66
|
model="gen4_turbo",
|
67
67
|
prompt_image="https://example.com/assets/bunny.jpg",
|
68
|
+
ratio="1280:720",
|
68
69
|
prompt_text="The bunny is eating a carrot",
|
69
70
|
)
|
70
71
|
print(image_to_video.id)
|
@@ -93,6 +94,7 @@ async def main() -> None:
|
|
93
94
|
image_to_video = await client.image_to_video.create(
|
94
95
|
model="gen4_turbo",
|
95
96
|
prompt_image="https://example.com/assets/bunny.jpg",
|
97
|
+
ratio="1280:720",
|
96
98
|
prompt_text="The bunny is eating a carrot",
|
97
99
|
)
|
98
100
|
print(image_to_video.id)
|
@@ -131,6 +133,7 @@ try:
|
|
131
133
|
client.image_to_video.create(
|
132
134
|
model="gen4_turbo",
|
133
135
|
prompt_image="https://example.com/assets/bunny.jpg",
|
136
|
+
ratio="1280:720",
|
134
137
|
prompt_text="The bunny is eating a carrot",
|
135
138
|
)
|
136
139
|
except runwayml.APIConnectionError as e:
|
@@ -178,6 +181,7 @@ client = RunwayML(
|
|
178
181
|
client.with_options(max_retries=5).image_to_video.create(
|
179
182
|
model="gen4_turbo",
|
180
183
|
prompt_image="https://example.com/assets/bunny.jpg",
|
184
|
+
ratio="1280:720",
|
181
185
|
prompt_text="The bunny is eating a carrot",
|
182
186
|
)
|
183
187
|
```
|
@@ -205,6 +209,7 @@ client = RunwayML(
|
|
205
209
|
client.with_options(timeout=5.0).image_to_video.create(
|
206
210
|
model="gen4_turbo",
|
207
211
|
prompt_image="https://example.com/assets/bunny.jpg",
|
212
|
+
ratio="1280:720",
|
208
213
|
prompt_text="The bunny is eating a carrot",
|
209
214
|
)
|
210
215
|
```
|
@@ -250,6 +255,7 @@ client = RunwayML()
|
|
250
255
|
response = client.image_to_video.with_raw_response.create(
|
251
256
|
model="gen4_turbo",
|
252
257
|
prompt_image="https://example.com/assets/bunny.jpg",
|
258
|
+
ratio="1280:720",
|
253
259
|
prompt_text="The bunny is eating a carrot",
|
254
260
|
)
|
255
261
|
print(response.headers.get('X-My-Header'))
|
@@ -272,6 +278,7 @@ To stream the response body, use `.with_streaming_response` instead, which requi
|
|
272
278
|
with client.image_to_video.with_streaming_response.create(
|
273
279
|
model="gen4_turbo",
|
274
280
|
prompt_image="https://example.com/assets/bunny.jpg",
|
281
|
+
ratio="1280:720",
|
275
282
|
prompt_text="The bunny is eating a carrot",
|
276
283
|
) as response:
|
277
284
|
print(response.headers.get("X-My-Header"))
|
@@ -1,4 +1,4 @@
|
|
1
|
-
runwayml/__init__.py,sha256=
|
1
|
+
runwayml/__init__.py,sha256=w7Il_Fc71HY9Ebs62Q5VLcsCQGraefXwcOmtzeg4r5I,2587
|
2
2
|
runwayml/_base_client.py,sha256=IHjCRq-jze0tVzSAP_zkZLHYG9lsvg4j_xwy2hv0ryQ,64846
|
3
3
|
runwayml/_client.py,sha256=RmchptAkzAmgp1RC40KQ0ZKqpdxfV9f8bHin3Bbmcmg,17123
|
4
4
|
runwayml/_compat.py,sha256=VWemUKbj6DDkQ-O4baSpHVLJafotzeXmCQGJugfVTIw,6580
|
@@ -11,12 +11,13 @@ runwayml/_resource.py,sha256=BF-j3xY5eRTKmuTxg8eDhLtLP4MLB1phDh_B6BKipKA,1112
|
|
11
11
|
runwayml/_response.py,sha256=WxjSEXX-j01ZhlSxYyMCVSEKxo20pgy40RA7iyski8M,28800
|
12
12
|
runwayml/_streaming.py,sha256=NSVuAgknVQWU1cgZEjQn01IdZKKynb5rOeYp5Lo-OEQ,10108
|
13
13
|
runwayml/_types.py,sha256=oHct1QQY_lI8bepCgfWDZm2N5VNi0e6o1iLeiTh4Y_0,6145
|
14
|
-
runwayml/_version.py,sha256=
|
14
|
+
runwayml/_version.py,sha256=l4HhWS02lY46M4mUQjlEaabu-ysSOOeJWtVxRIEjZts,160
|
15
15
|
runwayml/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
16
16
|
runwayml/_utils/__init__.py,sha256=PNZ_QJuzZEgyYXqkO1HVhGkj5IU9bglVUcw7H-Knjzw,2062
|
17
17
|
runwayml/_utils/_logs.py,sha256=ZfS5W59hdqEBVV86lNrk28PhvUxtHOzs9JqiLhSu0pI,780
|
18
|
-
runwayml/_utils/_proxy.py,sha256=
|
18
|
+
runwayml/_utils/_proxy.py,sha256=aglnj2yBTDyGX9Akk2crZHrl10oqRmceUy2Zp008XEs,1975
|
19
19
|
runwayml/_utils/_reflection.py,sha256=ZmGkIgT_PuwedyNBrrKGbxoWtkpytJNU1uU4QHnmEMU,1364
|
20
|
+
runwayml/_utils/_resources_proxy.py,sha256=mWtL945pucAKizHQ2ipewCIL-HijKdldUm72C3QqOBs,599
|
20
21
|
runwayml/_utils/_streams.py,sha256=SMC90diFFecpEg_zgDRVbdR3hSEIgVVij4taD-noMLM,289
|
21
22
|
runwayml/_utils/_sync.py,sha256=TpGLrrhRNWTJtODNE6Fup3_k7zrWm1j2RlirzBwre-0,2862
|
22
23
|
runwayml/_utils/_transform.py,sha256=n7kskEWz6o__aoNvhFoGVyDoalNe6mJwp-g7BWkdj88,15617
|
@@ -24,15 +25,15 @@ runwayml/_utils/_typing.py,sha256=D0DbbNu8GnYQTSICnTSHDGsYXj8TcAKyhejb0XcnjtY,46
|
|
24
25
|
runwayml/_utils/_utils.py,sha256=ts4CiiuNpFiGB6YMdkQRh2SZvYvsl7mAF-JWHCcLDf4,12312
|
25
26
|
runwayml/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
|
26
27
|
runwayml/resources/__init__.py,sha256=SqcC1MLwxPaz2c7gRRBlOn9-2pDPMKTXD2gFbG5FJ2E,1597
|
27
|
-
runwayml/resources/image_to_video.py,sha256=
|
28
|
+
runwayml/resources/image_to_video.py,sha256=n3xb3sm4qJK_yQlWK8dTF2BetoC6gA5p2V7jcuWy6Ik,10228
|
28
29
|
runwayml/resources/organization.py,sha256=XBg5nhkycPU3rllRvf9aaeHuZNtzGDKHlLPrPqDCAsw,5419
|
29
30
|
runwayml/resources/tasks.py,sha256=-VT3qetYcaqn4FskekxhN_fCTozMl1GqxGpGwxV8M60,9673
|
30
31
|
runwayml/types/__init__.py,sha256=xfq4RirwNpSBy5xXra7CB8wa0029vKUH0DB6Zg02hFs,505
|
31
|
-
runwayml/types/image_to_video_create_params.py,sha256=
|
32
|
+
runwayml/types/image_to_video_create_params.py,sha256=EtTTZJ4rWEcEknqRxFYDWtP3Zxox-_36NBj3fRGdP7o,2400
|
32
33
|
runwayml/types/image_to_video_create_response.py,sha256=WvZHbZxxJz8KerRNogzb1RYBrxa1x0iCPDi9-LCpHyE,345
|
33
34
|
runwayml/types/organization_retrieve_response.py,sha256=DV46yEIRjmL05uISc2-PpM5BGWu8gniA9TQ056abWLA,2721
|
34
35
|
runwayml/types/task_retrieve_response.py,sha256=v8y2bLxsW6srzScW-B3Akv72q_PI_NQmduGrGRQMHds,2139
|
35
|
-
runwayml-3.0.
|
36
|
-
runwayml-3.0.
|
37
|
-
runwayml-3.0.
|
38
|
-
runwayml-3.0.
|
36
|
+
runwayml-3.0.5.dist-info/METADATA,sha256=SrP5kPzjckoU5d2hbhBAVuuVVIDyYT0RUsa_bAR6SwQ,13678
|
37
|
+
runwayml-3.0.5.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
38
|
+
runwayml-3.0.5.dist-info/licenses/LICENSE,sha256=baeFj6izBWIm6A5_7N3-WAsy_VYpDF05Dd4zS1zsfZI,11338
|
39
|
+
runwayml-3.0.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|