@scenario-labs/sdk 0.1.3 → 0.2.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 (275) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/LICENSE +1 -1
  3. package/README.md +29 -29
  4. package/client.d.mts +35 -18
  5. package/client.d.mts.map +1 -1
  6. package/client.d.ts +35 -18
  7. package/client.d.ts.map +1 -1
  8. package/client.js +88 -50
  9. package/client.js.map +1 -1
  10. package/client.mjs +86 -48
  11. package/client.mjs.map +1 -1
  12. package/core/api-promise.d.mts +2 -2
  13. package/core/api-promise.d.mts.map +1 -1
  14. package/core/api-promise.d.ts +2 -2
  15. package/core/api-promise.d.ts.map +1 -1
  16. package/core/api-promise.js.map +1 -1
  17. package/core/api-promise.mjs.map +1 -1
  18. package/core/error.d.mts +2 -2
  19. package/core/error.d.mts.map +1 -1
  20. package/core/error.d.ts +2 -2
  21. package/core/error.d.ts.map +1 -1
  22. package/core/error.js +4 -4
  23. package/core/error.js.map +1 -1
  24. package/core/error.mjs +2 -2
  25. package/core/error.mjs.map +1 -1
  26. package/core/resource.d.mts +3 -3
  27. package/core/resource.d.mts.map +1 -1
  28. package/core/resource.d.ts +3 -3
  29. package/core/resource.d.ts.map +1 -1
  30. package/core/resource.js.map +1 -1
  31. package/core/resource.mjs.map +1 -1
  32. package/index.d.mts +8 -3
  33. package/index.d.mts.map +1 -1
  34. package/index.d.ts +8 -3
  35. package/index.d.ts.map +1 -1
  36. package/index.js +16 -6
  37. package/index.js.map +1 -1
  38. package/index.mjs +7 -3
  39. package/index.mjs.map +1 -1
  40. package/internal/parse.d.mts +2 -2
  41. package/internal/parse.d.mts.map +1 -1
  42. package/internal/parse.d.ts +2 -2
  43. package/internal/parse.d.ts.map +1 -1
  44. package/internal/parse.js.map +1 -1
  45. package/internal/parse.mjs.map +1 -1
  46. package/internal/request-options.d.mts +4 -0
  47. package/internal/request-options.d.mts.map +1 -1
  48. package/internal/request-options.d.ts +4 -0
  49. package/internal/request-options.d.ts.map +1 -1
  50. package/internal/request-options.js.map +1 -1
  51. package/internal/request-options.mjs.map +1 -1
  52. package/internal/shims.js +1 -1
  53. package/internal/shims.js.map +1 -1
  54. package/internal/shims.mjs +1 -1
  55. package/internal/shims.mjs.map +1 -1
  56. package/internal/uploads.d.mts +4 -4
  57. package/internal/uploads.d.mts.map +1 -1
  58. package/internal/uploads.d.ts +4 -4
  59. package/internal/uploads.d.ts.map +1 -1
  60. package/internal/uploads.js.map +1 -1
  61. package/internal/uploads.mjs.map +1 -1
  62. package/internal/utils/base64.js +2 -2
  63. package/internal/utils/base64.js.map +1 -1
  64. package/internal/utils/base64.mjs +3 -3
  65. package/internal/utils/base64.mjs.map +1 -1
  66. package/internal/utils/log.d.mts +3 -3
  67. package/internal/utils/log.d.mts.map +1 -1
  68. package/internal/utils/log.d.ts +3 -3
  69. package/internal/utils/log.d.ts.map +1 -1
  70. package/internal/utils/log.js.map +1 -1
  71. package/internal/utils/log.mjs.map +1 -1
  72. package/internal/utils/path.js +1 -1
  73. package/internal/utils/path.js.map +1 -1
  74. package/internal/utils/path.mjs +2 -2
  75. package/internal/utils/path.mjs.map +1 -1
  76. package/internal/utils/values.js +5 -5
  77. package/internal/utils/values.js.map +1 -1
  78. package/internal/utils/values.mjs +6 -6
  79. package/internal/utils/values.mjs.map +1 -1
  80. package/lib/generate.d.mts +19 -0
  81. package/lib/generate.d.mts.map +1 -0
  82. package/lib/generate.d.ts +19 -0
  83. package/lib/generate.d.ts.map +1 -0
  84. package/lib/generate.js +35 -0
  85. package/lib/generate.js.map +1 -0
  86. package/lib/generate.mjs +31 -0
  87. package/lib/generate.mjs.map +1 -0
  88. package/lib/job.d.mts +48 -0
  89. package/lib/job.d.mts.map +1 -0
  90. package/lib/job.d.ts +48 -0
  91. package/lib/job.d.ts.map +1 -0
  92. package/lib/job.js +50 -0
  93. package/lib/job.js.map +1 -0
  94. package/lib/job.mjs +45 -0
  95. package/lib/job.mjs.map +1 -0
  96. package/lib/models.d.mts +20 -0
  97. package/lib/models.d.mts.map +1 -0
  98. package/lib/models.d.ts +20 -0
  99. package/lib/models.d.ts.map +1 -0
  100. package/lib/models.js +28 -0
  101. package/lib/models.js.map +1 -0
  102. package/lib/models.mjs +23 -0
  103. package/lib/models.mjs.map +1 -0
  104. package/lib/scenario.d.mts +39 -0
  105. package/lib/scenario.d.mts.map +1 -0
  106. package/lib/scenario.d.ts +39 -0
  107. package/lib/scenario.d.ts.map +1 -0
  108. package/lib/scenario.js +46 -0
  109. package/lib/scenario.js.map +1 -0
  110. package/lib/scenario.mjs +42 -0
  111. package/lib/scenario.mjs.map +1 -0
  112. package/lib/workflow.d.mts +48 -0
  113. package/lib/workflow.d.mts.map +1 -0
  114. package/lib/workflow.d.ts +48 -0
  115. package/lib/workflow.d.ts.map +1 -0
  116. package/lib/workflow.js +59 -0
  117. package/lib/workflow.js.map +1 -0
  118. package/lib/workflow.mjs +54 -0
  119. package/lib/workflow.mjs.map +1 -0
  120. package/package.json +13 -3
  121. package/resources/assets/assets.d.mts +401 -96
  122. package/resources/assets/assets.d.mts.map +1 -1
  123. package/resources/assets/assets.d.ts +401 -96
  124. package/resources/assets/assets.d.ts.map +1 -1
  125. package/resources/assets/assets.js +2 -2
  126. package/resources/assets/assets.js.map +1 -1
  127. package/resources/assets/assets.mjs +2 -2
  128. package/resources/assets/assets.mjs.map +1 -1
  129. package/resources/assets/index.d.mts +1 -1
  130. package/resources/assets/index.d.mts.map +1 -1
  131. package/resources/assets/index.d.ts +1 -1
  132. package/resources/assets/index.d.ts.map +1 -1
  133. package/resources/assets/index.js.map +1 -1
  134. package/resources/assets/index.mjs.map +1 -1
  135. package/resources/assets/public.d.mts +30 -27
  136. package/resources/assets/public.d.mts.map +1 -1
  137. package/resources/assets/public.d.ts +30 -27
  138. package/resources/assets/public.d.ts.map +1 -1
  139. package/resources/assets/public.js +2 -2
  140. package/resources/assets/public.js.map +1 -1
  141. package/resources/assets/public.mjs +2 -2
  142. package/resources/assets/public.mjs.map +1 -1
  143. package/resources/collections/assets.d.mts +2 -8
  144. package/resources/collections/assets.d.mts.map +1 -1
  145. package/resources/collections/assets.d.ts +2 -8
  146. package/resources/collections/assets.d.ts.map +1 -1
  147. package/resources/collections/assets.js +2 -2
  148. package/resources/collections/assets.js.map +1 -1
  149. package/resources/collections/assets.mjs +2 -2
  150. package/resources/collections/assets.mjs.map +1 -1
  151. package/resources/collections/collections.d.mts +5 -5
  152. package/resources/collections/collections.d.mts.map +1 -1
  153. package/resources/collections/collections.d.ts +5 -5
  154. package/resources/collections/collections.d.ts.map +1 -1
  155. package/resources/collections/collections.js.map +1 -1
  156. package/resources/collections/collections.mjs.map +1 -1
  157. package/resources/collections/index.d.mts +2 -2
  158. package/resources/collections/index.d.mts.map +1 -1
  159. package/resources/collections/index.d.ts +2 -2
  160. package/resources/collections/index.d.ts.map +1 -1
  161. package/resources/collections/index.js.map +1 -1
  162. package/resources/collections/index.mjs +2 -2
  163. package/resources/collections/index.mjs.map +1 -1
  164. package/resources/collections/models.d.mts +2 -8
  165. package/resources/collections/models.d.mts.map +1 -1
  166. package/resources/collections/models.d.ts +2 -8
  167. package/resources/collections/models.d.ts.map +1 -1
  168. package/resources/collections/models.js +2 -2
  169. package/resources/collections/models.js.map +1 -1
  170. package/resources/collections/models.mjs +2 -2
  171. package/resources/collections/models.mjs.map +1 -1
  172. package/resources/generate.d.mts +4188 -1370
  173. package/resources/generate.d.mts.map +1 -1
  174. package/resources/generate.d.ts +4188 -1370
  175. package/resources/generate.d.ts.map +1 -1
  176. package/resources/index.d.mts +2 -2
  177. package/resources/index.d.mts.map +1 -1
  178. package/resources/index.d.ts +2 -2
  179. package/resources/index.d.ts.map +1 -1
  180. package/resources/index.js.map +1 -1
  181. package/resources/index.mjs.map +1 -1
  182. package/resources/jobs.d.mts +943 -33
  183. package/resources/jobs.d.mts.map +1 -1
  184. package/resources/jobs.d.ts +943 -33
  185. package/resources/jobs.d.ts.map +1 -1
  186. package/resources/jobs.js +3 -2
  187. package/resources/jobs.js.map +1 -1
  188. package/resources/jobs.mjs +3 -2
  189. package/resources/jobs.mjs.map +1 -1
  190. package/resources/models/description.d.mts +8 -8
  191. package/resources/models/description.d.mts.map +1 -1
  192. package/resources/models/description.d.ts +8 -8
  193. package/resources/models/description.d.ts.map +1 -1
  194. package/resources/models/examples.d.mts +640 -34
  195. package/resources/models/examples.d.mts.map +1 -1
  196. package/resources/models/examples.d.ts +640 -34
  197. package/resources/models/examples.d.ts.map +1 -1
  198. package/resources/models/models.d.mts +1323 -301
  199. package/resources/models/models.d.mts.map +1 -1
  200. package/resources/models/models.d.ts +1323 -301
  201. package/resources/models/models.d.ts.map +1 -1
  202. package/resources/models/models.js.map +1 -1
  203. package/resources/models/models.mjs.map +1 -1
  204. package/resources/models/train.d.mts +718 -90
  205. package/resources/models/train.d.mts.map +1 -1
  206. package/resources/models/train.d.ts +718 -90
  207. package/resources/models/train.d.ts.map +1 -1
  208. package/resources/models/train.js +9 -4
  209. package/resources/models/train.js.map +1 -1
  210. package/resources/models/train.mjs +9 -4
  211. package/resources/models/train.mjs.map +1 -1
  212. package/resources/models/training-images.d.mts +2 -2
  213. package/resources/models/training-images.d.mts.map +1 -1
  214. package/resources/models/training-images.d.ts +2 -2
  215. package/resources/models/training-images.d.ts.map +1 -1
  216. package/resources/search.d.mts +6 -31
  217. package/resources/search.d.mts.map +1 -1
  218. package/resources/search.d.ts +6 -31
  219. package/resources/search.d.ts.map +1 -1
  220. package/resources/search.js +6 -2
  221. package/resources/search.js.map +1 -1
  222. package/resources/search.mjs +6 -2
  223. package/resources/search.mjs.map +1 -1
  224. package/resources/tags.d.mts +1 -1
  225. package/resources/tags.d.ts +1 -1
  226. package/resources/usages.d.mts +401 -16
  227. package/resources/usages.d.mts.map +1 -1
  228. package/resources/usages.d.ts +401 -16
  229. package/resources/usages.d.ts.map +1 -1
  230. package/resources/workflows.d.mts +2738 -101
  231. package/resources/workflows.d.mts.map +1 -1
  232. package/resources/workflows.d.ts +2738 -101
  233. package/resources/workflows.d.ts.map +1 -1
  234. package/src/client.ts +102 -44
  235. package/src/core/api-promise.ts +4 -4
  236. package/src/core/error.ts +2 -2
  237. package/src/core/resource.ts +3 -3
  238. package/src/index.ts +8 -3
  239. package/src/internal/parse.ts +2 -2
  240. package/src/internal/request-options.ts +2 -0
  241. package/src/internal/shims.ts +1 -1
  242. package/src/internal/uploads.ts +5 -5
  243. package/src/internal/utils/base64.ts +3 -3
  244. package/src/internal/utils/log.ts +3 -3
  245. package/src/internal/utils/path.ts +2 -2
  246. package/src/internal/utils/values.ts +6 -6
  247. package/src/lib/generate.ts +77 -0
  248. package/src/lib/job.ts +78 -0
  249. package/src/lib/models.ts +27 -0
  250. package/src/lib/scenario.ts +39 -0
  251. package/src/lib/workflow.ts +90 -0
  252. package/src/resources/assets/assets.ts +742 -212
  253. package/src/resources/assets/index.ts +0 -1
  254. package/src/resources/assets/public.ts +151 -29
  255. package/src/resources/collections/assets.ts +2 -14
  256. package/src/resources/collections/collections.ts +3 -5
  257. package/src/resources/collections/index.ts +2 -14
  258. package/src/resources/collections/models.ts +2 -14
  259. package/src/resources/generate.ts +6254 -2217
  260. package/src/resources/index.ts +2 -3
  261. package/src/resources/jobs.ts +1355 -26
  262. package/src/resources/models/description.ts +50 -8
  263. package/src/resources/models/examples.ts +906 -56
  264. package/src/resources/models/models.ts +1867 -330
  265. package/src/resources/models/train.ts +976 -98
  266. package/src/resources/models/training-images.ts +2 -2
  267. package/src/resources/search.ts +13 -39
  268. package/src/resources/tags.ts +1 -1
  269. package/src/resources/usages.ts +544 -11
  270. package/src/resources/workflows.ts +4586 -914
  271. package/src/version.ts +1 -1
  272. package/version.d.mts +1 -1
  273. package/version.d.ts +1 -1
  274. package/version.js +1 -1
  275. package/version.mjs +1 -1
