@scenario-labs/sdk 1.0.0 → 1.1.0
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.
- package/CHANGELOG.md +8 -0
- package/README.md +0 -2
- package/client.d.mts +2 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +2 -2
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs.map +1 -1
- package/index.d.mts +3 -1
- package/index.d.mts.map +1 -1
- package/index.d.ts +3 -1
- package/index.d.ts.map +1 -1
- package/index.js +8 -1
- package/index.js.map +1 -1
- package/index.mjs +3 -1
- package/index.mjs.map +1 -1
- package/lib/asset.d.mts +55 -0
- package/lib/asset.d.mts.map +1 -0
- package/lib/asset.d.ts +55 -0
- package/lib/asset.d.ts.map +1 -0
- package/lib/asset.js +60 -0
- package/lib/asset.js.map +1 -0
- package/lib/asset.mjs +54 -0
- package/lib/asset.mjs.map +1 -0
- package/lib/job.d.mts +13 -1
- package/lib/job.d.mts.map +1 -1
- package/lib/job.d.ts +13 -1
- package/lib/job.d.ts.map +1 -1
- package/lib/job.js +18 -1
- package/lib/job.js.map +1 -1
- package/lib/job.mjs +16 -0
- package/lib/job.mjs.map +1 -1
- package/lib/scenario.d.mts +12 -0
- package/lib/scenario.d.mts.map +1 -1
- package/lib/scenario.d.ts +12 -0
- package/lib/scenario.d.ts.map +1 -1
- package/lib/scenario.js +12 -0
- package/lib/scenario.js.map +1 -1
- package/lib/scenario.mjs +12 -0
- package/lib/scenario.mjs.map +1 -1
- package/lib/upload.d.mts +56 -2
- package/lib/upload.d.mts.map +1 -1
- package/lib/upload.d.ts +56 -2
- package/lib/upload.d.ts.map +1 -1
- package/lib/upload.js +51 -2
- package/lib/upload.js.map +1 -1
- package/lib/upload.mjs +48 -1
- package/lib/upload.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/assets/assets.d.mts +25 -25
- package/resources/assets/assets.d.mts.map +1 -1
- package/resources/assets/assets.d.ts +25 -25
- package/resources/assets/assets.d.ts.map +1 -1
- package/resources/assets/assets.js.map +1 -1
- package/resources/assets/assets.mjs.map +1 -1
- package/resources/assets/public.d.mts +12 -12
- package/resources/assets/public.d.mts.map +1 -1
- package/resources/assets/public.d.ts +12 -12
- package/resources/assets/public.d.ts.map +1 -1
- package/resources/generate.d.mts +1027 -242
- package/resources/generate.d.mts.map +1 -1
- package/resources/generate.d.ts +1027 -242
- package/resources/generate.d.ts.map +1 -1
- package/resources/generate.js +7 -0
- package/resources/generate.js.map +1 -1
- package/resources/generate.mjs +7 -0
- package/resources/generate.mjs.map +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/models/description.d.mts +2 -2
- package/resources/models/description.d.mts.map +1 -1
- package/resources/models/description.d.ts +2 -2
- package/resources/models/description.d.ts.map +1 -1
- package/resources/models/examples.d.mts +4 -4
- package/resources/models/examples.d.mts.map +1 -1
- package/resources/models/examples.d.ts +4 -4
- package/resources/models/examples.d.ts.map +1 -1
- package/resources/models/models.d.mts +7 -7
- package/resources/models/models.d.mts.map +1 -1
- package/resources/models/models.d.ts +7 -7
- package/resources/models/models.d.ts.map +1 -1
- package/resources/models/models.js.map +1 -1
- package/resources/models/models.mjs.map +1 -1
- package/resources/models/train.d.mts +2 -2
- package/resources/models/train.d.mts.map +1 -1
- package/resources/models/train.d.ts +2 -2
- package/resources/models/train.d.ts.map +1 -1
- package/resources/usages.d.mts +3 -3
- package/resources/usages.d.mts.map +1 -1
- package/resources/usages.d.ts +3 -3
- package/resources/usages.d.ts.map +1 -1
- package/src/client.ts +4 -0
- package/src/index.ts +3 -1
- package/src/lib/asset.ts +85 -0
- package/src/lib/job.ts +28 -1
- package/src/lib/scenario.ts +12 -0
- package/src/lib/upload.ts +96 -2
- package/src/resources/assets/assets.ts +43 -7
- package/src/resources/assets/public.ts +17 -7
- package/src/resources/generate.ts +1227 -136
- package/src/resources/index.ts +2 -0
- package/src/resources/models/description.ts +4 -0
- package/src/resources/models/examples.ts +8 -0
- package/src/resources/models/models.ts +14 -0
- package/src/resources/models/train.ts +4 -0
- package/src/resources/usages.ts +5 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/resources/generate.d.ts
CHANGED
|
@@ -23,6 +23,10 @@ export declare class Generate extends APIResource {
|
|
|
23
23
|
* Patch an asset with an image.
|
|
24
24
|
*/
|
|
25
25
|
patch(params: GeneratePatchParams, options?: RequestOptions): APIPromise<GeneratePatchResponse>;
|
|
26
|
+
/**
|
|
27
|
+
* Generate, complete or invent new prompts.
|
|
28
|
+
*/
|
|
29
|
+
prompt(params: GeneratePromptParams, options?: RequestOptions): APIPromise<GeneratePromptResponse>;
|
|
26
30
|
/**
|
|
27
31
|
* Generate with any model (Image, Video, Audio, 3d).
|
|
28
32
|
*
|
|
@@ -2158,7 +2162,7 @@ export declare namespace GenerateDetectResponse {
|
|
|
2158
2162
|
/**
|
|
2159
2163
|
* source of the asset
|
|
2160
2164
|
*/
|
|
2161
|
-
source: '3d23d' | '3d23d:texture' | '3d:texture' | '3d:texture:albedo' | '3d:texture:metallic' | '3d:texture:mtl' | '3d:texture:normal' | '3d:texture:roughness' | 'audio2audio' | 'background-removal' | 'canvas' | 'canvas-drawing' | 'canvas-export' | 'detection' | 'generative-fill' | 'image-prompt-editing' | 'img23d' | 'img2img' | 'img2video' | 'inference-control-net' | 'inference-control-net-img' | 'inference-control-net-inpainting' | 'inference-control-net-inpainting-ip-adapter' | 'inference-control-net-ip-adapter' | 'inference-control-net-reference' | 'inference-control-net-texture' | 'inference-img' | 'inference-img-ip-adapter' | 'inference-img-texture' | 'inference-in-paint' | 'inference-in-paint-ip-adapter' | 'inference-reference' | 'inference-reference-texture' | 'inference-txt' | 'inference-txt-ip-adapter' | 'inference-txt-texture' | 'patch' | 'pixelization' | 'reframe' | 'restyle' | 'segment' | 'segmentation-image' | 'segmentation-mask' | 'skybox-3d' | 'skybox-base-360' | 'skybox-hdri' | 'texture' | 'texture:albedo' | 'texture:ao' | 'texture:edge' | 'texture:height' | 'texture:metallic' | 'texture:normal' | 'texture:smoothness' | 'txt23d' | 'txt2audio' | 'txt2img' | 'txt2video' | 'unknown' | 'uploaded' | 'uploaded-3d' | 'uploaded-audio' | 'uploaded-avatar' | 'uploaded-video' | 'upscale' | 'upscale-skybox' | 'upscale-texture' | 'upscale-video' | 'vectorization' | 'video23d' | 'video2img' | 'video2video' | 'voice-clone';
|
|
2165
|
+
source: '3d23d' | '3d23d:texture' | '3d:texture' | '3d:texture:albedo' | '3d:texture:metallic' | '3d:texture:mtl' | '3d:texture:normal' | '3d:texture:roughness' | 'audio2audio' | 'audio2video' | 'background-removal' | 'canvas' | 'canvas-drawing' | 'canvas-export' | 'detection' | 'generative-fill' | 'image-prompt-editing' | 'img23d' | 'img2img' | 'img2video' | 'inference-control-net' | 'inference-control-net-img' | 'inference-control-net-inpainting' | 'inference-control-net-inpainting-ip-adapter' | 'inference-control-net-ip-adapter' | 'inference-control-net-reference' | 'inference-control-net-texture' | 'inference-img' | 'inference-img-ip-adapter' | 'inference-img-texture' | 'inference-in-paint' | 'inference-in-paint-ip-adapter' | 'inference-reference' | 'inference-reference-texture' | 'inference-txt' | 'inference-txt-ip-adapter' | 'inference-txt-texture' | 'patch' | 'pixelization' | 'reframe' | 'restyle' | 'segment' | 'segmentation-image' | 'segmentation-mask' | 'skybox-3d' | 'skybox-base-360' | 'skybox-hdri' | 'texture' | 'texture:albedo' | 'texture:ao' | 'texture:edge' | 'texture:height' | 'texture:metallic' | 'texture:normal' | 'texture:smoothness' | 'txt23d' | 'txt2audio' | 'txt2img' | 'txt2video' | 'unknown' | 'uploaded' | 'uploaded-3d' | 'uploaded-audio' | 'uploaded-avatar' | 'uploaded-video' | 'upscale' | 'upscale-skybox' | 'upscale-texture' | 'upscale-video' | 'vectorization' | 'video23d' | 'video2audio' | 'video2img' | 'video2video' | 'voice-clone';
|
|
2162
2166
|
/**
|
|
2163
2167
|
* The actual status
|
|
2164
2168
|
*/
|
|
@@ -2251,7 +2255,7 @@ export declare namespace GenerateDetectResponse {
|
|
|
2251
2255
|
* The type of the asset. Ex: 'inference-txt2img' will represent an asset generated
|
|
2252
2256
|
* from a text to image model
|
|
2253
2257
|
*/
|
|
2254
|
-
type: '3d-texture' | '3d-texture-albedo' | '3d-texture-metallic' | '3d-texture-mtl' | '3d-texture-normal' | '3d-texture-roughness' | '3d23d' | '3d23d-texture' | 'audio2audio' | 'background-removal' | 'canvas' | 'canvas-drawing' | 'canvas-export' | 'detection' | 'generative-fill' | 'image-prompt-editing' | 'img23d' | 'img2img' | 'img2video' | 'inference-controlnet' | 'inference-controlnet-img2img' | 'inference-controlnet-inpaint' | 'inference-controlnet-inpaint-ip-adapter' | 'inference-controlnet-ip-adapter' | 'inference-controlnet-reference' | 'inference-controlnet-texture' | 'inference-img2img' | 'inference-img2img-ip-adapter' | 'inference-img2img-texture' | 'inference-inpaint' | 'inference-inpaint-ip-adapter' | 'inference-reference' | 'inference-reference-texture' | 'inference-txt2img' | 'inference-txt2img-ip-adapter' | 'inference-txt2img-texture' | 'patch' | 'pixelization' | 'reframe' | 'restyle' | 'segment' | 'segmentation-image' | 'segmentation-mask' | 'skybox-3d' | 'skybox-base-360' | 'skybox-hdri' | 'texture' | 'texture-albedo' | 'texture-ao' | 'texture-edge' | 'texture-height' | 'texture-metallic' | 'texture-normal' | 'texture-smoothness' | 'txt23d' | 'txt2audio' | 'txt2img' | 'txt2video' | 'unknown' | 'uploaded' | 'uploaded-3d' | 'uploaded-audio' | 'uploaded-avatar' | 'uploaded-video' | 'upscale' | 'upscale-skybox' | 'upscale-texture' | 'upscale-video' | 'vectorization' | 'video23d' | 'video2img' | 'video2video' | 'voice-clone';
|
|
2258
|
+
type: '3d-texture' | '3d-texture-albedo' | '3d-texture-metallic' | '3d-texture-mtl' | '3d-texture-normal' | '3d-texture-roughness' | '3d23d' | '3d23d-texture' | 'audio2audio' | 'audio2video' | 'background-removal' | 'canvas' | 'canvas-drawing' | 'canvas-export' | 'detection' | 'generative-fill' | 'image-prompt-editing' | 'img23d' | 'img2img' | 'img2video' | 'inference-controlnet' | 'inference-controlnet-img2img' | 'inference-controlnet-inpaint' | 'inference-controlnet-inpaint-ip-adapter' | 'inference-controlnet-ip-adapter' | 'inference-controlnet-reference' | 'inference-controlnet-texture' | 'inference-img2img' | 'inference-img2img-ip-adapter' | 'inference-img2img-texture' | 'inference-inpaint' | 'inference-inpaint-ip-adapter' | 'inference-reference' | 'inference-reference-texture' | 'inference-txt2img' | 'inference-txt2img-ip-adapter' | 'inference-txt2img-texture' | 'patch' | 'pixelization' | 'reframe' | 'restyle' | 'segment' | 'segmentation-image' | 'segmentation-mask' | 'skybox-3d' | 'skybox-base-360' | 'skybox-hdri' | 'texture' | 'texture-albedo' | 'texture-ao' | 'texture-edge' | 'texture-height' | 'texture-metallic' | 'texture-normal' | 'texture-smoothness' | 'txt23d' | 'txt2audio' | 'txt2img' | 'txt2video' | 'unknown' | 'uploaded' | 'uploaded-3d' | 'uploaded-audio' | 'uploaded-avatar' | 'uploaded-video' | 'upscale' | 'upscale-skybox' | 'upscale-texture' | 'upscale-video' | 'vectorization' | 'video23d' | 'video2audio' | 'video2img' | 'video2video' | 'voice-clone';
|
|
2255
2259
|
/**
|
|
2256
2260
|
* How angular is the surface? 0 is like a sphere, 1 is like a mechanical object
|
|
2257
2261
|
*/
|
|
@@ -4235,7 +4239,7 @@ export declare namespace GeneratePatchResponse {
|
|
|
4235
4239
|
/**
|
|
4236
4240
|
* source of the asset
|
|
4237
4241
|
*/
|
|
4238
|
-
source: '3d23d' | '3d23d:texture' | '3d:texture' | '3d:texture:albedo' | '3d:texture:metallic' | '3d:texture:mtl' | '3d:texture:normal' | '3d:texture:roughness' | 'audio2audio' | 'background-removal' | 'canvas' | 'canvas-drawing' | 'canvas-export' | 'detection' | 'generative-fill' | 'image-prompt-editing' | 'img23d' | 'img2img' | 'img2video' | 'inference-control-net' | 'inference-control-net-img' | 'inference-control-net-inpainting' | 'inference-control-net-inpainting-ip-adapter' | 'inference-control-net-ip-adapter' | 'inference-control-net-reference' | 'inference-control-net-texture' | 'inference-img' | 'inference-img-ip-adapter' | 'inference-img-texture' | 'inference-in-paint' | 'inference-in-paint-ip-adapter' | 'inference-reference' | 'inference-reference-texture' | 'inference-txt' | 'inference-txt-ip-adapter' | 'inference-txt-texture' | 'patch' | 'pixelization' | 'reframe' | 'restyle' | 'segment' | 'segmentation-image' | 'segmentation-mask' | 'skybox-3d' | 'skybox-base-360' | 'skybox-hdri' | 'texture' | 'texture:albedo' | 'texture:ao' | 'texture:edge' | 'texture:height' | 'texture:metallic' | 'texture:normal' | 'texture:smoothness' | 'txt23d' | 'txt2audio' | 'txt2img' | 'txt2video' | 'unknown' | 'uploaded' | 'uploaded-3d' | 'uploaded-audio' | 'uploaded-avatar' | 'uploaded-video' | 'upscale' | 'upscale-skybox' | 'upscale-texture' | 'upscale-video' | 'vectorization' | 'video23d' | 'video2img' | 'video2video' | 'voice-clone';
|
|
4242
|
+
source: '3d23d' | '3d23d:texture' | '3d:texture' | '3d:texture:albedo' | '3d:texture:metallic' | '3d:texture:mtl' | '3d:texture:normal' | '3d:texture:roughness' | 'audio2audio' | 'audio2video' | 'background-removal' | 'canvas' | 'canvas-drawing' | 'canvas-export' | 'detection' | 'generative-fill' | 'image-prompt-editing' | 'img23d' | 'img2img' | 'img2video' | 'inference-control-net' | 'inference-control-net-img' | 'inference-control-net-inpainting' | 'inference-control-net-inpainting-ip-adapter' | 'inference-control-net-ip-adapter' | 'inference-control-net-reference' | 'inference-control-net-texture' | 'inference-img' | 'inference-img-ip-adapter' | 'inference-img-texture' | 'inference-in-paint' | 'inference-in-paint-ip-adapter' | 'inference-reference' | 'inference-reference-texture' | 'inference-txt' | 'inference-txt-ip-adapter' | 'inference-txt-texture' | 'patch' | 'pixelization' | 'reframe' | 'restyle' | 'segment' | 'segmentation-image' | 'segmentation-mask' | 'skybox-3d' | 'skybox-base-360' | 'skybox-hdri' | 'texture' | 'texture:albedo' | 'texture:ao' | 'texture:edge' | 'texture:height' | 'texture:metallic' | 'texture:normal' | 'texture:smoothness' | 'txt23d' | 'txt2audio' | 'txt2img' | 'txt2video' | 'unknown' | 'uploaded' | 'uploaded-3d' | 'uploaded-audio' | 'uploaded-avatar' | 'uploaded-video' | 'upscale' | 'upscale-skybox' | 'upscale-texture' | 'upscale-video' | 'vectorization' | 'video23d' | 'video2audio' | 'video2img' | 'video2video' | 'voice-clone';
|
|
4239
4243
|
/**
|
|
4240
4244
|
* The actual status
|
|
4241
4245
|
*/
|
|
@@ -4328,7 +4332,7 @@ export declare namespace GeneratePatchResponse {
|
|
|
4328
4332
|
* The type of the asset. Ex: 'inference-txt2img' will represent an asset generated
|
|
4329
4333
|
* from a text to image model
|
|
4330
4334
|
*/
|
|
4331
|
-
type: '3d-texture' | '3d-texture-albedo' | '3d-texture-metallic' | '3d-texture-mtl' | '3d-texture-normal' | '3d-texture-roughness' | '3d23d' | '3d23d-texture' | 'audio2audio' | 'background-removal' | 'canvas' | 'canvas-drawing' | 'canvas-export' | 'detection' | 'generative-fill' | 'image-prompt-editing' | 'img23d' | 'img2img' | 'img2video' | 'inference-controlnet' | 'inference-controlnet-img2img' | 'inference-controlnet-inpaint' | 'inference-controlnet-inpaint-ip-adapter' | 'inference-controlnet-ip-adapter' | 'inference-controlnet-reference' | 'inference-controlnet-texture' | 'inference-img2img' | 'inference-img2img-ip-adapter' | 'inference-img2img-texture' | 'inference-inpaint' | 'inference-inpaint-ip-adapter' | 'inference-reference' | 'inference-reference-texture' | 'inference-txt2img' | 'inference-txt2img-ip-adapter' | 'inference-txt2img-texture' | 'patch' | 'pixelization' | 'reframe' | 'restyle' | 'segment' | 'segmentation-image' | 'segmentation-mask' | 'skybox-3d' | 'skybox-base-360' | 'skybox-hdri' | 'texture' | 'texture-albedo' | 'texture-ao' | 'texture-edge' | 'texture-height' | 'texture-metallic' | 'texture-normal' | 'texture-smoothness' | 'txt23d' | 'txt2audio' | 'txt2img' | 'txt2video' | 'unknown' | 'uploaded' | 'uploaded-3d' | 'uploaded-audio' | 'uploaded-avatar' | 'uploaded-video' | 'upscale' | 'upscale-skybox' | 'upscale-texture' | 'upscale-video' | 'vectorization' | 'video23d' | 'video2img' | 'video2video' | 'voice-clone';
|
|
4335
|
+
type: '3d-texture' | '3d-texture-albedo' | '3d-texture-metallic' | '3d-texture-mtl' | '3d-texture-normal' | '3d-texture-roughness' | '3d23d' | '3d23d-texture' | 'audio2audio' | 'audio2video' | 'background-removal' | 'canvas' | 'canvas-drawing' | 'canvas-export' | 'detection' | 'generative-fill' | 'image-prompt-editing' | 'img23d' | 'img2img' | 'img2video' | 'inference-controlnet' | 'inference-controlnet-img2img' | 'inference-controlnet-inpaint' | 'inference-controlnet-inpaint-ip-adapter' | 'inference-controlnet-ip-adapter' | 'inference-controlnet-reference' | 'inference-controlnet-texture' | 'inference-img2img' | 'inference-img2img-ip-adapter' | 'inference-img2img-texture' | 'inference-inpaint' | 'inference-inpaint-ip-adapter' | 'inference-reference' | 'inference-reference-texture' | 'inference-txt2img' | 'inference-txt2img-ip-adapter' | 'inference-txt2img-texture' | 'patch' | 'pixelization' | 'reframe' | 'restyle' | 'segment' | 'segmentation-image' | 'segmentation-mask' | 'skybox-3d' | 'skybox-base-360' | 'skybox-hdri' | 'texture' | 'texture-albedo' | 'texture-ao' | 'texture-edge' | 'texture-height' | 'texture-metallic' | 'texture-normal' | 'texture-smoothness' | 'txt23d' | 'txt2audio' | 'txt2img' | 'txt2video' | 'unknown' | 'uploaded' | 'uploaded-3d' | 'uploaded-audio' | 'uploaded-avatar' | 'uploaded-video' | 'upscale' | 'upscale-skybox' | 'upscale-texture' | 'upscale-video' | 'vectorization' | 'video23d' | 'video2audio' | 'video2img' | 'video2video' | 'voice-clone';
|
|
4332
4336
|
/**
|
|
4333
4337
|
* How angular is the surface? 0 is like a sphere, 1 is like a mechanical object
|
|
4334
4338
|
*/
|
|
@@ -4889,8 +4893,12 @@ export declare namespace GeneratePatchResponse {
|
|
|
4889
4893
|
}
|
|
4890
4894
|
}
|
|
4891
4895
|
}
|
|
4892
|
-
export interface
|
|
4893
|
-
job:
|
|
4896
|
+
export interface GeneratePromptResponse {
|
|
4897
|
+
job: GeneratePromptResponse.Job;
|
|
4898
|
+
/**
|
|
4899
|
+
* The generated prompts.
|
|
4900
|
+
*/
|
|
4901
|
+
prompts: Array<string>;
|
|
4894
4902
|
/**
|
|
4895
4903
|
* The Creative Units cost for the request billed
|
|
4896
4904
|
*/
|
|
@@ -4899,8 +4907,12 @@ export interface GenerateRunModelResponse {
|
|
|
4899
4907
|
* The Creative Units discount for the request billed
|
|
4900
4908
|
*/
|
|
4901
4909
|
creativeUnitsDiscount?: number;
|
|
4910
|
+
/**
|
|
4911
|
+
* The mode used to generate new prompt(s).
|
|
4912
|
+
*/
|
|
4913
|
+
mode?: 'completion' | 'contextual' | 'image-editing' | 'inventive' | 'structured';
|
|
4902
4914
|
}
|
|
4903
|
-
export declare namespace
|
|
4915
|
+
export declare namespace GeneratePromptResponse {
|
|
4904
4916
|
interface Job {
|
|
4905
4917
|
/**
|
|
4906
4918
|
* The job creation date as an ISO string (example: "2023-02-03T11:19:41.579Z")
|
|
@@ -5573,16 +5585,8 @@ export declare namespace GenerateRunModelResponse {
|
|
|
5573
5585
|
}
|
|
5574
5586
|
}
|
|
5575
5587
|
}
|
|
5576
|
-
export interface
|
|
5577
|
-
|
|
5578
|
-
* Detected language of the input.
|
|
5579
|
-
*/
|
|
5580
|
-
detectedLanguage: string;
|
|
5581
|
-
job: GenerateTranslateResponse.Job;
|
|
5582
|
-
/**
|
|
5583
|
-
* The translated prompt.
|
|
5584
|
-
*/
|
|
5585
|
-
translation: string;
|
|
5588
|
+
export interface GenerateRunModelResponse {
|
|
5589
|
+
job: GenerateRunModelResponse.Job;
|
|
5586
5590
|
/**
|
|
5587
5591
|
* The Creative Units cost for the request billed
|
|
5588
5592
|
*/
|
|
@@ -5592,7 +5596,7 @@ export interface GenerateTranslateResponse {
|
|
|
5592
5596
|
*/
|
|
5593
5597
|
creativeUnitsDiscount?: number;
|
|
5594
5598
|
}
|
|
5595
|
-
export declare namespace
|
|
5599
|
+
export declare namespace GenerateRunModelResponse {
|
|
5596
5600
|
interface Job {
|
|
5597
5601
|
/**
|
|
5598
5602
|
* The job creation date as an ISO string (example: "2023-02-03T11:19:41.579Z")
|
|
@@ -6265,238 +6269,930 @@ export declare namespace GenerateTranslateResponse {
|
|
|
6265
6269
|
}
|
|
6266
6270
|
}
|
|
6267
6271
|
}
|
|
6268
|
-
export interface
|
|
6269
|
-
/**
|
|
6270
|
-
* Body param: List of images used to generate captions. Results are returned in
|
|
6271
|
-
* the same order as the given images.
|
|
6272
|
-
*
|
|
6273
|
-
* Images are set a data URLs (example:
|
|
6274
|
-
* \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=\")
|
|
6275
|
-
* or the asset IDs (example: \"asset_GTrL3mq4SXWyMxkOHRxlpw\").
|
|
6276
|
-
*
|
|
6277
|
-
* Notes:
|
|
6278
|
-
*
|
|
6279
|
-
* - if both `modelId` and `images` are provided, `modelId`'s examples and training
|
|
6280
|
-
* images will be used to influence the caption structure of the images
|
|
6281
|
-
* - if only `images` are provided, the captions will be conditioned by the
|
|
6282
|
-
* `detailsLevel` parameter
|
|
6283
|
-
* - Replaces `assetIds` parameter
|
|
6284
|
-
* - if you want to caption multiple images at a time, please prefer using asset
|
|
6285
|
-
* ids instead of data url
|
|
6286
|
-
*/
|
|
6287
|
-
images: Array<string>;
|
|
6288
|
-
/**
|
|
6289
|
-
* Query param
|
|
6290
|
-
*/
|
|
6291
|
-
dryRun?: unknown;
|
|
6292
|
-
/**
|
|
6293
|
-
* Body param: The assetIds to generate captions. Results are returned in the same
|
|
6294
|
-
* order as the given assetIds. Deprecated, use `images` parameter instead.
|
|
6295
|
-
*/
|
|
6296
|
-
assetIds?: Array<string>;
|
|
6297
|
-
/**
|
|
6298
|
-
* Body param: The details level used to generate the captions.
|
|
6299
|
-
*
|
|
6300
|
-
* When a modelId is provided and examples are available, the details level is
|
|
6301
|
-
* ignored.
|
|
6302
|
-
*/
|
|
6303
|
-
detailsLevel?: 'action' | 'action+style';
|
|
6304
|
-
/**
|
|
6305
|
-
* Body param: Whether we try to ensure IP removal for new prompt generation.
|
|
6306
|
-
*/
|
|
6307
|
-
ensureIPCleared?: boolean;
|
|
6308
|
-
/**
|
|
6309
|
-
* Body param: When provided, the model will follow the model's training images and
|
|
6310
|
-
* examples' prompt to generate the captions.
|
|
6311
|
-
*/
|
|
6312
|
-
modelId?: string;
|
|
6313
|
-
/**
|
|
6314
|
-
* Body param: If specified, the API will make a best effort to produce the same
|
|
6315
|
-
* results, such that repeated requests with the same `seed` and parameters should
|
|
6316
|
-
* return the same outputs. Must be used along with the same parameters including
|
|
6317
|
-
* prompt, model's state, etc..
|
|
6318
|
-
*/
|
|
6319
|
-
seed?: number;
|
|
6320
|
-
/**
|
|
6321
|
-
* Body param: The sampling temperature to use. Higher values like `0.8` will make
|
|
6322
|
-
* the output more random, while lower values like `0.2` will make it more focused
|
|
6323
|
-
* and deterministic.
|
|
6324
|
-
*
|
|
6325
|
-
* We generally recommend altering this or `topP` but not both.
|
|
6326
|
-
*/
|
|
6327
|
-
temperature?: number;
|
|
6328
|
-
/**
|
|
6329
|
-
* Body param: An alternative to sampling with temperature, called nucleus
|
|
6330
|
-
* sampling, where the model considers the results of the tokens with top_p
|
|
6331
|
-
* probability mass. So `0.1` means only the tokens comprising the top `10%`
|
|
6332
|
-
* probability mass are considered.
|
|
6333
|
-
*
|
|
6334
|
-
* We generally recommend altering this or `temperature` but not both.
|
|
6335
|
-
*/
|
|
6336
|
-
topP?: number;
|
|
6337
|
-
/**
|
|
6338
|
-
* Body param: Optional list of words sequences that should not be present in the
|
|
6339
|
-
* generated prompts.
|
|
6340
|
-
*/
|
|
6341
|
-
unwantedSequences?: Array<string>;
|
|
6342
|
-
}
|
|
6343
|
-
export interface GenerateDescribeStyleParams {
|
|
6344
|
-
/**
|
|
6345
|
-
* Query param
|
|
6346
|
-
*/
|
|
6347
|
-
dryRun?: unknown;
|
|
6348
|
-
/**
|
|
6349
|
-
* Body param: The asset ids used to condition the generation.
|
|
6350
|
-
*/
|
|
6351
|
-
assetIds?: Array<string>;
|
|
6352
|
-
/**
|
|
6353
|
-
* Body param: Whether we try to ensure IP removal for new prompt generation.
|
|
6354
|
-
*/
|
|
6355
|
-
ensureIPCleared?: boolean;
|
|
6356
|
-
/**
|
|
6357
|
-
* Body param: List of images used to condition the generation.
|
|
6358
|
-
*
|
|
6359
|
-
* Images are set a data URLs (example:
|
|
6360
|
-
* \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=\")
|
|
6361
|
-
* or the asset IDs (example: \"asset_GTrL3mq4SXWyMxkOHRxlpw\").
|
|
6362
|
-
*
|
|
6363
|
-
* Notes:
|
|
6364
|
-
*
|
|
6365
|
-
* - in `contextual` mode, images condition prompt generation by using their actual
|
|
6366
|
-
* descriptions as context
|
|
6367
|
-
* - in all other modes, it supersedes the `modelId` parameter when provided.
|
|
6368
|
-
*/
|
|
6369
|
-
images?: Array<string>;
|
|
6370
|
-
/**
|
|
6371
|
-
* Body param: The modelId used to condition the generation.
|
|
6372
|
-
*
|
|
6373
|
-
* When provided, the generation will take into account model's training images,
|
|
6374
|
-
* examples.
|
|
6375
|
-
*
|
|
6376
|
-
* In `contextual` mode, the modelId is used to retrieve additional context from
|
|
6377
|
-
* the model such as its type and capabilities.
|
|
6378
|
-
*/
|
|
6379
|
-
modelId?: string;
|
|
6380
|
-
/**
|
|
6381
|
-
* Body param: If specified, the API will make a best effort to produce the same
|
|
6382
|
-
* results, such that repeated requests with the same `seed` and parameters should
|
|
6383
|
-
* return the same outputs. Must be used along with the same parameters including
|
|
6384
|
-
* prompt, model's state, etc..
|
|
6385
|
-
*/
|
|
6386
|
-
seed?: number;
|
|
6387
|
-
/**
|
|
6388
|
-
* Body param: The sampling temperature to use. Higher values like `0.8` will make
|
|
6389
|
-
* the output more random, while lower values like `0.2` will make it more focused
|
|
6390
|
-
* and deterministic.
|
|
6391
|
-
*
|
|
6392
|
-
* We generally recommend altering this or `topP` but not both.
|
|
6393
|
-
*/
|
|
6394
|
-
temperature?: number;
|
|
6395
|
-
/**
|
|
6396
|
-
* Body param: An alternative to sampling with temperature, called nucleus
|
|
6397
|
-
* sampling, where the model considers the results of the tokens with top_p
|
|
6398
|
-
* probability mass. So `0.1` means only the tokens comprising the top `10%`
|
|
6399
|
-
* probability mass are considered.
|
|
6400
|
-
*
|
|
6401
|
-
* We generally recommend altering this or `temperature` but not both.
|
|
6402
|
-
*/
|
|
6403
|
-
topP?: number;
|
|
6404
|
-
/**
|
|
6405
|
-
* Body param: Optional list of words sequences that should not be present in the
|
|
6406
|
-
* generated prompts.
|
|
6407
|
-
*/
|
|
6408
|
-
unwantedSequences?: Array<string>;
|
|
6409
|
-
}
|
|
6410
|
-
export interface GenerateDetectParams {
|
|
6411
|
-
/**
|
|
6412
|
-
* Body param: The image to be used to detect. Must reference an existing AssetId
|
|
6413
|
-
* or be a data URL.
|
|
6414
|
-
*/
|
|
6415
|
-
image: string;
|
|
6416
|
-
/**
|
|
6417
|
-
* Body param: Modality to detect
|
|
6418
|
-
*/
|
|
6419
|
-
modality: 'canny' | 'depth' | 'grayscale' | 'lineart_anime' | 'mlsd' | 'normal' | 'pose' | 'scribble' | 'segmentation' | 'sketch';
|
|
6420
|
-
/**
|
|
6421
|
-
* Query param
|
|
6422
|
-
*/
|
|
6423
|
-
dryRun?: unknown;
|
|
6424
|
-
/**
|
|
6425
|
-
* Query param: If set to true, returns the original asset without transformation
|
|
6426
|
-
*/
|
|
6427
|
-
originalAssets?: boolean;
|
|
6428
|
-
/**
|
|
6429
|
-
* Body param: Contrast factor for Grayscale detector
|
|
6430
|
-
*/
|
|
6431
|
-
factor?: number;
|
|
6432
|
-
/**
|
|
6433
|
-
* Body param: High threshold for Canny detector
|
|
6434
|
-
*/
|
|
6435
|
-
highThreshold?: number;
|
|
6436
|
-
/**
|
|
6437
|
-
* Body param: How polished is the surface? 0 is like a rough surface, 1 is like a
|
|
6438
|
-
* mirror
|
|
6439
|
-
*/
|
|
6440
|
-
keypointThreshold?: number;
|
|
6441
|
-
/**
|
|
6442
|
-
* Body param: Low threshold for Canny detector
|
|
6443
|
-
*/
|
|
6444
|
-
lowThreshold?: number;
|
|
6445
|
-
/**
|
|
6446
|
-
* Body param: Maximum threshold for Grayscale conversion
|
|
6447
|
-
*/
|
|
6448
|
-
maxThreshold?: number;
|
|
6449
|
-
/**
|
|
6450
|
-
* Body param: Minimum threshold for Grayscale conversion
|
|
6451
|
-
*/
|
|
6452
|
-
minThreshold?: number;
|
|
6272
|
+
export interface GenerateTranslateResponse {
|
|
6453
6273
|
/**
|
|
6454
|
-
*
|
|
6274
|
+
* Detected language of the input.
|
|
6455
6275
|
*/
|
|
6456
|
-
|
|
6457
|
-
|
|
6458
|
-
export interface GenerateEmbedParams {
|
|
6276
|
+
detectedLanguage: string;
|
|
6277
|
+
job: GenerateTranslateResponse.Job;
|
|
6459
6278
|
/**
|
|
6460
|
-
*
|
|
6279
|
+
* The translated prompt.
|
|
6461
6280
|
*/
|
|
6462
|
-
|
|
6281
|
+
translation: string;
|
|
6463
6282
|
/**
|
|
6464
|
-
*
|
|
6283
|
+
* The Creative Units cost for the request billed
|
|
6465
6284
|
*/
|
|
6466
|
-
|
|
6285
|
+
creativeUnitsCost?: number;
|
|
6467
6286
|
/**
|
|
6468
|
-
*
|
|
6287
|
+
* The Creative Units discount for the request billed
|
|
6469
6288
|
*/
|
|
6470
|
-
|
|
6289
|
+
creativeUnitsDiscount?: number;
|
|
6471
6290
|
}
|
|
6472
|
-
export
|
|
6473
|
-
|
|
6474
|
-
|
|
6475
|
-
|
|
6476
|
-
|
|
6477
|
-
|
|
6478
|
-
|
|
6479
|
-
|
|
6480
|
-
|
|
6481
|
-
|
|
6482
|
-
|
|
6483
|
-
|
|
6484
|
-
|
|
6485
|
-
|
|
6486
|
-
|
|
6487
|
-
|
|
6488
|
-
|
|
6489
|
-
|
|
6490
|
-
|
|
6491
|
-
|
|
6492
|
-
|
|
6493
|
-
|
|
6494
|
-
|
|
6495
|
-
|
|
6496
|
-
|
|
6497
|
-
|
|
6498
|
-
|
|
6499
|
-
|
|
6291
|
+
export declare namespace GenerateTranslateResponse {
|
|
6292
|
+
interface Job {
|
|
6293
|
+
/**
|
|
6294
|
+
* The job creation date as an ISO string (example: "2023-02-03T11:19:41.579Z")
|
|
6295
|
+
*/
|
|
6296
|
+
createdAt: string;
|
|
6297
|
+
/**
|
|
6298
|
+
* The job ID (example: "job_ocZCnG1Df35XRL1QyCZSRxAG8")
|
|
6299
|
+
*/
|
|
6300
|
+
jobId: string;
|
|
6301
|
+
/**
|
|
6302
|
+
* The type of job
|
|
6303
|
+
*/
|
|
6304
|
+
jobType: 'assets-download' | 'canvas-export' | 'caption' | 'caption-llava' | 'custom' | 'describe-style' | 'detection' | 'embed' | 'flux' | 'flux-model-training' | 'generate-prompt' | 'image-generation' | 'image-prompt-editing' | 'inference' | 'mesh-preview-rendering' | 'model-download' | 'model-import' | 'model-training' | 'musubi-model-training' | 'openai-image-generation' | 'patch-image' | 'pixelate' | 'reframe' | 'remove-background' | 'repaint' | 'restyle' | 'segment' | 'skybox-3d' | 'skybox-base-360' | 'skybox-hdri' | 'skybox-upscale-360' | 'texture' | 'translate' | 'upload' | 'upscale' | 'upscale-skybox' | 'upscale-texture' | 'vectorize' | 'workflow';
|
|
6305
|
+
/**
|
|
6306
|
+
* Metadata of the job with some additional information
|
|
6307
|
+
*/
|
|
6308
|
+
metadata: Job.Metadata;
|
|
6309
|
+
/**
|
|
6310
|
+
* Progress of the job (between 0 and 1)
|
|
6311
|
+
*/
|
|
6312
|
+
progress: number;
|
|
6313
|
+
/**
|
|
6314
|
+
* The current status of the job
|
|
6315
|
+
*/
|
|
6316
|
+
status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up';
|
|
6317
|
+
/**
|
|
6318
|
+
* The history of the different statuses the job went through with the ISO string
|
|
6319
|
+
* date of when the job reached each statuses.
|
|
6320
|
+
*/
|
|
6321
|
+
statusHistory: Array<Job.StatusHistory>;
|
|
6322
|
+
/**
|
|
6323
|
+
* The job last update date as an ISO string (example: "2023-02-03T11:19:41.579Z")
|
|
6324
|
+
*/
|
|
6325
|
+
updatedAt: string;
|
|
6326
|
+
/**
|
|
6327
|
+
* The author user ID (example: "dcf121faaa1a0a0bbbd9ca1b73d62aea")
|
|
6328
|
+
*/
|
|
6329
|
+
authorId?: string;
|
|
6330
|
+
/**
|
|
6331
|
+
* The billing of the job
|
|
6332
|
+
*/
|
|
6333
|
+
billing?: Job.Billing;
|
|
6334
|
+
/**
|
|
6335
|
+
* The owner ID (example: "team_U3Qmc8PCdWXwAQJ4Dvw4tV6D")
|
|
6336
|
+
*/
|
|
6337
|
+
ownerId?: string;
|
|
6338
|
+
}
|
|
6339
|
+
namespace Job {
|
|
6340
|
+
/**
|
|
6341
|
+
* Metadata of the job with some additional information
|
|
6342
|
+
*/
|
|
6343
|
+
interface Metadata {
|
|
6344
|
+
/**
|
|
6345
|
+
* List of produced assets for this job
|
|
6346
|
+
*/
|
|
6347
|
+
assetIds?: Array<string>;
|
|
6348
|
+
/**
|
|
6349
|
+
* Eventual error for the job
|
|
6350
|
+
*/
|
|
6351
|
+
error?: string | null;
|
|
6352
|
+
/**
|
|
6353
|
+
* The flow of the job. Only available for workflow jobs.
|
|
6354
|
+
*/
|
|
6355
|
+
flow?: Array<Metadata.Flow>;
|
|
6356
|
+
/**
|
|
6357
|
+
* Actionable hint for the user explaining what went wrong and how to resolve it.
|
|
6358
|
+
*/
|
|
6359
|
+
hint?: string;
|
|
6360
|
+
/**
|
|
6361
|
+
* The inputs for the job
|
|
6362
|
+
*/
|
|
6363
|
+
input?: {
|
|
6364
|
+
[key: string]: unknown;
|
|
6365
|
+
};
|
|
6366
|
+
/**
|
|
6367
|
+
* May contain the output of the job for specific custom models jobs. Only
|
|
6368
|
+
* available for custom models which generate non-assets outputs. Example: LLM text
|
|
6369
|
+
* results.
|
|
6370
|
+
*/
|
|
6371
|
+
output?: {
|
|
6372
|
+
[key: string]: unknown;
|
|
6373
|
+
};
|
|
6374
|
+
/**
|
|
6375
|
+
* For voice-clone jobs: the ID of the model being trained.
|
|
6376
|
+
*/
|
|
6377
|
+
outputModelId?: string;
|
|
6378
|
+
/**
|
|
6379
|
+
* The workflow ID of the job if job is part of a workflow.
|
|
6380
|
+
*/
|
|
6381
|
+
workflowId?: string;
|
|
6382
|
+
/**
|
|
6383
|
+
* The workflow job ID of the job if job is part of a workflow job.
|
|
6384
|
+
*/
|
|
6385
|
+
workflowJobId?: string;
|
|
6386
|
+
}
|
|
6387
|
+
namespace Metadata {
|
|
6388
|
+
interface Flow {
|
|
6389
|
+
/**
|
|
6390
|
+
* The id of the node.
|
|
6391
|
+
*/
|
|
6392
|
+
id: string;
|
|
6393
|
+
/**
|
|
6394
|
+
* The status of the node. Only available for WorkflowJob nodes.
|
|
6395
|
+
*/
|
|
6396
|
+
status: 'failure' | 'pending' | 'processing' | 'skipped' | 'success';
|
|
6397
|
+
/**
|
|
6398
|
+
* The type of the job for the node.
|
|
6399
|
+
*/
|
|
6400
|
+
type: 'custom-model' | 'for-each' | 'generate-prompt' | 'list' | 'logic' | 'model' | 'remove-background' | 'transform' | 'user-approval' | 'workflow';
|
|
6401
|
+
/**
|
|
6402
|
+
* List of produced assets for this node.
|
|
6403
|
+
*/
|
|
6404
|
+
assets?: Array<Flow.Asset>;
|
|
6405
|
+
/**
|
|
6406
|
+
* Fixed number of iterations for a ForEach node. When set, the loop runs exactly
|
|
6407
|
+
* `count` times regardless of array input. When not set, the loop iterates over
|
|
6408
|
+
* the resolved array input. Only available for ForEach nodes.
|
|
6409
|
+
*/
|
|
6410
|
+
count?: number;
|
|
6411
|
+
/**
|
|
6412
|
+
* The nodes that this node depends on. Only available for nodes that have
|
|
6413
|
+
* dependencies. Mainly used for user approval nodes.
|
|
6414
|
+
*/
|
|
6415
|
+
dependsOn?: Array<string>;
|
|
6416
|
+
/**
|
|
6417
|
+
* If true, the outputs of this node will be included in the workflow job's final
|
|
6418
|
+
* output. Only applicable to producing nodes (custom-model, inference, etc.). By
|
|
6419
|
+
* default, only last nodes (nodes not referenced by other nodes) contribute to
|
|
6420
|
+
* outputs. Set this to true to also include intermediate nodes in the final
|
|
6421
|
+
* output. Note: This should only be set to `true` or left undefined.
|
|
6422
|
+
*/
|
|
6423
|
+
includeOutputsInWorkflowJob?: true;
|
|
6424
|
+
/**
|
|
6425
|
+
* The inputs of the node.
|
|
6426
|
+
*/
|
|
6427
|
+
inputs?: Array<Flow.Input>;
|
|
6428
|
+
/**
|
|
6429
|
+
* Statically-configured items for a List node. The node outputs this array as-is
|
|
6430
|
+
* when executed. Only available for List nodes. The values can be strings,
|
|
6431
|
+
* numbers, or asset IDs.
|
|
6432
|
+
*/
|
|
6433
|
+
items?: Array<string>;
|
|
6434
|
+
/**
|
|
6435
|
+
* Zero-based index of the iteration this node copy belongs to. Set on
|
|
6436
|
+
* dynamically-created copies of loop body nodes.
|
|
6437
|
+
*/
|
|
6438
|
+
iterationIndex?: number;
|
|
6439
|
+
/**
|
|
6440
|
+
* If the flow is part of a WorkflowJob, this is the jobId for the node. jobId is
|
|
6441
|
+
* only available for nodes started. A node "Pending" for a running workflow job is
|
|
6442
|
+
* not started.
|
|
6443
|
+
*/
|
|
6444
|
+
jobId?: string;
|
|
6445
|
+
/**
|
|
6446
|
+
* The logic of the node. Only available for logic nodes.
|
|
6447
|
+
*/
|
|
6448
|
+
logic?: Flow.Logic;
|
|
6449
|
+
/**
|
|
6450
|
+
* The type of the logic for the node. Only available for logic nodes.
|
|
6451
|
+
*/
|
|
6452
|
+
logicType?: 'if-else';
|
|
6453
|
+
/**
|
|
6454
|
+
* IDs of the body template nodes that belong to this ForEach loop. At runtime
|
|
6455
|
+
* these templates are cloned once per iteration and marked Skipped. Only available
|
|
6456
|
+
* for ForEach nodes.
|
|
6457
|
+
*/
|
|
6458
|
+
loopBodyNodeIds?: Array<string>;
|
|
6459
|
+
/**
|
|
6460
|
+
* ID of the ForEach node that spawned this iteration copy. Set on
|
|
6461
|
+
* dynamically-created copies of loop body nodes.
|
|
6462
|
+
*/
|
|
6463
|
+
loopNodeId?: string;
|
|
6464
|
+
/**
|
|
6465
|
+
* The model id for the node. Mainly used for custom model tasks.
|
|
6466
|
+
*/
|
|
6467
|
+
modelId?: string;
|
|
6468
|
+
/**
|
|
6469
|
+
* The output of the node. Only available for logic nodes.
|
|
6470
|
+
*/
|
|
6471
|
+
output?: unknown;
|
|
6472
|
+
/**
|
|
6473
|
+
* The workflow id for the node. Mainly used for workflow tasks.
|
|
6474
|
+
*/
|
|
6475
|
+
workflowId?: string;
|
|
6476
|
+
}
|
|
6477
|
+
namespace Flow {
|
|
6478
|
+
interface Asset {
|
|
6479
|
+
assetId: string;
|
|
6480
|
+
url: string;
|
|
6481
|
+
}
|
|
6482
|
+
/**
|
|
6483
|
+
* This is used to run the flow.
|
|
6484
|
+
*/
|
|
6485
|
+
interface Input {
|
|
6486
|
+
/**
|
|
6487
|
+
* The name that must be user to call the model through the API
|
|
6488
|
+
*/
|
|
6489
|
+
name: string;
|
|
6490
|
+
/**
|
|
6491
|
+
* The data type of the input
|
|
6492
|
+
*/
|
|
6493
|
+
type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array';
|
|
6494
|
+
/**
|
|
6495
|
+
* The allowed values for the input. For \`string\` or \`number\` types, creates a
|
|
6496
|
+
* single-select dropdown. For \`string_array\` type, creates a multi-select
|
|
6497
|
+
* dropdown.
|
|
6498
|
+
*/
|
|
6499
|
+
allowedValues?: Array<unknown>;
|
|
6500
|
+
/**
|
|
6501
|
+
* Specifies the background behavior for the input. Only available for \`file\` and
|
|
6502
|
+
* \`file_array\` input types with kind \`image\`.
|
|
6503
|
+
*/
|
|
6504
|
+
backgroundBehavior?: 'opaque' | 'transparent';
|
|
6505
|
+
/**
|
|
6506
|
+
* Whether the input is a color or not. Only available for \`string\` input type.
|
|
6507
|
+
*/
|
|
6508
|
+
color?: boolean;
|
|
6509
|
+
/**
|
|
6510
|
+
* Whether this input affects the model's cost calculation
|
|
6511
|
+
*/
|
|
6512
|
+
costImpact?: boolean;
|
|
6513
|
+
/**
|
|
6514
|
+
* The default value for the input
|
|
6515
|
+
*/
|
|
6516
|
+
default?: unknown;
|
|
6517
|
+
/**
|
|
6518
|
+
* Help text displayed in the UI to provide additional information about the input
|
|
6519
|
+
*/
|
|
6520
|
+
description?: string;
|
|
6521
|
+
/**
|
|
6522
|
+
* Used to visually group inputs together in the UI. Inputs with the same group
|
|
6523
|
+
* value appear consecutively in the UI.
|
|
6524
|
+
*/
|
|
6525
|
+
group?: string;
|
|
6526
|
+
/**
|
|
6527
|
+
* Hint text displayed in the UI as a tooltip to guide the user
|
|
6528
|
+
*/
|
|
6529
|
+
hint?: string;
|
|
6530
|
+
/**
|
|
6531
|
+
* The list of inputs which form an object within a container array. All inputs are
|
|
6532
|
+
* the same as the current object. This is only available for type inputs_array
|
|
6533
|
+
* inputs.
|
|
6534
|
+
*/
|
|
6535
|
+
inputs?: Array<{
|
|
6536
|
+
[key: string]: unknown;
|
|
6537
|
+
}>;
|
|
6538
|
+
/**
|
|
6539
|
+
* The configured items for inputs_array type inputs. Each item is an array of
|
|
6540
|
+
* SubNodeInput that need ref/value resolution. Only available for inputs_array
|
|
6541
|
+
* type.
|
|
6542
|
+
*/
|
|
6543
|
+
items?: Array<Array<Input.Item>>;
|
|
6544
|
+
/**
|
|
6545
|
+
* The asset kind of the input. Only taken into account for \`file\` and
|
|
6546
|
+
* \`file_array\` input types. If model provides multiple kinds, the input will be
|
|
6547
|
+
* not able to create the asset on the flight on API side with dataurl without
|
|
6548
|
+
* data:kind, prefix
|
|
6549
|
+
*/
|
|
6550
|
+
kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
|
|
6551
|
+
/**
|
|
6552
|
+
* The label displayed in the UI for this input
|
|
6553
|
+
*/
|
|
6554
|
+
label?: string;
|
|
6555
|
+
/**
|
|
6556
|
+
* The name of the file input field to use as the mask source
|
|
6557
|
+
*/
|
|
6558
|
+
maskFrom?: string;
|
|
6559
|
+
/**
|
|
6560
|
+
* The maximum allowed value. Only available for \`number\` and \`array\` input
|
|
6561
|
+
* types.
|
|
6562
|
+
*/
|
|
6563
|
+
max?: number;
|
|
6564
|
+
/**
|
|
6565
|
+
* The maximum allowed length for \`string\` inputs. Also applies to each item in
|
|
6566
|
+
* \`string_array\`.
|
|
6567
|
+
*/
|
|
6568
|
+
maxLength?: number;
|
|
6569
|
+
/**
|
|
6570
|
+
* The maximum allowed file size in bytes. Only applies to \`file\` and
|
|
6571
|
+
* \`file_array\` input types. Validated against \`asset.properties.size\` at job
|
|
6572
|
+
* creation time.
|
|
6573
|
+
*/
|
|
6574
|
+
maxSize?: number;
|
|
6575
|
+
/**
|
|
6576
|
+
* The minimum allowed value. Only available for \`number\` and array input types.
|
|
6577
|
+
*/
|
|
6578
|
+
min?: number;
|
|
6579
|
+
/**
|
|
6580
|
+
* The minimum allowed length for string inputs. Also applies to each item in
|
|
6581
|
+
* \`string_array\`.
|
|
6582
|
+
*/
|
|
6583
|
+
minLength?: number;
|
|
6584
|
+
/**
|
|
6585
|
+
* The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only
|
|
6586
|
+
* available for \`model_array\` input type.
|
|
6587
|
+
*/
|
|
6588
|
+
modelTypes?: Array<'custom' | 'elevenlabs-voice' | 'flux.1' | 'flux.1-composition' | 'flux.1-kontext-dev' | 'flux.1-kontext-lora' | 'flux.1-krea-dev' | 'flux.1-krea-lora' | 'flux.1-lora' | 'flux.1-pro' | 'flux.1.1-pro-ultra' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'sd-1_5' | 'sd-1_5-composition' | 'sd-1_5-lora' | 'sd-xl' | 'sd-xl-composition' | 'sd-xl-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'>;
|
|
6589
|
+
/**
|
|
6590
|
+
* Whether this input represents a parent asset to assign to the produced assets.
|
|
6591
|
+
* Only available for \`file\` and \`file_array\` input types.
|
|
6592
|
+
*
|
|
6593
|
+
* For \`file_array\`, the parent asset is the first item in the array.
|
|
6594
|
+
*/
|
|
6595
|
+
parent?: boolean;
|
|
6596
|
+
/**
|
|
6597
|
+
* Placeholder text for the input. Only available for 'string' input type.
|
|
6598
|
+
*/
|
|
6599
|
+
placeholder?: string;
|
|
6600
|
+
/**
|
|
6601
|
+
* Whether the input is a prompt. When true, displays as a text area with prompt
|
|
6602
|
+
* spark feature. Only available for \`string\` input type.
|
|
6603
|
+
*/
|
|
6604
|
+
prompt?: boolean;
|
|
6605
|
+
/**
|
|
6606
|
+
* Whether the input is used with prompt spark. Only available for \`string\` input
|
|
6607
|
+
* type.
|
|
6608
|
+
*/
|
|
6609
|
+
promptSpark?: boolean;
|
|
6610
|
+
/**
|
|
6611
|
+
* The reference to another input or output of the same workflow. Must have at
|
|
6612
|
+
* least one of node or conditional.
|
|
6613
|
+
*/
|
|
6614
|
+
ref?: Input.Ref;
|
|
6615
|
+
/**
|
|
6616
|
+
* Set of rules that describes when this input is required:
|
|
6617
|
+
*
|
|
6618
|
+
* - \`always\`: Input is always required
|
|
6619
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
6620
|
+
* defined
|
|
6621
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
6622
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
6623
|
+
* value
|
|
6624
|
+
*
|
|
6625
|
+
* By default, the input is not required.
|
|
6626
|
+
*/
|
|
6627
|
+
required?: Input.Required;
|
|
6628
|
+
/**
|
|
6629
|
+
* The step increment for numeric inputs. Only available for \`number\` input type.
|
|
6630
|
+
*/
|
|
6631
|
+
step?: number;
|
|
6632
|
+
/**
|
|
6633
|
+
* The value of the input. This is the value of the input that will be used to run
|
|
6634
|
+
* the node. Only available for flows managed by a WorkflowJob.
|
|
6635
|
+
*/
|
|
6636
|
+
value?: unknown;
|
|
6637
|
+
}
|
|
6638
|
+
namespace Input {
|
|
6639
|
+
/**
|
|
6640
|
+
* A sub-input within an inputs_array item. Same as NodeInput but without the
|
|
6641
|
+
* recursive items field.
|
|
6642
|
+
*/
|
|
6643
|
+
interface Item {
|
|
6644
|
+
/**
|
|
6645
|
+
* The name that must be user to call the model through the API
|
|
6646
|
+
*/
|
|
6647
|
+
name: string;
|
|
6648
|
+
/**
|
|
6649
|
+
* The data type of the input
|
|
6650
|
+
*/
|
|
6651
|
+
type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array';
|
|
6652
|
+
/**
|
|
6653
|
+
* The allowed values for the input. For \`string\` or \`number\` types, creates a
|
|
6654
|
+
* single-select dropdown. For \`string_array\` type, creates a multi-select
|
|
6655
|
+
* dropdown.
|
|
6656
|
+
*/
|
|
6657
|
+
allowedValues?: Array<unknown>;
|
|
6658
|
+
/**
|
|
6659
|
+
* Specifies the background behavior for the input. Only available for \`file\` and
|
|
6660
|
+
* \`file_array\` input types with kind \`image\`.
|
|
6661
|
+
*/
|
|
6662
|
+
backgroundBehavior?: 'opaque' | 'transparent';
|
|
6663
|
+
/**
|
|
6664
|
+
* Whether the input is a color or not. Only available for \`string\` input type.
|
|
6665
|
+
*/
|
|
6666
|
+
color?: boolean;
|
|
6667
|
+
/**
|
|
6668
|
+
* Whether this input affects the model's cost calculation
|
|
6669
|
+
*/
|
|
6670
|
+
costImpact?: boolean;
|
|
6671
|
+
/**
|
|
6672
|
+
* The default value for the input
|
|
6673
|
+
*/
|
|
6674
|
+
default?: unknown;
|
|
6675
|
+
/**
|
|
6676
|
+
* Help text displayed in the UI to provide additional information about the input
|
|
6677
|
+
*/
|
|
6678
|
+
description?: string;
|
|
6679
|
+
/**
|
|
6680
|
+
* Used to visually group inputs together in the UI. Inputs with the same group
|
|
6681
|
+
* value appear consecutively in the UI.
|
|
6682
|
+
*/
|
|
6683
|
+
group?: string;
|
|
6684
|
+
/**
|
|
6685
|
+
* Hint text displayed in the UI as a tooltip to guide the user
|
|
6686
|
+
*/
|
|
6687
|
+
hint?: string;
|
|
6688
|
+
/**
|
|
6689
|
+
* The list of inputs which form an object within a container array. All inputs are
|
|
6690
|
+
* the same as the current object. This is only available for type inputs_array
|
|
6691
|
+
* inputs.
|
|
6692
|
+
*/
|
|
6693
|
+
inputs?: Array<{
|
|
6694
|
+
[key: string]: unknown;
|
|
6695
|
+
}>;
|
|
6696
|
+
/**
|
|
6697
|
+
* The asset kind of the input. Only taken into account for \`file\` and
|
|
6698
|
+
* \`file_array\` input types. If model provides multiple kinds, the input will be
|
|
6699
|
+
* not able to create the asset on the flight on API side with dataurl without
|
|
6700
|
+
* data:kind, prefix
|
|
6701
|
+
*/
|
|
6702
|
+
kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
|
|
6703
|
+
/**
|
|
6704
|
+
* The label displayed in the UI for this input
|
|
6705
|
+
*/
|
|
6706
|
+
label?: string;
|
|
6707
|
+
/**
|
|
6708
|
+
* The name of the file input field to use as the mask source
|
|
6709
|
+
*/
|
|
6710
|
+
maskFrom?: string;
|
|
6711
|
+
/**
|
|
6712
|
+
* The maximum allowed value. Only available for \`number\` and \`array\` input
|
|
6713
|
+
* types.
|
|
6714
|
+
*/
|
|
6715
|
+
max?: number;
|
|
6716
|
+
/**
|
|
6717
|
+
* The maximum allowed length for \`string\` inputs. Also applies to each item in
|
|
6718
|
+
* \`string_array\`.
|
|
6719
|
+
*/
|
|
6720
|
+
maxLength?: number;
|
|
6721
|
+
/**
|
|
6722
|
+
* The maximum allowed file size in bytes. Only applies to \`file\` and
|
|
6723
|
+
* \`file_array\` input types. Validated against \`asset.properties.size\` at job
|
|
6724
|
+
* creation time.
|
|
6725
|
+
*/
|
|
6726
|
+
maxSize?: number;
|
|
6727
|
+
/**
|
|
6728
|
+
* The minimum allowed value. Only available for \`number\` and array input types.
|
|
6729
|
+
*/
|
|
6730
|
+
min?: number;
|
|
6731
|
+
/**
|
|
6732
|
+
* The minimum allowed length for string inputs. Also applies to each item in
|
|
6733
|
+
* \`string_array\`.
|
|
6734
|
+
*/
|
|
6735
|
+
minLength?: number;
|
|
6736
|
+
/**
|
|
6737
|
+
* The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only
|
|
6738
|
+
* available for \`model_array\` input type.
|
|
6739
|
+
*/
|
|
6740
|
+
modelTypes?: Array<'custom' | 'elevenlabs-voice' | 'flux.1' | 'flux.1-composition' | 'flux.1-kontext-dev' | 'flux.1-kontext-lora' | 'flux.1-krea-dev' | 'flux.1-krea-lora' | 'flux.1-lora' | 'flux.1-pro' | 'flux.1.1-pro-ultra' | 'flux.2-dev-edit-lora' | 'flux.2-dev-lora' | 'flux.2-klein-4b-edit-lora' | 'flux.2-klein-4b-lora' | 'flux.2-klein-9b-edit-lora' | 'flux.2-klein-9b-lora' | 'flux.2-klein-base-4b-edit-lora' | 'flux.2-klein-base-4b-lora' | 'flux.2-klein-base-9b-edit-lora' | 'flux.2-klein-base-9b-lora' | 'flux1.1-pro' | 'gpt-image-1' | 'qwen-image-2512-lora' | 'qwen-image-edit-2509-lora' | 'qwen-image-edit-2511-lora' | 'qwen-image-edit-lora' | 'qwen-image-lora' | 'sd-1_5' | 'sd-1_5-composition' | 'sd-1_5-lora' | 'sd-xl' | 'sd-xl-composition' | 'sd-xl-lora' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'>;
|
|
6741
|
+
/**
|
|
6742
|
+
* Whether this input represents a parent asset to assign to the produced assets.
|
|
6743
|
+
* Only available for \`file\` and \`file_array\` input types.
|
|
6744
|
+
*
|
|
6745
|
+
* For \`file_array\`, the parent asset is the first item in the array.
|
|
6746
|
+
*/
|
|
6747
|
+
parent?: boolean;
|
|
6748
|
+
/**
|
|
6749
|
+
* Placeholder text for the input. Only available for 'string' input type.
|
|
6750
|
+
*/
|
|
6751
|
+
placeholder?: string;
|
|
6752
|
+
/**
|
|
6753
|
+
* Whether the input is a prompt. When true, displays as a text area with prompt
|
|
6754
|
+
* spark feature. Only available for \`string\` input type.
|
|
6755
|
+
*/
|
|
6756
|
+
prompt?: boolean;
|
|
6757
|
+
/**
|
|
6758
|
+
* Whether the input is used with prompt spark. Only available for \`string\` input
|
|
6759
|
+
* type.
|
|
6760
|
+
*/
|
|
6761
|
+
promptSpark?: boolean;
|
|
6762
|
+
/**
|
|
6763
|
+
* The reference to another input or output of the same workflow. Must have at
|
|
6764
|
+
* least one of node or conditional.
|
|
6765
|
+
*/
|
|
6766
|
+
ref?: Item.Ref;
|
|
6767
|
+
/**
|
|
6768
|
+
* Set of rules that describes when this input is required:
|
|
6769
|
+
*
|
|
6770
|
+
* - \`always\`: Input is always required
|
|
6771
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
6772
|
+
* defined
|
|
6773
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
6774
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
6775
|
+
* value
|
|
6776
|
+
*
|
|
6777
|
+
* By default, the input is not required.
|
|
6778
|
+
*/
|
|
6779
|
+
required?: Item.Required;
|
|
6780
|
+
/**
|
|
6781
|
+
* The step increment for numeric inputs. Only available for \`number\` input type.
|
|
6782
|
+
*/
|
|
6783
|
+
step?: number;
|
|
6784
|
+
/**
|
|
6785
|
+
* The value of the input. This is the value of the input that will be used to run
|
|
6786
|
+
* the node. Only available for flows managed by a WorkflowJob.
|
|
6787
|
+
*/
|
|
6788
|
+
value?: unknown;
|
|
6789
|
+
}
|
|
6790
|
+
namespace Item {
|
|
6791
|
+
/**
|
|
6792
|
+
* The reference to another input or output of the same workflow. Must have at
|
|
6793
|
+
* least one of node or conditional.
|
|
6794
|
+
*/
|
|
6795
|
+
interface Ref {
|
|
6796
|
+
/**
|
|
6797
|
+
* The conditional nodes to reference. If the conditional nodes are successful, the
|
|
6798
|
+
* node will be successful. If the conditional nodes are skipped, the node will be
|
|
6799
|
+
* skipped. Contains an array of node ids used to check the status of the nodes.
|
|
6800
|
+
*/
|
|
6801
|
+
conditional?: Array<string>;
|
|
6802
|
+
/**
|
|
6803
|
+
* This is the desired node output value if ref is an if/else node.
|
|
6804
|
+
*/
|
|
6805
|
+
equal?: string;
|
|
6806
|
+
/**
|
|
6807
|
+
* The name of the input or output to reference. If the type is 'workflow', the
|
|
6808
|
+
* name is the name of the input of the workflow is required If the type is 'node',
|
|
6809
|
+
* the name is not mandatory, except if you want all outputs of the node. To get
|
|
6810
|
+
* all outputs of a node, you can use the name 'all'.
|
|
6811
|
+
*/
|
|
6812
|
+
name?: string;
|
|
6813
|
+
/**
|
|
6814
|
+
* The node id or 'workflow' if the source is a workflow input.
|
|
6815
|
+
*/
|
|
6816
|
+
node?: string;
|
|
6817
|
+
}
|
|
6818
|
+
/**
|
|
6819
|
+
* Set of rules that describes when this input is required:
|
|
6820
|
+
*
|
|
6821
|
+
* - \`always\`: Input is always required
|
|
6822
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
6823
|
+
* defined
|
|
6824
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
6825
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
6826
|
+
* value
|
|
6827
|
+
*
|
|
6828
|
+
* By default, the input is not required.
|
|
6829
|
+
*/
|
|
6830
|
+
interface Required {
|
|
6831
|
+
/**
|
|
6832
|
+
* Whether the input is always required
|
|
6833
|
+
*/
|
|
6834
|
+
always?: boolean;
|
|
6835
|
+
/**
|
|
6836
|
+
* Makes this input required when another input has a specific value:
|
|
6837
|
+
*
|
|
6838
|
+
* - Key: name of the input to check
|
|
6839
|
+
* - Value: operation and allowed values that trigger the requirement
|
|
6840
|
+
*/
|
|
6841
|
+
conditionalValues?: unknown;
|
|
6842
|
+
/**
|
|
6843
|
+
* Makes this input required when another input is defined:
|
|
6844
|
+
*
|
|
6845
|
+
* - Key: name of the input that must be defined
|
|
6846
|
+
* - Value: message to display when this input is required
|
|
6847
|
+
*/
|
|
6848
|
+
ifDefined?: unknown;
|
|
6849
|
+
/**
|
|
6850
|
+
* Makes this input required when another input is not defined:
|
|
6851
|
+
*
|
|
6852
|
+
* - Key: name of the input that must be undefined
|
|
6853
|
+
* - Value: message to display when this input is required
|
|
6854
|
+
*/
|
|
6855
|
+
ifNotDefined?: unknown;
|
|
6856
|
+
}
|
|
6857
|
+
}
|
|
6858
|
+
/**
|
|
6859
|
+
* The reference to another input or output of the same workflow. Must have at
|
|
6860
|
+
* least one of node or conditional.
|
|
6861
|
+
*/
|
|
6862
|
+
interface Ref {
|
|
6863
|
+
/**
|
|
6864
|
+
* The conditional nodes to reference. If the conditional nodes are successful, the
|
|
6865
|
+
* node will be successful. If the conditional nodes are skipped, the node will be
|
|
6866
|
+
* skipped. Contains an array of node ids used to check the status of the nodes.
|
|
6867
|
+
*/
|
|
6868
|
+
conditional?: Array<string>;
|
|
6869
|
+
/**
|
|
6870
|
+
* This is the desired node output value if ref is an if/else node.
|
|
6871
|
+
*/
|
|
6872
|
+
equal?: string;
|
|
6873
|
+
/**
|
|
6874
|
+
* The name of the input or output to reference. If the type is 'workflow', the
|
|
6875
|
+
* name is the name of the input of the workflow is required If the type is 'node',
|
|
6876
|
+
* the name is not mandatory, except if you want all outputs of the node. To get
|
|
6877
|
+
* all outputs of a node, you can use the name 'all'.
|
|
6878
|
+
*/
|
|
6879
|
+
name?: string;
|
|
6880
|
+
/**
|
|
6881
|
+
* The node id or 'workflow' if the source is a workflow input.
|
|
6882
|
+
*/
|
|
6883
|
+
node?: string;
|
|
6884
|
+
}
|
|
6885
|
+
/**
|
|
6886
|
+
* Set of rules that describes when this input is required:
|
|
6887
|
+
*
|
|
6888
|
+
* - \`always\`: Input is always required
|
|
6889
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
6890
|
+
* defined
|
|
6891
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
6892
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
6893
|
+
* value
|
|
6894
|
+
*
|
|
6895
|
+
* By default, the input is not required.
|
|
6896
|
+
*/
|
|
6897
|
+
interface Required {
|
|
6898
|
+
/**
|
|
6899
|
+
* Whether the input is always required
|
|
6900
|
+
*/
|
|
6901
|
+
always?: boolean;
|
|
6902
|
+
/**
|
|
6903
|
+
* Makes this input required when another input has a specific value:
|
|
6904
|
+
*
|
|
6905
|
+
* - Key: name of the input to check
|
|
6906
|
+
* - Value: operation and allowed values that trigger the requirement
|
|
6907
|
+
*/
|
|
6908
|
+
conditionalValues?: unknown;
|
|
6909
|
+
/**
|
|
6910
|
+
* Makes this input required when another input is defined:
|
|
6911
|
+
*
|
|
6912
|
+
* - Key: name of the input that must be defined
|
|
6913
|
+
* - Value: message to display when this input is required
|
|
6914
|
+
*/
|
|
6915
|
+
ifDefined?: unknown;
|
|
6916
|
+
/**
|
|
6917
|
+
* Makes this input required when another input is not defined:
|
|
6918
|
+
*
|
|
6919
|
+
* - Key: name of the input that must be undefined
|
|
6920
|
+
* - Value: message to display when this input is required
|
|
6921
|
+
*/
|
|
6922
|
+
ifNotDefined?: unknown;
|
|
6923
|
+
}
|
|
6924
|
+
}
|
|
6925
|
+
/**
|
|
6926
|
+
* The logic of the node. Only available for logic nodes.
|
|
6927
|
+
*/
|
|
6928
|
+
interface Logic {
|
|
6929
|
+
/**
|
|
6930
|
+
* The cases of the logic. Only available for if/else nodes.
|
|
6931
|
+
*/
|
|
6932
|
+
cases?: Array<Logic.Case>;
|
|
6933
|
+
/**
|
|
6934
|
+
* The default case of the logic. Contains the id/output of the node to execute if
|
|
6935
|
+
* no case is matched. Only available for if/else nodes.
|
|
6936
|
+
*/
|
|
6937
|
+
default?: string;
|
|
6938
|
+
/**
|
|
6939
|
+
* The transform of the logic. Only available for transform nodes.
|
|
6940
|
+
*/
|
|
6941
|
+
transform?: string;
|
|
6942
|
+
}
|
|
6943
|
+
namespace Logic {
|
|
6944
|
+
interface Case {
|
|
6945
|
+
condition: string;
|
|
6946
|
+
value: string;
|
|
6947
|
+
}
|
|
6948
|
+
}
|
|
6949
|
+
}
|
|
6950
|
+
}
|
|
6951
|
+
interface StatusHistory {
|
|
6952
|
+
date: string;
|
|
6953
|
+
status: 'canceled' | 'failure' | 'finalizing' | 'in-progress' | 'pending' | 'queued' | 'success' | 'warming-up';
|
|
6954
|
+
}
|
|
6955
|
+
/**
|
|
6956
|
+
* The billing of the job
|
|
6957
|
+
*/
|
|
6958
|
+
interface Billing {
|
|
6959
|
+
cuCost: number;
|
|
6960
|
+
cuDiscount: number;
|
|
6961
|
+
}
|
|
6962
|
+
}
|
|
6963
|
+
}
|
|
6964
|
+
export interface GenerateCaptionParams {
|
|
6965
|
+
/**
|
|
6966
|
+
* Body param: List of images used to generate captions. Results are returned in
|
|
6967
|
+
* the same order as the given images.
|
|
6968
|
+
*
|
|
6969
|
+
* Images are set a data URLs (example:
|
|
6970
|
+
* \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=\")
|
|
6971
|
+
* or the asset IDs (example: \"asset_GTrL3mq4SXWyMxkOHRxlpw\").
|
|
6972
|
+
*
|
|
6973
|
+
* Notes:
|
|
6974
|
+
*
|
|
6975
|
+
* - if both `modelId` and `images` are provided, `modelId`'s examples and training
|
|
6976
|
+
* images will be used to influence the caption structure of the images
|
|
6977
|
+
* - if only `images` are provided, the captions will be conditioned by the
|
|
6978
|
+
* `detailsLevel` parameter
|
|
6979
|
+
* - Replaces `assetIds` parameter
|
|
6980
|
+
* - if you want to caption multiple images at a time, please prefer using asset
|
|
6981
|
+
* ids instead of data url
|
|
6982
|
+
*/
|
|
6983
|
+
images: Array<string>;
|
|
6984
|
+
/**
|
|
6985
|
+
* Query param
|
|
6986
|
+
*/
|
|
6987
|
+
dryRun?: unknown;
|
|
6988
|
+
/**
|
|
6989
|
+
* Body param: The assetIds to generate captions. Results are returned in the same
|
|
6990
|
+
* order as the given assetIds. Deprecated, use `images` parameter instead.
|
|
6991
|
+
*/
|
|
6992
|
+
assetIds?: Array<string>;
|
|
6993
|
+
/**
|
|
6994
|
+
* Body param: The details level used to generate the captions.
|
|
6995
|
+
*
|
|
6996
|
+
* When a modelId is provided and examples are available, the details level is
|
|
6997
|
+
* ignored.
|
|
6998
|
+
*/
|
|
6999
|
+
detailsLevel?: 'action' | 'action+style';
|
|
7000
|
+
/**
|
|
7001
|
+
* Body param: Whether we try to ensure IP removal for new prompt generation.
|
|
7002
|
+
*/
|
|
7003
|
+
ensureIPCleared?: boolean;
|
|
7004
|
+
/**
|
|
7005
|
+
* Body param: When provided, the model will follow the model's training images and
|
|
7006
|
+
* examples' prompt to generate the captions.
|
|
7007
|
+
*/
|
|
7008
|
+
modelId?: string;
|
|
7009
|
+
/**
|
|
7010
|
+
* Body param: If specified, the API will make a best effort to produce the same
|
|
7011
|
+
* results, such that repeated requests with the same `seed` and parameters should
|
|
7012
|
+
* return the same outputs. Must be used along with the same parameters including
|
|
7013
|
+
* prompt, model's state, etc..
|
|
7014
|
+
*/
|
|
7015
|
+
seed?: number;
|
|
7016
|
+
/**
|
|
7017
|
+
* Body param: The sampling temperature to use. Higher values like `0.8` will make
|
|
7018
|
+
* the output more random, while lower values like `0.2` will make it more focused
|
|
7019
|
+
* and deterministic.
|
|
7020
|
+
*
|
|
7021
|
+
* We generally recommend altering this or `topP` but not both.
|
|
7022
|
+
*/
|
|
7023
|
+
temperature?: number;
|
|
7024
|
+
/**
|
|
7025
|
+
* Body param: An alternative to sampling with temperature, called nucleus
|
|
7026
|
+
* sampling, where the model considers the results of the tokens with top_p
|
|
7027
|
+
* probability mass. So `0.1` means only the tokens comprising the top `10%`
|
|
7028
|
+
* probability mass are considered.
|
|
7029
|
+
*
|
|
7030
|
+
* We generally recommend altering this or `temperature` but not both.
|
|
7031
|
+
*/
|
|
7032
|
+
topP?: number;
|
|
7033
|
+
/**
|
|
7034
|
+
* Body param: Optional list of words sequences that should not be present in the
|
|
7035
|
+
* generated prompts.
|
|
7036
|
+
*/
|
|
7037
|
+
unwantedSequences?: Array<string>;
|
|
7038
|
+
}
|
|
7039
|
+
export interface GenerateDescribeStyleParams {
|
|
7040
|
+
/**
|
|
7041
|
+
* Query param
|
|
7042
|
+
*/
|
|
7043
|
+
dryRun?: unknown;
|
|
7044
|
+
/**
|
|
7045
|
+
* Body param: The asset ids used to condition the generation.
|
|
7046
|
+
*/
|
|
7047
|
+
assetIds?: Array<string>;
|
|
7048
|
+
/**
|
|
7049
|
+
* Body param: Whether we try to ensure IP removal for new prompt generation.
|
|
7050
|
+
*/
|
|
7051
|
+
ensureIPCleared?: boolean;
|
|
7052
|
+
/**
|
|
7053
|
+
* Body param: List of images used to condition the generation.
|
|
7054
|
+
*
|
|
7055
|
+
* Images are set a data URLs (example:
|
|
7056
|
+
* \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=\")
|
|
7057
|
+
* or the asset IDs (example: \"asset_GTrL3mq4SXWyMxkOHRxlpw\").
|
|
7058
|
+
*
|
|
7059
|
+
* Notes:
|
|
7060
|
+
*
|
|
7061
|
+
* - in `contextual` mode, images condition prompt generation by using their actual
|
|
7062
|
+
* descriptions as context
|
|
7063
|
+
* - in all other modes, it supersedes the `modelId` parameter when provided.
|
|
7064
|
+
*/
|
|
7065
|
+
images?: Array<string>;
|
|
7066
|
+
/**
|
|
7067
|
+
* Body param: The modelId used to condition the generation.
|
|
7068
|
+
*
|
|
7069
|
+
* When provided, the generation will take into account model's training images,
|
|
7070
|
+
* examples.
|
|
7071
|
+
*
|
|
7072
|
+
* In `contextual` mode, the modelId is used to retrieve additional context from
|
|
7073
|
+
* the model such as its type and capabilities.
|
|
7074
|
+
*/
|
|
7075
|
+
modelId?: string;
|
|
7076
|
+
/**
|
|
7077
|
+
* Body param: If specified, the API will make a best effort to produce the same
|
|
7078
|
+
* results, such that repeated requests with the same `seed` and parameters should
|
|
7079
|
+
* return the same outputs. Must be used along with the same parameters including
|
|
7080
|
+
* prompt, model's state, etc..
|
|
7081
|
+
*/
|
|
7082
|
+
seed?: number;
|
|
7083
|
+
/**
|
|
7084
|
+
* Body param: The sampling temperature to use. Higher values like `0.8` will make
|
|
7085
|
+
* the output more random, while lower values like `0.2` will make it more focused
|
|
7086
|
+
* and deterministic.
|
|
7087
|
+
*
|
|
7088
|
+
* We generally recommend altering this or `topP` but not both.
|
|
7089
|
+
*/
|
|
7090
|
+
temperature?: number;
|
|
7091
|
+
/**
|
|
7092
|
+
* Body param: An alternative to sampling with temperature, called nucleus
|
|
7093
|
+
* sampling, where the model considers the results of the tokens with top_p
|
|
7094
|
+
* probability mass. So `0.1` means only the tokens comprising the top `10%`
|
|
7095
|
+
* probability mass are considered.
|
|
7096
|
+
*
|
|
7097
|
+
* We generally recommend altering this or `temperature` but not both.
|
|
7098
|
+
*/
|
|
7099
|
+
topP?: number;
|
|
7100
|
+
/**
|
|
7101
|
+
* Body param: Optional list of words sequences that should not be present in the
|
|
7102
|
+
* generated prompts.
|
|
7103
|
+
*/
|
|
7104
|
+
unwantedSequences?: Array<string>;
|
|
7105
|
+
}
|
|
7106
|
+
export interface GenerateDetectParams {
|
|
7107
|
+
/**
|
|
7108
|
+
* Body param: The image to be used to detect. Must reference an existing AssetId
|
|
7109
|
+
* or be a data URL.
|
|
7110
|
+
*/
|
|
7111
|
+
image: string;
|
|
7112
|
+
/**
|
|
7113
|
+
* Body param: Modality to detect
|
|
7114
|
+
*/
|
|
7115
|
+
modality: 'canny' | 'depth' | 'grayscale' | 'lineart_anime' | 'mlsd' | 'normal' | 'pose' | 'scribble' | 'segmentation' | 'sketch';
|
|
7116
|
+
/**
|
|
7117
|
+
* Query param
|
|
7118
|
+
*/
|
|
7119
|
+
dryRun?: unknown;
|
|
7120
|
+
/**
|
|
7121
|
+
* Query param: If set to true, returns the original asset without transformation
|
|
7122
|
+
*/
|
|
7123
|
+
originalAssets?: boolean;
|
|
7124
|
+
/**
|
|
7125
|
+
* Body param: Contrast factor for Grayscale detector
|
|
7126
|
+
*/
|
|
7127
|
+
factor?: number;
|
|
7128
|
+
/**
|
|
7129
|
+
* Body param: High threshold for Canny detector
|
|
7130
|
+
*/
|
|
7131
|
+
highThreshold?: number;
|
|
7132
|
+
/**
|
|
7133
|
+
* Body param: How polished is the surface? 0 is like a rough surface, 1 is like a
|
|
7134
|
+
* mirror
|
|
7135
|
+
*/
|
|
7136
|
+
keypointThreshold?: number;
|
|
7137
|
+
/**
|
|
7138
|
+
* Body param: Low threshold for Canny detector
|
|
7139
|
+
*/
|
|
7140
|
+
lowThreshold?: number;
|
|
7141
|
+
/**
|
|
7142
|
+
* Body param: Maximum threshold for Grayscale conversion
|
|
7143
|
+
*/
|
|
7144
|
+
maxThreshold?: number;
|
|
7145
|
+
/**
|
|
7146
|
+
* Body param: Minimum threshold for Grayscale conversion
|
|
7147
|
+
*/
|
|
7148
|
+
minThreshold?: number;
|
|
7149
|
+
/**
|
|
7150
|
+
* Body param: Remove background for Grayscale detector
|
|
7151
|
+
*/
|
|
7152
|
+
removeBackground?: boolean;
|
|
7153
|
+
}
|
|
7154
|
+
export interface GenerateEmbedParams {
|
|
7155
|
+
/**
|
|
7156
|
+
* Body param: The text to embed. Must be a non-empty string.
|
|
7157
|
+
*/
|
|
7158
|
+
text: string;
|
|
7159
|
+
/**
|
|
7160
|
+
* Query param
|
|
7161
|
+
*/
|
|
7162
|
+
dryRun?: unknown;
|
|
7163
|
+
/**
|
|
7164
|
+
* Query param: If set to true, returns the original asset without transformation
|
|
7165
|
+
*/
|
|
7166
|
+
originalAssets?: boolean;
|
|
7167
|
+
}
|
|
7168
|
+
export interface GeneratePatchParams {
|
|
7169
|
+
/**
|
|
7170
|
+
* Body param: The input image as a data URL (example:
|
|
7171
|
+
* "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=")
|
|
7172
|
+
* or the asset ID (example: "asset_GTrL3mq4SXWyMxkOHRxlpw")
|
|
7173
|
+
*/
|
|
7174
|
+
image: string;
|
|
7175
|
+
/**
|
|
7176
|
+
* Query param
|
|
7177
|
+
*/
|
|
7178
|
+
dryRun?: unknown;
|
|
7179
|
+
/**
|
|
7180
|
+
* Query param: If set to true, returns the original asset without transformation
|
|
7181
|
+
*/
|
|
7182
|
+
originalAssets?: boolean;
|
|
7183
|
+
/**
|
|
7184
|
+
* Body param: Whether to allow the merged image to extend the size of the original
|
|
7185
|
+
* (when x or y are negative or merged image is bigger)
|
|
7186
|
+
*/
|
|
7187
|
+
allowOverflow?: boolean;
|
|
7188
|
+
/**
|
|
7189
|
+
* Body param: The background color as an hexadecimal code (ex: "#FFFFFF"), an html
|
|
7190
|
+
* color (ex: "red") or "transparent" if "format" is "png". Default to "white"
|
|
7191
|
+
*/
|
|
7192
|
+
backgroundColor?: string;
|
|
7193
|
+
/**
|
|
7194
|
+
* Body param: The crop operation to apply to the image. Applied before any
|
|
7195
|
+
* operation. For the backgroundColor: rgba, hex or named color are supported.
|
|
6500
7196
|
*/
|
|
6501
7197
|
crop?: GeneratePatchParams.Crop;
|
|
6502
7198
|
/**
|
|
@@ -6553,6 +7249,95 @@ export declare namespace GeneratePatchParams {
|
|
|
6553
7249
|
y: number;
|
|
6554
7250
|
}
|
|
6555
7251
|
}
|
|
7252
|
+
export interface GeneratePromptParams {
|
|
7253
|
+
/**
|
|
7254
|
+
* Body param: The mode used to generate new prompt(s).
|
|
7255
|
+
*/
|
|
7256
|
+
mode: 'completion' | 'contextual' | 'image-editing' | 'inventive' | 'structured';
|
|
7257
|
+
/**
|
|
7258
|
+
* Query param
|
|
7259
|
+
*/
|
|
7260
|
+
dryRun?: unknown;
|
|
7261
|
+
/**
|
|
7262
|
+
* Body param: The asset ids used to condition the generation.
|
|
7263
|
+
*
|
|
7264
|
+
* Notes:
|
|
7265
|
+
*
|
|
7266
|
+
* - supersedes the `modelId` parameter when provided.
|
|
7267
|
+
* - ignored when `mode` is `image-editing-prompt`.
|
|
7268
|
+
*/
|
|
7269
|
+
assetIds?: Array<string>;
|
|
7270
|
+
/**
|
|
7271
|
+
* Body param: Whether we try to ensure IP removal for new prompt generation.
|
|
7272
|
+
*/
|
|
7273
|
+
ensureIPCleared?: boolean;
|
|
7274
|
+
/**
|
|
7275
|
+
* Body param: The input image as a data URL (example:
|
|
7276
|
+
* "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=")
|
|
7277
|
+
* or the asset ID (example: "asset_GTrL3mq4SXWyMxkOHRxlpw")
|
|
7278
|
+
*
|
|
7279
|
+
* Required when `mode` is `image-editing-prompt`.
|
|
7280
|
+
*/
|
|
7281
|
+
image?: string;
|
|
7282
|
+
/**
|
|
7283
|
+
* Body param: List of images used to condition the generation.
|
|
7284
|
+
*
|
|
7285
|
+
* Images are set a data URLs (example:
|
|
7286
|
+
* \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=\")
|
|
7287
|
+
* or the asset IDs (example: \"asset_GTrL3mq4SXWyMxkOHRxlpw\").
|
|
7288
|
+
*
|
|
7289
|
+
* Notes:
|
|
7290
|
+
*
|
|
7291
|
+
* - in `contextual` mode, images condition prompt generation by using their actual
|
|
7292
|
+
* descriptions as context
|
|
7293
|
+
* - in all other modes, it supersedes the `modelId` parameter when provided.
|
|
7294
|
+
*/
|
|
7295
|
+
images?: Array<string>;
|
|
7296
|
+
/**
|
|
7297
|
+
* Body param: The modelId used to condition the generation.
|
|
7298
|
+
*
|
|
7299
|
+
* When provided, the generation will take into account model's training images,
|
|
7300
|
+
* examples.
|
|
7301
|
+
*
|
|
7302
|
+
* Only supports 'gemini-2.0-flash', 'gemini-2.5-flash', 'gpt-image-1',
|
|
7303
|
+
* 'flux-kontext' and 'runway-gen4-image' for now when `mode` is
|
|
7304
|
+
* `image-editing-prompt`.
|
|
7305
|
+
*/
|
|
7306
|
+
modelId?: string;
|
|
7307
|
+
/**
|
|
7308
|
+
* Body param: The number of results to return.
|
|
7309
|
+
*/
|
|
7310
|
+
numResults?: number;
|
|
7311
|
+
/**
|
|
7312
|
+
* Body param: The initial prompt spark feed to `completion`, `inventive` or
|
|
7313
|
+
* `structured` modes.
|
|
7314
|
+
*/
|
|
7315
|
+
prompt?: string;
|
|
7316
|
+
/**
|
|
7317
|
+
* Body param: If specified, the API will make a best effort to produce the same
|
|
7318
|
+
* results, such that repeated requests with the same `seed` and parameters should
|
|
7319
|
+
* return the same outputs. Must be used along with the same parameters including
|
|
7320
|
+
* prompt, model's state, etc..
|
|
7321
|
+
*/
|
|
7322
|
+
seed?: number;
|
|
7323
|
+
/**
|
|
7324
|
+
* Body param: The sampling temperature to use. Higher values like `0.8` will make
|
|
7325
|
+
* the output more random, while lower values like `0.2` will make it more focused
|
|
7326
|
+
* and deterministic.
|
|
7327
|
+
*
|
|
7328
|
+
* We generally recommend altering this or `topP` but not both.
|
|
7329
|
+
*/
|
|
7330
|
+
temperature?: number;
|
|
7331
|
+
/**
|
|
7332
|
+
* Body param: An alternative to sampling with temperature, called nucleus
|
|
7333
|
+
* sampling, where the model considers the results of the tokens with top_p
|
|
7334
|
+
* probability mass. So `0.1` means only the tokens comprising the top `10%`
|
|
7335
|
+
* probability mass are considered.
|
|
7336
|
+
*
|
|
7337
|
+
* We generally recommend altering this or `temperature` but not both.
|
|
7338
|
+
*/
|
|
7339
|
+
topP?: number;
|
|
7340
|
+
}
|
|
6556
7341
|
export interface GenerateRunModelParams {
|
|
6557
7342
|
/**
|
|
6558
7343
|
* Body param: The request body for the custom generation must be retrieve from GET
|
|
@@ -6617,6 +7402,6 @@ export interface GenerateTranslateParams {
|
|
|
6617
7402
|
topP?: number;
|
|
6618
7403
|
}
|
|
6619
7404
|
export declare namespace Generate {
|
|
6620
|
-
export { type GenerateCaptionResponse as GenerateCaptionResponse, type GenerateDescribeStyleResponse as GenerateDescribeStyleResponse, type GenerateDetectResponse as GenerateDetectResponse, type GenerateEmbedResponse as GenerateEmbedResponse, type GeneratePatchResponse as GeneratePatchResponse, type GenerateRunModelResponse as GenerateRunModelResponse, type GenerateTranslateResponse as GenerateTranslateResponse, type GenerateCaptionParams as GenerateCaptionParams, type GenerateDescribeStyleParams as GenerateDescribeStyleParams, type GenerateDetectParams as GenerateDetectParams, type GenerateEmbedParams as GenerateEmbedParams, type GeneratePatchParams as GeneratePatchParams, type GenerateRunModelParams as GenerateRunModelParams, type GenerateTranslateParams as GenerateTranslateParams, };
|
|
7405
|
+
export { type GenerateCaptionResponse as GenerateCaptionResponse, type GenerateDescribeStyleResponse as GenerateDescribeStyleResponse, type GenerateDetectResponse as GenerateDetectResponse, type GenerateEmbedResponse as GenerateEmbedResponse, type GeneratePatchResponse as GeneratePatchResponse, type GeneratePromptResponse as GeneratePromptResponse, type GenerateRunModelResponse as GenerateRunModelResponse, type GenerateTranslateResponse as GenerateTranslateResponse, type GenerateCaptionParams as GenerateCaptionParams, type GenerateDescribeStyleParams as GenerateDescribeStyleParams, type GenerateDetectParams as GenerateDetectParams, type GenerateEmbedParams as GenerateEmbedParams, type GeneratePatchParams as GeneratePatchParams, type GeneratePromptParams as GeneratePromptParams, type GenerateRunModelParams as GenerateRunModelParams, type GenerateTranslateParams as GenerateTranslateParams, };
|
|
6621
7406
|
}
|
|
6622
7407
|
//# sourceMappingURL=generate.d.ts.map
|