Skip to content

Commit fd6196e

Browse files
fix(api): Make ratio a required parameter for i2v
1 parent 028ff22 commit fd6196e

File tree

4 files changed

+14
-15
lines changed

4 files changed

+14
-15
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 4
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runwayml%2Frunwayml-8572445174f75794a6c3bdd3ffacd7ea80b140bb5ffbf59656e7da3668228249.yml
3-
openapi_spec_hash: 8b99d38d0511b6f4291a7d39c12d580e
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runwayml%2Frunwayml-50d72f887af30d0d676f216865284f2bc36899cc197f81774445e00bc0228c02.yml
3+
openapi_spec_hash: c692214e7e704169e0e82d5b367e8f8c
44
config_hash: 77ce816c37172a537f337abfaf2d65a9

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ async function main() {
3030
const imageToVideo = await client.imageToVideo.create({
3131
model: 'gen4_turbo',
3232
promptImage: 'https://example.com/assets/bunny.jpg',
33+
ratio: '1280:720',
3334
promptText: 'The bunny is eating a carrot',
3435
});
3536

@@ -55,6 +56,7 @@ async function main() {
5556
const params: RunwayML.ImageToVideoCreateParams = {
5657
model: 'gen4_turbo',
5758
promptImage: 'https://example.com/assets/bunny.jpg',
59+
ratio: '1280:720',
5860
promptText: 'The bunny is eating a carrot',
5961
};
6062
const imageToVideo: RunwayML.ImageToVideoCreateResponse = await client.imageToVideo.create(params);
@@ -78,6 +80,7 @@ async function main() {
7880
.create({
7981
model: 'gen4_turbo',
8082
promptImage: 'https://example.com/assets/bunny.jpg',
83+
ratio: '1280:720',
8184
promptText: 'The bunny is eating a carrot',
8285
})
8386
.catch(async (err) => {
@@ -123,7 +126,7 @@ const client = new RunwayML({
123126
});
124127

125128
// Or, configure per-request:
126-
await client.imageToVideo.create({ model: 'gen4_turbo', promptImage: 'https://example.com/assets/bunny.jpg', promptText: 'The bunny is eating a carrot' }, {
129+
await client.imageToVideo.create({ model: 'gen4_turbo', promptImage: 'https://example.com/assets/bunny.jpg', ratio: '1280:720', promptText: 'The bunny is eating a carrot' }, {
127130
maxRetries: 5,
128131
});
129132
```
@@ -140,7 +143,7 @@ const client = new RunwayML({
140143
});
141144

142145
// Override per-request:
143-
await client.imageToVideo.create({ model: 'gen4_turbo', promptImage: 'https://example.com/assets/bunny.jpg', promptText: 'The bunny is eating a carrot' }, {
146+
await client.imageToVideo.create({ model: 'gen4_turbo', promptImage: 'https://example.com/assets/bunny.jpg', ratio: '1280:720', promptText: 'The bunny is eating a carrot' }, {
144147
timeout: 5 * 1000,
145148
});
146149
```
@@ -165,6 +168,7 @@ const response = await client.imageToVideo
165168
.create({
166169
model: 'gen4_turbo',
167170
promptImage: 'https://example.com/assets/bunny.jpg',
171+
ratio: '1280:720',
168172
promptText: 'The bunny is eating a carrot',
169173
})
170174
.asResponse();
@@ -175,6 +179,7 @@ const { data: imageToVideo, response: raw } = await client.imageToVideo
175179
.create({
176180
model: 'gen4_turbo',
177181
promptImage: 'https://example.com/assets/bunny.jpg',
182+
ratio: '1280:720',
178183
promptText: 'The bunny is eating a carrot',
179184
})
180185
.withResponse();
@@ -287,6 +292,7 @@ await client.imageToVideo.create(
287292
{
288293
model: 'gen4_turbo',
289294
promptImage: 'https://example.com/assets/bunny.jpg',
295+
ratio: '1280:720',
290296
promptText: 'The bunny is eating a carrot',
291297
},
292298
{

src/resources/image-to-video.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,23 +36,15 @@ export interface ImageToVideoCreateParams {
3636
*/
3737
promptImage: string | Array<ImageToVideoCreateParams.PromptImage>;
3838

39+
ratio: '1280:720' | '720:1280' | '1104:832' | '832:1104' | '960:960' | '1584:672' | '1280:768' | '768:1280';
40+
3941
/**
4042
* The number of seconds of duration for the output video.
4143
*/
4244
duration?: 5 | 10;
4345

4446
promptText?: string;
4547

46-
ratio?:
47-
| '1280:720'
48-
| '720:1280'
49-
| '1104:832'
50-
| '832:1104'
51-
| '960:960'
52-
| '1584:672'
53-
| '1280:768'
54-
| '768:1280';
55-
5648
/**
5749
* If unspecified, a random number is chosen. Varying the seed integer is a way to
5850
* get different results for the same other request parameters. Using the same seed

tests/api-resources/image-to-video.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ describe('resource imageToVideo', () => {
1313
const responsePromise = client.imageToVideo.create({
1414
model: 'gen4_turbo',
1515
promptImage: 'https://example.com',
16+
ratio: '1280:720',
1617
});
1718
const rawResponse = await responsePromise.asResponse();
1819
expect(rawResponse).toBeInstanceOf(Response);
@@ -27,9 +28,9 @@ describe('resource imageToVideo', () => {
2728
const response = await client.imageToVideo.create({
2829
model: 'gen4_turbo',
2930
promptImage: 'https://example.com',
31+
ratio: '1280:720',
3032
duration: 5,
3133
promptText: 'promptText',
32-
ratio: '1280:720',
3334
seed: 0,
3435
});
3536
});

0 commit comments

Comments
 (0)