@scenario-labs/sdk 0.3.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (232) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +40 -8
  3. package/client.d.mts +36 -16
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +36 -16
  6. package/client.d.ts.map +1 -1
  7. package/client.js +10 -0
  8. package/client.js.map +1 -1
  9. package/client.mjs +10 -0
  10. package/client.mjs.map +1 -1
  11. package/core/pagination.d.mts +153 -0
  12. package/core/pagination.d.mts.map +1 -0
  13. package/core/pagination.d.ts +153 -0
  14. package/core/pagination.d.ts.map +1 -0
  15. package/core/pagination.js +276 -0
  16. package/core/pagination.js.map +1 -0
  17. package/core/pagination.mjs +263 -0
  18. package/core/pagination.mjs.map +1 -0
  19. package/index.d.mts +5 -1
  20. package/index.d.mts.map +1 -1
  21. package/index.d.ts +5 -1
  22. package/index.d.ts.map +1 -1
  23. package/index.js +14 -1
  24. package/index.js.map +1 -1
  25. package/index.mjs +5 -1
  26. package/index.mjs.map +1 -1
  27. package/lib/asset.d.mts +55 -0
  28. package/lib/asset.d.mts.map +1 -0
  29. package/lib/asset.d.ts +55 -0
  30. package/lib/asset.d.ts.map +1 -0
  31. package/lib/asset.js +60 -0
  32. package/lib/asset.js.map +1 -0
  33. package/lib/asset.mjs +54 -0
  34. package/lib/asset.mjs.map +1 -0
  35. package/lib/job.d.mts +13 -1
  36. package/lib/job.d.mts.map +1 -1
  37. package/lib/job.d.ts +13 -1
  38. package/lib/job.d.ts.map +1 -1
  39. package/lib/job.js +18 -1
  40. package/lib/job.js.map +1 -1
  41. package/lib/job.mjs +16 -0
  42. package/lib/job.mjs.map +1 -1
  43. package/lib/models.d.mts +34 -2
  44. package/lib/models.d.mts.map +1 -1
  45. package/lib/models.d.ts +34 -2
  46. package/lib/models.d.ts.map +1 -1
  47. package/lib/models.js +39 -2
  48. package/lib/models.js.map +1 -1
  49. package/lib/models.mjs +37 -1
  50. package/lib/models.mjs.map +1 -1
  51. package/lib/scenario.d.mts +14 -0
  52. package/lib/scenario.d.mts.map +1 -1
  53. package/lib/scenario.d.ts +14 -0
  54. package/lib/scenario.d.ts.map +1 -1
  55. package/lib/scenario.js +14 -0
  56. package/lib/scenario.js.map +1 -1
  57. package/lib/scenario.mjs +14 -0
  58. package/lib/scenario.mjs.map +1 -1
  59. package/lib/upload.d.mts +143 -0
  60. package/lib/upload.d.mts.map +1 -0
  61. package/lib/upload.d.ts +143 -0
  62. package/lib/upload.d.ts.map +1 -0
  63. package/lib/upload.js +242 -0
  64. package/lib/upload.js.map +1 -0
  65. package/lib/upload.mjs +203 -0
  66. package/lib/upload.mjs.map +1 -0
  67. package/lib/workflow.d.mts +13 -2
  68. package/lib/workflow.d.mts.map +1 -1
  69. package/lib/workflow.d.ts +13 -2
  70. package/lib/workflow.d.ts.map +1 -1
  71. package/lib/workflow.js +17 -4
  72. package/lib/workflow.js.map +1 -1
  73. package/lib/workflow.mjs +17 -4
  74. package/lib/workflow.mjs.map +1 -1
  75. package/lib/workflow_import_validator.d.mts +40 -0
  76. package/lib/workflow_import_validator.d.mts.map +1 -0
  77. package/lib/workflow_import_validator.d.ts +40 -0
  78. package/lib/workflow_import_validator.d.ts.map +1 -0
  79. package/lib/workflow_import_validator.js +69 -0
  80. package/lib/workflow_import_validator.js.map +1 -0
  81. package/lib/workflow_import_validator.mjs +64 -0
  82. package/lib/workflow_import_validator.mjs.map +1 -0
  83. package/package.json +11 -1
  84. package/pagination.d.mts +2 -0
  85. package/pagination.d.mts.map +1 -0
  86. package/pagination.d.ts +2 -0
  87. package/pagination.d.ts.map +1 -0
  88. package/pagination.js +6 -0
  89. package/pagination.js.map +1 -0
  90. package/pagination.mjs +2 -0
  91. package/pagination.mjs.map +1 -0
  92. package/resources/assets/assets.d.mts +646 -669
  93. package/resources/assets/assets.d.mts.map +1 -1
  94. package/resources/assets/assets.d.ts +646 -669
  95. package/resources/assets/assets.d.ts.map +1 -1
  96. package/resources/assets/assets.js +3 -2
  97. package/resources/assets/assets.js.map +1 -1
  98. package/resources/assets/assets.mjs +3 -2
  99. package/resources/assets/assets.mjs.map +1 -1
  100. package/resources/assets/index.d.mts +1 -1
  101. package/resources/assets/index.d.mts.map +1 -1
  102. package/resources/assets/index.d.ts +1 -1
  103. package/resources/assets/index.d.ts.map +1 -1
  104. package/resources/assets/index.js.map +1 -1
  105. package/resources/assets/index.mjs.map +1 -1
  106. package/resources/assets/public.d.mts +12 -12
  107. package/resources/assets/public.d.mts.map +1 -1
  108. package/resources/assets/public.d.ts +12 -12
  109. package/resources/assets/public.d.ts.map +1 -1
  110. package/resources/collections/collections.d.mts +38 -49
  111. package/resources/collections/collections.d.mts.map +1 -1
  112. package/resources/collections/collections.d.ts +38 -49
  113. package/resources/collections/collections.d.ts.map +1 -1
  114. package/resources/collections/collections.js +5 -1
  115. package/resources/collections/collections.js.map +1 -1
  116. package/resources/collections/collections.mjs +5 -1
  117. package/resources/collections/collections.mjs.map +1 -1
  118. package/resources/collections/index.d.mts +1 -1
  119. package/resources/collections/index.d.mts.map +1 -1
  120. package/resources/collections/index.d.ts +1 -1
  121. package/resources/collections/index.d.ts.map +1 -1
  122. package/resources/collections/index.js.map +1 -1
  123. package/resources/collections/index.mjs.map +1 -1
  124. package/resources/generate.d.mts +1027 -242
  125. package/resources/generate.d.mts.map +1 -1
  126. package/resources/generate.d.ts +1027 -242
  127. package/resources/generate.d.ts.map +1 -1
  128. package/resources/generate.js +7 -0
  129. package/resources/generate.js.map +1 -1
  130. package/resources/generate.mjs +7 -0
  131. package/resources/generate.mjs.map +1 -1
  132. package/resources/index.d.mts +8 -8
  133. package/resources/index.d.mts.map +1 -1
  134. package/resources/index.d.ts +8 -8
  135. package/resources/index.d.ts.map +1 -1
  136. package/resources/index.js.map +1 -1
  137. package/resources/index.mjs.map +1 -1
  138. package/resources/jobs.d.mts +369 -380
  139. package/resources/jobs.d.mts.map +1 -1
  140. package/resources/jobs.d.ts +369 -380
  141. package/resources/jobs.d.ts.map +1 -1
  142. package/resources/jobs.js +2 -1
  143. package/resources/jobs.js.map +1 -1
  144. package/resources/jobs.mjs +2 -1
  145. package/resources/jobs.mjs.map +1 -1
  146. package/resources/models/description.d.mts +2 -2
  147. package/resources/models/description.d.mts.map +1 -1
  148. package/resources/models/description.d.ts +2 -2
  149. package/resources/models/description.d.ts.map +1 -1
  150. package/resources/models/examples.d.mts +4 -4
  151. package/resources/models/examples.d.mts.map +1 -1
  152. package/resources/models/examples.d.ts +4 -4
  153. package/resources/models/examples.d.ts.map +1 -1
  154. package/resources/models/index.d.mts +1 -1
  155. package/resources/models/index.d.mts.map +1 -1
  156. package/resources/models/index.d.ts +1 -1
  157. package/resources/models/index.d.ts.map +1 -1
  158. package/resources/models/index.js.map +1 -1
  159. package/resources/models/index.mjs.map +1 -1
  160. package/resources/models/models.d.mts +845 -856
  161. package/resources/models/models.d.mts.map +1 -1
  162. package/resources/models/models.d.ts +845 -856
  163. package/resources/models/models.d.ts.map +1 -1
  164. package/resources/models/models.js +2 -1
  165. package/resources/models/models.js.map +1 -1
  166. package/resources/models/models.mjs +2 -1
  167. package/resources/models/models.mjs.map +1 -1
  168. package/resources/models/train.d.mts +2 -2
  169. package/resources/models/train.d.mts.map +1 -1
  170. package/resources/models/train.d.ts +2 -2
  171. package/resources/models/train.d.ts.map +1 -1
  172. package/resources/search.d.mts +215 -295
  173. package/resources/search.d.mts.map +1 -1
  174. package/resources/search.d.ts +215 -295
  175. package/resources/search.d.ts.map +1 -1
  176. package/resources/search.js +9 -2
  177. package/resources/search.js.map +1 -1
  178. package/resources/search.mjs +9 -2
  179. package/resources/search.mjs.map +1 -1
  180. package/resources/tags.d.mts +23 -35
  181. package/resources/tags.d.mts.map +1 -1
  182. package/resources/tags.d.ts +23 -35
  183. package/resources/tags.d.ts.map +1 -1
  184. package/resources/tags.js +2 -1
  185. package/resources/tags.js.map +1 -1
  186. package/resources/tags.mjs +2 -1
  187. package/resources/tags.mjs.map +1 -1
  188. package/resources/usages.d.mts +3 -3
  189. package/resources/usages.d.mts.map +1 -1
  190. package/resources/usages.d.ts +3 -3
  191. package/resources/usages.d.ts.map +1 -1
  192. package/resources/workflows.d.mts +688 -704
  193. package/resources/workflows.d.mts.map +1 -1
  194. package/resources/workflows.d.ts +688 -704
  195. package/resources/workflows.d.ts.map +1 -1
  196. package/resources/workflows.js +5 -1
  197. package/resources/workflows.js.map +1 -1
  198. package/resources/workflows.mjs +5 -1
  199. package/resources/workflows.mjs.map +1 -1
  200. package/src/client.ts +107 -2
  201. package/src/core/pagination.ts +497 -0
  202. package/src/index.ts +11 -1
  203. package/src/lib/asset.ts +85 -0
  204. package/src/lib/job.ts +28 -1
  205. package/src/lib/models.ts +62 -2
  206. package/src/lib/scenario.ts +14 -0
  207. package/src/lib/upload.ts +344 -0
  208. package/src/lib/workflow.ts +29 -4
  209. package/src/lib/workflow_import_validator.ts +104 -0
  210. package/src/pagination.ts +2 -0
  211. package/src/resources/assets/assets.ts +930 -909
  212. package/src/resources/assets/index.ts +2 -0
  213. package/src/resources/assets/public.ts +17 -7
  214. package/src/resources/collections/collections.ts +45 -54
  215. package/src/resources/collections/index.ts +1 -0
  216. package/src/resources/generate.ts +1227 -136
  217. package/src/resources/index.ts +11 -1
  218. package/src/resources/jobs.ts +613 -622
  219. package/src/resources/models/description.ts +4 -0
  220. package/src/resources/models/examples.ts +8 -0
  221. package/src/resources/models/index.ts +1 -0
  222. package/src/resources/models/models.ts +1066 -1064
  223. package/src/resources/models/train.ts +4 -0
  224. package/src/resources/search.ts +239 -327
  225. package/src/resources/tags.ts +32 -39
  226. package/src/resources/usages.ts +5 -0
  227. package/src/resources/workflows.ts +850 -864
  228. package/src/version.ts +1 -1
  229. package/version.d.mts +1 -1
  230. package/version.d.ts +1 -1
  231. package/version.js +1 -1
  232. package/version.mjs +1 -1
