Skip to content

Commit 940bcd1

Browse files
authored
interpolate frames typescript sdk (#111)
1 parent 90d455d commit 940bcd1

File tree

5 files changed

+1842
-766
lines changed

5 files changed

+1842
-766
lines changed

src/GEN_VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20240617.20240727
1+
20240617.20240806

src/Nodes.ts

+208-48
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* 𐃏 Substrate
33
* @generated file
4-
* 20240617.20240727
4+
* 20240617.20240806
55
*/
66

77
import * as OpenAPI from "substrate/OpenAPI";
@@ -294,6 +294,42 @@ export class StableDiffusionXLControlNetOutOutputs extends FutureArray {
294294
return super._result() as Promise<StableDiffusionImage[]>;
295295
}
296296
}
297+
/** Generated frames. */
298+
export class StableVideoDiffusionOutFrameUris extends FutureArray {
299+
/** Returns `FutureString` at given index. */
300+
override at(index: number) {
301+
return new FutureString(this._directive.next(index));
302+
}
303+
/** Returns the result for `StableVideoDiffusionOutFrameUris` once it's node has been run. */
304+
protected override async _result(): Promise<FutureString[]> {
305+
return super._result() as Promise<FutureString[]>;
306+
}
307+
}
308+
export class StableVideoDiffusionOutFrameUrisItem extends FutureString {}
309+
/** Frames. */
310+
export class InterpolateFramesInFrameUris extends FutureArray {
311+
/** Returns `FutureString` at given index. */
312+
override at(index: number) {
313+
return new FutureString(this._directive.next(index));
314+
}
315+
/** Returns the result for `InterpolateFramesInFrameUris` once it's node has been run. */
316+
protected override async _result(): Promise<FutureString[]> {
317+
return super._result() as Promise<FutureString[]>;
318+
}
319+
}
320+
export class InterpolateFramesInFrameUrisItem extends FutureString {}
321+
/** Output frames. */
322+
export class InterpolateFramesOutFrameUris extends FutureArray {
323+
/** Returns `FutureString` at given index. */
324+
override at(index: number) {
325+
return new FutureString(this._directive.next(index));
326+
}
327+
/** Returns the result for `InterpolateFramesOutFrameUris` once it's node has been run. */
328+
protected override async _result(): Promise<FutureString[]> {
329+
return super._result() as Promise<FutureString[]>;
330+
}
331+
}
332+
export class InterpolateFramesOutFrameUrisItem extends FutureString {}
297333
/** Generated images. */
298334
export class MultiInpaintImageOutOutputs extends FutureArray {
299335
/** Returns `InpaintImageOut` at given index. */
@@ -1688,7 +1724,7 @@ export class StableVideoDiffusionIn extends FutureObject {
16881724
get seed() {
16891725
return new FutureNumber(this._directive.next("seed"));
16901726
}
1691-
/** (Optional) Frames per second of the generated video. */
1727+
/** (Optional) Frames per second of the generated video. Ignored if output format is `frames`. */
16921728
get fps() {
16931729
return new FutureNumber(this._directive.next("fps"));
16941730
}
@@ -1711,11 +1747,63 @@ export class StableVideoDiffusionOut extends FutureObject {
17111747
get video_uri() {
17121748
return new FutureString(this._directive.next("video_uri"));
17131749
}
1750+
1751+
/** Generated frames. */
1752+
get frame_uris() {
1753+
return new StableVideoDiffusionOutFrameUris(
1754+
this._directive.next("frame_uris"),
1755+
);
1756+
}
17141757
/** returns the result for `StableVideoDiffusionOut` once it's node has been run. */
17151758
protected override async _result(): Promise<StableVideoDiffusionOut> {
17161759
return super._result() as Promise<StableVideoDiffusionOut>;
17171760
}
17181761
}
1762+
/** InterpolateFramesIn */
1763+
export class InterpolateFramesIn extends FutureObject {
1764+
/** Frames. */
1765+
get frame_uris() {
1766+
return new InterpolateFramesInFrameUris(this._directive.next("frame_uris"));
1767+
}
1768+
/** (Optional) Use "hosted" to return a video URL hosted on Substrate. You can also provide a URL to a registered [file store](https://docs.substrate.run/reference/external-files). If unset, the video data will be returned as a base64-encoded string. */
1769+
get store() {
1770+
return new FutureString(this._directive.next("store"));
1771+
}
1772+
/** (Optional) Output video format. */
1773+
get output_format() {
1774+
return new FutureString(this._directive.next("output_format"));
1775+
}
1776+
/** (Optional) Frames per second of the generated video. Ignored if output format is `frames`. */
1777+
get fps() {
1778+
return new FutureNumber(this._directive.next("fps"));
1779+
}
1780+
/** (Optional) Number of interpolation steps. Each step adds an interpolated frame between adjacent frames. For example, 2 steps over 2 frames produces 5 frames. */
1781+
get num_steps() {
1782+
return new FutureNumber(this._directive.next("num_steps"));
1783+
}
1784+
/** returns the result for `InterpolateFramesIn` once it's node has been run. */
1785+
protected override async _result(): Promise<InterpolateFramesIn> {
1786+
return super._result() as Promise<InterpolateFramesIn>;
1787+
}
1788+
}
1789+
/** InterpolateFramesOut */
1790+
export class InterpolateFramesOut extends FutureObject {
1791+
/** Generated video. */
1792+
get video_uri() {
1793+
return new FutureString(this._directive.next("video_uri"));
1794+
}
1795+
1796+
/** Output frames. */
1797+
get frame_uris() {
1798+
return new InterpolateFramesOutFrameUris(
1799+
this._directive.next("frame_uris"),
1800+
);
1801+
}
1802+
/** returns the result for `InterpolateFramesOut` once it's node has been run. */
1803+
protected override async _result(): Promise<InterpolateFramesOut> {
1804+
return super._result() as Promise<InterpolateFramesOut>;
1805+
}
1806+
}
17191807
/** InpaintImageIn */
17201808
export class InpaintImageIn extends FutureObject {
17211809
/** Original image. */
@@ -4408,7 +4496,7 @@ export class StableVideoDiffusion extends Node {
44084496
/**
44094497
* Input arguments: `image_uri`, `store` (optional), `output_format` (optional), `seed` (optional), `fps` (optional), `motion_bucket_id` (optional), `noise` (optional)
44104498
*
4411-
* Output fields: `video_uri`
4499+
* Output fields: `video_uri` (optional), `frame_uris` (optional)
44124500
*
44134501
* https://www.substrate.run/nodes#StableVideoDiffusion
44144502
*/
@@ -4425,7 +4513,7 @@ export class StableVideoDiffusion extends Node {
44254513
/**
44264514
* Retrieve this node's output from a response.
44274515
*
4428-
* Output fields: `video_uri`
4516+
* Output fields: `video_uri` (optional), `frame_uris` (optional)
44294517
*
44304518
* https://www.substrate.run/nodes#StableVideoDiffusion
44314519
*/
@@ -4442,7 +4530,7 @@ export class StableVideoDiffusion extends Node {
44424530
/**
44434531
* Future reference to this node's output.
44444532
*
4445-
* Output fields: `video_uri`
4533+
* Output fields: `video_uri` (optional), `frame_uris` (optional)
44464534
*
44474535
* https://www.substrate.run/nodes#StableVideoDiffusion
44484536
*/
@@ -4454,6 +4542,75 @@ export class StableVideoDiffusion extends Node {
44544542
return super.output() as OpenAPI.components["schemas"]["StableVideoDiffusionOut"];
44554543
}
44564544
}
4545+
export namespace InterpolateFrames {
4546+
/**
4547+
* InterpolateFrames Input
4548+
* https://www.substrate.run/nodes#InterpolateFrames
4549+
*/
4550+
export type Input = FutureExpandAny<
4551+
OpenAPI.components["schemas"]["InterpolateFramesIn"]
4552+
>;
4553+
4554+
/**
4555+
* InterpolateFrames Output
4556+
* https://www.substrate.run/nodes#InterpolateFrames
4557+
*/
4558+
export type Output = OpenAPI.components["schemas"]["InterpolateFramesOut"];
4559+
}
4560+
4561+
/**
4562+
* Generates a interpolation frames between each adjacent frames.
4563+
*
4564+
* https://www.substrate.run/nodes#InterpolateFrames
4565+
*/
4566+
export class InterpolateFrames extends Node {
4567+
/**
4568+
* Input arguments: `frame_uris`, `store` (optional), `output_format` (optional), `fps` (optional), `num_steps` (optional)
4569+
*
4570+
* Output fields: `video_uri` (optional), `frame_uris` (optional)
4571+
*
4572+
* https://www.substrate.run/nodes#InterpolateFrames
4573+
*/
4574+
constructor(
4575+
args: FutureExpandAny<OpenAPI.components["schemas"]["InterpolateFramesIn"]>,
4576+
options?: Options,
4577+
) {
4578+
super(args, options);
4579+
this.node = "InterpolateFrames";
4580+
}
4581+
4582+
/**
4583+
* Retrieve this node's output from a response.
4584+
*
4585+
* Output fields: `video_uri` (optional), `frame_uris` (optional)
4586+
*
4587+
* https://www.substrate.run/nodes#InterpolateFrames
4588+
*/
4589+
protected override async result(): Promise<
4590+
OpenAPI.components["schemas"]["InterpolateFramesOut"] | undefined
4591+
> {
4592+
return Promise.resolve(
4593+
this._response ? this._response.get(this) : undefined,
4594+
) as Promise<
4595+
OpenAPI.components["schemas"]["InterpolateFramesOut"] | undefined
4596+
>;
4597+
}
4598+
4599+
/**
4600+
* Future reference to this node's output.
4601+
*
4602+
* Output fields: `video_uri` (optional), `frame_uris` (optional)
4603+
*
4604+
* https://www.substrate.run/nodes#InterpolateFrames
4605+
*/
4606+
override get future(): InterpolateFramesOut {
4607+
return new InterpolateFramesOut(new Trace([], this));
4608+
}
4609+
4610+
protected override output(): OpenAPI.components["schemas"]["InterpolateFramesOut"] {
4611+
return super.output() as OpenAPI.components["schemas"]["InterpolateFramesOut"];
4612+
}
4613+
}
44574614
export namespace TranscribeSpeech {
44584615
/**
44594616
* TranscribeSpeech Input
@@ -5907,6 +6064,7 @@ export type AnyNode =
59076064
| StableDiffusionXLInpaint
59086065
| StableDiffusionXLControlNet
59096066
| StableVideoDiffusion
6067+
| InterpolateFrames
59106068
| TranscribeSpeech
59116069
| GenerateSpeech
59126070
| RemoveBackground
@@ -5973,46 +6131,48 @@ export type NodeOutput<T> = T extends Experimental
59736131
? OpenAPI.components["schemas"]["StableDiffusionXLControlNetOut"]
59746132
: T extends StableVideoDiffusion
59756133
? OpenAPI.components["schemas"]["StableVideoDiffusionOut"]
5976-
: T extends TranscribeSpeech
5977-
? OpenAPI.components["schemas"]["TranscribeSpeechOut"]
5978-
: T extends GenerateSpeech
5979-
? OpenAPI.components["schemas"]["GenerateSpeechOut"]
5980-
: T extends RemoveBackground
5981-
? OpenAPI.components["schemas"]["RemoveBackgroundOut"]
5982-
: T extends EraseImage
5983-
? OpenAPI.components["schemas"]["EraseImageOut"]
5984-
: T extends UpscaleImage
5985-
? OpenAPI.components["schemas"]["UpscaleImageOut"]
5986-
: T extends SegmentUnderPoint
5987-
? OpenAPI.components["schemas"]["SegmentUnderPointOut"]
5988-
: T extends SegmentAnything
5989-
? OpenAPI.components["schemas"]["SegmentAnythingOut"]
5990-
: T extends SplitDocument
5991-
? OpenAPI.components["schemas"]["SplitDocumentOut"]
5992-
: T extends EmbedText
5993-
? OpenAPI.components["schemas"]["EmbedTextOut"]
5994-
: T extends MultiEmbedText
5995-
? OpenAPI.components["schemas"]["MultiEmbedTextOut"]
5996-
: T extends EmbedImage
5997-
? OpenAPI.components["schemas"]["EmbedImageOut"]
5998-
: T extends MultiEmbedImage
5999-
? OpenAPI.components["schemas"]["MultiEmbedImageOut"]
6000-
: T extends JinaV2
6001-
? OpenAPI.components["schemas"]["JinaV2Out"]
6002-
: T extends CLIP
6003-
? OpenAPI.components["schemas"]["CLIPOut"]
6004-
: T extends FindOrCreateVectorStore
6005-
? OpenAPI.components["schemas"]["FindOrCreateVectorStoreOut"]
6006-
: T extends ListVectorStores
6007-
? OpenAPI.components["schemas"]["ListVectorStoresOut"]
6008-
: T extends DeleteVectorStore
6009-
? OpenAPI.components["schemas"]["DeleteVectorStoreOut"]
6010-
: T extends QueryVectorStore
6011-
? OpenAPI.components["schemas"]["QueryVectorStoreOut"]
6012-
: T extends FetchVectors
6013-
? OpenAPI.components["schemas"]["FetchVectorsOut"]
6014-
: T extends UpdateVectors
6015-
? OpenAPI.components["schemas"]["UpdateVectorsOut"]
6016-
: T extends DeleteVectors
6017-
? OpenAPI.components["schemas"]["DeleteVectorsOut"]
6018-
: never;
6134+
: T extends InterpolateFrames
6135+
? OpenAPI.components["schemas"]["InterpolateFramesOut"]
6136+
: T extends TranscribeSpeech
6137+
? OpenAPI.components["schemas"]["TranscribeSpeechOut"]
6138+
: T extends GenerateSpeech
6139+
? OpenAPI.components["schemas"]["GenerateSpeechOut"]
6140+
: T extends RemoveBackground
6141+
? OpenAPI.components["schemas"]["RemoveBackgroundOut"]
6142+
: T extends EraseImage
6143+
? OpenAPI.components["schemas"]["EraseImageOut"]
6144+
: T extends UpscaleImage
6145+
? OpenAPI.components["schemas"]["UpscaleImageOut"]
6146+
: T extends SegmentUnderPoint
6147+
? OpenAPI.components["schemas"]["SegmentUnderPointOut"]
6148+
: T extends SegmentAnything
6149+
? OpenAPI.components["schemas"]["SegmentAnythingOut"]
6150+
: T extends SplitDocument
6151+
? OpenAPI.components["schemas"]["SplitDocumentOut"]
6152+
: T extends EmbedText
6153+
? OpenAPI.components["schemas"]["EmbedTextOut"]
6154+
: T extends MultiEmbedText
6155+
? OpenAPI.components["schemas"]["MultiEmbedTextOut"]
6156+
: T extends EmbedImage
6157+
? OpenAPI.components["schemas"]["EmbedImageOut"]
6158+
: T extends MultiEmbedImage
6159+
? OpenAPI.components["schemas"]["MultiEmbedImageOut"]
6160+
: T extends JinaV2
6161+
? OpenAPI.components["schemas"]["JinaV2Out"]
6162+
: T extends CLIP
6163+
? OpenAPI.components["schemas"]["CLIPOut"]
6164+
: T extends FindOrCreateVectorStore
6165+
? OpenAPI.components["schemas"]["FindOrCreateVectorStoreOut"]
6166+
: T extends ListVectorStores
6167+
? OpenAPI.components["schemas"]["ListVectorStoresOut"]
6168+
: T extends DeleteVectorStore
6169+
? OpenAPI.components["schemas"]["DeleteVectorStoreOut"]
6170+
: T extends QueryVectorStore
6171+
? OpenAPI.components["schemas"]["QueryVectorStoreOut"]
6172+
: T extends FetchVectors
6173+
? OpenAPI.components["schemas"]["FetchVectorsOut"]
6174+
: T extends UpdateVectors
6175+
? OpenAPI.components["schemas"]["UpdateVectorsOut"]
6176+
: T extends DeleteVectors
6177+
? OpenAPI.components["schemas"]["DeleteVectorsOut"]
6178+
: never;

0 commit comments

Comments
 (0)