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