@@ -38,6 +38,7 @@ import {
38
38
  TrainingImages,
39
39
  } from './training-images';
40
40
  import { APIPromise } from '../../core/api-promise';
41
+ import { ModelsCursor, type ModelsCursorParams, PagePromise } from '../../core/pagination';
41
42
  import { RequestOptions } from '../../internal/request-options';
42
43
  import { path } from '../../internal/utils/path';
43
44
 
@@ -88,8 +89,8 @@ export class Models extends APIResource {
88
89
  list(
89
90
  query: ModelListParams | null | undefined = {},
90
91
  options?: RequestOptions,
91
- ): APIPromise<ModelListResponse> {
92
- return this._client.get('/models', { query, ...options });
92
+ ): PagePromise<ModelListResponsesModelsCursor, ModelListResponse> {
93
+ return this._client.getAPIList('/models', ModelsCursor<ModelListResponse>, { query, ...options });
93
94
  }
94
95
 
95
96
  /**
@@ -163,6 +164,8 @@ export class Models extends APIResource {
163
164
  }
164
165
  }
165
166
 
167
+ export type ModelListResponsesModelsCursor = ModelsCursor<ModelListResponse>;
168
+
166
169
  export interface ModelCreateResponse {
167
170
  model: ModelCreateResponse.Model;
168
171
  }
@@ -181,6 +184,7 @@ export namespace ModelCreateResponse {
181
184
  capabilities: Array<
182
185
  | '3d23d'
183
186
  | 'audio2audio'
187
+ | 'audio2video'
184
188
  | 'controlnet'
185
189
  | 'controlnet_img2img'
186
190
  | 'controlnet_inpaint'
@@ -207,6 +211,7 @@ export namespace ModelCreateResponse {
207
211
  | 'txt2txt'
208
212
  | 'txt2video'
209
213
  | 'video23d'
214
+ | 'video2audio'
210
215
  | 'video2img'
211
216
  | 'video2video'
212
217
  >;
@@ -1477,6 +1482,7 @@ export namespace ModelRetrieveResponse {
1477
1482
  capabilities: Array<
1478
1483
  | '3d23d'
1479
1484
  | 'audio2audio'
1485
+ | 'audio2video'
1480
1486
  | 'controlnet'
1481
1487
  | 'controlnet_img2img'
1482
1488
  | 'controlnet_inpaint'
@@ -1503,6 +1509,7 @@ export namespace ModelRetrieveResponse {
1503
1509
  | 'txt2txt'
1504
1510
  | 'txt2video'
1505
1511
  | 'video23d'
1512
+ | 'video2audio'
1506
1513
  | 'video2img'
1507
1514
  | 'video2video'
1508
1515
  >;
@@ -2773,6 +2780,7 @@ export namespace ModelUpdateResponse {
2773
2780
  capabilities: Array<
2774
2781
  | '3d23d'
2775
2782
  | 'audio2audio'
2783
+ | 'audio2video'
2776
2784
  | 'controlnet'
2777
2785
  | 'controlnet_img2img'
2778
2786
  | 'controlnet_inpaint'
@@ -2799,6 +2807,7 @@ export namespace ModelUpdateResponse {
2799
2807
  | 'txt2txt'
2800
2808
  | 'txt2video'
2801
2809
  | 'video23d'
2810
+ | 'video2audio'
2802
2811
  | 'video2img'
2803
2812
  | 'video2video'
2804
2813
  >;
@@ -4052,117 +4061,510 @@ export namespace ModelUpdateResponse {
4052
4061
  }
4053
4062
 
4054
4063
  export interface ModelListResponse {
4055
- models: Array<ModelListResponse.Model>;
4064
+ /**
4065
+ * The model ID (example: "model_eyVcnFJcR92BxBkz7N6g5w")
4066
+ */
4067
+ id: string;
4068
+
4069
+ /**
4070
+ * List of model capabilities (example: ["txt2img", "img2img",
4071
+ * "txt2img_ip_adapter", ...])
4072
+ */
4073
+ capabilities: Array<
4074
+ | '3d23d'
4075
+ | 'audio2audio'
4076
+ | 'audio2video'
4077
+ | 'controlnet'
4078
+ | 'controlnet_img2img'
4079
+ | 'controlnet_inpaint'
4080
+ | 'controlnet_inpaint_ip_adapter'
4081
+ | 'controlnet_ip_adapter'
4082
+ | 'controlnet_reference'
4083
+ | 'controlnet_texture'
4084
+ | 'img23d'
4085
+ | 'img2img'
4086
+ | 'img2img_ip_adapter'
4087
+ | 'img2img_texture'
4088
+ | 'img2txt'
4089
+ | 'img2video'
4090
+ | 'inpaint'
4091
+ | 'inpaint_ip_adapter'
4092
+ | 'outpaint'
4093
+ | 'reference'
4094
+ | 'reference_texture'
4095
+ | 'txt23d'
4096
+ | 'txt2audio'
4097
+ | 'txt2img'
4098
+ | 'txt2img_ip_adapter'
4099
+ | 'txt2img_texture'
4100
+ | 'txt2txt'
4101
+ | 'txt2video'
4102
+ | 'video23d'
4103
+ | 'video2audio'
4104
+ | 'video2img'
4105
+ | 'video2video'
4106
+ >;
4107
+
4108
+ /**
4109
+ * A list of CollectionId this model belongs to
4110
+ */
4111
+ collectionIds: Array<string>;
4112
+
4113
+ /**
4114
+ * The model creation date as an ISO string (example: "2023-02-03T11:19:41.579Z")
4115
+ */
4116
+ createdAt: string;
4117
+
4118
+ /**
4119
+ * Whether the model is a custom model and can be used only with POST
4120
+ * /generate/custom/{modelId} endpoint
4121
+ */
4122
+ custom: boolean;
4123
+
4124
+ /**
4125
+ * List of all example asset IDs setup by the model owner
4126
+ */
4127
+ exampleAssetIds: Array<string>;
4128
+
4129
+ /**
4130
+ * The privacy of the model (default: private)
4131
+ */
4132
+ privacy: 'private' | 'public' | 'unlisted';
4133
+
4134
+ /**
4135
+ * The source of the model
4136
+ */
4137
+ source: 'civitai' | 'huggingface' | 'other' | 'scenario';
4138
+
4139
+ /**
4140
+ * The model status
4141
+ */
4142
+ status: 'copying' | 'failed' | 'new' | 'trained' | 'training' | 'training-canceled';
4143
+
4144
+ /**
4145
+ * The associated tags (example: ["sci-fi", "landscape"])
4146
+ */
4147
+ tags: Array<string>;
4148
+
4149
+ /**
4150
+ * The total number of training images
4151
+ */
4152
+ trainingImagesNumber: number;
4153
+
4154
+ /**
4155
+ * The model type (example: "flux.1-lora")
4156
+ */
4157
+ type:
4158
+ | 'custom'
4159
+ | 'elevenlabs-voice'
4160
+ | 'flux.1'
4161
+ | 'flux.1-composition'
4162
+ | 'flux.1-kontext-dev'
4163
+ | 'flux.1-kontext-lora'
4164
+ | 'flux.1-krea-dev'
4165
+ | 'flux.1-krea-lora'
4166
+ | 'flux.1-lora'
4167
+ | 'flux.1-pro'
4168
+ | 'flux.1.1-pro-ultra'
4169
+ | 'flux.2-dev-edit-lora'
4170
+ | 'flux.2-dev-lora'
4171
+ | 'flux.2-klein-4b-edit-lora'
4172
+ | 'flux.2-klein-4b-lora'
4173
+ | 'flux.2-klein-9b-edit-lora'
4174
+ | 'flux.2-klein-9b-lora'
4175
+ | 'flux.2-klein-base-4b-edit-lora'
4176
+ | 'flux.2-klein-base-4b-lora'
4177
+ | 'flux.2-klein-base-9b-edit-lora'
4178
+ | 'flux.2-klein-base-9b-lora'
4179
+ | 'flux1.1-pro'
4180
+ | 'gpt-image-1'
4181
+ | 'qwen-image-2512-lora'
4182
+ | 'qwen-image-edit-2509-lora'
4183
+ | 'qwen-image-edit-2511-lora'
4184
+ | 'qwen-image-edit-lora'
4185
+ | 'qwen-image-lora'
4186
+ | 'sd-1_5'
4187
+ | 'sd-1_5-composition'
4188
+ | 'sd-1_5-lora'
4189
+ | 'sd-xl'
4190
+ | 'sd-xl-composition'
4191
+ | 'sd-xl-lora'
4192
+ | 'zimage-de-turbo-lora'
4193
+ | 'zimage-lora'
4194
+ | 'zimage-turbo-lora';
4195
+
4196
+ /**
4197
+ * The model last update date as an ISO string (example:
4198
+ * "2023-02-03T11:19:41.579Z")
4199
+ */
4200
+ updatedAt: string;
4201
+
4202
+ /**
4203
+ * The access restrictions of the model 0: Free plan 25: Creator plan 50: Pro plan
4204
+ * 75: Team plan 100: Enterprise plan
4205
+ */
4206
+ accessRestrictions?: 0 | 100 | 25 | 50 | 75;
4207
+
4208
+ /**
4209
+ * The author user ID (example: "user_VFhihHKMRZyDDnZAJwLb2Q")
4210
+ */
4211
+ authorId?: string;
4212
+
4213
+ /**
4214
+ * The class of the model
4215
+ */
4216
+ class?: ModelListResponse.Class;
4217
+
4218
+ /**
4219
+ * List of base model IDs compliant with the model (example: ["flux.1-dev",
4220
+ * "flux.1-schnell"]) This attribute is mainly used for Flux LoRA models
4221
+ */
4222
+ compliantModelIds?: Array<string>;
4223
+
4224
+ /**
4225
+ * The concepts is required for the type model: composition
4226
+ */
4227
+ concepts?: Array<ModelListResponse.Concept>;
4228
+
4229
+ /**
4230
+ * The epoch of the model. Only available for Flux Lora Trained models. If not set,
4231
+ * uses the final model epoch (latest)
4232
+ */
4233
+ epoch?: string;
4234
+
4235
+ /**
4236
+ * The epochs of the model. Only available for Flux Lora Trained models.
4237
+ */
4238
+ epochs?: Array<ModelListResponse.Epoch>;
4239
+
4240
+ /**
4241
+ * The inputs of the model. Only used for custom models. To retrieve this list, get
4242
+ * it by modelId with GET /models/{modelId}
4243
+ */
4244
+ inputs?: Array<ModelListResponse.Input>;
4245
+
4246
+ /**
4247
+ * The model keyword, this is a legacy parameter, please use conceptPrompt in
4248
+ * parameters
4249
+ */
4250
+ modelKeyword?: string;
4251
+
4252
+ /**
4253
+ * The model name (example: "Cinematic Realism")
4254
+ */
4255
+ name?: string;
4256
+
4257
+ /**
4258
+ * Fine-tune the model's inferences with negative prompt embedding
4259
+ */
4260
+ negativePromptEmbedding?: string;
4261
+
4262
+ /**
4263
+ * The owner ID (example: "team_VFhihHKMRZyDDnZAJwLb2Q")
4264
+ */
4265
+ ownerId?: string;
4266
+
4267
+ /**
4268
+ * The parameters of the model
4269
+ */
4270
+ parameters?: ModelListResponse.Parameters;
4271
+
4272
+ /**
4273
+ * The id of the parent model
4274
+ */
4275
+ parentModelId?: string;
4276
+
4277
+ /**
4278
+ * Aggregated performance stats
4279
+ */
4280
+ performanceStats?: ModelListResponse.PerformanceStats;
4281
+
4282
+ /**
4283
+ * Fine-tune the model's inferences with prompt embedding
4284
+ */
4285
+ promptEmbedding?: string;
4056
4286
 
4057
4287
  /**
4058
- * A token to query the next page of models
4288
+ * The model short description (example: "This model generates highly detailed
4289
+ * cinematic scenes.")
4059
4290
  */
4060
- nextPaginationToken?: string;
4291
+ shortDescription?: string;
4292
+
4293
+ /**
4294
+ * The date when the model will be soft deleted (only for Free plan)
4295
+ */
4296
+ softDeletionOn?: string;
4297
+
4298
+ /**
4299
+ * A thumbnail for your model
4300
+ */
4301
+ thumbnail?: ModelListResponse.Thumbnail;
4302
+
4303
+ /**
4304
+ * Array of training image pairs
4305
+ */
4306
+ trainingImagePairs?: Array<ModelListResponse.TrainingImagePair>;
4307
+
4308
+ /**
4309
+ * The URLs of the first 3 training images of the model. To retrieve the full set
4310
+ * of images, get it by modelId
4311
+ */
4312
+ trainingImages?: Array<ModelListResponse.TrainingImage>;
4313
+
4314
+ /**
4315
+ * Additional information about the training progress of the model
4316
+ */
4317
+ trainingProgress?: ModelListResponse.TrainingProgress;
4318
+
4319
+ /**
4320
+ * Additional information about the model's training
4321
+ */
4322
+ trainingStats?: ModelListResponse.TrainingStats;
4323
+
4324
+ /**
4325
+ * The UI configuration for the model
4326
+ */
4327
+ uiConfig?: ModelListResponse.UiConfig;
4328
+
4329
+ /**
4330
+ * (Deprecated) The user ID (example: "user_VFhihHKMRZyDDnZAJwLb2Q")
4331
+ */
4332
+ userId?: string;
4061
4333
  }
