Skip to content

Commit f062fee

Browse files
authored
Merge pull request #105 from runwayml/release-please--branches--main--changes--next--components--sdk
release: 2.1.0
2 parents 020b350 + bebe0db commit f062fee

12 files changed

+215
-10
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "2.0.3"
2+
".": "2.1.0"
33
}

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 4
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runwayml%2Frunwayml-34491bc11ee43039ff5f1828a4caf68847a7346ab283bbefe88d1690951dd4d6.yml
3-
openapi_spec_hash: 4fc80b2e354cf70ebc85e0ef4e7e6f51
4-
config_hash: 77ce816c37172a537f337abfaf2d65a9
1+
configured_endpoints: 5
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runwayml%2Frunwayml-8c239934c53125f00aa8829b9f767de17aececb19c088d29446008c186831e2d.yml
3+
openapi_spec_hash: a9b0529ceb1d668bae7a35c40d6a4f2d
4+
config_hash: d16736214512e2116d5b40a9b18a8f71

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 2.1.0 (2025-05-16)
4+
5+
Full Changelog: [v2.0.3...v2.1.0](https://github.com/runwayml/sdk-node/compare/v2.0.3...v2.1.0)
6+
7+
### Features
8+
9+
* **api:** Gen-4 Image (text-to-image) support ([348a4c9](https://github.com/runwayml/sdk-node/commit/348a4c902980531f4cf45a744f0567a0cd0aefb1))
10+
311
## 2.0.3 (2025-05-07)
412

513
Full Changelog: [v2.0.2...v2.0.3](https://github.com/runwayml/sdk-node/compare/v2.0.2...v2.0.3)

api.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ Methods:
1919

2020
- <code title="post /v1/image_to_video">client.imageToVideo.<a href="./src/resources/image-to-video.ts">create</a>({ ...params }) -> ImageToVideoCreateResponse</code>
2121

22+
# TextToImage
23+
24+
Types:
25+
26+
- <code><a href="./src/resources/text-to-image.ts">TextToImageCreateResponse</a></code>
27+
28+
Methods:
29+
30+
- <code title="post /v1/text_to_image">client.textToImage.<a href="./src/resources/text-to-image.ts">create</a>({ ...params }) -> TextToImageCreateResponse</code>
31+
2232
# Organization
2333

2434
Types:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@runwayml/sdk",
3-
"version": "2.0.3",
3+
"version": "2.1.0",
44
"description": "The official TypeScript library for the RunwayML API",
55
"author": "RunwayML <[email protected]>",
66
"types": "dist/index.d.ts",

src/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
} from './resources/image-to-video';
1313
import { Organization, OrganizationRetrieveResponse } from './resources/organization';
1414
import { TaskRetrieveResponse, Tasks } from './resources/tasks';
15+
import { TextToImage, TextToImageCreateParams, TextToImageCreateResponse } from './resources/text-to-image';
1516

1617
export interface ClientOptions {
1718
/**
@@ -141,6 +142,7 @@ export class RunwayML extends Core.APIClient {
141142

142143
tasks: API.Tasks = new API.Tasks(this);
143144
imageToVideo: API.ImageToVideo = new API.ImageToVideo(this);
145+
textToImage: API.TextToImage = new API.TextToImage(this);
144146
organization: API.Organization = new API.Organization(this);
145147

146148
protected override defaultQuery(): Core.DefaultQuery | undefined {
@@ -182,6 +184,7 @@ export class RunwayML extends Core.APIClient {
182184

183185
RunwayML.Tasks = Tasks;
184186
RunwayML.ImageToVideo = ImageToVideo;
187+
RunwayML.TextToImage = TextToImage;
185188
RunwayML.Organization = Organization;
186189
export declare namespace RunwayML {
187190
export type RequestOptions = Core.RequestOptions;
@@ -194,6 +197,12 @@ export declare namespace RunwayML {
194197
type ImageToVideoCreateParams as ImageToVideoCreateParams,
195198
};
196199

200+
export {
201+
TextToImage as TextToImage,
202+
type TextToImageCreateResponse as TextToImageCreateResponse,
203+
type TextToImageCreateParams as TextToImageCreateParams,
204+
};
205+
197206
export { Organization as Organization, type OrganizationRetrieveResponse as OrganizationRetrieveResponse };
198207
}
199208

src/resources/image-to-video.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,8 @@ export interface ImageToVideoCreateParams {
6161
duration?: 5 | 10;
6262

6363
/**
64-
* A non-empty string up to 1000 UTF-16 code points in length (that is,
65-
* `promptText.length === 1000` in JavaScript). This should describe in detail what
66-
* should appear in the output.
64+
* A non-empty string up to 1000 characters (measured in UTF-16 code units). This
65+
* should describe in detail what should appear in the output.
6766
*/
6867
promptText?: string;
6968

src/resources/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ export {
77
} from './image-to-video';
88
export { Organization, type OrganizationRetrieveResponse } from './organization';
99
export { Tasks, type TaskRetrieveResponse } from './tasks';
10+
export { TextToImage, type TextToImageCreateResponse, type TextToImageCreateParams } from './text-to-image';

src/resources/organization.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ export namespace OrganizationRetrieveResponse {
5656
*/
5757
gen3a_turbo?: Models.Gen3aTurbo;
5858

59+
/**
60+
* Limits associated with the gen4_image model.
61+
*/
62+
gen4_image?: Models.Gen4Image;
63+
5964
/**
6065
* Limits associated with the gen4_turbo model.
6166
*/
@@ -78,6 +83,21 @@ export namespace OrganizationRetrieveResponse {
7883
maxDailyGenerations: number;
7984
}
8085

86+
/**
87+
* Limits associated with the gen4_image model.
88+
*/
89+
export interface Gen4Image {
90+
/**
91+
* The maximum number of generations that can be run concurrently for this model.
92+
*/
93+
maxConcurrentGenerations: number;
94+
95+
/**
96+
* The maximum number of generations that can be created each day for this model.
97+
*/
98+
maxDailyGenerations: number;
99+
}
100+
81101
/**
82102
* Limits associated with the gen4_turbo model.
83103
*/
@@ -115,6 +135,11 @@ export namespace OrganizationRetrieveResponse {
115135
*/
116136
gen3a_turbo?: Models.Gen3aTurbo;
117137

138+
/**
139+
* Usage data for the gen4_image model.
140+
*/
141+
gen4_image?: Models.Gen4Image;
142+
118143
/**
119144
* Usage data for the gen4_turbo model.
120145
*/
@@ -132,6 +157,16 @@ export namespace OrganizationRetrieveResponse {
132157
dailyGenerations: number;
133158
}
134159

160+
/**
161+
* Usage data for the gen4_image model.
162+
*/
163+
export interface Gen4Image {
164+
/**
165+
* The number of generations that have been run for this model in the past day.
166+
*/
167+
dailyGenerations: number;
168+
}
169+
135170
/**
136171
* Usage data for the gen4_turbo model.
137172
*/

src/resources/text-to-image.ts

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
import { APIResource } from '../resource';
4+
import * as Core from '../core';
5+
6+
export class TextToImage extends APIResource {
7+
/**
8+
* This endpoint will start a new task to generate images from text.
9+
*/
10+
create(
11+
body: TextToImageCreateParams,
12+
options?: Core.RequestOptions,
13+
): Core.APIPromise<TextToImageCreateResponse> {
14+
return this._client.post('/v1/text_to_image', { body, ...options });
15+
}
16+
}
17+
18+
export interface TextToImageCreateResponse {
19+
/**
20+
* The ID of the newly created task.
21+
*/
22+
id: string;
23+
}
24+
25+
export interface TextToImageCreateParams {
26+
/**
27+
* The model variant to use.
28+
*/
29+
model: 'gen4_image';
30+
31+
/**
32+
* A non-empty string up to 1000 characters (measured in UTF-16 code units). This
33+
* should describe in detail what should appear in the output.
34+
*/
35+
promptText: string;
36+
37+
/**
38+
* The resolution of the output image(s).
39+
*/
40+
ratio:
41+
| '1920:1080'
42+
| '1080:1920'
43+
| '1024:1024'
44+
| '1360:768'
45+
| '1080:1080'
46+
| '1168:880'
47+
| '1440:1080'
48+
| '1080:1440'
49+
| '1808:768'
50+
| '2112:912';
51+
52+
/**
53+
* Settings that affect the behavior of the content moderation system.
54+
*/
55+
contentModeration?: TextToImageCreateParams.ContentModeration;
56+
57+
/**
58+
* An array of images to be used as references for the generated image output. Up
59+
* to three reference images can be provided.
60+
*/
61+
referenceImages?: Array<TextToImageCreateParams.ReferenceImage>;
62+
63+
/**
64+
* If unspecified, a random number is chosen. Varying the seed integer is a way to
65+
* get different results for the same other request parameters. Using the same seed
66+
* integer for an identical request will produce similar results.
67+
*/
68+
seed?: number;
69+
}
70+
71+
export namespace TextToImageCreateParams {
72+
/**
73+
* Settings that affect the behavior of the content moderation system.
74+
*/
75+
export interface ContentModeration {
76+
/**
77+
* When set to `low`, the content moderation system will be less strict about
78+
* preventing generations that include recognizable public figures.
79+
*/
80+
publicFigureThreshold?: 'auto' | 'low';
81+
}
82+
83+
export interface ReferenceImage {
84+
/**
85+
* A HTTPS URL or data URI containing an encoded image to be used as reference for
86+
* the generated output image. See [our docs](/assets/inputs#images) on image
87+
* inputs for more information.
88+
*/
89+
uri: string;
90+
91+
/**
92+
* A name used to refer to the image reference, from 3 to 16 characters in length.
93+
* Tags must be alphanumeric (plus underscores) and start with a letter. You can
94+
* refer to the reference image's tag in the prompt text with at-mention syntax:
95+
* `@tag`. Tags are case-sensitive.
96+
*/
97+
tag?: string;
98+
}
99+
}
100+
101+
export declare namespace TextToImage {
102+
export {
103+
type TextToImageCreateResponse as TextToImageCreateResponse,
104+
type TextToImageCreateParams as TextToImageCreateParams,
105+
};
106+
}

src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const VERSION = '2.0.3'; // x-release-please-version
1+
export const VERSION = '2.1.0'; // x-release-please-version
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
import RunwayML from '@runwayml/sdk';
4+
import { Response } from 'node-fetch';
5+
6+
const client = new RunwayML({
7+
apiKey: 'My API Key',
8+
baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010',
9+
});
10+
11+
describe('resource textToImage', () => {
12+
test('create: only required params', async () => {
13+
const responsePromise = client.textToImage.create({
14+
model: 'gen4_image',
15+
promptText: 'promptText',
16+
ratio: '1920:1080',
17+
});
18+
const rawResponse = await responsePromise.asResponse();
19+
expect(rawResponse).toBeInstanceOf(Response);
20+
const response = await responsePromise;
21+
expect(response).not.toBeInstanceOf(Response);
22+
const dataAndResponse = await responsePromise.withResponse();
23+
expect(dataAndResponse.data).toBe(response);
24+
expect(dataAndResponse.response).toBe(rawResponse);
25+
});
26+
27+
test('create: required and optional params', async () => {
28+
const response = await client.textToImage.create({
29+
model: 'gen4_image',
30+
promptText: 'promptText',
31+
ratio: '1920:1080',
32+
contentModeration: { publicFigureThreshold: 'auto' },
33+
referenceImages: [{ uri: 'https://example.com', tag: 'tag' }],
34+
seed: 0,
35+
});
36+
});
37+
});

0 commit comments

Comments
 (0)