@qvac/sdk 0.15.0 → 0.16.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 (102) hide show
  1. package/NOTICE +31 -45
  2. package/dist/client/api/ocr.d.ts +9 -0
  3. package/dist/client/api/ocr.js +9 -0
  4. package/dist/client/api/translate.js +6 -17
  5. package/dist/client/api/video.d.ts +7 -4
  6. package/dist/client/api/video.js +7 -4
  7. package/dist/client/api/vla.d.ts +14 -10
  8. package/dist/client/api/vla.js +14 -10
  9. package/dist/client/rpc/rpc-error.js +7 -1
  10. package/dist/examples/diffusion-ideogram.d.ts +2 -0
  11. package/dist/examples/diffusion-ideogram.js +108 -0
  12. package/dist/examples/diffusion-img2vid-ltx.d.ts +2 -0
  13. package/dist/examples/diffusion-img2vid-ltx.js +98 -0
  14. package/dist/examples/diffusion-txt2vid-ltx.d.ts +2 -0
  15. package/dist/examples/diffusion-txt2vid-ltx.js +92 -0
  16. package/dist/examples/logging-streaming.js +5 -1
  17. package/dist/examples/transcription/parakeet-tdt-filesystem-chunked.d.ts +2 -0
  18. package/dist/examples/transcription/parakeet-tdt-filesystem-chunked.js +203 -0
  19. package/dist/examples/vla-groot.d.ts +2 -0
  20. package/dist/examples/vla-groot.js +118 -0
  21. package/dist/models/registry/models.d.ts +5711 -9637
  22. package/dist/models/registry/models.js +2747 -6886
  23. package/dist/models/update-models/naming.js +5 -1
  24. package/dist/schemas/batch-completion-stream.d.ts +4 -4
  25. package/dist/schemas/common.d.ts +385 -4
  26. package/dist/schemas/common.js +3 -1
  27. package/dist/schemas/completion-stream.d.ts +186 -2
  28. package/dist/schemas/completion-stream.js +67 -0
  29. package/dist/schemas/constants-registry.d.ts +67 -0
  30. package/dist/schemas/constants-registry.js +51 -0
  31. package/dist/schemas/delete-cache.js +7 -3
  32. package/dist/schemas/engine-addon-map.d.ts +1 -0
  33. package/dist/schemas/engine-addon-map.js +1 -1
  34. package/dist/schemas/finetune.js +6 -3
  35. package/dist/schemas/get-loaded-model-info.d.ts +16 -0
  36. package/dist/schemas/get-loaded-model-info.js +14 -6
  37. package/dist/schemas/llamacpp-config.d.ts +24 -4
  38. package/dist/schemas/llamacpp-config.js +1 -6
  39. package/dist/schemas/load-model.d.ts +1380 -60
  40. package/dist/schemas/load-model.js +6 -3
  41. package/dist/schemas/plugin.d.ts +4 -4
  42. package/dist/schemas/plugin.js +4 -4
  43. package/dist/schemas/reload-config.js +3 -1
  44. package/dist/schemas/sdcpp-config.d.ts +239 -0
  45. package/dist/schemas/sdcpp-config.js +116 -10
  46. package/dist/schemas/sdk-config.d.ts +790 -40
  47. package/dist/schemas/sdk-errors-server.js +3 -1
  48. package/dist/schemas/text-to-speech.d.ts +14 -0
  49. package/dist/schemas/text-to-speech.js +10 -4
  50. package/dist/schemas/tools.d.ts +1 -1
  51. package/dist/schemas/tools.js +2 -1
  52. package/dist/schemas/translate.js +12 -6
  53. package/dist/schemas/vla.d.ts +10 -0
  54. package/dist/schemas/vla.js +31 -11
  55. package/dist/scripts/contract/build-contract.d.ts +38 -0
  56. package/dist/scripts/contract/build-contract.js +620 -0
  57. package/dist/scripts/contract/build-error-codes.d.ts +17 -0
  58. package/dist/scripts/contract/build-error-codes.js +17 -0
  59. package/dist/scripts/contract/build-model-type-maps.d.ts +22 -0
  60. package/dist/scripts/contract/build-model-type-maps.js +16 -0
  61. package/dist/scripts/contract/build-models-registry.d.ts +17 -0
  62. package/dist/scripts/contract/build-models-registry.js +31 -0
  63. package/dist/scripts/contract/plugin-contract.d.ts +23 -0
  64. package/dist/scripts/contract/plugin-contract.js +28 -0
  65. package/dist/scripts/export-contract.d.ts +2 -0
  66. package/dist/scripts/export-contract.js +27 -0
  67. package/dist/scripts/export-plugin-contract.d.ts +2 -0
  68. package/dist/scripts/export-plugin-contract.js +18 -0
  69. package/dist/server/bare/ops/translate.js +16 -3
  70. package/dist/server/bare/plugins/bci-whispercpp-transcription/plugin.d.ts +2 -1
  71. package/dist/server/bare/plugins/ggml-ocr/plugin.js +2 -23
  72. package/dist/server/bare/plugins/ggml-ocr/resolve-config.d.ts +6 -0
  73. package/dist/server/bare/plugins/ggml-ocr/resolve-config.js +73 -0
  74. package/dist/server/bare/plugins/ggml-vla/plugin.d.ts +5 -0
  75. package/dist/server/bare/plugins/ggml-vla/plugin.js +1 -1
  76. package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.js +11 -22
  77. package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-state.d.ts +8 -0
  78. package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-state.js +8 -0
  79. package/dist/server/bare/plugins/llamacpp-completion/plugin.d.ts +8 -3
  80. package/dist/server/bare/plugins/llamacpp-embedding/plugin.d.ts +6 -1
  81. package/dist/server/bare/plugins/sdcpp-generation/ops/video.d.ts +3 -1
  82. package/dist/server/bare/plugins/sdcpp-generation/ops/video.js +31 -2
  83. package/dist/server/bare/plugins/sdcpp-generation/plugin.d.ts +129 -1
  84. package/dist/server/bare/plugins/sdcpp-generation/plugin.js +94 -22
  85. package/dist/server/bare/plugins/tts-ggml/ops/text-to-speech.js +2 -16
  86. package/dist/server/bare/plugins/tts-ggml/plugin.d.ts +6 -0
  87. package/dist/server/bare/plugins/tts-ggml/plugin.js +3 -1
  88. package/dist/server/bare/types/addon-responses.d.ts +2 -0
  89. package/dist/server/bare/utils/tts-stats.d.ts +8 -4
  90. package/dist/server/bare/utils/tts-stats.js +6 -0
  91. package/dist/server/rpc/create-server.js +23 -1
  92. package/dist/server/rpc/handler-registry.js +5 -0
  93. package/dist/server/rpc/handlers/completion-orchestrate.d.ts +42 -0
  94. package/dist/server/rpc/handlers/completion-orchestrate.js +190 -0
  95. package/dist/server/rpc/handlers/get-loaded-model-info.js +8 -2
  96. package/dist/server/rpc/handlers/index.d.ts +2 -0
  97. package/dist/server/rpc/handlers/index.js +2 -0
  98. package/dist/server/rpc/method-shapes.d.ts +51 -0
  99. package/dist/server/rpc/method-shapes.js +48 -0
  100. package/dist/server/rpc/profiling/operation-metrics.js +20 -0
  101. package/dist/server/utils/cache/auto-history.js +13 -9
  102. package/package.json +16 -13
