@scenario-labs/sdk 0.3.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 +30 -0
- package/README.md +40 -8
- package/client.d.mts +36 -16
- package/client.d.mts.map +1 -1
- package/client.d.ts +36 -16
- package/client.d.ts.map +1 -1
- package/client.js +10 -0
- package/client.js.map +1 -1
- package/client.mjs +10 -0
- package/client.mjs.map +1 -1
- package/core/pagination.d.mts +153 -0
- package/core/pagination.d.mts.map +1 -0
- package/core/pagination.d.ts +153 -0
- package/core/pagination.d.ts.map +1 -0
- package/core/pagination.js +276 -0
- package/core/pagination.js.map +1 -0
- package/core/pagination.mjs +263 -0
- package/core/pagination.mjs.map +1 -0
- package/index.d.mts +5 -1
- package/index.d.mts.map +1 -1
- package/index.d.ts +5 -1
- package/index.d.ts.map +1 -1
- package/index.js +14 -1
- package/index.js.map +1 -1
- package/index.mjs +5 -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/models.d.mts +34 -2
- package/lib/models.d.mts.map +1 -1
- package/lib/models.d.ts +34 -2
- package/lib/models.d.ts.map +1 -1
- package/lib/models.js +39 -2
- package/lib/models.js.map +1 -1
- package/lib/models.mjs +37 -1
- package/lib/models.mjs.map +1 -1
- package/lib/scenario.d.mts +14 -0
- package/lib/scenario.d.mts.map +1 -1
- package/lib/scenario.d.ts +14 -0
- package/lib/scenario.d.ts.map +1 -1
- package/lib/scenario.js +14 -0
- package/lib/scenario.js.map +1 -1
- package/lib/scenario.mjs +14 -0
- package/lib/scenario.mjs.map +1 -1
- package/lib/upload.d.mts +143 -0
- package/lib/upload.d.mts.map +1 -0
- package/lib/upload.d.ts +143 -0
- package/lib/upload.d.ts.map +1 -0
- package/lib/upload.js +242 -0
- package/lib/upload.js.map +1 -0
- package/lib/upload.mjs +203 -0
- package/lib/upload.mjs.map +1 -0
- package/lib/workflow.d.mts +13 -2
- package/lib/workflow.d.mts.map +1 -1
- package/lib/workflow.d.ts +13 -2
- package/lib/workflow.d.ts.map +1 -1
- package/lib/workflow.js +17 -4
- package/lib/workflow.js.map +1 -1
- package/lib/workflow.mjs +17 -4
- package/lib/workflow.mjs.map +1 -1
- package/lib/workflow_import_validator.d.mts +40 -0
- package/lib/workflow_import_validator.d.mts.map +1 -0
- package/lib/workflow_import_validator.d.ts +40 -0
- package/lib/workflow_import_validator.d.ts.map +1 -0
- package/lib/workflow_import_validator.js +69 -0
- package/lib/workflow_import_validator.js.map +1 -0
- package/lib/workflow_import_validator.mjs +64 -0
- package/lib/workflow_import_validator.mjs.map +1 -0
- package/package.json +11 -1
- package/pagination.d.mts +2 -0
- package/pagination.d.mts.map +1 -0
- package/pagination.d.ts +2 -0
- package/pagination.d.ts.map +1 -0
- package/pagination.js +6 -0
- package/pagination.js.map +1 -0
- package/pagination.mjs +2 -0
- package/pagination.mjs.map +1 -0
- package/resources/assets/assets.d.mts +646 -669
- package/resources/assets/assets.d.mts.map +1 -1
- package/resources/assets/assets.d.ts +646 -669
- package/resources/assets/assets.d.ts.map +1 -1
- package/resources/assets/assets.js +3 -2
- package/resources/assets/assets.js.map +1 -1
- package/resources/assets/assets.mjs +3 -2
- package/resources/assets/assets.mjs.map +1 -1
- package/resources/assets/index.d.mts +1 -1
- package/resources/assets/index.d.mts.map +1 -1
- package/resources/assets/index.d.ts +1 -1
- package/resources/assets/index.d.ts.map +1 -1
- package/resources/assets/index.js.map +1 -1
- package/resources/assets/index.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/collections/collections.d.mts +38 -49
- package/resources/collections/collections.d.mts.map +1 -1
- package/resources/collections/collections.d.ts +38 -49
- package/resources/collections/collections.d.ts.map +1 -1
- package/resources/collections/collections.js +5 -1
- package/resources/collections/collections.js.map +1 -1
- package/resources/collections/collections.mjs +5 -1
- package/resources/collections/collections.mjs.map +1 -1
- package/resources/collections/index.d.mts +1 -1
- package/resources/collections/index.d.mts.map +1 -1
- package/resources/collections/index.d.ts +1 -1
- package/resources/collections/index.d.ts.map +1 -1
- package/resources/collections/index.js.map +1 -1
- package/resources/collections/index.mjs.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 +8 -8
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +8 -8
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/jobs.d.mts +369 -380
- package/resources/jobs.d.mts.map +1 -1
- package/resources/jobs.d.ts +369 -380
- package/resources/jobs.d.ts.map +1 -1
- package/resources/jobs.js +2 -1
- package/resources/jobs.js.map +1 -1
- package/resources/jobs.mjs +2 -1
- package/resources/jobs.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/index.d.mts +1 -1
- package/resources/models/index.d.mts.map +1 -1
- package/resources/models/index.d.ts +1 -1
- package/resources/models/index.d.ts.map +1 -1
- package/resources/models/index.js.map +1 -1
- package/resources/models/index.mjs.map +1 -1
- package/resources/models/models.d.mts +845 -856
- package/resources/models/models.d.mts.map +1 -1
- package/resources/models/models.d.ts +845 -856
- package/resources/models/models.d.ts.map +1 -1
- package/resources/models/models.js +2 -1
- package/resources/models/models.js.map +1 -1
- package/resources/models/models.mjs +2 -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/search.d.mts +215 -295
- package/resources/search.d.mts.map +1 -1
- package/resources/search.d.ts +215 -295
- package/resources/search.d.ts.map +1 -1
- package/resources/search.js +9 -2
- package/resources/search.js.map +1 -1
- package/resources/search.mjs +9 -2
- package/resources/search.mjs.map +1 -1
- package/resources/tags.d.mts +23 -35
- package/resources/tags.d.mts.map +1 -1
- package/resources/tags.d.ts +23 -35
- package/resources/tags.d.ts.map +1 -1
- package/resources/tags.js +2 -1
- package/resources/tags.js.map +1 -1
- package/resources/tags.mjs +2 -1
- package/resources/tags.mjs.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/resources/workflows.d.mts +688 -704
- package/resources/workflows.d.mts.map +1 -1
- package/resources/workflows.d.ts +688 -704
- package/resources/workflows.d.ts.map +1 -1
- package/resources/workflows.js +5 -1
- package/resources/workflows.js.map +1 -1
- package/resources/workflows.mjs +5 -1
- package/resources/workflows.mjs.map +1 -1
- package/src/client.ts +107 -2
- package/src/core/pagination.ts +497 -0
- package/src/index.ts +11 -1
- package/src/lib/asset.ts +85 -0
- package/src/lib/job.ts +28 -1
- package/src/lib/models.ts +62 -2
- package/src/lib/scenario.ts +14 -0
- package/src/lib/upload.ts +344 -0
- package/src/lib/workflow.ts +29 -4
- package/src/lib/workflow_import_validator.ts +104 -0
- package/src/pagination.ts +2 -0
- package/src/resources/assets/assets.ts +930 -909
- package/src/resources/assets/index.ts +2 -0
- package/src/resources/assets/public.ts +17 -7
- package/src/resources/collections/collections.ts +45 -54
- package/src/resources/collections/index.ts +1 -0
- package/src/resources/generate.ts +1227 -136
- package/src/resources/index.ts +11 -1
- package/src/resources/jobs.ts +613 -622
- package/src/resources/models/description.ts +4 -0
- package/src/resources/models/examples.ts +8 -0
- package/src/resources/models/index.ts +1 -0
- package/src/resources/models/models.ts +1066 -1064
- package/src/resources/models/train.ts +4 -0
- package/src/resources/search.ts +239 -327
- package/src/resources/tags.ts +32 -39
- package/src/resources/usages.ts +5 -0
- package/src/resources/workflows.ts +850 -864
- 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
|
@@ -50,6 +50,14 @@ export class Generate extends APIResource {
|
|
|
50
50
|
return this._client.post('/generate/patch', { query: { dryRun, originalAssets }, body, ...options });
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
/**
|
|
54
|
+
* Generate, complete or invent new prompts.
|
|
55
|
+
*/
|
|
56
|
+
prompt(params: GeneratePromptParams, options?: RequestOptions): APIPromise<GeneratePromptResponse> {
|
|
57
|
+
const { dryRun, ...body } = params;
|
|
58
|
+
return this._client.post('/generate/prompt', { query: { dryRun }, body, ...options });
|
|
59
|
+
}
|
|
60
|
+
|
|
53
61
|
/**
|
|
54
62
|
* Generate with any model (Image, Video, Audio, 3d).
|
|
55
63
|
*
|
|
@@ -3076,6 +3084,7 @@ export namespace GenerateDetectResponse {
|
|
|
3076
3084
|
| '3d:texture:normal'
|
|
3077
3085
|
| '3d:texture:roughness'
|
|
3078
3086
|
| 'audio2audio'
|
|
3087
|
+
| 'audio2video'
|
|
3079
3088
|
| 'background-removal'
|
|
3080
3089
|
| 'canvas'
|
|
3081
3090
|
| 'canvas-drawing'
|
|
@@ -3137,6 +3146,7 @@ export namespace GenerateDetectResponse {
|
|
|
3137
3146
|
| 'upscale-video'
|
|
3138
3147
|
| 'vectorization'
|
|
3139
3148
|
| 'video23d'
|
|
3149
|
+
| 'video2audio'
|
|
3140
3150
|
| 'video2img'
|
|
3141
3151
|
| 'video2video'
|
|
3142
3152
|
| 'voice-clone';
|
|
@@ -3259,6 +3269,7 @@ export namespace GenerateDetectResponse {
|
|
|
3259
3269
|
| '3d23d'
|
|
3260
3270
|
| '3d23d-texture'
|
|
3261
3271
|
| 'audio2audio'
|
|
3272
|
+
| 'audio2video'
|
|
3262
3273
|
| 'background-removal'
|
|
3263
3274
|
| 'canvas'
|
|
3264
3275
|
| 'canvas-drawing'
|
|
@@ -3320,6 +3331,7 @@ export namespace GenerateDetectResponse {
|
|
|
3320
3331
|
| 'upscale-video'
|
|
3321
3332
|
| 'vectorization'
|
|
3322
3333
|
| 'video23d'
|
|
3334
|
+
| 'video2audio'
|
|
3323
3335
|
| 'video2img'
|
|
3324
3336
|
| 'video2video'
|
|
3325
3337
|
| 'voice-clone';
|
|
@@ -6115,6 +6127,7 @@ export namespace GeneratePatchResponse {
|
|
|
6115
6127
|
| '3d:texture:normal'
|
|
6116
6128
|
| '3d:texture:roughness'
|
|
6117
6129
|
| 'audio2audio'
|
|
6130
|
+
| 'audio2video'
|
|
6118
6131
|
| 'background-removal'
|
|
6119
6132
|
| 'canvas'
|
|
6120
6133
|
| 'canvas-drawing'
|
|
@@ -6176,6 +6189,7 @@ export namespace GeneratePatchResponse {
|
|
|
6176
6189
|
| 'upscale-video'
|
|
6177
6190
|
| 'vectorization'
|
|
6178
6191
|
| 'video23d'
|
|
6192
|
+
| 'video2audio'
|
|
6179
6193
|
| 'video2img'
|
|
6180
6194
|
| 'video2video'
|
|
6181
6195
|
| 'voice-clone';
|
|
@@ -6298,6 +6312,7 @@ export namespace GeneratePatchResponse {
|
|
|
6298
6312
|
| '3d23d'
|
|
6299
6313
|
| '3d23d-texture'
|
|
6300
6314
|
| 'audio2audio'
|
|
6315
|
+
| 'audio2video'
|
|
6301
6316
|
| 'background-removal'
|
|
6302
6317
|
| 'canvas'
|
|
6303
6318
|
| 'canvas-drawing'
|
|
@@ -6359,6 +6374,7 @@ export namespace GeneratePatchResponse {
|
|
|
6359
6374
|
| 'upscale-video'
|
|
6360
6375
|
| 'vectorization'
|
|
6361
6376
|
| 'video23d'
|
|
6377
|
+
| 'video2audio'
|
|
6362
6378
|
| 'video2img'
|
|
6363
6379
|
| 'video2video'
|
|
6364
6380
|
| 'voice-clone';
|
|
@@ -7140,8 +7156,13 @@ export namespace GeneratePatchResponse {
|
|
|
7140
7156
|
}
|
|
7141
7157
|
}
|
|
7142
7158
|
|
|
7143
|
-
export interface
|
|
7144
|
-
job:
|
|
7159
|
+
export interface GeneratePromptResponse {
|
|
7160
|
+
job: GeneratePromptResponse.Job;
|
|
7161
|
+
|
|
7162
|
+
/**
|
|
7163
|
+
* The generated prompts.
|
|
7164
|
+
*/
|
|
7165
|
+
prompts: Array<string>;
|
|
7145
7166
|
|
|
7146
7167
|
/**
|
|
7147
7168
|
* The Creative Units cost for the request billed
|
|
@@ -7152,9 +7173,14 @@ export interface GenerateRunModelResponse {
|
|
|
7152
7173
|
* The Creative Units discount for the request billed
|
|
7153
7174
|
*/
|
|
7154
7175
|
creativeUnitsDiscount?: number;
|
|
7176
|
+
|
|
7177
|
+
/**
|
|
7178
|
+
* The mode used to generate new prompt(s).
|
|
7179
|
+
*/
|
|
7180
|
+
mode?: 'completion' | 'contextual' | 'image-editing' | 'inventive' | 'structured';
|
|
7155
7181
|
}
|
|
7156
7182
|
|
|
7157
|
-
export namespace
|
|
7183
|
+
export namespace GeneratePromptResponse {
|
|
7158
7184
|
export interface Job {
|
|
7159
7185
|
/**
|
|
7160
7186
|
* The job creation date as an ISO string (example: "2023-02-03T11:19:41.579Z")
|
|
@@ -8102,18 +8128,8 @@ export namespace GenerateRunModelResponse {
|
|
|
8102
8128
|
}
|
|
8103
8129
|
}
|
|
8104
8130
|
|
|
8105
|
-
export interface
|
|
8106
|
-
|
|
8107
|
-
* Detected language of the input.
|
|
8108
|
-
*/
|
|
8109
|
-
detectedLanguage: string;
|
|
8110
|
-
|
|
8111
|
-
job: GenerateTranslateResponse.Job;
|
|
8112
|
-
|
|
8113
|
-
/**
|
|
8114
|
-
* The translated prompt.
|
|
8115
|
-
*/
|
|
8116
|
-
translation: string;
|
|
8131
|
+
export interface GenerateRunModelResponse {
|
|
8132
|
+
job: GenerateRunModelResponse.Job;
|
|
8117
8133
|
|
|
8118
8134
|
/**
|
|
8119
8135
|
* The Creative Units cost for the request billed
|
|
@@ -8126,7 +8142,7 @@ export interface GenerateTranslateResponse {
|
|
|
8126
8142
|
creativeUnitsDiscount?: number;
|
|
8127
8143
|
}
|
|
8128
8144
|
|
|
8129
|
-
export namespace
|
|
8145
|
+
export namespace GenerateRunModelResponse {
|
|
8130
8146
|
export interface Job {
|
|
8131
8147
|
/**
|
|
8132
8148
|
* The job creation date as an ISO string (example: "2023-02-03T11:19:41.579Z")
|
|
@@ -9074,149 +9090,1121 @@ export namespace GenerateTranslateResponse {
|
|
|
9074
9090
|
}
|
|
9075
9091
|
}
|
|
9076
9092
|
|
|
9077
|
-
export interface
|
|
9078
|
-
/**
|
|
9079
|
-
* Body param: List of images used to generate captions. Results are returned in
|
|
9080
|
-
* the same order as the given images.
|
|
9081
|
-
*
|
|
9082
|
-
* Images are set a data URLs (example:
|
|
9083
|
-
* \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=\")
|
|
9084
|
-
* or the asset IDs (example: \"asset_GTrL3mq4SXWyMxkOHRxlpw\").
|
|
9085
|
-
*
|
|
9086
|
-
* Notes:
|
|
9087
|
-
*
|
|
9088
|
-
* - if both `modelId` and `images` are provided, `modelId`'s examples and training
|
|
9089
|
-
* images will be used to influence the caption structure of the images
|
|
9090
|
-
* - if only `images` are provided, the captions will be conditioned by the
|
|
9091
|
-
* `detailsLevel` parameter
|
|
9092
|
-
* - Replaces `assetIds` parameter
|
|
9093
|
-
* - if you want to caption multiple images at a time, please prefer using asset
|
|
9094
|
-
* ids instead of data url
|
|
9095
|
-
*/
|
|
9096
|
-
images: Array<string>;
|
|
9097
|
-
|
|
9093
|
+
export interface GenerateTranslateResponse {
|
|
9098
9094
|
/**
|
|
9099
|
-
*
|
|
9095
|
+
* Detected language of the input.
|
|
9100
9096
|
*/
|
|
9101
|
-
|
|
9097
|
+
detectedLanguage: string;
|
|
9102
9098
|
|
|
9103
|
-
|
|
9104
|
-
* Body param: The assetIds to generate captions. Results are returned in the same
|
|
9105
|
-
* order as the given assetIds. Deprecated, use `images` parameter instead.
|
|
9106
|
-
*/
|
|
9107
|
-
assetIds?: Array<string>;
|
|
9099
|
+
job: GenerateTranslateResponse.Job;
|
|
9108
9100
|
|
|
9109
9101
|
/**
|
|
9110
|
-
*
|
|
9111
|
-
*
|
|
9112
|
-
* When a modelId is provided and examples are available, the details level is
|
|
9113
|
-
* ignored.
|
|
9102
|
+
* The translated prompt.
|
|
9114
9103
|
*/
|
|
9115
|
-
|
|
9104
|
+
translation: string;
|
|
9116
9105
|
|
|
9117
9106
|
/**
|
|
9118
|
-
*
|
|
9107
|
+
* The Creative Units cost for the request billed
|
|
9119
9108
|
*/
|
|
9120
|
-
|
|
9109
|
+
creativeUnitsCost?: number;
|
|
9121
9110
|
|
|
9122
9111
|
/**
|
|
9123
|
-
*
|
|
9124
|
-
* examples' prompt to generate the captions.
|
|
9112
|
+
* The Creative Units discount for the request billed
|
|
9125
9113
|
*/
|
|
9126
|
-
|
|
9114
|
+
creativeUnitsDiscount?: number;
|
|
9115
|
+
}
|
|
9127
9116
|
|
|
9128
|
-
|
|
9129
|
-
|
|
9130
|
-
|
|
9131
|
-
|
|
9132
|
-
|
|
9133
|
-
|
|
9134
|
-
seed?: number;
|
|
9117
|
+
export namespace GenerateTranslateResponse {
|
|
9118
|
+
export interface Job {
|
|
9119
|
+
/**
|
|
9120
|
+
* The job creation date as an ISO string (example: "2023-02-03T11:19:41.579Z")
|
|
9121
|
+
*/
|
|
9122
|
+
createdAt: string;
|
|
9135
9123
|
|
|
9136
|
-
|
|
9137
|
-
|
|
9138
|
-
|
|
9139
|
-
|
|
9140
|
-
*
|
|
9141
|
-
* We generally recommend altering this or `topP` but not both.
|
|
9142
|
-
*/
|
|
9143
|
-
temperature?: number;
|
|
9124
|
+
/**
|
|
9125
|
+
* The job ID (example: "job_ocZCnG1Df35XRL1QyCZSRxAG8")
|
|
9126
|
+
*/
|
|
9127
|
+
jobId: string;
|
|
9144
9128
|
|
|
9145
|
-
|
|
9146
|
-
|
|
9147
|
-
|
|
9148
|
-
|
|
9149
|
-
|
|
9150
|
-
|
|
9151
|
-
|
|
9152
|
-
|
|
9153
|
-
|
|
9129
|
+
/**
|
|
9130
|
+
* The type of job
|
|
9131
|
+
*/
|
|
9132
|
+
jobType:
|
|
9133
|
+
| 'assets-download'
|
|
9134
|
+
| 'canvas-export'
|
|
9135
|
+
| 'caption'
|
|
9136
|
+
| 'caption-llava'
|
|
9137
|
+
| 'custom'
|
|
9138
|
+
| 'describe-style'
|
|
9139
|
+
| 'detection'
|
|
9140
|
+
| 'embed'
|
|
9141
|
+
| 'flux'
|
|
9142
|
+
| 'flux-model-training'
|
|
9143
|
+
| 'generate-prompt'
|
|
9144
|
+
| 'image-generation'
|
|
9145
|
+
| 'image-prompt-editing'
|
|
9146
|
+
| 'inference'
|
|
9147
|
+
| 'mesh-preview-rendering'
|
|
9148
|
+
| 'model-download'
|
|
9149
|
+
| 'model-import'
|
|
9150
|
+
| 'model-training'
|
|
9151
|
+
| 'musubi-model-training'
|
|
9152
|
+
| 'openai-image-generation'
|
|
9153
|
+
| 'patch-image'
|
|
9154
|
+
| 'pixelate'
|
|
9155
|
+
| 'reframe'
|
|
9156
|
+
| 'remove-background'
|
|
9157
|
+
| 'repaint'
|
|
9158
|
+
| 'restyle'
|
|
9159
|
+
| 'segment'
|
|
9160
|
+
| 'skybox-3d'
|
|
9161
|
+
| 'skybox-base-360'
|
|
9162
|
+
| 'skybox-hdri'
|
|
9163
|
+
| 'skybox-upscale-360'
|
|
9164
|
+
| 'texture'
|
|
9165
|
+
| 'translate'
|
|
9166
|
+
| 'upload'
|
|
9167
|
+
| 'upscale'
|
|
9168
|
+
| 'upscale-skybox'
|
|
9169
|
+
| 'upscale-texture'
|
|
9170
|
+
| 'vectorize'
|
|
9171
|
+
| 'workflow';
|
|
9154
9172
|
|
|
9155
|
-
|
|
9156
|
-
|
|
9157
|
-
|
|
9158
|
-
|
|
9159
|
-
unwantedSequences?: Array<string>;
|
|
9160
|
-
}
|
|
9173
|
+
/**
|
|
9174
|
+
* Metadata of the job with some additional information
|
|
9175
|
+
*/
|
|
9176
|
+
metadata: Job.Metadata;
|
|
9161
9177
|
|
|
9162
|
-
|
|
9163
|
-
|
|
9164
|
-
|
|
9165
|
-
|
|
9166
|
-
dryRun?: unknown;
|
|
9178
|
+
/**
|
|
9179
|
+
* Progress of the job (between 0 and 1)
|
|
9180
|
+
*/
|
|
9181
|
+
progress: number;
|
|
9167
9182
|
|
|
9168
|
-
|
|
9169
|
-
|
|
9170
|
-
|
|
9171
|
-
|
|
9183
|
+
/**
|
|
9184
|
+
* The current status of the job
|
|
9185
|
+
*/
|
|
9186
|
+
status:
|
|
9187
|
+
| 'canceled'
|
|
9188
|
+
| 'failure'
|
|
9189
|
+
| 'finalizing'
|
|
9190
|
+
| 'in-progress'
|
|
9191
|
+
| 'pending'
|
|
9192
|
+
| 'queued'
|
|
9193
|
+
| 'success'
|
|
9194
|
+
| 'warming-up';
|
|
9172
9195
|
|
|
9173
|
-
|
|
9174
|
-
|
|
9175
|
-
|
|
9176
|
-
|
|
9196
|
+
/**
|
|
9197
|
+
* The history of the different statuses the job went through with the ISO string
|
|
9198
|
+
* date of when the job reached each statuses.
|
|
9199
|
+
*/
|
|
9200
|
+
statusHistory: Array<Job.StatusHistory>;
|
|
9177
9201
|
|
|
9178
|
-
|
|
9179
|
-
|
|
9180
|
-
|
|
9181
|
-
|
|
9182
|
-
* \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=\")
|
|
9183
|
-
* or the asset IDs (example: \"asset_GTrL3mq4SXWyMxkOHRxlpw\").
|
|
9184
|
-
*
|
|
9185
|
-
* Notes:
|
|
9186
|
-
*
|
|
9187
|
-
* - in `contextual` mode, images condition prompt generation by using their actual
|
|
9188
|
-
* descriptions as context
|
|
9189
|
-
* - in all other modes, it supersedes the `modelId` parameter when provided.
|
|
9190
|
-
*/
|
|
9191
|
-
images?: Array<string>;
|
|
9202
|
+
/**
|
|
9203
|
+
* The job last update date as an ISO string (example: "2023-02-03T11:19:41.579Z")
|
|
9204
|
+
*/
|
|
9205
|
+
updatedAt: string;
|
|
9192
9206
|
|
|
9193
|
-
|
|
9194
|
-
|
|
9195
|
-
|
|
9196
|
-
|
|
9197
|
-
* examples.
|
|
9198
|
-
*
|
|
9199
|
-
* In `contextual` mode, the modelId is used to retrieve additional context from
|
|
9200
|
-
* the model such as its type and capabilities.
|
|
9201
|
-
*/
|
|
9202
|
-
modelId?: string;
|
|
9207
|
+
/**
|
|
9208
|
+
* The author user ID (example: "dcf121faaa1a0a0bbbd9ca1b73d62aea")
|
|
9209
|
+
*/
|
|
9210
|
+
authorId?: string;
|
|
9203
9211
|
|
|
9204
|
-
|
|
9205
|
-
|
|
9206
|
-
|
|
9207
|
-
|
|
9208
|
-
* prompt, model's state, etc..
|
|
9209
|
-
*/
|
|
9210
|
-
seed?: number;
|
|
9212
|
+
/**
|
|
9213
|
+
* The billing of the job
|
|
9214
|
+
*/
|
|
9215
|
+
billing?: Job.Billing;
|
|
9211
9216
|
|
|
9212
|
-
|
|
9213
|
-
|
|
9214
|
-
|
|
9215
|
-
|
|
9216
|
-
|
|
9217
|
-
|
|
9218
|
-
|
|
9219
|
-
|
|
9217
|
+
/**
|
|
9218
|
+
* The owner ID (example: "team_U3Qmc8PCdWXwAQJ4Dvw4tV6D")
|
|
9219
|
+
*/
|
|
9220
|
+
ownerId?: string;
|
|
9221
|
+
}
|
|
9222
|
+
|
|
9223
|
+
export namespace Job {
|
|
9224
|
+
/**
|
|
9225
|
+
* Metadata of the job with some additional information
|
|
9226
|
+
*/
|
|
9227
|
+
export interface Metadata {
|
|
9228
|
+
/**
|
|
9229
|
+
* List of produced assets for this job
|
|
9230
|
+
*/
|
|
9231
|
+
assetIds?: Array<string>;
|
|
9232
|
+
|
|
9233
|
+
/**
|
|
9234
|
+
* Eventual error for the job
|
|
9235
|
+
*/
|
|
9236
|
+
error?: string | null;
|
|
9237
|
+
|
|
9238
|
+
/**
|
|
9239
|
+
* The flow of the job. Only available for workflow jobs.
|
|
9240
|
+
*/
|
|
9241
|
+
flow?: Array<Metadata.Flow>;
|
|
9242
|
+
|
|
9243
|
+
/**
|
|
9244
|
+
* Actionable hint for the user explaining what went wrong and how to resolve it.
|
|
9245
|
+
*/
|
|
9246
|
+
hint?: string;
|
|
9247
|
+
|
|
9248
|
+
/**
|
|
9249
|
+
* The inputs for the job
|
|
9250
|
+
*/
|
|
9251
|
+
input?: { [key: string]: unknown };
|
|
9252
|
+
|
|
9253
|
+
/**
|
|
9254
|
+
* May contain the output of the job for specific custom models jobs. Only
|
|
9255
|
+
* available for custom models which generate non-assets outputs. Example: LLM text
|
|
9256
|
+
* results.
|
|
9257
|
+
*/
|
|
9258
|
+
output?: { [key: string]: unknown };
|
|
9259
|
+
|
|
9260
|
+
/**
|
|
9261
|
+
* For voice-clone jobs: the ID of the model being trained.
|
|
9262
|
+
*/
|
|
9263
|
+
outputModelId?: string;
|
|
9264
|
+
|
|
9265
|
+
/**
|
|
9266
|
+
* The workflow ID of the job if job is part of a workflow.
|
|
9267
|
+
*/
|
|
9268
|
+
workflowId?: string;
|
|
9269
|
+
|
|
9270
|
+
/**
|
|
9271
|
+
* The workflow job ID of the job if job is part of a workflow job.
|
|
9272
|
+
*/
|
|
9273
|
+
workflowJobId?: string;
|
|
9274
|
+
}
|
|
9275
|
+
|
|
9276
|
+
export namespace Metadata {
|
|
9277
|
+
export interface Flow {
|
|
9278
|
+
/**
|
|
9279
|
+
* The id of the node.
|
|
9280
|
+
*/
|
|
9281
|
+
id: string;
|
|
9282
|
+
|
|
9283
|
+
/**
|
|
9284
|
+
* The status of the node. Only available for WorkflowJob nodes.
|
|
9285
|
+
*/
|
|
9286
|
+
status: 'failure' | 'pending' | 'processing' | 'skipped' | 'success';
|
|
9287
|
+
|
|
9288
|
+
/**
|
|
9289
|
+
* The type of the job for the node.
|
|
9290
|
+
*/
|
|
9291
|
+
type:
|
|
9292
|
+
| 'custom-model'
|
|
9293
|
+
| 'for-each'
|
|
9294
|
+
| 'generate-prompt'
|
|
9295
|
+
| 'list'
|
|
9296
|
+
| 'logic'
|
|
9297
|
+
| 'model'
|
|
9298
|
+
| 'remove-background'
|
|
9299
|
+
| 'transform'
|
|
9300
|
+
| 'user-approval'
|
|
9301
|
+
| 'workflow';
|
|
9302
|
+
|
|
9303
|
+
/**
|
|
9304
|
+
* List of produced assets for this node.
|
|
9305
|
+
*/
|
|
9306
|
+
assets?: Array<Flow.Asset>;
|
|
9307
|
+
|
|
9308
|
+
/**
|
|
9309
|
+
* Fixed number of iterations for a ForEach node. When set, the loop runs exactly
|
|
9310
|
+
* `count` times regardless of array input. When not set, the loop iterates over
|
|
9311
|
+
* the resolved array input. Only available for ForEach nodes.
|
|
9312
|
+
*/
|
|
9313
|
+
count?: number;
|
|
9314
|
+
|
|
9315
|
+
/**
|
|
9316
|
+
* The nodes that this node depends on. Only available for nodes that have
|
|
9317
|
+
* dependencies. Mainly used for user approval nodes.
|
|
9318
|
+
*/
|
|
9319
|
+
dependsOn?: Array<string>;
|
|
9320
|
+
|
|
9321
|
+
/**
|
|
9322
|
+
* If true, the outputs of this node will be included in the workflow job's final
|
|
9323
|
+
* output. Only applicable to producing nodes (custom-model, inference, etc.). By
|
|
9324
|
+
* default, only last nodes (nodes not referenced by other nodes) contribute to
|
|
9325
|
+
* outputs. Set this to true to also include intermediate nodes in the final
|
|
9326
|
+
* output. Note: This should only be set to `true` or left undefined.
|
|
9327
|
+
*/
|
|
9328
|
+
includeOutputsInWorkflowJob?: true;
|
|
9329
|
+
|
|
9330
|
+
/**
|
|
9331
|
+
* The inputs of the node.
|
|
9332
|
+
*/
|
|
9333
|
+
inputs?: Array<Flow.Input>;
|
|
9334
|
+
|
|
9335
|
+
/**
|
|
9336
|
+
* Statically-configured items for a List node. The node outputs this array as-is
|
|
9337
|
+
* when executed. Only available for List nodes. The values can be strings,
|
|
9338
|
+
* numbers, or asset IDs.
|
|
9339
|
+
*/
|
|
9340
|
+
items?: Array<string>;
|
|
9341
|
+
|
|
9342
|
+
/**
|
|
9343
|
+
* Zero-based index of the iteration this node copy belongs to. Set on
|
|
9344
|
+
* dynamically-created copies of loop body nodes.
|
|
9345
|
+
*/
|
|
9346
|
+
iterationIndex?: number;
|
|
9347
|
+
|
|
9348
|
+
/**
|
|
9349
|
+
* If the flow is part of a WorkflowJob, this is the jobId for the node. jobId is
|
|
9350
|
+
* only available for nodes started. A node "Pending" for a running workflow job is
|
|
9351
|
+
* not started.
|
|
9352
|
+
*/
|
|
9353
|
+
jobId?: string;
|
|
9354
|
+
|
|
9355
|
+
/**
|
|
9356
|
+
* The logic of the node. Only available for logic nodes.
|
|
9357
|
+
*/
|
|
9358
|
+
logic?: Flow.Logic;
|
|
9359
|
+
|
|
9360
|
+
/**
|
|
9361
|
+
* The type of the logic for the node. Only available for logic nodes.
|
|
9362
|
+
*/
|
|
9363
|
+
logicType?: 'if-else';
|
|
9364
|
+
|
|
9365
|
+
/**
|
|
9366
|
+
* IDs of the body template nodes that belong to this ForEach loop. At runtime
|
|
9367
|
+
* these templates are cloned once per iteration and marked Skipped. Only available
|
|
9368
|
+
* for ForEach nodes.
|
|
9369
|
+
*/
|
|
9370
|
+
loopBodyNodeIds?: Array<string>;
|
|
9371
|
+
|
|
9372
|
+
/**
|
|
9373
|
+
* ID of the ForEach node that spawned this iteration copy. Set on
|
|
9374
|
+
* dynamically-created copies of loop body nodes.
|
|
9375
|
+
*/
|
|
9376
|
+
loopNodeId?: string;
|
|
9377
|
+
|
|
9378
|
+
/**
|
|
9379
|
+
* The model id for the node. Mainly used for custom model tasks.
|
|
9380
|
+
*/
|
|
9381
|
+
modelId?: string;
|
|
9382
|
+
|
|
9383
|
+
/**
|
|
9384
|
+
* The output of the node. Only available for logic nodes.
|
|
9385
|
+
*/
|
|
9386
|
+
output?: unknown;
|
|
9387
|
+
|
|
9388
|
+
/**
|
|
9389
|
+
* The workflow id for the node. Mainly used for workflow tasks.
|
|
9390
|
+
*/
|
|
9391
|
+
workflowId?: string;
|
|
9392
|
+
}
|
|
9393
|
+
|
|
9394
|
+
export namespace Flow {
|
|
9395
|
+
export interface Asset {
|
|
9396
|
+
assetId: string;
|
|
9397
|
+
|
|
9398
|
+
url: string;
|
|
9399
|
+
}
|
|
9400
|
+
|
|
9401
|
+
/**
|
|
9402
|
+
* This is used to run the flow.
|
|
9403
|
+
*/
|
|
9404
|
+
export interface Input {
|
|
9405
|
+
/**
|
|
9406
|
+
* The name that must be user to call the model through the API
|
|
9407
|
+
*/
|
|
9408
|
+
name: string;
|
|
9409
|
+
|
|
9410
|
+
/**
|
|
9411
|
+
* The data type of the input
|
|
9412
|
+
*/
|
|
9413
|
+
type:
|
|
9414
|
+
| 'boolean'
|
|
9415
|
+
| 'file'
|
|
9416
|
+
| 'file_array'
|
|
9417
|
+
| 'inputs_array'
|
|
9418
|
+
| 'model'
|
|
9419
|
+
| 'model_array'
|
|
9420
|
+
| 'number'
|
|
9421
|
+
| 'number_array'
|
|
9422
|
+
| 'string'
|
|
9423
|
+
| 'string_array';
|
|
9424
|
+
|
|
9425
|
+
/**
|
|
9426
|
+
* The allowed values for the input. For \`string\` or \`number\` types, creates a
|
|
9427
|
+
* single-select dropdown. For \`string_array\` type, creates a multi-select
|
|
9428
|
+
* dropdown.
|
|
9429
|
+
*/
|
|
9430
|
+
allowedValues?: Array<unknown>;
|
|
9431
|
+
|
|
9432
|
+
/**
|
|
9433
|
+
* Specifies the background behavior for the input. Only available for \`file\` and
|
|
9434
|
+
* \`file_array\` input types with kind \`image\`.
|
|
9435
|
+
*/
|
|
9436
|
+
backgroundBehavior?: 'opaque' | 'transparent';
|
|
9437
|
+
|
|
9438
|
+
/**
|
|
9439
|
+
* Whether the input is a color or not. Only available for \`string\` input type.
|
|
9440
|
+
*/
|
|
9441
|
+
color?: boolean;
|
|
9442
|
+
|
|
9443
|
+
/**
|
|
9444
|
+
* Whether this input affects the model's cost calculation
|
|
9445
|
+
*/
|
|
9446
|
+
costImpact?: boolean;
|
|
9447
|
+
|
|
9448
|
+
/**
|
|
9449
|
+
* The default value for the input
|
|
9450
|
+
*/
|
|
9451
|
+
default?: unknown;
|
|
9452
|
+
|
|
9453
|
+
/**
|
|
9454
|
+
* Help text displayed in the UI to provide additional information about the input
|
|
9455
|
+
*/
|
|
9456
|
+
description?: string;
|
|
9457
|
+
|
|
9458
|
+
/**
|
|
9459
|
+
* Used to visually group inputs together in the UI. Inputs with the same group
|
|
9460
|
+
* value appear consecutively in the UI.
|
|
9461
|
+
*/
|
|
9462
|
+
group?: string;
|
|
9463
|
+
|
|
9464
|
+
/**
|
|
9465
|
+
* Hint text displayed in the UI as a tooltip to guide the user
|
|
9466
|
+
*/
|
|
9467
|
+
hint?: string;
|
|
9468
|
+
|
|
9469
|
+
/**
|
|
9470
|
+
* The list of inputs which form an object within a container array. All inputs are
|
|
9471
|
+
* the same as the current object. This is only available for type inputs_array
|
|
9472
|
+
* inputs.
|
|
9473
|
+
*/
|
|
9474
|
+
inputs?: Array<{ [key: string]: unknown }>;
|
|
9475
|
+
|
|
9476
|
+
/**
|
|
9477
|
+
* The configured items for inputs_array type inputs. Each item is an array of
|
|
9478
|
+
* SubNodeInput that need ref/value resolution. Only available for inputs_array
|
|
9479
|
+
* type.
|
|
9480
|
+
*/
|
|
9481
|
+
items?: Array<Array<Input.Item>>;
|
|
9482
|
+
|
|
9483
|
+
/**
|
|
9484
|
+
* The asset kind of the input. Only taken into account for \`file\` and
|
|
9485
|
+
* \`file_array\` input types. If model provides multiple kinds, the input will be
|
|
9486
|
+
* not able to create the asset on the flight on API side with dataurl without
|
|
9487
|
+
* data:kind, prefix
|
|
9488
|
+
*/
|
|
9489
|
+
kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
|
|
9490
|
+
|
|
9491
|
+
/**
|
|
9492
|
+
* The label displayed in the UI for this input
|
|
9493
|
+
*/
|
|
9494
|
+
label?: string;
|
|
9495
|
+
|
|
9496
|
+
/**
|
|
9497
|
+
* The name of the file input field to use as the mask source
|
|
9498
|
+
*/
|
|
9499
|
+
maskFrom?: string;
|
|
9500
|
+
|
|
9501
|
+
/**
|
|
9502
|
+
* The maximum allowed value. Only available for \`number\` and \`array\` input
|
|
9503
|
+
* types.
|
|
9504
|
+
*/
|
|
9505
|
+
max?: number;
|
|
9506
|
+
|
|
9507
|
+
/**
|
|
9508
|
+
* The maximum allowed length for \`string\` inputs. Also applies to each item in
|
|
9509
|
+
* \`string_array\`.
|
|
9510
|
+
*/
|
|
9511
|
+
maxLength?: number;
|
|
9512
|
+
|
|
9513
|
+
/**
|
|
9514
|
+
* The maximum allowed file size in bytes. Only applies to \`file\` and
|
|
9515
|
+
* \`file_array\` input types. Validated against \`asset.properties.size\` at job
|
|
9516
|
+
* creation time.
|
|
9517
|
+
*/
|
|
9518
|
+
maxSize?: number;
|
|
9519
|
+
|
|
9520
|
+
/**
|
|
9521
|
+
* The minimum allowed value. Only available for \`number\` and array input types.
|
|
9522
|
+
*/
|
|
9523
|
+
min?: number;
|
|
9524
|
+
|
|
9525
|
+
/**
|
|
9526
|
+
* The minimum allowed length for string inputs. Also applies to each item in
|
|
9527
|
+
* \`string_array\`.
|
|
9528
|
+
*/
|
|
9529
|
+
minLength?: number;
|
|
9530
|
+
|
|
9531
|
+
/**
|
|
9532
|
+
* The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only
|
|
9533
|
+
* available for \`model_array\` input type.
|
|
9534
|
+
*/
|
|
9535
|
+
modelTypes?: Array<
|
|
9536
|
+
| 'custom'
|
|
9537
|
+
| 'elevenlabs-voice'
|
|
9538
|
+
| 'flux.1'
|
|
9539
|
+
| 'flux.1-composition'
|
|
9540
|
+
| 'flux.1-kontext-dev'
|
|
9541
|
+
| 'flux.1-kontext-lora'
|
|
9542
|
+
| 'flux.1-krea-dev'
|
|
9543
|
+
| 'flux.1-krea-lora'
|
|
9544
|
+
| 'flux.1-lora'
|
|
9545
|
+
| 'flux.1-pro'
|
|
9546
|
+
| 'flux.1.1-pro-ultra'
|
|
9547
|
+
| 'flux.2-dev-edit-lora'
|
|
9548
|
+
| 'flux.2-dev-lora'
|
|
9549
|
+
| 'flux.2-klein-4b-edit-lora'
|
|
9550
|
+
| 'flux.2-klein-4b-lora'
|
|
9551
|
+
| 'flux.2-klein-9b-edit-lora'
|
|
9552
|
+
| 'flux.2-klein-9b-lora'
|
|
9553
|
+
| 'flux.2-klein-base-4b-edit-lora'
|
|
9554
|
+
| 'flux.2-klein-base-4b-lora'
|
|
9555
|
+
| 'flux.2-klein-base-9b-edit-lora'
|
|
9556
|
+
| 'flux.2-klein-base-9b-lora'
|
|
9557
|
+
| 'flux1.1-pro'
|
|
9558
|
+
| 'gpt-image-1'
|
|
9559
|
+
| 'qwen-image-2512-lora'
|
|
9560
|
+
| 'qwen-image-edit-2509-lora'
|
|
9561
|
+
| 'qwen-image-edit-2511-lora'
|
|
9562
|
+
| 'qwen-image-edit-lora'
|
|
9563
|
+
| 'qwen-image-lora'
|
|
9564
|
+
| 'sd-1_5'
|
|
9565
|
+
| 'sd-1_5-composition'
|
|
9566
|
+
| 'sd-1_5-lora'
|
|
9567
|
+
| 'sd-xl'
|
|
9568
|
+
| 'sd-xl-composition'
|
|
9569
|
+
| 'sd-xl-lora'
|
|
9570
|
+
| 'zimage-de-turbo-lora'
|
|
9571
|
+
| 'zimage-lora'
|
|
9572
|
+
| 'zimage-turbo-lora'
|
|
9573
|
+
>;
|
|
9574
|
+
|
|
9575
|
+
/**
|
|
9576
|
+
* Whether this input represents a parent asset to assign to the produced assets.
|
|
9577
|
+
* Only available for \`file\` and \`file_array\` input types.
|
|
9578
|
+
*
|
|
9579
|
+
* For \`file_array\`, the parent asset is the first item in the array.
|
|
9580
|
+
*/
|
|
9581
|
+
parent?: boolean;
|
|
9582
|
+
|
|
9583
|
+
/**
|
|
9584
|
+
* Placeholder text for the input. Only available for 'string' input type.
|
|
9585
|
+
*/
|
|
9586
|
+
placeholder?: string;
|
|
9587
|
+
|
|
9588
|
+
/**
|
|
9589
|
+
* Whether the input is a prompt. When true, displays as a text area with prompt
|
|
9590
|
+
* spark feature. Only available for \`string\` input type.
|
|
9591
|
+
*/
|
|
9592
|
+
prompt?: boolean;
|
|
9593
|
+
|
|
9594
|
+
/**
|
|
9595
|
+
* Whether the input is used with prompt spark. Only available for \`string\` input
|
|
9596
|
+
* type.
|
|
9597
|
+
*/
|
|
9598
|
+
promptSpark?: boolean;
|
|
9599
|
+
|
|
9600
|
+
/**
|
|
9601
|
+
* The reference to another input or output of the same workflow. Must have at
|
|
9602
|
+
* least one of node or conditional.
|
|
9603
|
+
*/
|
|
9604
|
+
ref?: Input.Ref;
|
|
9605
|
+
|
|
9606
|
+
/**
|
|
9607
|
+
* Set of rules that describes when this input is required:
|
|
9608
|
+
*
|
|
9609
|
+
* - \`always\`: Input is always required
|
|
9610
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
9611
|
+
* defined
|
|
9612
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
9613
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
9614
|
+
* value
|
|
9615
|
+
*
|
|
9616
|
+
* By default, the input is not required.
|
|
9617
|
+
*/
|
|
9618
|
+
required?: Input.Required;
|
|
9619
|
+
|
|
9620
|
+
/**
|
|
9621
|
+
* The step increment for numeric inputs. Only available for \`number\` input type.
|
|
9622
|
+
*/
|
|
9623
|
+
step?: number;
|
|
9624
|
+
|
|
9625
|
+
/**
|
|
9626
|
+
* The value of the input. This is the value of the input that will be used to run
|
|
9627
|
+
* the node. Only available for flows managed by a WorkflowJob.
|
|
9628
|
+
*/
|
|
9629
|
+
value?: unknown;
|
|
9630
|
+
}
|
|
9631
|
+
|
|
9632
|
+
export namespace Input {
|
|
9633
|
+
/**
|
|
9634
|
+
* A sub-input within an inputs_array item. Same as NodeInput but without the
|
|
9635
|
+
* recursive items field.
|
|
9636
|
+
*/
|
|
9637
|
+
export interface Item {
|
|
9638
|
+
/**
|
|
9639
|
+
* The name that must be user to call the model through the API
|
|
9640
|
+
*/
|
|
9641
|
+
name: string;
|
|
9642
|
+
|
|
9643
|
+
/**
|
|
9644
|
+
* The data type of the input
|
|
9645
|
+
*/
|
|
9646
|
+
type:
|
|
9647
|
+
| 'boolean'
|
|
9648
|
+
| 'file'
|
|
9649
|
+
| 'file_array'
|
|
9650
|
+
| 'inputs_array'
|
|
9651
|
+
| 'model'
|
|
9652
|
+
| 'model_array'
|
|
9653
|
+
| 'number'
|
|
9654
|
+
| 'number_array'
|
|
9655
|
+
| 'string'
|
|
9656
|
+
| 'string_array';
|
|
9657
|
+
|
|
9658
|
+
/**
|
|
9659
|
+
* The allowed values for the input. For \`string\` or \`number\` types, creates a
|
|
9660
|
+
* single-select dropdown. For \`string_array\` type, creates a multi-select
|
|
9661
|
+
* dropdown.
|
|
9662
|
+
*/
|
|
9663
|
+
allowedValues?: Array<unknown>;
|
|
9664
|
+
|
|
9665
|
+
/**
|
|
9666
|
+
* Specifies the background behavior for the input. Only available for \`file\` and
|
|
9667
|
+
* \`file_array\` input types with kind \`image\`.
|
|
9668
|
+
*/
|
|
9669
|
+
backgroundBehavior?: 'opaque' | 'transparent';
|
|
9670
|
+
|
|
9671
|
+
/**
|
|
9672
|
+
* Whether the input is a color or not. Only available for \`string\` input type.
|
|
9673
|
+
*/
|
|
9674
|
+
color?: boolean;
|
|
9675
|
+
|
|
9676
|
+
/**
|
|
9677
|
+
* Whether this input affects the model's cost calculation
|
|
9678
|
+
*/
|
|
9679
|
+
costImpact?: boolean;
|
|
9680
|
+
|
|
9681
|
+
/**
|
|
9682
|
+
* The default value for the input
|
|
9683
|
+
*/
|
|
9684
|
+
default?: unknown;
|
|
9685
|
+
|
|
9686
|
+
/**
|
|
9687
|
+
* Help text displayed in the UI to provide additional information about the input
|
|
9688
|
+
*/
|
|
9689
|
+
description?: string;
|
|
9690
|
+
|
|
9691
|
+
/**
|
|
9692
|
+
* Used to visually group inputs together in the UI. Inputs with the same group
|
|
9693
|
+
* value appear consecutively in the UI.
|
|
9694
|
+
*/
|
|
9695
|
+
group?: string;
|
|
9696
|
+
|
|
9697
|
+
/**
|
|
9698
|
+
* Hint text displayed in the UI as a tooltip to guide the user
|
|
9699
|
+
*/
|
|
9700
|
+
hint?: string;
|
|
9701
|
+
|
|
9702
|
+
/**
|
|
9703
|
+
* The list of inputs which form an object within a container array. All inputs are
|
|
9704
|
+
* the same as the current object. This is only available for type inputs_array
|
|
9705
|
+
* inputs.
|
|
9706
|
+
*/
|
|
9707
|
+
inputs?: Array<{ [key: string]: unknown }>;
|
|
9708
|
+
|
|
9709
|
+
/**
|
|
9710
|
+
* The asset kind of the input. Only taken into account for \`file\` and
|
|
9711
|
+
* \`file_array\` input types. If model provides multiple kinds, the input will be
|
|
9712
|
+
* not able to create the asset on the flight on API side with dataurl without
|
|
9713
|
+
* data:kind, prefix
|
|
9714
|
+
*/
|
|
9715
|
+
kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
|
|
9716
|
+
|
|
9717
|
+
/**
|
|
9718
|
+
* The label displayed in the UI for this input
|
|
9719
|
+
*/
|
|
9720
|
+
label?: string;
|
|
9721
|
+
|
|
9722
|
+
/**
|
|
9723
|
+
* The name of the file input field to use as the mask source
|
|
9724
|
+
*/
|
|
9725
|
+
maskFrom?: string;
|
|
9726
|
+
|
|
9727
|
+
/**
|
|
9728
|
+
* The maximum allowed value. Only available for \`number\` and \`array\` input
|
|
9729
|
+
* types.
|
|
9730
|
+
*/
|
|
9731
|
+
max?: number;
|
|
9732
|
+
|
|
9733
|
+
/**
|
|
9734
|
+
* The maximum allowed length for \`string\` inputs. Also applies to each item in
|
|
9735
|
+
* \`string_array\`.
|
|
9736
|
+
*/
|
|
9737
|
+
maxLength?: number;
|
|
9738
|
+
|
|
9739
|
+
/**
|
|
9740
|
+
* The maximum allowed file size in bytes. Only applies to \`file\` and
|
|
9741
|
+
* \`file_array\` input types. Validated against \`asset.properties.size\` at job
|
|
9742
|
+
* creation time.
|
|
9743
|
+
*/
|
|
9744
|
+
maxSize?: number;
|
|
9745
|
+
|
|
9746
|
+
/**
|
|
9747
|
+
* The minimum allowed value. Only available for \`number\` and array input types.
|
|
9748
|
+
*/
|
|
9749
|
+
min?: number;
|
|
9750
|
+
|
|
9751
|
+
/**
|
|
9752
|
+
* The minimum allowed length for string inputs. Also applies to each item in
|
|
9753
|
+
* \`string_array\`.
|
|
9754
|
+
*/
|
|
9755
|
+
minLength?: number;
|
|
9756
|
+
|
|
9757
|
+
/**
|
|
9758
|
+
* The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only
|
|
9759
|
+
* available for \`model_array\` input type.
|
|
9760
|
+
*/
|
|
9761
|
+
modelTypes?: Array<
|
|
9762
|
+
| 'custom'
|
|
9763
|
+
| 'elevenlabs-voice'
|
|
9764
|
+
| 'flux.1'
|
|
9765
|
+
| 'flux.1-composition'
|
|
9766
|
+
| 'flux.1-kontext-dev'
|
|
9767
|
+
| 'flux.1-kontext-lora'
|
|
9768
|
+
| 'flux.1-krea-dev'
|
|
9769
|
+
| 'flux.1-krea-lora'
|
|
9770
|
+
| 'flux.1-lora'
|
|
9771
|
+
| 'flux.1-pro'
|
|
9772
|
+
| 'flux.1.1-pro-ultra'
|
|
9773
|
+
| 'flux.2-dev-edit-lora'
|
|
9774
|
+
| 'flux.2-dev-lora'
|
|
9775
|
+
| 'flux.2-klein-4b-edit-lora'
|
|
9776
|
+
| 'flux.2-klein-4b-lora'
|
|
9777
|
+
| 'flux.2-klein-9b-edit-lora'
|
|
9778
|
+
| 'flux.2-klein-9b-lora'
|
|
9779
|
+
| 'flux.2-klein-base-4b-edit-lora'
|
|
9780
|
+
| 'flux.2-klein-base-4b-lora'
|
|
9781
|
+
| 'flux.2-klein-base-9b-edit-lora'
|
|
9782
|
+
| 'flux.2-klein-base-9b-lora'
|
|
9783
|
+
| 'flux1.1-pro'
|
|
9784
|
+
| 'gpt-image-1'
|
|
9785
|
+
| 'qwen-image-2512-lora'
|
|
9786
|
+
| 'qwen-image-edit-2509-lora'
|
|
9787
|
+
| 'qwen-image-edit-2511-lora'
|
|
9788
|
+
| 'qwen-image-edit-lora'
|
|
9789
|
+
| 'qwen-image-lora'
|
|
9790
|
+
| 'sd-1_5'
|
|
9791
|
+
| 'sd-1_5-composition'
|
|
9792
|
+
| 'sd-1_5-lora'
|
|
9793
|
+
| 'sd-xl'
|
|
9794
|
+
| 'sd-xl-composition'
|
|
9795
|
+
| 'sd-xl-lora'
|
|
9796
|
+
| 'zimage-de-turbo-lora'
|
|
9797
|
+
| 'zimage-lora'
|
|
9798
|
+
| 'zimage-turbo-lora'
|
|
9799
|
+
>;
|
|
9800
|
+
|
|
9801
|
+
/**
|
|
9802
|
+
* Whether this input represents a parent asset to assign to the produced assets.
|
|
9803
|
+
* Only available for \`file\` and \`file_array\` input types.
|
|
9804
|
+
*
|
|
9805
|
+
* For \`file_array\`, the parent asset is the first item in the array.
|
|
9806
|
+
*/
|
|
9807
|
+
parent?: boolean;
|
|
9808
|
+
|
|
9809
|
+
/**
|
|
9810
|
+
* Placeholder text for the input. Only available for 'string' input type.
|
|
9811
|
+
*/
|
|
9812
|
+
placeholder?: string;
|
|
9813
|
+
|
|
9814
|
+
/**
|
|
9815
|
+
* Whether the input is a prompt. When true, displays as a text area with prompt
|
|
9816
|
+
* spark feature. Only available for \`string\` input type.
|
|
9817
|
+
*/
|
|
9818
|
+
prompt?: boolean;
|
|
9819
|
+
|
|
9820
|
+
/**
|
|
9821
|
+
* Whether the input is used with prompt spark. Only available for \`string\` input
|
|
9822
|
+
* type.
|
|
9823
|
+
*/
|
|
9824
|
+
promptSpark?: boolean;
|
|
9825
|
+
|
|
9826
|
+
/**
|
|
9827
|
+
* The reference to another input or output of the same workflow. Must have at
|
|
9828
|
+
* least one of node or conditional.
|
|
9829
|
+
*/
|
|
9830
|
+
ref?: Item.Ref;
|
|
9831
|
+
|
|
9832
|
+
/**
|
|
9833
|
+
* Set of rules that describes when this input is required:
|
|
9834
|
+
*
|
|
9835
|
+
* - \`always\`: Input is always required
|
|
9836
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
9837
|
+
* defined
|
|
9838
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
9839
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
9840
|
+
* value
|
|
9841
|
+
*
|
|
9842
|
+
* By default, the input is not required.
|
|
9843
|
+
*/
|
|
9844
|
+
required?: Item.Required;
|
|
9845
|
+
|
|
9846
|
+
/**
|
|
9847
|
+
* The step increment for numeric inputs. Only available for \`number\` input type.
|
|
9848
|
+
*/
|
|
9849
|
+
step?: number;
|
|
9850
|
+
|
|
9851
|
+
/**
|
|
9852
|
+
* The value of the input. This is the value of the input that will be used to run
|
|
9853
|
+
* the node. Only available for flows managed by a WorkflowJob.
|
|
9854
|
+
*/
|
|
9855
|
+
value?: unknown;
|
|
9856
|
+
}
|
|
9857
|
+
|
|
9858
|
+
export namespace Item {
|
|
9859
|
+
/**
|
|
9860
|
+
* The reference to another input or output of the same workflow. Must have at
|
|
9861
|
+
* least one of node or conditional.
|
|
9862
|
+
*/
|
|
9863
|
+
export interface Ref {
|
|
9864
|
+
/**
|
|
9865
|
+
* The conditional nodes to reference. If the conditional nodes are successful, the
|
|
9866
|
+
* node will be successful. If the conditional nodes are skipped, the node will be
|
|
9867
|
+
* skipped. Contains an array of node ids used to check the status of the nodes.
|
|
9868
|
+
*/
|
|
9869
|
+
conditional?: Array<string>;
|
|
9870
|
+
|
|
9871
|
+
/**
|
|
9872
|
+
* This is the desired node output value if ref is an if/else node.
|
|
9873
|
+
*/
|
|
9874
|
+
equal?: string;
|
|
9875
|
+
|
|
9876
|
+
/**
|
|
9877
|
+
* The name of the input or output to reference. If the type is 'workflow', the
|
|
9878
|
+
* name is the name of the input of the workflow is required If the type is 'node',
|
|
9879
|
+
* the name is not mandatory, except if you want all outputs of the node. To get
|
|
9880
|
+
* all outputs of a node, you can use the name 'all'.
|
|
9881
|
+
*/
|
|
9882
|
+
name?: string;
|
|
9883
|
+
|
|
9884
|
+
/**
|
|
9885
|
+
* The node id or 'workflow' if the source is a workflow input.
|
|
9886
|
+
*/
|
|
9887
|
+
node?: string;
|
|
9888
|
+
}
|
|
9889
|
+
|
|
9890
|
+
/**
|
|
9891
|
+
* Set of rules that describes when this input is required:
|
|
9892
|
+
*
|
|
9893
|
+
* - \`always\`: Input is always required
|
|
9894
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
9895
|
+
* defined
|
|
9896
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
9897
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
9898
|
+
* value
|
|
9899
|
+
*
|
|
9900
|
+
* By default, the input is not required.
|
|
9901
|
+
*/
|
|
9902
|
+
export interface Required {
|
|
9903
|
+
/**
|
|
9904
|
+
* Whether the input is always required
|
|
9905
|
+
*/
|
|
9906
|
+
always?: boolean;
|
|
9907
|
+
|
|
9908
|
+
/**
|
|
9909
|
+
* Makes this input required when another input has a specific value:
|
|
9910
|
+
*
|
|
9911
|
+
* - Key: name of the input to check
|
|
9912
|
+
* - Value: operation and allowed values that trigger the requirement
|
|
9913
|
+
*/
|
|
9914
|
+
conditionalValues?: unknown;
|
|
9915
|
+
|
|
9916
|
+
/**
|
|
9917
|
+
* Makes this input required when another input is defined:
|
|
9918
|
+
*
|
|
9919
|
+
* - Key: name of the input that must be defined
|
|
9920
|
+
* - Value: message to display when this input is required
|
|
9921
|
+
*/
|
|
9922
|
+
ifDefined?: unknown;
|
|
9923
|
+
|
|
9924
|
+
/**
|
|
9925
|
+
* Makes this input required when another input is not defined:
|
|
9926
|
+
*
|
|
9927
|
+
* - Key: name of the input that must be undefined
|
|
9928
|
+
* - Value: message to display when this input is required
|
|
9929
|
+
*/
|
|
9930
|
+
ifNotDefined?: unknown;
|
|
9931
|
+
}
|
|
9932
|
+
}
|
|
9933
|
+
|
|
9934
|
+
/**
|
|
9935
|
+
* The reference to another input or output of the same workflow. Must have at
|
|
9936
|
+
* least one of node or conditional.
|
|
9937
|
+
*/
|
|
9938
|
+
export interface Ref {
|
|
9939
|
+
/**
|
|
9940
|
+
* The conditional nodes to reference. If the conditional nodes are successful, the
|
|
9941
|
+
* node will be successful. If the conditional nodes are skipped, the node will be
|
|
9942
|
+
* skipped. Contains an array of node ids used to check the status of the nodes.
|
|
9943
|
+
*/
|
|
9944
|
+
conditional?: Array<string>;
|
|
9945
|
+
|
|
9946
|
+
/**
|
|
9947
|
+
* This is the desired node output value if ref is an if/else node.
|
|
9948
|
+
*/
|
|
9949
|
+
equal?: string;
|
|
9950
|
+
|
|
9951
|
+
/**
|
|
9952
|
+
* The name of the input or output to reference. If the type is 'workflow', the
|
|
9953
|
+
* name is the name of the input of the workflow is required If the type is 'node',
|
|
9954
|
+
* the name is not mandatory, except if you want all outputs of the node. To get
|
|
9955
|
+
* all outputs of a node, you can use the name 'all'.
|
|
9956
|
+
*/
|
|
9957
|
+
name?: string;
|
|
9958
|
+
|
|
9959
|
+
/**
|
|
9960
|
+
* The node id or 'workflow' if the source is a workflow input.
|
|
9961
|
+
*/
|
|
9962
|
+
node?: string;
|
|
9963
|
+
}
|
|
9964
|
+
|
|
9965
|
+
/**
|
|
9966
|
+
* Set of rules that describes when this input is required:
|
|
9967
|
+
*
|
|
9968
|
+
* - \`always\`: Input is always required
|
|
9969
|
+
* - \`ifNotDefined\`: Input is required when another specified input is not
|
|
9970
|
+
* defined
|
|
9971
|
+
* - \`ifDefined\`: Input is required when another specified input is defined
|
|
9972
|
+
* - \`conditionalValues\`: Input is required when another input has a specific
|
|
9973
|
+
* value
|
|
9974
|
+
*
|
|
9975
|
+
* By default, the input is not required.
|
|
9976
|
+
*/
|
|
9977
|
+
export interface Required {
|
|
9978
|
+
/**
|
|
9979
|
+
* Whether the input is always required
|
|
9980
|
+
*/
|
|
9981
|
+
always?: boolean;
|
|
9982
|
+
|
|
9983
|
+
/**
|
|
9984
|
+
* Makes this input required when another input has a specific value:
|
|
9985
|
+
*
|
|
9986
|
+
* - Key: name of the input to check
|
|
9987
|
+
* - Value: operation and allowed values that trigger the requirement
|
|
9988
|
+
*/
|
|
9989
|
+
conditionalValues?: unknown;
|
|
9990
|
+
|
|
9991
|
+
/**
|
|
9992
|
+
* Makes this input required when another input is defined:
|
|
9993
|
+
*
|
|
9994
|
+
* - Key: name of the input that must be defined
|
|
9995
|
+
* - Value: message to display when this input is required
|
|
9996
|
+
*/
|
|
9997
|
+
ifDefined?: unknown;
|
|
9998
|
+
|
|
9999
|
+
/**
|
|
10000
|
+
* Makes this input required when another input is not defined:
|
|
10001
|
+
*
|
|
10002
|
+
* - Key: name of the input that must be undefined
|
|
10003
|
+
* - Value: message to display when this input is required
|
|
10004
|
+
*/
|
|
10005
|
+
ifNotDefined?: unknown;
|
|
10006
|
+
}
|
|
10007
|
+
}
|
|
10008
|
+
|
|
10009
|
+
/**
|
|
10010
|
+
* The logic of the node. Only available for logic nodes.
|
|
10011
|
+
*/
|
|
10012
|
+
export interface Logic {
|
|
10013
|
+
/**
|
|
10014
|
+
* The cases of the logic. Only available for if/else nodes.
|
|
10015
|
+
*/
|
|
10016
|
+
cases?: Array<Logic.Case>;
|
|
10017
|
+
|
|
10018
|
+
/**
|
|
10019
|
+
* The default case of the logic. Contains the id/output of the node to execute if
|
|
10020
|
+
* no case is matched. Only available for if/else nodes.
|
|
10021
|
+
*/
|
|
10022
|
+
default?: string;
|
|
10023
|
+
|
|
10024
|
+
/**
|
|
10025
|
+
* The transform of the logic. Only available for transform nodes.
|
|
10026
|
+
*/
|
|
10027
|
+
transform?: string;
|
|
10028
|
+
}
|
|
10029
|
+
|
|
10030
|
+
export namespace Logic {
|
|
10031
|
+
export interface Case {
|
|
10032
|
+
condition: string;
|
|
10033
|
+
|
|
10034
|
+
value: string;
|
|
10035
|
+
}
|
|
10036
|
+
}
|
|
10037
|
+
}
|
|
10038
|
+
}
|
|
10039
|
+
|
|
10040
|
+
export interface StatusHistory {
|
|
10041
|
+
date: string;
|
|
10042
|
+
|
|
10043
|
+
status:
|
|
10044
|
+
| 'canceled'
|
|
10045
|
+
| 'failure'
|
|
10046
|
+
| 'finalizing'
|
|
10047
|
+
| 'in-progress'
|
|
10048
|
+
| 'pending'
|
|
10049
|
+
| 'queued'
|
|
10050
|
+
| 'success'
|
|
10051
|
+
| 'warming-up';
|
|
10052
|
+
}
|
|
10053
|
+
|
|
10054
|
+
/**
|
|
10055
|
+
* The billing of the job
|
|
10056
|
+
*/
|
|
10057
|
+
export interface Billing {
|
|
10058
|
+
cuCost: number;
|
|
10059
|
+
|
|
10060
|
+
cuDiscount: number;
|
|
10061
|
+
}
|
|
10062
|
+
}
|
|
10063
|
+
}
|
|
10064
|
+
|
|
10065
|
+
export interface GenerateCaptionParams {
|
|
10066
|
+
/**
|
|
10067
|
+
* Body param: List of images used to generate captions. Results are returned in
|
|
10068
|
+
* the same order as the given images.
|
|
10069
|
+
*
|
|
10070
|
+
* Images are set a data URLs (example:
|
|
10071
|
+
* \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=\")
|
|
10072
|
+
* or the asset IDs (example: \"asset_GTrL3mq4SXWyMxkOHRxlpw\").
|
|
10073
|
+
*
|
|
10074
|
+
* Notes:
|
|
10075
|
+
*
|
|
10076
|
+
* - if both `modelId` and `images` are provided, `modelId`'s examples and training
|
|
10077
|
+
* images will be used to influence the caption structure of the images
|
|
10078
|
+
* - if only `images` are provided, the captions will be conditioned by the
|
|
10079
|
+
* `detailsLevel` parameter
|
|
10080
|
+
* - Replaces `assetIds` parameter
|
|
10081
|
+
* - if you want to caption multiple images at a time, please prefer using asset
|
|
10082
|
+
* ids instead of data url
|
|
10083
|
+
*/
|
|
10084
|
+
images: Array<string>;
|
|
10085
|
+
|
|
10086
|
+
/**
|
|
10087
|
+
* Query param
|
|
10088
|
+
*/
|
|
10089
|
+
dryRun?: unknown;
|
|
10090
|
+
|
|
10091
|
+
/**
|
|
10092
|
+
* Body param: The assetIds to generate captions. Results are returned in the same
|
|
10093
|
+
* order as the given assetIds. Deprecated, use `images` parameter instead.
|
|
10094
|
+
*/
|
|
10095
|
+
assetIds?: Array<string>;
|
|
10096
|
+
|
|
10097
|
+
/**
|
|
10098
|
+
* Body param: The details level used to generate the captions.
|
|
10099
|
+
*
|
|
10100
|
+
* When a modelId is provided and examples are available, the details level is
|
|
10101
|
+
* ignored.
|
|
10102
|
+
*/
|
|
10103
|
+
detailsLevel?: 'action' | 'action+style';
|
|
10104
|
+
|
|
10105
|
+
/**
|
|
10106
|
+
* Body param: Whether we try to ensure IP removal for new prompt generation.
|
|
10107
|
+
*/
|
|
10108
|
+
ensureIPCleared?: boolean;
|
|
10109
|
+
|
|
10110
|
+
/**
|
|
10111
|
+
* Body param: When provided, the model will follow the model's training images and
|
|
10112
|
+
* examples' prompt to generate the captions.
|
|
10113
|
+
*/
|
|
10114
|
+
modelId?: string;
|
|
10115
|
+
|
|
10116
|
+
/**
|
|
10117
|
+
* Body param: If specified, the API will make a best effort to produce the same
|
|
10118
|
+
* results, such that repeated requests with the same `seed` and parameters should
|
|
10119
|
+
* return the same outputs. Must be used along with the same parameters including
|
|
10120
|
+
* prompt, model's state, etc..
|
|
10121
|
+
*/
|
|
10122
|
+
seed?: number;
|
|
10123
|
+
|
|
10124
|
+
/**
|
|
10125
|
+
* Body param: The sampling temperature to use. Higher values like `0.8` will make
|
|
10126
|
+
* the output more random, while lower values like `0.2` will make it more focused
|
|
10127
|
+
* and deterministic.
|
|
10128
|
+
*
|
|
10129
|
+
* We generally recommend altering this or `topP` but not both.
|
|
10130
|
+
*/
|
|
10131
|
+
temperature?: number;
|
|
10132
|
+
|
|
10133
|
+
/**
|
|
10134
|
+
* Body param: An alternative to sampling with temperature, called nucleus
|
|
10135
|
+
* sampling, where the model considers the results of the tokens with top_p
|
|
10136
|
+
* probability mass. So `0.1` means only the tokens comprising the top `10%`
|
|
10137
|
+
* probability mass are considered.
|
|
10138
|
+
*
|
|
10139
|
+
* We generally recommend altering this or `temperature` but not both.
|
|
10140
|
+
*/
|
|
10141
|
+
topP?: number;
|
|
10142
|
+
|
|
10143
|
+
/**
|
|
10144
|
+
* Body param: Optional list of words sequences that should not be present in the
|
|
10145
|
+
* generated prompts.
|
|
10146
|
+
*/
|
|
10147
|
+
unwantedSequences?: Array<string>;
|
|
10148
|
+
}
|
|
10149
|
+
|
|
10150
|
+
export interface GenerateDescribeStyleParams {
|
|
10151
|
+
/**
|
|
10152
|
+
* Query param
|
|
10153
|
+
*/
|
|
10154
|
+
dryRun?: unknown;
|
|
10155
|
+
|
|
10156
|
+
/**
|
|
10157
|
+
* Body param: The asset ids used to condition the generation.
|
|
10158
|
+
*/
|
|
10159
|
+
assetIds?: Array<string>;
|
|
10160
|
+
|
|
10161
|
+
/**
|
|
10162
|
+
* Body param: Whether we try to ensure IP removal for new prompt generation.
|
|
10163
|
+
*/
|
|
10164
|
+
ensureIPCleared?: boolean;
|
|
10165
|
+
|
|
10166
|
+
/**
|
|
10167
|
+
* Body param: List of images used to condition the generation.
|
|
10168
|
+
*
|
|
10169
|
+
* Images are set a data URLs (example:
|
|
10170
|
+
* \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=\")
|
|
10171
|
+
* or the asset IDs (example: \"asset_GTrL3mq4SXWyMxkOHRxlpw\").
|
|
10172
|
+
*
|
|
10173
|
+
* Notes:
|
|
10174
|
+
*
|
|
10175
|
+
* - in `contextual` mode, images condition prompt generation by using their actual
|
|
10176
|
+
* descriptions as context
|
|
10177
|
+
* - in all other modes, it supersedes the `modelId` parameter when provided.
|
|
10178
|
+
*/
|
|
10179
|
+
images?: Array<string>;
|
|
10180
|
+
|
|
10181
|
+
/**
|
|
10182
|
+
* Body param: The modelId used to condition the generation.
|
|
10183
|
+
*
|
|
10184
|
+
* When provided, the generation will take into account model's training images,
|
|
10185
|
+
* examples.
|
|
10186
|
+
*
|
|
10187
|
+
* In `contextual` mode, the modelId is used to retrieve additional context from
|
|
10188
|
+
* the model such as its type and capabilities.
|
|
10189
|
+
*/
|
|
10190
|
+
modelId?: string;
|
|
10191
|
+
|
|
10192
|
+
/**
|
|
10193
|
+
* Body param: If specified, the API will make a best effort to produce the same
|
|
10194
|
+
* results, such that repeated requests with the same `seed` and parameters should
|
|
10195
|
+
* return the same outputs. Must be used along with the same parameters including
|
|
10196
|
+
* prompt, model's state, etc..
|
|
10197
|
+
*/
|
|
10198
|
+
seed?: number;
|
|
10199
|
+
|
|
10200
|
+
/**
|
|
10201
|
+
* Body param: The sampling temperature to use. Higher values like `0.8` will make
|
|
10202
|
+
* the output more random, while lower values like `0.2` will make it more focused
|
|
10203
|
+
* and deterministic.
|
|
10204
|
+
*
|
|
10205
|
+
* We generally recommend altering this or `topP` but not both.
|
|
10206
|
+
*/
|
|
10207
|
+
temperature?: number;
|
|
9220
10208
|
|
|
9221
10209
|
/**
|
|
9222
10210
|
* Body param: An alternative to sampling with temperature, called nucleus
|
|
@@ -9423,6 +10411,107 @@ export namespace GeneratePatchParams {
|
|
|
9423
10411
|
}
|
|
9424
10412
|
}
|
|
9425
10413
|
|
|
10414
|
+
export interface GeneratePromptParams {
|
|
10415
|
+
/**
|
|
10416
|
+
* Body param: The mode used to generate new prompt(s).
|
|
10417
|
+
*/
|
|
10418
|
+
mode: 'completion' | 'contextual' | 'image-editing' | 'inventive' | 'structured';
|
|
10419
|
+
|
|
10420
|
+
/**
|
|
10421
|
+
* Query param
|
|
10422
|
+
*/
|
|
10423
|
+
dryRun?: unknown;
|
|
10424
|
+
|
|
10425
|
+
/**
|
|
10426
|
+
* Body param: The asset ids used to condition the generation.
|
|
10427
|
+
*
|
|
10428
|
+
* Notes:
|
|
10429
|
+
*
|
|
10430
|
+
* - supersedes the `modelId` parameter when provided.
|
|
10431
|
+
* - ignored when `mode` is `image-editing-prompt`.
|
|
10432
|
+
*/
|
|
10433
|
+
assetIds?: Array<string>;
|
|
10434
|
+
|
|
10435
|
+
/**
|
|
10436
|
+
* Body param: Whether we try to ensure IP removal for new prompt generation.
|
|
10437
|
+
*/
|
|
10438
|
+
ensureIPCleared?: boolean;
|
|
10439
|
+
|
|
10440
|
+
/**
|
|
10441
|
+
* Body param: The input image as a data URL (example:
|
|
10442
|
+
* "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=")
|
|
10443
|
+
* or the asset ID (example: "asset_GTrL3mq4SXWyMxkOHRxlpw")
|
|
10444
|
+
*
|
|
10445
|
+
* Required when `mode` is `image-editing-prompt`.
|
|
10446
|
+
*/
|
|
10447
|
+
image?: string;
|
|
10448
|
+
|
|
10449
|
+
/**
|
|
10450
|
+
* Body param: List of images used to condition the generation.
|
|
10451
|
+
*
|
|
10452
|
+
* Images are set a data URLs (example:
|
|
10453
|
+
* \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=\")
|
|
10454
|
+
* or the asset IDs (example: \"asset_GTrL3mq4SXWyMxkOHRxlpw\").
|
|
10455
|
+
*
|
|
10456
|
+
* Notes:
|
|
10457
|
+
*
|
|
10458
|
+
* - in `contextual` mode, images condition prompt generation by using their actual
|
|
10459
|
+
* descriptions as context
|
|
10460
|
+
* - in all other modes, it supersedes the `modelId` parameter when provided.
|
|
10461
|
+
*/
|
|
10462
|
+
images?: Array<string>;
|
|
10463
|
+
|
|
10464
|
+
/**
|
|
10465
|
+
* Body param: The modelId used to condition the generation.
|
|
10466
|
+
*
|
|
10467
|
+
* When provided, the generation will take into account model's training images,
|
|
10468
|
+
* examples.
|
|
10469
|
+
*
|
|
10470
|
+
* Only supports 'gemini-2.0-flash', 'gemini-2.5-flash', 'gpt-image-1',
|
|
10471
|
+
* 'flux-kontext' and 'runway-gen4-image' for now when `mode` is
|
|
10472
|
+
* `image-editing-prompt`.
|
|
10473
|
+
*/
|
|
10474
|
+
modelId?: string;
|
|
10475
|
+
|
|
10476
|
+
/**
|
|
10477
|
+
* Body param: The number of results to return.
|
|
10478
|
+
*/
|
|
10479
|
+
numResults?: number;
|
|
10480
|
+
|
|
10481
|
+
/**
|
|
10482
|
+
* Body param: The initial prompt spark feed to `completion`, `inventive` or
|
|
10483
|
+
* `structured` modes.
|
|
10484
|
+
*/
|
|
10485
|
+
prompt?: string;
|
|
10486
|
+
|
|
10487
|
+
/**
|
|
10488
|
+
* Body param: If specified, the API will make a best effort to produce the same
|
|
10489
|
+
* results, such that repeated requests with the same `seed` and parameters should
|
|
10490
|
+
* return the same outputs. Must be used along with the same parameters including
|
|
10491
|
+
* prompt, model's state, etc..
|
|
10492
|
+
*/
|
|
10493
|
+
seed?: number;
|
|
10494
|
+
|
|
10495
|
+
/**
|
|
10496
|
+
* Body param: The sampling temperature to use. Higher values like `0.8` will make
|
|
10497
|
+
* the output more random, while lower values like `0.2` will make it more focused
|
|
10498
|
+
* and deterministic.
|
|
10499
|
+
*
|
|
10500
|
+
* We generally recommend altering this or `topP` but not both.
|
|
10501
|
+
*/
|
|
10502
|
+
temperature?: number;
|
|
10503
|
+
|
|
10504
|
+
/**
|
|
10505
|
+
* Body param: An alternative to sampling with temperature, called nucleus
|
|
10506
|
+
* sampling, where the model considers the results of the tokens with top_p
|
|
10507
|
+
* probability mass. So `0.1` means only the tokens comprising the top `10%`
|
|
10508
|
+
* probability mass are considered.
|
|
10509
|
+
*
|
|
10510
|
+
* We generally recommend altering this or `temperature` but not both.
|
|
10511
|
+
*/
|
|
10512
|
+
topP?: number;
|
|
10513
|
+
}
|
|
10514
|
+
|
|
9426
10515
|
export interface GenerateRunModelParams {
|
|
9427
10516
|
/**
|
|
9428
10517
|
* Body param: The request body for the custom generation must be retrieve from GET
|
|
@@ -9502,6 +10591,7 @@ export declare namespace Generate {
|
|
|
9502
10591
|
type GenerateDetectResponse as GenerateDetectResponse,
|
|
9503
10592
|
type GenerateEmbedResponse as GenerateEmbedResponse,
|
|
9504
10593
|
type GeneratePatchResponse as GeneratePatchResponse,
|
|
10594
|
+
type GeneratePromptResponse as GeneratePromptResponse,
|
|
9505
10595
|
type GenerateRunModelResponse as GenerateRunModelResponse,
|
|
9506
10596
|
type GenerateTranslateResponse as GenerateTranslateResponse,
|
|
9507
10597
|
type GenerateCaptionParams as GenerateCaptionParams,
|
|
@@ -9509,6 +10599,7 @@ export declare namespace Generate {
|
|
|
9509
10599
|
type GenerateDetectParams as GenerateDetectParams,
|
|
9510
10600
|
type GenerateEmbedParams as GenerateEmbedParams,
|
|
9511
10601
|
type GeneratePatchParams as GeneratePatchParams,
|
|
10602
|
+
type GeneratePromptParams as GeneratePromptParams,
|
|
9512
10603
|
type GenerateRunModelParams as GenerateRunModelParams,
|
|
9513
10604
|
type GenerateTranslateParams as GenerateTranslateParams,
|
|
9514
10605
|
};
|