@civitai/client 0.2.0-beta.4 → 0.2.0-beta.40

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.
@@ -13,7 +13,9 @@ export function createCivitaiClient(config) {
13
13
  client.interceptors.response.use(async (response) => {
14
14
  if (!response.ok) {
15
15
  const error = (response.status === 400
16
- ? await response.json()
16
+ ? await response
17
+ .json()
18
+ .catch(() => ({ status: response.status, detail: response.statusText }))
17
19
  : { status: response.status, detail: response.statusText });
18
20
  const newResponse = new Response(JSON.stringify(error), {
19
21
  status: response.status,
@@ -5,12 +5,32 @@ import type {
5
5
  HeadBlobData,
6
6
  HeadBlobResponses,
7
7
  HeadBlobErrors,
8
+ GetConsumerBlobUploadUrlData,
9
+ GetConsumerBlobUploadUrlResponses,
10
+ GetConsumerBlobUploadUrlErrors,
11
+ UploadConsumerBlobData,
12
+ UploadConsumerBlobResponses,
13
+ UploadConsumerBlobErrors,
14
+ GetBlobContentData,
15
+ GetBlobContentResponses,
16
+ GetBlobContentErrors,
17
+ GetBlockedContentData,
18
+ GetBlockedContentErrors,
19
+ InvokeAceStepAudioStepTemplateData,
20
+ InvokeAceStepAudioStepTemplateResponses,
21
+ InvokeAceStepAudioStepTemplateErrors,
8
22
  InvokeAgeClassificationStepTemplateData,
9
23
  InvokeAgeClassificationStepTemplateResponses,
10
24
  InvokeAgeClassificationStepTemplateErrors,
25
+ InvokeChatCompletionStepTemplateData,
26
+ InvokeChatCompletionStepTemplateResponses,
27
+ InvokeChatCompletionStepTemplateErrors,
11
28
  InvokeComfyStepTemplateData,
12
29
  InvokeComfyStepTemplateResponses,
13
30
  InvokeComfyStepTemplateErrors,
31
+ InvokeConvertImageStepTemplateData,
32
+ InvokeConvertImageStepTemplateResponses,
33
+ InvokeConvertImageStepTemplateErrors,
14
34
  InvokeEchoStepTemplateData,
15
35
  InvokeEchoStepTemplateResponses,
16
36
  InvokeEchoStepTemplateErrors,
@@ -23,21 +43,60 @@ import type {
23
43
  InvokeImageUploadStepTemplateData,
24
44
  InvokeImageUploadStepTemplateResponses,
25
45
  InvokeImageUploadStepTemplateErrors,
46
+ InvokeImageUpscalerStepTemplateData,
47
+ InvokeImageUpscalerStepTemplateResponses,
48
+ InvokeImageUpscalerStepTemplateErrors,
49
+ InvokeMediaHashStepTemplateData,
50
+ InvokeMediaHashStepTemplateResponses,
51
+ InvokeMediaHashStepTemplateErrors,
52
+ InvokeMediaRatingStepTemplateData,
53
+ InvokeMediaRatingStepTemplateResponses,
54
+ InvokeMediaRatingStepTemplateErrors,
55
+ InvokePreprocessImageStepTemplateData,
56
+ InvokePreprocessImageStepTemplateResponses,
57
+ InvokePreprocessImageStepTemplateErrors,
26
58
  InvokeTextToImageStepTemplateData,
27
59
  InvokeTextToImageStepTemplateResponses,
28
60
  InvokeTextToImageStepTemplateErrors,
61
+ InvokeTextToSpeechStepTemplateData,
62
+ InvokeTextToSpeechStepTemplateResponses,
63
+ InvokeTextToSpeechStepTemplateErrors,
64
+ InvokeTrainingStepTemplateData,
65
+ InvokeTrainingStepTemplateResponses,
66
+ InvokeTrainingStepTemplateErrors,
67
+ InvokeTranscriptionStepTemplateData,
68
+ InvokeTranscriptionStepTemplateResponses,
69
+ InvokeTranscriptionStepTemplateErrors,
29
70
  InvokeVideoEnhancementStepTemplateData,
30
71
  InvokeVideoEnhancementStepTemplateResponses,
31
72
  InvokeVideoEnhancementStepTemplateErrors,
73
+ InvokeVideoFrameExtractionStepTemplateData,
74
+ InvokeVideoFrameExtractionStepTemplateResponses,
75
+ InvokeVideoFrameExtractionStepTemplateErrors,
32
76
  InvokeVideoGenStepTemplateData,
33
77
  InvokeVideoGenStepTemplateResponses,
34
78
  InvokeVideoGenStepTemplateErrors,
79
+ InvokeVideoInterpolationStepTemplateData,
80
+ InvokeVideoInterpolationStepTemplateResponses,
81
+ InvokeVideoInterpolationStepTemplateErrors,
82
+ InvokeVideoMetadataStepTemplateData,
83
+ InvokeVideoMetadataStepTemplateResponses,
84
+ InvokeVideoMetadataStepTemplateErrors,
85
+ InvokeVideoUpscalerStepTemplateData,
86
+ InvokeVideoUpscalerStepTemplateResponses,
87
+ InvokeVideoUpscalerStepTemplateErrors,
88
+ InvokeWdTaggingStepTemplateData,
89
+ InvokeWdTaggingStepTemplateResponses,
90
+ InvokeWdTaggingStepTemplateErrors,
35
91
  InvalidateResourceData,
36
92
  InvalidateResourceResponses,
37
93
  InvalidateResourceErrors,
38
94
  GetResourceData,
39
95
  GetResourceResponses,
40
96
  GetResourceErrors,
97
+ GetStreamingBlobData,
98
+ GetStreamingBlobResponses,
99
+ GetStreamingBlobErrors,
41
100
  QueryWorkflowsData,
42
101
  QueryWorkflowsResponses,
43
102
  QueryWorkflowsErrors,
@@ -92,7 +151,7 @@ export type Options<
92
151
  meta?: Record<string, unknown>;
93
152
  };
94
153
  /**
95
- * Get blob by ID. This will return the blob as a binary stream.
154
+ * Get blob by ID. This will redirect to a cacheable content URL.
96
155
  */
97
156
  export declare const getBlob: <ThrowOnError extends boolean = false>(
98
157
  options: Options<GetBlobData, ThrowOnError>
@@ -103,6 +162,59 @@ export declare const getBlob: <ThrowOnError extends boolean = false>(
103
162
  export declare const headBlob: <ThrowOnError extends boolean = false>(
104
163
  options: Options<HeadBlobData, ThrowOnError>
105
164
  ) => import('./client').RequestResult<HeadBlobResponses, HeadBlobErrors, ThrowOnError, 'fields'>;
165
+ /**
166
+ * Get a presigned URL for browser uploads.
167
+ * The returned URL points to POST /v2/consumer/blobs with a signature for authentication.
168
+ */
169
+ export declare const getConsumerBlobUploadUrl: <ThrowOnError extends boolean = false>(
170
+ options?: Options<GetConsumerBlobUploadUrlData, ThrowOnError>
171
+ ) => import('./client').RequestResult<
172
+ GetConsumerBlobUploadUrlResponses,
173
+ GetConsumerBlobUploadUrlErrors,
174
+ ThrowOnError,
175
+ 'fields'
176
+ >;
177
+ /**
178
+ * Upload a blob directly with on-the-fly moderation.
179
+ * Supports both authenticated requests (Bearer token) and presigned URLs (sig query param).
180
+ */
181
+ export declare const uploadConsumerBlob: <ThrowOnError extends boolean = false>(
182
+ options?: Options<UploadConsumerBlobData, ThrowOnError>
183
+ ) => import('./client').RequestResult<
184
+ UploadConsumerBlobResponses,
185
+ UploadConsumerBlobErrors,
186
+ ThrowOnError,
187
+ 'fields'
188
+ >;
189
+ /**
190
+ * Serves cacheable blob content using a deterministic encrypted token
191
+ */
192
+ export declare const getBlobContent: <ThrowOnError extends boolean = false>(
193
+ options: Options<GetBlobContentData, ThrowOnError>
194
+ ) => import('./client').RequestResult<
195
+ GetBlobContentResponses,
196
+ GetBlobContentErrors,
197
+ ThrowOnError,
198
+ 'fields'
199
+ >;
200
+ /**
201
+ * Serves a blocked placeholder image with the specified dimensions
202
+ */
203
+ export declare const getBlockedContent: <ThrowOnError extends boolean = false>(
204
+ options: Options<GetBlockedContentData, ThrowOnError>
205
+ ) => import('./client').RequestResult<unknown, GetBlockedContentErrors, ThrowOnError, 'fields'>;
206
+ /**
207
+ * Workflow step for generating music using ACE Step 1.5.
208
+ * /// Produces full songs from text descriptions and structured lyrics.
209
+ */
210
+ export declare const invokeAceStepAudioStepTemplate: <ThrowOnError extends boolean = false>(
211
+ options?: Options<InvokeAceStepAudioStepTemplateData, ThrowOnError>
212
+ ) => import('./client').RequestResult<
213
+ InvokeAceStepAudioStepTemplateResponses,
214
+ InvokeAceStepAudioStepTemplateErrors,
215
+ ThrowOnError,
216
+ 'fields'
217
+ >;
106
218
  /**
107
219
  * Age classification
108
220
  * Detects minors in media content. Returns a boolean value indicating whether the content contains minors as well as details on where minors are detected.
@@ -115,6 +227,19 @@ export declare const invokeAgeClassificationStepTemplate: <ThrowOnError extends
115
227
  ThrowOnError,
116
228
  'fields'
117
229
  >;
230
+ /**
231
+ * ChatCompletion
232
+ * Generate chat completions using language models with support for text and image inputs.
233
+ * /// Compatible with OpenAI Chat Completions API format.
234
+ */
235
+ export declare const invokeChatCompletionStepTemplate: <ThrowOnError extends boolean = false>(
236
+ options?: Options<InvokeChatCompletionStepTemplateData, ThrowOnError>
237
+ ) => import('./client').RequestResult<
238
+ InvokeChatCompletionStepTemplateResponses,
239
+ InvokeChatCompletionStepTemplateErrors,
240
+ ThrowOnError,
241
+ 'fields'
242
+ >;
118
243
  /**
119
244
  * Comfy workflows
120
245
  * Runs a comfy workflow. Currently there are limited nodes available. Contact support for more information.
@@ -127,6 +252,17 @@ export declare const invokeComfyStepTemplate: <ThrowOnError extends boolean = fa
127
252
  ThrowOnError,
128
253
  'fields'
129
254
  >;
255
+ /**
256
+ * A workflow step that converts images to different formats and applies optional transforms.
257
+ */
258
+ export declare const invokeConvertImageStepTemplate: <ThrowOnError extends boolean = false>(
259
+ options?: Options<InvokeConvertImageStepTemplateData, ThrowOnError>
260
+ ) => import('./client').RequestResult<
261
+ InvokeConvertImageStepTemplateResponses,
262
+ InvokeConvertImageStepTemplateErrors,
263
+ ThrowOnError,
264
+ 'fields'
265
+ >;
130
266
  /**
131
267
  * Echo
132
268
  * A workflow step that takes a message string and retuns it.
@@ -178,6 +314,46 @@ export declare const invokeImageUploadStepTemplate: <ThrowOnError extends boolea
178
314
  ThrowOnError,
179
315
  'fields'
180
316
  >;
317
+ export declare const invokeImageUpscalerStepTemplate: <ThrowOnError extends boolean = false>(
318
+ options?: Options<InvokeImageUpscalerStepTemplateData, ThrowOnError>
319
+ ) => import('./client').RequestResult<
320
+ InvokeImageUpscalerStepTemplateResponses,
321
+ InvokeImageUpscalerStepTemplateErrors,
322
+ ThrowOnError,
323
+ 'fields'
324
+ >;
325
+ /**
326
+ * MediaHash
327
+ * Generates perceptual hashes for media content to enable similarity detection and duplicate identification.
328
+ */
329
+ export declare const invokeMediaHashStepTemplate: <ThrowOnError extends boolean = false>(
330
+ options?: Options<InvokeMediaHashStepTemplateData, ThrowOnError>
331
+ ) => import('./client').RequestResult<
332
+ InvokeMediaHashStepTemplateResponses,
333
+ InvokeMediaHashStepTemplateErrors,
334
+ ThrowOnError,
335
+ 'fields'
336
+ >;
337
+ /**
338
+ * MediaRating
339
+ * Performs NSFW level detection and content safety classification on media content.
340
+ */
341
+ export declare const invokeMediaRatingStepTemplate: <ThrowOnError extends boolean = false>(
342
+ options?: Options<InvokeMediaRatingStepTemplateData, ThrowOnError>
343
+ ) => import('./client').RequestResult<
344
+ InvokeMediaRatingStepTemplateResponses,
345
+ InvokeMediaRatingStepTemplateErrors,
346
+ ThrowOnError,
347
+ 'fields'
348
+ >;
349
+ export declare const invokePreprocessImageStepTemplate: <ThrowOnError extends boolean = false>(
350
+ options?: Options<InvokePreprocessImageStepTemplateData, ThrowOnError>
351
+ ) => import('./client').RequestResult<
352
+ InvokePreprocessImageStepTemplateResponses,
353
+ InvokePreprocessImageStepTemplateErrors,
354
+ ThrowOnError,
355
+ 'fields'
356
+ >;
181
357
  /**
182
358
  * TextToImage
183
359
  * Generate images using text as input
@@ -190,6 +366,44 @@ export declare const invokeTextToImageStepTemplate: <ThrowOnError extends boolea
190
366
  ThrowOnError,
191
367
  'fields'
192
368
  >;
369
+ /**
370
+ * Text-to-Speech
371
+ * Synthesizes speech from text, supporting both voice cloning (Base mode with reference audio) and built-in speakers (CustomVoice mode).
372
+ */
373
+ export declare const invokeTextToSpeechStepTemplate: <ThrowOnError extends boolean = false>(
374
+ options?: Options<InvokeTextToSpeechStepTemplateData, ThrowOnError>
375
+ ) => import('./client').RequestResult<
376
+ InvokeTextToSpeechStepTemplateResponses,
377
+ InvokeTextToSpeechStepTemplateErrors,
378
+ ThrowOnError,
379
+ 'fields'
380
+ >;
381
+ /**
382
+ * Training
383
+ * A workflow step for training machine learning models (LoRAs, checkpoints, etc.)
384
+ * /// on various types of data (images, videos, audio). This replaces ImageResourceTraining
385
+ * /// with a cleaner architecture that creates one job per epoch instead of a single monolithic job.
386
+ */
387
+ export declare const invokeTrainingStepTemplate: <ThrowOnError extends boolean = false>(
388
+ options?: Options<InvokeTrainingStepTemplateData, ThrowOnError>
389
+ ) => import('./client').RequestResult<
390
+ InvokeTrainingStepTemplateResponses,
391
+ InvokeTrainingStepTemplateErrors,
392
+ ThrowOnError,
393
+ 'fields'
394
+ >;
395
+ /**
396
+ * Transcription
397
+ * Performs automatic speech recognition (ASR) on audio media, returning transcribed text with optional timestamps.
398
+ */
399
+ export declare const invokeTranscriptionStepTemplate: <ThrowOnError extends boolean = false>(
400
+ options?: Options<InvokeTranscriptionStepTemplateData, ThrowOnError>
401
+ ) => import('./client').RequestResult<
402
+ InvokeTranscriptionStepTemplateResponses,
403
+ InvokeTranscriptionStepTemplateErrors,
404
+ ThrowOnError,
405
+ 'fields'
406
+ >;
193
407
  /**
194
408
  * Upscale videos and/or interpolate frames
195
409
  */
@@ -201,6 +415,19 @@ export declare const invokeVideoEnhancementStepTemplate: <ThrowOnError extends b
201
415
  ThrowOnError,
202
416
  'fields'
203
417
  >;
418
+ /**
419
+ * Video Frame Extraction
420
+ * Extracts unique frames from a video at a specified rate using perceptual hashing to filter out duplicate/similar frames.
421
+ * /// Useful for generating video previews, storyboards, or analyzing video content.
422
+ */
423
+ export declare const invokeVideoFrameExtractionStepTemplate: <ThrowOnError extends boolean = false>(
424
+ options?: Options<InvokeVideoFrameExtractionStepTemplateData, ThrowOnError>
425
+ ) => import('./client').RequestResult<
426
+ InvokeVideoFrameExtractionStepTemplateResponses,
427
+ InvokeVideoFrameExtractionStepTemplateErrors,
428
+ ThrowOnError,
429
+ 'fields'
430
+ >;
204
431
  /**
205
432
  * Video generation
206
433
  * Generate videos through text/image inputs using any of our supported engines
@@ -213,6 +440,51 @@ export declare const invokeVideoGenStepTemplate: <ThrowOnError extends boolean =
213
440
  ThrowOnError,
214
441
  'fields'
215
442
  >;
443
+ /**
444
+ * Interpolate videos using VFI Mamba
445
+ */
446
+ export declare const invokeVideoInterpolationStepTemplate: <ThrowOnError extends boolean = false>(
447
+ options?: Options<InvokeVideoInterpolationStepTemplateData, ThrowOnError>
448
+ ) => import('./client').RequestResult<
449
+ InvokeVideoInterpolationStepTemplateResponses,
450
+ InvokeVideoInterpolationStepTemplateErrors,
451
+ ThrowOnError,
452
+ 'fields'
453
+ >;
454
+ /**
455
+ * Extract metadata from videos including width, height, FPS, and duration
456
+ */
457
+ export declare const invokeVideoMetadataStepTemplate: <ThrowOnError extends boolean = false>(
458
+ options?: Options<InvokeVideoMetadataStepTemplateData, ThrowOnError>
459
+ ) => import('./client').RequestResult<
460
+ InvokeVideoMetadataStepTemplateResponses,
461
+ InvokeVideoMetadataStepTemplateErrors,
462
+ ThrowOnError,
463
+ 'fields'
464
+ >;
465
+ /**
466
+ * Upscale videos using FlashVSR
467
+ */
468
+ export declare const invokeVideoUpscalerStepTemplate: <ThrowOnError extends boolean = false>(
469
+ options?: Options<InvokeVideoUpscalerStepTemplateData, ThrowOnError>
470
+ ) => import('./client').RequestResult<
471
+ InvokeVideoUpscalerStepTemplateResponses,
472
+ InvokeVideoUpscalerStepTemplateErrors,
473
+ ThrowOnError,
474
+ 'fields'
475
+ >;
476
+ /**
477
+ * WDTagging
478
+ * Performs Waifu Diffusion tagging on media content to identify characteristics, objects, and themes.
479
+ */
480
+ export declare const invokeWdTaggingStepTemplate: <ThrowOnError extends boolean = false>(
481
+ options?: Options<InvokeWdTaggingStepTemplateData, ThrowOnError>
482
+ ) => import('./client').RequestResult<
483
+ InvokeWdTaggingStepTemplateResponses,
484
+ InvokeWdTaggingStepTemplateErrors,
485
+ ThrowOnError,
486
+ 'fields'
487
+ >;
216
488
  /**
217
489
  * Invalidates the cache of a specific resource.
218
490
  */
@@ -235,6 +507,14 @@ export declare const getResource: <ThrowOnError extends boolean = false>(
235
507
  ThrowOnError,
236
508
  'fields'
237
509
  >;
510
+ export declare const getStreamingBlob: <ThrowOnError extends boolean = false>(
511
+ options: Options<GetStreamingBlobData, ThrowOnError>
512
+ ) => import('./client').RequestResult<
513
+ GetStreamingBlobResponses,
514
+ GetStreamingBlobErrors,
515
+ ThrowOnError,
516
+ 'fields'
517
+ >;
238
518
  /**
239
519
  * Query workflows
240
520
  */