@qvac/sdk 0.12.2 → 0.13.1
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/NOTICE +55 -1225
- package/README.md +12 -0
- package/dist/client/api/bci-transcribe.d.ts +57 -0
- package/dist/client/api/bci-transcribe.js +172 -0
- package/dist/client/api/get-model-info.d.ts +1 -1
- package/dist/client/api/index.d.ts +1 -0
- package/dist/client/api/index.js +1 -0
- package/dist/client/api/video.d.ts +26 -6
- package/dist/client/api/video.js +30 -7
- package/dist/client/api/vla.d.ts +11 -7
- package/dist/client/api/vla.js +11 -7
- package/dist/client/rpc/bare-client.js +2 -2
- package/dist/commands/bundle/constants.js +2 -0
- package/dist/examples/bci/bci-filesystem-streaming.d.ts +2 -0
- package/dist/examples/bci/bci-filesystem-streaming.js +77 -0
- package/dist/examples/bci/bci-filesystem.d.ts +2 -0
- package/dist/examples/bci/bci-filesystem.js +63 -0
- package/dist/examples/cache-management.js +0 -1
- package/dist/examples/cancel-by-request-id.js +0 -1
- package/dist/examples/classification/classify-image.js +1 -1
- package/dist/examples/completion-events.js +6 -2
- package/dist/examples/completion-stop-reason.d.ts +25 -0
- package/dist/examples/completion-stop-reason.js +65 -0
- package/dist/examples/concurrent-completion-collision.d.ts +2 -0
- package/dist/examples/concurrent-completion-collision.js +98 -0
- package/dist/examples/config-reload.js +1 -2
- package/dist/examples/default-config-usage.js +0 -1
- package/dist/examples/delegated-inference/composite.js +0 -1
- package/dist/examples/delegated-inference/consumer-profiled.js +0 -1
- package/dist/examples/delegated-inference/consumer.js +0 -1
- package/dist/examples/diffusion-esrgan-upscale.js +1 -3
- package/dist/examples/diffusion-flux2-klein-img2img.js +1 -1
- package/dist/examples/diffusion-flux2-klein.js +2 -2
- package/dist/examples/diffusion-img2img.js +1 -1
- package/dist/examples/diffusion-img2vid.d.ts +2 -0
- package/dist/examples/diffusion-img2vid.js +78 -0
- package/dist/examples/diffusion-simple.js +1 -1
- package/dist/examples/diffusion-txt2img.js +8 -3
- package/dist/examples/diffusion-txt2vid.js +2 -3
- package/dist/examples/download-with-blind-relays.js +0 -1
- package/dist/examples/embed-multi-gpu.js +1 -2
- package/dist/examples/embed-p2p.js +4 -2
- package/dist/examples/finetune/llamacpp-finetune.js +5 -3
- package/dist/examples/kv-cache-cleanup.js +0 -1
- package/dist/examples/kv-cache-custom-key.js +0 -1
- package/dist/examples/kv-cache-example.js +4 -2
- package/dist/examples/llamacpp-cache.js +0 -1
- package/dist/examples/llamacpp-dynamic-tools.js +4 -2
- package/dist/examples/llamacpp-filesystem.js +1 -1
- package/dist/examples/llamacpp-http.js +1 -1
- package/dist/examples/llamacpp-multi-gpu.js +2 -2
- package/dist/examples/llamacpp-multimodal.js +0 -1
- package/dist/examples/llamacpp-p2p.js +0 -1
- package/dist/examples/llamacpp-sharded.js +1 -1
- package/dist/examples/llamacpp-structured-output.js +0 -1
- package/dist/examples/logging-file-transport.js +0 -1
- package/dist/examples/logging-streaming.js +0 -2
- package/dist/examples/mcp-websearch.js +0 -1
- package/dist/examples/multi-model-demo.js +0 -2
- package/dist/examples/ocr-fasttext.js +0 -1
- package/dist/examples/plugins.js +1 -4
- package/dist/examples/profiling/basic.js +3 -2
- package/dist/examples/profiling/per-call.js +0 -1
- package/dist/examples/quickstart.js +0 -1
- package/dist/examples/rag/rag-chromadb.js +0 -1
- package/dist/examples/rag/rag-hyperdb/cancellation.js +0 -1
- package/dist/examples/rag/rag-hyperdb/ingest.js +0 -1
- package/dist/examples/rag/rag-hyperdb/pipeline.js +0 -1
- package/dist/examples/rag/rag-hyperdb/workspaces.js +0 -1
- package/dist/examples/rag/rag-lancedb.js +0 -1
- package/dist/examples/rag/rag-sqlite.js +0 -1
- package/dist/examples/suspend-resume.js +0 -1
- package/dist/examples/tools/llamacpp-native-tools.js +0 -1
- package/dist/examples/tools/llamacpp-tools-gemma4.js +1 -1
- package/dist/examples/tools/llamacpp-tools-pythonic.js +2 -2
- package/dist/examples/tools/llamacpp-tools-qwen35.js +1 -1
- package/dist/examples/transcription/parakeet-ctc-filesystem.js +1 -1
- package/dist/examples/transcription/parakeet-microphone-record.js +0 -1
- package/dist/examples/transcription/parakeet-microphone-stream.js +0 -1
- package/dist/examples/transcription/parakeet-sortformer.js +1 -2
- package/dist/examples/transcription/parakeet-tdt-filesystem.js +1 -1
- package/dist/examples/transcription/whispercpp-filesystem-streaming.js +10 -6
- package/dist/examples/transcription/whispercpp-filesystem.js +4 -2
- package/dist/examples/transcription/whispercpp-microphone-conversation.js +0 -1
- package/dist/examples/transcription/whispercpp-microphone-record.js +0 -1
- package/dist/examples/transcription/whispercpp-prompt.js +0 -1
- package/dist/examples/translation/translation-bergamot-batch.js +1 -2
- package/dist/examples/translation/translation-bergamot-pivot.js +3 -4
- package/dist/examples/translation/translation-bergamot.js +1 -2
- package/dist/examples/translation/translation-indic.js +1 -2
- package/dist/examples/translation/translation-llm-afriquegemma.js +3 -4
- package/dist/examples/translation/translation-llm-context.js +1 -2
- package/dist/examples/translation/translation-llm.js +2 -3
- package/dist/examples/translation/translation-stream.js +2 -3
- package/dist/examples/tts/chatterbox.js +1 -2
- package/dist/examples/tts/llm-to-tts-streaming.js +2 -4
- package/dist/examples/tts/supertonic-multilingual.js +1 -2
- package/dist/examples/tts/supertonic.js +1 -2
- package/dist/examples/vla-pi05.d.ts +2 -0
- package/dist/examples/vla-pi05.js +84 -0
- package/dist/examples/vla-smolvla.js +1 -1
- package/dist/examples/voice-assistant/voice-assistant.js +1 -4
- package/dist/index.d.ts +2 -2
- package/dist/index.js +9 -7
- package/dist/models/registry/models.d.ts +869 -186
- package/dist/models/registry/models.js +3160 -2453
- package/dist/models/update-models/companions.d.ts +7 -0
- package/dist/models/update-models/companions.js +56 -0
- package/dist/models/update-models/naming.js +10 -0
- package/dist/pear/pre.js +2 -0
- package/dist/schemas/bci-config.d.ts +36 -0
- package/dist/schemas/bci-config.js +56 -0
- package/dist/schemas/bci.d.ts +177 -0
- package/dist/schemas/bci.js +95 -0
- package/dist/schemas/common.d.ts +395 -51
- package/dist/schemas/common.js +5 -0
- package/dist/schemas/completion-event.d.ts +1 -0
- package/dist/schemas/download-asset.d.ts +7 -3
- package/dist/schemas/embed.d.ts +2 -0
- package/dist/schemas/embed.js +1 -0
- package/dist/schemas/engine-addon-map.d.ts +1 -0
- package/dist/schemas/engine-addon-map.js +4 -1
- package/dist/schemas/get-model-info.d.ts +2 -0
- package/dist/schemas/get-model-info.js +1 -0
- package/dist/schemas/index.d.ts +2 -0
- package/dist/schemas/index.js +2 -0
- package/dist/schemas/llamacpp-config.d.ts +6 -2
- package/dist/schemas/load-model.d.ts +1841 -267
- package/dist/schemas/load-model.js +34 -1
- package/dist/schemas/model-src-utils.d.ts +10 -2
- package/dist/schemas/model-types.d.ts +19 -1
- package/dist/schemas/model-types.js +11 -0
- package/dist/schemas/ocr.d.ts +2 -0
- package/dist/schemas/plugin.d.ts +13 -5
- package/dist/schemas/plugin.js +13 -4
- package/dist/schemas/registry.d.ts +18 -0
- package/dist/schemas/registry.js +2 -0
- package/dist/schemas/reload-config.d.ts +10 -2
- package/dist/schemas/sdcpp-config.d.ts +75 -8
- package/dist/schemas/sdcpp-config.js +56 -10
- package/dist/schemas/sdk-config.d.ts +342 -0
- package/dist/schemas/text-to-speech.d.ts +8 -0
- package/dist/schemas/transcription-config.d.ts +2 -0
- package/dist/schemas/transcription.d.ts +12 -0
- package/dist/schemas/transcription.js +8 -0
- package/dist/schemas/translation-config.d.ts +44 -16
- package/dist/schemas/translation-config.js +2 -0
- package/dist/schemas/vla.d.ts +14 -0
- package/dist/schemas/vla.js +26 -3
- package/dist/server/bare/delegate-connect-diagnostics.d.ts +9 -0
- package/dist/server/bare/delegate-connect-diagnostics.js +44 -0
- package/dist/server/bare/delegate-rpc-client.js +10 -12
- package/dist/server/bare/hyperswarm.js +1 -0
- package/dist/server/bare/ops/bci-transcribe.d.ts +13 -0
- package/dist/server/bare/ops/bci-transcribe.js +248 -0
- package/dist/server/bare/ops/embed.js +2 -1
- package/dist/server/bare/ops/kv-cache-utils.js +4 -3
- package/dist/server/bare/ops/transcribe.js +6 -2
- package/dist/server/bare/ops/translate.js +1 -1
- package/dist/server/bare/plugins/bci-whispercpp-transcription/plugin.d.ts +130 -0
- package/dist/server/bare/plugins/bci-whispercpp-transcription/plugin.js +116 -0
- package/dist/server/bare/plugins/ggml-vla/ops/vla-run.js +4 -0
- package/dist/server/bare/plugins/ggml-vla/plugin.d.ts +7 -0
- package/dist/server/bare/plugins/ggml-vla/plugin.js +1 -1
- package/dist/server/bare/plugins/index.d.ts +1 -0
- package/dist/server/bare/plugins/index.js +1 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/finetune.js +22 -29
- package/dist/server/bare/plugins/llamacpp-completion/plugin.d.ts +2 -0
- package/dist/server/bare/plugins/llamacpp-completion/plugin.js +38 -7
- package/dist/server/bare/plugins/llamacpp-embedding/plugin.d.ts +1 -0
- package/dist/server/bare/plugins/llamacpp-embedding/plugin.js +9 -1
- package/dist/server/bare/plugins/nmtcpp-translation/plugin.d.ts +14 -0
- package/dist/server/bare/plugins/onnx-ocr/plugin.d.ts +2 -0
- package/dist/server/bare/plugins/parakeet-transcription/plugin.d.ts +8 -0
- package/dist/server/bare/plugins/sdcpp-generation/ops/video.js +7 -1
- package/dist/server/bare/plugins/sdcpp-generation/plugin.d.ts +58 -4
- package/dist/server/bare/plugins/sdcpp-generation/plugin.js +9 -4
- package/dist/server/bare/plugins/whispercpp-transcription/plugin.d.ts +10 -0
- package/dist/server/bare/registry/model-config-utils.js +3 -0
- package/dist/server/bare/runtime/request-registry-singleton.js +11 -4
- package/dist/server/bare/runtime/request-registry.d.ts +60 -16
- package/dist/server/bare/runtime/request-registry.js +258 -15
- package/dist/server/bare/runtime/with-request-context.d.ts +1 -1
- package/dist/server/bare/runtime/with-request-context.js +1 -1
- package/dist/server/bare/types/addon-responses.d.ts +5 -0
- package/dist/server/rpc/handler-registry.js +4 -0
- package/dist/server/rpc/handlers/bci-transcribe-stream.d.ts +3 -0
- package/dist/server/rpc/handlers/bci-transcribe-stream.js +4 -0
- package/dist/server/rpc/handlers/bci-transcribe.d.ts +3 -0
- package/dist/server/rpc/handlers/bci-transcribe.js +4 -0
- package/dist/server/rpc/handlers/download-asset.js +1 -1
- package/dist/server/rpc/handlers/get-model-info.js +3 -3
- package/dist/server/rpc/handlers/index.d.ts +4 -0
- package/dist/server/rpc/handlers/index.js +4 -0
- package/dist/server/rpc/handlers/load-model/download-manager.d.ts +1 -1
- package/dist/server/rpc/handlers/load-model/handler.js +1 -1
- package/dist/server/rpc/handlers/load-model/http.js +6 -6
- package/dist/server/rpc/handlers/load-model/hyperdrive.js +1 -0
- package/dist/server/rpc/handlers/load-model/registry-companion-set.d.ts +1 -0
- package/dist/server/rpc/handlers/load-model/registry-companion-set.js +2 -2
- package/dist/server/rpc/handlers/load-model/registry.js +1 -0
- package/dist/server/rpc/handlers/load-model/resolve-session.d.ts +1 -1
- package/dist/server/rpc/handlers/rag.js +5 -5
- package/dist/server/utils/audio/decoder.js +1 -1
- package/dist/server/utils/checksum.js +2 -1
- package/dist/server/utils/formatting.js +2 -1
- package/dist/server/utils/multi-gpu-mobile.d.ts +5 -0
- package/dist/server/utils/multi-gpu-mobile.js +10 -0
- package/dist/server/worker.js +2 -1
- package/dist/utils/aggregate-events.d.ts +2 -1
- package/dist/utils/aggregate-events.js +11 -3
- package/dist/utils/errors-server.d.ts +6 -4
- package/dist/utils/errors-server.js +6 -4
- package/electron-forge/index.cjs +820 -0
- package/package.json +70 -37
- package/dist/scripts/run-security-tests-bare.d.ts +0 -2
- package/dist/scripts/run-security-tests-bare.js +0 -78
|
@@ -75,6 +75,7 @@ export declare const sdcppConfigSchema: z.ZodObject<{
|
|
|
75
75
|
vla: "vla";
|
|
76
76
|
"llamacpp-completion": "llamacpp-completion";
|
|
77
77
|
"whispercpp-transcription": "whispercpp-transcription";
|
|
78
|
+
"bci-whispercpp-transcription": "bci-whispercpp-transcription";
|
|
78
79
|
"llamacpp-embedding": "llamacpp-embedding";
|
|
79
80
|
"nmtcpp-translation": "nmtcpp-translation";
|
|
80
81
|
"onnx-tts": "onnx-tts";
|
|
@@ -86,6 +87,7 @@ export declare const sdcppConfigSchema: z.ZodObject<{
|
|
|
86
87
|
"ggml-classification": "ggml-classification";
|
|
87
88
|
llm: "llm";
|
|
88
89
|
whisper: "whisper";
|
|
90
|
+
bci: "bci";
|
|
89
91
|
nmt: "nmt";
|
|
90
92
|
parakeet: "parakeet";
|
|
91
93
|
classification: "classification";
|
|
@@ -110,6 +112,7 @@ export declare const sdcppConfigSchema: z.ZodObject<{
|
|
|
110
112
|
vla: "vla";
|
|
111
113
|
"llamacpp-completion": "llamacpp-completion";
|
|
112
114
|
"whispercpp-transcription": "whispercpp-transcription";
|
|
115
|
+
"bci-whispercpp-transcription": "bci-whispercpp-transcription";
|
|
113
116
|
"llamacpp-embedding": "llamacpp-embedding";
|
|
114
117
|
"nmtcpp-translation": "nmtcpp-translation";
|
|
115
118
|
"onnx-tts": "onnx-tts";
|
|
@@ -121,6 +124,7 @@ export declare const sdcppConfigSchema: z.ZodObject<{
|
|
|
121
124
|
"ggml-classification": "ggml-classification";
|
|
122
125
|
llm: "llm";
|
|
123
126
|
whisper: "whisper";
|
|
127
|
+
bci: "bci";
|
|
124
128
|
nmt: "nmt";
|
|
125
129
|
parakeet: "parakeet";
|
|
126
130
|
classification: "classification";
|
|
@@ -145,6 +149,7 @@ export declare const sdcppConfigSchema: z.ZodObject<{
|
|
|
145
149
|
vla: "vla";
|
|
146
150
|
"llamacpp-completion": "llamacpp-completion";
|
|
147
151
|
"whispercpp-transcription": "whispercpp-transcription";
|
|
152
|
+
"bci-whispercpp-transcription": "bci-whispercpp-transcription";
|
|
148
153
|
"llamacpp-embedding": "llamacpp-embedding";
|
|
149
154
|
"nmtcpp-translation": "nmtcpp-translation";
|
|
150
155
|
"onnx-tts": "onnx-tts";
|
|
@@ -156,6 +161,7 @@ export declare const sdcppConfigSchema: z.ZodObject<{
|
|
|
156
161
|
"ggml-classification": "ggml-classification";
|
|
157
162
|
llm: "llm";
|
|
158
163
|
whisper: "whisper";
|
|
164
|
+
bci: "bci";
|
|
159
165
|
nmt: "nmt";
|
|
160
166
|
parakeet: "parakeet";
|
|
161
167
|
classification: "classification";
|
|
@@ -180,6 +186,7 @@ export declare const sdcppConfigSchema: z.ZodObject<{
|
|
|
180
186
|
vla: "vla";
|
|
181
187
|
"llamacpp-completion": "llamacpp-completion";
|
|
182
188
|
"whispercpp-transcription": "whispercpp-transcription";
|
|
189
|
+
"bci-whispercpp-transcription": "bci-whispercpp-transcription";
|
|
183
190
|
"llamacpp-embedding": "llamacpp-embedding";
|
|
184
191
|
"nmtcpp-translation": "nmtcpp-translation";
|
|
185
192
|
"onnx-tts": "onnx-tts";
|
|
@@ -191,6 +198,7 @@ export declare const sdcppConfigSchema: z.ZodObject<{
|
|
|
191
198
|
"ggml-classification": "ggml-classification";
|
|
192
199
|
llm: "llm";
|
|
193
200
|
whisper: "whisper";
|
|
201
|
+
bci: "bci";
|
|
194
202
|
nmt: "nmt";
|
|
195
203
|
parakeet: "parakeet";
|
|
196
204
|
classification: "classification";
|
|
@@ -215,6 +223,7 @@ export declare const sdcppConfigSchema: z.ZodObject<{
|
|
|
215
223
|
vla: "vla";
|
|
216
224
|
"llamacpp-completion": "llamacpp-completion";
|
|
217
225
|
"whispercpp-transcription": "whispercpp-transcription";
|
|
226
|
+
"bci-whispercpp-transcription": "bci-whispercpp-transcription";
|
|
218
227
|
"llamacpp-embedding": "llamacpp-embedding";
|
|
219
228
|
"nmtcpp-translation": "nmtcpp-translation";
|
|
220
229
|
"onnx-tts": "onnx-tts";
|
|
@@ -226,6 +235,7 @@ export declare const sdcppConfigSchema: z.ZodObject<{
|
|
|
226
235
|
"ggml-classification": "ggml-classification";
|
|
227
236
|
llm: "llm";
|
|
228
237
|
whisper: "whisper";
|
|
238
|
+
bci: "bci";
|
|
229
239
|
nmt: "nmt";
|
|
230
240
|
parakeet: "parakeet";
|
|
231
241
|
classification: "classification";
|
|
@@ -250,6 +260,7 @@ export declare const sdcppConfigSchema: z.ZodObject<{
|
|
|
250
260
|
vla: "vla";
|
|
251
261
|
"llamacpp-completion": "llamacpp-completion";
|
|
252
262
|
"whispercpp-transcription": "whispercpp-transcription";
|
|
263
|
+
"bci-whispercpp-transcription": "bci-whispercpp-transcription";
|
|
253
264
|
"llamacpp-embedding": "llamacpp-embedding";
|
|
254
265
|
"nmtcpp-translation": "nmtcpp-translation";
|
|
255
266
|
"onnx-tts": "onnx-tts";
|
|
@@ -261,6 +272,44 @@ export declare const sdcppConfigSchema: z.ZodObject<{
|
|
|
261
272
|
"ggml-classification": "ggml-classification";
|
|
262
273
|
llm: "llm";
|
|
263
274
|
whisper: "whisper";
|
|
275
|
+
bci: "bci";
|
|
276
|
+
nmt: "nmt";
|
|
277
|
+
parakeet: "parakeet";
|
|
278
|
+
classification: "classification";
|
|
279
|
+
}>, z.ZodLiteral<"vad">]>>;
|
|
280
|
+
}, z.core.$strip>]>>;
|
|
281
|
+
clipVisionModelSrc: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
282
|
+
src: z.ZodString;
|
|
283
|
+
name: z.ZodOptional<z.ZodString>;
|
|
284
|
+
modelId: z.ZodOptional<z.ZodString>;
|
|
285
|
+
registryPath: z.ZodOptional<z.ZodString>;
|
|
286
|
+
registrySource: z.ZodOptional<z.ZodString>;
|
|
287
|
+
blobCoreKey: z.ZodOptional<z.ZodString>;
|
|
288
|
+
blobIndex: z.ZodOptional<z.ZodNumber>;
|
|
289
|
+
engine: z.ZodOptional<z.ZodString>;
|
|
290
|
+
expectedSize: z.ZodOptional<z.ZodNumber>;
|
|
291
|
+
sha256Checksum: z.ZodOptional<z.ZodString>;
|
|
292
|
+
addon: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
293
|
+
embeddings: "embeddings";
|
|
294
|
+
diffusion: "diffusion";
|
|
295
|
+
tts: "tts";
|
|
296
|
+
ocr: "ocr";
|
|
297
|
+
vla: "vla";
|
|
298
|
+
"llamacpp-completion": "llamacpp-completion";
|
|
299
|
+
"whispercpp-transcription": "whispercpp-transcription";
|
|
300
|
+
"bci-whispercpp-transcription": "bci-whispercpp-transcription";
|
|
301
|
+
"llamacpp-embedding": "llamacpp-embedding";
|
|
302
|
+
"nmtcpp-translation": "nmtcpp-translation";
|
|
303
|
+
"onnx-tts": "onnx-tts";
|
|
304
|
+
"tts-ggml": "tts-ggml";
|
|
305
|
+
"parakeet-transcription": "parakeet-transcription";
|
|
306
|
+
"onnx-ocr": "onnx-ocr";
|
|
307
|
+
"sdcpp-generation": "sdcpp-generation";
|
|
308
|
+
"ggml-vla": "ggml-vla";
|
|
309
|
+
"ggml-classification": "ggml-classification";
|
|
310
|
+
llm: "llm";
|
|
311
|
+
whisper: "whisper";
|
|
312
|
+
bci: "bci";
|
|
264
313
|
nmt: "nmt";
|
|
265
314
|
parakeet: "parakeet";
|
|
266
315
|
classification: "classification";
|
|
@@ -287,6 +336,7 @@ export declare const sdcppConfigSchema: z.ZodObject<{
|
|
|
287
336
|
vla: "vla";
|
|
288
337
|
"llamacpp-completion": "llamacpp-completion";
|
|
289
338
|
"whispercpp-transcription": "whispercpp-transcription";
|
|
339
|
+
"bci-whispercpp-transcription": "bci-whispercpp-transcription";
|
|
290
340
|
"llamacpp-embedding": "llamacpp-embedding";
|
|
291
341
|
"nmtcpp-translation": "nmtcpp-translation";
|
|
292
342
|
"onnx-tts": "onnx-tts";
|
|
@@ -298,6 +348,7 @@ export declare const sdcppConfigSchema: z.ZodObject<{
|
|
|
298
348
|
"ggml-classification": "ggml-classification";
|
|
299
349
|
llm: "llm";
|
|
300
350
|
whisper: "whisper";
|
|
351
|
+
bci: "bci";
|
|
301
352
|
nmt: "nmt";
|
|
302
353
|
parakeet: "parakeet";
|
|
303
354
|
classification: "classification";
|
|
@@ -512,9 +563,6 @@ export type DiffusionClientParams = DiffusionClientParamsBase & ({
|
|
|
512
563
|
export declare const videoRequestSchema: z.ZodObject<{
|
|
513
564
|
modelId: z.ZodString;
|
|
514
565
|
requestId: z.ZodOptional<z.ZodString>;
|
|
515
|
-
mode: z.ZodEnum<{
|
|
516
|
-
txt2vid: "txt2vid";
|
|
517
|
-
}>;
|
|
518
566
|
prompt: z.ZodString;
|
|
519
567
|
negative_prompt: z.ZodOptional<z.ZodString>;
|
|
520
568
|
width: z.ZodOptional<z.ZodNumber>;
|
|
@@ -602,14 +650,17 @@ export declare const videoRequestSchema: z.ZodObject<{
|
|
|
602
650
|
}>>;
|
|
603
651
|
cache_preset: z.ZodOptional<z.ZodString>;
|
|
604
652
|
cache_threshold: z.ZodOptional<z.ZodNumber>;
|
|
653
|
+
mode: z.ZodEnum<{
|
|
654
|
+
txt2vid: "txt2vid";
|
|
655
|
+
img2vid: "img2vid";
|
|
656
|
+
}>;
|
|
657
|
+
init_image: z.ZodOptional<z.ZodString>;
|
|
658
|
+
strength: z.ZodOptional<z.ZodNumber>;
|
|
605
659
|
}, z.core.$strip>;
|
|
606
660
|
export type VideoRequest = z.input<typeof videoRequestSchema>;
|
|
607
661
|
export declare const videoStreamRequestSchema: z.ZodObject<{
|
|
608
662
|
modelId: z.ZodString;
|
|
609
663
|
requestId: z.ZodOptional<z.ZodString>;
|
|
610
|
-
mode: z.ZodEnum<{
|
|
611
|
-
txt2vid: "txt2vid";
|
|
612
|
-
}>;
|
|
613
664
|
prompt: z.ZodString;
|
|
614
665
|
negative_prompt: z.ZodOptional<z.ZodString>;
|
|
615
666
|
width: z.ZodOptional<z.ZodNumber>;
|
|
@@ -697,13 +748,29 @@ export declare const videoStreamRequestSchema: z.ZodObject<{
|
|
|
697
748
|
}>>;
|
|
698
749
|
cache_preset: z.ZodOptional<z.ZodString>;
|
|
699
750
|
cache_threshold: z.ZodOptional<z.ZodNumber>;
|
|
751
|
+
mode: z.ZodEnum<{
|
|
752
|
+
txt2vid: "txt2vid";
|
|
753
|
+
img2vid: "img2vid";
|
|
754
|
+
}>;
|
|
755
|
+
init_image: z.ZodOptional<z.ZodString>;
|
|
756
|
+
strength: z.ZodOptional<z.ZodNumber>;
|
|
700
757
|
type: z.ZodLiteral<"videoStream">;
|
|
701
758
|
}, z.core.$strip>;
|
|
702
759
|
export type VideoStreamRequest = z.input<typeof videoStreamRequestSchema>;
|
|
703
|
-
type
|
|
704
|
-
export type VideoClientParams = VideoClientParamsBase & {
|
|
760
|
+
type VideoClientParamsCommon = Omit<VideoRequest, "requestId" | "mode" | "init_image" | "strength" | "control_frames"> & {
|
|
705
761
|
control_frames?: Uint8Array[];
|
|
706
762
|
};
|
|
763
|
+
export type VideoTxt2vidClientParams = VideoClientParamsCommon & {
|
|
764
|
+
mode: "txt2vid";
|
|
765
|
+
init_image?: never;
|
|
766
|
+
strength?: never;
|
|
767
|
+
};
|
|
768
|
+
export type VideoImg2vidClientParams = VideoClientParamsCommon & {
|
|
769
|
+
mode: "img2vid";
|
|
770
|
+
init_image: Uint8Array;
|
|
771
|
+
strength?: number;
|
|
772
|
+
};
|
|
773
|
+
export type VideoClientParams = VideoTxt2vidClientParams | VideoImg2vidClientParams;
|
|
707
774
|
export declare const upscaleStatsSchema: z.ZodObject<{
|
|
708
775
|
modelLoadMs: z.ZodOptional<z.ZodNumber>;
|
|
709
776
|
upscaleMs: z.ZodOptional<z.ZodNumber>;
|
|
@@ -89,6 +89,9 @@ export const sdcppConfigSchema = z
|
|
|
89
89
|
.describe("VAE decoder model — required for FLUX.2 [klein], optional for SDXL"),
|
|
90
90
|
highNoiseDiffusionModelSrc: modelSrcInputSchema.optional()
|
|
91
91
|
.describe("High-noise diffusion expert — required for Wan 2.2 mixture-of-experts video models"),
|
|
92
|
+
clipVisionModelSrc: modelSrcInputSchema.optional()
|
|
93
|
+
.describe("OpenCLIP ViT-H/14 weights (`clip_vision_h.safetensors`). Required for " +
|
|
94
|
+
"Wan image-to-video (`img2vid`); omit for text-to-video-only pipelines."),
|
|
92
95
|
upscaler: z.object({
|
|
93
96
|
type: z.literal("esrgan").optional()
|
|
94
97
|
.describe("Type of upscaler to use for post-generation upscaling when requested in diffusion({ upscale })."),
|
|
@@ -344,7 +347,7 @@ export const diffusionRequestSchema = z.object({
|
|
|
344
347
|
export const diffusionStreamRequestSchema = diffusionRequestSchema.extend({
|
|
345
348
|
type: z.literal("diffusionStream"),
|
|
346
349
|
});
|
|
347
|
-
|
|
350
|
+
const videoGenerationBaseSchema = z.object({
|
|
348
351
|
modelId: z
|
|
349
352
|
.string()
|
|
350
353
|
.describe("The identifier of the loaded video model to use for generation. " +
|
|
@@ -356,9 +359,6 @@ export const videoRequestSchema = z.object({
|
|
|
356
359
|
.min(1)
|
|
357
360
|
.optional()
|
|
358
361
|
.describe("Stable identifier for this in-flight video generation. Optional on the wire — the server falls back to a server-generated id when the field is missing."),
|
|
359
|
-
mode: z
|
|
360
|
-
.enum(["txt2vid"])
|
|
361
|
-
.describe("Video generation mode. Only `txt2vid` is supported today."),
|
|
362
362
|
prompt: z.string().describe("Positive prompt describing the video to generate."),
|
|
363
363
|
negative_prompt: z
|
|
364
364
|
.string()
|
|
@@ -368,16 +368,16 @@ export const videoRequestSchema = z.object({
|
|
|
368
368
|
.number()
|
|
369
369
|
.int()
|
|
370
370
|
.positive()
|
|
371
|
-
.multipleOf(
|
|
371
|
+
.multipleOf(16)
|
|
372
372
|
.optional()
|
|
373
|
-
.describe("Video width in pixels (must be a multiple of
|
|
373
|
+
.describe("Video width in pixels (must be a multiple of 16)."),
|
|
374
374
|
height: z
|
|
375
375
|
.number()
|
|
376
376
|
.int()
|
|
377
377
|
.positive()
|
|
378
|
-
.multipleOf(
|
|
378
|
+
.multipleOf(16)
|
|
379
379
|
.optional()
|
|
380
|
-
.describe("Video height in pixels (must be a multiple of
|
|
380
|
+
.describe("Video height in pixels (must be a multiple of 16)."),
|
|
381
381
|
video_frames: z
|
|
382
382
|
.number()
|
|
383
383
|
.int()
|
|
@@ -477,9 +477,55 @@ export const videoRequestSchema = z.object({
|
|
|
477
477
|
.optional()
|
|
478
478
|
.describe("Direct cache reuse threshold override."),
|
|
479
479
|
});
|
|
480
|
-
|
|
481
|
-
|
|
480
|
+
// Single wire object with mode-dependent rules expressed via a shared refine.
|
|
481
|
+
// Keeping the wire schema a plain object (instead of a discriminated union)
|
|
482
|
+
// lets the client builder construct the request without an `as` cast that
|
|
483
|
+
// would otherwise disable field-level type-checking. The compile-time
|
|
484
|
+
// "img2vid requires init_image" guarantee lives on the client-facing
|
|
485
|
+
// discriminated union types below.
|
|
486
|
+
const videoRequestObjectSchema = videoGenerationBaseSchema.extend({
|
|
487
|
+
mode: z
|
|
488
|
+
.enum(["txt2vid", "img2vid"])
|
|
489
|
+
.describe("Generation mode: 'txt2vid' (no source frame) or 'img2vid' (first-frame image)."),
|
|
490
|
+
init_image: base64StringSchema
|
|
491
|
+
.optional()
|
|
492
|
+
.describe("Base64-encoded first-frame image (PNG/JPEG). Required for img2vid; rejected for txt2vid."),
|
|
493
|
+
strength: z
|
|
494
|
+
.number()
|
|
495
|
+
.min(0)
|
|
496
|
+
.max(1)
|
|
497
|
+
.optional()
|
|
498
|
+
.describe("img2vid denoise strength in [0, 1]; rejected for txt2vid."),
|
|
482
499
|
});
|
|
500
|
+
function refineVideoMode(data, ctx) {
|
|
501
|
+
if (data.mode === "img2vid" && data.init_image === undefined) {
|
|
502
|
+
ctx.addIssue({
|
|
503
|
+
code: "custom",
|
|
504
|
+
path: ["init_image"],
|
|
505
|
+
message: "init_image is required when mode is 'img2vid'.",
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
if (data.mode === "txt2vid") {
|
|
509
|
+
if (data.init_image !== undefined) {
|
|
510
|
+
ctx.addIssue({
|
|
511
|
+
code: "custom",
|
|
512
|
+
path: ["init_image"],
|
|
513
|
+
message: "init_image is only valid for img2vid.",
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
if (data.strength !== undefined) {
|
|
517
|
+
ctx.addIssue({
|
|
518
|
+
code: "custom",
|
|
519
|
+
path: ["strength"],
|
|
520
|
+
message: "strength is only valid for img2vid.",
|
|
521
|
+
});
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
export const videoRequestSchema = videoRequestObjectSchema.superRefine(refineVideoMode);
|
|
526
|
+
export const videoStreamRequestSchema = videoRequestObjectSchema
|
|
527
|
+
.extend({ type: z.literal("videoStream") })
|
|
528
|
+
.superRefine(refineVideoMode);
|
|
483
529
|
// ============================================
|
|
484
530
|
// Standalone ESRGAN upscale (mode: "upscale")
|
|
485
531
|
// ============================================
|