@civitai/client 0.2.0-beta.1 → 0.2.0-beta.2
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.
|
@@ -90,17 +90,12 @@ export type Blob = {
|
|
|
90
90
|
blockedReason?: string | null;
|
|
91
91
|
};
|
|
92
92
|
export declare const BuzzClientAccount: {
|
|
93
|
-
readonly
|
|
94
|
-
readonly
|
|
93
|
+
readonly YELLOW: 'yellow';
|
|
94
|
+
readonly BLUE: 'blue';
|
|
95
|
+
readonly GREEN: 'green';
|
|
96
|
+
readonly FAKE_RED: 'fakeRed';
|
|
95
97
|
};
|
|
96
98
|
export type BuzzClientAccount = (typeof BuzzClientAccount)[keyof typeof BuzzClientAccount];
|
|
97
|
-
export type CivitaiWanVideoGenInput = WanVideoGenInput & {
|
|
98
|
-
width?: number;
|
|
99
|
-
height?: number;
|
|
100
|
-
model?: string | null;
|
|
101
|
-
} & {
|
|
102
|
-
provider: 'civitai';
|
|
103
|
-
};
|
|
104
99
|
export type ComfyInput = {
|
|
105
100
|
/**
|
|
106
101
|
* Get the comfy workflow that needs to be executed
|
|
@@ -228,12 +223,6 @@ export type EpochResult = {
|
|
|
228
223
|
*/
|
|
229
224
|
blobUrl: string;
|
|
230
225
|
};
|
|
231
|
-
export type FalWanVideoGenInput = WanVideoGenInput & {
|
|
232
|
-
aspectRatio?: '1:1' | '16:9' | '9:16';
|
|
233
|
-
enablePromptExpansion?: boolean;
|
|
234
|
-
} & {
|
|
235
|
-
provider: 'fal';
|
|
236
|
-
};
|
|
237
226
|
export declare const FileFormat: {
|
|
238
227
|
readonly UNKNOWN: 'unknown';
|
|
239
228
|
readonly SAFE_TENSOR: 'safeTensor';
|
|
@@ -243,13 +232,15 @@ export declare const FileFormat: {
|
|
|
243
232
|
readonly ONNX: 'onnx';
|
|
244
233
|
};
|
|
245
234
|
export type FileFormat = (typeof FileFormat)[keyof typeof FileFormat];
|
|
246
|
-
export type Flux1KontextDevImageGenInput = Flux1KontextImageGenInput & {
|
|
235
|
+
export type Flux1KontextDevImageGenInput = Flux1KontextImageGenInput & {
|
|
236
|
+
readonly model: string;
|
|
237
|
+
} & {
|
|
247
238
|
model: 'dev';
|
|
248
239
|
};
|
|
249
240
|
export type Flux1KontextImageGenInput = ImageGenInput & {
|
|
250
241
|
engine: 'flux1-kontext';
|
|
251
242
|
} & {
|
|
252
|
-
model: string;
|
|
243
|
+
readonly model: string;
|
|
253
244
|
prompt: string;
|
|
254
245
|
images?: Array<string>;
|
|
255
246
|
aspectRatio?: '21:9' | '16:9' | '4:3' | '3:2' | '1:1' | '2:3' | '3:4' | '9:16' | '9:21';
|
|
@@ -260,10 +251,14 @@ export type Flux1KontextImageGenInput = ImageGenInput & {
|
|
|
260
251
|
} & {
|
|
261
252
|
engine: 'flux1-kontext';
|
|
262
253
|
};
|
|
263
|
-
export type Flux1KontextMaxImageGenInput = Flux1KontextImageGenInput & {
|
|
254
|
+
export type Flux1KontextMaxImageGenInput = Flux1KontextImageGenInput & {
|
|
255
|
+
readonly model: string;
|
|
256
|
+
} & {
|
|
264
257
|
model: 'max';
|
|
265
258
|
};
|
|
266
|
-
export type Flux1KontextProImageGenInput = Flux1KontextImageGenInput & {
|
|
259
|
+
export type Flux1KontextProImageGenInput = Flux1KontextImageGenInput & {
|
|
260
|
+
readonly model: string;
|
|
261
|
+
} & {
|
|
267
262
|
model: 'pro';
|
|
268
263
|
};
|
|
269
264
|
export type FluxDevFastImageResourceTrainingInput = ImageResourceTrainingInput & {
|
|
@@ -367,6 +362,10 @@ export type ImageBlob = Blob & {
|
|
|
367
362
|
export type ImageGenInput = {
|
|
368
363
|
engine: string;
|
|
369
364
|
};
|
|
365
|
+
export type ImageGenInputLora = {
|
|
366
|
+
air: string;
|
|
367
|
+
strength?: number;
|
|
368
|
+
};
|
|
370
369
|
export type ImageGenOutput = {
|
|
371
370
|
/**
|
|
372
371
|
* A collection of output images.
|
|
@@ -1209,6 +1208,10 @@ export type TransactionSummary = {
|
|
|
1209
1208
|
* Get a list of individual transactions.
|
|
1210
1209
|
*/
|
|
1211
1210
|
list?: Array<TransactionInfo>;
|
|
1211
|
+
/**
|
|
1212
|
+
* A boolean returned with whatif requests to indicate whether the user has nsufficient buzz to run a workflow.
|
|
1213
|
+
*/
|
|
1214
|
+
insufficientBuzz?: boolean | null;
|
|
1212
1215
|
};
|
|
1213
1216
|
export declare const TransactionType: {
|
|
1214
1217
|
readonly DEBIT: 'debit';
|
|
@@ -1283,6 +1286,10 @@ export type UpdateWorkflowRequest = {
|
|
|
1283
1286
|
* An optional set of new tags to set on the workflow.
|
|
1284
1287
|
*/
|
|
1285
1288
|
tags?: Array<string> | null;
|
|
1289
|
+
/**
|
|
1290
|
+
* Set to true to remove the mature content restriction on the workflow.
|
|
1291
|
+
*/
|
|
1292
|
+
allowMatureContent?: boolean | null;
|
|
1286
1293
|
};
|
|
1287
1294
|
/**
|
|
1288
1295
|
* Available statuses for updating workflows.
|
|
@@ -1456,10 +1463,118 @@ export declare const ViduVideoGenStyle: {
|
|
|
1456
1463
|
readonly ANIME: 'anime';
|
|
1457
1464
|
};
|
|
1458
1465
|
export type ViduVideoGenStyle = (typeof ViduVideoGenStyle)[keyof typeof ViduVideoGenStyle];
|
|
1466
|
+
export type Wan21CivitaiVideoGenInput = Wan21VideoGenInput & {
|
|
1467
|
+
width?: number;
|
|
1468
|
+
height?: number;
|
|
1469
|
+
model?: string | null;
|
|
1470
|
+
images?: Array<string>;
|
|
1471
|
+
} & {
|
|
1472
|
+
provider: 'civitai';
|
|
1473
|
+
};
|
|
1474
|
+
export type Wan21FalVideoGenInput = Wan21VideoGenInput & {
|
|
1475
|
+
aspectRatio?: '1:1' | '16:9' | '9:16';
|
|
1476
|
+
enablePromptExpansion?: boolean;
|
|
1477
|
+
} & {
|
|
1478
|
+
provider: 'fal';
|
|
1479
|
+
};
|
|
1480
|
+
export type Wan21VideoGenInput = WanVideoGenInput & {
|
|
1481
|
+
provider: string | null;
|
|
1482
|
+
} & {
|
|
1483
|
+
version: 'v2.1';
|
|
1484
|
+
};
|
|
1485
|
+
export type Wan225bFalImageGenInput = Wan225bImageGenInput & {} & {
|
|
1486
|
+
provider: 'fal';
|
|
1487
|
+
};
|
|
1488
|
+
export type Wan225bFalImageToVideoInput = Wan225bFalVideoGenInput & {
|
|
1489
|
+
images?: Array<string>;
|
|
1490
|
+
} & {
|
|
1491
|
+
operation: 'image-to-video';
|
|
1492
|
+
};
|
|
1493
|
+
export type Wan225bFalTextToVideoInput = Wan225bFalVideoGenInput & {} & {
|
|
1494
|
+
operation: 'text-to-video';
|
|
1495
|
+
};
|
|
1496
|
+
export type Wan225bFalVideoGenInput = Wan225bVideoGenInput & {
|
|
1497
|
+
operation: string | null;
|
|
1498
|
+
resolution?: '480p' | '580p' | '720p';
|
|
1499
|
+
aspectRatio?: '1:1' | '16:9' | '9:16' | 'auto';
|
|
1500
|
+
enablePromptExpansion?: boolean;
|
|
1501
|
+
useDistill?: boolean;
|
|
1502
|
+
interpolatorModel?: 'none' | 'film' | 'rife';
|
|
1503
|
+
negativePrompt?: string | null;
|
|
1504
|
+
enableSafetyChecker?: boolean;
|
|
1505
|
+
numInferenceSteps?: number;
|
|
1506
|
+
} & {
|
|
1507
|
+
provider: 'fal';
|
|
1508
|
+
};
|
|
1509
|
+
export type Wan225bImageGenInput = WanImageGenInput & {
|
|
1510
|
+
provider: string | null;
|
|
1511
|
+
steps?: number;
|
|
1512
|
+
shift?: number;
|
|
1513
|
+
} & {
|
|
1514
|
+
version: 'v2.2-5b';
|
|
1515
|
+
};
|
|
1516
|
+
export type Wan225bVideoGenInput = WanVideoGenInput & {
|
|
1517
|
+
provider: string | null;
|
|
1518
|
+
} & {
|
|
1519
|
+
version: 'v2.2-5b';
|
|
1520
|
+
};
|
|
1521
|
+
export type Wan22FalImageGenInput = Wan22ImageGenInput & {
|
|
1522
|
+
acceleration?: 'none' | 'fast' | 'faster';
|
|
1523
|
+
} & {
|
|
1524
|
+
provider: 'fal';
|
|
1525
|
+
};
|
|
1526
|
+
export type Wan22FalImageToVideoInput = Wan22FalVideoGenInput & {
|
|
1527
|
+
images?: Array<string>;
|
|
1528
|
+
} & {
|
|
1529
|
+
operation: 'image-to-video';
|
|
1530
|
+
};
|
|
1531
|
+
export type Wan22FalTextToVideoInput = Wan22FalVideoGenInput & {} & {
|
|
1532
|
+
operation: 'text-to-video';
|
|
1533
|
+
};
|
|
1534
|
+
export type Wan22FalVideoGenInput = Wan22VideoGenInput & {
|
|
1535
|
+
operation: string | null;
|
|
1536
|
+
resolution?: '480p' | '720p';
|
|
1537
|
+
aspectRatio?: '1:1' | '16:9' | '9:16' | '4:3' | '3:4' | '4:5' | '5:4';
|
|
1538
|
+
enablePromptExpansion?: boolean;
|
|
1539
|
+
shift?: number;
|
|
1540
|
+
interpolatorModel?: 'film' | 'rife';
|
|
1541
|
+
useTurbo?: boolean;
|
|
1542
|
+
negativePrompt?: string | null;
|
|
1543
|
+
enableSafetyChecker?: boolean;
|
|
1544
|
+
} & {
|
|
1545
|
+
provider: 'fal';
|
|
1546
|
+
};
|
|
1547
|
+
export type Wan22ImageGenInput = WanImageGenInput & {
|
|
1548
|
+
provider: string | null;
|
|
1549
|
+
steps?: number;
|
|
1550
|
+
} & {
|
|
1551
|
+
version: 'v2.2';
|
|
1552
|
+
};
|
|
1553
|
+
export type Wan22VideoGenInput = WanVideoGenInput & {
|
|
1554
|
+
provider: string | null;
|
|
1555
|
+
} & {
|
|
1556
|
+
version: 'v2.2';
|
|
1557
|
+
};
|
|
1558
|
+
export type WanImageGenInput = ImageGenInput & {
|
|
1559
|
+
engine: 'wan';
|
|
1560
|
+
} & {
|
|
1561
|
+
version: string | null;
|
|
1562
|
+
prompt: string;
|
|
1563
|
+
negativePrompt?: string | null;
|
|
1564
|
+
guidanceScale?: number;
|
|
1565
|
+
seed?: number | null;
|
|
1566
|
+
quantity?: number;
|
|
1567
|
+
imageSize?: string;
|
|
1568
|
+
enablePromptExpansion?: boolean;
|
|
1569
|
+
enableSafetyChecker?: boolean;
|
|
1570
|
+
loras?: Array<ImageGenInputLora>;
|
|
1571
|
+
} & {
|
|
1572
|
+
engine: 'wan';
|
|
1573
|
+
};
|
|
1459
1574
|
export type WanVideoGenInput = VideoGenInput & {
|
|
1460
1575
|
engine: 'wan';
|
|
1461
1576
|
} & {
|
|
1462
|
-
|
|
1577
|
+
version: string | null;
|
|
1463
1578
|
/**
|
|
1464
1579
|
* Either A URL, A DataURL or a Base64 string
|
|
1465
1580
|
*/
|
|
@@ -1471,7 +1586,6 @@ export type WanVideoGenInput = VideoGenInput & {
|
|
|
1471
1586
|
steps?: number;
|
|
1472
1587
|
loras?: Array<VideoGenInputLora>;
|
|
1473
1588
|
} & {
|
|
1474
|
-
provider: 'wan';
|
|
1475
1589
|
engine: 'wan';
|
|
1476
1590
|
};
|
|
1477
1591
|
/**
|
|
@@ -1527,6 +1641,11 @@ export type Workflow = {
|
|
|
1527
1641
|
* Get or set whether this workflow is experimental
|
|
1528
1642
|
*/
|
|
1529
1643
|
experimental?: boolean | null;
|
|
1644
|
+
/**
|
|
1645
|
+
* Gets or sets a value indicating whether mature content is allowed in this workflow.
|
|
1646
|
+
*/
|
|
1647
|
+
allowMatureContent?: boolean | null;
|
|
1648
|
+
upgradeMode?: WorkflowUpgradeMode;
|
|
1530
1649
|
};
|
|
1531
1650
|
/**
|
|
1532
1651
|
* Details of a callback setup for a workflow.
|
|
@@ -1736,6 +1855,7 @@ export type WorkflowStepJobEvent = {
|
|
|
1736
1855
|
progress?: number | null;
|
|
1737
1856
|
reason?: string | null;
|
|
1738
1857
|
blockedReason?: string | null;
|
|
1858
|
+
matureContent?: boolean | null;
|
|
1739
1859
|
};
|
|
1740
1860
|
/**
|
|
1741
1861
|
* Details of the workflow step job's queue position.
|
|
@@ -1816,6 +1936,13 @@ export type WorkflowTemplate = {
|
|
|
1816
1936
|
* Get or set whether this workflow is experimental
|
|
1817
1937
|
*/
|
|
1818
1938
|
experimental?: boolean | null;
|
|
1939
|
+
/**
|
|
1940
|
+
* Get or set whether this workflow should allow mature content.
|
|
1941
|
+
* When set to false, the workflow will not return any content that is marked as mature.
|
|
1942
|
+
* Additional payment options are available for workflows that do not allow mature content.
|
|
1943
|
+
*/
|
|
1944
|
+
allowMatureContent?: boolean | null;
|
|
1945
|
+
upgradeMode?: WorkflowUpgradeMode;
|
|
1819
1946
|
};
|
|
1820
1947
|
export type WorkflowTips = {
|
|
1821
1948
|
/**
|
|
@@ -1827,6 +1954,17 @@ export type WorkflowTips = {
|
|
|
1827
1954
|
*/
|
|
1828
1955
|
creators: number;
|
|
1829
1956
|
};
|
|
1957
|
+
/**
|
|
1958
|
+
* Specifies how a workflow should be upgraded when mature content is detected and green or blue buzz was used for payment.
|
|
1959
|
+
*/
|
|
1960
|
+
export declare const WorkflowUpgradeMode: {
|
|
1961
|
+
readonly MANUAL: 'manual';
|
|
1962
|
+
readonly AUTOMATIC: 'automatic';
|
|
1963
|
+
};
|
|
1964
|
+
/**
|
|
1965
|
+
* Specifies how a workflow should be upgraded when mature content is detected and green or blue buzz was used for payment.
|
|
1966
|
+
*/
|
|
1967
|
+
export type WorkflowUpgradeMode = (typeof WorkflowUpgradeMode)[keyof typeof WorkflowUpgradeMode];
|
|
1830
1968
|
export type GetBlobData = {
|
|
1831
1969
|
body?: never;
|
|
1832
1970
|
path: {
|
|
@@ -1836,6 +1974,10 @@ export type GetBlobData = {
|
|
|
1836
1974
|
blobId: string;
|
|
1837
1975
|
};
|
|
1838
1976
|
query?: {
|
|
1977
|
+
/**
|
|
1978
|
+
* The id of the workflow to obtain
|
|
1979
|
+
*/
|
|
1980
|
+
workflowId?: string;
|
|
1839
1981
|
/**
|
|
1840
1982
|
* A maximum nsfw level. If this is specified and the blob does not have a NSFW level specified or the NSFW level exceeds our max then we'll return an error
|
|
1841
1983
|
*/
|
|
@@ -2204,6 +2346,10 @@ export type QueryWorkflowsData = {
|
|
|
2204
2346
|
* Whether to return data from oldest to newest
|
|
2205
2347
|
*/
|
|
2206
2348
|
ascending?: boolean;
|
|
2349
|
+
/**
|
|
2350
|
+
* When set to true, any blob that has mature won't be available and won't have a URL
|
|
2351
|
+
*/
|
|
2352
|
+
hideMatureContent?: boolean;
|
|
2207
2353
|
};
|
|
2208
2354
|
url: '/v2/consumer/workflows';
|
|
2209
2355
|
};
|
|
@@ -2235,6 +2381,10 @@ export type SubmitWorkflowData = {
|
|
|
2235
2381
|
* Whether to actually submit the workflow or return an estimate on what would happen upon submission
|
|
2236
2382
|
*/
|
|
2237
2383
|
whatif?: boolean;
|
|
2384
|
+
/**
|
|
2385
|
+
* When set to true, any blob that has mature won't be available and won't have a URL
|
|
2386
|
+
*/
|
|
2387
|
+
hideMatureContent?: boolean;
|
|
2238
2388
|
};
|
|
2239
2389
|
url: '/v2/consumer/workflows';
|
|
2240
2390
|
};
|
|
@@ -2312,6 +2462,10 @@ export type GetWorkflowData = {
|
|
|
2312
2462
|
* In which case the client should use the token to query the status of the workflow.
|
|
2313
2463
|
*/
|
|
2314
2464
|
wait?: boolean;
|
|
2465
|
+
/**
|
|
2466
|
+
* When set to true, any blob that has mature won't be available and won't have a URL
|
|
2467
|
+
*/
|
|
2468
|
+
hideMatureContent?: boolean;
|
|
2315
2469
|
};
|
|
2316
2470
|
url: '/v2/consumer/workflows/{workflowId}';
|
|
2317
2471
|
};
|
|
@@ -2348,6 +2502,10 @@ export type PatchWorkflowData = {
|
|
|
2348
2502
|
url: '/v2/consumer/workflows/{workflowId}';
|
|
2349
2503
|
};
|
|
2350
2504
|
export type PatchWorkflowErrors = {
|
|
2505
|
+
/**
|
|
2506
|
+
* Bad Request
|
|
2507
|
+
*/
|
|
2508
|
+
400: ProblemDetails;
|
|
2351
2509
|
/**
|
|
2352
2510
|
* Unauthorized
|
|
2353
2511
|
*/
|
|
@@ -4,8 +4,10 @@ export const AgeClassificationPrediction = {
|
|
|
4
4
|
FAIL: 'fail',
|
|
5
5
|
};
|
|
6
6
|
export const BuzzClientAccount = {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
YELLOW: 'yellow',
|
|
8
|
+
BLUE: 'blue',
|
|
9
|
+
GREEN: 'green',
|
|
10
|
+
FAKE_RED: 'fakeRed',
|
|
9
11
|
};
|
|
10
12
|
export const ContainerFormat = {
|
|
11
13
|
MP4: 'mp4',
|
|
@@ -178,3 +180,10 @@ export const WorkflowStatus = {
|
|
|
178
180
|
EXPIRED: 'expired',
|
|
179
181
|
CANCELED: 'canceled',
|
|
180
182
|
};
|
|
183
|
+
/**
|
|
184
|
+
* Specifies how a workflow should be upgraded when mature content is detected and green or blue buzz was used for payment.
|
|
185
|
+
*/
|
|
186
|
+
export const WorkflowUpgradeMode = {
|
|
187
|
+
MANUAL: 'manual',
|
|
188
|
+
AUTOMATIC: 'automatic',
|
|
189
|
+
};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export function handleError(error) {
|
|
2
2
|
if (typeof error === 'string')
|
|
3
3
|
return error;
|
|
4
|
-
const
|
|
4
|
+
const errors = error.errors && Array.isArray(error.errors)
|
|
5
|
+
? error.errors
|
|
6
|
+
: undefined;
|
|
7
|
+
const message = errors ? errors.messages.join('\n') : error.detail;
|
|
5
8
|
return message === null ? undefined : message;
|
|
6
9
|
}
|