@civitai/client 0.1.1-beta.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 (48) hide show
  1. package/README.md +0 -0
  2. package/dist/client/CivitaiClient.d.ts +17 -0
  3. package/dist/client/CivitaiClient.js +24 -0
  4. package/dist/client/RequestsClient.d.ts +0 -0
  5. package/dist/client/RequestsClient.js +58 -0
  6. package/dist/generated/GeneratedClient.d.ts +20 -0
  7. package/dist/generated/GeneratedClient.js +38 -0
  8. package/dist/generated/core/ApiError.d.ts +10 -0
  9. package/dist/generated/core/ApiError.js +15 -0
  10. package/dist/generated/core/ApiRequestOptions.d.ts +13 -0
  11. package/dist/generated/core/ApiRequestOptions.js +2 -0
  12. package/dist/generated/core/ApiResult.d.ts +7 -0
  13. package/dist/generated/core/ApiResult.js +2 -0
  14. package/dist/generated/core/AxiosHttpRequest.d.ts +14 -0
  15. package/dist/generated/core/AxiosHttpRequest.js +20 -0
  16. package/dist/generated/core/BaseHttpRequest.d.ts +8 -0
  17. package/dist/generated/core/BaseHttpRequest.js +9 -0
  18. package/dist/generated/core/CancelablePromise.d.ts +37 -0
  19. package/dist/generated/core/CancelablePromise.js +93 -0
  20. package/dist/generated/core/FetchHttpRequest.d.ts +14 -0
  21. package/dist/generated/core/FetchHttpRequest.js +20 -0
  22. package/dist/generated/core/OpenAPI.d.ts +27 -0
  23. package/dist/generated/core/OpenAPI.js +33 -0
  24. package/dist/generated/core/request.d.ts +49 -0
  25. package/dist/generated/core/request.js +277 -0
  26. package/dist/generated/enums.gen.d.ts +93 -0
  27. package/dist/generated/enums.gen.js +97 -0
  28. package/dist/generated/index.d.ts +9 -0
  29. package/dist/generated/index.js +20 -0
  30. package/dist/generated/schemas.gen.d.ts +2243 -0
  31. package/dist/generated/schemas.gen.js +2244 -0
  32. package/dist/generated/services.gen.d.ts +242 -0
  33. package/dist/generated/services.gen.js +469 -0
  34. package/dist/generated/types.gen.d.ts +1931 -0
  35. package/dist/generated/types.gen.js +3 -0
  36. package/dist/index.d.ts +3 -0
  37. package/dist/index.js +6 -0
  38. package/dist/utils/Air.d.ts +19 -0
  39. package/dist/utils/Air.js +18 -0
  40. package/dist/utils/CivitaiClientError.d.ts +0 -0
  41. package/dist/utils/CivitaiClientError.js +4 -0
  42. package/dist/utils/TimeSpan.d.ts +45 -0
  43. package/dist/utils/TimeSpan.js +101 -0
  44. package/dist/utils/createClient.d.ts +1 -0
  45. package/dist/utils/createClient.js +119 -0
  46. package/dist/utils/index.d.ts +2 -0
  47. package/dist/utils/index.js +5 -0
  48. package/package.json +48 -0