@@ -490,12 +490,14 @@ export const loadClassificationModelRequestSchema = commonModelConfigSchema
490
490
  })
491
491
  .strict();
492
492
  // Custom plugin catch-all: accepts any modelType string EXCEPT built-ins
493
- export const loadCustomPluginModelRequestSchema = commonModelConfigSchema.extend({
493
+ export const loadCustomPluginModelRequestSchema = commonModelConfigSchema
494
+ .extend({
494
495
  modelType: z.string().refine((val) => !builtInModelTypes.has(val), {
495
496
  message: 'Built-in model types must use their specific schema'
496
497
  }),
497
498
  modelConfig: z.record(z.string(), z.unknown()).optional()
498
- });
499
+ })
500
+ .meta({ title: 'LoadModelCustomPluginRequest' });
499
501
  // Union of all load model request types (using z.union since each modelType accepts multiple values)
500
502
  export const loadModelSrcRequestSchema = z
501
503
  .union([
@@ -515,7 +517,8 @@ export const loadModelSrcRequestSchema = z
515
517
  .transform((data) => ({
516
518
  ...data,
517
519
  seed: data.seed ?? false
518
- }));
520
+ }))
521
+ .meta({ title: 'LoadModelSrcRequest' });
519
522
  // Combined request schema: load new model OR reload config
520
523
  export const loadModelRequestSchema = z.union([
521
524
  loadModelSrcRequestSchema,
@@ -286,10 +286,10 @@ export declare const PLUGIN_OCR: "@qvac/sdk/ggml-ocr/plugin";
286
286
  */
287
287
  export declare const PLUGIN_DIFFUSION: "@qvac/sdk/sdcpp-generation/plugin";
288
288
  /**
289
- * Vision-Language-Action plugin (ggml). Supports SmolVLA and π₀.₅ (pi05),
290
- * dispatched on the GGUF `general.architecture` key.
289
+ * Vision-Language-Action plugin (ggml). Supports SmolVLA, π₀.₅ (pi05), and
290
+ * GR00T, dispatched on the GGUF `general.architecture` key.
291
291
  * Provides: robot-action inference from one or more camera frames (2 for
292
- * SmolVLA, 3 for π₀.₅) and a natural-language instruction.
292
+ * SmolVLA and GR00T, 3 for π₀.₅) and a natural-language instruction.
293
293
  */
294
294
  export declare const PLUGIN_VLA: "@qvac/sdk/ggml-vla/plugin";
295
295
  /**
@@ -326,7 +326,7 @@ export declare const ADDON_TTS: "@qvac/tts-ggml";
326
326
  export declare const ADDON_OCR: "@qvac/ocr-ggml";
327
327
  /** Native addon package for image generation (stable-diffusion.cpp) */
328
328
  export declare const ADDON_DIFFUSION: "@qvac/diffusion-cpp";
329
- /** Native addon package for vision-language-action inference (SmolVLA / π₀.₅ on ggml) */
329
+ /** Native addon package for vision-language-action inference (SmolVLA / π₀.₅ / GR00T on ggml) */
330
330
  export declare const ADDON_VLA: "@qvac/vla-ggml";
331
331
  /** Native addon package for image classification (GGML / MobileNetV3) */
332
332
  export declare const ADDON_CLASSIFICATION: "@qvac/classification-ggml";
@@ -172,10 +172,10 @@ export const PLUGIN_OCR = '@qvac/sdk/ggml-ocr/plugin';
172
172
  */
173
173
  export const PLUGIN_DIFFUSION = '@qvac/sdk/sdcpp-generation/plugin';
174
174
  /**
175
- * Vision-Language-Action plugin (ggml). Supports SmolVLA and π₀.₅ (pi05),
176
- * dispatched on the GGUF `general.architecture` key.
175
+ * Vision-Language-Action plugin (ggml). Supports SmolVLA, π₀.₅ (pi05), and
176
+ * GR00T, dispatched on the GGUF `general.architecture` key.
177
177
  * Provides: robot-action inference from one or more camera frames (2 for
178
- * SmolVLA, 3 for π₀.₅) and a natural-language instruction.
178
+ * SmolVLA and GR00T, 3 for π₀.₅) and a natural-language instruction.
179
179
  */
180
180
  export const PLUGIN_VLA = '@qvac/sdk/ggml-vla/plugin';
181
181
  /**
@@ -226,7 +226,7 @@ export const ADDON_TTS = '@qvac/tts-ggml';
226
226
  export const ADDON_OCR = '@qvac/ocr-ggml';
227
227
  /** Native addon package for image generation (stable-diffusion.cpp) */
228
228
  export const ADDON_DIFFUSION = '@qvac/diffusion-cpp';
229
- /** Native addon package for vision-language-action inference (SmolVLA / π₀.₅ on ggml) */
229
+ /** Native addon package for vision-language-action inference (SmolVLA / π₀.₅ / GR00T on ggml) */
230
230
  export const ADDON_VLA = '@qvac/vla-ggml';
231
231
  /** Native addon package for image classification (GGML / MobileNetV3) */
232
232
  export const ADDON_CLASSIFICATION = '@qvac/classification-ggml';
@@ -37,4 +37,6 @@ export const reloadConfigWhisperRequestSchema = reloadConfigRequestBaseSchema.ex
37
37
  modelConfig: whisperConfigSchema.partial()
38
38
  });