@@ -11,10 +11,15 @@ export class Train extends APIResource {
11
11
  */
12
12
  action(
13
13
  modelID: string,
14
- body: TrainActionParams,
14
+ params: TrainActionParams,
15
15
  options?: RequestOptions,
16
16
  ): APIPromise<TrainActionResponse> {
17
- return this._client.post(path`/models/${modelID}/train/action`, { body, ...options });
17
+ const { originalAssets, ...body } = params;
18
+ return this._client.post(path`/models/${modelID}/train/action`, {
19
+ query: { originalAssets },
20
+ body,
21
+ ...options,
22
+ });
18
23
  }
19
24
 
20
25
  /**
@@ -25,9 +30,9 @@ export class Train extends APIResource {
25
30
  params: TrainTriggerParams,
26
31
  options?: RequestOptions,
27
32
  ): APIPromise<TrainTriggerResponse> {
28
- const { dryRun, originalAssets, ...body } = params;
33
+ const { dryRun, originalAssets, trainingImagesCount, ...body } = params;
29
34
  return this._client.put(path`/models/${modelID}/train`, {
30
- query: { dryRun, originalAssets },
35
+ query: { dryRun, originalAssets, trainingImagesCount },
31
36
  body,
32
37
  ...options,
33
38
  });
@@ -77,6 +82,7 @@ export namespace TrainActionResponse {
77
82
  | 'txt2img_texture'
78
83
  | 'txt2txt'
79
84
  | 'txt2video'
85
+ | 'video23d'
80
86
  | 'video2img'
81
87
  | 'video2video'
82
88
  >;
@@ -132,6 +138,7 @@ export namespace TrainActionResponse {
132
138
  */
133
139
  type:
134
140
  | 'custom'
141
+ | 'elevenlabs-voice'
135
142
  | 'flux.1'
136
143
  | 'flux.1-composition'
137
144
  | 'flux.1-kontext-dev'
@@ -141,14 +148,32 @@ export namespace TrainActionResponse {
141
148
  | 'flux.1-lora'
142
149
  | 'flux.1-pro'
143
150
  | 'flux.1.1-pro-ultra'
151
+ | 'flux.2-dev-edit-lora'
152
+ | 'flux.2-dev-lora'
153
+ | 'flux.2-klein-4b-edit-lora'
154
+ | 'flux.2-klein-4b-lora'
155
+ | 'flux.2-klein-9b-edit-lora'
156
+ | 'flux.2-klein-9b-lora'
157
+ | 'flux.2-klein-base-4b-edit-lora'
158
+ | 'flux.2-klein-base-4b-lora'
159
+ | 'flux.2-klein-base-9b-edit-lora'
160
+ | 'flux.2-klein-base-9b-lora'
144
161
  | 'flux1.1-pro'
145
162
  | 'gpt-image-1'
163
+ | 'qwen-image-2512-lora'
164
+ | 'qwen-image-edit-2509-lora'
165
+ | 'qwen-image-edit-2511-lora'
166
+ | 'qwen-image-edit-lora'
167
+ | 'qwen-image-lora'
146
168
  | 'sd-1_5'
147
169
  | 'sd-1_5-composition'
148
170
  | 'sd-1_5-lora'
149
171
  | 'sd-xl'
150
172
  | 'sd-xl-composition'
151
- | 'sd-xl-lora';
173
+ | 'sd-xl-lora'
174
+ | 'zimage-de-turbo-lora'
175
+ | 'zimage-lora'
176
+ | 'zimage-turbo-lora';
152
177
 
153
178
  /**
154
179
  * The model last update date as an ISO string (example:
@@ -160,7 +185,7 @@ export namespace TrainActionResponse {
160
185
  * The access restrictions of the model 0: Free plan 25: Creator plan 50: Pro plan
161
186
  * 75: Team plan 100: Enterprise plan
162
187
  */
163
- accessRestrictions?: number;
188
+ accessRestrictions?: 0 | 100 | 25 | 50 | 75;
164
189
 
165
190
  /**
166
191
  * The author user ID (example: "user_VFhihHKMRZyDDnZAJwLb2Q")
@@ -172,11 +197,6 @@ export namespace TrainActionResponse {
172
197
  */
173
198
  class?: Model.Class;
174
199
 
175
- /**
176
- * Compliance and regulatory metadata for the model
177
- */
178
- complianceMetadata?: Model.ComplianceMetadata;
179
-
180
200
  /**
181
201
  * List of base model IDs compliant with the model (example: ["flux.1-dev",
182
202
  * "flux.1-schnell"]) This attribute is mainly used for Flux LoRA models
@@ -236,6 +256,11 @@ export namespace TrainActionResponse {
236
256
  */
237
257
  parentModelId?: string;
238
258
 
259
+ /**
260
+ * Aggregated performance stats
261
+ */
262
+ performanceStats?: Model.PerformanceStats;
263
+
239
264
  /**
240
265
  * Fine-tune the model's inferences with prompt embedding
241
266
  */
@@ -336,36 +361,6 @@ export namespace TrainActionResponse {
336
361
  thumbnails: Array<string>;
337
362
  }
338
363
 
339
- /**
340
- * Compliance and regulatory metadata for the model
341
- */
342
- export interface ComplianceMetadata {
343
- /**
344
- * Data processing comment (e.g., zeroRetention, temporaryRetention, etc.)
345
- */
346
- dataProcessingComment?: 'researchOnly' | 'serviceImprovement' | 'temporaryRetention' | 'zeroRetention';
347
-
348
- /**
349
- * URL to license terms
350
- */
351
- licenseTerms?: string;
352
-
353
- /**
354
- * The maintainer of the model
355
- */
356
- maintainer?: 'Fal' | 'Provider' | 'Replicate' | 'Scenario';
357
-
358
- /**
359
- * The provider of the model (examples: 'Google', 'AWS', 'BFL', 'Meshy', etc.)
360
- */
361
- modelProvider?: string;
362
-
363
- /**
364
- * The sub-processor used for the model
365
- */
366
- subProcessor?: 'AWS' | 'Fal' | 'Modal' | 'Provider' | 'Replicate';
367
- }
368
-
369
364
  export interface Concept {
370
365
  /**
371
366
  * The model ID (example: "model_eyVcnFJcR92BxBkz7N6g5w")
@@ -462,6 +457,11 @@ export namespace TrainActionResponse {
462
457
  */
463
458
  costImpact?: boolean;
464
459
 
460
+ /**
461
+ * The default value for the input
462
+ */
463
+ default?: unknown;
464
+
465
465
  /**
466
466
  * Help text displayed in the UI to provide additional information about the input
467
467
  */
@@ -483,11 +483,13 @@ export namespace TrainActionResponse {
483
483
  * the same as the current object. This is only available for type inputs_array
484
484
  * inputs.
485
485
  */
486
- inputs?: Array<unknown>;
486
+ inputs?: Array<{ [key: string]: unknown }>;
487
487
 
488
488
  /**
489
489
  * The asset kind of the input. Only taken into account for \`file\` and
490
- * \`file_array\` input types.
490
+ * \`file_array\` input types. If model provides multiple kinds, the input will be
491
+ * not able to create the asset on the flight on API side with dataurl without
492
+ * data:kind, prefix
491
493
  */
492
494
  kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
493
495
 
@@ -513,6 +515,13 @@ export namespace TrainActionResponse {
513
515
  */
514
516
  maxLength?: number;
515
517
 
518
+ /**
519
+ * The maximum allowed file size in bytes. Only applies to \`file\` and
520
+ * \`file_array\` input types. Validated against \`asset.properties.size\` at job
521
+ * creation time.
522
+ */
523
+ maxSize?: number;
524
+
516
525
  /**
517
526
  * The minimum allowed value. Only available for \`number\` and array input types.
518
527
  */
@@ -530,6 +539,7 @@ export namespace TrainActionResponse {
530
539
  */
531
540
  modelTypes?: Array<
532
541
  | 'custom'
542
+ | 'elevenlabs-voice'
533
543
  | 'flux.1'
534
544
  | 'flux.1-composition'
535
545
  | 'flux.1-kontext-dev'
@@ -539,14 +549,32 @@ export namespace TrainActionResponse {
539
549
  | 'flux.1-lora'
540
550
  | 'flux.1-pro'
541
551
  | 'flux.1.1-pro-ultra'
552
+ | 'flux.2-dev-edit-lora'
553
+ | 'flux.2-dev-lora'
554
+ | 'flux.2-klein-4b-edit-lora'
555
+ | 'flux.2-klein-4b-lora'
556
+ | 'flux.2-klein-9b-edit-lora'
557
+ | 'flux.2-klein-9b-lora'
558
+ | 'flux.2-klein-base-4b-edit-lora'
559
+ | 'flux.2-klein-base-4b-lora'
560
+ | 'flux.2-klein-base-9b-edit-lora'
561
+ | 'flux.2-klein-base-9b-lora'
542
562
  | 'flux1.1-pro'
543
563
  | 'gpt-image-1'
564
+ | 'qwen-image-2512-lora'
565
+ | 'qwen-image-edit-2509-lora'
566
+ | 'qwen-image-edit-2511-lora'
567
+ | 'qwen-image-edit-lora'
568
+ | 'qwen-image-lora'
544
569
  | 'sd-1_5'
545
570
  | 'sd-1_5-composition'
546
571
  | 'sd-1_5-lora'
547
572
  | 'sd-xl'
548
573
  | 'sd-xl-composition'
549
574
  | 'sd-xl-lora'
575
+ | 'zimage-de-turbo-lora'
576
+ | 'zimage-lora'
577
+ | 'zimage-turbo-lora'
550
578
  >;
551
579
 
552
580
  /**
@@ -643,6 +671,13 @@ export namespace TrainActionResponse {
643
671
  * The parameters of the model
644
672
  */
645
673
  export interface Parameters {
674
+ /**
675
+ * Age group of the voice (for professional cloning)
676
+ *
677
+ * Only available for ElevenLabs voice training
678
+ */
679
+ age?: string;
680
+
646
681
  /**
647
682
  * The batch size Less steps, and will increase the learning rate
648
683
  *
@@ -657,6 +692,14 @@ export namespace TrainActionResponse {
657
692
  */
658
693
  classPrompt?: string;
659
694
 
695
+ /**
696
+ * Type of voice cloning: "instant" (fast) or "professional" (higher quality,
697
+ * requires captcha)
698
+ *
699
+ * Only available for ElevenLabs voice training
700
+ */
701
+ cloneType?: string;
702
+
660
703
  /**
661
704
  * The prompt with identifier specifying the instance (or subject) of the class
662
705
  * (example: "a daiton dog")
@@ -669,6 +712,20 @@ export namespace TrainActionResponse {
669
712
  */
670
713
  conceptPrompt?: string;
671
714
 
715
+ /**
716
+ * Gender of the voice (for professional cloning)
717
+ *
718
+ * Only available for ElevenLabs voice training
719
+ */
720
+ gender?: string;
721
+
722
+ /**
723
+ * Language of the audio samples (ISO 639-1 code)
724
+ *
725
+ * Only available for ElevenLabs voice training
726
+ */
727
+ language?: string;
728
+
672
729
  /**
673
730
  * Initial learning rate (after the potential warmup period)
674
731
  *
@@ -803,15 +860,27 @@ export namespace TrainActionResponse {
803
860
  /**
804
861
  * The dimension of the LoRA update matrices
805
862
  *
806
- * Only available for SDXL and Flux LoRA training
863
+ * Only available for SDXL (deprecated), Flux LoRA and Musubi training
807
864
  *
808
865
  * Default value varies depending on the model type:
809
866
  *
810
- * - For SDXL: 64
867
+ * - For SDXL (deprecated): 64
811
868
  * - For Flux: 16
869
+ * - For Musubi: 64
870
+ *
871
+ * Each trainer enforces its own tighter limit (Flux LoRA: [2; 64], Musubi: [2;
872
+ * 128])
812
873
  */
813
874
  rank?: number;
814
875
 
876
+ /**
877
+ * Whether to remove background noise from audio samples before cloning. When
878
+ * enabled, each sample must be at least 5 seconds long.
879
+ *
880
+ * Only available for ElevenLabs voice training
881
+ */
882
+ removeBackgroundNoise?: boolean;
883
+
815
884
  /**
816
885
  * The prompts to use for each epoch Only available for Flux LoRA training
817
886
  */
@@ -865,12 +934,148 @@ export namespace TrainActionResponse {
865
934
  */
866
935
  validationPrompt?: string;
867
936
 
937
+ /**
938
+ * Description of the voice characteristics
939
+ *
940
+ * Only available for ElevenLabs voice training
941
+ */
942
+ voiceDescription?: string;
943
+
868
944
  /**
869
945
  * The Weights And Bias key to use for logging. The maximum length is 40 characters
870
946
  */
871
947
  wandbKey?: string;
872
948
  }
873
949
 
950
+ /**
951
+ * Aggregated performance stats
952
+ */
953
+ export interface PerformanceStats {
954
+ /**
955
+ * Performance metrics per variant
956
+ */
957
+ variants: Array<PerformanceStats.Variant>;
958
+
959
+ /**
960
+ * Default variant key for quick model comparison
961
+ */
962
+ default?: string;
963
+ }
964
+
965
+ export namespace PerformanceStats {
966
+ /**
967
+ * Performance stats for a model variant
968
+ */
969
+ export interface Variant {
970
+ /**
971
+ * The generation capability (example: "txt2img", "img2video", "txt2audio")
972
+ */
973
+ capability: string;
974
+
975
+ /**
976
+ * When these stats were last computed (ISO date)
977
+ */
978
+ computedAt: string;
979
+
980
+ /**
981
+ * Maximum cost per output asset (CU)
982
+ */
983
+ costPerAssetMaxCU: number;
984
+
985
+ /**
986
+ * Minimum cost per output asset (CU)
987
+ */
988
+ costPerAssetMinCU: number;
989
+
990
+ /**
991
+ * Median cost per output asset (CU)
992
+ */
993
+ costPerAssetP50CU: number;
994
+
995
+ /**
996
+ * Inference latency P50 per output asset (seconds)
997
+ */
998
+ inferenceLatencyP50Sec: number;
999
+
1000
+ /**
1001
+ * Inference latency P75 per output asset (seconds)
1002
+ */
1003
+ inferenceLatencyP75Sec: number;
1004
+
1005
+ /**
1006
+ * Total latency P50 per output asset, including queue time (seconds)
1007
+ */
1008
+ totalLatencyP50Sec: number;
1009
+
1010
+ /**
1011
+ * Total latency P75 per output asset, including queue time (seconds)
1012
+ */
1013
+ totalLatencyP75Sec: number;
1014
+
1015
+ /**
1016
+ * Unique variant identifier (example: "txt2img:1K", "img2video:2K", "txt2audio")
1017
+ */
1018
+ variantKey: string;
1019
+
1020
+ /**
1021
+ * External quality score from arena.ai leaderboard
1022
+ */
1023
+ arenaScore?: Variant.ArenaScore;
1024
+
1025
+ /**
1026
+ * The resolution bucket (example: "0.5K", "1K", "2K", "4K")
1027
+ */
1028
+ resolution?: string;
1029
+ }
1030
+
1031
+ export namespace Variant {
1032
+ /**
1033
+ * External quality score from arena.ai leaderboard
1034
+ */
1035
+ export interface ArenaScore {
1036
+ /**
1037
+ * Arena category (example: "text_to_image", "image_to_video")
1038
+ */
1039
+ arenaCategory: string;
1040
+
1041
+ /**
1042
+ * Model name on arena.ai
1043
+ */
1044
+ arenaModelName: string;
1045
+
1046
+ /**
1047
+ * When this score was last fetched (ISO date)
1048
+ */
1049
+ fetchedAt: string;
1050
+
1051
+ /**
1052
+ * Rank in the arena category
1053
+ */
1054
+ rank: number;
1055
+
1056
+ /**
1057
+ * ELO rating
1058
+ */
1059
+ rating: number;
1060
+
1061
+ /**
1062
+ * ELO rating confidence interval lower bound
1063
+ */
1064
+ ratingLower: number;
1065
+
1066
+ /**
1067
+ * ELO rating confidence interval upper bound
1068
+ */
1069
+ ratingUpper: number;
1070
+
1071
+ /**
1072
+ * Number of human votes
1073
+ */
1074
+ votes: number;
1075
+ }
1076
+ }
1077
+ }
1078
+
874
1079
  /**
875
1080
  * A thumbnail for your model
876
1081
  */
@@ -944,7 +1149,7 @@ export namespace TrainActionResponse {
944
1149
  /**
945
1150
  * The stage of the request
946
1151
  */
947
- stage: 'pending' | 'queued-for-train' | 'running-train' | 'starting-train';
1152
+ stage: 'pending' | 'pending-captcha' | 'queued-for-train' | 'running-train' | 'starting-train';
948
1153
 
949
1154
  /**
950
1155
  * Timestamp in milliseconds of the last time the training progress was updated
@@ -1180,6 +1385,7 @@ export namespace TrainTriggerResponse {
1180
1385
  | 'model-download'
1181
1386
  | 'model-import'
1182
1387
  | 'model-training'
1388
+ | 'musubi-model-training'
1183
1389
  | 'openai-image-generation'
1184
1390
  | 'patch-image'
1185
1391
  | 'pixelate'
@@ -1261,20 +1467,37 @@ export namespace TrainTriggerResponse {
1261
1467
  */
1262
1468
  assetIds?: Array<string>;
1263
1469
 
1470
+ /**
1471
+ * Eventual error for the job
1472
+ */
1473
+ error?: string | null;
1474
+
1264
1475
  /**
1265
1476
  * The flow of the job. Only available for workflow jobs.
1266
1477
  */
1267
1478
  flow?: Array<Metadata.Flow>;
1268
1479
 
1480
+ /**
1481
+ * Actionable hint for the user explaining what went wrong and how to resolve it.
1482
+ */
1483
+ hint?: string;
1484
+
1269
1485
  /**
1270
1486
  * The inputs for the job
1271
1487
  */
1272
- input?: unknown;
1488
+ input?: { [key: string]: unknown };
1273
1489
 
1274
1490
  /**
1275
- * The output of the job
1491
+ * May contain the output of the job for specific custom models jobs. Only
1492
+ * available for custom models which generate non-assets outputs. Example: LLM text
1493
+ * results.
1276
1494
  */
1277
- output?: unknown;
1495
+ output?: { [key: string]: unknown };
1496
+
1497
+ /**
1498
+ * For voice-clone jobs: the ID of the model being trained.
1499
+ */
1500
+ outputModelId?: string;
1278
1501
 
1279
1502
  /**
1280
1503
  * The workflow ID of the job if job is part of a workflow.
@@ -1304,8 +1527,11 @@ export namespace TrainTriggerResponse {
1304
1527
  */
1305
1528
  type:
1306
1529
  | 'custom-model'
1530
+ | 'for-each'
1307
1531
  | 'generate-prompt'
1532
+ | 'list'
1308
1533
  | 'logic'
1534
+ | 'model'
1309
1535
  | 'remove-background'
1310
1536
  | 'transform'
1311
1537
  | 'user-approval'
@@ -1316,17 +1542,46 @@ export namespace TrainTriggerResponse {
1316
1542
  */
1317
1543
  assets?: Array<Flow.Asset>;
1318
1544
 
1545
+ /**
1546
+ * Fixed number of iterations for a ForEach node. When set, the loop runs exactly
1547
+ * `count` times regardless of array input. When not set, the loop iterates over
1548
+ * the resolved array input. Only available for ForEach nodes.
1549
+ */
1550
+ count?: number;
1551
+
1319
1552
  /**
1320
1553
  * The nodes that this node depends on. Only available for nodes that have
1321
1554
  * dependencies. Mainly used for user approval nodes.
1322
1555
  */
1323
1556
  dependsOn?: Array<string>;
1324
1557
 
1558
+ /**
1559
+ * If true, the outputs of this node will be included in the workflow job's final
1560
+ * output. Only applicable to producing nodes (custom-model, inference, etc.). By
1561
+ * default, only last nodes (nodes not referenced by other nodes) contribute to
1562
+ * outputs. Set this to true to also include intermediate nodes in the final
1563
+ * output. Note: This should only be set to `true` or left undefined.
1564
+ */
1565
+ includeOutputsInWorkflowJob?: true;
1566
+
1325
1567
  /**
1326
1568
  * The inputs of the node.
1327
1569
  */
1328
1570
  inputs?: Array<Flow.Input>;
1329
1571
 
1572
+ /**
1573
+ * Statically-configured items for a List node. The node outputs this array as-is
1574
+ * when executed. Only available for List nodes. The values can be strings,
1575
+ * numbers, or asset IDs.
1576
+ */
1577
+ items?: Array<string>;
1578
+
1579
+ /**
1580
+ * Zero-based index of the iteration this node copy belongs to. Set on
1581
+ * dynamically-created copies of loop body nodes.
1582
+ */
1583
+ iterationIndex?: number;
1584
+
1330
1585
  /**
1331
1586
  * If the flow is part of a WorkflowJob, this is the jobId for the node. jobId is
1332
1587
  * only available for nodes started. A node "Pending" for a running workflow job is
@@ -1344,11 +1599,29 @@ export namespace TrainTriggerResponse {
1344
1599
  */
1345
1600
  logicType?: 'if-else';
1346
1601
 
1602
+ /**
1603
+ * IDs of the body template nodes that belong to this ForEach loop. At runtime
1604
+ * these templates are cloned once per iteration and marked Skipped. Only available
1605
+ * for ForEach nodes.
1606
+ */
1607
+ loopBodyNodeIds?: Array<string>;
1608
+
1609
+ /**
1610
+ * ID of the ForEach node that spawned this iteration copy. Set on
1611
+ * dynamically-created copies of loop body nodes.
1612
+ */
1613
+ loopNodeId?: string;
1614
+
1347
1615
  /**
1348
1616
  * The model id for the node. Mainly used for custom model tasks.
1349
1617
  */
1350
1618
  modelId?: string;
1351
1619
 
1620
+ /**
1621
+ * The output of the node. Only available for logic nodes.
1622
+ */
1623
+ output?: unknown;
1624
+
1352
1625
  /**
1353
1626
  * The workflow id for the node. Mainly used for workflow tasks.
1354
1627
  */
@@ -1409,6 +1682,11 @@ export namespace TrainTriggerResponse {
1409
1682
  */
1410
1683
  costImpact?: boolean;
1411
1684
 
1685
+ /**
1686
+ * The default value for the input
1687
+ */
1688
+ default?: unknown;
1689
+
1412
1690
  /**
1413
1691
  * Help text displayed in the UI to provide additional information about the input
1414
1692
  */
@@ -1430,11 +1708,20 @@ export namespace TrainTriggerResponse {
1430
1708
  * the same as the current object. This is only available for type inputs_array
1431
1709
  * inputs.
1432
1710
  */
1433
- inputs?: Array<unknown>;
1711
+ inputs?: Array<{ [key: string]: unknown }>;
1712
+
1713
+ /**
1714
+ * The configured items for inputs_array type inputs. Each item is an array of
1715
+ * SubNodeInput that need ref/value resolution. Only available for inputs_array
1716
+ * type.
1717
+ */
1718
+ items?: Array<Array<Input.Item>>;
1434
1719
 
1435
1720
  /**
1436
1721
  * The asset kind of the input. Only taken into account for \`file\` and
1437
- * \`file_array\` input types.
1722
+ * \`file_array\` input types. If model provides multiple kinds, the input will be
1723
+ * not able to create the asset on the flight on API side with dataurl without
1724
+ * data:kind, prefix
1438
1725
  */
1439
1726
  kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
1440
1727
 
@@ -1460,6 +1747,13 @@ export namespace TrainTriggerResponse {
1460
1747
  */
1461
1748
  maxLength?: number;
1462
1749
 
1750
+ /**
1751
+ * The maximum allowed file size in bytes. Only applies to \`file\` and
1752
+ * \`file_array\` input types. Validated against \`asset.properties.size\` at job
1753
+ * creation time.
1754
+ */
1755
+ maxSize?: number;
1756
+
1463
1757
  /**
1464
1758
  * The minimum allowed value. Only available for \`number\` and array input types.
1465
1759
  */
@@ -1477,6 +1771,7 @@ export namespace TrainTriggerResponse {
1477
1771
  */
1478
1772
  modelTypes?: Array<
1479
1773
  | 'custom'
1774
+ | 'elevenlabs-voice'
1480
1775
  | 'flux.1'
1481
1776
  | 'flux.1-composition'
1482
1777
  | 'flux.1-kontext-dev'
@@ -1486,14 +1781,32 @@ export namespace TrainTriggerResponse {
1486
1781
  | 'flux.1-lora'
1487
1782
  | 'flux.1-pro'
1488
1783
  | 'flux.1.1-pro-ultra'
1784
+ | 'flux.2-dev-edit-lora'
1785
+ | 'flux.2-dev-lora'
1786
+ | 'flux.2-klein-4b-edit-lora'
1787
+ | 'flux.2-klein-4b-lora'
1788
+ | 'flux.2-klein-9b-edit-lora'
1789
+ | 'flux.2-klein-9b-lora'
1790
+ | 'flux.2-klein-base-4b-edit-lora'
1791
+ | 'flux.2-klein-base-4b-lora'
1792
+ | 'flux.2-klein-base-9b-edit-lora'
1793
+ | 'flux.2-klein-base-9b-lora'
1489
1794
  | 'flux1.1-pro'
1490
1795
  | 'gpt-image-1'
1796
+ | 'qwen-image-2512-lora'
1797
+ | 'qwen-image-edit-2509-lora'
1798
+ | 'qwen-image-edit-2511-lora'
1799
+ | 'qwen-image-edit-lora'
1800
+ | 'qwen-image-lora'
1491
1801
  | 'sd-1_5'
1492
1802
  | 'sd-1_5-composition'
1493
1803
  | 'sd-1_5-lora'
1494
1804
  | 'sd-xl'
1495
1805
  | 'sd-xl-composition'
1496
1806
  | 'sd-xl-lora'
1807
+ | 'zimage-de-turbo-lora'
1808
+ | 'zimage-lora'
1809
+ | 'zimage-turbo-lora'
1497
1810
  >;
1498
1811
 
1499
1812
  /**
@@ -1545,9 +1858,316 @@ export namespace TrainTriggerResponse {
1545
1858
  * The step increment for numeric inputs. Only available for \`number\` input type.
1546
1859
  */
1547
1860
  step?: number;
1861
+
1862
+ /**
1863
+ * The value of the input. This is the value of the input that will be used to run
1864
+ * the node. Only available for flows managed by a WorkflowJob.
1865
+ */
1866
+ value?: unknown;
1548
1867
  }
1549
1868
 
1550
1869
  export namespace Input {
1870
+ /**
1871
+ * A sub-input within an inputs_array item. Same as NodeInput but without the
1872
+ * recursive items field.
1873
+ */
1874
+ export interface Item {
1875
+ /**
1876
+ * The name that must be user to call the model through the API
1877
+ */
1878
+ name: string;
1879
+
1880
+ /**
1881
+ * The data type of the input
1882
+ */
1883
+ type:
1884
+ | 'boolean'
1885
+ | 'file'
1886
+ | 'file_array'
1887
+ | 'inputs_array'
1888
+ | 'model'
1889
+ | 'model_array'
1890
+ | 'number'
1891
+ | 'number_array'
1892
+ | 'string'
1893
+ | 'string_array';
1894
+
1895
+ /**
1896
+ * The allowed values for the input. For \`string\` or \`number\` types, creates a
1897
+ * single-select dropdown. For \`string_array\` type, creates a multi-select
1898
+ * dropdown.
1899
+ */
1900
+ allowedValues?: Array<unknown>;
1901
+
1902
+ /**
1903
+ * Specifies the background behavior for the input. Only available for \`file\` and
1904
+ * \`file_array\` input types with kind \`image\`.
1905
+ */
1906
+ backgroundBehavior?: 'opaque' | 'transparent';
1907
+
1908
+ /**
1909
+ * Whether the input is a color or not. Only available for \`string\` input type.
1910
+ */
1911
+ color?: boolean;
1912
+
1913
+ /**
1914
+ * Whether this input affects the model's cost calculation
1915
+ */
1916
+ costImpact?: boolean;
1917
+
1918
+ /**
1919
+ * The default value for the input
1920
+ */
1921
+ default?: unknown;
1922
+
1923
+ /**
1924
+ * Help text displayed in the UI to provide additional information about the input
1925
+ */
1926
+ description?: string;
1927
+
1928
+ /**
1929
+ * Used to visually group inputs together in the UI. Inputs with the same group
1930
+ * value appear consecutively in the UI.
1931
+ */
1932
+ group?: string;
1933
+
1934
+ /**
1935
+ * Hint text displayed in the UI as a tooltip to guide the user
1936
+ */
1937
+ hint?: string;
1938
+
1939
+ /**
1940
+ * The list of inputs which form an object within a container array. All inputs are
1941
+ * the same as the current object. This is only available for type inputs_array
1942
+ * inputs.
1943
+ */
1944
+ inputs?: Array<{ [key: string]: unknown }>;
1945
+
1946
+ /**
1947
+ * The asset kind of the input. Only taken into account for \`file\` and
1948
+ * \`file_array\` input types. If model provides multiple kinds, the input will be
1949
+ * not able to create the asset on the flight on API side with dataurl without
1950
+ * data:kind, prefix
1951
+ */
1952
+ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
1953
+
1954
+ /**
1955
+ * The label displayed in the UI for this input
1956
+ */
1957
+ label?: string;
1958
+
1959
+ /**
1960
+ * The name of the file input field to use as the mask source
1961
+ */
1962
+ maskFrom?: string;
1963
+
1964
+ /**
1965
+ * The maximum allowed value. Only available for \`number\` and \`array\` input
1966
+ * types.
1967
+ */
1968
+ max?: number;
1969
+
1970
+ /**
1971
+ * The maximum allowed length for \`string\` inputs. Also applies to each item in
1972
+ * \`string_array\`.
1973
+ */
1974
+ maxLength?: number;
1975
+
1976
+ /**
1977
+ * The maximum allowed file size in bytes. Only applies to \`file\` and
1978
+ * \`file_array\` input types. Validated against \`asset.properties.size\` at job
1979
+ * creation time.
1980
+ */
1981
+ maxSize?: number;
1982
+
1983
+ /**
1984
+ * The minimum allowed value. Only available for \`number\` and array input types.
1985
+ */
1986
+ min?: number;
1987
+
1988
+ /**
1989
+ * The minimum allowed length for string inputs. Also applies to each item in
1990
+ * \`string_array\`.
1991
+ */
1992
+ minLength?: number;
1993
+
1994
+ /**
1995
+ * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only
1996
+ * available for \`model_array\` input type.
1997
+ */
1998
+ modelTypes?: Array<
1999
+ | 'custom'
2000
+ | 'elevenlabs-voice'
2001
+ | 'flux.1'
2002
+ | 'flux.1-composition'
2003
+ | 'flux.1-kontext-dev'
2004
+ | 'flux.1-kontext-lora'
2005
+ | 'flux.1-krea-dev'
2006
+ | 'flux.1-krea-lora'
2007
+ | 'flux.1-lora'
2008
+ | 'flux.1-pro'
2009
+ | 'flux.1.1-pro-ultra'
2010
+ | 'flux.2-dev-edit-lora'
2011
+ | 'flux.2-dev-lora'
2012
+ | 'flux.2-klein-4b-edit-lora'
2013
+ | 'flux.2-klein-4b-lora'
2014
+ | 'flux.2-klein-9b-edit-lora'
2015
+ | 'flux.2-klein-9b-lora'
2016
+ | 'flux.2-klein-base-4b-edit-lora'
2017
+ | 'flux.2-klein-base-4b-lora'
2018
+ | 'flux.2-klein-base-9b-edit-lora'
2019
+ | 'flux.2-klein-base-9b-lora'
2020
+ | 'flux1.1-pro'
2021
+ | 'gpt-image-1'
2022
+ | 'qwen-image-2512-lora'
2023
+ | 'qwen-image-edit-2509-lora'
2024
+ | 'qwen-image-edit-2511-lora'
2025
+ | 'qwen-image-edit-lora'
2026
+ | 'qwen-image-lora'
2027
+ | 'sd-1_5'
2028
+ | 'sd-1_5-composition'
2029
+ | 'sd-1_5-lora'
2030
+ | 'sd-xl'
2031
+ | 'sd-xl-composition'
2032
+ | 'sd-xl-lora'
2033
+ | 'zimage-de-turbo-lora'
2034
+ | 'zimage-lora'
2035
+ | 'zimage-turbo-lora'
2036
+ >;
2037
+
2038
+ /**
2039
+ * Whether this input represents a parent asset to assign to the produced assets.
2040
+ * Only available for \`file\` and \`file_array\` input types.
2041
+ *
2042
+ * For \`file_array\`, the parent asset is the first item in the array.
2043
+ */
2044
+ parent?: boolean;
2045
+
2046
+ /**
2047
+ * Placeholder text for the input. Only available for 'string' input type.
2048
+ */
2049
+ placeholder?: string;
2050
+
2051
+ /**
2052
+ * Whether the input is a prompt. When true, displays as a text area with prompt
2053
+ * spark feature. Only available for \`string\` input type.
2054
+ */
2055
+ prompt?: boolean;
2056
+
2057
+ /**
2058
+ * Whether the input is used with prompt spark. Only available for \`string\` input
2059
+ * type.
2060
+ */
2061
+ promptSpark?: boolean;
2062
+
2063
+ /**
2064
+ * The reference to another input or output of the same workflow. Must have at
2065
+ * least one of node or conditional.
2066
+ */
2067
+ ref?: Item.Ref;
2068
+
2069
+ /**
2070
+ * Set of rules that describes when this input is required:
2071
+ *
2072
+ * - \`always\`: Input is always required
2073
+ * - \`ifNotDefined\`: Input is required when another specified input is not
2074
+ * defined
2075
+ * - \`ifDefined\`: Input is required when another specified input is defined
2076
+ * - \`conditionalValues\`: Input is required when another input has a specific
2077
+ * value
2078
+ *
2079
+ * By default, the input is not required.
2080
+ */
2081
+ required?: Item.Required;
2082
+
2083
+ /**
2084
+ * The step increment for numeric inputs. Only available for \`number\` input type.
2085
+ */
2086
+ step?: number;
2087
+
2088
+ /**
2089
+ * The value of the input. This is the value of the input that will be used to run
2090
+ * the node. Only available for flows managed by a WorkflowJob.
2091
+ */
2092
+ value?: unknown;
2093
+ }
2094
+
2095
+ export namespace Item {
2096
+ /**
2097
+ * The reference to another input or output of the same workflow. Must have at
2098
+ * least one of node or conditional.
2099
+ */
2100
+ export interface Ref {
2101
+ /**
2102
+ * The conditional nodes to reference. If the conditional nodes are successful, the
2103
+ * node will be successful. If the conditional nodes are skipped, the node will be
2104
+ * skipped. Contains an array of node ids used to check the status of the nodes.
2105
+ */
2106
+ conditional?: Array<string>;
2107
+
2108
+ /**
2109
+ * This is the desired node output value if ref is an if/else node.
2110
+ */
2111
+ equal?: string;
2112
+
2113
+ /**
2114
+ * The name of the input or output to reference. If the type is 'workflow', the
2115
+ * name is the name of the input of the workflow is required If the type is 'node',
2116
+ * the name is not mandatory, except if you want all outputs of the node. To get
2117
+ * all outputs of a node, you can use the name 'all'.
2118
+ */
2119
+ name?: string;
2120
+
2121
+ /**
2122
+ * The node id or 'workflow' if the source is a workflow input.
2123
+ */
2124
+ node?: string;
2125
+ }
2126
+
2127
+ /**
2128
+ * Set of rules that describes when this input is required:
2129
+ *
2130
+ * - \`always\`: Input is always required
2131
+ * - \`ifNotDefined\`: Input is required when another specified input is not
2132
+ * defined
2133
+ * - \`ifDefined\`: Input is required when another specified input is defined
2134
+ * - \`conditionalValues\`: Input is required when another input has a specific
2135
+ * value
2136
+ *
2137
+ * By default, the input is not required.
2138
+ */
2139
+ export interface Required {
2140
+ /**
2141
+ * Whether the input is always required
2142
+ */
2143
+ always?: boolean;
2144
+
2145
+ /**
2146
+ * Makes this input required when another input has a specific value:
2147
+ *
2148
+ * - Key: name of the input to check
2149
+ * - Value: operation and allowed values that trigger the requirement
2150
+ */
2151
+ conditionalValues?: unknown;
2152
+
2153
+ /**
2154
+ * Makes this input required when another input is defined:
2155
+ *
2156
+ * - Key: name of the input that must be defined
2157
+ * - Value: message to display when this input is required
2158
+ */
2159
+ ifDefined?: unknown;
2160
+
2161
+ /**
2162
+ * Makes this input required when another input is not defined:
2163
+ *
2164
+ * - Key: name of the input that must be undefined
2165
+ * - Value: message to display when this input is required
2166
+ */
2167
+ ifNotDefined?: unknown;
2168
+ }
2169
+ }
2170
+
1551
2171
  /**
1552
2172
  * The reference to another input or output of the same workflow. Must have at
1553
2173
  * least one of node or conditional.
@@ -1716,6 +2336,7 @@ export namespace TrainTriggerResponse {
1716
2336
  | 'txt2img_texture'
1717
2337
  | 'txt2txt'
1718
2338
  | 'txt2video'
2339
+ | 'video23d'
1719
2340
  | 'video2img'
1720
2341
  | 'video2video'
1721
2342
  >;
@@ -1771,6 +2392,7 @@ export namespace TrainTriggerResponse {
1771
2392
  */
1772
2393
  type:
1773
2394
  | 'custom'
2395
+ | 'elevenlabs-voice'
1774
2396
  | 'flux.1'
1775
2397
  | 'flux.1-composition'
1776
2398
  | 'flux.1-kontext-dev'
@@ -1780,14 +2402,32 @@ export namespace TrainTriggerResponse {
1780
2402
  | 'flux.1-lora'
1781
2403
  | 'flux.1-pro'
1782
2404
  | 'flux.1.1-pro-ultra'
2405
+ | 'flux.2-dev-edit-lora'
2406
+ | 'flux.2-dev-lora'
2407
+ | 'flux.2-klein-4b-edit-lora'
2408
+ | 'flux.2-klein-4b-lora'
2409
+ | 'flux.2-klein-9b-edit-lora'
2410
+ | 'flux.2-klein-9b-lora'
2411
+ | 'flux.2-klein-base-4b-edit-lora'
2412
+ | 'flux.2-klein-base-4b-lora'
2413
+ | 'flux.2-klein-base-9b-edit-lora'
2414
+ | 'flux.2-klein-base-9b-lora'
1783
2415
  | 'flux1.1-pro'
1784
2416
  | 'gpt-image-1'
2417
+ | 'qwen-image-2512-lora'
2418
+ | 'qwen-image-edit-2509-lora'
2419
+ | 'qwen-image-edit-2511-lora'
2420
+ | 'qwen-image-edit-lora'
2421
+ | 'qwen-image-lora'
1785
2422
  | 'sd-1_5'
1786
2423
  | 'sd-1_5-composition'
1787
2424
  | 'sd-1_5-lora'
1788
2425
  | 'sd-xl'
1789
2426
  | 'sd-xl-composition'
1790
- | 'sd-xl-lora';
2427
+ | 'sd-xl-lora'
2428
+ | 'zimage-de-turbo-lora'
2429
+ | 'zimage-lora'
2430
+ | 'zimage-turbo-lora';
1791
2431
 
1792
2432
  /**
1793
2433
  * The model last update date as an ISO string (example:
@@ -1799,7 +2439,7 @@ export namespace TrainTriggerResponse {
1799
2439
  * The access restrictions of the model 0: Free plan 25: Creator plan 50: Pro plan
1800
2440
  * 75: Team plan 100: Enterprise plan
1801
2441
  */
1802
- accessRestrictions?: number;
2442
+ accessRestrictions?: 0 | 100 | 25 | 50 | 75;
1803
2443
 
1804
2444
  /**
1805
2445
  * The author user ID (example: "user_VFhihHKMRZyDDnZAJwLb2Q")
@@ -1811,11 +2451,6 @@ export namespace TrainTriggerResponse {
1811
2451
  */
1812
2452
  class?: Model.Class;
1813
2453
 
1814
- /**
1815
- * Compliance and regulatory metadata for the model
1816
- */
1817
- complianceMetadata?: Model.ComplianceMetadata;
1818
-
1819
2454
  /**
1820
2455
  * List of base model IDs compliant with the model (example: ["flux.1-dev",
1821
2456
  * "flux.1-schnell"]) This attribute is mainly used for Flux LoRA models
@@ -1875,6 +2510,11 @@ export namespace TrainTriggerResponse {
1875
2510
  */
1876
2511
  parentModelId?: string;
1877
2512
 
2513
+ /**
2514
+ * Aggregated performance stats
2515
+ */
2516
+ performanceStats?: Model.PerformanceStats;
2517
+
1878
2518
  /**
1879
2519
  * Fine-tune the model's inferences with prompt embedding
1880
2520
  */
@@ -1975,36 +2615,6 @@ export namespace TrainTriggerResponse {
1975
2615
  thumbnails: Array<string>;
1976
2616
  }
1977
2617
 
1978
- /**
1979
- * Compliance and regulatory metadata for the model
1980
- */
1981
- export interface ComplianceMetadata {
1982
- /**
1983
- * Data processing comment (e.g., zeroRetention, temporaryRetention, etc.)
1984
- */
1985
- dataProcessingComment?: 'researchOnly' | 'serviceImprovement' | 'temporaryRetention' | 'zeroRetention';
1986
-
1987
- /**
1988
- * URL to license terms
1989
- */
1990
- licenseTerms?: string;
1991
-
1992
- /**
1993
- * The maintainer of the model
1994
- */
1995
- maintainer?: 'Fal' | 'Provider' | 'Replicate' | 'Scenario';
1996
-
1997
- /**
1998
- * The provider of the model (examples: 'Google', 'AWS', 'BFL', 'Meshy', etc.)
1999
- */
2000
- modelProvider?: string;
2001
-
2002
- /**
2003
- * The sub-processor used for the model
2004
- */
2005
- subProcessor?: 'AWS' | 'Fal' | 'Modal' | 'Provider' | 'Replicate';
2006
- }
2007
-
2008
2618
  export interface Concept {
2009
2619
  /**
2010
2620
  * The model ID (example: "model_eyVcnFJcR92BxBkz7N6g5w")
@@ -2101,6 +2711,11 @@ export namespace TrainTriggerResponse {
2101
2711
  */
2102
2712
  costImpact?: boolean;
2103
2713
 
2714
+ /**
2715
+ * The default value for the input
2716
+ */
2717
+ default?: unknown;
2718
+
2104
2719
  /**
2105
2720
  * Help text displayed in the UI to provide additional information about the input
2106
2721
  */
@@ -2122,11 +2737,13 @@ export namespace TrainTriggerResponse {
2122
2737
  * the same as the current object. This is only available for type inputs_array
2123
2738
  * inputs.
2124
2739
  */
2125
- inputs?: Array<unknown>;
2740
+ inputs?: Array<{ [key: string]: unknown }>;
2126
2741
 
2127
2742
  /**
2128
2743
  * The asset kind of the input. Only taken into account for \`file\` and
2129
- * \`file_array\` input types.
2744
+ * \`file_array\` input types. If model provides multiple kinds, the input will be
2745
+ * not able to create the asset on the flight on API side with dataurl without
2746
+ * data:kind, prefix
2130
2747
  */
2131
2748
  kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
2132
2749
 
@@ -2152,6 +2769,13 @@ export namespace TrainTriggerResponse {
2152
2769
  */
2153
2770
  maxLength?: number;
2154
2771
 
2772
+ /**
2773
+ * The maximum allowed file size in bytes. Only applies to \`file\` and
2774
+ * \`file_array\` input types. Validated against \`asset.properties.size\` at job
2775
+ * creation time.
2776
+ */
2777
+ maxSize?: number;
2778
+
2155
2779
  /**
2156
2780
  * The minimum allowed value. Only available for \`number\` and array input types.
2157
2781
  */
@@ -2169,6 +2793,7 @@ export namespace TrainTriggerResponse {
2169
2793
  */
2170
2794
  modelTypes?: Array<
2171
2795
  | 'custom'
2796
+ | 'elevenlabs-voice'
2172
2797
  | 'flux.1'
2173
2798
  | 'flux.1-composition'
2174
2799
  | 'flux.1-kontext-dev'
@@ -2178,14 +2803,32 @@ export namespace TrainTriggerResponse {
2178
2803
  | 'flux.1-lora'
2179
2804
  | 'flux.1-pro'
2180
2805
  | 'flux.1.1-pro-ultra'
2806
+ | 'flux.2-dev-edit-lora'
2807
+ | 'flux.2-dev-lora'
2808
+ | 'flux.2-klein-4b-edit-lora'
2809
+ | 'flux.2-klein-4b-lora'
2810
+ | 'flux.2-klein-9b-edit-lora'
2811
+ | 'flux.2-klein-9b-lora'
2812
+ | 'flux.2-klein-base-4b-edit-lora'
2813
+ | 'flux.2-klein-base-4b-lora'
2814
+ | 'flux.2-klein-base-9b-edit-lora'
2815
+ | 'flux.2-klein-base-9b-lora'
2181
2816
  | 'flux1.1-pro'
2182
2817
  | 'gpt-image-1'
2818
+ | 'qwen-image-2512-lora'
2819
+ | 'qwen-image-edit-2509-lora'
2820
+ | 'qwen-image-edit-2511-lora'
2821
+ | 'qwen-image-edit-lora'
2822
+ | 'qwen-image-lora'
2183
2823
  | 'sd-1_5'
2184
2824
  | 'sd-1_5-composition'
2185
2825
  | 'sd-1_5-lora'
2186
2826
  | 'sd-xl'
2187
2827
  | 'sd-xl-composition'
2188
2828
  | 'sd-xl-lora'
2829
+ | 'zimage-de-turbo-lora'
2830
+ | 'zimage-lora'
2831
+ | 'zimage-turbo-lora'
2189
2832
  >;
2190
2833
 
2191
2834
  /**
@@ -2282,6 +2925,13 @@ export namespace TrainTriggerResponse {
2282
2925
  * The parameters of the model
2283
2926
  */
2284
2927
  export interface Parameters {
2928
+ /**
2929
+ * Age group of the voice (for professional cloning)
2930
+ *
2931
+ * Only available for ElevenLabs voice training
2932
+ */
2933
+ age?: string;
2934
+
2285
2935
  /**
2286
2936
  * The batch size Less steps, and will increase the learning rate
2287
2937
  *
@@ -2296,6 +2946,14 @@ export namespace TrainTriggerResponse {
2296
2946
  */
2297
2947
  classPrompt?: string;
2298
2948
 
2949
+ /**
2950
+ * Type of voice cloning: "instant" (fast) or "professional" (higher quality,
2951
+ * requires captcha)
2952
+ *
2953
+ * Only available for ElevenLabs voice training
2954
+ */
2955
+ cloneType?: string;
2956
+
2299
2957
  /**
2300
2958
  * The prompt with identifier specifying the instance (or subject) of the class
2301
2959
  * (example: "a daiton dog")
@@ -2308,6 +2966,20 @@ export namespace TrainTriggerResponse {
2308
2966
  */
2309
2967
  conceptPrompt?: string;
2310
2968
 
2969
+ /**
2970
+ * Gender of the voice (for professional cloning)
2971
+ *
2972
+ * Only available for ElevenLabs voice training
2973
+ */
2974
+ gender?: string;
2975
+
2976
+ /**
2977
+ * Language of the audio samples (ISO 639-1 code)
2978
+ *
2979
+ * Only available for ElevenLabs voice training
2980
+ */
2981
+ language?: string;
2982
+
2311
2983
  /**
2312
2984
  * Initial learning rate (after the potential warmup period)
2313
2985
  *
@@ -2442,15 +3114,27 @@ export namespace TrainTriggerResponse {
2442
3114
  /**
2443
3115
  * The dimension of the LoRA update matrices
2444
3116
  *
2445
- * Only available for SDXL and Flux LoRA training
3117
+ * Only available for SDXL (deprecated), Flux LoRA and Musubi training
2446
3118
  *
2447
3119
  * Default value varies depending on the model type:
2448
3120
  *
2449
- * - For SDXL: 64
3121
+ * - For SDXL (deprecated): 64
2450
3122
  * - For Flux: 16
3123
+ * - For Musubi: 64
3124
+ *
3125
+ * Each trainer enforces its own tighter limit (Flux LoRA: [2; 64], Musubi: [2;
3126
+ * 128])
2451
3127
  */
2452
3128
  rank?: number;
2453
3129
 
3130
+ /**
3131
+ * Whether to remove background noise from audio samples before cloning. When
3132
+ * enabled, each sample must be at least 5 seconds long.
3133
+ *
3134
+ * Only available for ElevenLabs voice training
3135
+ */
3136
+ removeBackgroundNoise?: boolean;
3137
+
2454
3138
  /**
2455
3139
  * The prompts to use for each epoch Only available for Flux LoRA training
2456
3140
  */
@@ -2504,12 +3188,148 @@ export namespace TrainTriggerResponse {
2504
3188
  */
2505
3189
  validationPrompt?: string;
2506
3190
 
3191
+ /**
3192
+ * Description of the voice characteristics
3193
+ *
3194
+ * Only available for ElevenLabs voice training
3195
+ */
3196
+ voiceDescription?: string;
3197
+
2507
3198
  /**
2508
3199
  * The Weights And Bias key to use for logging. The maximum length is 40 characters
2509
3200
  */
2510
3201
  wandbKey?: string;
2511
3202
  }
2512
3203
 
3204
+ /**
3205
+ * Aggregated performance stats
3206
+ */
3207
+ export interface PerformanceStats {
3208
+ /**
3209
+ * Performance metrics per variant
3210
+ */
3211
+ variants: Array<PerformanceStats.Variant>;
3212
+
3213
+ /**
3214
+ * Default variant key for quick model comparison
3215
+ */
3216
+ default?: string;
3217
+ }
3218
+
3219
+ export namespace PerformanceStats {
3220
+ /**
3221
+ * Performance stats for a model variant
3222
+ */
3223
+ export interface Variant {
3224
+ /**
3225
+ * The generation capability (example: "txt2img", "img2video", "txt2audio")
3226
+ */
3227
+ capability: string;
3228
+
3229
+ /**
3230
+ * When these stats were last computed (ISO date)
3231
+ */
3232
+ computedAt: string;
3233
+
3234
+ /**
3235
+ * Maximum cost per output asset (CU)
3236
+ */
3237
+ costPerAssetMaxCU: number;
3238
+
3239
+ /**
3240
+ * Minimum cost per output asset (CU)
3241
+ */
3242
+ costPerAssetMinCU: number;
3243
+
3244
+ /**
3245
+ * Median cost per output asset (CU)
3246
+ */
3247
+ costPerAssetP50CU: number;
3248
+
3249
+ /**
3250
+ * Inference latency P50 per output asset (seconds)
3251
+ */
3252
+ inferenceLatencyP50Sec: number;
3253
+
3254
+ /**
3255
+ * Inference latency P75 per output asset (seconds)
3256
+ */
3257
+ inferenceLatencyP75Sec: number;
3258
+
3259
+ /**
3260
+ * Total latency P50 per output asset, including queue time (seconds)
3261
+ */
3262
+ totalLatencyP50Sec: number;
3263
+
3264
+ /**
3265
+ * Total latency P75 per output asset, including queue time (seconds)
3266
+ */
3267
+ totalLatencyP75Sec: number;
3268
+
3269
+ /**
3270
+ * Unique variant identifier (example: "txt2img:1K", "img2video:2K", "txt2audio")
3271
+ */
3272
+ variantKey: string;
3273
+
3274
+ /**
3275
+ * External quality score from arena.ai leaderboard
3276
+ */
3277
+ arenaScore?: Variant.ArenaScore;
3278
+
3279
+ /**
3280
+ * The resolution bucket (example: "0.5K", "1K", "2K", "4K")
3281
+ */
3282
+ resolution?: string;
3283
+ }
3284
+
3285
+ export namespace Variant {
3286
+ /**
3287
+ * External quality score from arena.ai leaderboard
3288
+ */
3289
+ export interface ArenaScore {
3290
+ /**
3291
+ * Arena category (example: "text_to_image", "image_to_video")
3292
+ */
3293
+ arenaCategory: string;
3294
+
3295
+ /**
3296
+ * Model name on arena.ai
3297
+ */
3298
+ arenaModelName: string;
3299
+
3300
+ /**
3301
+ * When this score was last fetched (ISO date)
3302
+ */
3303
+ fetchedAt: string;
3304
+
3305
+ /**
3306
+ * Rank in the arena category
3307
+ */
3308
+ rank: number;
3309
+
3310
+ /**
3311
+ * ELO rating
3312
+ */
3313
+ rating: number;
3314
+
3315
+ /**
3316
+ * ELO rating confidence interval lower bound
3317
+ */
3318
+ ratingLower: number;
3319
+
3320
+ /**
3321
+ * ELO rating confidence interval upper bound
3322
+ */
3323
+ ratingUpper: number;
3324
+
3325
+ /**
3326
+ * Number of human votes
3327
+ */
3328
+ votes: number;
3329
+ }
3330
+ }
3331
+ }
3332
+
2513
3333
  /**
2514
3334
  * A thumbnail for your model
2515
3335
  */
@@ -2583,7 +3403,7 @@ export namespace TrainTriggerResponse {
2583
3403
  /**
2584
3404
  * The stage of the request
2585
3405
  */
2586
- stage: 'pending' | 'queued-for-train' | 'running-train' | 'starting-train';
3406
+ stage: 'pending' | 'pending-captcha' | 'queued-for-train' | 'running-train' | 'starting-train';
2587
3407
 
2588
3408
  /**
2589
3409
  * Timestamp in milliseconds of the last time the training progress was updated
@@ -2771,21 +3591,31 @@ export namespace TrainTriggerResponse {
2771
3591
 
2772
3592
  export interface TrainActionParams {
2773
3593
  /**
2774
- * The action to perform on the model training
3594
+ * Body param: The action to perform on the model training
2775
3595
  */
2776
3596
  action: 'cancel';
3597
+
3598
+ /**
3599
+ * Query param: If set to true, returns the original asset without transformation
3600
+ */
3601
+ originalAssets?: boolean;
2777
3602
  }
2778
3603
 
2779
3604
  export interface TrainTriggerParams {
2780
3605
  /**
2781
3606
  * Query param
2782
3607
  */
2783
- dryRun?: string;
3608
+ dryRun?: unknown;
2784
3609
 
2785
3610
  /**
2786
3611
  * Query param: If set to true, returns the original asset without transformation
2787
3612
  */
2788
- originalAssets?: string;
3613
+ originalAssets?: boolean;
3614
+
3615
+ /**
3616
+ * Query param: Simulate the number of training images, used for dryRun purpose
3617
+ */
3618
+ trainingImagesCount?: number;
2789
3619
 
2790
3620
  /**
2791
3621
  * Body param
@@ -2795,6 +3625,13 @@ export interface TrainTriggerParams {
2795
3625
 
2796
3626
  export namespace TrainTriggerParams {
2797
3627
  export interface Parameters {
3628
+ /**
3629
+ * Age group of the voice (for professional cloning)
3630
+ *
3631
+ * Only available for ElevenLabs voice training
3632
+ */
3633
+ age?: string;
3634
+
2798
3635
  /**
2799
3636
  * The batch size Less steps, and will increase the learning rate
2800
3637
  *
@@ -2809,6 +3646,14 @@ export namespace TrainTriggerParams {
2809
3646
  */
2810
3647
  classPrompt?: string;
2811
3648
 
3649
+ /**
3650
+ * Type of voice cloning: "instant" (fast) or "professional" (higher quality,
3651
+ * requires captcha)
3652
+ *
3653
+ * Only available for ElevenLabs voice training
3654
+ */
3655
+ cloneType?: string;
3656
+
2812
3657
  /**
2813
3658
  * The prompt with identifier specifying the instance (or subject) of the class
2814
3659
  * (example: "a daiton dog")
@@ -2821,6 +3666,20 @@ export namespace TrainTriggerParams {
2821
3666
  */
2822
3667
  conceptPrompt?: string;
2823
3668
 
3669
+ /**
3670
+ * Gender of the voice (for professional cloning)
3671
+ *
3672
+ * Only available for ElevenLabs voice training
3673
+ */
3674
+ gender?: string;
3675
+
3676
+ /**
3677
+ * Language of the audio samples (ISO 639-1 code)
3678
+ *
3679
+ * Only available for ElevenLabs voice training
3680
+ */
3681
+ language?: string;
3682
+
2824
3683
  /**
2825
3684
  * Initial learning rate (after the potential warmup period)
2826
3685
  *
@@ -2955,15 +3814,27 @@ export namespace TrainTriggerParams {
2955
3814
  /**
2956
3815
  * The dimension of the LoRA update matrices
2957
3816
  *
2958
- * Only available for SDXL and Flux LoRA training
3817
+ * Only available for SDXL (deprecated), Flux LoRA and Musubi training
2959
3818
  *
2960
3819
  * Default value varies depending on the model type:
2961
3820
  *
2962
- * - For SDXL: 64
3821
+ * - For SDXL (deprecated): 64
2963
3822
  * - For Flux: 16
3823
+ * - For Musubi: 64
3824
+ *
3825
+ * Each trainer enforces its own tighter limit (Flux LoRA: [2; 64], Musubi: [2;
3826
+ * 128])
2964
3827
  */
2965
3828
  rank?: number;
2966
3829
 
3830
+ /**
3831
+ * Whether to remove background noise from audio samples before cloning. When
3832
+ * enabled, each sample must be at least 5 seconds long.
3833
+ *
3834
+ * Only available for ElevenLabs voice training
3835
+ */
3836
+ removeBackgroundNoise?: boolean;
3837
+
2967
3838
  /**
2968
3839
  * The prompts to use for each epoch Only available for Flux LoRA training
2969
3840
  */
@@ -3017,6 +3888,13 @@ export namespace TrainTriggerParams {
3017
3888
  */
3018
3889
  validationPrompt?: string;
3019
3890
 
3891
+ /**
3892
+ * Description of the voice characteristics
3893
+ *
3894
+ * Only available for ElevenLabs voice training
3895
+ */
3896
+ voiceDescription?: string;
3897
+
3020
3898
  /**
3021
3899
  * The Weights And Bias key to use for logging. The maximum length is 40 characters
3022
3900
  */