@scenario-labs/sdk 3.3.1 → 3.4.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.
Files changed (142) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/client.d.mts +4 -4
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +4 -4
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs.map +1 -1
  8. package/index.d.mts +1 -1
  9. package/index.d.mts.map +1 -1
  10. package/index.d.ts +1 -1
  11. package/index.d.ts.map +1 -1
  12. package/index.js +2 -1
  13. package/index.js.map +1 -1
  14. package/index.mjs +1 -1
  15. package/index.mjs.map +1 -1
  16. package/lib/user_selection_limits.d.mts +13 -0
  17. package/lib/user_selection_limits.d.mts.map +1 -0
  18. package/lib/user_selection_limits.d.ts +13 -0
  19. package/lib/user_selection_limits.d.ts.map +1 -0
  20. package/lib/user_selection_limits.js +16 -0
  21. package/lib/user_selection_limits.js.map +1 -0
  22. package/lib/user_selection_limits.mjs +13 -0
  23. package/lib/user_selection_limits.mjs.map +1 -0
  24. package/lib/workflow_converter.d.mts +6 -0
  25. package/lib/workflow_converter.d.mts.map +1 -1
  26. package/lib/workflow_converter.d.ts +6 -0
  27. package/lib/workflow_converter.d.ts.map +1 -1
  28. package/lib/workflow_converter.js +154 -52
  29. package/lib/workflow_converter.js.map +1 -1
  30. package/lib/workflow_converter.mjs +154 -52
  31. package/lib/workflow_converter.mjs.map +1 -1
  32. package/lib/workflow_import_validator.d.mts +17 -2
  33. package/lib/workflow_import_validator.d.mts.map +1 -1
  34. package/lib/workflow_import_validator.d.ts +17 -2
  35. package/lib/workflow_import_validator.d.ts.map +1 -1
  36. package/lib/workflow_import_validator.js +100 -1
  37. package/lib/workflow_import_validator.js.map +1 -1
  38. package/lib/workflow_import_validator.mjs +99 -1
  39. package/lib/workflow_import_validator.mjs.map +1 -1
  40. package/lib/workflow_validator.d.mts +1 -1
  41. package/lib/workflow_validator.d.mts.map +1 -1
  42. package/lib/workflow_validator.d.ts +1 -1
  43. package/lib/workflow_validator.d.ts.map +1 -1
  44. package/lib/workflow_validator.js +10 -11
  45. package/lib/workflow_validator.js.map +1 -1
  46. package/lib/workflow_validator.mjs +7 -8
  47. package/lib/workflow_validator.mjs.map +1 -1
  48. package/package.json +1 -1
  49. package/resources/assets/assets.d.mts +126 -30
  50. package/resources/assets/assets.d.mts.map +1 -1
  51. package/resources/assets/assets.d.ts +126 -30
  52. package/resources/assets/assets.d.ts.map +1 -1
  53. package/resources/assets/assets.js +12 -0
  54. package/resources/assets/assets.js.map +1 -1
  55. package/resources/assets/assets.mjs +12 -0
  56. package/resources/assets/assets.mjs.map +1 -1
  57. package/resources/assets/index.d.mts +1 -1
  58. package/resources/assets/index.d.mts.map +1 -1
  59. package/resources/assets/index.d.ts +1 -1
  60. package/resources/assets/index.d.ts.map +1 -1
  61. package/resources/assets/index.js.map +1 -1
  62. package/resources/assets/index.mjs.map +1 -1
  63. package/resources/generate.d.mts +120 -9
  64. package/resources/generate.d.mts.map +1 -1
  65. package/resources/generate.d.ts +120 -9
  66. package/resources/generate.d.ts.map +1 -1
  67. package/resources/index.d.mts +2 -2
  68. package/resources/index.d.mts.map +1 -1
  69. package/resources/index.d.ts +2 -2
  70. package/resources/index.d.ts.map +1 -1
  71. package/resources/index.js.map +1 -1
  72. package/resources/index.mjs.map +1 -1
  73. package/resources/jobs.d.mts +36 -0
  74. package/resources/jobs.d.mts.map +1 -1
  75. package/resources/jobs.d.ts +36 -0
  76. package/resources/jobs.d.ts.map +1 -1
  77. package/resources/models/description.d.mts +4 -4
  78. package/resources/models/description.d.mts.map +1 -1
  79. package/resources/models/description.d.ts +4 -4
  80. package/resources/models/description.d.ts.map +1 -1
  81. package/resources/models/examples.d.mts +40 -6
  82. package/resources/models/examples.d.mts.map +1 -1
  83. package/resources/models/examples.d.ts +40 -6
  84. package/resources/models/examples.d.ts.map +1 -1
  85. package/resources/models/index.d.mts +1 -1
  86. package/resources/models/index.d.mts.map +1 -1
  87. package/resources/models/index.d.ts +1 -1
  88. package/resources/models/index.d.ts.map +1 -1
  89. package/resources/models/index.js.map +1 -1
  90. package/resources/models/index.mjs.map +1 -1
  91. package/resources/models/models.d.mts +1353 -199
  92. package/resources/models/models.d.mts.map +1 -1
  93. package/resources/models/models.d.ts +1353 -199
  94. package/resources/models/models.d.ts.map +1 -1
  95. package/resources/models/models.js +13 -0
  96. package/resources/models/models.js.map +1 -1
  97. package/resources/models/models.mjs +13 -0
  98. package/resources/models/models.mjs.map +1 -1
  99. package/resources/models/train.d.mts +36 -2
  100. package/resources/models/train.d.mts.map +1 -1
  101. package/resources/models/train.d.ts +36 -2
  102. package/resources/models/train.d.ts.map +1 -1
  103. package/resources/recommendations.d.mts +16 -5
  104. package/resources/recommendations.d.mts.map +1 -1
  105. package/resources/recommendations.d.ts +16 -5
  106. package/resources/recommendations.d.ts.map +1 -1
  107. package/resources/usages.d.mts +14 -2
  108. package/resources/usages.d.mts.map +1 -1
  109. package/resources/usages.d.ts +14 -2
  110. package/resources/usages.d.ts.map +1 -1
  111. package/resources/workflows.d.mts +152 -9
  112. package/resources/workflows.d.mts.map +1 -1
  113. package/resources/workflows.d.ts +152 -9
  114. package/resources/workflows.d.ts.map +1 -1
  115. package/resources/workflows.js +2 -3
  116. package/resources/workflows.js.map +1 -1
  117. package/resources/workflows.mjs +2 -3
  118. package/resources/workflows.mjs.map +1 -1
  119. package/src/client.ts +8 -0
  120. package/src/index.ts +1 -0
  121. package/src/lib/user_selection_limits.ts +14 -0
  122. package/src/lib/workflow_converter.ts +173 -54
  123. package/src/lib/workflow_import_validator.ts +116 -1
  124. package/src/lib/workflow_validator.ts +12 -8
  125. package/src/resources/assets/assets.ts +164 -4
  126. package/src/resources/assets/index.ts +2 -0
  127. package/src/resources/generate.ts +142 -0
  128. package/src/resources/index.ts +4 -0
  129. package/src/resources/jobs.ts +42 -0
  130. package/src/resources/models/description.ts +6 -0
  131. package/src/resources/models/examples.ts +48 -0
  132. package/src/resources/models/index.ts +2 -0
  133. package/src/resources/models/models.ts +1610 -114
  134. package/src/resources/models/train.ts +42 -0
  135. package/src/resources/recommendations.ts +18 -3
  136. package/src/resources/usages.ts +16 -0
  137. package/src/resources/workflows.ts +176 -9
  138. package/src/version.ts +1 -1
  139. package/version.d.mts +1 -1
  140. package/version.d.ts +1 -1
  141. package/version.js +1 -1
  142. package/version.mjs +1 -1