39
39
  // Using z.union since modelType accepts multiple values
40
- export const reloadConfigRequestSchema = z.union([reloadConfigWhisperRequestSchema]);
40
+ export const reloadConfigRequestSchema = z
41
+ .union([reloadConfigWhisperRequestSchema])
42
+ .meta({ title: 'ReloadConfigRequest' });
@@ -10,6 +10,10 @@ export declare const sdcppConfigSchema: z.ZodObject<{
10
10
  gpu: "gpu";
11
11
  cpu: "cpu";
12
12
  }>>;
13
+ 'main-gpu': z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodEnum<{
14
+ integrated: "integrated";
15
+ dedicated: "dedicated";
16
+ }>]>>;
13
17
  prediction: z.ZodOptional<z.ZodEnum<{
14
18
  auto: "auto";
15
19
  eps: "eps";
@@ -278,6 +282,43 @@ export declare const sdcppConfigSchema: z.ZodObject<{
278
282
  classification: "classification";
279
283
  }>, z.ZodLiteral<"vad">]>>;
280
284
  }, z.core.$strip>]>>;
285
+ uncondModelSrc: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
286
+ src: z.ZodString;
287
+ name: z.ZodOptional<z.ZodString>;
288
+ modelId: z.ZodOptional<z.ZodString>;
289
+ registryPath: z.ZodOptional<z.ZodString>;
290
+ registrySource: z.ZodOptional<z.ZodString>;
291
+ blobCoreKey: z.ZodOptional<z.ZodString>;
292
+ blobIndex: z.ZodOptional<z.ZodNumber>;
293
+ engine: z.ZodOptional<z.ZodString>;
294
+ expectedSize: z.ZodOptional<z.ZodNumber>;
295
+ sha256Checksum: z.ZodOptional<z.ZodString>;
296
+ addon: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
297
+ embeddings: "embeddings";
298
+ diffusion: "diffusion";
299
+ tts: "tts";
300
+ ocr: "ocr";
301
+ vla: "vla";
302
+ "llamacpp-completion": "llamacpp-completion";
303
+ "whispercpp-transcription": "whispercpp-transcription";
304
+ "bci-whispercpp-transcription": "bci-whispercpp-transcription";
305
+ "llamacpp-embedding": "llamacpp-embedding";
306
+ "nmtcpp-translation": "nmtcpp-translation";
307
+ "onnx-tts": "onnx-tts";
308
+ "tts-ggml": "tts-ggml";
309
+ "parakeet-transcription": "parakeet-transcription";
310
+ "ggml-ocr": "ggml-ocr";
311
+ "sdcpp-generation": "sdcpp-generation";
312
+ "ggml-vla": "ggml-vla";
313
+ "ggml-classification": "ggml-classification";
314
+ llm: "llm";
315
+ whisper: "whisper";
316
+ bci: "bci";
317
+ nmt: "nmt";
318
+ parakeet: "parakeet";
319
+ classification: "classification";
320
+ }>, z.ZodLiteral<"vad">]>>;
321
+ }, z.core.$strip>]>>;
281
322
  clipVisionModelSrc: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
282
323
  src: z.ZodString;
283
324
  name: z.ZodOptional<z.ZodString>;
@@ -315,6 +356,80 @@ export declare const sdcppConfigSchema: z.ZodObject<{
315
356
  classification: "classification";
316
357
  }>, z.ZodLiteral<"vad">]>>;
317
358
  }, z.core.$strip>]>>;