4062
4334
 
4063
4335
  export namespace ModelListResponse {
4064
- export interface Model {
4336
+ /**
4337
+ * The class of the model
4338
+ */
4339
+ export interface Class {
4065
4340
  /**
4066
- * The model ID (example: "model_eyVcnFJcR92BxBkz7N6g5w")
4341
+ * The category slug of the class (example: "art-style")
4067
4342
  */
4068
- id: string;
4343
+ category: string;
4069
4344
 
4070
4345
  /**
4071
- * List of model capabilities (example: ["txt2img", "img2img",
4072
- * "txt2img_ip_adapter", ...])
4346
+ * The concept prompt of the class (example: "a sks character design")
4073
4347
  */
4074
- capabilities: Array<
4075
- | '3d23d'
4076
- | 'audio2audio'
4077
- | 'controlnet'
4078
- | 'controlnet_img2img'
4079
- | 'controlnet_inpaint'
4080
- | 'controlnet_inpaint_ip_adapter'
4081
- | 'controlnet_ip_adapter'
4082
- | 'controlnet_reference'
4083
- | 'controlnet_texture'
4084
- | 'img23d'
4085
- | 'img2img'
4086
- | 'img2img_ip_adapter'
4087
- | 'img2img_texture'
4088
- | 'img2txt'
4089
- | 'img2video'
4090
- | 'inpaint'
4091
- | 'inpaint_ip_adapter'
4092
- | 'outpaint'
4093
- | 'reference'
4094
- | 'reference_texture'
4095
- | 'txt23d'
4096
- | 'txt2audio'
4097
- | 'txt2img'
4098
- | 'txt2img_ip_adapter'
4099
- | 'txt2img_texture'
4100
- | 'txt2txt'
4101
- | 'txt2video'
4102
- | 'video23d'
4103
- | 'video2img'
4104
- | 'video2video'
4105
- >;
4348
+ conceptPrompt: string;
4106
4349
 
4107
4350
  /**
4108
- * A list of CollectionId this model belongs to
4351
+ * The model ID of the class (example: "stable-diffusion-v1-5")
4109
4352
  */
4110
- collectionIds: Array<string>;
4353
+ modelId: string;
4111
4354
 
4112
4355
  /**
4113
- * The model creation date as an ISO string (example: "2023-02-03T11:19:41.579Z")
4356
+ * The class name (example: "Character Design")
4114
4357
  */
4115
- createdAt: string;
4358
+ name: string;
4116
4359
 
4117
4360
  /**
4118
- * Whether the model is a custom model and can be used only with POST
4119
- * /generate/custom/{modelId} endpoint
4361
+ * The class prompt (example: "a character design")
4120
4362
  */
4121
- custom: boolean;
4363
+ prompt: string;
4122
4364
 
4123
4365
  /**
4124
- * List of all example asset IDs setup by the model owner
4366
+ * The class slug (example: "art-style-character-design")
4125
4367
  */
4126
- exampleAssetIds: Array<string>;
4368
+ slug: string;
4127
4369
 
4128
4370
  /**
4129
- * The privacy of the model (default: private)
4371
+ * The class status (only published classes are listed, but unpublished classes can
4372
+ * still appear in existing models)
4130
4373
  */
4131
- privacy: 'private' | 'public' | 'unlisted';
4374
+ status: 'published' | 'unpublished';
4132
4375
 
4133
4376
  /**
4134
- * The source of the model
4377
+ * Some example images URLs to showcase the class
4135
4378
  */
4136
- source: 'civitai' | 'huggingface' | 'other' | 'scenario';
4379
+ thumbnails: Array<string>;
4380
+ }
4137
4381
 
4382
+ export interface Concept {
4138
4383
  /**
4139
- * The model status
4384
+ * The model ID (example: "model_eyVcnFJcR92BxBkz7N6g5w")
4140
4385
  */
4141
- status: 'copying' | 'failed' | 'new' | 'trained' | 'training' | 'training-canceled';
4386
+ modelId: string;
4142
4387
 
4143
4388
  /**
4144
- * The associated tags (example: ["sci-fi", "landscape"])
4389
+ * The scale of the model (example: 1.0) For Flux Kontext Prompt Editing, the scale
4390
+ * is between 0 and 2.
4145
4391
  */
4146
- tags: Array<string>;
4392
+ scale: number;
4147
4393
 
4148
4394
  /**
4149
- * The total number of training images
4395
+ * The epoch of the model (example: "000001") Only available for Flux Lora Trained
4396
+ * models
4150
4397
  */
4151
- trainingImagesNumber: number;
4398
+ modelEpoch?: string;
4399
+ }
4152
4400
 
4401
+ export interface Epoch {
4153
4402
  /**
4154
- * The model type (example: "flux.1-lora")
4403
+ * The epoch hash to identify the epoch
4404
+ */
4405
+ epoch: string;
4406
+
4407
+ /**
4408
+ * The assets of the epoch if sample prompts as been supplied during training
4409
+ */
4410
+ assets?: Array<Epoch.Asset>;
4411
+ }
4412
+
4413
+ export namespace Epoch {
4414
+ export interface Asset {
4415
+ /**
4416
+ * The AssetId of the image during training (example:
4417
+ * "asset_GTrL3mq4SXWyMxkOHRxlpw")
4418
+ */
4419
+ assetId: string;
4420
+
4421
+ /**
4422
+ * The url of the asset
4423
+ */
4424
+ url: string;
4425
+ }
4426
+ }
4427
+
4428
+ /**
4429
+ * Defines the input parameters for a model. Use this to understand the available
4430
+ * input parameters for a given `modelId` when calling
4431
+ * `POST /generate/custom/{modelId}`. See {@link
4432
+ * https://docs.scenario.com/docs/video-generation} for examples.
4433
+ */
4434
+ export interface Input {
4435
+ /**
4436
+ * The name that must be user to call the model through the API
4437
+ */
4438
+ name: string;
4439
+
4440
+ /**
4441
+ * The data type of the input
4155
4442
  */
4156
4443
  type:
4157
- | 'custom'
4158
- | 'elevenlabs-voice'
4159
- | 'flux.1'
4160
- | 'flux.1-composition'
4161
- | 'flux.1-kontext-dev'
4162
- | 'flux.1-kontext-lora'
4163
- | 'flux.1-krea-dev'
4164
- | 'flux.1-krea-lora'
4165
- | 'flux.1-lora'
4444
+ | 'boolean'
4445
+ | 'file'
4446
+ | 'file_array'
4447
+ | 'inputs_array'
4448
+ | 'model'
4449
+ | 'model_array'
4450
+ | 'number'
4451
+ | 'number_array'
4452
+ | 'string'
4453
+ | 'string_array';
4454
+
4455
+ /**
4456
+ * The allowed values for the input. For \`string\` or \`number\` types, creates a
4457
+ * single-select dropdown. For \`string_array\` type, creates a multi-select
4458
+ * dropdown.
4459
+ */
4460
+ allowedValues?: Array<unknown>;
4461
+
4462
+ /**
4463
+ * Specifies the background behavior for the input. Only available for \`file\` and
4464
+ * \`file_array\` input types with kind \`image\`.
4465
+ */
4466
+ backgroundBehavior?: 'opaque' | 'transparent';
4467
+
4468
+ /**
4469
+ * Whether the input is a color or not. Only available for \`string\` input type.
4470
+ */
4471
+ color?: boolean;
4472
+
4473
+ /**
4474
+ * Whether this input affects the model's cost calculation
4475
+ */
4476
+ costImpact?: boolean;
4477
+
4478
+ /**
4479
+ * The default value for the input
4480
+ */
4481
+ default?: unknown;
4482
+
4483
+ /**
4484
+ * Help text displayed in the UI to provide additional information about the input
4485
+ */
4486
+ description?: string;
4487
+
4488
+ /**
4489
+ * Used to visually group inputs together in the UI. Inputs with the same group
4490
+ * value appear consecutively in the UI.
4491
+ */
4492
+ group?: string;
4493
+
4494
+ /**
4495
+ * Hint text displayed in the UI as a tooltip to guide the user
4496
+ */
4497
+ hint?: string;
4498
+
4499
+ /**
4500
+ * The list of inputs which form an object within a container array. All inputs are
4501
+ * the same as the current object. This is only available for type inputs_array
4502
+ * inputs.
4503
+ */
4504
+ inputs?: Array<{ [key: string]: unknown }>;
4505
+
4506
+ /**
4507
+ * The asset kind of the input. Only taken into account for \`file\` and
4508
+ * \`file_array\` input types. If model provides multiple kinds, the input will be
4509
+ * not able to create the asset on the flight on API side with dataurl without
4510
+ * data:kind, prefix
4511
+ */
4512
+ kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
4513
+
4514
+ /**
4515
+ * The label displayed in the UI for this input
4516
+ */
4517
+ label?: string;
4518
+
4519
+ /**
4520
+ * The name of the file input field to use as the mask source
4521
+ */
4522
+ maskFrom?: string;
4523
+
4524
+ /**
4525
+ * The maximum allowed value. Only available for \`number\` and \`array\` input
4526
+ * types.
4527
+ */
4528
+ max?: number;
4529
+
4530
+ /**
4531
+ * The maximum allowed length for \`string\` inputs. Also applies to each item in
4532
+ * \`string_array\`.
4533
+ */
4534
+ maxLength?: number;
4535
+
4536
+ /**
4537
+ * The maximum allowed file size in bytes. Only applies to \`file\` and
4538
+ * \`file_array\` input types. Validated against \`asset.properties.size\` at job
4539
+ * creation time.
4540
+ */
4541
+ maxSize?: number;
4542
+
4543
+ /**
4544
+ * The minimum allowed value. Only available for \`number\` and array input types.
4545
+ */
4546
+ min?: number;
4547
+
4548
+ /**
4549
+ * The minimum allowed length for string inputs. Also applies to each item in
4550
+ * \`string_array\`.
4551
+ */
4552
+ minLength?: number;
4553
+
4554
+ /**
4555
+ * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only
4556
+ * available for \`model_array\` input type.
4557
+ */
4558
+ modelTypes?: Array<
4559
+ | 'custom'
4560
+ | 'elevenlabs-voice'
4561
+ | 'flux.1'
4562
+ | 'flux.1-composition'
4563
+ | 'flux.1-kontext-dev'
4564
+ | 'flux.1-kontext-lora'
4565
+ | 'flux.1-krea-dev'
4566
+ | 'flux.1-krea-lora'
4567
+ | 'flux.1-lora'
4166
4568
  | 'flux.1-pro'
4167
4569
  | 'flux.1.1-pro-ultra'
4168
4570
  | 'flux.2-dev-edit-lora'
@@ -4190,1165 +4592,763 @@ export namespace ModelListResponse {
4190
4592
  | 'sd-xl-lora'
4191
4593
  | 'zimage-de-turbo-lora'
4192
4594
  | 'zimage-lora'
4193
- | 'zimage-turbo-lora';
4595
+ | 'zimage-turbo-lora'
4596
+ >;
4194
4597
 
4195
4598
  /**
4196
- * The model last update date as an ISO string (example:
4197
- * "2023-02-03T11:19:41.579Z")
4599
+ * Whether this input represents a parent asset to assign to the produced assets.
4600
+ * Only available for \`file\` and \`file_array\` input types.
4601
+ *
4602
+ * For \`file_array\`, the parent asset is the first item in the array.
4198
4603
  */
4199
- updatedAt: string;
4604
+ parent?: boolean;
4200
4605
 
4201
4606
  /**
4202
- * The access restrictions of the model 0: Free plan 25: Creator plan 50: Pro plan
4203
- * 75: Team plan 100: Enterprise plan
4607
+ * Placeholder text for the input. Only available for 'string' input type.
4204
4608
  */
4205
- accessRestrictions?: 0 | 100 | 25 | 50 | 75;
4609
+ placeholder?: string;
4206
4610
 
4207
4611
  /**
4208
- * The author user ID (example: "user_VFhihHKMRZyDDnZAJwLb2Q")
4612
+ * Whether the input is a prompt. When true, displays as a text area with prompt
4613
+ * spark feature. Only available for \`string\` input type.
4209
4614
  */
4210
- authorId?: string;
4615
+ prompt?: boolean;
4211
4616
 
4212
4617
  /**
4213
- * The class of the model
4618
+ * Whether the input is used with prompt spark. Only available for \`string\` input
4619
+ * type.
4214
4620
  */
4215
- class?: Model.Class;
4621
+ promptSpark?: boolean;
4216
4622
 
4217
4623
  /**
4218
- * List of base model IDs compliant with the model (example: ["flux.1-dev",
4219
- * "flux.1-schnell"]) This attribute is mainly used for Flux LoRA models
4624
+ * Set of rules that describes when this input is required:
4625
+ *
4626
+ * - \`always\`: Input is always required
4627
+ * - \`ifNotDefined\`: Input is required when another specified input is not
4628
+ * defined
4629
+ * - \`ifDefined\`: Input is required when another specified input is defined
4630
+ * - \`conditionalValues\`: Input is required when another input has a specific
4631
+ * value
4632
+ *
4633
+ * By default, the input is not required.
4220
4634
  */
4221
- compliantModelIds?: Array<string>;
4635
+ required?: Input.Required;
4222
4636
 
4223
4637
  /**
4224
- * The concepts is required for the type model: composition
4638
+ * The step increment for numeric inputs. Only available for \`number\` input type.
4225
4639
  */
4226
- concepts?: Array<Model.Concept>;
4640
+ step?: number;
4641
+ }
4227
4642
 
4643
+ export namespace Input {
4228
4644
  /**
4229
- * The epoch of the model. Only available for Flux Lora Trained models. If not set,
4230
- * uses the final model epoch (latest)
4645
+ * Set of rules that describes when this input is required:
4646
+ *
4647
+ * - \`always\`: Input is always required
4648
+ * - \`ifNotDefined\`: Input is required when another specified input is not
4649
+ * defined
4650
+ * - \`ifDefined\`: Input is required when another specified input is defined
4651
+ * - \`conditionalValues\`: Input is required when another input has a specific
4652
+ * value
4653
+ *
4654
+ * By default, the input is not required.
4231
4655
  */
4232
- epoch?: string;
4656
+ export interface Required {
4657
+ /**
4658
+ * Whether the input is always required
4659
+ */
4660
+ always?: boolean;
4233
4661
 
4234
- /**
4235
- * The epochs of the model. Only available for Flux Lora Trained models.
4236
- */
4237
- epochs?: Array<Model.Epoch>;
4662
+ /**
4663
+ * Makes this input required when another input has a specific value:
4664
+ *
4665
+ * - Key: name of the input to check
4666
+ * - Value: operation and allowed values that trigger the requirement
4667
+ */
4668
+ conditionalValues?: unknown;
4669
+
4670
+ /**
4671
+ * Makes this input required when another input is defined:
4672
+ *
4673
+ * - Key: name of the input that must be defined
4674
+ * - Value: message to display when this input is required
4675
+ */
4676
+ ifDefined?: unknown;
4677
+
4678
+ /**
4679
+ * Makes this input required when another input is not defined:
4680
+ *
4681
+ * - Key: name of the input that must be undefined
4682
+ * - Value: message to display when this input is required
4683
+ */
4684
+ ifNotDefined?: unknown;
4685
+ }
4686
+ }
4238
4687
 
4688
+ /**
4689
+ * The parameters of the model
4690
+ */
4691
+ export interface Parameters {
4239
4692
  /**
4240
- * The inputs of the model. Only used for custom models. To retrieve this list, get
4241
- * it by modelId with GET /models/{modelId}
4693
+ * Age group of the voice (for professional cloning)
4694
+ *
4695
+ * Only available for ElevenLabs voice training
4242
4696
  */
4243
- inputs?: Array<Model.Input>;
4697
+ age?: string;
4244
4698
 
4245
4699
  /**
4246
- * The model keyword, this is a legacy parameter, please use conceptPrompt in
4247
- * parameters
4700
+ * The batch size Less steps, and will increase the learning rate
4701
+ *
4702
+ * Only available for Flux LoRA training
4248
4703
  */
4249
- modelKeyword?: string;
4704
+ batchSize?: number;
4250
4705
 
4251
4706
  /**
4252
- * The model name (example: "Cinematic Realism")
4707
+ * The prompt to specify images in the same class as provided instance images
4708
+ *
4709
+ * Only available for SD15 training
4253
4710
  */
4254
- name?: string;
4711
+ classPrompt?: string;
4255
4712
 
4256
4713
  /**
4257
- * Fine-tune the model's inferences with negative prompt embedding
4714
+ * Type of voice cloning: "instant" (fast) or "professional" (higher quality,
4715
+ * requires captcha)
4716
+ *
4717
+ * Only available for ElevenLabs voice training
4258
4718
  */
4259
- negativePromptEmbedding?: string;
4719
+ cloneType?: string;
4260
4720
 
4261
4721
  /**
4262
- * The owner ID (example: "team_VFhihHKMRZyDDnZAJwLb2Q")
4722
+ * The prompt with identifier specifying the instance (or subject) of the class
4723
+ * (example: "a daiton dog")
4724
+ *
4725
+ * Default value varies depending on the model type:
4726
+ *
4727
+ * - For SD1.5: "daiton" if no class is associated with the model
4728
+ * - For SDXL: "daiton"
4729
+ * - For Flux: ""
4263
4730
  */
4264
- ownerId?: string;
4731
+ conceptPrompt?: string;
4265
4732
 
4266
4733
  /**
4267
- * The parameters of the model
4734
+ * Gender of the voice (for professional cloning)
4735
+ *
4736
+ * Only available for ElevenLabs voice training
4268
4737
  */
4269
- parameters?: Model.Parameters;
4738
+ gender?: string;
4270
4739
 
4271
4740
  /**
4272
- * The id of the parent model
4741
+ * Language of the audio samples (ISO 639-1 code)
4742
+ *
4743
+ * Only available for ElevenLabs voice training
4273
4744
  */
4274
- parentModelId?: string;
4745
+ language?: string;
4275
4746
 
4276
4747
  /**
4277
- * Aggregated performance stats
4748
+ * Initial learning rate (after the potential warmup period)
4749
+ *
4750
+ * Default value varies depending on the model type:
4751
+ *
4752
+ * - For SD1.5 and SDXL: 0.000005
4753
+ * - For Flux: 0.0001
4278
4754
  */
4279
- performanceStats?: Model.PerformanceStats;
4755
+ learningRate?: number;
4280
4756
 
4281
4757
  /**
4282
- * Fine-tune the model's inferences with prompt embedding
4758
+ * Initial learning rate (after the potential warmup period) for the text encoder
4759
+ *
4760
+ * Maximum [Flux LoRA: 0.001] Default [SDXL: 0.00005 | Flux LoRA: 0.00001] Minimum
4761
+ * [SDXL: 0 | Flux LoRA: 0.000001]
4283
4762
  */
4284
- promptEmbedding?: string;
4763
+ learningRateTextEncoder?: number;
4285
4764
 
4286
4765
  /**
4287
- * The model short description (example: "This model generates highly detailed
4288
- * cinematic scenes.")
4766
+ * Initial learning rate (after the potential warmup period) for the UNet
4767
+ *
4768
+ * Only available for SDXL LoRA training
4289
4769
  */
4290
- shortDescription?: string;
4770
+ learningRateUnet?: number;
4291
4771
 
4292
4772
  /**
4293
- * The date when the model will be soft deleted (only for Free plan)
4773
+ * The scheduler type to use (default: "constant")
4774
+ *
4775
+ * Only available for SD15 and SDXL LoRA training
4294
4776
  */
4295
- softDeletionOn?: string;
4777
+ lrScheduler?:
4778
+ | 'constant'
4779
+ | 'constant-with-warmup'
4780
+ | 'cosine'
4781
+ | 'cosine-with-restarts'
4782
+ | 'linear'
4783
+ | 'polynomial';
4296
4784
 
4297
4785
  /**
4298
- * A thumbnail for your model
4786
+ * Maximum number of training steps to execute (default: varies depending on the
4787
+ * model type)
4788
+ *
4789
+ * For SDXL LoRA training, please use `numTextTrainSteps` and `numUNetTrainSteps`
4790
+ * instead
4791
+ *
4792
+ * Default value varies depending on the model type:
4793
+ *
4794
+ * - For SD1.5: round((number of training images \* 225) / 3)
4795
+ * - For SDXL: number of training images \* 175
4796
+ * - For Flux: number of training images \* 100
4797
+ *
4798
+ * Maximum value varies depending on the model type:
4799
+ *
4800
+ * - For SD1.5 and SDXL: [0, 40000]
4801
+ * - For Flux: [0, 10000]
4299
4802
  */
4300
- thumbnail?: Model.Thumbnail;
4803
+ maxTrainSteps?: number;
4301
4804
 
4302
4805
  /**
4303
- * Array of training image pairs
4806
+ * The number of epochs to train for
4807
+ *
4808
+ * Only available for Flux LoRA training
4304
4809
  */
4305
- trainingImagePairs?: Array<Model.TrainingImagePair>;
4810
+ nbEpochs?: number;
4306
4811
 
4307
4812
  /**
4308
- * The URLs of the first 3 training images of the model. To retrieve the full set
4309
- * of images, get it by modelId
4813
+ * The number of times to repeat the training
4814
+ *
4815
+ * Only available for Flux LoRA training
4310
4816
  */
4311
- trainingImages?: Array<Model.TrainingImage>;
4817
+ nbRepeats?: number;
4312
4818
 
4313
4819
  /**
4314
- * Additional information about the training progress of the model
4820
+ * The number of training steps for the text encoder
4821
+ *
4822
+ * Only available for SDXL LoRA training
4315
4823
  */
4316
- trainingProgress?: Model.TrainingProgress;
4824
+ numTextTrainSteps?: number;
4317
4825
 
4318
4826
  /**
4319
- * Additional information about the model's training
4827
+ * The number of training steps for the UNet
4828
+ *
4829
+ * Only available for SDXL LoRA training
4320
4830
  */
4321
- trainingStats?: Model.TrainingStats;
4831
+ numUNetTrainSteps?: number;
4322
4832
 
4323
4833
  /**
4324
- * The UI configuration for the model
4834
+ * Optimize the model training task for a specific type of input images. The
4835
+ * available values are:
4836
+ *
4837
+ * - "likeness": optimize training for likeness or portrait (targets specific
4838
+ * transformer blocks)
4839
+ * - "all": train all transformer blocks
4840
+ * - "none": train no specific transformer blocks
4841
+ *
4842
+ * This parameter controls which double and single transformer blocks are trained
4843
+ * during the LoRA training process.
4844
+ *
4845
+ * Only available for Flux LoRA training
4325
4846
  */
4326
- uiConfig?: Model.UiConfig;
4847
+ optimizeFor?: 'likeness';
4327
4848
 
4328
4849
  /**
4329
- * (Deprecated) The user ID (example: "user_VFhihHKMRZyDDnZAJwLb2Q")
4850
+ * The weight of prior preservation loss
4851
+ *
4852
+ * Only available for SD15 and SDXL LoRA training
4330
4853
  */
4331
- userId?: string;
4332
- }
4854
+ priorLossWeight?: number;
4333
4855
 
4334
- export namespace Model {
4335
4856
  /**
4336
- * The class of the model
4857
+ * Whether to random crop or center crop images before resizing to the working
4858
+ * resolution
4859
+ *
4860
+ * Only available for SD15 and SDXL LoRA training
4337
4861
  */
4338
- export interface Class {
4339
- /**
4340
- * The category slug of the class (example: "art-style")
4341
- */
4342
- category: string;
4343
-
4344
- /**
4345
- * The concept prompt of the class (example: "a sks character design")
4346
- */
4347
- conceptPrompt: string;
4348
-
4349
- /**
4350
- * The model ID of the class (example: "stable-diffusion-v1-5")
4351
- */
4352
- modelId: string;
4353
-
4354
- /**
4355
- * The class name (example: "Character Design")
4356
- */
4357
- name: string;
4358
-
4359
- /**
4360
- * The class prompt (example: "a character design")
4361
- */
4362
- prompt: string;
4363
-
4364
- /**
4365
- * The class slug (example: "art-style-character-design")
4366
- */
4367
- slug: string;
4368
-
4369
- /**
4370
- * The class status (only published classes are listed, but unpublished classes can
4371
- * still appear in existing models)
4372
- */
4373
- status: 'published' | 'unpublished';
4374
-
4375
- /**
4376
- * Some example images URLs to showcase the class
4377
- */
4378
- thumbnails: Array<string>;
4379
- }
4380
-
4381
- export interface Concept {
4382
- /**
4383
- * The model ID (example: "model_eyVcnFJcR92BxBkz7N6g5w")
4384
- */
4385
- modelId: string;
4386
-
4387
- /**
4388
- * The scale of the model (example: 1.0) For Flux Kontext Prompt Editing, the scale
4389
- * is between 0 and 2.
4390
- */
4391
- scale: number;
4392
-
4393
- /**
4394
- * The epoch of the model (example: "000001") Only available for Flux Lora Trained
4395
- * models
4396
- */
4397
- modelEpoch?: string;
4398
- }
4399
-
4400
- export interface Epoch {
4401
- /**
4402
- * The epoch hash to identify the epoch
4403
- */
4404
- epoch: string;
4405
-
4406
- /**
4407
- * The assets of the epoch if sample prompts as been supplied during training
4408
- */
4409
- assets?: Array<Epoch.Asset>;
4410
- }
4411
-
4412
- export namespace Epoch {
4413
- export interface Asset {
4414
- /**
4415
- * The AssetId of the image during training (example:
4416
- * "asset_GTrL3mq4SXWyMxkOHRxlpw")
4417
- */
4418
- assetId: string;
4862
+ randomCrop?: boolean;
4419
4863
 
4420
- /**
4421
- * The url of the asset
4422
- */
4423
- url: string;
4424
- }
4425
- }
4864
+ /**
4865
+ * Ratio of random crops
4866
+ *
4867
+ * Only available for SD15 and SDXL LoRA training
4868
+ */
4869
+ randomCropRatio?: number;
4426
4870
 
4427
4871
  /**
4428
- * Defines the input parameters for a model. Use this to understand the available
4429
- * input parameters for a given `modelId` when calling
4430
- * `POST /generate/custom/{modelId}`. See {@link
4431
- * https://docs.scenario.com/docs/video-generation} for examples.
4872
+ * Scale of random crops
4873
+ *
4874
+ * Only available for SD15 and SDXL LoRA training
4432
4875
  */
4433
- export interface Input {
4434
- /**
4435
- * The name that must be user to call the model through the API
4436
- */
4437
- name: string;
4876
+ randomCropScale?: number;
4438
4877
 
4439
- /**
4440
- * The data type of the input
4441
- */
4442
- type:
4443
- | 'boolean'
4444
- | 'file'
4445
- | 'file_array'
4446
- | 'inputs_array'
4447
- | 'model'
4448
- | 'model_array'
4449
- | 'number'
4450
- | 'number_array'
4451
- | 'string'
4452
- | 'string_array';
4878
+ /**
4879
+ * The dimension of the LoRA update matrices
4880
+ *
4881
+ * Only available for SDXL (deprecated), Flux LoRA and Musubi training
4882
+ *
4883
+ * Default value varies depending on the model type:
4884
+ *
4885
+ * - For SDXL (deprecated): 64
4886
+ * - For Flux: 16
4887
+ * - For Musubi: 64
4888
+ *
4889
+ * Each trainer enforces its own tighter limit (Flux LoRA: [2; 64], Musubi: [2;
4890
+ * 128])
4891
+ */
4892
+ rank?: number;
4453
4893
 
4454
- /**
4455
- * The allowed values for the input. For \`string\` or \`number\` types, creates a
4456
- * single-select dropdown. For \`string_array\` type, creates a multi-select
4457
- * dropdown.
4458
- */
4459
- allowedValues?: Array<unknown>;
4894
+ /**
4895
+ * Whether to remove background noise from audio samples before cloning. When
4896
+ * enabled, each sample must be at least 5 seconds long.
4897
+ *
4898
+ * Only available for ElevenLabs voice training
4899
+ */
4900
+ removeBackgroundNoise?: boolean;
4460
4901
 
4461
- /**
4462
- * Specifies the background behavior for the input. Only available for \`file\` and
4463
- * \`file_array\` input types with kind \`image\`.
4464
- */
4465
- backgroundBehavior?: 'opaque' | 'transparent';
4902
+ /**
4903
+ * The prompts to use for each epoch Only available for Flux LoRA training
4904
+ */
4905
+ samplePrompts?: Array<string>;
4466
4906
 
4467
- /**
4468
- * Whether the input is a color or not. Only available for \`string\` input type.
4469
- */
4470
- color?: boolean;
4907
+ /**
4908
+ * The sample prompt images (AssetIds) paired with samplePrompts Only available for
4909
+ * Flux LoRA training Must be the same length as samplePrompts
4910
+ */
4911
+ sampleSourceImages?: Array<string>;
4471
4912
 
4472
- /**
4473
- * Whether this input affects the model's cost calculation
4474
- */
4475
- costImpact?: boolean;
4913
+ /**
4914
+ * Whether to scale the learning rate
4915
+ *
4916
+ * Note: Legacy parameter, will be ignored
4917
+ *
4918
+ * Only available for SD15 and SDXL LoRA training
4919
+ */
4920
+ scaleLr?: boolean;
4476
4921
 
4477
- /**
4478
- * The default value for the input
4479
- */
4480
- default?: unknown;
4922
+ /**
4923
+ * Used to reproduce previous results. Default: randomly generated number.
4924
+ *
4925
+ * Only available for SD15 and SDXL LoRA training
4926
+ */
4927
+ seed?: number;
4481
4928
 
4482
- /**
4483
- * Help text displayed in the UI to provide additional information about the input
4484
- */
4485
- description?: string;
4929
+ /**
4930
+ * Whether to train the text encoder or not
4931
+ *
4932
+ * Example: For 100 steps and a value of 0.2, it means that the text encoder will
4933
+ * be trained for 20 steps and then the UNet for 80 steps
4934
+ *
4935
+ * Note: Legacy parameter, please use `numTextTrainSteps` and `numUNetTrainSteps`
4936
+ *
4937
+ * Only available for SD15 and SDXL LoRA training
4938
+ */
4939
+ textEncoderTrainingRatio?: number;
4486
4940
 
4487
- /**
4488
- * Used to visually group inputs together in the UI. Inputs with the same group
4489
- * value appear consecutively in the UI.
4490
- */
4491
- group?: string;
4941
+ /**
4942
+ * Validation frequency. Cannot be greater than maxTrainSteps value
4943
+ *
4944
+ * Only available for SD15 and SDXL LoRA training
4945
+ */
4946
+ validationFrequency?: number;
4492
4947
 
4493
- /**
4494
- * Hint text displayed in the UI as a tooltip to guide the user
4495
- */
4496
- hint?: string;
4948
+ /**
4949
+ * Validation prompt
4950
+ *
4951
+ * Only available for SD15 and SDXL LoRA training
4952
+ */
4953
+ validationPrompt?: string;
4497
4954
 
4498
- /**
4499
- * The list of inputs which form an object within a container array. All inputs are
4500
- * the same as the current object. This is only available for type inputs_array
4501
- * inputs.
4502
- */
4503
- inputs?: Array<{ [key: string]: unknown }>;
4504
-
4505
- /**
4506
- * The asset kind of the input. Only taken into account for \`file\` and
4507
- * \`file_array\` input types. If model provides multiple kinds, the input will be
4508
- * not able to create the asset on the flight on API side with dataurl without
4509
- * data:kind, prefix
4510
- */
4511
- kind?: '3d' | 'audio' | 'document' | 'image' | 'image-hdr' | 'json' | 'video';
4512
-
4513
- /**
4514
- * The label displayed in the UI for this input
4515
- */
4516
- label?: string;
4517
-
4518
- /**
4519
- * The name of the file input field to use as the mask source
4520
- */
4521
- maskFrom?: string;
4522
-
4523
- /**
4524
- * The maximum allowed value. Only available for \`number\` and \`array\` input
4525
- * types.
4526
- */
4527
- max?: number;
4528
-
4529
- /**
4530
- * The maximum allowed length for \`string\` inputs. Also applies to each item in
4531
- * \`string_array\`.
4532
- */
4533
- maxLength?: number;
4534
-
4535
- /**
4536
- * The maximum allowed file size in bytes. Only applies to \`file\` and
4537
- * \`file_array\` input types. Validated against \`asset.properties.size\` at job
4538
- * creation time.
4539
- */
4540
- maxSize?: number;
4541
-
4542
- /**
4543
- * The minimum allowed value. Only available for \`number\` and array input types.
4544
- */
4545
- min?: number;
4546
-
4547
- /**
4548
- * The minimum allowed length for string inputs. Also applies to each item in
4549
- * \`string_array\`.
4550
- */
4551
- minLength?: number;
4552
-
4553
- /**
4554
- * The allowed model types for this input. Example: \`["flux.1-lora"]\`. Only
4555
- * available for \`model_array\` input type.
4556
- */
4557
- modelTypes?: Array<
4558
- | 'custom'
4559
- | 'elevenlabs-voice'
4560
- | 'flux.1'
4561
- | 'flux.1-composition'
4562
- | 'flux.1-kontext-dev'
4563
- | 'flux.1-kontext-lora'
4564
- | 'flux.1-krea-dev'
4565
- | 'flux.1-krea-lora'
4566
- | 'flux.1-lora'
4567
- | 'flux.1-pro'
4568
- | 'flux.1.1-pro-ultra'
4569
- | 'flux.2-dev-edit-lora'
4570
- | 'flux.2-dev-lora'
4571
- | 'flux.2-klein-4b-edit-lora'
4572
- | 'flux.2-klein-4b-lora'
4573
- | 'flux.2-klein-9b-edit-lora'
4574
- | 'flux.2-klein-9b-lora'
4575
- | 'flux.2-klein-base-4b-edit-lora'
4576
- | 'flux.2-klein-base-4b-lora'
4577
- | 'flux.2-klein-base-9b-edit-lora'
4578
- | 'flux.2-klein-base-9b-lora'
4579
- | 'flux1.1-pro'
4580
- | 'gpt-image-1'
4581
- | 'qwen-image-2512-lora'
4582
- | 'qwen-image-edit-2509-lora'
4583
- | 'qwen-image-edit-2511-lora'
4584
- | 'qwen-image-edit-lora'
4585
- | 'qwen-image-lora'
4586
- | 'sd-1_5'
4587
- | 'sd-1_5-composition'
4588
- | 'sd-1_5-lora'
4589
- | 'sd-xl'
4590
- | 'sd-xl-composition'
4591
- | 'sd-xl-lora'
4592
- | 'zimage-de-turbo-lora'
4593
- | 'zimage-lora'
4594
- | 'zimage-turbo-lora'
4595
- >;
4596
-
4597
- /**
4598
- * Whether this input represents a parent asset to assign to the produced assets.
4599
- * Only available for \`file\` and \`file_array\` input types.
4600
- *
4601
- * For \`file_array\`, the parent asset is the first item in the array.
4602
- */
4603
- parent?: boolean;
4604
-
4605
- /**
4606
- * Placeholder text for the input. Only available for 'string' input type.
4607
- */
4608
- placeholder?: string;
4609
-
4610
- /**
4611
- * Whether the input is a prompt. When true, displays as a text area with prompt
4612
- * spark feature. Only available for \`string\` input type.
4613
- */
4614
- prompt?: boolean;
4615
-
4616
- /**
4617
- * Whether the input is used with prompt spark. Only available for \`string\` input
4618
- * type.
4619
- */
4620
- promptSpark?: boolean;
4621
-
4622
- /**
4623
- * Set of rules that describes when this input is required:
4624
- *
4625
- * - \`always\`: Input is always required
4626
- * - \`ifNotDefined\`: Input is required when another specified input is not
4627
- * defined
4628
- * - \`ifDefined\`: Input is required when another specified input is defined
4629
- * - \`conditionalValues\`: Input is required when another input has a specific
4630
- * value
4631
- *
4632
- * By default, the input is not required.
4633
- */
4634
- required?: Input.Required;
4635
-
4636
- /**
4637
- * The step increment for numeric inputs. Only available for \`number\` input type.
4638
- */
4639
- step?: number;
4640
- }
4641
-
4642
- export namespace Input {
4643
- /**
4644
- * Set of rules that describes when this input is required:
4645
- *
4646
- * - \`always\`: Input is always required
4647
- * - \`ifNotDefined\`: Input is required when another specified input is not
4648
- * defined
4649
- * - \`ifDefined\`: Input is required when another specified input is defined
4650
- * - \`conditionalValues\`: Input is required when another input has a specific
4651
- * value
4652
- *
4653
- * By default, the input is not required.
4654
- */
4655
- export interface Required {
4656
- /**
4657
- * Whether the input is always required
4658
- */
4659
- always?: boolean;
4660
-
4661
- /**
4662
- * Makes this input required when another input has a specific value:
4663
- *
4664
- * - Key: name of the input to check
4665
- * - Value: operation and allowed values that trigger the requirement
4666
- */
4667
- conditionalValues?: unknown;
4668
-
4669
- /**
4670
- * Makes this input required when another input is defined:
4671
- *
4672
- * - Key: name of the input that must be defined
4673
- * - Value: message to display when this input is required
4674
- */
4675
- ifDefined?: unknown;
4676
-
4677
- /**
4678
- * Makes this input required when another input is not defined:
4679
- *
4680
- * - Key: name of the input that must be undefined
4681
- * - Value: message to display when this input is required
4682
- */
4683
- ifNotDefined?: unknown;
4684
- }
4685
- }
4686
-
4687
- /**
4688
- * The parameters of the model
4689
- */
4690
- export interface Parameters {
4691
- /**
4692
- * Age group of the voice (for professional cloning)
4693
- *
4694
- * Only available for ElevenLabs voice training
4695
- */
4696
- age?: string;
4697
-
4698
- /**
4699
- * The batch size Less steps, and will increase the learning rate
4700
- *
4701
- * Only available for Flux LoRA training
4702
- */
4703
- batchSize?: number;
4704
-
4705
- /**
4706
- * The prompt to specify images in the same class as provided instance images
4707
- *
4708
- * Only available for SD15 training
4709
- */
4710
- classPrompt?: string;
4711
-
4712
- /**
4713
- * Type of voice cloning: "instant" (fast) or "professional" (higher quality,
4714
- * requires captcha)
4715
- *
4716
- * Only available for ElevenLabs voice training
4717
- */
4718
- cloneType?: string;
4719
-
4720
- /**
4721
- * The prompt with identifier specifying the instance (or subject) of the class
4722
- * (example: "a daiton dog")
4723
- *
4724
- * Default value varies depending on the model type:
4725
- *
4726
- * - For SD1.5: "daiton" if no class is associated with the model
4727
- * - For SDXL: "daiton"
4728
- * - For Flux: ""
4729
- */
4730
- conceptPrompt?: string;
4731
-
4732
- /**
4733
- * Gender of the voice (for professional cloning)
4734
- *
4735
- * Only available for ElevenLabs voice training
4736
- */
4737
- gender?: string;
4738
-
4739
- /**
4740
- * Language of the audio samples (ISO 639-1 code)
4741
- *
4742
- * Only available for ElevenLabs voice training
4743
- */
4744
- language?: string;
4745
-
4746
- /**
4747
- * Initial learning rate (after the potential warmup period)
4748
- *
4749
- * Default value varies depending on the model type:
4750
- *
4751
- * - For SD1.5 and SDXL: 0.000005
4752
- * - For Flux: 0.0001
4753
- */
4754
- learningRate?: number;
4755
-
4756
- /**
4757
- * Initial learning rate (after the potential warmup period) for the text encoder
4758
- *
4759
- * Maximum [Flux LoRA: 0.001] Default [SDXL: 0.00005 | Flux LoRA: 0.00001] Minimum
4760
- * [SDXL: 0 | Flux LoRA: 0.000001]
4761
- */
4762
- learningRateTextEncoder?: number;
4763
-
4764
- /**
4765
- * Initial learning rate (after the potential warmup period) for the UNet
4766
- *
4767
- * Only available for SDXL LoRA training
4768
- */
4769
- learningRateUnet?: number;
4770
-
4771
- /**
4772
- * The scheduler type to use (default: "constant")
4773
- *
4774
- * Only available for SD15 and SDXL LoRA training
4775
- */
4776
- lrScheduler?:
4777
- | 'constant'
4778
- | 'constant-with-warmup'
4779
- | 'cosine'
4780
- | 'cosine-with-restarts'
4781
- | 'linear'
4782
- | 'polynomial';
4783
-
4784
- /**
4785
- * Maximum number of training steps to execute (default: varies depending on the
4786
- * model type)
4787
- *
4788
- * For SDXL LoRA training, please use `numTextTrainSteps` and `numUNetTrainSteps`
4789
- * instead
4790
- *
4791
- * Default value varies depending on the model type:
4792
- *
4793
- * - For SD1.5: round((number of training images \* 225) / 3)
4794
- * - For SDXL: number of training images \* 175
4795
- * - For Flux: number of training images \* 100
4796
- *
4797
- * Maximum value varies depending on the model type:
4798
- *
4799
- * - For SD1.5 and SDXL: [0, 40000]
4800
- * - For Flux: [0, 10000]
4801
- */
4802
- maxTrainSteps?: number;
4803
-
4804
- /**
4805
- * The number of epochs to train for
4806
- *
4807
- * Only available for Flux LoRA training
4808
- */
4809
- nbEpochs?: number;
4810
-
4811
- /**
4812
- * The number of times to repeat the training
4813
- *
4814
- * Only available for Flux LoRA training
4815
- */
4816
- nbRepeats?: number;
4817
-
4818
- /**
4819
- * The number of training steps for the text encoder
4820
- *
4821
- * Only available for SDXL LoRA training
4822
- */
4823
- numTextTrainSteps?: number;
4824
-
4825
- /**
4826
- * The number of training steps for the UNet
4827
- *
4828
- * Only available for SDXL LoRA training
4829
- */
4830
- numUNetTrainSteps?: number;
4831
-
4832
- /**
4833
- * Optimize the model training task for a specific type of input images. The
4834
- * available values are:
4835
- *
4836
- * - "likeness": optimize training for likeness or portrait (targets specific
4837
- * transformer blocks)
4838
- * - "all": train all transformer blocks
4839
- * - "none": train no specific transformer blocks
4840
- *
4841
- * This parameter controls which double and single transformer blocks are trained
4842
- * during the LoRA training process.
4843
- *
4844
- * Only available for Flux LoRA training
4845
- */
4846
- optimizeFor?: 'likeness';
4847
-
4848
- /**
4849
- * The weight of prior preservation loss
4850
- *
4851
- * Only available for SD15 and SDXL LoRA training
4852
- */
4853
- priorLossWeight?: number;
4854
-
4855
- /**
4856
- * Whether to random crop or center crop images before resizing to the working
4857
- * resolution
4858
- *
4859
- * Only available for SD15 and SDXL LoRA training
4860
- */
4861
- randomCrop?: boolean;
4862
-
4863
- /**
4864
- * Ratio of random crops
4865
- *
4866
- * Only available for SD15 and SDXL LoRA training
4867
- */
4868
- randomCropRatio?: number;
4869
-
4870
- /**
4871
- * Scale of random crops
4872
- *
4873
- * Only available for SD15 and SDXL LoRA training
4874
- */
4875
- randomCropScale?: number;
4876
-
4877
- /**
4878
- * The dimension of the LoRA update matrices
4879
- *
4880
- * Only available for SDXL (deprecated), Flux LoRA and Musubi training
4881
- *
4882
- * Default value varies depending on the model type:
4883
- *
4884
- * - For SDXL (deprecated): 64
4885
- * - For Flux: 16
4886
- * - For Musubi: 64
4887
- *
4888
- * Each trainer enforces its own tighter limit (Flux LoRA: [2; 64], Musubi: [2;
4889
- * 128])
4890
- */
4891
- rank?: number;
4892
-
4893
- /**
4894
- * Whether to remove background noise from audio samples before cloning. When
4895
- * enabled, each sample must be at least 5 seconds long.
4896
- *
4897
- * Only available for ElevenLabs voice training
4898
- */
4899
- removeBackgroundNoise?: boolean;
4900
-
4901
- /**
4902
- * The prompts to use for each epoch Only available for Flux LoRA training
4903
- */
4904
- samplePrompts?: Array<string>;
4905
-
4906
- /**
4907
- * The sample prompt images (AssetIds) paired with samplePrompts Only available for
4908
- * Flux LoRA training Must be the same length as samplePrompts
4909
- */
4910
- sampleSourceImages?: Array<string>;
4911
-
4912
- /**
4913
- * Whether to scale the learning rate
4914
- *
4915
- * Note: Legacy parameter, will be ignored
4916
- *
4917
- * Only available for SD15 and SDXL LoRA training
4918
- */
4919
- scaleLr?: boolean;
4920
-
4921
- /**
4922
- * Used to reproduce previous results. Default: randomly generated number.
4923
- *
4924
- * Only available for SD15 and SDXL LoRA training
4925
- */
4926
- seed?: number;
4927
-
4928
- /**
4929
- * Whether to train the text encoder or not
4930
- *
4931
- * Example: For 100 steps and a value of 0.2, it means that the text encoder will
4932
- * be trained for 20 steps and then the UNet for 80 steps
4933
- *
4934
- * Note: Legacy parameter, please use `numTextTrainSteps` and `numUNetTrainSteps`
4935
- *
4936
- * Only available for SD15 and SDXL LoRA training
4937
- */
4938
- textEncoderTrainingRatio?: number;
4939
-
4940
- /**
4941
- * Validation frequency. Cannot be greater than maxTrainSteps value
4942
- *
4943
- * Only available for SD15 and SDXL LoRA training
4944
- */
4945
- validationFrequency?: number;
4946
-
4947
- /**
4948
- * Validation prompt
4949
- *
4950
- * Only available for SD15 and SDXL LoRA training
4951
- */
4952
- validationPrompt?: string;
4953
-
4954
- /**
4955
- * Description of the voice characteristics
4956
- *
4957
- * Only available for ElevenLabs voice training
4958
- */
4959
- voiceDescription?: string;
4960
-
4961
- /**
4962
- * The Weights And Bias key to use for logging. The maximum length is 40 characters
4963
- */
4964
- wandbKey?: string;
4965
- }
4966
-
4967
- /**
4968
- * Aggregated performance stats
4969
- */
4970
- export interface PerformanceStats {
4971
- /**
4972
- * Performance metrics per variant
4973
- */
4974
- variants: Array<PerformanceStats.Variant>;
4975
-
4976
- /**
4977
- * Default variant key for quick model comparison
4978
- */
4979
- default?: string;
4980
- }
4981
-
4982
- export namespace PerformanceStats {
4983
- /**
4984
- * Performance stats for a model variant
4985
- */
4986
- export interface Variant {
4987
- /**
4988
- * The generation capability (example: "txt2img", "img2video", "txt2audio")
4989
- */
4990
- capability: string;
4991
-
4992
- /**
4993
- * When these stats were last computed (ISO date)
4994
- */
4995
- computedAt: string;
4996
-
4997
- /**
4998
- * Unique variant identifier (example: "txt2img:1K", "img2video:2K", "txt2audio")
4999
- */
5000
- variantKey: string;
5001
-
5002
- /**
5003
- * External quality score from arena.ai leaderboard
5004
- */
5005
- arenaScore?: Variant.ArenaScore;
5006
-
5007
- /**
5008
- * Maximum cost per output asset (CU)
5009
- */
5010
- costPerAssetMaxCU?: number;
5011
-
5012
- /**
5013
- * Minimum cost per output asset (CU)
5014
- */
5015
- costPerAssetMinCU?: number;
5016
-
5017
- /**
5018
- * Median cost per output asset (CU)
5019
- */
5020
- costPerAssetP50CU?: number;
5021
-
5022
- /**
5023
- * Inference latency P50 per output asset (seconds)
5024
- */
5025
- inferenceLatencyP50Sec?: number;
5026
-
5027
- /**
5028
- * Inference latency P75 per output asset (seconds)
5029
- */
5030
- inferenceLatencyP75Sec?: number;
5031
-
5032
- /**
5033
- * The resolution bucket (example: "0.5K", "1K", "2K", "4K")
5034
- */
5035
- resolution?: string;
5036
-
5037
- /**
5038
- * Total latency P50 per output asset, including queue time (seconds)
5039
- */
5040
- totalLatencyP50Sec?: number;
5041
-
5042
- /**
5043
- * Total latency P75 per output asset, including queue time (seconds)
5044
- */
5045
- totalLatencyP75Sec?: number;
5046
- }
5047
-
5048
- export namespace Variant {
5049
- /**
5050
- * External quality score from arena.ai leaderboard
5051
- */
5052
- export interface ArenaScore {
5053
- /**
5054
- * Arena category (example: "text_to_image", "image_to_video")
5055
- */
5056
- arenaCategory: string;
5057
-
5058
- /**
5059
- * Model name on arena.ai
5060
- */
5061
- arenaModelName: string;
5062
-
5063
- /**
5064
- * When this score was last fetched (ISO date)
5065
- */
5066
- fetchedAt: string;
5067
-
5068
- /**
5069
- * Rank in the arena category
5070
- */
5071
- rank: number;
5072
-
5073
- /**
5074
- * ELO rating
5075
- */
5076
- rating: number;
5077
-
5078
- /**
5079
- * ELO rating confidence interval lower bound
5080
- */
5081
- ratingLower: number;
5082
-
5083
- /**
5084
- * ELO rating confidence interval upper bound
5085
- */
5086
- ratingUpper: number;
5087
-
5088
- /**
5089
- * Number of human votes
5090
- */
5091
- votes: number;
5092
- }
5093
- }
5094
- }
5095
-
5096
- /**
5097
- * A thumbnail for your model
5098
- */
5099
- export interface Thumbnail {
5100
- /**
5101
- * The AssetId of the image used as a thumbnail for your model (example:
5102
- * "asset_GTrL3mq4SXWyMxkOHRxlpw")
5103
- */
5104
- assetId: string;
5105
-
5106
- /**
5107
- * The url of the image used as a thumbnail for your model
5108
- */
5109
- url: string;
5110
- }
5111
-
5112
- export interface TrainingImagePair {
5113
- /**
5114
- * The instruction for the image pair, source to target
5115
- */
5116
- instruction?: string;
5117
-
5118
- /**
5119
- * The source asset ID (must be a training asset)
5120
- */
5121
- sourceId?: string;
5122
-
5123
- /**
5124
- * The target asset ID (must be a training asset)
5125
- */
5126
- targetId?: string;
5127
- }
5128
-
5129
- export interface TrainingImage {
5130
- /**
5131
- * The training image ID (example: "asset_GTrL3mq4SXWyMxkOHRxlpw")
5132
- */
5133
- id: string;
5134
-
5135
- /**
5136
- * Automatic captioning of the image
5137
- */
5138
- automaticCaptioning: string;
5139
-
5140
- /**
5141
- * The training image upload date as an ISO string (example:
5142
- * "2023-02-03T11:19:41.579Z")
5143
- */
5144
- createdAt: string;
5145
-
5146
- /**
5147
- * Description for the image
5148
- */
5149
- description: string;
5150
-
5151
- /**
5152
- * The URL of the image
5153
- */
5154
- downloadUrl: string;
5155
-
5156
- /**
5157
- * The original file name of the image (example: "my-training-image.jpg")
5158
- */
5159
- name: string;
5160
- }
4955
+ /**
4956
+ * Description of the voice characteristics
4957
+ *
4958
+ * Only available for ElevenLabs voice training
4959
+ */
4960
+ voiceDescription?: string;
5161
4961
 
5162
4962
  /**
5163
- * Additional information about the training progress of the model
4963
+ * The Weights And Bias key to use for logging. The maximum length is 40 characters
5164
4964
  */
5165
- export interface TrainingProgress {
5166
- /**
5167
- * The stage of the request
5168
- */
5169
- stage: 'pending' | 'pending-captcha' | 'queued-for-train' | 'running-train' | 'starting-train';
5170
-
5171
- /**
5172
- * Timestamp in milliseconds of the last time the training progress was updated
5173
- */
5174
- updatedAt: number;
4965
+ wandbKey?: string;
4966
+ }
5175
4967
 
5176
- /**
5177
- * Position of the job in the queue (ie. the number of job in the queue before this
5178
- * one)
5179
- */
5180
- position?: number;
4968
+ /**
4969
+ * Aggregated performance stats
4970
+ */
4971
+ export interface PerformanceStats {
4972
+ /**
4973
+ * Performance metrics per variant
4974
+ */
4975
+ variants: Array<PerformanceStats.Variant>;
5181
4976
 
5182
- /**
5183
- * The progress of the job
5184
- */
5185
- progress?: number;
4977
+ /**
4978
+ * Default variant key for quick model comparison
4979
+ */
4980
+ default?: string;
4981
+ }
5186
4982
 
4983
+ export namespace PerformanceStats {
4984
+ /**
4985
+ * Performance stats for a model variant
4986
+ */
4987
+ export interface Variant {
5187
4988
  /**
5188
- * The remaining time in milliseconds
4989
+ * The generation capability (example: "txt2img", "img2video", "txt2audio")
5189
4990
  */
5190
- remainingTimeMs?: number;
4991
+ capability: string;
5191
4992
 
5192
4993
  /**
5193
- * The timestamp in millisecond marking the start of the process
4994
+ * When these stats were last computed (ISO date)
5194
4995
  */
5195
- startedAt?: number;
5196
- }
4996
+ computedAt: string;
5197
4997
 
5198
- /**
5199
- * Additional information about the model's training
5200
- */
5201
- export interface TrainingStats {
5202
4998
  /**
5203
- * The training end time as an ISO date string
4999
+ * Unique variant identifier (example: "txt2img:1K", "img2video:2K", "txt2audio")
5204
5000
  */
5205
- endedAt?: string;
5001
+ variantKey: string;
5206
5002
 
5207
5003
  /**
5208
- * The training queued duration in seconds
5004
+ * External quality score from arena.ai leaderboard
5209
5005
  */
5210
- queueDuration?: number;
5006
+ arenaScore?: Variant.ArenaScore;
5211
5007
 
5212
5008
  /**
5213
- * The training start time as an ISO date string
5009
+ * Maximum cost per output asset (CU)
5214
5010
  */
5215
- startedAt?: string;
5011
+ costPerAssetMaxCU?: number;
5216
5012
 
5217
5013
  /**
5218
- * The training duration in seconds
5014
+ * Minimum cost per output asset (CU)
5219
5015
  */
5220
- trainDuration?: number;
5221
- }
5016
+ costPerAssetMinCU?: number;
5222
5017
 
5223
- /**
5224
- * The UI configuration for the model
5225
- */
5226
- export interface UiConfig {
5227
5018
  /**
5228
- * Configuration for the input properties
5019
+ * Median cost per output asset (CU)
5229
5020
  */
5230
- inputProperties?: { [key: string]: UiConfig.InputProperties };
5021
+ costPerAssetP50CU?: number;
5231
5022
 
5232
5023
  /**
5233
- * Configuration for the loras component
5024
+ * Inference latency P50 per output asset (seconds)
5234
5025
  */
5235
- lorasComponent?: UiConfig.LorasComponent;
5026
+ inferenceLatencyP50Sec?: number;
5236
5027
 
5237
5028
  /**
5238
- * Configuration for the presets
5029
+ * Inference latency P75 per output asset (seconds)
5239
5030
  */
5240
- presets?: Array<UiConfig.Preset>;
5031
+ inferenceLatencyP75Sec?: number;
5241
5032
 
5242
5033
  /**
5243
- * Configuration for the resolution component
5034
+ * The resolution bucket (example: "0.5K", "1K", "2K", "4K")
5244
5035
  */
5245
- resolutionComponent?: UiConfig.ResolutionComponent;
5036
+ resolution?: string;
5246
5037
 
5247
5038
  /**
5248
- * Configuration for the selects
5039
+ * Total latency P50 per output asset, including queue time (seconds)
5249
5040
  */
5250
- selects?: { [key: string]: unknown };
5041
+ totalLatencyP50Sec?: number;
5251
5042
 
5252
5043
  /**
5253
- * Configuration for the trigger generate button
5044
+ * Total latency P75 per output asset, including queue time (seconds)
5254
5045
  */
5255
- triggerGenerate?: UiConfig.TriggerGenerate;
5046
+ totalLatencyP75Sec?: number;
5256
5047
  }
5257
5048
 
5258
- export namespace UiConfig {
5259
- export interface InputProperties {
5260
- collapsed?: boolean;
5261
- }
5262
-
5049
+ export namespace Variant {
5263
5050
  /**
5264
- * Configuration for the loras component
5051
+ * External quality score from arena.ai leaderboard
5265
5052
  */
5266
- export interface LorasComponent {
5053
+ export interface ArenaScore {
5267
5054
  /**
5268
- * The label of the component
5055
+ * Arena category (example: "text_to_image", "image_to_video")
5269
5056
  */
5270
- label: string;
5057
+ arenaCategory: string;
5271
5058
 
5272
5059
  /**
5273
- * The input name of the model (model_array)
5060
+ * Model name on arena.ai
5274
5061
  */
5275
- modelInput: string;
5062
+ arenaModelName: string;
5276
5063
 
5277
5064
  /**
5278
- * The input name of the scale (number_array)
5065
+ * When this score was last fetched (ISO date)
5279
5066
  */
5280
- scaleInput: string;
5067
+ fetchedAt: string;
5281
5068
 
5282
5069
  /**
5283
- * The input model id (example: a composition or a single LoRA modelId) If
5284
- * specified, the model id will be attached to the output asset as a metadata If
5285
- * the model-decomposer parser is specified on it, modelInput and scaleInput will
5286
- * be automatically populated
5070
+ * Rank in the arena category
5287
5071
  */
5288
- modelIdInput?: string;
5289
- }
5072
+ rank: number;
5290
5073
 
5291
- export interface Preset {
5292
- fields: Array<string>;
5293
-
5294
- presets: unknown;
5295
- }
5296
-
5297
- /**
5298
- * Configuration for the resolution component
5299
- */
5300
- export interface ResolutionComponent {
5301
5074
  /**
5302
- * The input name of the height
5075
+ * ELO rating
5303
5076
  */
5304
- heightInput: string;
5077
+ rating: number;
5305
5078
 
5306
5079
  /**
5307
- * The label of the component
5080
+ * ELO rating confidence interval lower bound
5308
5081
  */
5309
- label: string;
5082
+ ratingLower: number;
5310
5083
 
5311
5084
  /**
5312
- * The resolution presets
5085
+ * ELO rating confidence interval upper bound
5313
5086
  */
5314
- presets: Array<ResolutionComponent.Preset>;
5087
+ ratingUpper: number;
5315
5088
 
5316
5089
  /**
5317
- * The input name of the width
5090
+ * Number of human votes
5318
5091
  */
5319
- widthInput: string;
5092
+ votes: number;
5320
5093
  }
5094
+ }
5095
+ }
5321
5096
 
5322
- export namespace ResolutionComponent {
5323
- export interface Preset {
5324
- height: number;
5097
+ /**
5098
+ * A thumbnail for your model
5099
+ */
5100
+ export interface Thumbnail {
5101
+ /**
5102
+ * The AssetId of the image used as a thumbnail for your model (example:
5103
+ * "asset_GTrL3mq4SXWyMxkOHRxlpw")
5104
+ */
5105
+ assetId: string;
5325
5106
 
5326
- label: string;
5107
+ /**
5108
+ * The url of the image used as a thumbnail for your model
5109
+ */
5110
+ url: string;
5111
+ }
5327
5112
 
5328
- width: number;
5329
- }
5330
- }
5113
+ export interface TrainingImagePair {
5114
+ /**
5115
+ * The instruction for the image pair, source to target
5116
+ */
5117
+ instruction?: string;
5118
+
5119
+ /**
5120
+ * The source asset ID (must be a training asset)
5121
+ */
5122
+ sourceId?: string;
5123
+
5124
+ /**
5125
+ * The target asset ID (must be a training asset)
5126
+ */
5127
+ targetId?: string;
5128
+ }
5129
+
5130
+ export interface TrainingImage {
5131
+ /**
5132
+ * The training image ID (example: "asset_GTrL3mq4SXWyMxkOHRxlpw")
5133
+ */
5134
+ id: string;
5135
+
5136
+ /**
5137
+ * Automatic captioning of the image
5138
+ */
5139
+ automaticCaptioning: string;
5140
+
5141
+ /**
5142
+ * The training image upload date as an ISO string (example:
5143
+ * "2023-02-03T11:19:41.579Z")
5144
+ */
5145
+ createdAt: string;
5146
+
5147
+ /**
5148
+ * Description for the image
5149
+ */
5150
+ description: string;
5151
+
5152
+ /**
5153
+ * The URL of the image
5154
+ */
5155
+ downloadUrl: string;
5156
+
5157
+ /**
5158
+ * The original file name of the image (example: "my-training-image.jpg")
5159
+ */
5160
+ name: string;
5161
+ }
5162
+
5163
+ /**
5164
+ * Additional information about the training progress of the model
5165
+ */
5166
+ export interface TrainingProgress {
5167
+ /**
5168
+ * The stage of the request
5169
+ */
5170
+ stage: 'pending' | 'pending-captcha' | 'queued-for-train' | 'running-train' | 'starting-train';
5171
+
5172
+ /**
5173
+ * Timestamp in milliseconds of the last time the training progress was updated
5174
+ */
5175
+ updatedAt: number;
5176
+
5177
+ /**
5178
+ * Position of the job in the queue (ie. the number of job in the queue before this
5179
+ * one)
5180
+ */
5181
+ position?: number;
5182
+
5183
+ /**
5184
+ * The progress of the job
5185
+ */
5186
+ progress?: number;
5187
+
5188
+ /**
5189
+ * The remaining time in milliseconds
5190
+ */
5191
+ remainingTimeMs?: number;
5192
+
5193
+ /**
5194
+ * The timestamp in millisecond marking the start of the process
5195
+ */
5196
+ startedAt?: number;
5197
+ }
5198
+
5199
+ /**
5200
+ * Additional information about the model's training
5201
+ */
5202
+ export interface TrainingStats {
5203
+ /**
5204
+ * The training end time as an ISO date string
5205
+ */
5206
+ endedAt?: string;
5207
+
5208
+ /**
5209
+ * The training queued duration in seconds
5210
+ */
5211
+ queueDuration?: number;
5212
+
5213
+ /**
5214
+ * The training start time as an ISO date string
5215
+ */
5216
+ startedAt?: string;
5217
+
5218
+ /**
5219
+ * The training duration in seconds
5220
+ */
5221
+ trainDuration?: number;
5222
+ }
5223
+
5224
+ /**
5225
+ * The UI configuration for the model
5226
+ */
5227
+ export interface UiConfig {
5228
+ /**
5229
+ * Configuration for the input properties
5230
+ */
5231
+ inputProperties?: { [key: string]: UiConfig.InputProperties };
5232
+
5233
+ /**
5234
+ * Configuration for the loras component
5235
+ */
5236
+ lorasComponent?: UiConfig.LorasComponent;
5237
+
5238
+ /**
5239
+ * Configuration for the presets
5240
+ */
5241
+ presets?: Array<UiConfig.Preset>;
5242
+
5243
+ /**
5244
+ * Configuration for the resolution component
5245
+ */
5246
+ resolutionComponent?: UiConfig.ResolutionComponent;
5247
+
5248
+ /**
5249
+ * Configuration for the selects
5250
+ */
5251
+ selects?: { [key: string]: unknown };
5252
+
5253
+ /**
5254
+ * Configuration for the trigger generate button
5255
+ */
5256
+ triggerGenerate?: UiConfig.TriggerGenerate;
5257
+ }
5258
+
5259
+ export namespace UiConfig {
5260
+ export interface InputProperties {
5261
+ collapsed?: boolean;
5262
+ }
5331
5263
 
5264
+ /**
5265
+ * Configuration for the loras component
5266
+ */
5267
+ export interface LorasComponent {
5332
5268
  /**
5333
- * Configuration for the trigger generate button
5269
+ * The label of the component
5334
5270
  */
5335
- export interface TriggerGenerate {
5336
- label: string;
5271
+ label: string;
5337
5272
 
5338
- /**
5339
- * The 'name' of the input where the trigger generate button will be displayed
5340
- * (after the input). Do not specify both position and after.
5341
- */
5342
- after?: string;
5273
+ /**
5274
+ * The input name of the model (model_array)
5275
+ */
5276
+ modelInput: string;
5343
5277
 
5344
- /**
5345
- * The position of the trigger generate button. If position specified, the button
5346
- * will be displayed at the specified position. Do not specify both position and
5347
- * after.
5348
- */
5349
- position?: 'bottom' | 'top';
5278
+ /**
5279
+ * The input name of the scale (number_array)
5280
+ */
5281
+ scaleInput: string;
5282
+
5283
+ /**
5284
+ * The input model id (example: a composition or a single LoRA modelId) If
5285
+ * specified, the model id will be attached to the output asset as a metadata If
5286
+ * the model-decomposer parser is specified on it, modelInput and scaleInput will
5287
+ * be automatically populated
5288
+ */
5289
+ modelIdInput?: string;
5290
+ }
5291
+
5292
+ export interface Preset {
5293
+ fields: Array<string>;
5294
+
5295
+ presets: unknown;
5296
+ }
5297
+
5298
+ /**
5299
+ * Configuration for the resolution component
5300
+ */
5301
+ export interface ResolutionComponent {
5302
+ /**
5303
+ * The input name of the height
5304
+ */
5305
+ heightInput: string;
5306
+
5307
+ /**
5308
+ * The label of the component
5309
+ */
5310
+ label: string;
5311
+
5312
+ /**
5313
+ * The resolution presets
5314
+ */
5315
+ presets: Array<ResolutionComponent.Preset>;
5316
+
5317
+ /**
5318
+ * The input name of the width
5319
+ */
5320
+ widthInput: string;
5321
+ }
5322
+
5323
+ export namespace ResolutionComponent {
5324
+ export interface Preset {
5325
+ height: number;
5326
+
5327
+ label: string;
5328
+
5329
+ width: number;
5350
5330
  }
5351
5331
  }
5332
+
5333
+ /**
5334
+ * Configuration for the trigger generate button
5335
+ */
5336
+ export interface TriggerGenerate {
5337
+ label: string;
5338
+
5339
+ /**
5340
+ * The 'name' of the input where the trigger generate button will be displayed
5341
+ * (after the input). Do not specify both position and after.
5342
+ */
5343
+ after?: string;
5344
+
5345
+ /**
5346
+ * The position of the trigger generate button. If position specified, the button
5347
+ * will be displayed at the specified position. Do not specify both position and
5348
+ * after.
5349
+ */
5350
+ position?: 'bottom' | 'top';
5351
+ }
5352
5352
  }
5353
5353
  }
5354
5354
 
@@ -5372,6 +5372,7 @@ export namespace ModelCopyResponse {
5372
5372
  capabilities: Array<
5373
5373
  | '3d23d'
5374
5374
  | 'audio2audio'
5375
+ | 'audio2video'
5375
5376
  | 'controlnet'
5376
5377
  | 'controlnet_img2img'
5377
5378
  | 'controlnet_inpaint'
@@ -5398,6 +5399,7 @@ export namespace ModelCopyResponse {
5398
5399
  | 'txt2txt'
5399
5400
  | 'txt2video'
5400
5401
  | 'video23d'
5402
+ | 'video2audio'
5401
5403
  | 'video2img'
5402
5404
  | 'video2video'
5403
5405
  >;
@@ -6735,6 +6737,7 @@ export namespace ModelGetBulkResponse {
6735
6737
  capabilities?: Array<
6736
6738
  | '3d23d'
6737
6739
  | 'audio2audio'
6740
+ | 'audio2video'
6738
6741
  | 'controlnet'
6739
6742
  | 'controlnet_img2img'
6740
6743
  | 'controlnet_inpaint'
@@ -6761,6 +6764,7 @@ export namespace ModelGetBulkResponse {
6761
6764
  | 'txt2txt'
6762
6765
  | 'txt2video'
6763
6766
  | 'video23d'
6767
+ | 'video2audio'
6764
6768
  | 'video2img'
6765
6769
  | 'video2video'
6766
6770
  >;
@@ -7973,6 +7977,7 @@ export namespace ModelTransferResponse {
7973
7977
  capabilities: Array<
7974
7978
  | '3d23d'
7975
7979
  | 'audio2audio'
7980
+ | 'audio2video'
7976
7981
  | 'controlnet'
7977
7982
  | 'controlnet_img2img'
7978
7983
  | 'controlnet_inpaint'
@@ -7999,6 +8004,7 @@ export namespace ModelTransferResponse {
7999
8004
  | 'txt2txt'
8000
8005
  | 'txt2video'
8001
8006
  | 'video23d'
8007
+ | 'video2audio'
8002
8008
  | 'video2img'
8003
8009
  | 'video2video'
8004
8010
  >;
@@ -9804,7 +9810,7 @@ export namespace ModelUpdateParams {
9804
9810
  }
9805
9811
  }
9806
9812
 
9807
- export interface ModelListParams {
9813
+ export interface ModelListParams extends ModelsCursorParams {
9808
9814
  /**
9809
9815
  * If set to true, returns the full list of models (including blacklisted models)
9810
9816
  * (only available for team admins)
@@ -9853,11 +9859,6 @@ export interface ModelListParams {
9853
9859
  */
9854
9860
  pageSize?: number;
9855
9861
 
9856
- /**
9857
- * A token you received in a previous request to query the next page of items
9858
- */
9859
- paginationToken?: string;
9860
-
9861
9862
  /**
9862
9863
  * The privacy of the models to return. The default value is `private`, possible
9863
9864
  * values are `private` and `public`
@@ -10106,6 +10107,7 @@ export declare namespace Models {
10106
10107
  type ModelGetBulkResponse as ModelGetBulkResponse,
10107
10108
  type ModelTransferResponse as ModelTransferResponse,
10108
10109
  type ModelUpdateTagsResponse as ModelUpdateTagsResponse,
10110
+ type ModelListResponsesModelsCursor as ModelListResponsesModelsCursor,
10109
10111
  type ModelCreateParams as ModelCreateParams,
10110
10112
  type ModelRetrieveParams as ModelRetrieveParams,
10111
10113
  type ModelUpdateParams as ModelUpdateParams,