@@ -0,0 +1,1931 @@
1
+ export type ConfigurationOptions = {
2
+ /**
3
+ * Get or set the priority of this configuration if multiple configurations apply to the same worker
4
+ */
5
+ priority?: number;
6
+ selector: Expression;
7
+ /**
8
+ * Get or set the specification associated with this configuration
9
+ */
10
+ spec: unknown;
11
+ };
12
+ export type ConfigurationStatus = {
13
+ configurationId: string;
14
+ assigned?: number;
15
+ targeted?: number;
16
+ applied?: number;
17
+ };
18
+ export type CreateConfigurationResult = {
19
+ configurationId: string;
20
+ };
21
+ export type CreateWorkerResult = {
22
+ workerId: string;
23
+ };
24
+ export type CursedArrayOfTelemetryCursorAndWorkflow = {
25
+ next: string;
26
+ items: Array<Workflow>;
27
+ };
28
+ export type DynamicAssignment = {
29
+ fromPath: string;
30
+ toPath: string;
31
+ defaultValue?: unknown;
32
+ };
33
+ /**
34
+ * Represents the input information needed for the Echo workflow step.
35
+ */
36
+ export type EchoInput = {
37
+ /**
38
+ * The message to be returned in the output.
39
+ */
40
+ message: string;
41
+ };
42
+ /**
43
+ * Represents the output information returned from the Echo workflow step.
44
+ */
45
+ export type EchoOutput = {
46
+ /**
47
+ * The message to be returned.
48
+ */
49
+ message: string;
50
+ };
51
+ /**
52
+ * This step is intended for testing purposes.
53
+ */
54
+ export type EchoStep = WorkflowStep & {
55
+ /**
56
+ * The name of the workflow step. Used to allow steps to refer to one another.
57
+ */
58
+ name?: string | null;
59
+ priority?: Priority;
60
+ /**
61
+ * The maximum time to wait for this step to complete.
62
+ */
63
+ timeout?: string | null;
64
+ /**
65
+ * The maximum number of times this step should be retried.
66
+ */
67
+ retries?: number | null;
68
+ /**
69
+ * The jobs generated by this step.
70
+ */
71
+ jobs?: Array<WorkflowStepJob>;
72
+ status?: WorkflowStatus;
73
+ /**
74
+ * The date / time the step was started. Null if not yet started.
75
+ */
76
+ startedAt?: string | null;
77
+ /**
78
+ * The date / time the step was completed. Null if not yet completed.
79
+ */
80
+ completedAt?: string | null;
81
+ input: EchoInput;
82
+ output?: EchoOutput;
83
+ $type: 'echo';
84
+ };
85
+ export type EchoStepTemplate = WorkflowStepTemplate & {
86
+ $type: 'echo';
87
+ input: EchoInput;
88
+ };
89
+ export type EcosystemElement = {
90
+ [key: string]: EcosystemElement;
91
+ };
92
+ /**
93
+ * An epock result.
94
+ */
95
+ export type EpochResult = {
96
+ /**
97
+ * Get the name of the generated epoch assets
98
+ */
99
+ blobName: string;
100
+ /**
101
+ * Get the total size in bytes of the asset
102
+ */
103
+ blobSize: number;
104
+ /**
105
+ * Get a list of the names of the blobs that represent sample images
106
+ */
107
+ sampleImages?: Array<string>;
108
+ };
109
+ export type Expression = {
110
+ [key: string]: unknown;
111
+ };
112
+ /**
113
+ * Represents an image that is the result of a TextToImage workflow step.
114
+ */
115
+ export type Image = {
116
+ /**
117
+ * Gets the id of the blob that contains this image.
118
+ */
119
+ id: string;
120
+ /**
121
+ * Gets a value indicating whether the image is available.
122
+ */
123
+ available: boolean;
124
+ /**
125
+ * Gets a url that can be used to preview the image.
126
+ */
127
+ url?: string | null;
128
+ /**
129
+ * Get when the url is set to expire
130
+ */
131
+ urlExpiresAt?: string | null;
132
+ /**
133
+ * Get the id of the job that is associated with this image.
134
+ */
135
+ jobId: string;
136
+ };
137
+ /**
138
+ * Information for a controlnet provided for a text to image input.
139
+ */
140
+ export type ImageJobControlNet = {
141
+ preprocessor?: ImageTransformer;
142
+ /**
143
+ * A value representing the weight applied to the ControlNet.
144
+ */
145
+ weight?: number;
146
+ /**
147
+ * A value representing the start step selected for the ControlNet.
148
+ */
149
+ startStep?: number;
150
+ /**
151
+ * A value representing the end step selected for the ControlNet.
152
+ */
153
+ endStep?: number;
154
+ };
155
+ export type ImageJobNetworkParams = {
156
+ /**
157
+ * In case of Lora and LoCon, set the strength of the network
158
+ */
159
+ strength?: number | null;
160
+ /**
161
+ * In case of a TextualInversion, set the trigger word of the network
162
+ */
163
+ triggerWord?: string | null;
164
+ /**
165
+ * A legacy type set by the consumer
166
+ */
167
+ type?: string | null;
168
+ };
169
+ /**
170
+ * Parameters for a text to image step.
171
+ */
172
+ export type ImageJobParams = {
173
+ /**
174
+ * The prompt for the text to image generation.
175
+ */
176
+ prompt?: string | null;
177
+ /**
178
+ * The negative prompt for the text to image generation.
179
+ */
180
+ negativePrompt?: string | null;
181
+ scheduler?: Scheduler;
182
+ /**
183
+ * The number of steps for the text to image generation.
184
+ */
185
+ steps?: number;
186
+ /**
187
+ * The CFG scale value for the text to image generation.
188
+ */
189
+ cfgScale?: number | null;
190
+ /**
191
+ * The width for the image to be generated in pixels.
192
+ */
193
+ width: number;
194
+ /**
195
+ * The height for the image to be generated in pixels.
196
+ */
197
+ height: number;
198
+ /**
199
+ * The seed for the text to image generation.
200
+ */
201
+ seed?: number;
202
+ /**
203
+ * The clip skip value for the text to image generation.
204
+ */
205
+ clipSkip?: number;
206
+ };
207
+ /**
208
+ * Input for an image resource training step.
209
+ */
210
+ export type ImageResourceTrainingInput = {
211
+ /**
212
+ * The primary model to train upon.
213
+ */
214
+ model: string;
215
+ /**
216
+ * A url referring data to use in training.
217
+ */
218
+ trainingData: string;
219
+ /**
220
+ * The desired learning rate for the U-Net.
221
+ */
222
+ unetLR?: number;
223
+ /**
224
+ * The desired learning rate for the text encoder.
225
+ */
226
+ textEncoderLR?: number;
227
+ /**
228
+ * The desired optimizer type.
229
+ */
230
+ optimizerType?: string;
231
+ /**
232
+ * The desired network dimensionality.
233
+ */
234
+ networkDim?: number;
235
+ /**
236
+ * The desired network alpha.
237
+ */
238
+ networkAlpha?: number;
239
+ /**
240
+ * The desired learning rate scheduler.
241
+ */
242
+ lrScheduler?: string;
243
+ /**
244
+ * The desired maximum number of training epochs.
245
+ */
246
+ maxTrainEpochs?: number;
247
+ /**
248
+ * The desired number of repeats.
249
+ */
250
+ numRepeats?: number;
251
+ /**
252
+ * The desired resolution.
253
+ */
254
+ resolution?: number;
255
+ /**
256
+ * The lora type.
257
+ */
258
+ loraType?: string;
259
+ /**
260
+ * EnableBucket?
261
+ */
262
+ enableBucket?: boolean;
263
+ /**
264
+ * KeepTokens?
265
+ */
266
+ keepTokens?: number;
267
+ /**
268
+ * The desired number of cycles for the learning rate scheduler.
269
+ */
270
+ lrSchedulerNumCycles?: number;
271
+ /**
272
+ * The desired training batch size.
273
+ */
274
+ trainBatchSize?: number;
275
+ /**
276
+ * MinSnrGamm?
277
+ */
278
+ minSnrGamma?: number;
279
+ /**
280
+ * Provided arguments for the optimizer.
281
+ */
282
+ optimizerArgs?: string;
283
+ /**
284
+ * ShuffleCaption?
285
+ */
286
+ shuffleCaption?: boolean;
287
+ /**
288
+ * The desired lora name.
289
+ */
290
+ loraName?: string;
291
+ /**
292
+ * The desired noise offset.
293
+ */
294
+ noiseOffset?: number;
295
+ /**
296
+ * A selection of sample prompts.
297
+ */
298
+ samplePrompts?: Array<string>;
299
+ };
300
+ export type ImageResourceTrainingJob = Job & {
301
+ /**
302
+ * An AIR representing the model to use.
303
+ */
304
+ model: string;
305
+ /**
306
+ * A url referring data that needs to be trained upon
307
+ */
308
+ trainingData: string;
309
+ /**
310
+ * A untyped set of parameters that are associated with this job
311
+ */
312
+ params: {
313
+ [key: string]: unknown;
314
+ };
315
+ /**
316
+ * Get cost associated with this job
317
+ */
318
+ cost?: number;
319
+ /**
320
+ * Get or set a custom cost value for this job
321
+ */
322
+ customCost?: number;
323
+ /**
324
+ * An application provided output of the current status of this job
325
+ */
326
+ output?: string | null;
327
+ /**
328
+ * The job type.
329
+ */
330
+ type?: string;
331
+ /**
332
+ * Rick: yeah i think for LoRA we need it to be 5-10 minutes.
333
+ * lora training has this lame effect where it can't send updates while it is uploading... so we need to give it extra buffer
334
+ */
335
+ claimDuration?: string;
336
+ $type: 'ImageResourceTrainingJob';
337
+ };
338
+ export type ImageResourceTrainingOutput = {
339
+ /**
340
+ * An array of epochs.
341
+ */
342
+ epochs: Array<EpochResult>;
343
+ /**
344
+ * Get wether the blobs are actually stored as assets
345
+ * Assets are deprecated and require a different retrieval mechanism
346
+ */
347
+ storedAsAssets?: boolean | null;
348
+ };
349
+ /**
350
+ * A workflow step for training image resources.
351
+ */
352
+ export type ImageResourceTrainingStep = WorkflowStep & {
353
+ /**
354
+ * The name of the workflow step. Used to allow steps to refer to one another.
355
+ */
356
+ name?: string | null;
357
+ priority?: Priority;
358
+ /**
359
+ * The maximum time to wait for this step to complete.
360
+ */
361
+ timeout?: string | null;
362
+ /**
363
+ * The maximum number of times this step should be retried.
364
+ */
365
+ retries?: number | null;
366
+ /**
367
+ * The jobs generated by this step.
368
+ */
369
+ jobs?: Array<WorkflowStepJob>;
370
+ status?: WorkflowStatus;
371
+ /**
372
+ * The date / time the step was started. Null if not yet started.
373
+ */
374
+ startedAt?: string | null;
375
+ /**
376
+ * The date / time the step was completed. Null if not yet completed.
377
+ */
378
+ completedAt?: string | null;
379
+ input: ImageResourceTrainingInput;
380
+ output?: ImageResourceTrainingOutput;
381
+ $type: 'imageResourceTraining';
382
+ };
383
+ export type ImageResourceTrainingStepTemplate = WorkflowStepTemplate & {
384
+ $type: 'imageResourceTraining';
385
+ input: ImageResourceTrainingInput;
386
+ };
387
+ /**
388
+ * Available image transformers.
389
+ */
390
+ export type ImageTransformer = 'canny' | 'depthZoe' | 'softedgePidinet' | 'rembg';
391
+ export type Job = {
392
+ $type: string;
393
+ /**
394
+ * A unique id for this job
395
+ */
396
+ id?: string;
397
+ /**
398
+ * The date when this job got created
399
+ */
400
+ createdAt?: string;
401
+ /**
402
+ * The date for when this job was set to expire
403
+ */
404
+ expireAt?: string | null;
405
+ /**
406
+ * A webhook to be invoked when the job receives a status update
407
+ */
408
+ webhook?: string | null;
409
+ /**
410
+ * A set of user defined properties that can be used to index and partition this job
411
+ */
412
+ properties?: {
413
+ [key: string]: unknown;
414
+ };
415
+ /**
416
+ * The type of this job as a string
417
+ */
418
+ type?: string;
419
+ /**
420
+ * Get a cost estimate for this job
421
+ */
422
+ cost?: number;
423
+ /**
424
+ * The max number of retries before we give up
425
+ */
426
+ maxRetryAttempt?: number;
427
+ /**
428
+ * Get or set a list of dependencies that this job has
429
+ */
430
+ dependencies?: {
431
+ [key: string]: Array<DynamicAssignment> | null;
432
+ };
433
+ /**
434
+ * Get or set the name of the consumer that issued this job
435
+ */
436
+ issuedBy?: string | null;
437
+ /**
438
+ * Get or set the version of this job, this is used to track changes to the job schema
439
+ */
440
+ version?: number;
441
+ /**
442
+ * The total duration that the job can be claimed
443
+ */
444
+ claimDuration?: string;
445
+ /**
446
+ * An internal property to mark that the job has been recovered. We use this to not fiddle with up/down counters as we may have missed other counters
447
+ */
448
+ recovered?: boolean;
449
+ };
450
+ /**
451
+ * Available levels of job support.
452
+ */
453
+ export type JobSupport = 'unsupported' | 'unavailable' | 'available';
454
+ /**
455
+ * LLM prompt augmentaition capabilities.
456
+ */
457
+ export type LLMPromptAugmentationCapabilities = {
458
+ [key: string]: unknown;
459
+ };
460
+ export type LLMPromptAugmentationJob = Job & {
461
+ /**
462
+ * The primary model to use.
463
+ */
464
+ model: string;
465
+ /**
466
+ * The base prompt.
467
+ */
468
+ basePrompt?: string | null;
469
+ /**
470
+ * A list of prompts.
471
+ */
472
+ prompts?: Array<string>;
473
+ /**
474
+ * The temp.
475
+ */
476
+ temp?: number;
477
+ /**
478
+ * The type.
479
+ */
480
+ type?: string;
481
+ $type: 'LLMPromptAugmentationJob';
482
+ };
483
+ /**
484
+ * Details for a specific model.
485
+ */
486
+ export type ModelInfo = {
487
+ /**
488
+ * An AIR ID for the model.
489
+ */
490
+ air: string;
491
+ /**
492
+ * The model size in bytes.
493
+ */
494
+ size: number;
495
+ /**
496
+ * A collection of hashes.
497
+ */
498
+ hashes: {
499
+ [key: string]: string;
500
+ };
501
+ /**
502
+ * An array of download urls.
503
+ */
504
+ downloadUrls: Array<string>;
505
+ /**
506
+ * The name of the model.
507
+ */
508
+ modelName?: string | null;
509
+ /**
510
+ * The name of the version.
511
+ */
512
+ versionName?: string | null;
513
+ /**
514
+ * A date time to invalidate at.
515
+ */
516
+ invalidateAt?: string | null;
517
+ };
518
+ /**
519
+ * Available options for priority.
520
+ */
521
+ export type Priority = 'high' | 'normal' | 'low';
522
+ export type ProblemDetails = {
523
+ type?: string | null;
524
+ title?: string | null;
525
+ status?: number | null;
526
+ detail?: string | null;
527
+ instance?: string | null;
528
+ [key: string]: unknown | undefined;
529
+ };
530
+ /**
531
+ * Details of processing statistics.
532
+ */
533
+ export type ProcessingStatistics = {
534
+ /**
535
+ * The total number of jobs requested.
536
+ */
537
+ totalJobsRequested?: number;
538
+ /**
539
+ * The total cost of jobs requested.
540
+ */
541
+ totalCostRequested?: number;
542
+ /**
543
+ * The total number of successful jobs.
544
+ */
545
+ totalJobsSucceeded?: number;
546
+ /**
547
+ * The total cost of successful jobs.
548
+ */
549
+ totalCostSucceeded?: number;
550
+ /**
551
+ * The total number of rejected jobs.
552
+ */
553
+ totalJobsRejected?: number;
554
+ /**
555
+ * The total cost of rejected jobs.
556
+ */
557
+ totalCostRejected?: number;
558
+ /**
559
+ * The total number of late rejected jobs.
560
+ */
561
+ totalJobsLateRejected?: number;
562
+ /**
563
+ * The total cost of laterejected jobs.
564
+ */
565
+ totalCostLateRejected?: number;
566
+ /**
567
+ * The total number of expired jobs.
568
+ */
569
+ totalJobsExpired?: number;
570
+ /**
571
+ * The total cost of expired jobs.
572
+ */
573
+ totalCostExpired?: number;
574
+ /**
575
+ * The total number of failed jobs.
576
+ */
577
+ totalJobsFailed?: number;
578
+ /**
579
+ * The total cost of failed jobs.
580
+ */
581
+ totalCostFailed?: number;
582
+ /**
583
+ * The total number of completed jobs.
584
+ */
585
+ totalJobsCompleted?: number;
586
+ /**
587
+ * The total cost of completed jobs.
588
+ */
589
+ totalCostCompleted?: number;
590
+ };
591
+ /**
592
+ * The available options for schedulers used in image generation.
593
+ */
594
+ export type Scheduler =
595
+ | 'eulerA'
596
+ | 'euler'
597
+ | 'lms'
598
+ | 'heun'
599
+ | 'dpM2'
600
+ | 'dpM2A'
601
+ | 'dpM2SA'
602
+ | 'dpM2M'
603
+ | 'dpmsde'
604
+ | 'dpmFast'
605
+ | 'dpmAdaptive'
606
+ | 'lmsKarras'
607
+ | 'dpM2Karras'
608
+ | 'dpM2AKarras'
609
+ | 'dpM2SAKarras'
610
+ | 'dpM2MKarras'
611
+ | 'dpmsdeKarras'
612
+ | 'ddim'
613
+ | 'plms'
614
+ | 'uniPC'
615
+ | 'undefined'
616
+ | 'lcm'
617
+ | 'ddpm'
618
+ | 'deis';
619
+ /**
620
+ * Details for a similarity search job.
621
+ */
622
+ export type SimilaritySearchJob = Job & {
623
+ /**
624
+ * An AIR ID representing the primary model.
625
+ */
626
+ model: string;
627
+ /**
628
+ * A value for the NSFW filter.
629
+ */
630
+ nsfwFilter: string;
631
+ /**
632
+ * The prompt provided.
633
+ */
634
+ prompt: string;
635
+ /**
636
+ * A collection of parameters.
637
+ */
638
+ params: {
639
+ [key: string]: unknown;
640
+ };
641
+ /**
642
+ * A value representing the cost of the job.
643
+ */
644
+ cost?: number;
645
+ /**
646
+ * The job type.
647
+ */
648
+ type?: string;
649
+ $type: 'SimilaritySearchJob';
650
+ };
651
+ /**
652
+ * A subscription for pushed based notifications.
653
+ */
654
+ export type Subscription = {
655
+ /**
656
+ * The webhook url.
657
+ */
658
+ webhook: string;
659
+ };
660
+ /**
661
+ * Input for an text to image step.
662
+ */
663
+ export type TextToImageInput = {
664
+ /**
665
+ * Get or sets the number of images to generate in a batch.
666
+ */
667
+ quantity?: number;
668
+ /**
669
+ * The size of each batch.
670
+ */
671
+ batchSize?: number;
672
+ /**
673
+ * The AIR of the checkpoint model to use for generation.
674
+ */
675
+ model: string;
676
+ /**
677
+ * Get or set a associative list of additional networks. Use the AIR of the network as the key.
678
+ */
679
+ additionalNetworks?: {
680
+ [key: string]: ImageJobNetworkParams;
681
+ };
682
+ /**
683
+ * Get or set a associative list of ControlNets.
684
+ */
685
+ controlNets?: Array<ImageJobControlNet>;
686
+ /**
687
+ * The provided text prompt.
688
+ */
689
+ prompt?: string;
690
+ /**
691
+ * The provided negative text prompt.
692
+ */
693
+ negativePrompt?: string;
694
+ scheduler?: Scheduler;
695
+ /**
696
+ * The number of steps for image generation.
697
+ */
698
+ steps?: number;
699
+ /**
700
+ * The CFG scale value for image generation.
701
+ */
702
+ cfgScale?: number;
703
+ /**
704
+ * The desired image width in pixels.
705
+ */
706
+ width: number;
707
+ /**
708
+ * The desired image height in pixels.
709
+ */
710
+ height: number;
711
+ /**
712
+ * The seed to use in image generation. Defaults to a random value if left unpopulated.
713
+ */
714
+ seed?: number;
715
+ /**
716
+ * The clip skip value for image generation.
717
+ */
718
+ clipSkip?: number;
719
+ };
720
+ /**
721
+ * A text to image generation job.
722
+ */
723
+ export type TextToImageJob = Job & {
724
+ /**
725
+ * An AIR representing the model to use.
726
+ */
727
+ model: string;
728
+ params: ImageJobParams;
729
+ /**
730
+ * The hash for the output image.
731
+ */
732
+ imageHash: string;
733
+ /**
734
+ * Get or set a associative list of additional networks. Each network is identified by a hash code.
735
+ */
736
+ additionalNetworks?: {
737
+ [key: string]: ImageJobNetworkParams;
738
+ };
739
+ /**
740
+ * Get or set the URL where the image will be uploaded to.
741
+ */
742
+ destinationUrl?: string | null;
743
+ /**
744
+ * A value indicating whether to store the image as a blob or as a legacy image.
745
+ */
746
+ storeAsBlob?: boolean;
747
+ /**
748
+ * Get or set a list of control nets that should be applied with this textToImage job.
749
+ */
750
+ controlNets?: Array<ImageJobControlNet>;
751
+ /**
752
+ * A value representing the cost of the job.
753
+ */
754
+ cost?: number;
755
+ /**
756
+ * The duration for which this job can be claimed for.
757
+ */
758
+ claimDuration?: string;
759
+ /**
760
+ * The job type.
761
+ */
762
+ type?: string;
763
+ $type: 'TextToImageJob';
764
+ };
765
+ /**
766
+ * Contains slot information for an image generated by a TextToImageJob.
767
+ */
768
+ export type TextToImageJobSlot = {
769
+ /**
770
+ * The hash for the image output.
771
+ */
772
+ imageHash: string;
773
+ /**
774
+ * The destination url for image upload.
775
+ */
776
+ destinationUrl: string;
777
+ };
778
+ /**
779
+ * Represents the output of a TextToImage workflow step.
780
+ */
781
+ export type TextToImageOutput = {
782
+ /**
783
+ * A collection of output images.
784
+ */
785
+ images: Array<Image>;
786
+ };
787
+ /**
788
+ * A workflow step for text to image generations.
789
+ */
790
+ export type TextToImageStep = WorkflowStep & {
791
+ /**
792
+ * The name of the workflow step. Used to allow steps to refer to one another.
793
+ */
794
+ name?: string | null;
795
+ priority?: Priority;
796
+ /**
797
+ * The maximum time to wait for this step to complete.
798
+ */
799
+ timeout?: string | null;
800
+ /**
801
+ * The maximum number of times this step should be retried.
802
+ */
803
+ retries?: number | null;
804
+ /**
805
+ * The jobs generated by this step.
806
+ */
807
+ jobs?: Array<WorkflowStepJob>;
808
+ status?: WorkflowStatus;
809
+ /**
810
+ * The date / time the step was started. Null if not yet started.
811
+ */
812
+ startedAt?: string | null;
813
+ /**
814
+ * The date / time the step was completed. Null if not yet completed.
815
+ */
816
+ completedAt?: string | null;
817
+ input: TextToImageInput;
818
+ output?: TextToImageOutput;
819
+ $type: 'textToImage';
820
+ };
821
+ export type TextToImageStepTemplate = WorkflowStepTemplate & {
822
+ $type: 'textToImage';
823
+ input: TextToImageInput;
824
+ };
825
+ export type TextToImageV2Job = Job & {
826
+ /**
827
+ * An AIR representing the model to use.
828
+ */
829
+ model: string;
830
+ params: ImageJobParams;
831
+ /**
832
+ * Slots for the resulting image outputs.
833
+ */
834
+ slots: Array<TextToImageJobSlot>;
835
+ /**
836
+ * Get or set a associative list of additional networks. Each network is identified by a hash code
837
+ */
838
+ additionalNetworks?: {
839
+ [key: string]: ImageJobNetworkParams;
840
+ };
841
+ /**
842
+ * Get or set a list of control nets that should be applied with this textToImage job
843
+ */
844
+ controlNets?: Array<ImageJobControlNet>;
845
+ /**
846
+ * A value representing the cost of the job.
847
+ */
848
+ cost?: number;
849
+ /**
850
+ * The duration for which this job can be claimed for.
851
+ */
852
+ claimDuration?: string;
853
+ /**
854
+ * The job type.
855
+ */
856
+ type?: string;
857
+ $type: 'TextToImageV2Job';
858
+ };
859
+ /**
860
+ * Transaction information.
861
+ */
862
+ export type TransactionInfo = {
863
+ /**
864
+ * The transaction amount.
865
+ */
866
+ amount: number;
867
+ /**
868
+ * The transaction ID.
869
+ */
870
+ id: string | null;
871
+ };
872
+ /**
873
+ * An request for updating a workflow.
874
+ */
875
+ export type UpdateWorkflowRequest = {
876
+ status?: UpdateWorkflowStatus;
877
+ /**
878
+ * An optional set of new properties to set on the workflow.
879
+ */
880
+ metadata?: {
881
+ [key: string]: unknown;
882
+ } | null;
883
+ };
884
+ /**
885
+ * Available statuses for updating workflows.
886
+ */
887
+ export type UpdateWorkflowStatus = 'canceled';
888
+ /**
889
+ * Details of a worker's capabilities.
890
+ */
891
+ export type WorkerCapabilities = {
892
+ image?: WorkerImageCapabilities;
893
+ media?: WorkerMediaCapabilities;
894
+ modelManagement?: WorkerModelPreparationCapabilities;
895
+ configurationManagement?: WorkerConfigurationCapabilities;
896
+ similaritySearch?: WorkerSimilaritySearchCapabilities;
897
+ llmPromptAugmentation?: LLMPromptAugmentationCapabilities;
898
+ };
899
+ /**
900
+ * Details of a worker's configuration capabilities.
901
+ */
902
+ export type WorkerConfigurationCapabilities = {
903
+ [key: string]: unknown;
904
+ };
905
+ /**
906
+ * Details for a particular worker.
907
+ */
908
+ export type WorkerDetails = {
909
+ /**
910
+ * The worker's ID.
911
+ */
912
+ id: string;
913
+ /**
914
+ * The worker's name.
915
+ */
916
+ name: string;
917
+ /**
918
+ * The worker's active job count.
919
+ */
920
+ activeJobs?: number;
921
+ /**
922
+ * The number of jobs in the worker's queue.
923
+ */
924
+ queueSize?: number;
925
+ /**
926
+ * The total cost of job's in the worker's queue.
927
+ */
928
+ queueDepth?: number;
929
+ /**
930
+ * The worker's start date / time.
931
+ */
932
+ startDate?: string;
933
+ /**
934
+ * The worker's last request date / time.
935
+ */
936
+ lastRequestDate?: string | null;
937
+ /**
938
+ * The worker's expiration date / time.
939
+ */
940
+ expirationDate?: string | null;
941
+ statistics?: ProcessingStatistics;
942
+ /**
943
+ * The worker's succeeded job throughput rate.
944
+ */
945
+ succeededThroughputRate?: number;
946
+ /**
947
+ * The worker's failed job throughput rate.
948
+ */
949
+ failedThroughputRate?: number;
950
+ /**
951
+ * The worker's idle rate.
952
+ */
953
+ idleRate?: number;
954
+ /**
955
+ * The date / time of the worker's last successfully completed job.
956
+ */
957
+ lastSuccesfullyCompletedJobDate?: string | null;
958
+ /**
959
+ * The date / time of the worker's last job update.
960
+ */
961
+ lastJobUpdateDate?: string | null;
962
+ /**
963
+ * The date / time that the worker's subscription was set.
964
+ */
965
+ subscriptionSetDate?: string | null;
966
+ /**
967
+ * The date / time that the worker was quarantined.
968
+ */
969
+ quarantineDate?: string | null;
970
+ };
971
+ /**
972
+ * Details of a worker's image capabilities.
973
+ */
974
+ export type WorkerImageCapabilities = {
975
+ textToImage?: WorkerImageTextToImageCapabilities;
976
+ imageToImage?: WorkerImageImageToImageCapabilities;
977
+ transform?: WorkerImageTransformCapabilities;
978
+ resourceTraining?: WorkerImageResourceTrainingCapabilities;
979
+ embedding?: WorkerImageEmbeddingCapabilities;
980
+ };
981
+ /**
982
+ * Details of a worker's image embedding capabilities.
983
+ */
984
+ export type WorkerImageEmbeddingCapabilities = {
985
+ [key: string]: unknown;
986
+ };
987
+ /**
988
+ * Details of a worker's image to image capabilities.
989
+ */
990
+ export type WorkerImageImageToImageCapabilities = {
991
+ /**
992
+ * The worker's maximum supported image size for image to image (squared).
993
+ */
994
+ size?: number;
995
+ /**
996
+ * A list of schedulers the worker supports for image to image.
997
+ */
998
+ schedulers?: Array<Scheduler>;
999
+ /**
1000
+ * The number of ControlNets the worker supports for image to image (at once).
1001
+ */
1002
+ controlNet?: number;
1003
+ /**
1004
+ * Indicates whether the worker supports inpaiting.
1005
+ */
1006
+ inpainting?: boolean;
1007
+ };
1008
+ /**
1009
+ * Details of a worker's image resource training capabilities.
1010
+ */
1011
+ export type WorkerImageResourceTrainingCapabilities = {
1012
+ [key: string]: unknown;
1013
+ };
1014
+ /**
1015
+ * Details of a worker's text to image capabilities.
1016
+ */
1017
+ export type WorkerImageTextToImageCapabilities = {
1018
+ /**
1019
+ * The worker's maximum supported image size for text to image (squared).
1020
+ */
1021
+ size?: number;
1022
+ /**
1023
+ * A list of schedulers the worker supports for text to image.
1024
+ */
1025
+ schedulers?: Array<Scheduler>;
1026
+ /**
1027
+ * The number of ControlNets the worker supports for text to image (at once).
1028
+ */
1029
+ controlNet?: number;
1030
+ };
1031
+ /**
1032
+ * Details of a worker's image transform capabilities.
1033
+ */
1034
+ export type WorkerImageTransformCapabilities = {
1035
+ /**
1036
+ * A list of supported image transformers.
1037
+ */
1038
+ transformers?: Array<ImageTransformer>;
1039
+ };
1040
+ /**
1041
+ * Details of a worker's media capabilities.
1042
+ */
1043
+ export type WorkerMediaCapabilities = {
1044
+ wdTagging?: WorkerMediaWDTaggingCapabilities;
1045
+ comfy?: WorkerMediaComfyCapabilities;
1046
+ tagging?: WorkerMediaTaggingCapabilities;
1047
+ movieRating?: WorkerMediaMovieRatingCapabilities;
1048
+ };
1049
+ /**
1050
+ * Details of a worker's media comfy capabilities.
1051
+ */
1052
+ export type WorkerMediaComfyCapabilities = {
1053
+ [key: string]: unknown;
1054
+ };
1055
+ /**
1056
+ * Details of a worker's media movie rating capabilities.
1057
+ */
1058
+ export type WorkerMediaMovieRatingCapabilities = {
1059
+ [key: string]: unknown;
1060
+ };
1061
+ /**
1062
+ * Details of a worker's media tagging capabilities.
1063
+ */
1064
+ export type WorkerMediaTaggingCapabilities = {
1065
+ [key: string]: unknown;
1066
+ };
1067
+ /**
1068
+ * Details of a worker's media WD tagging capabilities.
1069
+ */
1070
+ export type WorkerMediaWDTaggingCapabilities = {
1071
+ [key: string]: unknown;
1072
+ };
1073
+ /**
1074
+ * Options for representing the status for a model on a worker.
1075
+ */
1076
+ export type WorkerModelAvailability =
1077
+ | 'unknown'
1078
+ | 'unsupported'
1079
+ | 'unavailable'
1080
+ | 'available'
1081
+ | 'providerUnsupported';
1082
+ /**
1083
+ * Details of a worker's model preparation capabilities.
1084
+ */
1085
+ export type WorkerModelPreparationCapabilities = {
1086
+ [key: string]: unknown;
1087
+ };
1088
+ /**
1089
+ * Details for the status of a model on a particular worker.
1090
+ */
1091
+ export type WorkerModelStatus = {
1092
+ availability: WorkerModelAvailability;
1093
+ /**
1094
+ * The cost associated with this model.
1095
+ */
1096
+ cost?: number;
1097
+ };
1098
+ /**
1099
+ * Details of a worker's registration.
1100
+ */
1101
+ export type WorkerRegistration = {
1102
+ legacyName?: string | null;
1103
+ /**
1104
+ * The worker's name.
1105
+ */
1106
+ name: string;
1107
+ /**
1108
+ * An array of asset types the worker can retrieve on demand.
1109
+ */
1110
+ onDemandModelTypesAsArray?: Array<string>;
1111
+ /**
1112
+ * A hash set of asset types the worker can retrieve on demand.
1113
+ */
1114
+ onDemandModelTypes?: Array<string>;
1115
+ capabilities?: WorkerCapabilities;
1116
+ subscription?: Subscription;
1117
+ type?: WorkerType;
1118
+ /**
1119
+ * The number of requests the worker can handle at once.
1120
+ */
1121
+ concurrentLimit?: number;
1122
+ /**
1123
+ * A collection of ecosystems the worker supports.
1124
+ */
1125
+ ecosystems?: {
1126
+ [key: string]: EcosystemElement;
1127
+ };
1128
+ /**
1129
+ * A collection of information about the availability of particular models on this worker.
1130
+ */
1131
+ models?: {
1132
+ [key: string]: WorkerModelStatus;
1133
+ };
1134
+ /**
1135
+ * The name of the closest cache level that this worker can interact with.
1136
+ */
1137
+ cacheLevel?: string | null;
1138
+ /**
1139
+ * The max queue size before the worker stops accepting requests that require cold swapping.
1140
+ */
1141
+ maxColdSwapQueueSize?: number | null;
1142
+ /**
1143
+ * The max size in Mb of downloads that can be pending.
1144
+ */
1145
+ maxPendingModelSize?: number | null;
1146
+ /**
1147
+ * A value indicating if worker should consume jobs that are not yet available.
1148
+ */
1149
+ consumeUnavailableJobs?: boolean;
1150
+ /**
1151
+ * An optional identifier unique to this worker.
1152
+ */
1153
+ nodeIdentifier?: string | null;
1154
+ };
1155
+ /**
1156
+ * Details of a worker's similarity search capabilities.
1157
+ */
1158
+ export type WorkerSimilaritySearchCapabilities = {
1159
+ [key: string]: unknown;
1160
+ };
1161
+ /**
1162
+ * Available values for worker type.
1163
+ */
1164
+ export type WorkerType = 'normal' | 'deferred';
1165
+ /**
1166
+ * Details of a workflow.
1167
+ */
1168
+ export type Workflow = {
1169
+ /**
1170
+ * The ID for the workflow.
1171
+ */
1172
+ id?: string | null;
1173
+ /**
1174
+ * The date / time the workflow was created.
1175
+ */
1176
+ createdAt?: string;
1177
+ /**
1178
+ * An array of transactions on this workflow.
1179
+ */
1180
+ transactions?: Array<TransactionInfo> | null;
1181
+ /**
1182
+ * A collection of user defined metadata for the workflow.
1183
+ */
1184
+ metadata?: {
1185
+ [key: string]: unknown;
1186
+ } | null;
1187
+ status?: WorkflowStatus;
1188
+ /**
1189
+ * The date / time the workflow was started. Null if not yet started.
1190
+ */
1191
+ startedAt?: string | null;
1192
+ /**
1193
+ * The date / time the workflow was completed. Null if not yet complete.
1194
+ */
1195
+ completedAt?: string | null;
1196
+ /**
1197
+ * The steps for the workflow.
1198
+ */
1199
+ steps?: Array<WorkflowStep>;
1200
+ /**
1201
+ * An array of callback details for the workflow.
1202
+ */
1203
+ callbacks?: Array<WorkflowCallback>;
1204
+ };
1205
+ /**
1206
+ * Details of a callback setup for a workflow.
1207
+ */
1208
+ export type WorkflowCallback = {
1209
+ /**
1210
+ * The url for the callback.
1211
+ */
1212
+ url: string;
1213
+ /**
1214
+ * An array of event types to send to the callback.
1215
+ */
1216
+ type: Array<
1217
+ | 'workflow:*'
1218
+ | 'workflow:unassigned'
1219
+ | 'workflow:processing'
1220
+ | 'workflow:succeeded'
1221
+ | 'workflow:failed'
1222
+ | 'workflow:expired'
1223
+ | 'workflow:canceled'
1224
+ | 'step:*'
1225
+ | 'step:unassigned'
1226
+ | 'step:processing'
1227
+ | 'step:succeeded'
1228
+ | 'step:failed'
1229
+ | 'step:expired'
1230
+ | 'step:canceled'
1231
+ | 'job:*'
1232
+ | 'job:unassigned'
1233
+ | 'job:processing'
1234
+ | 'job:succeeded'
1235
+ | 'job:failed'
1236
+ | 'job:expired'
1237
+ | 'job:canceled'
1238
+ >;
1239
+ };
1240
+ /**
1241
+ * Details of a workflow event.
1242
+ */
1243
+ export type WorkflowEvent = {
1244
+ /**
1245
+ * The ID that represents the corresponding workflow.
1246
+ */
1247
+ workflowId: string;
1248
+ status: WorkflowStatus;
1249
+ $type?: string | null;
1250
+ };
1251
+ /**
1252
+ * Values available to represent workflow status.
1253
+ */
1254
+ export type WorkflowStatus =
1255
+ | 'unassigned'
1256
+ | 'preparing'
1257
+ | 'scheduled'
1258
+ | 'processing'
1259
+ | 'succeeded'
1260
+ | 'failed'
1261
+ | 'expired'
1262
+ | 'canceled';
1263
+ /**
1264
+ * Details of a workflow step.
1265
+ */
1266
+ export type WorkflowStep = {
1267
+ $type: string;
1268
+ /**
1269
+ * The name of the workflow step. Used to allow steps to refer to one another.
1270
+ */
1271
+ name?: string | null;
1272
+ priority?: Priority;
1273
+ /**
1274
+ * The maximum time to wait for this step to complete.
1275
+ */
1276
+ timeout?: string | null;
1277
+ /**
1278
+ * The maximum number of times this step should be retried.
1279
+ */
1280
+ retries?: number | null;
1281
+ /**
1282
+ * The jobs generated by this step.
1283
+ */
1284
+ jobs?: Array<WorkflowStepJob>;
1285
+ status?: WorkflowStatus;
1286
+ /**
1287
+ * The date / time the step was started. Null if not yet started.
1288
+ */
1289
+ startedAt?: string | null;
1290
+ /**
1291
+ * The date / time the step was completed. Null if not yet completed.
1292
+ */
1293
+ completedAt?: string | null;
1294
+ };
1295
+ /**
1296
+ * Details of a workflow step event.
1297
+ */
1298
+ export type WorkflowStepEvent = {
1299
+ /**
1300
+ * The workflow ID.
1301
+ */
1302
+ workflowId: string;
1303
+ /**
1304
+ * The workflow step's name.
1305
+ */
1306
+ stepName: string;
1307
+ status: WorkflowStatus;
1308
+ $type?: string | null;
1309
+ };
1310
+ /**
1311
+ * Details of a job produced by a workflow step.
1312
+ */
1313
+ export type WorkflowStepJob = {
1314
+ /**
1315
+ * The job's ID.
1316
+ */
1317
+ id: string;
1318
+ /**
1319
+ * The job's cost.
1320
+ */
1321
+ cost: number;
1322
+ status?: WorkflowStatus;
1323
+ /**
1324
+ * The date / time the job started. Null if not yet started.
1325
+ */
1326
+ startedAt?: string | null;
1327
+ /**
1328
+ * The date / time the job completed. Null if not yet completed.
1329
+ */
1330
+ completedAt?: string | null;
1331
+ queuePosition?: WorkflowStepJobQueuePosition;
1332
+ };
1333
+ /**
1334
+ * Details of a workflow step job event.
1335
+ */
1336
+ export type WorkflowStepJobEvent = {
1337
+ /**
1338
+ * The workflow ID.
1339
+ */
1340
+ workflowId: string;
1341
+ /**
1342
+ * The step's name.
1343
+ */
1344
+ stepName: string;
1345
+ /**
1346
+ * The job's ID.
1347
+ */
1348
+ jobId: string;
1349
+ status: WorkflowStatus;
1350
+ $type?: string | null;
1351
+ };
1352
+ /**
1353
+ * Details of the workflow step job's queue position.
1354
+ */
1355
+ export type WorkflowStepJobQueuePosition = {
1356
+ support?: JobSupport;
1357
+ /**
1358
+ * The number of preceding jobs in the queue.
1359
+ */
1360
+ precedingJobs?: number | null;
1361
+ /**
1362
+ * An estimated date / time for when the job will start.
1363
+ */
1364
+ startAt?: string | null;
1365
+ /**
1366
+ * An estimated date / time for when the job will complete.
1367
+ */
1368
+ completeAt?: string | null;
1369
+ };
1370
+ /**
1371
+ * Details of a workflow step template.
1372
+ */
1373
+ export type WorkflowStepTemplate = {
1374
+ /**
1375
+ * The type of step the template represents.
1376
+ */
1377
+ $type: string;
1378
+ /**
1379
+ * The name of the workflow step. Used to allow steps to refer to one another.
1380
+ */
1381
+ name?: string | null;
1382
+ priority?: Priority;
1383
+ /**
1384
+ * The maximum time to wait for this step to complete.
1385
+ */
1386
+ timeout?: string | null;
1387
+ /**
1388
+ * The maximum number of times this step should be retried.
1389
+ */
1390
+ retries?: number | null;
1391
+ };
1392
+ /**
1393
+ * Details of a requested workflow.
1394
+ */
1395
+ export type WorkflowTemplate = {
1396
+ /**
1397
+ * A colletion of user defined metadata that can be used to store additional information about the workflow.
1398
+ */
1399
+ metadata?: {
1400
+ [key: string]: unknown;
1401
+ } | null;
1402
+ /**
1403
+ * An array of steps that compose this workflow.
1404
+ */
1405
+ steps: Array<WorkflowStepTemplate>;
1406
+ /**
1407
+ * An array of callbacks to be triggered during the lifetime of the workflow.
1408
+ */
1409
+ callbacks?: Array<WorkflowCallback>;
1410
+ };
1411
+ export type $OpenApiTs = {
1412
+ '/v2/consumer/blobs/{blobId}': {
1413
+ get: {
1414
+ req: {
1415
+ /**
1416
+ * The blob ID to retrieve.
1417
+ */
1418
+ blobId: string;
1419
+ };
1420
+ res: {
1421
+ /**
1422
+ * Unauthorized
1423
+ */
1424
+ 401: ProblemDetails;
1425
+ };
1426
+ };
1427
+ };
1428
+ '/v2/providers/configurations': {
1429
+ post: {
1430
+ req: {
1431
+ /**
1432
+ * The details of the configuration being created.
1433
+ */
1434
+ requestBody?: ConfigurationOptions;
1435
+ };
1436
+ res: {
1437
+ /**
1438
+ * Success
1439
+ */
1440
+ 200: CreateConfigurationResult;
1441
+ /**
1442
+ * Unauthorized
1443
+ */
1444
+ 401: ProblemDetails;
1445
+ /**
1446
+ * Forbidden
1447
+ */
1448
+ 403: ProblemDetails;
1449
+ };
1450
+ };
1451
+ get: {
1452
+ res: {
1453
+ /**
1454
+ * Success
1455
+ */
1456
+ 200: ConfigurationStatus;
1457
+ /**
1458
+ * Unauthorized
1459
+ */
1460
+ 401: ProblemDetails;
1461
+ /**
1462
+ * Forbidden
1463
+ */
1464
+ 403: ProblemDetails;
1465
+ };
1466
+ };
1467
+ };
1468
+ '/v2/providers/configurations/{configurationId}/options': {
1469
+ get: {
1470
+ req: {
1471
+ /**
1472
+ * The ID of the configuration whose options are being requested.
1473
+ */
1474
+ configurationId: string;
1475
+ };
1476
+ res: {
1477
+ /**
1478
+ * Success
1479
+ */
1480
+ 200: ConfigurationOptions;
1481
+ /**
1482
+ * Unauthorized
1483
+ */
1484
+ 401: ProblemDetails;
1485
+ /**
1486
+ * Forbidden
1487
+ */
1488
+ 403: ProblemDetails;
1489
+ /**
1490
+ * Not Found
1491
+ */
1492
+ 404: ProblemDetails;
1493
+ };
1494
+ };
1495
+ };
1496
+ '/v2/providers/configurations/{configurationId}': {
1497
+ delete: {
1498
+ req: {
1499
+ /**
1500
+ * The ID of the configuration to delete.
1501
+ */
1502
+ configurationId: string;
1503
+ };
1504
+ res: {
1505
+ /**
1506
+ * Success
1507
+ */
1508
+ 200: unknown;
1509
+ /**
1510
+ * Unauthorized
1511
+ */
1512
+ 401: ProblemDetails;
1513
+ /**
1514
+ * Forbidden
1515
+ */
1516
+ 403: ProblemDetails;
1517
+ /**
1518
+ * Not Found
1519
+ */
1520
+ 404: ProblemDetails;
1521
+ };
1522
+ };
1523
+ };
1524
+ '/v2/models/{air}': {
1525
+ get: {
1526
+ req: {
1527
+ /**
1528
+ * A unique ID for the model being requested. See https://developer.civitai.com/docs/getting-started/ai-resource-identifier for more info on AIRs.
1529
+ */
1530
+ air: string;
1531
+ };
1532
+ res: {
1533
+ /**
1534
+ * Success
1535
+ */
1536
+ 200: ModelInfo;
1537
+ /**
1538
+ * Bad Request
1539
+ */
1540
+ 400: ProblemDetails;
1541
+ /**
1542
+ * Not Found
1543
+ */
1544
+ 404: ProblemDetails;
1545
+ };
1546
+ };
1547
+ delete: {
1548
+ req: {
1549
+ /**
1550
+ * A unique ID for the model being requested. See https://developer.civitai.com/docs/getting-started/ai-resource-identifier for more info on AIRs.
1551
+ */
1552
+ air: string;
1553
+ };
1554
+ res: {
1555
+ /**
1556
+ * No Content
1557
+ */
1558
+ 204: void;
1559
+ /**
1560
+ * Bad Request
1561
+ */
1562
+ 400: ProblemDetails;
1563
+ };
1564
+ };
1565
+ };
1566
+ '/v2/providers/workers/{workerId}/jobs': {
1567
+ get: {
1568
+ req: {
1569
+ claim?: boolean;
1570
+ take?: number;
1571
+ wait?: number | null;
1572
+ workerId: string;
1573
+ };
1574
+ res: {
1575
+ /**
1576
+ * Success
1577
+ */
1578
+ 200: Array<Job>;
1579
+ /**
1580
+ * Unauthorized
1581
+ */
1582
+ 401: ProblemDetails;
1583
+ /**
1584
+ * Forbidden
1585
+ */
1586
+ 403: ProblemDetails;
1587
+ /**
1588
+ * Not Found
1589
+ */
1590
+ 404: ProblemDetails;
1591
+ };
1592
+ };
1593
+ };
1594
+ '/v2/providers/workers': {
1595
+ post: {
1596
+ req: {
1597
+ /**
1598
+ * The registration specifying the details of the worker to be created.
1599
+ */
1600
+ requestBody?: WorkerRegistration;
1601
+ };
1602
+ res: {
1603
+ /**
1604
+ * Created
1605
+ */
1606
+ 201: CreateWorkerResult;
1607
+ /**
1608
+ * Bad Request
1609
+ */
1610
+ 400: ProblemDetails;
1611
+ /**
1612
+ * Unauthorized
1613
+ */
1614
+ 401: ProblemDetails;
1615
+ /**
1616
+ * Forbidden
1617
+ */
1618
+ 403: ProblemDetails;
1619
+ };
1620
+ };
1621
+ get: {
1622
+ res: {
1623
+ /**
1624
+ * Success
1625
+ */
1626
+ 200: Array<WorkerDetails>;
1627
+ /**
1628
+ * Unauthorized
1629
+ */
1630
+ 401: ProblemDetails;
1631
+ /**
1632
+ * Forbidden
1633
+ */
1634
+ 403: ProblemDetails;
1635
+ };
1636
+ };
1637
+ };
1638
+ '/v2/providers/workers/{workerId}': {
1639
+ get: {
1640
+ req: {
1641
+ /**
1642
+ * The ID for the requested worker.
1643
+ */
1644
+ workerId: string;
1645
+ };
1646
+ res: {
1647
+ /**
1648
+ * Success
1649
+ */
1650
+ 200: WorkerDetails;
1651
+ /**
1652
+ * Unauthorized
1653
+ */
1654
+ 401: ProblemDetails;
1655
+ /**
1656
+ * Forbidden
1657
+ */
1658
+ 403: ProblemDetails;
1659
+ /**
1660
+ * Not Found
1661
+ */
1662
+ 404: ProblemDetails;
1663
+ };
1664
+ };
1665
+ delete: {
1666
+ req: {
1667
+ /**
1668
+ * The ID for the worker to be deleted.
1669
+ */
1670
+ workerId: string;
1671
+ };
1672
+ res: {
1673
+ /**
1674
+ * No Content
1675
+ */
1676
+ 204: void;
1677
+ /**
1678
+ * Unauthorized
1679
+ */
1680
+ 401: ProblemDetails;
1681
+ /**
1682
+ * Forbidden
1683
+ */
1684
+ 403: ProblemDetails;
1685
+ /**
1686
+ * Not Found
1687
+ */
1688
+ 404: ProblemDetails;
1689
+ };
1690
+ };
1691
+ };
1692
+ '/v2/providers/workers/{workerId}/registration': {
1693
+ get: {
1694
+ req: {
1695
+ /**
1696
+ * The ID of the worker whose registration is being requested.
1697
+ */
1698
+ workerId: string;
1699
+ };
1700
+ res: {
1701
+ /**
1702
+ * Success
1703
+ */
1704
+ 200: WorkerRegistration;
1705
+ /**
1706
+ * Unauthorized
1707
+ */
1708
+ 401: ProblemDetails;
1709
+ /**
1710
+ * Forbidden
1711
+ */
1712
+ 403: ProblemDetails;
1713
+ /**
1714
+ * Not Found
1715
+ */
1716
+ 404: ProblemDetails;
1717
+ };
1718
+ };
1719
+ put: {
1720
+ req: {
1721
+ /**
1722
+ * The registration details to update on the worker's registration.
1723
+ */
1724
+ requestBody?: WorkerRegistration;
1725
+ /**
1726
+ * The ID for the worker whose registration is being updated.
1727
+ */
1728
+ workerId: string;
1729
+ };
1730
+ res: {
1731
+ /**
1732
+ * No Content
1733
+ */
1734
+ 204: void;
1735
+ /**
1736
+ * Bad Request
1737
+ */
1738
+ 400: ProblemDetails;
1739
+ /**
1740
+ * Unauthorized
1741
+ */
1742
+ 401: ProblemDetails;
1743
+ /**
1744
+ * Forbidden
1745
+ */
1746
+ 403: ProblemDetails;
1747
+ /**
1748
+ * Not Found
1749
+ */
1750
+ 404: ProblemDetails;
1751
+ };
1752
+ };
1753
+ };
1754
+ '/v2/providers/workers/{workerId}/registration/models': {
1755
+ patch: {
1756
+ req: {
1757
+ /**
1758
+ * A dictionary of model AIRs and their corresponding status for on that worker.
1759
+ */
1760
+ requestBody?: {
1761
+ [key: string]: WorkerModelStatus;
1762
+ };
1763
+ /**
1764
+ * The ID for the worker whose registration models are being patched.
1765
+ */
1766
+ workerId: string;
1767
+ };
1768
+ res: {
1769
+ /**
1770
+ * No Content
1771
+ */
1772
+ 204: void;
1773
+ /**
1774
+ * Bad Request
1775
+ */
1776
+ 400: ProblemDetails;
1777
+ /**
1778
+ * Unauthorized
1779
+ */
1780
+ 401: ProblemDetails;
1781
+ /**
1782
+ * Forbidden
1783
+ */
1784
+ 403: ProblemDetails;
1785
+ /**
1786
+ * Not Found
1787
+ */
1788
+ 404: ProblemDetails;
1789
+ };
1790
+ };
1791
+ };
1792
+ '/v2/consumer/workflows': {
1793
+ post: {
1794
+ req: {
1795
+ requestBody?: WorkflowTemplate;
1796
+ /**
1797
+ * Whether to wait for the workflow to complete before returning or to return immediately
1798
+ * The request may return a 202 if the clients waits for the workflow to complete and the workflow does not complete within the requested timeout.
1799
+ * In which case the client should use the token to query the status of the workflow.
1800
+ */
1801
+ wait?: number;
1802
+ /**
1803
+ * Whether to actually submit the workflow or return an estimate on what would happen upon submission
1804
+ */
1805
+ whatif?: boolean;
1806
+ };
1807
+ res: {
1808
+ /**
1809
+ * Success
1810
+ */
1811
+ 200: Workflow;
1812
+ /**
1813
+ * Bad Request
1814
+ */
1815
+ 400: ProblemDetails;
1816
+ /**
1817
+ * Unauthorized
1818
+ */
1819
+ 401: ProblemDetails;
1820
+ };
1821
+ };
1822
+ get: {
1823
+ req: {
1824
+ /**
1825
+ * An optional cursor to continue querying workflows from a previous query.
1826
+ */
1827
+ cursor?: string;
1828
+ /**
1829
+ * The type of job to filter on.
1830
+ */
1831
+ jobType?: Array<string>;
1832
+ /**
1833
+ * How many workflows to return
1834
+ */
1835
+ take?: number;
1836
+ };
1837
+ res: {
1838
+ /**
1839
+ * Success
1840
+ */
1841
+ 200: CursedArrayOfTelemetryCursorAndWorkflow;
1842
+ /**
1843
+ * Unauthorized
1844
+ */
1845
+ 401: ProblemDetails;
1846
+ };
1847
+ };
1848
+ };
1849
+ '/v2/consumer/workflows/{workflowId}': {
1850
+ get: {
1851
+ req: {
1852
+ /**
1853
+ * Whether to wait for the workflow to complete before returning or to return immediately
1854
+ * The request may return a 202 if the clients waits for the workflow to complete and the workflow does not complete within the requested timeout.
1855
+ * In which case the client should use the token to query the status of the workflow.
1856
+ */
1857
+ wait?: boolean;
1858
+ /**
1859
+ * The id of the workflow to get status for
1860
+ */
1861
+ workflowId: string;
1862
+ };
1863
+ res: {
1864
+ /**
1865
+ * Success
1866
+ */
1867
+ 200: Workflow;
1868
+ /**
1869
+ * Unauthorized
1870
+ */
1871
+ 401: ProblemDetails;
1872
+ /**
1873
+ * Not Found
1874
+ */
1875
+ 404: ProblemDetails;
1876
+ };
1877
+ };
1878
+ put: {
1879
+ req: {
1880
+ /**
1881
+ * The details to update on the workflow.
1882
+ */
1883
+ requestBody?: UpdateWorkflowRequest;
1884
+ /**
1885
+ * The id of the request to update.
1886
+ */
1887
+ workflowId: string;
1888
+ };
1889
+ res: {
1890
+ /**
1891
+ * No Content
1892
+ */
1893
+ 204: void;
1894
+ /**
1895
+ * Bad Request
1896
+ */
1897
+ 400: ProblemDetails;
1898
+ /**
1899
+ * Unauthorized
1900
+ */
1901
+ 401: ProblemDetails;
1902
+ /**
1903
+ * Not Found
1904
+ */
1905
+ 404: ProblemDetails;
1906
+ };
1907
+ };
1908
+ delete: {
1909
+ req: {
1910
+ /**
1911
+ * The id of the workflow to delete.
1912
+ */
1913
+ workflowId: string;
1914
+ };
1915
+ res: {
1916
+ /**
1917
+ * No Content
1918
+ */
1919
+ 204: void;
1920
+ /**
1921
+ * Unauthorized
1922
+ */
1923
+ 401: ProblemDetails;
1924
+ /**
1925
+ * Not Found
1926
+ */
1927
+ 404: ProblemDetails;
1928
+ };
1929
+ };
1930
+ };
1931
+ };