@civitai/app-sdk 0.1.0 → 0.7.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.
- package/README.md +46 -1
- package/dist/blocks/defineBlock.d.ts +32 -0
- package/dist/blocks/defineBlock.d.ts.map +1 -0
- package/dist/blocks/defineBlock.js +270 -0
- package/dist/blocks/defineBlock.js.map +1 -0
- package/dist/blocks/index.d.ts +16 -0
- package/dist/blocks/index.d.ts.map +1 -0
- package/dist/blocks/index.js +12 -0
- package/dist/blocks/index.js.map +1 -0
- package/dist/blocks/messages.d.ts +289 -0
- package/dist/blocks/messages.d.ts.map +1 -0
- package/dist/blocks/messages.js +31 -0
- package/dist/blocks/messages.js.map +1 -0
- package/dist/blocks/scopes.d.ts +35 -0
- package/dist/blocks/scopes.d.ts.map +1 -0
- package/dist/blocks/scopes.js +33 -0
- package/dist/blocks/scopes.js.map +1 -0
- package/dist/blocks/types.d.ts +371 -0
- package/dist/blocks/types.d.ts.map +1 -0
- package/dist/blocks/types.js +8 -0
- package/dist/blocks/types.js.map +1 -0
- package/dist/oauth/token.d.ts +28 -0
- package/dist/oauth/token.d.ts.map +1 -1
- package/dist/oauth/token.js +28 -0
- package/dist/oauth/token.js.map +1 -1
- package/dist/orchestrator/index.d.ts +224 -0
- package/dist/orchestrator/index.d.ts.map +1 -1
- package/dist/orchestrator/index.js +207 -0
- package/dist/orchestrator/index.js.map +1 -1
- package/package.json +11 -5
- package/schemas/app-block/v1.json +184 -0
- package/dist/client/index.d.ts +0 -23
- package/dist/client/index.d.ts.map +0 -1
- package/dist/client/index.js +0 -19
- package/dist/client/index.js.map +0 -1
- package/dist/workflows/index.d.ts +0 -52
- package/dist/workflows/index.d.ts.map +0 -1
- package/dist/workflows/index.js +0 -77
- package/dist/workflows/index.js.map +0 -1
|
@@ -3,6 +3,15 @@
|
|
|
3
3
|
* starter's BFF. Client + server safe: no Node-only imports, no `process.env`
|
|
4
4
|
* access. All configuration flows through the `OrchestratorClient` value that
|
|
5
5
|
* the caller builds.
|
|
6
|
+
*
|
|
7
|
+
* The orchestrator is a workflow API: you POST a `{ steps: [...] }` body with
|
|
8
|
+
* one or more typed steps (`textToImage`, `imageGen`, `videoGen`, `comfy`, ...)
|
|
9
|
+
* and get back a workflow snapshot. {@link WORKFLOW_STEP_TYPES} is the catalog
|
|
10
|
+
* of available step types — start there to find the one you need, then either
|
|
11
|
+
* use the matching `build*Body` helper or hand-craft a body and pass it to
|
|
12
|
+
* {@link submitWorkflow} / {@link callOrchestrator}.
|
|
13
|
+
*
|
|
14
|
+
* Full OpenAPI spec: https://orchestration.civitai.com/openapi/v2-consumers.json
|
|
6
15
|
*/
|
|
7
16
|
export declare const DEFAULT_ORCHESTRATOR_BASE_URL = "https://orchestration.civitai.com";
|
|
8
17
|
/** Default SDXL base model. Replace per starter / per call as needed. */
|
|
@@ -12,6 +21,121 @@ export declare const DEFAULT_MODEL_AIR = "urn:air:sdxl:checkpoint:civitai:101055
|
|
|
12
21
|
*/
|
|
13
22
|
export declare const TERMINAL_STATUSES: readonly ["succeeded", "failed", "expired", "canceled"];
|
|
14
23
|
export type TerminalStatus = (typeof TERMINAL_STATUSES)[number];
|
|
24
|
+
/**
|
|
25
|
+
* Every workflow step type the orchestrator accepts, with a one-line
|
|
26
|
+
* description. Use this as a map: find the step `$type` you want, then look
|
|
27
|
+
* at the matching `build*Body` helper (if one exists) or fall back to
|
|
28
|
+
* {@link callOrchestrator} with a hand-crafted body.
|
|
29
|
+
*
|
|
30
|
+
* Source of truth is `https://orchestration.civitai.com/openapi/v2-consumers.json`.
|
|
31
|
+
* If a step type is missing here, the catalog is stale — open a PR.
|
|
32
|
+
*/
|
|
33
|
+
export declare const WORKFLOW_STEP_TYPES: {
|
|
34
|
+
/** Diffusion image gen (SDXL / Flux.1 / Pony / Illustrious / SD1.5 / etc.). Use {@link buildTextToImageBody}. */
|
|
35
|
+
readonly textToImage: "Text-to-image via diffusion checkpoints (AIR URN models)";
|
|
36
|
+
/**
|
|
37
|
+
* Closed-source image-gen APIs (Nano Banana, Gemini, Flux.1 Kontext, Flux.2,
|
|
38
|
+
* GPT-Image, Seedream, Grok, fal, …). Each engine has its own input shape;
|
|
39
|
+
* see {@link IMAGE_GEN_ENGINES}. Use {@link buildImageGenBody}.
|
|
40
|
+
*/
|
|
41
|
+
readonly imageGen: "Closed-source image gen (Nano Banana, Gemini, GPT-Image, Flux Kontext, Seedream, Grok, fal, …)";
|
|
42
|
+
/** Arbitrary ComfyUI workflow graphs. Pass a `prompt` object (node graph). */
|
|
43
|
+
readonly comfy: "Custom ComfyUI node-graph workflows";
|
|
44
|
+
/** Upscale an existing image. Input is a source image URL + scale factor. */
|
|
45
|
+
readonly imageUpscaler: "Image upscaling";
|
|
46
|
+
/** LoRA / DoRA / embedding training. Long-running. */
|
|
47
|
+
readonly imageResourceTraining: "Train a LoRA / DoRA / embedding from a dataset";
|
|
48
|
+
/** Pre-process an image (resize, ControlNet preprocessor, etc.). */
|
|
49
|
+
readonly preprocessImage: "Image preprocessing (resize, ControlNet preprocessors, …)";
|
|
50
|
+
/** Format conversion between png/jpeg/webp/avif. */
|
|
51
|
+
readonly convertImage: "Image format conversion";
|
|
52
|
+
/** Upload arbitrary blob bytes for use as a reference in a later step. */
|
|
53
|
+
readonly imageUpload: "Upload an image blob to use as input in a later step";
|
|
54
|
+
/** Video gen across all engines (VEO 3, Kling, Wan, Vidu, Sora, LTX, …). */
|
|
55
|
+
readonly videoGen: "Video generation across all engines (VEO 3, Kling, Wan, Vidu, Sora, LTX, …)";
|
|
56
|
+
/** Upscale an existing video. */
|
|
57
|
+
readonly videoUpscaler: "Video upscaling";
|
|
58
|
+
/** Frame interpolation / smoothing. */
|
|
59
|
+
readonly videoInterpolation: "Video frame interpolation";
|
|
60
|
+
/** Per-frame transformations (denoise, color correct, etc.). */
|
|
61
|
+
readonly videoEnhancement: "Per-frame video enhancement";
|
|
62
|
+
/** Extract individual frames from a video. */
|
|
63
|
+
readonly videoFrameExtraction: "Extract frames from a video";
|
|
64
|
+
/** Read video metadata (duration, codec, dimensions). */
|
|
65
|
+
readonly videoMetadata: "Read video file metadata";
|
|
66
|
+
/** Transcode video format / codec. */
|
|
67
|
+
readonly transcode: "Audio/video transcoding";
|
|
68
|
+
/** Text-to-speech (multi-voice, multi-language). */
|
|
69
|
+
readonly textToSpeech: "Text-to-speech synthesis";
|
|
70
|
+
/** Music generation via ACE Step 1.5 (lyrics + style → song). */
|
|
71
|
+
readonly aceStepAudio: "Music generation (ACE Step 1.5)";
|
|
72
|
+
/** Speech-to-text transcription. */
|
|
73
|
+
readonly transcription: "Speech-to-text transcription";
|
|
74
|
+
/** Mix multiple audio tracks. */
|
|
75
|
+
readonly audioMix: "Audio track mixing";
|
|
76
|
+
/** Generate captions from audio. */
|
|
77
|
+
readonly audioCaptioning: "Caption generation from audio";
|
|
78
|
+
/** Hash an image / video / model for dedup or lookup. */
|
|
79
|
+
readonly mediaHash: "Media content hashing";
|
|
80
|
+
/** Hash a model file. */
|
|
81
|
+
readonly modelHash: "Model file hashing";
|
|
82
|
+
/** Rate media on aesthetic / quality axes. */
|
|
83
|
+
readonly mediaRating: "Media aesthetic / quality rating";
|
|
84
|
+
/** Caption an image with a vision model. */
|
|
85
|
+
readonly mediaCaptioning: "Image captioning via vision models";
|
|
86
|
+
/** WD-14 tagger (anime / booru tags). */
|
|
87
|
+
readonly wdTagging: "WD-14 anime tagging";
|
|
88
|
+
/** Estimate an age range for faces in an image. */
|
|
89
|
+
readonly ageClassification: "Age range classification";
|
|
90
|
+
/** xGuard NSFW / safety moderation. */
|
|
91
|
+
readonly xGuardModeration: "NSFW / safety moderation";
|
|
92
|
+
/** ClamAV scan a model file for malware. */
|
|
93
|
+
readonly modelClamScan: "Antivirus scan a model file";
|
|
94
|
+
/** Pickle-scan a model file for unsafe pickles. */
|
|
95
|
+
readonly modelPickleScan: "Pickle-safety scan for model files";
|
|
96
|
+
/** Parse model file metadata (SafeTensors / GGUF headers). */
|
|
97
|
+
readonly modelParseMetadata: "Parse model file metadata";
|
|
98
|
+
/** Chat completion (OpenAI / Anthropic / Gemini / local OSS). */
|
|
99
|
+
readonly chatCompletion: "LLM chat completion";
|
|
100
|
+
/** Generate a richer prompt from a short seed prompt. */
|
|
101
|
+
readonly promptEnhancement: "Prompt expansion via LLM";
|
|
102
|
+
/** Echo the input back. Useful for testing the round-trip. */
|
|
103
|
+
readonly echo: "Echo step — round-trip the input for testing";
|
|
104
|
+
/** Package multiple blobs into a zip archive. */
|
|
105
|
+
readonly blobArchive: "Zip multiple blobs into an archive";
|
|
106
|
+
};
|
|
107
|
+
export type WorkflowStepType = keyof typeof WORKFLOW_STEP_TYPES;
|
|
108
|
+
/**
|
|
109
|
+
* Engines that the `imageGen` step accepts. Each one has its own input shape;
|
|
110
|
+
* the body's `engine` field selects which shape applies.
|
|
111
|
+
*
|
|
112
|
+
* Pair with {@link buildImageGenBody} or hand-craft via {@link callOrchestrator}.
|
|
113
|
+
*/
|
|
114
|
+
export declare const IMAGE_GEN_ENGINES: {
|
|
115
|
+
/** Nano Banana 2 / Nano Banana Pro / Imagen 4. */
|
|
116
|
+
readonly google: "Google (Nano Banana, Imagen)";
|
|
117
|
+
/** Gemini 2.5 Flash image gen + editing. */
|
|
118
|
+
readonly gemini: "Gemini";
|
|
119
|
+
/** GPT-Image-1 / GPT-Image-1.5 / DALL-E-3. */
|
|
120
|
+
readonly openai: "OpenAI (GPT-Image, DALL-E)";
|
|
121
|
+
/** Flux.1 Kontext (pro/max/dev) — image editing with ref images. */
|
|
122
|
+
readonly 'flux1-kontext': "Flux.1 Kontext (image editing)";
|
|
123
|
+
/** Flux.2 family (pro/max/dev/flex/klein). */
|
|
124
|
+
readonly flux2: "Flux.2";
|
|
125
|
+
/** Seedream (ByteDance) — 2K/4K image gen. */
|
|
126
|
+
readonly seedream: "Seedream";
|
|
127
|
+
/** Grok image generation. */
|
|
128
|
+
readonly grok: "Grok";
|
|
129
|
+
/** Wan image generation. */
|
|
130
|
+
readonly wan: "Wan";
|
|
131
|
+
/** Self-hosted SDCpp (stable-diffusion.cpp) gen. */
|
|
132
|
+
readonly sdcpp: "SDCpp (self-hosted diffusion)";
|
|
133
|
+
/** fal.ai routed gen. */
|
|
134
|
+
readonly fal: "fal.ai";
|
|
135
|
+
/** Comfy graph as an imageGen step (vs. the top-level `comfy` step). */
|
|
136
|
+
readonly comfy: "Comfy (engine-style)";
|
|
137
|
+
};
|
|
138
|
+
export type ImageGenEngine = keyof typeof IMAGE_GEN_ENGINES;
|
|
15
139
|
/**
|
|
16
140
|
* Orchestrator workflow status. Lowercase — matches what the orchestrator
|
|
17
141
|
* actually returns. Forward-compat: open-ended string union so unknown
|
|
@@ -90,6 +214,106 @@ export interface BuildTextToImageBodyOptions {
|
|
|
90
214
|
* the shape every starter's existing `buildWorkflowBody` produced.
|
|
91
215
|
*/
|
|
92
216
|
export declare function buildTextToImageBody(input: GenerateInput, opts?: BuildTextToImageBodyOptions): unknown;
|
|
217
|
+
/**
|
|
218
|
+
* Input for an `imageGen` step. The engine + model pair picks which
|
|
219
|
+
* sub-schema applies. Every closed-source image-gen API plugs in here:
|
|
220
|
+
*
|
|
221
|
+
* - `{ engine: 'google', model: 'nano-banana-2' | 'nano-banana-pro' | 'imagen4', images?: string[] }`
|
|
222
|
+
* - `{ engine: 'gemini', model: '2.5-flash', operation: 'createImage' | 'editImage', images?: string[] }`
|
|
223
|
+
* - `{ engine: 'flux1-kontext', model: 'pro' | 'max' | 'dev', images?: string[] }`
|
|
224
|
+
* - `{ engine: 'flux2', model: 'pro' | 'max' | 'dev' | 'flex' | 'klein' }`
|
|
225
|
+
* - `{ engine: 'openai', model: 'gpt-image-1' | 'gpt-image-1.5' | 'dall-e-3' | 'dall-e-2' }`
|
|
226
|
+
* - `{ engine: 'seedream', model: '4b' | '20b' | 'v1.0' }`
|
|
227
|
+
* - `{ engine: 'grok', model: 'createImage' | 'editImage' }`
|
|
228
|
+
* - `{ engine: 'fal' | 'wan' | 'sdcpp' | 'comfy', model: ..., ... }`
|
|
229
|
+
*
|
|
230
|
+
* Reference images go in `images: [...]` (URL, data URL, or base64 string).
|
|
231
|
+
* For aspect ratio / dimensions / seed / etc., pass the engine-specific
|
|
232
|
+
* input fields directly — this builder is intentionally pass-through.
|
|
233
|
+
*
|
|
234
|
+
* See `https://orchestration.civitai.com/openapi/v2-consumers.json` for the
|
|
235
|
+
* complete per-engine schema. The shape is forward-compat: any field the
|
|
236
|
+
* engine accepts can be added to `input` without changing this SDK.
|
|
237
|
+
*/
|
|
238
|
+
export interface ImageGenInput {
|
|
239
|
+
engine: ImageGenEngine | (string & {});
|
|
240
|
+
model: string;
|
|
241
|
+
prompt?: string;
|
|
242
|
+
/** Reference images. Each item is a URL, data URL, or raw base64 string. */
|
|
243
|
+
images?: string[];
|
|
244
|
+
/** Catch-all for engine-specific fields. */
|
|
245
|
+
[field: string]: unknown;
|
|
246
|
+
}
|
|
247
|
+
export interface BuildImageGenBodyOptions {
|
|
248
|
+
tags?: string[];
|
|
249
|
+
/** Step name. Defaults to `step_0`. */
|
|
250
|
+
name?: string;
|
|
251
|
+
/** Step timeout. Defaults to `'00:10:00'`. */
|
|
252
|
+
timeout?: string;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Build an `imageGen` workflow body. Pass-through for engine-specific input
|
|
256
|
+
* fields — see {@link ImageGenInput} for examples per engine.
|
|
257
|
+
*
|
|
258
|
+
* @example Nano Banana 2 with a reference image
|
|
259
|
+
* ```ts
|
|
260
|
+
* const body = buildImageGenBody({
|
|
261
|
+
* engine: 'google',
|
|
262
|
+
* model: 'nano-banana-2',
|
|
263
|
+
* prompt: 'turn this into a cartoon sticker',
|
|
264
|
+
* images: ['data:image/png;base64,...'],
|
|
265
|
+
* aspectRatio: '1:1',
|
|
266
|
+
* numImages: 1,
|
|
267
|
+
* resolution: '1K',
|
|
268
|
+
* }, { tags: ['my-app'] });
|
|
269
|
+
*
|
|
270
|
+
* const estimate = await estimateWorkflow(client, body);
|
|
271
|
+
* const submitted = await submitWorkflow(client, body);
|
|
272
|
+
* ```
|
|
273
|
+
*
|
|
274
|
+
* @example Flux.1 Kontext for image editing
|
|
275
|
+
* ```ts
|
|
276
|
+
* const body = buildImageGenBody({
|
|
277
|
+
* engine: 'flux1-kontext',
|
|
278
|
+
* model: 'pro',
|
|
279
|
+
* prompt: 'add sunglasses',
|
|
280
|
+
* images: ['https://example.com/portrait.jpg'],
|
|
281
|
+
* aspectRatio: '1:1',
|
|
282
|
+
* });
|
|
283
|
+
* ```
|
|
284
|
+
*/
|
|
285
|
+
export declare function buildImageGenBody(input: ImageGenInput, opts?: BuildImageGenBodyOptions): unknown;
|
|
286
|
+
export interface BuildWorkflowBodyStep {
|
|
287
|
+
$type: WorkflowStepType | (string & {});
|
|
288
|
+
/** Step name. Defaults to `step_0`. */
|
|
289
|
+
name?: string;
|
|
290
|
+
/** Step timeout. Defaults to `'00:10:00'`. */
|
|
291
|
+
timeout?: string;
|
|
292
|
+
/** The step's input — shape is per-step-type. See {@link WORKFLOW_STEP_TYPES}. */
|
|
293
|
+
input: unknown;
|
|
294
|
+
/** Optional metadata attached to the step. */
|
|
295
|
+
metadata?: Record<string, unknown>;
|
|
296
|
+
}
|
|
297
|
+
export interface BuildWorkflowBodyOptions {
|
|
298
|
+
tags?: string[];
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Lowest-level body builder — drops a single step into the `{ steps: [...] }`
|
|
302
|
+
* envelope and fills in `name` / `timeout` defaults. Use this when no dedicated
|
|
303
|
+
* `build*Body` exists for your step type.
|
|
304
|
+
*
|
|
305
|
+
* For multi-step workflows, hand-build `{ tags?, steps: [step1, step2, ...] }`
|
|
306
|
+
* yourself — there's no special envelope work beyond a JSON array.
|
|
307
|
+
*
|
|
308
|
+
* @example videoGen via VEO 3
|
|
309
|
+
* ```ts
|
|
310
|
+
* const body = buildWorkflowBody({
|
|
311
|
+
* $type: 'videoGen',
|
|
312
|
+
* input: { engine: 'veo3', prompt: 'a fox jumping', duration: 8 },
|
|
313
|
+
* }, { tags: ['my-app'] });
|
|
314
|
+
* ```
|
|
315
|
+
*/
|
|
316
|
+
export declare function buildWorkflowBody(step: BuildWorkflowBodyStep, opts?: BuildWorkflowBodyOptions): unknown;
|
|
93
317
|
/**
|
|
94
318
|
* Cost preview ("what if") — runs the workflow validation/pricing pipeline
|
|
95
319
|
* without committing any Buzz.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/orchestrator/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/orchestrator/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,eAAO,MAAM,6BAA6B,sCAAsC,CAAC;AAEjF,yEAAyE;AACzE,eAAO,MAAM,iBAAiB,kDAAkD,CAAC;AAEjF;;GAEG;AACH,eAAO,MAAM,iBAAiB,yDAA0D,CAAC;AACzF,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAIhE;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB;IAE9B,iHAAiH;;IAEjH;;;;OAIG;;IAEH,8EAA8E;;IAE9E,6EAA6E;;IAE7E,sDAAsD;;IAEtD,oEAAoE;;IAEpE,oDAAoD;;IAEpD,0EAA0E;;IAI1E,4EAA4E;;IAE5E,iCAAiC;;IAEjC,uCAAuC;;IAEvC,gEAAgE;;IAEhE,8CAA8C;;IAE9C,yDAAyD;;IAEzD,sCAAsC;;IAItC,oDAAoD;;IAEpD,iEAAiE;;IAEjE,oCAAoC;;IAEpC,iCAAiC;;IAEjC,oCAAoC;;IAIpC,yDAAyD;;IAEzD,yBAAyB;;IAEzB,8CAA8C;;IAE9C,4CAA4C;;IAE5C,yCAAyC;;IAEzC,mDAAmD;;IAEnD,uCAAuC;;IAEvC,4CAA4C;;IAE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,EAC1B,IAAI,EAAE,OAAO,GACZ,OAAO,CAAC,gBAAgB,CAAC,CAK3B;AAED,2EAA2E;AAC3E,wBAAgB,cAAc,CAC5B,MAAM,EAAE,kBAAkB,EAC1B,IAAI,EAAE,OAAO,GACZ,OAAO,CAAC,gBAAgB,CAAC,CAK3B;AAED,wBAAgB,WAAW,CACzB,MAAM,EAAE,kBAAkB,EAC1B,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,gBAAgB,CAAC,CAM3B;AAID,MAAM,WAAW,mBAAmB;IAClC,4CAA4C;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qDAAqD;IACrD,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED;;;;;GAKG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,kBAAkB,EAC1B,UAAU,EAAE,MAAM,EAClB,IAAI,GAAE,mBAAwB,GAC7B,OAAO,CAAC,gBAAgB,CAAC,CAY3B;AAID,wBAAgB,UAAU,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAG7E;AAED,iEAAiE;AACjE,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,EAAE,CAcpF"}
|
|
@@ -3,6 +3,15 @@
|
|
|
3
3
|
* starter's BFF. Client + server safe: no Node-only imports, no `process.env`
|
|
4
4
|
* access. All configuration flows through the `OrchestratorClient` value that
|
|
5
5
|
* the caller builds.
|
|
6
|
+
*
|
|
7
|
+
* The orchestrator is a workflow API: you POST a `{ steps: [...] }` body with
|
|
8
|
+
* one or more typed steps (`textToImage`, `imageGen`, `videoGen`, `comfy`, ...)
|
|
9
|
+
* and get back a workflow snapshot. {@link WORKFLOW_STEP_TYPES} is the catalog
|
|
10
|
+
* of available step types — start there to find the one you need, then either
|
|
11
|
+
* use the matching `build*Body` helper or hand-craft a body and pass it to
|
|
12
|
+
* {@link submitWorkflow} / {@link callOrchestrator}.
|
|
13
|
+
*
|
|
14
|
+
* Full OpenAPI spec: https://orchestration.civitai.com/openapi/v2-consumers.json
|
|
6
15
|
*/
|
|
7
16
|
// ---------- Constants -------------------------------------------------------
|
|
8
17
|
export const DEFAULT_ORCHESTRATOR_BASE_URL = 'https://orchestration.civitai.com';
|
|
@@ -12,6 +21,126 @@ export const DEFAULT_MODEL_AIR = 'urn:air:sdxl:checkpoint:civitai:101055@128078'
|
|
|
12
21
|
* Terminal orchestrator statuses (lowercase — matches what the API returns).
|
|
13
22
|
*/
|
|
14
23
|
export const TERMINAL_STATUSES = ['succeeded', 'failed', 'expired', 'canceled'];
|
|
24
|
+
// ---------- Step type catalog ----------------------------------------------
|
|
25
|
+
/**
|
|
26
|
+
* Every workflow step type the orchestrator accepts, with a one-line
|
|
27
|
+
* description. Use this as a map: find the step `$type` you want, then look
|
|
28
|
+
* at the matching `build*Body` helper (if one exists) or fall back to
|
|
29
|
+
* {@link callOrchestrator} with a hand-crafted body.
|
|
30
|
+
*
|
|
31
|
+
* Source of truth is `https://orchestration.civitai.com/openapi/v2-consumers.json`.
|
|
32
|
+
* If a step type is missing here, the catalog is stale — open a PR.
|
|
33
|
+
*/
|
|
34
|
+
export const WORKFLOW_STEP_TYPES = {
|
|
35
|
+
// ----- Image gen ---------------------------------------------------------
|
|
36
|
+
/** Diffusion image gen (SDXL / Flux.1 / Pony / Illustrious / SD1.5 / etc.). Use {@link buildTextToImageBody}. */
|
|
37
|
+
textToImage: 'Text-to-image via diffusion checkpoints (AIR URN models)',
|
|
38
|
+
/**
|
|
39
|
+
* Closed-source image-gen APIs (Nano Banana, Gemini, Flux.1 Kontext, Flux.2,
|
|
40
|
+
* GPT-Image, Seedream, Grok, fal, …). Each engine has its own input shape;
|
|
41
|
+
* see {@link IMAGE_GEN_ENGINES}. Use {@link buildImageGenBody}.
|
|
42
|
+
*/
|
|
43
|
+
imageGen: 'Closed-source image gen (Nano Banana, Gemini, GPT-Image, Flux Kontext, Seedream, Grok, fal, …)',
|
|
44
|
+
/** Arbitrary ComfyUI workflow graphs. Pass a `prompt` object (node graph). */
|
|
45
|
+
comfy: 'Custom ComfyUI node-graph workflows',
|
|
46
|
+
/** Upscale an existing image. Input is a source image URL + scale factor. */
|
|
47
|
+
imageUpscaler: 'Image upscaling',
|
|
48
|
+
/** LoRA / DoRA / embedding training. Long-running. */
|
|
49
|
+
imageResourceTraining: 'Train a LoRA / DoRA / embedding from a dataset',
|
|
50
|
+
/** Pre-process an image (resize, ControlNet preprocessor, etc.). */
|
|
51
|
+
preprocessImage: 'Image preprocessing (resize, ControlNet preprocessors, …)',
|
|
52
|
+
/** Format conversion between png/jpeg/webp/avif. */
|
|
53
|
+
convertImage: 'Image format conversion',
|
|
54
|
+
/** Upload arbitrary blob bytes for use as a reference in a later step. */
|
|
55
|
+
imageUpload: 'Upload an image blob to use as input in a later step',
|
|
56
|
+
// ----- Video gen ---------------------------------------------------------
|
|
57
|
+
/** Video gen across all engines (VEO 3, Kling, Wan, Vidu, Sora, LTX, …). */
|
|
58
|
+
videoGen: 'Video generation across all engines (VEO 3, Kling, Wan, Vidu, Sora, LTX, …)',
|
|
59
|
+
/** Upscale an existing video. */
|
|
60
|
+
videoUpscaler: 'Video upscaling',
|
|
61
|
+
/** Frame interpolation / smoothing. */
|
|
62
|
+
videoInterpolation: 'Video frame interpolation',
|
|
63
|
+
/** Per-frame transformations (denoise, color correct, etc.). */
|
|
64
|
+
videoEnhancement: 'Per-frame video enhancement',
|
|
65
|
+
/** Extract individual frames from a video. */
|
|
66
|
+
videoFrameExtraction: 'Extract frames from a video',
|
|
67
|
+
/** Read video metadata (duration, codec, dimensions). */
|
|
68
|
+
videoMetadata: 'Read video file metadata',
|
|
69
|
+
/** Transcode video format / codec. */
|
|
70
|
+
transcode: 'Audio/video transcoding',
|
|
71
|
+
// ----- Audio -------------------------------------------------------------
|
|
72
|
+
/** Text-to-speech (multi-voice, multi-language). */
|
|
73
|
+
textToSpeech: 'Text-to-speech synthesis',
|
|
74
|
+
/** Music generation via ACE Step 1.5 (lyrics + style → song). */
|
|
75
|
+
aceStepAudio: 'Music generation (ACE Step 1.5)',
|
|
76
|
+
/** Speech-to-text transcription. */
|
|
77
|
+
transcription: 'Speech-to-text transcription',
|
|
78
|
+
/** Mix multiple audio tracks. */
|
|
79
|
+
audioMix: 'Audio track mixing',
|
|
80
|
+
/** Generate captions from audio. */
|
|
81
|
+
audioCaptioning: 'Caption generation from audio',
|
|
82
|
+
// ----- Classification / tagging / moderation ----------------------------
|
|
83
|
+
/** Hash an image / video / model for dedup or lookup. */
|
|
84
|
+
mediaHash: 'Media content hashing',
|
|
85
|
+
/** Hash a model file. */
|
|
86
|
+
modelHash: 'Model file hashing',
|
|
87
|
+
/** Rate media on aesthetic / quality axes. */
|
|
88
|
+
mediaRating: 'Media aesthetic / quality rating',
|
|
89
|
+
/** Caption an image with a vision model. */
|
|
90
|
+
mediaCaptioning: 'Image captioning via vision models',
|
|
91
|
+
/** WD-14 tagger (anime / booru tags). */
|
|
92
|
+
wdTagging: 'WD-14 anime tagging',
|
|
93
|
+
/** Estimate an age range for faces in an image. */
|
|
94
|
+
ageClassification: 'Age range classification',
|
|
95
|
+
/** xGuard NSFW / safety moderation. */
|
|
96
|
+
xGuardModeration: 'NSFW / safety moderation',
|
|
97
|
+
/** ClamAV scan a model file for malware. */
|
|
98
|
+
modelClamScan: 'Antivirus scan a model file',
|
|
99
|
+
/** Pickle-scan a model file for unsafe pickles. */
|
|
100
|
+
modelPickleScan: 'Pickle-safety scan for model files',
|
|
101
|
+
/** Parse model file metadata (SafeTensors / GGUF headers). */
|
|
102
|
+
modelParseMetadata: 'Parse model file metadata',
|
|
103
|
+
// ----- LLM ---------------------------------------------------------------
|
|
104
|
+
/** Chat completion (OpenAI / Anthropic / Gemini / local OSS). */
|
|
105
|
+
chatCompletion: 'LLM chat completion',
|
|
106
|
+
/** Generate a richer prompt from a short seed prompt. */
|
|
107
|
+
promptEnhancement: 'Prompt expansion via LLM',
|
|
108
|
+
// ----- Utility -----------------------------------------------------------
|
|
109
|
+
/** Echo the input back. Useful for testing the round-trip. */
|
|
110
|
+
echo: 'Echo step — round-trip the input for testing',
|
|
111
|
+
/** Package multiple blobs into a zip archive. */
|
|
112
|
+
blobArchive: 'Zip multiple blobs into an archive',
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* Engines that the `imageGen` step accepts. Each one has its own input shape;
|
|
116
|
+
* the body's `engine` field selects which shape applies.
|
|
117
|
+
*
|
|
118
|
+
* Pair with {@link buildImageGenBody} or hand-craft via {@link callOrchestrator}.
|
|
119
|
+
*/
|
|
120
|
+
export const IMAGE_GEN_ENGINES = {
|
|
121
|
+
/** Nano Banana 2 / Nano Banana Pro / Imagen 4. */
|
|
122
|
+
google: 'Google (Nano Banana, Imagen)',
|
|
123
|
+
/** Gemini 2.5 Flash image gen + editing. */
|
|
124
|
+
gemini: 'Gemini',
|
|
125
|
+
/** GPT-Image-1 / GPT-Image-1.5 / DALL-E-3. */
|
|
126
|
+
openai: 'OpenAI (GPT-Image, DALL-E)',
|
|
127
|
+
/** Flux.1 Kontext (pro/max/dev) — image editing with ref images. */
|
|
128
|
+
'flux1-kontext': 'Flux.1 Kontext (image editing)',
|
|
129
|
+
/** Flux.2 family (pro/max/dev/flex/klein). */
|
|
130
|
+
flux2: 'Flux.2',
|
|
131
|
+
/** Seedream (ByteDance) — 2K/4K image gen. */
|
|
132
|
+
seedream: 'Seedream',
|
|
133
|
+
/** Grok image generation. */
|
|
134
|
+
grok: 'Grok',
|
|
135
|
+
/** Wan image generation. */
|
|
136
|
+
wan: 'Wan',
|
|
137
|
+
/** Self-hosted SDCpp (stable-diffusion.cpp) gen. */
|
|
138
|
+
sdcpp: 'SDCpp (self-hosted diffusion)',
|
|
139
|
+
/** fal.ai routed gen. */
|
|
140
|
+
fal: 'fal.ai',
|
|
141
|
+
/** Comfy graph as an imageGen step (vs. the top-level `comfy` step). */
|
|
142
|
+
comfy: 'Comfy (engine-style)',
|
|
143
|
+
};
|
|
15
144
|
export class OrchestratorError extends Error {
|
|
16
145
|
status;
|
|
17
146
|
body;
|
|
@@ -88,6 +217,84 @@ export function buildTextToImageBody(input, opts = {}) {
|
|
|
88
217
|
body.tags = opts.tags;
|
|
89
218
|
return body;
|
|
90
219
|
}
|
|
220
|
+
/**
|
|
221
|
+
* Build an `imageGen` workflow body. Pass-through for engine-specific input
|
|
222
|
+
* fields — see {@link ImageGenInput} for examples per engine.
|
|
223
|
+
*
|
|
224
|
+
* @example Nano Banana 2 with a reference image
|
|
225
|
+
* ```ts
|
|
226
|
+
* const body = buildImageGenBody({
|
|
227
|
+
* engine: 'google',
|
|
228
|
+
* model: 'nano-banana-2',
|
|
229
|
+
* prompt: 'turn this into a cartoon sticker',
|
|
230
|
+
* images: ['data:image/png;base64,...'],
|
|
231
|
+
* aspectRatio: '1:1',
|
|
232
|
+
* numImages: 1,
|
|
233
|
+
* resolution: '1K',
|
|
234
|
+
* }, { tags: ['my-app'] });
|
|
235
|
+
*
|
|
236
|
+
* const estimate = await estimateWorkflow(client, body);
|
|
237
|
+
* const submitted = await submitWorkflow(client, body);
|
|
238
|
+
* ```
|
|
239
|
+
*
|
|
240
|
+
* @example Flux.1 Kontext for image editing
|
|
241
|
+
* ```ts
|
|
242
|
+
* const body = buildImageGenBody({
|
|
243
|
+
* engine: 'flux1-kontext',
|
|
244
|
+
* model: 'pro',
|
|
245
|
+
* prompt: 'add sunglasses',
|
|
246
|
+
* images: ['https://example.com/portrait.jpg'],
|
|
247
|
+
* aspectRatio: '1:1',
|
|
248
|
+
* });
|
|
249
|
+
* ```
|
|
250
|
+
*/
|
|
251
|
+
export function buildImageGenBody(input, opts = {}) {
|
|
252
|
+
const body = {
|
|
253
|
+
steps: [
|
|
254
|
+
{
|
|
255
|
+
$type: 'imageGen',
|
|
256
|
+
name: opts.name ?? 'step_0',
|
|
257
|
+
timeout: opts.timeout ?? '00:10:00',
|
|
258
|
+
input,
|
|
259
|
+
},
|
|
260
|
+
],
|
|
261
|
+
};
|
|
262
|
+
if (opts.tags && opts.tags.length > 0)
|
|
263
|
+
body.tags = opts.tags;
|
|
264
|
+
return body;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Lowest-level body builder — drops a single step into the `{ steps: [...] }`
|
|
268
|
+
* envelope and fills in `name` / `timeout` defaults. Use this when no dedicated
|
|
269
|
+
* `build*Body` exists for your step type.
|
|
270
|
+
*
|
|
271
|
+
* For multi-step workflows, hand-build `{ tags?, steps: [step1, step2, ...] }`
|
|
272
|
+
* yourself — there's no special envelope work beyond a JSON array.
|
|
273
|
+
*
|
|
274
|
+
* @example videoGen via VEO 3
|
|
275
|
+
* ```ts
|
|
276
|
+
* const body = buildWorkflowBody({
|
|
277
|
+
* $type: 'videoGen',
|
|
278
|
+
* input: { engine: 'veo3', prompt: 'a fox jumping', duration: 8 },
|
|
279
|
+
* }, { tags: ['my-app'] });
|
|
280
|
+
* ```
|
|
281
|
+
*/
|
|
282
|
+
export function buildWorkflowBody(step, opts = {}) {
|
|
283
|
+
const body = {
|
|
284
|
+
steps: [
|
|
285
|
+
{
|
|
286
|
+
$type: step.$type,
|
|
287
|
+
name: step.name ?? 'step_0',
|
|
288
|
+
timeout: step.timeout ?? '00:10:00',
|
|
289
|
+
input: step.input,
|
|
290
|
+
...(step.metadata ? { metadata: step.metadata } : {}),
|
|
291
|
+
},
|
|
292
|
+
],
|
|
293
|
+
};
|
|
294
|
+
if (opts.tags && opts.tags.length > 0)
|
|
295
|
+
body.tags = opts.tags;
|
|
296
|
+
return body;
|
|
297
|
+
}
|
|
91
298
|
// ---------- Workflow endpoints ---------------------------------------------
|
|
92
299
|
/**
|
|
93
300
|
* Cost preview ("what if") — runs the workflow validation/pricing pipeline
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/orchestrator/index.ts"],"names":[],"m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rypted-cookie sessions, scopes, and orchestrator helpers for building third-party Civitai apps.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -26,10 +26,16 @@
|
|
|
26
26
|
"./orchestrator": {
|
|
27
27
|
"types": "./dist/orchestrator/index.d.ts",
|
|
28
28
|
"import": "./dist/orchestrator/index.js"
|
|
29
|
-
}
|
|
29
|
+
},
|
|
30
|
+
"./blocks": {
|
|
31
|
+
"types": "./dist/blocks/index.d.ts",
|
|
32
|
+
"import": "./dist/blocks/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./schemas/app-block/v1.json": "./schemas/app-block/v1.json"
|
|
30
35
|
},
|
|
31
36
|
"files": [
|
|
32
37
|
"dist",
|
|
38
|
+
"schemas",
|
|
33
39
|
"README.md"
|
|
34
40
|
],
|
|
35
41
|
"scripts": {
|
|
@@ -43,9 +49,9 @@
|
|
|
43
49
|
},
|
|
44
50
|
"dependencies": {},
|
|
45
51
|
"devDependencies": {
|
|
46
|
-
"@types/node": "^
|
|
52
|
+
"@types/node": "^25.9.1",
|
|
47
53
|
"typescript": "^5.9.2",
|
|
48
|
-
"vitest": "^4.
|
|
54
|
+
"vitest": "^4.1.7"
|
|
49
55
|
},
|
|
50
56
|
"publishConfig": {
|
|
51
57
|
"access": "public"
|
|
@@ -65,7 +71,7 @@
|
|
|
65
71
|
"bugs": "https://github.com/civitai/civitai-app-starters/issues",
|
|
66
72
|
"repository": {
|
|
67
73
|
"type": "git",
|
|
68
|
-
"url": "https://github.com/civitai/civitai-app-starters.git",
|
|
74
|
+
"url": "git+https://github.com/civitai/civitai-app-starters.git",
|
|
69
75
|
"directory": "packages/civitai-app-sdk"
|
|
70
76
|
}
|
|
71
77
|
}
|