359
+ audioVaeModelSrc: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
360
+ src: z.ZodString;
361
+ name: z.ZodOptional<z.ZodString>;
362
+ modelId: z.ZodOptional<z.ZodString>;
363
+ registryPath: z.ZodOptional<z.ZodString>;
364
+ registrySource: z.ZodOptional<z.ZodString>;
365
+ blobCoreKey: z.ZodOptional<z.ZodString>;
366
+ blobIndex: z.ZodOptional<z.ZodNumber>;
367
+ engine: z.ZodOptional<z.ZodString>;
368
+ expectedSize: z.ZodOptional<z.ZodNumber>;
369
+ sha256Checksum: z.ZodOptional<z.ZodString>;
370
+ addon: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
371
+ embeddings: "embeddings";
372
+ diffusion: "diffusion";
373
+ tts: "tts";
374
+ ocr: "ocr";
375
+ vla: "vla";
376
+ "llamacpp-completion": "llamacpp-completion";
377
+ "whispercpp-transcription": "whispercpp-transcription";
378
+ "bci-whispercpp-transcription": "bci-whispercpp-transcription";
379
+ "llamacpp-embedding": "llamacpp-embedding";
380
+ "nmtcpp-translation": "nmtcpp-translation";
381
+ "onnx-tts": "onnx-tts";
382
+ "tts-ggml": "tts-ggml";
383
+ "parakeet-transcription": "parakeet-transcription";
384
+ "ggml-ocr": "ggml-ocr";
385
+ "sdcpp-generation": "sdcpp-generation";
386
+ "ggml-vla": "ggml-vla";
387
+ "ggml-classification": "ggml-classification";
388
+ llm: "llm";
389
+ whisper: "whisper";
390
+ bci: "bci";
391
+ nmt: "nmt";
392
+ parakeet: "parakeet";
393
+ classification: "classification";
394
+ }>, z.ZodLiteral<"vad">]>>;
395
+ }, z.core.$strip>]>>;
396
+ embeddingsConnectorsModelSrc: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
397
+ src: z.ZodString;
398
+ name: z.ZodOptional<z.ZodString>;
399
+ modelId: z.ZodOptional<z.ZodString>;
400
+ registryPath: z.ZodOptional<z.ZodString>;
401
+ registrySource: z.ZodOptional<z.ZodString>;
402
+ blobCoreKey: z.ZodOptional<z.ZodString>;
403
+ blobIndex: z.ZodOptional<z.ZodNumber>;
404
+ engine: z.ZodOptional<z.ZodString>;
405
+ expectedSize: z.ZodOptional<z.ZodNumber>;
406
+ sha256Checksum: z.ZodOptional<z.ZodString>;
407
+ addon: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
408
+ embeddings: "embeddings";
409
+ diffusion: "diffusion";
410
+ tts: "tts";
411
+ ocr: "ocr";
412
+ vla: "vla";
413
+ "llamacpp-completion": "llamacpp-completion";
414
+ "whispercpp-transcription": "whispercpp-transcription";
415
+ "bci-whispercpp-transcription": "bci-whispercpp-transcription";
416
+ "llamacpp-embedding": "llamacpp-embedding";
417
+ "nmtcpp-translation": "nmtcpp-translation";
418
+ "onnx-tts": "onnx-tts";
419
+ "tts-ggml": "tts-ggml";
420
+ "parakeet-transcription": "parakeet-transcription";
421
+ "ggml-ocr": "ggml-ocr";
422
+ "sdcpp-generation": "sdcpp-generation";
423
+ "ggml-vla": "ggml-vla";
424
+ "ggml-classification": "ggml-classification";
425
+ llm: "llm";
426
+ whisper: "whisper";
427
+ bci: "bci";
428
+ nmt: "nmt";
429
+ parakeet: "parakeet";
430
+ classification: "classification";
431
+ }>, z.ZodLiteral<"vad">]>>;
432
+ }, z.core.$strip>]>>;
318
433
  upscaler: z.ZodOptional<z.ZodObject<{
319
434
  type: z.ZodOptional<z.ZodLiteral<"esrgan">>;
320
435
  model_src: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
@@ -364,6 +479,11 @@ export type SdcppConfig = z.input<typeof sdcppConfigSchema>;
364
479
  export declare const diffusionStatsSchema: z.ZodObject<{
365
480
  modelLoadMs: z.ZodOptional<z.ZodNumber>;
366
481
  generationMs: z.ZodOptional<z.ZodNumber>;
482
+ conditionerMs: z.ZodOptional<z.ZodNumber>;
483
+ denoiseMs: z.ZodOptional<z.ZodNumber>;
484
+ vaeMs: z.ZodOptional<z.ZodNumber>;
485
+ postProcessMs: z.ZodOptional<z.ZodNumber>;
486
+ stepsPerSecond: z.ZodOptional<z.ZodNumber>;
367
487
  totalGenerationMs: z.ZodOptional<z.ZodNumber>;
368
488
  totalWallMs: z.ZodOptional<z.ZodNumber>;
369
489
  totalSteps: z.ZodOptional<z.ZodNumber>;
@@ -381,6 +501,11 @@ export declare const videoStatsSchema: z.ZodObject<{
381
501
  height: z.ZodOptional<z.ZodNumber>;
382
502
  modelLoadMs: z.ZodOptional<z.ZodNumber>;
383
503
  generationMs: z.ZodOptional<z.ZodNumber>;
504
+ conditionerMs: z.ZodOptional<z.ZodNumber>;
505
+ denoiseMs: z.ZodOptional<z.ZodNumber>;
506
+ vaeMs: z.ZodOptional<z.ZodNumber>;
507
+ postProcessMs: z.ZodOptional<z.ZodNumber>;
508
+ stepsPerSecond: z.ZodOptional<z.ZodNumber>;
384
509
  totalGenerationMs: z.ZodOptional<z.ZodNumber>;
385
510
  totalWallMs: z.ZodOptional<z.ZodNumber>;
386
511
  totalSteps: z.ZodOptional<z.ZodNumber>;
@@ -391,6 +516,8 @@ export declare const videoStatsSchema: z.ZodObject<{
391
516
  totalVideoFrames: z.ZodOptional<z.ZodNumber>;
392
517
  videoFrames: z.ZodOptional<z.ZodNumber>;
393
518
  fps: z.ZodOptional<z.ZodNumber>;
519
+ hasAudio: z.ZodOptional<z.ZodBoolean>;
520
+ audioSampleRate: z.ZodOptional<z.ZodNumber>;
394
521
  }, z.core.$strip>;
395
522
  export type VideoStats = z.infer<typeof videoStatsSchema>;
396
523
  export declare const diffusionStreamResponseSchema: z.ZodObject<{
@@ -404,6 +531,11 @@ export declare const diffusionStreamResponseSchema: z.ZodObject<{
404
531
  stats: z.ZodOptional<z.ZodObject<{
405
532
  modelLoadMs: z.ZodOptional<z.ZodNumber>;
406
533
  generationMs: z.ZodOptional<z.ZodNumber>;
534
+ conditionerMs: z.ZodOptional<z.ZodNumber>;
535
+ denoiseMs: z.ZodOptional<z.ZodNumber>;
536
+ vaeMs: z.ZodOptional<z.ZodNumber>;
537
+ postProcessMs: z.ZodOptional<z.ZodNumber>;
538
+ stepsPerSecond: z.ZodOptional<z.ZodNumber>;
407
539
  totalGenerationMs: z.ZodOptional<z.ZodNumber>;
408
540
  totalWallMs: z.ZodOptional<z.ZodNumber>;
409
541
  totalSteps: z.ZodOptional<z.ZodNumber>;
@@ -430,6 +562,11 @@ export declare const videoStreamResponseSchema: z.ZodObject<{
430
562
  height: z.ZodOptional<z.ZodNumber>;
431
563
  modelLoadMs: z.ZodOptional<z.ZodNumber>;
432
564
  generationMs: z.ZodOptional<z.ZodNumber>;
565
+ conditionerMs: z.ZodOptional<z.ZodNumber>;
566
+ denoiseMs: z.ZodOptional<z.ZodNumber>;
567
+ vaeMs: z.ZodOptional<z.ZodNumber>;
568
+ postProcessMs: z.ZodOptional<z.ZodNumber>;
569
+ stepsPerSecond: z.ZodOptional<z.ZodNumber>;
433
570
  totalGenerationMs: z.ZodOptional<z.ZodNumber>;
434
571
  totalWallMs: z.ZodOptional<z.ZodNumber>;
435
572
  totalSteps: z.ZodOptional<z.ZodNumber>;
@@ -440,6 +577,8 @@ export declare const videoStreamResponseSchema: z.ZodObject<{
440
577
  totalVideoFrames: z.ZodOptional<z.ZodNumber>;
441
578
  videoFrames: z.ZodOptional<z.ZodNumber>;
442
579
  fps: z.ZodOptional<z.ZodNumber>;
580
+ hasAudio: z.ZodOptional<z.ZodBoolean>;
581
+ audioSampleRate: z.ZodOptional<z.ZodNumber>;
443
582
  }, z.core.$strip>>;
444
583
  }, z.core.$strip>;
445
584
  export type VideoStreamResponse = z.infer<typeof videoStreamResponseSchema>;
@@ -640,6 +779,105 @@ export declare const videoRequestSchema: z.ZodObject<{
640
779
  vae_tiling: z.ZodOptional<z.ZodBoolean>;
641
780
  vae_tile_size: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
642
781
  vae_tile_overlap: z.ZodOptional<z.ZodNumber>;
782
+ temporal_tiling: z.ZodOptional<z.ZodBoolean>;
783
+ cache_mode: z.ZodOptional<z.ZodEnum<{
784
+ disabled: "disabled";
785
+ easycache: "easycache";
786
+ ucache: "ucache";
787
+ dbcache: "dbcache";
788
+ taylorseer: "taylorseer";
789
+ "cache-dit": "cache-dit";
790
+ }>>;
791
+ cache_preset: z.ZodOptional<z.ZodString>;
792
+ cache_threshold: z.ZodOptional<z.ZodNumber>;
793
+ mode: z.ZodEnum<{
794
+ txt2vid: "txt2vid";
795
+ img2vid: "img2vid";
796
+ }>;
797
+ init_image: z.ZodOptional<z.ZodString>;
798
+ strength: z.ZodOptional<z.ZodNumber>;
799
+ }, z.core.$strip>;
800
+ export declare const ltxVideoRequestSchema: z.ZodObject<{
801
+ modelId: z.ZodString;
802
+ requestId: z.ZodOptional<z.ZodString>;
803
+ prompt: z.ZodString;
804
+ negative_prompt: z.ZodOptional<z.ZodString>;
805
+ width: z.ZodOptional<z.ZodNumber>;
806
+ height: z.ZodOptional<z.ZodNumber>;
807
+ video_frames: z.ZodOptional<z.ZodNumber>;
808
+ fps: z.ZodOptional<z.ZodNumber>;
809
+ seed: z.ZodOptional<z.ZodNumber>;
810
+ steps: z.ZodOptional<z.ZodNumber>;
811
+ sampling_method: z.ZodOptional<z.ZodEnum<{
812
+ euler: "euler";
813
+ euler_a: "euler_a";
814
+ heun: "heun";
815
+ dpm2: "dpm2";
816
+ "dpm++2m": "dpm++2m";
817
+ "dpm++2mv2": "dpm++2mv2";
818
+ "dpm++2s_a": "dpm++2s_a";
819
+ lcm: "lcm";
820
+ ipndm: "ipndm";
821
+ ipndm_v: "ipndm_v";
822
+ ddim_trailing: "ddim_trailing";
823
+ tcd: "tcd";
824
+ res_multistep: "res_multistep";
825
+ res_2s: "res_2s";
826
+ }>>;
827
+ scheduler: z.ZodOptional<z.ZodEnum<{
828
+ lcm: "lcm";
829
+ discrete: "discrete";
830
+ karras: "karras";
831
+ exponential: "exponential";
832
+ ays: "ays";
833
+ gits: "gits";
834
+ sgm_uniform: "sgm_uniform";
835
+ simple: "simple";
836
+ smoothstep: "smoothstep";
837
+ kl_optimal: "kl_optimal";
838
+ bong_tangent: "bong_tangent";
839
+ }>>;
840
+ cfg_scale: z.ZodOptional<z.ZodNumber>;
841
+ flow_shift: z.ZodOptional<z.ZodNumber>;
842
+ high_noise_steps: z.ZodOptional<z.ZodNumber>;
843
+ high_noise_sampler: z.ZodOptional<z.ZodEnum<{
844
+ euler: "euler";
845
+ euler_a: "euler_a";
846
+ heun: "heun";
847
+ dpm2: "dpm2";
848
+ "dpm++2m": "dpm++2m";
849
+ "dpm++2mv2": "dpm++2mv2";
850
+ "dpm++2s_a": "dpm++2s_a";
851
+ lcm: "lcm";
852
+ ipndm: "ipndm";
853
+ ipndm_v: "ipndm_v";
854
+ ddim_trailing: "ddim_trailing";
855
+ tcd: "tcd";
856
+ res_multistep: "res_multistep";
857
+ res_2s: "res_2s";
858
+ }>>;
859
+ high_noise_scheduler: z.ZodOptional<z.ZodEnum<{
860
+ lcm: "lcm";
861
+ discrete: "discrete";
862
+ karras: "karras";
863
+ exponential: "exponential";
864
+ ays: "ays";
865
+ gits: "gits";
866
+ sgm_uniform: "sgm_uniform";
867
+ simple: "simple";
868
+ smoothstep: "smoothstep";
869
+ kl_optimal: "kl_optimal";
870
+ bong_tangent: "bong_tangent";
871
+ }>>;
872
+ high_noise_cfg_scale: z.ZodOptional<z.ZodNumber>;
873
+ high_noise_flow_shift: z.ZodOptional<z.ZodNumber>;
874
+ moe_boundary: z.ZodOptional<z.ZodNumber>;
875
+ vace_strength: z.ZodOptional<z.ZodNumber>;
876
+ control_frames: z.ZodOptional<z.ZodArray<z.ZodString>>;
877
+ vae_tiling: z.ZodOptional<z.ZodBoolean>;
878
+ vae_tile_size: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
879
+ vae_tile_overlap: z.ZodOptional<z.ZodNumber>;
880
+ temporal_tiling: z.ZodOptional<z.ZodBoolean>;
643
881
  cache_mode: z.ZodOptional<z.ZodEnum<{
644
882
  disabled: "disabled";
645
883
  easycache: "easycache";
@@ -738,6 +976,7 @@ export declare const videoStreamRequestSchema: z.ZodObject<{
738
976
  vae_tiling: z.ZodOptional<z.ZodBoolean>;
739
977
  vae_tile_size: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
740
978
  vae_tile_overlap: z.ZodOptional<z.ZodNumber>;
979
+ temporal_tiling: z.ZodOptional<z.ZodBoolean>;
741
980
  cache_mode: z.ZodOptional<z.ZodEnum<{
742
981
  disabled: "disabled";
743
982
  easycache: "easycache";
@@ -46,17 +46,35 @@ export const sdcppConfigSchema = z.object({
46
46
  .default('diffusion')
47
47
  .describe('Operation mode for the diffusion plugin. ' +
48
48
  "`'diffusion'` (default) builds a full SD / SDXL / SD3 / FLUX pipeline from " +
49
- 'the primary model plus optional auxiliary text encoders, VAE, and ESRGAN ' +
49
+ 'the primary model plus optional auxiliary text encoders, VAE, unconditional ' +
50
+ 'diffusion model, and ESRGAN ' +
50
51
  'upscaler, and exposes diffusion({ ... }). ' +
51
52
  "`'upscale'` builds a standalone ESRGAN upscaler from the primary model " +
52
53
  'file alone (auxiliary model sources are ignored) and exposes upscale({ ... }). ' +
53
- "`'video'` builds a Wan `VideoStableDiffusion` pipeline and exposes video({ ... }). " +
54
+ "`'video'` builds a `VideoStableDiffusion` pipeline and exposes video({ ... }). " +
55
+ 'The video layout is selected from the auxiliary sources: supplying ' +
56
+ '`embeddingsConnectorsModelSrc` loads the LTX-2 layout (Gemma text encoder ' +
57
+ 'via `llmModelSrc` + video VAE + connectors, optional `audioVaeModelSrc` for ' +
58
+ 'synchronized audio); otherwise the Wan layout is used (UMT5 text encoder ' +
59
+ 'via `t5XxlModelSrc` + VAE). ' +
54
60
  'On React Native, loading the video model on-device will likely fail ' +
55
61
  'because the video diffusion models currently ' +
56
62
  'shipped by the SDK are too large to load on typical mobile devices; ' +
57
63
  'pass a `delegate` to `loadModel(...)` to run generation on a desktop peer instead.'),
58
64
  threads: z.number().optional(),
59
65
  device: z.enum(['gpu', 'cpu']).optional(),
66
+ 'main-gpu': z
67
+ .union([z.number().int().min(0), z.enum(['integrated', 'dedicated'])])
68
+ .optional()
69
+ .describe('GPU to pin when `device` is "gpu": a GPU-device index, "integrated", or ' +
70
+ '"dedicated" (the discrete GPU with the most VRAM). Omit to let the ' +
71
+ 'backend choose the first enumerated device. Resolved against the ' +
72
+ "addon's own ggml device enumeration, so it cannot desync from the " +
73
+ 'device list the backend actually uses. If an explicit request cannot ' +
74
+ 'be satisfied (e.g. "integrated" with no integrated GPU, "dedicated" ' +
75
+ 'with no discrete GPU, or an out-of-range index) the addon falls back ' +
76
+ 'to CPU rather than substituting a different GPU. Stripped on mobile ' +
77
+ '(single-GPU devices).'),
60
78
  prediction: z
61
79
  .enum(['auto', 'eps', 'v', 'edm_v', 'flow', 'flux2_flow'])
62
80
  .optional()
@@ -116,17 +134,37 @@ export const sdcppConfigSchema = z.object({
116
134
  .describe('T5-XXL text encoder model — required for SD3'),
117
135
  llmModelSrc: modelSrcInputSchema
118
136
  .optional()
119
- .describe('LLM text encoder model (e.g. Qwen3) — required for FLUX.2 [klein]'),
137
+ .describe('LLM text encoder model — required for FLUX.2 [klein] (Qwen3), ' +
138
+ 'Ideogram 4 (Qwen3-VL), and LTX-2 video (Gemma).'),
120
139
  vaeModelSrc: modelSrcInputSchema
121
140
  .optional()
122
- .describe('VAE decoder model — required for FLUX.2 [klein], optional for SDXL'),
141
+ .describe('VAE decoder model — required for FLUX.2 [klein], Ideogram 4, and ' +
142
+ 'LTX-2 video (video VAE); optional for SDXL.'),
123
143
  highNoiseDiffusionModelSrc: modelSrcInputSchema
124
144
  .optional()
125
145
  .describe('High-noise diffusion expert — required for Wan 2.2 mixture-of-experts video models'),
146
+ uncondModelSrc: modelSrcInputSchema
147
+ .optional()
148
+ .describe('Unconditional diffusion model — Ideogram 4 only. Requires diffusion mode, ' +
149
+ 'llmModelSrc (Qwen3-VL), vaeModelSrc, and a JSON-serialized structured ' +
150
+ 'caption with explicit bounding boxes as the generation prompt. Plain-text ' +
151
+ "prompts produce degenerate output or the model's placeholder response."),
126
152
  clipVisionModelSrc: modelSrcInputSchema
127
153
  .optional()
128
154
  .describe('OpenCLIP ViT-H/14 weights (`clip_vision_h.safetensors`). Required for ' +
129
- 'Wan image-to-video (`img2vid`); omit for text-to-video-only pipelines.'),
155
+ 'Wan image-to-video (`img2vid`); omit for text-to-video-only pipelines. ' +
156
+ 'Not used by LTX-2 (its img2vid path needs no CLIP-vision projection).'),
157
+ audioVaeModelSrc: modelSrcInputSchema
158
+ .optional()
159
+ .describe('Audio VAE decoder model — LTX-2 video only. Enables the synchronized ' +
160
+ '48 kHz audio track muxed into the output AVI; omit for silent video. ' +
161
+ 'Ignored by the Wan layout.'),
162
+ embeddingsConnectorsModelSrc: modelSrcInputSchema
163
+ .optional()
164
+ .describe('Text-embedding connector weights — required for LTX-2 video. Its ' +
165
+ 'presence selects the LTX-2 video layout (Gemma text encoder via ' +
166
+ '`llmModelSrc` + video VAE via `vaeModelSrc` + these connectors) instead ' +
167
+ 'of the Wan layout.'),
130
168
  upscaler: z
131
169
  .object({
132
170
  type: z
@@ -182,7 +220,27 @@ export const diffusionStatsSchema = z.object({
182
220
  generationMs: z
183
221
  .number()
184
222
  .optional()
185
- .describe('Wall-clock time in milliseconds spent generating images.'),
223
+ .describe('Wall-clock time in milliseconds spent generating the output.'),
224
+ conditionerMs: z
225
+ .number()
226
+ .optional()
227
+ .describe('Time in milliseconds spent conditioning the prompt before denoising.'),
228
+ denoiseMs: z
229
+ .number()
230
+ .optional()
231
+ .describe('Time in milliseconds spent in the diffusion denoising loop.'),
232
+ vaeMs: z
233
+ .number()
234
+ .optional()
235
+ .describe('Time in milliseconds spent decoding diffusion latents with the VAE.'),
236
+ postProcessMs: z
237
+ .number()
238
+ .optional()
239
+ .describe('Time in milliseconds spent encoding, upscaling, muxing, and emitting outputs.'),
240
+ stepsPerSecond: z
241
+ .number()
242
+ .optional()
243
+ .describe('Diffusion denoising throughput in sampling steps per second.'),
186
244
  totalGenerationMs: z
187
245
  .number()
188
246
  .optional()
@@ -209,6 +267,11 @@ export const videoStatsSchema = diffusionStatsSchema
209
267
  .pick({
210
268
  modelLoadMs: true,
211
269
  generationMs: true,
270
+ conditionerMs: true,
271
+ denoiseMs: true,
272
+ vaeMs: true,
273
+ postProcessMs: true,
274
+ stepsPerSecond: true,
212
275
  totalGenerationMs: true,
213
276
  totalWallMs: true,
214
277
  totalSteps: true,
@@ -226,7 +289,16 @@ export const videoStatsSchema = diffusionStatsSchema
226
289
  fps: z
227
290
  .number()
228
291
  .optional()
229
- .describe('Frames-per-second metadata for the most recent generated video.')
292
+ .describe('Frames-per-second metadata for the most recent generated video.'),
293
+ hasAudio: z
294
+ .boolean()
295
+ .optional()
296
+ .describe('True when the output AVI includes a muxed audio track (LTX-2 loaded ' +
297
+ 'with audioVaeModelSrc), false otherwise.'),
298
+ audioSampleRate: z
299
+ .number()
300
+ .optional()
301
+ .describe('Sample rate (Hz) of the muxed audio track; 0 when there is no audio.')
230
302
  });
231
303
  export const diffusionStreamResponseSchema = z.object({
232
304
  type: z.literal('diffusionStream'),
@@ -395,14 +467,16 @@ const videoGenerationBaseSchema = z.object({
395
467
  .positive()
396
468
  .multipleOf(16)
397
469
  .optional()
398
- .describe('Video width in pixels (must be a multiple of 16).'),
470
+ .describe('Video width in pixels (must be a multiple of 16). LTX-2 additionally ' +
471
+ 'requires a multiple of 32, validated against the loaded model before generation.'),
399
472
  height: z
400
473
  .number()
401
474
  .int()
402
475
  .positive()
403
476
  .multipleOf(16)
404
477
  .optional()
405
- .describe('Video height in pixels (must be a multiple of 16).'),
478
+ .describe('Video height in pixels (must be a multiple of 16). LTX-2 additionally ' +
479
+ 'requires a multiple of 32, validated against the loaded model before generation.'),
406
480
  video_frames: z
407
481
  .number()
408
482
  .int()
@@ -410,7 +484,9 @@ const videoGenerationBaseSchema = z.object({
410
484
  message: 'video_frames must be an integer >= 5 of the form (4*k + 1)'
411
485
  })
412
486
  .optional()
413
- .describe('Frame count for the generated video; must satisfy (4*k + 1), where k>=1.'),
487
+ .describe('Frame count for the generated video; must satisfy (4*k + 1), where k>=1. ' +
488
+ 'LTX-2 additionally requires the stricter (8*k + 1) with a max of 257, ' +
489
+ 'validated against the loaded model before generation.'),
414
490
  fps: z
415
491
  .number()
416
492
  .positive()
@@ -474,6 +550,11 @@ const videoGenerationBaseSchema = z.object({
474
550
  .optional()
475
551
  .describe('VAE tile size override.'),
476
552
  vae_tile_overlap: z.number().optional().describe('VAE tile overlap override.'),
553
+ temporal_tiling: z
554
+ .boolean()
555
+ .optional()
556
+ .describe('LTX-2 only: tile the video VAE decode along the time axis to cap peak ' +
557
+ 'VRAM for HD / long clips. No effect on Wan (spatial-only VAE).'),
477
558
  cache_mode: cacheModeSchema.optional().describe('Step-caching algorithm.'),
478
559
  cache_preset: z
479
560
  .string()
@@ -527,6 +608,31 @@ function refineVideoMode(data, ctx) {
527
608
  }
528
609
  }
529
610
  export const videoRequestSchema = videoRequestObjectSchema.superRefine(refineVideoMode);
611
+ function refineLtxVideoRequest(data, ctx) {
612
+ if (data.width !== undefined && data.width % 32 !== 0) {
613
+ ctx.addIssue({
614
+ code: 'custom',
615
+ path: ['width'],
616
+ message: 'LTX-2 width must be a multiple of 32.'
617
+ });
618
+ }
619
+ if (data.height !== undefined && data.height % 32 !== 0) {
620
+ ctx.addIssue({
621
+ code: 'custom',
622
+ path: ['height'],
623
+ message: 'LTX-2 height must be a multiple of 32.'
624
+ });
625
+ }
626
+ if (data.video_frames !== undefined &&
627
+ (data.video_frames > 257 || (data.video_frames - 1) % 8 !== 0)) {
628
+ ctx.addIssue({
629
+ code: 'custom',
630
+ path: ['video_frames'],
631
+ message: 'LTX-2 video_frames must be at most 257 and satisfy (8*k + 1), where k>=1.'
632
+ });
633
+ }
634
+ }
635
+ export const ltxVideoRequestSchema = videoRequestSchema.superRefine(refineLtxVideoRequest);
530
636
  export const videoStreamRequestSchema = videoRequestObjectSchema
531
637
  .extend({ type: z.literal('videoStream') })
532
638
  .superRefine(refineVideoMode);