@@ -65,6 +65,13 @@ export declare class Models extends APIResource {
65
65
  * Get multiple models by their `modelIds`
66
66
  */
67
67
  getBulk(params: ModelGetBulkParams, options?: RequestOptions): APIPromise<ModelGetBulkResponse>;
68
+ /**
69
+ * Restore a model deleted in the last 30 days, back to the status it had (an
70
+ * interrupted training comes back as `training-canceled`). Tags and collections
71
+ * are not restored. Max plan and above only. Returns 400 if the model is not
72
+ * deleted, and 410 if it was deleted more than 30 days ago or permanently.
73
+ */
74
+ restore(modelID: string, params?: ModelRestoreParams | null | undefined, options?: RequestOptions): APIPromise<ModelRestoreResponse>;
68
75
  /**
69
76
  * Transfer (with a copy or a full ownership change) a model to a new owner,
70
77
  * including all of its training images
@@ -89,7 +96,7 @@ export declare namespace ModelCreateResponse {
89
96
  * List of model capabilities (example: ["txt2img", "img2img",
90
97
  * "txt2img_ip_adapter", ...])
91
98
  */
92
- capabilities: Array<'3d23d' | 'audio2audio' | 'audio2txt' | 'audio2video' | 'controlnet' | 'controlnet_img2img' | 'controlnet_inpaint' | 'controlnet_inpaint_ip_adapter' | 'controlnet_ip_adapter' | 'controlnet_reference' | 'controlnet_texture' | 'img23d' | 'img2img' | 'img2img_ip_adapter' | 'img2img_texture' | 'img2txt' | 'img2video' | 'inpaint' | 'inpaint_ip_adapter' | 'outpaint' | 'reference' | 'reference_texture' | 'txt23d' | 'txt2audio' | 'txt2img' | 'txt2img_ip_adapter' | 'txt2img_texture' | 'txt2txt' | 'txt2video' | 'video23d' | 'video2audio' | 'video2img' | 'video2video'>;
99
+ capabilities: Array<'3d23d' | 'audio2audio' | 'audio2txt' | 'audio2video' | 'controlnet' | 'controlnet_img2img' | 'controlnet_inpaint' | 'controlnet_inpaint_ip_adapter' | 'controlnet_ip_adapter' | 'controlnet_reference' | 'controlnet_texture' | 'img23d' | 'img2img' | 'img2img_ip_adapter' | 'img2img_texture' | 'img2txt' | 'img2video' | 'inpaint' | 'inpaint_ip_adapter' | 'outpaint' | 'reference' | 'reference_texture' | 'txt23d' | 'txt2audio' | 'txt2img' | 'txt2img_ip_adapter' | 'txt2img_texture' | 'txt2txt' | 'txt2video' | 'video23d' | 'video2audio' | 'video2img' | 'video2txt' | 'video2video'>;
93
100
  /**
94
101
  * A list of CollectionId this model belongs to
95
102
  */
@@ -158,6 +165,11 @@ export declare namespace ModelCreateResponse {
158
165
  * The concepts is required for the type model: composition
159
166
  */
160
167
  concepts?: Array<Model.Concept>;
168
+ /**
169
+ * The model deletion date as an ISO string (example: "2023-02-03T11:19:41.579Z").
170
+ * Only set on deleted models, listed with `status=deleted`.
171
+ */
172
+ deletedAt?: string;
161
173
  /**
162
174
  * When true, credits spent on a generation with this model are not automatically
163
175
  * refunded if the generation fails. Absent or false means failed generations are
@@ -436,6 +448,12 @@ export declare namespace ModelCreateResponse {
436
448
  * The minimum allowed value. Only available for \`number\` and array input types.
437
449
  */
438
450
  min?: number;
451
+ /**
452
+ * The minimum allowed media duration in seconds. Only applies to \`file\` and
453
+ * \`file_array\` input types for video and audio assets. Validated against
454
+ * \`asset.properties.duration\` at job creation time.
455
+ */
456
+ minDuration?: number;
439
457
  /**
440
458
  * The minimum allowed length for \`string\` and \`model\` inputs, in characters.
441
459
  * For the array types (\`string_array\`, \`model_array\`) it bounds the NUMBER OF
@@ -1135,7 +1153,7 @@ export declare namespace ModelRetrieveResponse {
1135
1153
  * List of model capabilities (example: ["txt2img", "img2img",
1136
1154
  * "txt2img_ip_adapter", ...])
1137
1155
  */
1138
- capabilities: Array<'3d23d' | 'audio2audio' | 'audio2txt' | 'audio2video' | 'controlnet' | 'controlnet_img2img' | 'controlnet_inpaint' | 'controlnet_inpaint_ip_adapter' | 'controlnet_ip_adapter' | 'controlnet_reference' | 'controlnet_texture' | 'img23d' | 'img2img' | 'img2img_ip_adapter' | 'img2img_texture' | 'img2txt' | 'img2video' | 'inpaint' | 'inpaint_ip_adapter' | 'outpaint' | 'reference' | 'reference_texture' | 'txt23d' | 'txt2audio' | 'txt2img' | 'txt2img_ip_adapter' | 'txt2img_texture' | 'txt2txt' | 'txt2video' | 'video23d' | 'video2audio' | 'video2img' | 'video2video'>;
1156
+ capabilities: Array<'3d23d' | 'audio2audio' | 'audio2txt' | 'audio2video' | 'controlnet' | 'controlnet_img2img' | 'controlnet_inpaint' | 'controlnet_inpaint_ip_adapter' | 'controlnet_ip_adapter' | 'controlnet_reference' | 'controlnet_texture' | 'img23d' | 'img2img' | 'img2img_ip_adapter' | 'img2img_texture' | 'img2txt' | 'img2video' | 'inpaint' | 'inpaint_ip_adapter' | 'outpaint' | 'reference' | 'reference_texture' | 'txt23d' | 'txt2audio' | 'txt2img' | 'txt2img_ip_adapter' | 'txt2img_texture' | 'txt2txt' | 'txt2video' | 'video23d' | 'video2audio' | 'video2img' | 'video2txt' | 'video2video'>;
1139
1157
  /**
1140
1158
  * A list of CollectionId this model belongs to
1141
1159
  */
@@ -1204,6 +1222,11 @@ export declare namespace ModelRetrieveResponse {
1204
1222
  * The concepts is required for the type model: composition
1205
1223
  */
1206
1224
  concepts?: Array<Model.Concept>;
1225
+ /**
1226
+ * The model deletion date as an ISO string (example: "2023-02-03T11:19:41.579Z").
1227
+ * Only set on deleted models, listed with `status=deleted`.
1228
+ */
1229
+ deletedAt?: string;
1207
1230
  /**
1208
1231
  * When true, credits spent on a generation with this model are not automatically
1209
1232
  * refunded if the generation fails. Absent or false means failed generations are
@@ -1482,6 +1505,12 @@ export declare namespace ModelRetrieveResponse {
1482
1505
  * The minimum allowed value. Only available for \`number\` and array input types.
1483
1506
  */
1484
1507
  min?: number;
1508
+ /**
1509
+ * The minimum allowed media duration in seconds. Only applies to \`file\` and
1510
+ * \`file_array\` input types for video and audio assets. Validated against
1511
+ * \`asset.properties.duration\` at job creation time.
1512
+ */
1513
+ minDuration?: number;
1485
1514
  /**
1486
1515
  * The minimum allowed length for \`string\` and \`model\` inputs, in characters.
1487
1516
  * For the array types (\`string_array\`, \`model_array\`) it bounds the NUMBER OF
@@ -2181,7 +2210,7 @@ export declare namespace ModelUpdateResponse {
2181
2210
  * List of model capabilities (example: ["txt2img", "img2img",
2182
2211
  * "txt2img_ip_adapter", ...])
2183
2212
  */
2184
- capabilities: Array<'3d23d' | 'audio2audio' | 'audio2txt' | 'audio2video' | 'controlnet' | 'controlnet_img2img' | 'controlnet_inpaint' | 'controlnet_inpaint_ip_adapter' | 'controlnet_ip_adapter' | 'controlnet_reference' | 'controlnet_texture' | 'img23d' | 'img2img' | 'img2img_ip_adapter' | 'img2img_texture' | 'img2txt' | 'img2video' | 'inpaint' | 'inpaint_ip_adapter' | 'outpaint' | 'reference' | 'reference_texture' | 'txt23d' | 'txt2audio' | 'txt2img' | 'txt2img_ip_adapter' | 'txt2img_texture' | 'txt2txt' | 'txt2video' | 'video23d' | 'video2audio' | 'video2img' | 'video2video'>;
2213
+ capabilities: Array<'3d23d' | 'audio2audio' | 'audio2txt' | 'audio2video' | 'controlnet' | 'controlnet_img2img' | 'controlnet_inpaint' | 'controlnet_inpaint_ip_adapter' | 'controlnet_ip_adapter' | 'controlnet_reference' | 'controlnet_texture' | 'img23d' | 'img2img' | 'img2img_ip_adapter' | 'img2img_texture' | 'img2txt' | 'img2video' | 'inpaint' | 'inpaint_ip_adapter' | 'outpaint' | 'reference' | 'reference_texture' | 'txt23d' | 'txt2audio' | 'txt2img' | 'txt2img_ip_adapter' | 'txt2img_texture' | 'txt2txt' | 'txt2video' | 'video23d' | 'video2audio' | 'video2img' | 'video2txt' | 'video2video'>;
2185
2214
  /**
2186
2215
  * A list of CollectionId this model belongs to
2187
2216
  */
@@ -2250,6 +2279,11 @@ export declare namespace ModelUpdateResponse {
2250
2279
  * The concepts is required for the type model: composition
2251
2280
  */
2252
2281
  concepts?: Array<Model.Concept>;
2282
+ /**
2283
+ * The model deletion date as an ISO string (example: "2023-02-03T11:19:41.579Z").
2284
+ * Only set on deleted models, listed with `status=deleted`.
2285
+ */
2286
+ deletedAt?: string;
2253
2287
  /**
2254
2288
  * When true, credits spent on a generation with this model are not automatically
2255
2289
  * refunded if the generation fails. Absent or false means failed generations are
@@ -2528,6 +2562,12 @@ export declare namespace ModelUpdateResponse {
2528
2562
  * The minimum allowed value. Only available for \`number\` and array input types.
2529
2563
  */
2530
2564
  min?: number;
2565
+ /**
2566
+ * The minimum allowed media duration in seconds. Only applies to \`file\` and
2567
+ * \`file_array\` input types for video and audio assets. Validated against
2568
+ * \`asset.properties.duration\` at job creation time.
2569
+ */
2570
+ minDuration?: number;
2531
2571
  /**
2532
2572
  * The minimum allowed length for \`string\` and \`model\` inputs, in characters.
2533
2573
  * For the array types (\`string_array\`, \`model_array\`) it bounds the NUMBER OF
@@ -3223,7 +3263,7 @@ export interface ModelListResponse {
3223
3263
  * List of model capabilities (example: ["txt2img", "img2img",
3224
3264
  * "txt2img_ip_adapter", ...])
3225
3265
  */
3226
- capabilities: Array<'3d23d' | 'audio2audio' | 'audio2txt' | 'audio2video' | 'controlnet' | 'controlnet_img2img' | 'controlnet_inpaint' | 'controlnet_inpaint_ip_adapter' | 'controlnet_ip_adapter' | 'controlnet_reference' | 'controlnet_texture' | 'img23d' | 'img2img' | 'img2img_ip_adapter' | 'img2img_texture' | 'img2txt' | 'img2video' | 'inpaint' | 'inpaint_ip_adapter' | 'outpaint' | 'reference' | 'reference_texture' | 'txt23d' | 'txt2audio' | 'txt2img' | 'txt2img_ip_adapter' | 'txt2img_texture' | 'txt2txt' | 'txt2video' | 'video23d' | 'video2audio' | 'video2img' | 'video2video'>;
3266
+ capabilities: Array<'3d23d' | 'audio2audio' | 'audio2txt' | 'audio2video' | 'controlnet' | 'controlnet_img2img' | 'controlnet_inpaint' | 'controlnet_inpaint_ip_adapter' | 'controlnet_ip_adapter' | 'controlnet_reference' | 'controlnet_texture' | 'img23d' | 'img2img' | 'img2img_ip_adapter' | 'img2img_texture' | 'img2txt' | 'img2video' | 'inpaint' | 'inpaint_ip_adapter' | 'outpaint' | 'reference' | 'reference_texture' | 'txt23d' | 'txt2audio' | 'txt2img' | 'txt2img_ip_adapter' | 'txt2img_texture' | 'txt2txt' | 'txt2video' | 'video23d' | 'video2audio' | 'video2img' | 'video2txt' | 'video2video'>;
3227
3267
  /**
3228
3268
  * A list of CollectionId this model belongs to
3229
3269
  */
@@ -3292,6 +3332,11 @@ export interface ModelListResponse {
3292
3332
  * The concepts is required for the type model: composition
3293
3333
  */
3294
3334
  concepts?: Array<ModelListResponse.Concept>;
3335
+ /**
3336
+ * The model deletion date as an ISO string (example: "2023-02-03T11:19:41.579Z").
3337
+ * Only set on deleted models, listed with `status=deleted`.
3338
+ */
3339
+ deletedAt?: string;
3295
3340
  /**
3296
3341
  * When true, credits spent on a generation with this model are not automatically
3297
3342
  * refunded if the generation fails. Absent or false means failed generations are
@@ -3570,6 +3615,12 @@ export declare namespace ModelListResponse {
3570
3615
  * The minimum allowed value. Only available for \`number\` and array input types.
3571
3616
  */
3572
3617
  min?: number;
3618
+ /**
3619
+ * The minimum allowed media duration in seconds. Only applies to \`file\` and
3620
+ * \`file_array\` input types for video and audio assets. Validated against
3621
+ * \`asset.properties.duration\` at job creation time.
3622
+ */
3623
+ minDuration?: number;
3573
3624
  /**
3574
3625
  * The minimum allowed length for \`string\` and \`model\` inputs, in characters.
3575
3626
  * For the array types (\`string_array\`, \`model_array\`) it bounds the NUMBER OF
@@ -4269,7 +4320,7 @@ export declare namespace ModelCopyResponse {
4269
4320
  * List of model capabilities (example: ["txt2img", "img2img",
4270
4321
  * "txt2img_ip_adapter", ...])
4271
4322
  */
4272
- capabilities: Array<'3d23d' | 'audio2audio' | 'audio2txt' | 'audio2video' | 'controlnet' | 'controlnet_img2img' | 'controlnet_inpaint' | 'controlnet_inpaint_ip_adapter' | 'controlnet_ip_adapter' | 'controlnet_reference' | 'controlnet_texture' | 'img23d' | 'img2img' | 'img2img_ip_adapter' | 'img2img_texture' | 'img2txt' | 'img2video' | 'inpaint' | 'inpaint_ip_adapter' | 'outpaint' | 'reference' | 'reference_texture' | 'txt23d' | 'txt2audio' | 'txt2img' | 'txt2img_ip_adapter' | 'txt2img_texture' | 'txt2txt' | 'txt2video' | 'video23d' | 'video2audio' | 'video2img' | 'video2video'>;
4323
+ capabilities: Array<'3d23d' | 'audio2audio' | 'audio2txt' | 'audio2video' | 'controlnet' | 'controlnet_img2img' | 'controlnet_inpaint' | 'controlnet_inpaint_ip_adapter' | 'controlnet_ip_adapter' | 'controlnet_reference' | 'controlnet_texture' | 'img23d' | 'img2img' | 'img2img_ip_adapter' | 'img2img_texture' | 'img2txt' | 'img2video' | 'inpaint' | 'inpaint_ip_adapter' | 'outpaint' | 'reference' | 'reference_texture' | 'txt23d' | 'txt2audio' | 'txt2img' | 'txt2img_ip_adapter' | 'txt2img_texture' | 'txt2txt' | 'txt2video' | 'video23d' | 'video2audio' | 'video2img' | 'video2txt' | 'video2video'>;
4273
4324
  /**
4274
4325
  * A list of CollectionId this model belongs to
4275
4326
  */
@@ -4338,6 +4389,11 @@ export declare namespace ModelCopyResponse {
4338
4389
  * The concepts is required for the type model: composition
4339
4390
  */
4340
4391
  concepts?: Array<Model.Concept>;
4392
+ /**
4393
+ * The model deletion date as an ISO string (example: "2023-02-03T11:19:41.579Z").
4394
+ * Only set on deleted models, listed with `status=deleted`.
4395
+ */
4396
+ deletedAt?: string;
4341
4397
  /**
4342
4398
  * When true, credits spent on a generation with this model are not automatically
4343
4399
  * refunded if the generation fails. Absent or false means failed generations are
@@ -4616,6 +4672,12 @@ export declare namespace ModelCopyResponse {
4616
4672
  * The minimum allowed value. Only available for \`number\` and array input types.
4617
4673
  */
4618
4674
  min?: number;
4675
+ /**
4676
+ * The minimum allowed media duration in seconds. Only applies to \`file\` and
4677
+ * \`file_array\` input types for video and audio assets. Validated against
4678
+ * \`asset.properties.duration\` at job creation time.
4679
+ */
4680
+ minDuration?: number;
4619
4681
  /**
4620
4682
  * The minimum allowed length for \`string\` and \`model\` inputs, in characters.
4621
4683
  * For the array types (\`string_array\`, \`model_array\`) it bounds the NUMBER OF
@@ -5339,7 +5401,7 @@ export declare namespace ModelGetBulkResponse {
5339
5401
  * List of model capabilities (example: ["txt2img", "img2img",
5340
5402
  * "txt2img_ip_adapter", ...])
5341
5403
  */
5342
- capabilities?: Array<'3d23d' | 'audio2audio' | 'audio2txt' | 'audio2video' | 'controlnet' | 'controlnet_img2img' | 'controlnet_inpaint' | 'controlnet_inpaint_ip_adapter' | 'controlnet_ip_adapter' | 'controlnet_reference' | 'controlnet_texture' | 'img23d' | 'img2img' | 'img2img_ip_adapter' | 'img2img_texture' | 'img2txt' | 'img2video' | 'inpaint' | 'inpaint_ip_adapter' | 'outpaint' | 'reference' | 'reference_texture' | 'txt23d' | 'txt2audio' | 'txt2img' | 'txt2img_ip_adapter' | 'txt2img_texture' | 'txt2txt' | 'txt2video' | 'video23d' | 'video2audio' | 'video2img' | 'video2video'>;
5404
+ capabilities?: Array<'3d23d' | 'audio2audio' | 'audio2txt' | 'audio2video' | 'controlnet' | 'controlnet_img2img' | 'controlnet_inpaint' | 'controlnet_inpaint_ip_adapter' | 'controlnet_ip_adapter' | 'controlnet_reference' | 'controlnet_texture' | 'img23d' | 'img2img' | 'img2img_ip_adapter' | 'img2img_texture' | 'img2txt' | 'img2video' | 'inpaint' | 'inpaint_ip_adapter' | 'outpaint' | 'reference' | 'reference_texture' | 'txt23d' | 'txt2audio' | 'txt2img' | 'txt2img_ip_adapter' | 'txt2img_texture' | 'txt2txt' | 'txt2video' | 'video23d' | 'video2audio' | 'video2img' | 'video2txt' | 'video2video'>;
5343
5405
  /**
5344
5406
  * The class of the model
5345
5407
  */
@@ -5366,6 +5428,11 @@ export declare namespace ModelGetBulkResponse {
5366
5428
  * /generate/custom/{modelId} endpoint
5367
5429
  */
5368
5430
  custom?: boolean;
5431
+ /**
5432
+ * The model deletion date as an ISO string (example: "2023-02-03T11:19:41.579Z").
5433
+ * Only set on deleted models, listed with `status=deleted`.
5434
+ */
5435
+ deletedAt?: string;
5369
5436
  /**
5370
5437
  * When true, credits spent on a generation with this model are not automatically
5371
5438
  * refunded if the generation fails. Absent or false means failed generations are
@@ -5669,6 +5736,12 @@ export declare namespace ModelGetBulkResponse {
5669
5736
  * The minimum allowed value. Only available for \`number\` and array input types.
5670
5737
  */
5671
5738
  min?: number;
5739
+ /**
5740
+ * The minimum allowed media duration in seconds. Only applies to \`file\` and
5741
+ * \`file_array\` input types for video and audio assets. Validated against
5742
+ * \`asset.properties.duration\` at job creation time.
5743
+ */
5744
+ minDuration?: number;
5672
5745
  /**
5673
5746
  * The minimum allowed length for \`string\` and \`model\` inputs, in characters.
5674
5747
  * For the array types (\`string_array\`, \`model_array\`) it bounds the NUMBER OF
@@ -6355,10 +6428,10 @@ export declare namespace ModelGetBulkResponse {
6355
6428
  }
6356
6429
  }
6357
6430
  }
6358
- export interface ModelTransferResponse {
6359
- model: ModelTransferResponse.Model;
6431
+ export interface ModelRestoreResponse {
6432
+ model: ModelRestoreResponse.Model;
6360
6433
  }
6361
- export declare namespace ModelTransferResponse {
6434
+ export declare namespace ModelRestoreResponse {
6362
6435
  interface Model {
6363
6436
  /**
6364
6437
  * The model ID (example: "model_eyVcnFJcR92BxBkz7N6g5w")
@@ -6368,7 +6441,7 @@ export declare namespace ModelTransferResponse {
6368
6441
  * List of model capabilities (example: ["txt2img", "img2img",
6369
6442
  * "txt2img_ip_adapter", ...])
6370
6443
  */
6371
- capabilities: Array<'3d23d' | 'audio2audio' | 'audio2txt' | 'audio2video' | 'controlnet' | 'controlnet_img2img' | 'controlnet_inpaint' | 'controlnet_inpaint_ip_adapter' | 'controlnet_ip_adapter' | 'controlnet_reference' | 'controlnet_texture' | 'img23d' | 'img2img' | 'img2img_ip_adapter' | 'img2img_texture' | 'img2txt' | 'img2video' | 'inpaint' | 'inpaint_ip_adapter' | 'outpaint' | 'reference' | 'reference_texture' | 'txt23d' | 'txt2audio' | 'txt2img' | 'txt2img_ip_adapter' | 'txt2img_texture' | 'txt2txt' | 'txt2video' | 'video23d' | 'video2audio' | 'video2img' | 'video2video'>;
6444
+ capabilities: Array<'3d23d' | 'audio2audio' | 'audio2txt' | 'audio2video' | 'controlnet' | 'controlnet_img2img' | 'controlnet_inpaint' | 'controlnet_inpaint_ip_adapter' | 'controlnet_ip_adapter' | 'controlnet_reference' | 'controlnet_texture' | 'img23d' | 'img2img' | 'img2img_ip_adapter' | 'img2img_texture' | 'img2txt' | 'img2video' | 'inpaint' | 'inpaint_ip_adapter' | 'outpaint' | 'reference' | 'reference_texture' | 'txt23d' | 'txt2audio' | 'txt2img' | 'txt2img_ip_adapter' | 'txt2img_texture' | 'txt2txt' | 'txt2video' | 'video23d' | 'video2audio' | 'video2img' | 'video2txt' | 'video2video'>;
6372
6445
  /**
6373
6446
  * A list of CollectionId this model belongs to
6374
6447
  */
@@ -6437,6 +6510,11 @@ export declare namespace ModelTransferResponse {
6437
6510
  * The concepts is required for the type model: composition
6438
6511
  */
6439
6512
  concepts?: Array<Model.Concept>;
6513
+ /**
6514
+ * The model deletion date as an ISO string (example: "2023-02-03T11:19:41.579Z").
6515
+ * Only set on deleted models, listed with `status=deleted`.
6516
+ */
6517
+ deletedAt?: string;
6440
6518
  /**
6441
6519
  * When true, credits spent on a generation with this model are not automatically
6442
6520
  * refunded if the generation fails. Absent or false means failed generations are
@@ -6715,6 +6793,12 @@ export declare namespace ModelTransferResponse {
6715
6793
  * The minimum allowed value. Only available for \`number\` and array input types.
6716
6794
  */
6717
6795
  min?: number;
6796
+ /**
6797
+ * The minimum allowed media duration in seconds. Only applies to \`file\` and
6798
+ * \`file_array\` input types for video and audio assets. Validated against
6799
+ * \`asset.properties.duration\` at job creation time.
6800
+ */
6801
+ minDuration?: number;
6718
6802
  /**
6719
6803
  * The minimum allowed length for \`string\` and \`model\` inputs, in characters.
6720
6804
  * For the array types (\`string_array\`, \`model_array\`) it bounds the NUMBER OF
@@ -7401,213 +7485,1270 @@ export declare namespace ModelTransferResponse {
7401
7485
  }
7402
7486
  }
7403
7487
  }
7404
- export interface ModelUpdateTagsResponse {
7405
- /**
7406
- * The list of added tags
7407
- */
7408
- added: Array<string>;
7409
- /**
7410
- * The list of deleted tags
7411
- */
7412
- deleted: Array<string>;
7413
- }
7414
- export interface ModelCreateParams {
7415
- /**
7416
- * Query param: If set to true, returns the original asset without transformation
7417
- */
7418
- originalAssets?: boolean;
7419
- /**
7420
- * Query param: The projectId used for ownership resource management. Either to
7421
- * assert ownership or to set the owner of the resource(s)
7422
- */
7423
- projectId?: string;
7424
- /**
7425
- * Body param: The ID of the base model to use as a starting point for the training
7426
- * (example: "flux.1-dev")
7427
- *
7428
- * Value is automatically set based on the model's type. In case of doubt leave it
7429
- * empty.
7430
- */
7431
- baseModelId?: string;
7432
- /**
7433
- * Body param: The slug of the class you want to use (ex:
7434
- * "characters-npcs-mobs-characters"). Set to null to unset the class
7435
- */
7436
- classSlug?: string;
7437
- /**
7438
- * Body param: List of collection IDs to add the model to
7439
- */
7440
- collectionIds?: Array<string>;
7441
- /**
7442
- * Body param: The concepts is required for composition models. With one or more
7443
- * loras
7444
- *
7445
- * Only applicable to Flux based models.
7446
- */
7447
- concepts?: Array<ModelCreateParams.Concept>;
7448
- /**
7449
- * Body param: The model's name (ex: "Cinematic Realism").
7450
- *
7451
- * If not set, the model's name will be automatically generated when starting
7452
- * training based on training data.
7453
- */
7454
- name?: string;
7455
- /**
7456
- * Body param: The model's short description (ex: "This model generates highly
7457
- * detailed cinematic scenes.").
7458
- *
7459
- * If not set, the model's short description will be automatically generated when
7460
- * starting training based on training data.
7461
- */
7462
- shortDescription?: string;
7463
- /**
7464
- * Body param: The model's type (ex: "flux.1-lora").
7465
- *
7466
- * The type can only be changed if the model has the "new" status.
7467
- */
7468
- type?: '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' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora';
7488
+ export interface ModelTransferResponse {
7489
+ model: ModelTransferResponse.Model;
7469
7490
  }
7470
- export declare namespace ModelCreateParams {
7471
- interface Concept {
7491
+ export declare namespace ModelTransferResponse {
7492
+ interface Model {
7472
7493
  /**
7473
7494
  * The model ID (example: "model_eyVcnFJcR92BxBkz7N6g5w")
7474
7495
  */
7475
- modelId: string;
7496
+ id: string;
7476
7497
  /**
7477
- * The scale of the model (example: 1.0) For Flux Kontext Prompt Editing, the scale
7478
- * is between 0 and 2.
7498
+ * List of model capabilities (example: ["txt2img", "img2img",
7499
+ * "txt2img_ip_adapter", ...])
7479
7500
  */
7480
- scale: number;
7501
+ capabilities: Array<'3d23d' | 'audio2audio' | 'audio2txt' | 'audio2video' | 'controlnet' | 'controlnet_img2img' | 'controlnet_inpaint' | 'controlnet_inpaint_ip_adapter' | 'controlnet_ip_adapter' | 'controlnet_reference' | 'controlnet_texture' | 'img23d' | 'img2img' | 'img2img_ip_adapter' | 'img2img_texture' | 'img2txt' | 'img2video' | 'inpaint' | 'inpaint_ip_adapter' | 'outpaint' | 'reference' | 'reference_texture' | 'txt23d' | 'txt2audio' | 'txt2img' | 'txt2img_ip_adapter' | 'txt2img_texture' | 'txt2txt' | 'txt2video' | 'video23d' | 'video2audio' | 'video2img' | 'video2txt' | 'video2video'>;
7481
7502
  /**
7482
- * The epoch of the model (example: "000001") Only available for Flux Lora Trained
7483
- * models
7503
+ * A list of CollectionId this model belongs to
7484
7504
  */
7485
- modelEpoch?: string;
7486
- }
7487
- }
7488
- export interface ModelRetrieveParams {
7489
- /**
7490
- * If set to true, returns the original asset without transformation
7491
- */
7492
- originalAssets?: boolean;
7493
- /**
7494
- * The projectId used for ownership resource management. Either to assert ownership
7495
- * or to set the owner of the resource(s)
7496
- */
7497
- projectId?: string;
7498
- }
7499
- export interface ModelUpdateParams {
7500
- /**
7501
- * Query param: If set to true, returns the original asset without transformation
7502
- */
7503
- originalAssets?: boolean;
7504
- /**
7505
- * Query param: The projectId used for ownership resource management. Either to
7506
- * assert ownership or to set the owner of the resource(s)
7507
- */
7508
- projectId?: string;
7509
- /**
7510
- * Body param: The slug of the class you want to use (ex:
7511
- * "characters-npcs-mobs-characters"). Set to null to unset the class
7512
- */
7513
- classSlug?: string;
7514
- /**
7515
- * Body param: The concepts is required for composition models. With one or more
7516
- * loras
7517
- *
7518
- * Only applicable to Flux based models.
7519
- */
7520
- concepts?: Array<ModelUpdateParams.Concept>;
7521
- /**
7522
- * Body param: The epoch of the model. Only available for flux.1-lora and
7523
- * flux.1-kontext-lora based models.
7524
- *
7525
- * The epoch can only be set if the model has epochs and is in status "trained".
7526
- *
7527
- * The default epoch (if not set) is the final model epoch (latest).
7528
- *
7529
- * Set to null to unset the epoch.
7530
- */
7531
- epoch?: string;
7532
- /**
7533
- * Body param: The model's name (ex: "Cinematic Realism").
7534
- *
7535
- * If not set, the model's name will be automatically generated when starting
7536
- * training based on training data.
7537
- */
7538
- name?: string;
7539
- /**
7540
- * Body param: Add a negative prompt embedding to every model's generation
7541
- */
7542
- negativePromptEmbedding?: string;
7543
- /**
7544
- * Body param: The parameters to use for the model's training
7545
- */
7546
- parameters?: ModelUpdateParams.Parameters;
7547
- /**
7548
- * Body param: Add a prompt embedding to every model's generation
7549
- */
7550
- promptEmbedding?: string;
7551
- /**
7552
- * Body param: The model's short description (ex: "This model generates highly
7553
- * detailed cinematic scenes.").
7554
- *
7555
- * If not set, the model's short description will be automatically generated when
7556
- * starting training based on training data.
7557
- */
7558
- shortDescription?: string;
7559
- /**
7560
- * Body param: The AssetId of the image you want to use as a thumbnail for the
7561
- * model (example: "asset_GTrL3mq4SXWyMxkOHRxlpw"). Set to null to unset the
7562
- * thumbnail
7563
- */
7564
- thumbnail?: string;
7565
- /**
7566
- * Body param: The model's type (ex: "flux.1-lora").
7567
- *
7568
- * The type can only be changed if the model has the "new" status.
7569
- */
7570
- type?: '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' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora';
7571
- }
7572
- export declare namespace ModelUpdateParams {
7573
- interface Concept {
7505
+ collectionIds: Array<string>;
7574
7506
  /**
7575
- * The model ID (example: "model_eyVcnFJcR92BxBkz7N6g5w")
7507
+ * The model creation date as an ISO string (example: "2023-02-03T11:19:41.579Z")
7576
7508
  */
7577
- modelId: string;
7509
+ createdAt: string;
7578
7510
  /**
7579
- * The scale of the model (example: 1.0) For Flux Kontext Prompt Editing, the scale
7580
- * is between 0 and 2.
7511
+ * Whether the model is a custom model and can be used only with POST
7512
+ * /generate/custom/{modelId} endpoint
7581
7513
  */
7582
- scale: number;
7514
+ custom: boolean;
7583
7515
  /**
7584
- * The epoch of the model (example: "000001") Only available for Flux Lora Trained
7585
- * models
7516
+ * List of all example asset IDs setup by the model owner
7586
7517
  */
7587
- modelEpoch?: string;
7588
- }
7589
- /**
7590
- * The parameters to use for the model's training
7591
- */
7592
- interface Parameters {
7518
+ exampleAssetIds: Array<string>;
7593
7519
  /**
7594
- * Age group of the voice (for professional cloning)
7595
- *
7596
- * Only available for ElevenLabs voice training
7520
+ * The privacy of the model (default: private)
7597
7521
  */
7598
- age?: string;
7522
+ privacy: 'private' | 'public' | 'unlisted';
7599
7523
  /**
7600
- * The batch size Less steps, and will increase the learning rate
7601
- *
7602
- * Only available for Flux LoRA training
7524
+ * The source of the model
7603
7525
  */
7604
- batchSize?: number;
7526
+ source: 'civitai' | 'huggingface' | 'other' | 'scenario';
7605
7527
  /**
7606
- * The prompt to specify images in the same class as provided instance images
7607
- *
7608
- * Deprecated legacy training parameter.
7528
+ * The model status
7609
7529
  */
7610
- classPrompt?: string;
7530
+ status: 'copying' | 'failed' | 'new' | 'trained' | 'training' | 'training-canceled';
7531
+ /**
7532
+ * The associated tags (example: ["sci-fi", "landscape"])
7533
+ */
7534
+ tags: Array<string>;
7535
+ /**
7536
+ * The total number of training images
7537
+ */
7538
+ trainingImagesNumber: number;
7539
+ /**
7540
+ * The model type (example: "flux.1-lora")
7541
+ */
7542
+ type: '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' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora';
7543
+ /**
7544
+ * The model last update date as an ISO string (example:
7545
+ * "2023-02-03T11:19:41.579Z")
7546
+ */
7547
+ updatedAt: string;
7548
+ /**
7549
+ * The access restrictions of the model 0: Free plan 25: Starter plan 50: Pro plan
7550
+ * 75: Max plan 100: Enterprise plan
7551
+ */
7552
+ accessRestrictions?: 0 | 100 | 25 | 50 | 75;
7553
+ /**
7554
+ * The author user ID (example: "user_VFhihHKMRZyDDnZAJwLb2Q")
7555
+ */
7556
+ authorId?: string;
7557
+ /**
7558
+ * The class of the model
7559
+ */
7560
+ class?: Model.Class;
7561
+ /**
7562
+ * List of base model IDs compliant with the model (example: ["flux.1-dev",
7563
+ * "flux.1-schnell"]) This attribute is mainly used for Flux LoRA models
7564
+ */
7565
+ compliantModelIds?: Array<string>;
7566
+ /**
7567
+ * The concepts is required for the type model: composition
7568
+ */
7569
+ concepts?: Array<Model.Concept>;
7570
+ /**
7571
+ * The model deletion date as an ISO string (example: "2023-02-03T11:19:41.579Z").
7572
+ * Only set on deleted models, listed with `status=deleted`.
7573
+ */
7574
+ deletedAt?: string;
7575
+ /**
7576
+ * When true, credits spent on a generation with this model are not automatically
7577
+ * refunded if the generation fails. Absent or false means failed generations are
7578
+ * refunded as usual.
7579
+ */
7580
+ disableRefund?: boolean;
7581
+ /**
7582
+ * The epoch of the model. Only available for Flux Lora Trained models. If not set,
7583
+ * uses the final model epoch (latest)
7584
+ */
7585
+ epoch?: string;
7586
+ /**
7587
+ * The epochs of the model. Only available for Flux Lora Trained models.
7588
+ */
7589
+ epochs?: Array<Model.Epoch>;
7590
+ /**
7591
+ * The inputs of the model. Only used for custom models. To retrieve this list, get
7592
+ * it by modelId with GET /models/{modelId}
7593
+ */
7594
+ inputs?: Array<Model.Input>;
7595
+ /**
7596
+ * The ID of the job that trained the model, returned to the model owner only
7597
+ * (example: "job_ocZCnG1Df35XRL1QyCZSRxAG8")
7598
+ */
7599
+ jobId?: string;
7600
+ /**
7601
+ * The model keyword, this is a legacy parameter, please use conceptPrompt in
7602
+ * parameters
7603
+ */
7604
+ modelKeyword?: string;
7605
+ /**
7606
+ * The model name (example: "Cinematic Realism")
7607
+ */
7608
+ name?: string;
7609
+ /**
7610
+ * Fine-tune the model's inferences with negative prompt embedding
7611
+ */
7612
+ negativePromptEmbedding?: string;
7613
+ /**
7614
+ * The owner ID (example: "team_VFhihHKMRZyDDnZAJwLb2Q")
7615
+ */
7616
+ ownerId?: string;
7617
+ /**
7618
+ * The parameters of the model
7619
+ */
7620
+ parameters?: Model.Parameters;
7621
+ /**
7622
+ * The id of the parent model
7623
+ */
7624
+ parentModelId?: string;
7625
+ /**
7626
+ * Aggregated performance stats
7627
+ */
7628
+ performanceStats?: Model.PerformanceStats;
7629
+ /**
7630
+ * Fine-tune the model's inferences with prompt embedding
7631
+ */
7632
+ promptEmbedding?: string;
7633
+ /**
7634
+ * The model short description (example: "This model generates highly detailed
7635
+ * cinematic scenes.")
7636
+ */
7637
+ shortDescription?: string;
7638
+ /**
7639
+ * The date when the model will be soft deleted (only for Free plan)
7640
+ */
7641
+ softDeletionOn?: string;
7642
+ /**
7643
+ * A thumbnail for your model
7644
+ */
7645
+ thumbnail?: Model.Thumbnail;
7646
+ /**
7647
+ * Array of training image pairs
7648
+ */
7649
+ trainingImagePairs?: Array<Model.TrainingImagePair>;
7650
+ /**
7651
+ * The URLs of the first 3 training images of the model. To retrieve the full set
7652
+ * of images, get it by modelId
7653
+ */
7654
+ trainingImages?: Array<Model.TrainingImage>;
7655
+ /**
7656
+ * Additional information about the training progress of the model
7657
+ */
7658
+ trainingProgress?: Model.TrainingProgress;
7659
+ /**
7660
+ * Additional information about the model's training
7661
+ */
7662
+ trainingStats?: Model.TrainingStats;
7663
+ /**
7664
+ * The UI configuration for the model
7665
+ */
7666
+ uiConfig?: Model.UiConfig;
7667
+ /**
7668
+ * (Deprecated) The user ID (example: "user_VFhihHKMRZyDDnZAJwLb2Q")
7669
+ */
7670
+ userId?: string;
7671
+ }
7672
+ namespace Model {
7673
+ /**
7674
+ * The class of the model
7675
+ */
7676
+ interface Class {
7677
+ /**
7678
+ * The category slug of the class (example: "art-style")
7679
+ */
7680
+ category: string;
7681
+ /**
7682
+ * The concept prompt of the class (example: "a sks character design")
7683
+ */
7684
+ conceptPrompt: string;
7685
+ /**
7686
+ * The model ID of the class. Only available for legacy models.
7687
+ */
7688
+ modelId: string;
7689
+ /**
7690
+ * The class name (example: "Character Design")
7691
+ */
7692
+ name: string;
7693
+ /**
7694
+ * The class prompt (example: "a character design")
7695
+ */
7696
+ prompt: string;
7697
+ /**
7698
+ * The class slug (example: "art-style-character-design")
7699
+ */
7700
+ slug: string;
7701
+ /**
7702
+ * The class status (only published classes are listed, but unpublished classes can
7703
+ * still appear in existing models)
7704
+ */
7705
+ status: 'published' | 'unpublished';
7706
+ /**
7707
+ * Some example images URLs to showcase the class
7708
+ */
7709
+ thumbnails: Array<string>;
7710
+ }
7711
+ interface Concept {
7712
+ /**
7713
+ * The model ID (example: "model_eyVcnFJcR92BxBkz7N6g5w")
7714
+ */
7715
+ modelId: string;
7716
+ /**
7717
+ * The scale of the model (example: 1.0) For Flux Kontext Prompt Editing, the scale
7718
+ * is between 0 and 2.
7719
+ */
7720
+ scale: number;
7721
+ /**
7722
+ * The epoch of the model (example: "000001") Only available for Flux Lora Trained
7723
+ * models
7724
+ */
7725
+ modelEpoch?: string;
7726
+ }
7727
+ interface Epoch {
7728
+ /**
7729
+ * The epoch hash to identify the epoch
7730
+ */
7731
+ epoch: string;
7732
+ /**
7733
+ * The assets of the epoch if sample prompts as been supplied during training
7734
+ */
7735
+ assets?: Array<Epoch.Asset>;
7736
+ }
7737
+ namespace Epoch {
7738
+ interface Asset {
7739
+ /**
7740
+ * The AssetId of the image during training (example:
7741
+ * "asset_GTrL3mq4SXWyMxkOHRxlpw")
7742
+ */
7743
+ assetId: string;
7744
+ /**
7745
+ * The url of the asset
7746
+ */
7747
+ url: string;
7748
+ }
7749
+ }
7750
+ /**
7751
+ * Defines the input parameters for a model. Use this to understand the available
7752
+ * input parameters for a given `modelId` when calling
7753
+ * `POST /generate/custom/{modelId}`. See {@link
7754
+ * https://docs.scenario.com/get-started/generation/video-generation} for examples.
7755
+ */
7756
+ interface Input {
7757
+ /**
7758
+ * The name that must be user to call the model through the API
7759
+ */
7760
+ name: string;
7761
+ /**
7762
+ * The data type of the input
7763
+ */
7764
+ type: 'boolean' | 'file' | 'file_array' | 'inputs_array' | 'model' | 'model_array' | 'number' | 'number_array' | 'string' | 'string_array';
7765
+ /**
7766
+ * The allowed values for the input. For \`string\` or \`number\` types, creates a
7767
+ * single-select dropdown. For \`string_array\` type, creates a multi-select
7768
+ * dropdown.
7769
+ */
7770
+ allowedValues?: Array<unknown>;
7771
+ /**
7772
+ * Specifies the background behavior for the input. Only available for \`file\` and
7773
+ * \`file_array\` input types with kind \`image\`.
7774
+ */
7775
+ backgroundBehavior?: 'opaque' | 'transparent';
7776
+ /**
7777
+ * Whether the input is a color or not. Only available for \`string\` input type.
7778
+ */
7779
+ color?: boolean;
7780
+ /**
7781
+ * Whether this input affects the model's cost calculation
7782
+ */
7783
+ costImpact?: boolean;
7784
+ /**
7785
+ * The default value for the input
7786
+ */
7787
+ default?: unknown;
7788
+ /**
7789
+ * Help text displayed in the UI to provide additional information about the input
7790
+ */
7791
+ description?: string;
7792
+ /**
7793
+ * Used to visually group inputs together in the UI. Inputs with the same group
7794
+ * value appear consecutively in the UI.
7795
+ */
7796
+ group?: string;
7797
+ /**
7798
+ * Hint text displayed in the UI as a tooltip to guide the user
7799
+ */
7800
+ hint?: string;
7801
+ /**
7802
+ * The list of inputs which form an object within a container array. All inputs are
7803
+ * the same as the current object. This is only available for type inputs_array
7804
+ * inputs.
7805
+ */
7806
+ inputs?: Array<{
7807
+ [key: string]: unknown;
7808
+ }>;
7809
+ /**
7810
+ * The asset kind of the input. Only taken into account for \`file\` and
7811
+ * \`file_array\` input types. If model provides multiple kinds, the input will be
7812
+ * not able to create the asset on the flight on API side with dataurl without
7813
+ * data:kind, prefix \`file\` and \`file_array\` inputs always expose a kind: when
7814
+ * a model does not declare one, \`image\` is returned, which is the kind used at
7815
+ * generation time.
7816
+ */
7817
+ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'text' | 'video';
7818
+ /**
7819
+ * The label displayed in the UI for this input
7820
+ */
7821
+ label?: string;
7822
+ /**
7823
+ * The name of the file input field to use as the mask source
7824
+ */
7825
+ maskFrom?: string;
7826
+ /**
7827
+ * The maximum allowed value. Only available for \`number\` and \`array\` input
7828
+ * types.
7829
+ */
7830
+ max?: number;
7831
+ /**
7832
+ * The maximum allowed media duration in seconds. Only applies to \`file\` and
7833
+ * \`file_array\` input types for video and audio assets. Validated against
7834
+ * \`asset.properties.duration\` at job creation time.
7835
+ */
7836
+ maxDuration?: number;
7837
+ /**
7838
+ * The maximum allowed length for \`string\` and \`model\` inputs, in characters.
7839
+ * For the array types (\`string_array\`, \`model_array\`) it bounds the NUMBER OF
7840
+ * ITEMS instead — the length of each item is not constrained.
7841
+ */
7842
+ maxLength?: number;
7843
+ /**
7844
+ * The maximum allowed file size in bytes. Only applies to \`file\` and
7845
+ * \`file_array\` input types. Validated against \`asset.properties.size\` at job
7846
+ * creation time.
7847
+ */
7848
+ maxSize?: number;
7849
+ /**
7850
+ * The minimum allowed value. Only available for \`number\` and array input types.
7851
+ */
7852
+ min?: number;
7853
+ /**
7854
+ * The minimum allowed media duration in seconds. Only applies to \`file\` and
7855
+ * \`file_array\` input types for video and audio assets. Validated against
7856
+ * \`asset.properties.duration\` at job creation time.
7857
+ */
7858
+ minDuration?: number;
7859
+ /**
7860
+ * The minimum allowed length for \`string\` and \`model\` inputs, in characters.
7861
+ * For the array types (\`string_array\`, \`model_array\`) it bounds the NUMBER OF
7862
+ * ITEMS instead — the length of each item is not constrained.
7863
+ */
7864
+ minLength?: number;
7865
+ /**
7866
+ * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only
7867
+ * available for \`model_array\` input type.
7868
+ */
7869
+ 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' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora'>;
7870
+ /**
7871
+ * Whether this input represents a parent asset to assign to the produced assets.
7872
+ * Only available for \`file\` and \`file_array\` input types.
7873
+ *
7874
+ * For \`file_array\`, the parent asset is the first item in the array.
7875
+ */
7876
+ parent?: boolean;
7877
+ /**
7878
+ * Placeholder text for the input. Only available for 'string' input type.
7879
+ */
7880
+ placeholder?: string;
7881
+ /**
7882
+ * Whether the input is a prompt. When true, displays as a text area with prompt
7883
+ * spark feature. Only available for \`string\` input type.
7884
+ */
7885
+ prompt?: boolean;
7886
+ /**
7887
+ * Whether the input is used with prompt spark. Only available for \`string\` input
7888
+ * type.
7889
+ */
7890
+ promptSpark?: boolean;
7891
+ /**
7892
+ * Set of rules that describes when this input is required:
7893
+ *
7894
+ * - \`always\`: Input is always required
7895
+ * - \`ifNotDefined\`: Input is required when another specified input is not
7896
+ * defined
7897
+ * - \`ifDefined\`: Input is required when another specified input is defined
7898
+ * - \`conditional\`: Input is required when other inputs have specific values
7899
+ *
7900
+ * By default, the input is not required.
7901
+ */
7902
+ required?: Input.Required;
7903
+ /**
7904
+ * The step increment for numeric inputs. Only available for \`number\` input type.
7905
+ */
7906
+ step?: number;
7907
+ }
7908
+ namespace Input {
7909
+ /**
7910
+ * Set of rules that describes when this input is required:
7911
+ *
7912
+ * - \`always\`: Input is always required
7913
+ * - \`ifNotDefined\`: Input is required when another specified input is not
7914
+ * defined
7915
+ * - \`ifDefined\`: Input is required when another specified input is defined
7916
+ * - \`conditional\`: Input is required when other inputs have specific values
7917
+ *
7918
+ * By default, the input is not required.
7919
+ */
7920
+ interface Required {
7921
+ /**
7922
+ * Whether the input is always required
7923
+ */
7924
+ always?: boolean;
7925
+ /**
7926
+ * Makes this input required when other inputs have one of the listed values
7927
+ */
7928
+ conditional?: Required.Conditional;
7929
+ /**
7930
+ * Makes this input required when another input is defined:
7931
+ *
7932
+ * - Key: name of the input that must be defined
7933
+ * - Value: message to display when this input is required
7934
+ */
7935
+ ifDefined?: unknown;
7936
+ /**
7937
+ * Makes this input required when another input is not defined:
7938
+ *
7939
+ * - Key: name of the input that must be undefined
7940
+ * - Value: message to display when this input is required
7941
+ */
7942
+ ifNotDefined?: unknown;
7943
+ }
7944
+ namespace Required {
7945
+ /**
7946
+ * Makes this input required when other inputs have one of the listed values
7947
+ */
7948
+ interface Conditional {
7949
+ /**
7950
+ * The conditions to check:
7951
+ *
7952
+ * - Key: name of the input to check
7953
+ * - Value: values of that input that satisfy the condition
7954
+ */
7955
+ values: unknown;
7956
+ /**
7957
+ * How the conditions combine: \`and\` (all must match) or \`or\` (any must match)
7958
+ */
7959
+ operator?: 'and' | 'or';
7960
+ }
7961
+ }
7962
+ }
7963
+ /**
7964
+ * The parameters of the model
7965
+ */
7966
+ interface Parameters {
7967
+ /**
7968
+ * Age group of the voice (for professional cloning)
7969
+ *
7970
+ * Only available for ElevenLabs voice training
7971
+ */
7972
+ age?: string;
7973
+ /**
7974
+ * The batch size Less steps, and will increase the learning rate
7975
+ *
7976
+ * Only available for Flux LoRA training
7977
+ */
7978
+ batchSize?: number;
7979
+ /**
7980
+ * The prompt to specify images in the same class as provided instance images
7981
+ *
7982
+ * Deprecated legacy training parameter.
7983
+ */
7984
+ classPrompt?: string;
7985
+ /**
7986
+ * Type of voice cloning: "instant" (fast) or "professional" (higher quality,
7987
+ * requires captcha)
7988
+ *
7989
+ * Only available for ElevenLabs voice training
7990
+ */
7991
+ cloneType?: string;
7992
+ /**
7993
+ * The prompt with identifier specifying the instance (or subject) of the class
7994
+ * (example: "a daiton dog")
7995
+ *
7996
+ * Default value varies depending on the model type. For Flux LoRA, the default is
7997
+ * an empty string.
7998
+ */
7999
+ conceptPrompt?: string;
8000
+ /**
8001
+ * Gender of the voice (for professional cloning)
8002
+ *
8003
+ * Only available for ElevenLabs voice training
8004
+ */
8005
+ gender?: string;
8006
+ /**
8007
+ * Language of the audio samples (ISO 639-1 code)
8008
+ *
8009
+ * Only available for ElevenLabs voice training
8010
+ */
8011
+ language?: string;
8012
+ /**
8013
+ * Initial learning rate (after the potential warmup period)
8014
+ *
8015
+ * Default value varies depending on the model type. For Flux LoRA, the default is
8016
+ * 0.0001.
8017
+ */
8018
+ learningRate?: number;
8019
+ /**
8020
+ * Initial learning rate (after the potential warmup period) for the text encoder
8021
+ *
8022
+ * Maximum [Flux LoRA: 0.001] Default [Flux LoRA: 0.00001] Minimum [Flux LoRA:
8023
+ * 0.000001]
8024
+ */
8025
+ learningRateTextEncoder?: number;
8026
+ /**
8027
+ * Initial learning rate (after the potential warmup period) for the UNet
8028
+ *
8029
+ * Deprecated legacy training parameter.
8030
+ */
8031
+ learningRateUnet?: number;
8032
+ /**
8033
+ * The scheduler type to use (default: "constant")
8034
+ *
8035
+ * Deprecated legacy training parameter.
8036
+ */
8037
+ lrScheduler?: 'constant' | 'constant-with-warmup' | 'cosine' | 'cosine-with-restarts' | 'linear' | 'polynomial';
8038
+ /**
8039
+ * Maximum number of training steps to execute (default: varies depending on the
8040
+ * model type)
8041
+ *
8042
+ * Default value varies depending on the model type:
8043
+ *
8044
+ * - For Flux: number of training images \* 100
8045
+ *
8046
+ * Maximum value varies depending on the model type:
8047
+ *
8048
+ * - For Flux: [0, 10000]
8049
+ */
8050
+ maxTrainSteps?: number;
8051
+ /**
8052
+ * The number of epochs to train for
8053
+ *
8054
+ * Only available for Flux LoRA training
8055
+ */
8056
+ nbEpochs?: number;
8057
+ /**
8058
+ * The number of times to repeat the training
8059
+ *
8060
+ * Only available for Flux LoRA training
8061
+ */
8062
+ nbRepeats?: number;
8063
+ /**
8064
+ * The number of training steps for the text encoder
8065
+ *
8066
+ * Deprecated legacy training parameter.
8067
+ */
8068
+ numTextTrainSteps?: number;
8069
+ /**
8070
+ * The number of training steps for the UNet
8071
+ *
8072
+ * Deprecated legacy training parameter.
8073
+ */
8074
+ numUNetTrainSteps?: number;
8075
+ /**
8076
+ * Optimize the model training task for a specific type of input images. The
8077
+ * available values are:
8078
+ *
8079
+ * - "likeness": optimize training for likeness or portrait (targets specific
8080
+ * transformer blocks)
8081
+ * - "all": train all transformer blocks
8082
+ * - "none": train no specific transformer blocks
8083
+ *
8084
+ * This parameter controls which double and single transformer blocks are trained
8085
+ * during the LoRA training process.
8086
+ *
8087
+ * Only available for Flux LoRA training
8088
+ */
8089
+ optimizeFor?: 'likeness';
8090
+ /**
8091
+ * The weight of prior preservation loss
8092
+ *
8093
+ * Deprecated legacy training parameter.
8094
+ */
8095
+ priorLossWeight?: number;
8096
+ /**
8097
+ * Whether to random crop or center crop images before resizing to the working
8098
+ * resolution
8099
+ *
8100
+ * Deprecated legacy training parameter.
8101
+ */
8102
+ randomCrop?: boolean;
8103
+ /**
8104
+ * Ratio of random crops
8105
+ *
8106
+ * Deprecated legacy training parameter.
8107
+ */
8108
+ randomCropRatio?: number;
8109
+ /**
8110
+ * Scale of random crops
8111
+ *
8112
+ * Deprecated legacy training parameter.
8113
+ */
8114
+ randomCropScale?: number;
8115
+ /**
8116
+ * The dimension of the LoRA update matrices
8117
+ *
8118
+ * Only available for Flux LoRA and Musubi training
8119
+ *
8120
+ * Default value varies depending on the model type:
8121
+ *
8122
+ * - For Flux: 16
8123
+ * - For Musubi: 64
8124
+ *
8125
+ * Each trainer enforces its own tighter limit (Flux LoRA: [2; 64], Musubi: [2;
8126
+ * 128])
8127
+ */
8128
+ rank?: number;
8129
+ /**
8130
+ * Whether to remove background noise from audio samples before cloning. When
8131
+ * enabled, each sample must be at least 5 seconds long.
8132
+ *
8133
+ * Only available for ElevenLabs voice training
8134
+ */
8135
+ removeBackgroundNoise?: boolean;
8136
+ /**
8137
+ * The prompts to use for each epoch Only available for Flux LoRA training
8138
+ */
8139
+ samplePrompts?: Array<string>;
8140
+ /**
8141
+ * The sample prompt images (AssetIds) paired with samplePrompts Only available for
8142
+ * Flux LoRA training Must be the same length as samplePrompts
8143
+ */
8144
+ sampleSourceImages?: Array<string>;
8145
+ /**
8146
+ * Whether to scale the learning rate
8147
+ *
8148
+ * Note: Legacy parameter, will be ignored
8149
+ *
8150
+ * Deprecated legacy training parameter.
8151
+ */
8152
+ scaleLr?: boolean;
8153
+ /**
8154
+ * Used to reproduce previous results. Default: randomly generated number.
8155
+ *
8156
+ * Deprecated legacy training parameter.
8157
+ */
8158
+ seed?: number;
8159
+ /**
8160
+ * Whether to train the text encoder or not
8161
+ *
8162
+ * Example: For 100 steps and a value of 0.2, it means that the text encoder will
8163
+ * be trained for 20 steps and then the UNet for 80 steps
8164
+ *
8165
+ * Note: Legacy parameter, please use `numTextTrainSteps` and `numUNetTrainSteps`
8166
+ *
8167
+ * Deprecated legacy training parameter.
8168
+ */
8169
+ textEncoderTrainingRatio?: number;
8170
+ /**
8171
+ * Validation frequency. Cannot be greater than maxTrainSteps value
8172
+ *
8173
+ * Deprecated legacy training parameter.
8174
+ */
8175
+ validationFrequency?: number;
8176
+ /**
8177
+ * Validation prompt
8178
+ *
8179
+ * Deprecated legacy training parameter.
8180
+ */
8181
+ validationPrompt?: string;
8182
+ /**
8183
+ * Description of the voice characteristics
8184
+ *
8185
+ * Only available for ElevenLabs voice training
8186
+ */
8187
+ voiceDescription?: string;
8188
+ /**
8189
+ * The Weights And Bias key to use for logging. The maximum length is 40 characters
8190
+ */
8191
+ wandbKey?: string;
8192
+ }
8193
+ /**
8194
+ * Aggregated performance stats
8195
+ */
8196
+ interface PerformanceStats {
8197
+ /**
8198
+ * Performance metrics per variant
8199
+ */
8200
+ variants: Array<PerformanceStats.Variant>;
8201
+ /**
8202
+ * Default variant key for quick model comparison
8203
+ */
8204
+ default?: string;
8205
+ }
8206
+ namespace PerformanceStats {
8207
+ /**
8208
+ * Performance stats for a model variant
8209
+ */
8210
+ interface Variant {
8211
+ /**
8212
+ * The generation capability (example: "txt2img", "img2video", "txt2audio")
8213
+ */
8214
+ capability: string;
8215
+ /**
8216
+ * When these stats were last computed (ISO date)
8217
+ */
8218
+ computedAt: string;
8219
+ /**
8220
+ * Unique variant identifier (example: "txt2img:1K", "img2video:2K", "txt2audio")
8221
+ */
8222
+ variantKey: string;
8223
+ /**
8224
+ * External quality score from arena.ai leaderboard
8225
+ */
8226
+ arenaScore?: Variant.ArenaScore;
8227
+ /**
8228
+ * Maximum cost per output asset (CU)
8229
+ */
8230
+ costPerAssetMaxCU?: number;
8231
+ /**
8232
+ * Minimum cost per output asset (CU)
8233
+ */
8234
+ costPerAssetMinCU?: number;
8235
+ /**
8236
+ * Median cost per output asset (CU)
8237
+ */
8238
+ costPerAssetP50CU?: number;
8239
+ /**
8240
+ * Inference latency P50 per output asset (seconds)
8241
+ */
8242
+ inferenceLatencyP50Sec?: number;
8243
+ /**
8244
+ * Inference latency P75 per output asset (seconds)
8245
+ */
8246
+ inferenceLatencyP75Sec?: number;
8247
+ /**
8248
+ * The resolution bucket (example: "0.5K", "1K", "2K", "4K")
8249
+ */
8250
+ resolution?: string;
8251
+ /**
8252
+ * Total latency P50 per output asset, including queue time (seconds)
8253
+ */
8254
+ totalLatencyP50Sec?: number;
8255
+ /**
8256
+ * Total latency P75 per output asset, including queue time (seconds)
8257
+ */
8258
+ totalLatencyP75Sec?: number;
8259
+ }
8260
+ namespace Variant {
8261
+ /**
8262
+ * External quality score from arena.ai leaderboard
8263
+ */
8264
+ interface ArenaScore {
8265
+ /**
8266
+ * Arena category (example: "text_to_image", "image_to_video")
8267
+ */
8268
+ arenaCategory: string;
8269
+ /**
8270
+ * Model name on arena.ai
8271
+ */
8272
+ arenaModelName: string;
8273
+ /**
8274
+ * When this score was last fetched (ISO date)
8275
+ */
8276
+ fetchedAt: string;
8277
+ /**
8278
+ * Rank in the arena category
8279
+ */
8280
+ rank: number;
8281
+ /**
8282
+ * ELO rating
8283
+ */
8284
+ rating: number;
8285
+ /**
8286
+ * ELO rating confidence interval lower bound
8287
+ */
8288
+ ratingLower: number;
8289
+ /**
8290
+ * ELO rating confidence interval upper bound
8291
+ */
8292
+ ratingUpper: number;
8293
+ /**
8294
+ * Number of human votes
8295
+ */
8296
+ votes: number;
8297
+ }
8298
+ }
8299
+ }
8300
+ /**
8301
+ * A thumbnail for your model
8302
+ */
8303
+ interface Thumbnail {
8304
+ /**
8305
+ * The AssetId of the image used as a thumbnail for your model (example:
8306
+ * "asset_GTrL3mq4SXWyMxkOHRxlpw")
8307
+ */
8308
+ assetId: string;
8309
+ /**
8310
+ * The url of the image used as a thumbnail for your model
8311
+ */
8312
+ url: string;
8313
+ }
8314
+ interface TrainingImagePair {
8315
+ /**
8316
+ * The instruction for the image pair, source to target
8317
+ */
8318
+ instruction?: string;
8319
+ /**
8320
+ * The source asset ID (must be a training asset)
8321
+ */
8322
+ sourceId?: string;
8323
+ /**
8324
+ * The target asset ID (must be a training asset)
8325
+ */
8326
+ targetId?: string;
8327
+ }
8328
+ interface TrainingImage {
8329
+ /**
8330
+ * The training image ID (example: "asset_GTrL3mq4SXWyMxkOHRxlpw")
8331
+ */
8332
+ id: string;
8333
+ /**
8334
+ * Automatic captioning of the image
8335
+ */
8336
+ automaticCaptioning: string;
8337
+ /**
8338
+ * The training image upload date as an ISO string (example:
8339
+ * "2023-02-03T11:19:41.579Z")
8340
+ */
8341
+ createdAt: string;
8342
+ /**
8343
+ * Description for the image
8344
+ */
8345
+ description: string;
8346
+ /**
8347
+ * The URL of the image
8348
+ */
8349
+ downloadUrl: string;
8350
+ /**
8351
+ * The original file name of the image (example: "my-training-image.jpg")
8352
+ */
8353
+ name: string;
8354
+ }
8355
+ /**
8356
+ * Additional information about the training progress of the model
8357
+ */
8358
+ interface TrainingProgress {
8359
+ /**
8360
+ * The stage of the request
8361
+ */
8362
+ stage: 'pending' | 'pending-captcha' | 'queued-for-train' | 'ready-for-captcha' | 'running-train' | 'starting-train';
8363
+ /**
8364
+ * Timestamp in milliseconds of the last time the training progress was updated
8365
+ */
8366
+ updatedAt: number;
8367
+ /**
8368
+ * Signed URL of the captcha image to read aloud during PVC voice cloning. Only
8369
+ * present when stage === 'pending-captcha'. Overwritten on each retry.
8370
+ */
8371
+ captchaImageUrl?: string;
8372
+ /**
8373
+ * Position of the job in the queue (ie. the number of job in the queue before this
8374
+ * one)
8375
+ */
8376
+ position?: number;
8377
+ /**
8378
+ * The progress of the job
8379
+ */
8380
+ progress?: number;
8381
+ /**
8382
+ * The remaining time in milliseconds
8383
+ */
8384
+ remainingTimeMs?: number;
8385
+ /**
8386
+ * Last recoverable failure message during PVC. Present when the model has bounced
8387
+ * back to stage === 'ready-for-captcha' after a step 2 or step 3 failure (e.g.
8388
+ * captcha rejected, time limit exceeded). Surface above the retry button so the
8389
+ * user understands why they're back here.
8390
+ */
8391
+ retryableError?: string;
8392
+ /**
8393
+ * Number of consecutive PVC step 2 / step 3 failures on this voice model. The
8394
+ * model is marked Failed when this reaches the platform's max retries.
8395
+ */
8396
+ retryCount?: number;
8397
+ /**
8398
+ * The timestamp in millisecond marking the start of the process
8399
+ */
8400
+ startedAt?: number;
8401
+ }
8402
+ /**
8403
+ * Additional information about the model's training
8404
+ */
8405
+ interface TrainingStats {
8406
+ /**
8407
+ * The training end time as an ISO date string
8408
+ */
8409
+ endedAt?: string;
8410
+ /**
8411
+ * The training queued duration in seconds
8412
+ */
8413
+ queueDuration?: number;
8414
+ /**
8415
+ * The training start time as an ISO date string
8416
+ */
8417
+ startedAt?: string;
8418
+ /**
8419
+ * The training duration in seconds
8420
+ */
8421
+ trainDuration?: number;
8422
+ }
8423
+ /**
8424
+ * The UI configuration for the model
8425
+ */
8426
+ interface UiConfig {
8427
+ /**
8428
+ * Configuration for the input properties
8429
+ */
8430
+ inputProperties?: {
8431
+ [key: string]: UiConfig.InputProperties;
8432
+ };
8433
+ /**
8434
+ * Configuration for the loras component
8435
+ */
8436
+ lorasComponent?: UiConfig.LorasComponent;
8437
+ /**
8438
+ * Configuration for the provider outputs exposed by `exposeOutput`
8439
+ */
8440
+ outputProperties?: {
8441
+ [key: string]: UiConfig.OutputProperties;
8442
+ };
8443
+ /**
8444
+ * Configuration for the presets
8445
+ */
8446
+ presets?: Array<UiConfig.Preset>;
8447
+ /**
8448
+ * Configuration for the resolution component
8449
+ */
8450
+ resolutionComponent?: UiConfig.ResolutionComponent;
8451
+ /**
8452
+ * Configuration for the selects
8453
+ */
8454
+ selects?: {
8455
+ [key: string]: unknown;
8456
+ };
8457
+ /**
8458
+ * Configuration for the trigger generate button
8459
+ */
8460
+ triggerGenerate?: UiConfig.TriggerGenerate;
8461
+ }
8462
+ namespace UiConfig {
8463
+ interface InputProperties {
8464
+ collapsed?: boolean;
8465
+ }
8466
+ /**
8467
+ * Configuration for the loras component
8468
+ */
8469
+ interface LorasComponent {
8470
+ /**
8471
+ * The label of the component
8472
+ */
8473
+ label: string;
8474
+ /**
8475
+ * The input name of the model (model_array)
8476
+ */
8477
+ modelInput: string;
8478
+ /**
8479
+ * The input name of the scale (number_array)
8480
+ */
8481
+ scaleInput: string;
8482
+ /**
8483
+ * The input model id (example: a composition or a single LoRA modelId) If
8484
+ * specified, the model id will be attached to the output asset as a metadata If
8485
+ * the model-decomposer parser is specified on it, modelInput and scaleInput will
8486
+ * be automatically populated
8487
+ */
8488
+ modelIdInput?: string;
8489
+ }
8490
+ interface OutputProperties {
8491
+ label: string;
8492
+ }
8493
+ interface Preset {
8494
+ fields: Array<string>;
8495
+ presets: unknown;
8496
+ }
8497
+ /**
8498
+ * Configuration for the resolution component
8499
+ */
8500
+ interface ResolutionComponent {
8501
+ /**
8502
+ * The input name of the height
8503
+ */
8504
+ heightInput: string;
8505
+ /**
8506
+ * The label of the component
8507
+ */
8508
+ label: string;
8509
+ /**
8510
+ * The resolution presets
8511
+ */
8512
+ presets: Array<ResolutionComponent.Preset>;
8513
+ /**
8514
+ * The input name of the width
8515
+ */
8516
+ widthInput: string;
8517
+ }
8518
+ namespace ResolutionComponent {
8519
+ interface Preset {
8520
+ height: number;
8521
+ label: string;
8522
+ width: number;
8523
+ }
8524
+ }
8525
+ /**
8526
+ * Configuration for the trigger generate button
8527
+ */
8528
+ interface TriggerGenerate {
8529
+ label: string;
8530
+ /**
8531
+ * The 'name' of the input where the trigger generate button will be displayed
8532
+ * (after the input). Do not specify both position and after.
8533
+ */
8534
+ after?: string;
8535
+ /**
8536
+ * The position of the trigger generate button. If position specified, the button
8537
+ * will be displayed at the specified position. Do not specify both position and
8538
+ * after.
8539
+ */
8540
+ position?: 'bottom' | 'top';
8541
+ }
8542
+ }
8543
+ }
8544
+ }
8545
+ export interface ModelUpdateTagsResponse {
8546
+ /**
8547
+ * The list of added tags
8548
+ */
8549
+ added: Array<string>;
8550
+ /**
8551
+ * The list of deleted tags
8552
+ */
8553
+ deleted: Array<string>;
8554
+ }
8555
+ export interface ModelCreateParams {
8556
+ /**
8557
+ * Query param: If set to true, returns the original asset without transformation
8558
+ */
8559
+ originalAssets?: boolean;
8560
+ /**
8561
+ * Query param: The projectId used for ownership resource management. Either to
8562
+ * assert ownership or to set the owner of the resource(s)
8563
+ */
8564
+ projectId?: string;
8565
+ /**
8566
+ * Body param: The ID of the base model to use as a starting point for the training
8567
+ * (example: "flux.1-dev")
8568
+ *
8569
+ * Value is automatically set based on the model's type. In case of doubt leave it
8570
+ * empty.
8571
+ */
8572
+ baseModelId?: string;
8573
+ /**
8574
+ * Body param: The slug of the class you want to use (ex:
8575
+ * "characters-npcs-mobs-characters"). Set to null to unset the class
8576
+ */
8577
+ classSlug?: string;
8578
+ /**
8579
+ * Body param: List of collection IDs to add the model to
8580
+ */
8581
+ collectionIds?: Array<string>;
8582
+ /**
8583
+ * Body param: The concepts is required for composition models. With one or more
8584
+ * loras
8585
+ *
8586
+ * Only applicable to Flux based models.
8587
+ */
8588
+ concepts?: Array<ModelCreateParams.Concept>;
8589
+ /**
8590
+ * Body param: The model's name (ex: "Cinematic Realism").
8591
+ *
8592
+ * If not set, the model's name will be automatically generated when starting
8593
+ * training based on training data.
8594
+ */
8595
+ name?: string;
8596
+ /**
8597
+ * Body param: The model's short description (ex: "This model generates highly
8598
+ * detailed cinematic scenes.").
8599
+ *
8600
+ * If not set, the model's short description will be automatically generated when
8601
+ * starting training based on training data.
8602
+ */
8603
+ shortDescription?: string;
8604
+ /**
8605
+ * Body param: The model's type (ex: "flux.1-lora").
8606
+ *
8607
+ * The type can only be changed if the model has the "new" status.
8608
+ */
8609
+ type?: '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' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora';
8610
+ }
8611
+ export declare namespace ModelCreateParams {
8612
+ interface Concept {
8613
+ /**
8614
+ * The model ID (example: "model_eyVcnFJcR92BxBkz7N6g5w")
8615
+ */
8616
+ modelId: string;
8617
+ /**
8618
+ * The scale of the model (example: 1.0) For Flux Kontext Prompt Editing, the scale
8619
+ * is between 0 and 2.
8620
+ */
8621
+ scale: number;
8622
+ /**
8623
+ * The epoch of the model (example: "000001") Only available for Flux Lora Trained
8624
+ * models
8625
+ */
8626
+ modelEpoch?: string;
8627
+ }
8628
+ }
8629
+ export interface ModelRetrieveParams {
8630
+ /**
8631
+ * If set to true, returns the original asset without transformation
8632
+ */
8633
+ originalAssets?: boolean;
8634
+ /**
8635
+ * The projectId used for ownership resource management. Either to assert ownership
8636
+ * or to set the owner of the resource(s)
8637
+ */
8638
+ projectId?: string;
8639
+ }
8640
+ export interface ModelUpdateParams {
8641
+ /**
8642
+ * Query param: If set to true, returns the original asset without transformation
8643
+ */
8644
+ originalAssets?: boolean;
8645
+ /**
8646
+ * Query param: The projectId used for ownership resource management. Either to
8647
+ * assert ownership or to set the owner of the resource(s)
8648
+ */
8649
+ projectId?: string;
8650
+ /**
8651
+ * Body param: The slug of the class you want to use (ex:
8652
+ * "characters-npcs-mobs-characters"). Set to null to unset the class
8653
+ */
8654
+ classSlug?: string;
8655
+ /**
8656
+ * Body param: The concepts is required for composition models. With one or more
8657
+ * loras
8658
+ *
8659
+ * Only applicable to Flux based models.
8660
+ */
8661
+ concepts?: Array<ModelUpdateParams.Concept>;
8662
+ /**
8663
+ * Body param: The epoch of the model. Only available for flux.1-lora and
8664
+ * flux.1-kontext-lora based models.
8665
+ *
8666
+ * The epoch can only be set if the model has epochs and is in status "trained".
8667
+ *
8668
+ * The default epoch (if not set) is the final model epoch (latest).
8669
+ *
8670
+ * Set to null to unset the epoch.
8671
+ */
8672
+ epoch?: string;
8673
+ /**
8674
+ * Body param: The model's name (ex: "Cinematic Realism").
8675
+ *
8676
+ * If not set, the model's name will be automatically generated when starting
8677
+ * training based on training data.
8678
+ */
8679
+ name?: string;
8680
+ /**
8681
+ * Body param: Add a negative prompt embedding to every model's generation
8682
+ */
8683
+ negativePromptEmbedding?: string;
8684
+ /**
8685
+ * Body param: The parameters to use for the model's training
8686
+ */
8687
+ parameters?: ModelUpdateParams.Parameters;
8688
+ /**
8689
+ * Body param: Add a prompt embedding to every model's generation
8690
+ */
8691
+ promptEmbedding?: string;
8692
+ /**
8693
+ * Body param: The model's short description (ex: "This model generates highly
8694
+ * detailed cinematic scenes.").
8695
+ *
8696
+ * If not set, the model's short description will be automatically generated when
8697
+ * starting training based on training data.
8698
+ */
8699
+ shortDescription?: string;
8700
+ /**
8701
+ * Body param: The AssetId of the image you want to use as a thumbnail for the
8702
+ * model (example: "asset_GTrL3mq4SXWyMxkOHRxlpw"). Set to null to unset the
8703
+ * thumbnail
8704
+ */
8705
+ thumbnail?: string;
8706
+ /**
8707
+ * Body param: The model's type (ex: "flux.1-lora").
8708
+ *
8709
+ * The type can only be changed if the model has the "new" status.
8710
+ */
8711
+ type?: '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' | 'zimage-de-turbo-lora' | 'zimage-lora' | 'zimage-turbo-lora';
8712
+ }
8713
+ export declare namespace ModelUpdateParams {
8714
+ interface Concept {
8715
+ /**
8716
+ * The model ID (example: "model_eyVcnFJcR92BxBkz7N6g5w")
8717
+ */
8718
+ modelId: string;
8719
+ /**
8720
+ * The scale of the model (example: 1.0) For Flux Kontext Prompt Editing, the scale
8721
+ * is between 0 and 2.
8722
+ */
8723
+ scale: number;
8724
+ /**
8725
+ * The epoch of the model (example: "000001") Only available for Flux Lora Trained
8726
+ * models
8727
+ */
8728
+ modelEpoch?: string;
8729
+ }
8730
+ /**
8731
+ * The parameters to use for the model's training
8732
+ */
8733
+ interface Parameters {
8734
+ /**
8735
+ * Age group of the voice (for professional cloning)
8736
+ *
8737
+ * Only available for ElevenLabs voice training
8738
+ */
8739
+ age?: string;
8740
+ /**
8741
+ * The batch size Less steps, and will increase the learning rate
8742
+ *
8743
+ * Only available for Flux LoRA training
8744
+ */
8745
+ batchSize?: number;
8746
+ /**
8747
+ * The prompt to specify images in the same class as provided instance images
8748
+ *
8749
+ * Deprecated legacy training parameter.
8750
+ */
8751
+ classPrompt?: string;
7611
8752
  /**
7612
8753
  * Type of voice cloning: "instant" (fast) or "professional" (higher quality,
7613
8754
  * requires captcha)
@@ -7883,7 +9024,9 @@ export interface ModelListParams extends ModelsCursorParams {
7883
9024
  */
7884
9025
  sortDirection?: 'asc' | 'desc';
7885
9026
  /**
7886
- * The status of the models to return. Only available when privacy=private/unlisted
9027
+ * The status of the models to return. Only available when
9028
+ * privacy=private/unlisted. "deleted" returns the models deleted in the last 30
9029
+ * days, each with its `deletedAt` date
7887
9030
  */
7888
9031
  status?: 'new' | 'training' | 'trained' | 'failed' | 'deleted';
7889
9032
  /**
@@ -8035,6 +9178,17 @@ export interface ModelGetBulkParams {
8035
9178
  */
8036
9179
  trainingImagesPreview?: boolean;
8037
9180
  }
9181
+ export interface ModelRestoreParams {
9182
+ /**
9183
+ * If set to true, returns the original asset without transformation
9184
+ */
9185
+ originalAssets?: boolean;
9186
+ /**
9187
+ * The projectId used for ownership resource management. Either to assert ownership
9188
+ * or to set the owner of the resource(s)
9189
+ */
9190
+ projectId?: string;
9191
+ }
8038
9192
  export interface ModelTransferParams {
8039
9193
  /**
8040
9194
  * Body param: The id of the project to copy and transfer the model to
@@ -8074,7 +9228,7 @@ export interface ModelUpdateTagsParams {
8074
9228
  strict?: boolean;
8075
9229
  }
8076
9230
  export declare namespace Models {
8077
- export { type ModelCreateResponse as ModelCreateResponse, type ModelRetrieveResponse as ModelRetrieveResponse, type ModelUpdateResponse as ModelUpdateResponse, type ModelListResponse as ModelListResponse, type ModelDeleteResponse as ModelDeleteResponse, type ModelCopyResponse as ModelCopyResponse, type ModelDeleteImagesResponse as ModelDeleteImagesResponse, type ModelDownloadResponse as ModelDownloadResponse, type ModelGetBulkResponse as ModelGetBulkResponse, type ModelTransferResponse as ModelTransferResponse, type ModelUpdateTagsResponse as ModelUpdateTagsResponse, type ModelListResponsesModelsCursor as ModelListResponsesModelsCursor, type ModelCreateParams as ModelCreateParams, type ModelRetrieveParams as ModelRetrieveParams, type ModelUpdateParams as ModelUpdateParams, type ModelListParams as ModelListParams, type ModelDeleteParams as ModelDeleteParams, type ModelCopyParams as ModelCopyParams, type ModelDeleteImagesParams as ModelDeleteImagesParams, type ModelDownloadParams as ModelDownloadParams, type ModelGetBulkParams as ModelGetBulkParams, type ModelTransferParams as ModelTransferParams, type ModelUpdateTagsParams as ModelUpdateTagsParams, };
9231
+ export { type ModelCreateResponse as ModelCreateResponse, type ModelRetrieveResponse as ModelRetrieveResponse, type ModelUpdateResponse as ModelUpdateResponse, type ModelListResponse as ModelListResponse, type ModelDeleteResponse as ModelDeleteResponse, type ModelCopyResponse as ModelCopyResponse, type ModelDeleteImagesResponse as ModelDeleteImagesResponse, type ModelDownloadResponse as ModelDownloadResponse, type ModelGetBulkResponse as ModelGetBulkResponse, type ModelRestoreResponse as ModelRestoreResponse, type ModelTransferResponse as ModelTransferResponse, type ModelUpdateTagsResponse as ModelUpdateTagsResponse, type ModelListResponsesModelsCursor as ModelListResponsesModelsCursor, type ModelCreateParams as ModelCreateParams, type ModelRetrieveParams as ModelRetrieveParams, type ModelUpdateParams as ModelUpdateParams, type ModelListParams as ModelListParams, type ModelDeleteParams as ModelDeleteParams, type ModelCopyParams as ModelCopyParams, type ModelDeleteImagesParams as ModelDeleteImagesParams, type ModelDownloadParams as ModelDownloadParams, type ModelGetBulkParams as ModelGetBulkParams, type ModelRestoreParams as ModelRestoreParams, type ModelTransferParams as ModelTransferParams, type ModelUpdateTagsParams as ModelUpdateTagsParams, };
8078
9232
  export { Description as Description, type DescriptionRetrieveResponse as DescriptionRetrieveResponse, type DescriptionUpdateResponse as DescriptionUpdateResponse, type DescriptionRetrieveParams as DescriptionRetrieveParams, type DescriptionUpdateParams as DescriptionUpdateParams, };
8079
9233
  export { Examples as Examples, type ExampleUpdateResponse as ExampleUpdateResponse, type ExampleListResponse as ExampleListResponse, type ExampleUpdateParams as ExampleUpdateParams, type ExampleListParams as ExampleListParams, };
8080
9234
  export { Presets as Presets, type PresetCreateResponse as PresetCreateResponse, type PresetUpdateResponse as PresetUpdateResponse, type PresetListResponse as PresetListResponse, type PresetDeleteResponse as PresetDeleteResponse, type PresetCreateParams as PresetCreateParams, type PresetUpdateParams as PresetUpdateParams, type PresetListParams as PresetListParams, type PresetDeleteParams as PresetDeleteParams, };