@qvac/sdk 0.14.1 → 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.
- package/NOTICE +47 -45
- package/README.md +34 -35
- package/dist/client/api/batch-completion.d.ts +15 -0
- package/dist/client/api/batch-completion.js +332 -0
- package/dist/client/api/bci-transcribe.d.ts +1 -1
- package/dist/client/api/bci-transcribe.js +31 -31
- package/dist/client/api/cancel.d.ts +1 -1
- package/dist/client/api/cancel.js +18 -18
- package/dist/client/api/classify.d.ts +1 -1
- package/dist/client/api/classify.js +9 -6
- package/dist/client/api/client-request-id.js +1 -1
- package/dist/client/api/completion-stream.d.ts +3 -3
- package/dist/client/api/completion-stream.js +18 -18
- package/dist/client/api/delete-cache.js +9 -9
- package/dist/client/api/diffusion.d.ts +1 -1
- package/dist/client/api/diffusion.js +17 -11
- package/dist/client/api/download-asset.d.ts +1 -1
- package/dist/client/api/download-asset.js +11 -11
- package/dist/client/api/embed.d.ts +1 -1
- package/dist/client/api/embed.js +10 -10
- package/dist/client/api/finetune.d.ts +1 -1
- package/dist/client/api/finetune.js +25 -27
- package/dist/client/api/get-loaded-model-info.d.ts +2 -2
- package/dist/client/api/get-loaded-model-info.js +8 -8
- package/dist/client/api/get-model-info.d.ts +1 -1
- package/dist/client/api/get-model-info.js +7 -7
- package/dist/client/api/heartbeat.d.ts +2 -2
- package/dist/client/api/heartbeat.js +7 -7
- package/dist/client/api/index.d.ts +33 -32
- package/dist/client/api/index.js +33 -32
- package/dist/client/api/invoke-plugin.d.ts +1 -1
- package/dist/client/api/invoke-plugin.js +10 -10
- package/dist/client/api/load-model.d.ts +1 -1
- package/dist/client/api/load-model.js +32 -32
- package/dist/client/api/logging-stream.d.ts +1 -1
- package/dist/client/api/logging-stream.js +6 -6
- package/dist/client/api/ocr.d.ts +10 -1
- package/dist/client/api/ocr.js +20 -11
- package/dist/client/api/provide.d.ts +1 -1
- package/dist/client/api/provide.js +7 -7
- package/dist/client/api/rag.d.ts +1 -1
- package/dist/client/api/rag.js +65 -66
- package/dist/client/api/registry.d.ts +1 -1
- package/dist/client/api/registry.js +8 -8
- package/dist/client/api/resume.js +5 -5
- package/dist/client/api/state.d.ts +1 -1
- package/dist/client/api/state.js +5 -5
- package/dist/client/api/stop-provider.js +6 -6
- package/dist/client/api/subscribe-logs.d.ts +1 -1
- package/dist/client/api/subscribe-logs.js +3 -3
- package/dist/client/api/suspend.js +5 -5
- package/dist/client/api/text-to-speech.d.ts +1 -1
- package/dist/client/api/text-to-speech.js +37 -39
- package/dist/client/api/transcribe.d.ts +2 -2
- package/dist/client/api/transcribe.js +44 -45
- package/dist/client/api/translate.d.ts +1 -1
- package/dist/client/api/translate.js +14 -25
- package/dist/client/api/unload-model.d.ts +1 -1
- package/dist/client/api/unload-model.js +11 -11
- package/dist/client/api/upscale.d.ts +1 -1
- package/dist/client/api/upscale.js +9 -9
- package/dist/client/api/video.d.ts +8 -5
- package/dist/client/api/video.js +23 -18
- package/dist/client/api/vla-helpers.d.ts +2 -2
- package/dist/client/api/vla-helpers.js +6 -11
- package/dist/client/api/vla.d.ts +15 -11
- package/dist/client/api/vla.js +27 -23
- package/dist/client/config-loader/config-utils.d.ts +1 -1
- package/dist/client/config-loader/config-utils.js +3 -3
- package/dist/client/config-loader/resolve-config.bare.d.ts +1 -1
- package/dist/client/config-loader/resolve-config.bare.js +11 -11
- package/dist/client/config-loader/resolve-config.expo.d.ts +1 -1
- package/dist/client/config-loader/resolve-config.expo.js +6 -6
- package/dist/client/config-loader/resolve-config.node.d.ts +1 -1
- package/dist/client/config-loader/resolve-config.node.js +27 -27
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/init-hooks.d.ts +1 -1
- package/dist/client/init-hooks.js +12 -12
- package/dist/client/logging-stream-registry.d.ts +1 -1
- package/dist/client/logging-stream-registry.js +6 -6
- package/dist/client/parse-input.d.ts +1 -1
- package/dist/client/parse-input.js +3 -3
- package/dist/client/plugins-factory.d.ts +2 -2
- package/dist/client/plugins-factory.js +2 -2
- package/dist/client/rpc/bare-client.d.ts +2 -1
- package/dist/client/rpc/bare-client.js +37 -39
- package/dist/client/rpc/ensure-worker-ready.js +4 -4
- package/dist/client/rpc/expo-device-info.d.ts +1 -1
- package/dist/client/rpc/expo-device-info.js +11 -11
- package/dist/client/rpc/expo-rpc-client.d.ts +2 -1
- package/dist/client/rpc/expo-rpc-client.js +38 -47
- package/dist/client/rpc/node-rpc-client.d.ts +2 -1
- package/dist/client/rpc/node-rpc-client.js +103 -75
- package/dist/client/rpc/profiling/index.d.ts +1 -1
- package/dist/client/rpc/profiling/index.js +1 -1
- package/dist/client/rpc/profiling/profiler.d.ts +2 -2
- package/dist/client/rpc/profiling/profiler.js +31 -34
- package/dist/client/rpc/rpc-client.d.ts +2 -2
- package/dist/client/rpc/rpc-client.js +113 -72
- package/dist/client/rpc/rpc-error.d.ts +1 -1
- package/dist/client/rpc/rpc-error.js +19 -13
- package/dist/commands/bundle/bare-pack.d.ts +1 -1
- package/dist/commands/bundle/bare-pack.js +20 -20
- package/dist/commands/bundle/constants.js +21 -21
- package/dist/commands/bundle/entry-gen.js +4 -4
- package/dist/commands/bundle/index.js +45 -47
- package/dist/commands/bundle/manifest.d.ts +1 -1
- package/dist/commands/bundle/manifest.js +44 -46
- package/dist/commands/bundle/plugins.d.ts +2 -2
- package/dist/commands/bundle/plugins.js +7 -7
- package/dist/commands/bundle/resolve-sdk-import.js +6 -13
- package/dist/commands/index.d.ts +4 -4
- package/dist/commands/index.js +2 -2
- package/dist/commands/verify/abi.d.ts +9 -9
- package/dist/commands/verify/abi.js +31 -31
- package/dist/commands/verify/addon-source.d.ts +1 -1
- package/dist/commands/verify/addon-source.js +13 -14
- package/dist/commands/verify/bundle-source.d.ts +1 -1
- package/dist/commands/verify/bundle-source.js +7 -7
- package/dist/commands/verify/index.d.ts +3 -3
- package/dist/commands/verify/index.js +18 -17
- package/dist/commands/verify/node-modules-source.d.ts +1 -1
- package/dist/commands/verify/node-modules-source.js +11 -11
- package/dist/commands/verify/prebuilds.d.ts +3 -3
- package/dist/commands/verify/prebuilds.js +8 -8
- package/dist/constants/audio.d.ts +1 -1
- package/dist/constants/audio.js +1 -1
- package/dist/constants/index.d.ts +2 -2
- package/dist/constants/index.js +2 -2
- package/dist/constants/registry.js +1 -1
- package/dist/examples/audio/mic-input.d.ts +1 -1
- package/dist/examples/audio/mic-input.js +31 -31
- package/dist/examples/batch-completion.d.ts +38 -0
- package/dist/examples/batch-completion.js +100 -0
- package/dist/examples/bci/bci-filesystem-streaming.js +20 -20
- package/dist/examples/bci/bci-filesystem.js +17 -17
- package/dist/examples/cache-management.js +32 -32
- package/dist/examples/cancel-by-request-id.js +11 -11
- package/dist/examples/classification/classify-image.js +5 -5
- package/dist/examples/completion-events.js +16 -18
- package/dist/examples/completion-stop-reason.js +13 -13
- package/dist/examples/concurrent-completion-collision.js +20 -20
- package/dist/examples/config/blind-relay/blind-relay.config.js +4 -4
- package/dist/examples/config/default/default.config.js +2 -2
- package/dist/examples/config/plugins/plugins.config.js +2 -2
- package/dist/examples/config-reload.js +14 -14
- package/dist/examples/default-config-usage.js +10 -13
- package/dist/examples/delegated-inference/composite.js +23 -23
- package/dist/examples/delegated-inference/consumer-profiled.js +19 -19
- package/dist/examples/delegated-inference/consumer.js +11 -11
- package/dist/examples/delegated-inference/provider.js +24 -24
- package/dist/examples/diffusion-esrgan-upscale.js +19 -19
- package/dist/examples/diffusion-flux2-klein-img2img.js +17 -17
- package/dist/examples/diffusion-flux2-klein.js +14 -14
- package/dist/examples/diffusion-ideogram.d.ts +2 -0
- package/dist/examples/diffusion-ideogram.js +108 -0
- package/dist/examples/diffusion-img2img.js +13 -13
- package/dist/examples/diffusion-img2vid-ltx.d.ts +2 -0
- package/dist/examples/diffusion-img2vid-ltx.js +98 -0
- package/dist/examples/diffusion-img2vid.js +22 -23
- package/dist/examples/diffusion-simple.js +7 -7
- package/dist/examples/diffusion-txt2img.js +13 -14
- package/dist/examples/diffusion-txt2vid-ltx.d.ts +2 -0
- package/dist/examples/diffusion-txt2vid-ltx.js +92 -0
- package/dist/examples/diffusion-txt2vid.js +18 -18
- package/dist/examples/download-with-blind-relays.js +7 -8
- package/dist/examples/download-with-cancel.js +9 -9
- package/dist/examples/embed-multi-gpu.js +9 -9
- package/dist/examples/embed-p2p.js +24 -24
- package/dist/examples/finetune/llamacpp-finetune.js +21 -21
- package/dist/examples/kv-cache-cleanup.js +34 -34
- package/dist/examples/kv-cache-custom-key.js +30 -30
- package/dist/examples/kv-cache-example.js +18 -20
- package/dist/examples/llamacpp-cache.js +33 -33
- package/dist/examples/llamacpp-dynamic-tools.js +38 -38
- package/dist/examples/llamacpp-filesystem.js +13 -15
- package/dist/examples/llamacpp-http.js +12 -14
- package/dist/examples/llamacpp-multi-gpu.js +12 -12
- package/dist/examples/llamacpp-multimodal.js +16 -16
- package/dist/examples/llamacpp-p2p.js +11 -11
- package/dist/examples/llamacpp-sharded.js +12 -12
- package/dist/examples/llamacpp-structured-output.js +37 -37
- package/dist/examples/logging-file-transport.js +19 -21
- package/dist/examples/logging-global.js +8 -8
- package/dist/examples/logging-streaming.js +19 -17
- package/dist/examples/mcp-websearch.js +44 -44
- package/dist/examples/multi-model-demo.js +33 -33
- package/dist/examples/ocr-fasttext.js +17 -17
- package/dist/examples/parallel-download.js +11 -13
- package/dist/examples/plugins.js +43 -43
- package/dist/examples/profiling/basic.js +34 -36
- package/dist/examples/profiling/per-call.js +16 -16
- package/dist/examples/quickstart.bare.js +4 -6
- package/dist/examples/quickstart.js +7 -7
- package/dist/examples/rag/rag-chromadb.js +26 -26
- package/dist/examples/rag/rag-hyperdb/cancellation.js +19 -20
- package/dist/examples/rag/rag-hyperdb/ingest.js +19 -19
- package/dist/examples/rag/rag-hyperdb/pipeline.js +26 -26
- package/dist/examples/rag/rag-hyperdb/workspaces.js +46 -46
- package/dist/examples/rag/rag-lancedb.js +29 -32
- package/dist/examples/rag/rag-sqlite.js +25 -25
- package/dist/examples/registry-query.js +15 -15
- package/dist/examples/seed-p2p.js +8 -8
- package/dist/examples/suspend-resume.js +20 -20
- package/dist/examples/tools/llamacpp-native-tools.js +25 -25
- package/dist/examples/tools/llamacpp-tools-gemma4.js +14 -14
- package/dist/examples/tools/llamacpp-tools-harmony-multiturn.js +15 -15
- package/dist/examples/tools/llamacpp-tools-pythonic.js +15 -15
- package/dist/examples/tools/llamacpp-tools-qwen35.js +14 -14
- package/dist/examples/tools/shared.d.ts +2 -2
- package/dist/examples/tools/shared.js +17 -17
- package/dist/examples/transcription/parakeet-ctc-filesystem.js +12 -12
- package/dist/examples/transcription/parakeet-microphone-record.js +19 -19
- package/dist/examples/transcription/parakeet-microphone-stream.js +23 -23
- package/dist/examples/transcription/parakeet-sortformer-streaming.js +18 -28
- package/dist/examples/transcription/parakeet-sortformer.js +21 -21
- package/dist/examples/transcription/parakeet-tdt-filesystem-chunked.d.ts +2 -0
- package/dist/examples/transcription/parakeet-tdt-filesystem-chunked.js +203 -0
- package/dist/examples/transcription/parakeet-tdt-filesystem.js +13 -13
- package/dist/examples/transcription/whispercpp-filesystem-streaming.js +34 -34
- package/dist/examples/transcription/whispercpp-filesystem.js +19 -19
- package/dist/examples/transcription/whispercpp-microphone-conversation.js +27 -27
- package/dist/examples/transcription/whispercpp-microphone-record.js +21 -21
- package/dist/examples/transcription/whispercpp-prompt.js +18 -18
- package/dist/examples/translation/translation-bergamot-batch.js +17 -17
- package/dist/examples/translation/translation-bergamot-pivot.js +16 -16
- package/dist/examples/translation/translation-bergamot.js +11 -11
- package/dist/examples/translation/translation-indic.js +10 -10
- package/dist/examples/translation/translation-llm-afriquegemma.js +10 -10
- package/dist/examples/translation/translation-llm-context.js +10 -10
- package/dist/examples/translation/translation-llm.js +13 -13
- package/dist/examples/translation/translation-stream.js +11 -11
- package/dist/examples/tts/chatterbox-enhanced.d.ts +2 -0
- package/dist/examples/tts/chatterbox-enhanced.js +55 -0
- package/dist/examples/tts/chatterbox-multilingual.d.ts +2 -0
- package/dist/examples/tts/chatterbox-multilingual.js +54 -0
- package/dist/examples/tts/chatterbox.js +18 -18
- package/dist/examples/tts/llm-to-tts-streaming.js +30 -30
- package/dist/examples/tts/supertonic-enhanced.d.ts +2 -0
- package/dist/examples/tts/supertonic-enhanced.js +57 -0
- package/dist/examples/tts/supertonic-multilingual.js +19 -19
- package/dist/examples/tts/supertonic.js +18 -18
- package/dist/examples/tts/utils.js +24 -32
- package/dist/examples/vla-groot.d.ts +2 -0
- package/dist/examples/vla-groot.js +118 -0
- package/dist/examples/vla-pi05.js +14 -14
- package/dist/examples/vla-smolvla.js +14 -14
- package/dist/examples/voice-assistant/voice-assistant.js +46 -46
- package/dist/expo/plugins/find-in-ancestor-node-modules.js +3 -3
- package/dist/expo/plugins/get-project-root.d.ts +2 -2
- package/dist/expo/plugins/get-project-root.js +1 -1
- package/dist/expo/plugins/index.d.ts +11 -11
- package/dist/expo/plugins/index.js +10 -10
- package/dist/expo/plugins/resolve-sdk-package-dir.js +7 -11
- package/dist/expo/plugins/withAndroidArchitecture.d.ts +1 -1
- package/dist/expo/plugins/withAndroidArchitecture.js +12 -12
- package/dist/expo/plugins/withAndroidNdkVersion.d.ts +1 -1
- package/dist/expo/plugins/withAndroidNdkVersion.js +9 -9
- package/dist/expo/plugins/withDeviceInfo.d.ts +1 -1
- package/dist/expo/plugins/withDeviceInfo.js +13 -13
- package/dist/expo/plugins/withMobileBundle.d.ts +1 -1
- package/dist/expo/plugins/withMobileBundle.js +34 -42
- package/dist/expo/plugins/withOpenCL.d.ts +1 -1
- package/dist/expo/plugins/withOpenCL.js +14 -16
- package/dist/expo/plugins/withQvacSDK.d.ts +1 -1
- package/dist/expo/plugins/withQvacSDK.js +12 -12
- package/dist/index.d.ts +16 -16
- package/dist/index.js +16 -17
- package/dist/logging/addon.d.ts +1 -1
- package/dist/logging/addon.js +13 -13
- package/dist/logging/base-logger.d.ts +2 -2
- package/dist/logging/base-logger.js +6 -6
- package/dist/logging/client-logger.d.ts +1 -1
- package/dist/logging/client-logger.js +3 -3
- package/dist/logging/index.d.ts +9 -9
- package/dist/logging/index.js +8 -8
- package/dist/logging/logger.d.ts +1 -1
- package/dist/logging/logger.js +4 -4
- package/dist/logging/namespaces.d.ts +1 -1
- package/dist/logging/namespaces.js +5 -5
- package/dist/logging/registry.d.ts +2 -2
- package/dist/logging/registry.js +3 -3
- package/dist/logging/server-logger.d.ts +1 -1
- package/dist/logging/server-logger.js +2 -2
- package/dist/logging/stream-logger.d.ts +1 -1
- package/dist/logging/stream-logger.js +4 -4
- package/dist/logging/transport.d.ts +1 -1
- package/dist/logging/types.d.ts +1 -1
- package/dist/logging/utils.d.ts +2 -2
- package/dist/logging/utils.js +40 -41
- package/dist/models/registry/index.d.ts +1 -1
- package/dist/models/registry/index.js +5 -5
- package/dist/models/registry/models.d.ts +5622 -9241
- package/dist/models/registry/models.js +13215 -17030
- package/dist/models/update-models/codegen.d.ts +1 -1
- package/dist/models/update-models/codegen.js +8 -8
- package/dist/models/update-models/companions.d.ts +6 -1
- package/dist/models/update-models/companions.js +104 -39
- package/dist/models/update-models/history.d.ts +1 -1
- package/dist/models/update-models/history.js +11 -11
- package/dist/models/update-models/index.js +32 -34
- package/dist/models/update-models/naming.d.ts +2 -2
- package/dist/models/update-models/naming.js +181 -186
- package/dist/models/update-models/processing.d.ts +2 -2
- package/dist/models/update-models/processing.js +17 -19
- package/dist/models/update-models/registry.d.ts +2 -2
- package/dist/models/update-models/registry.js +9 -9
- package/dist/models/update-models/shards.d.ts +1 -1
- package/dist/models/update-models/shards.js +3 -3
- package/dist/models/update-models/types.d.ts +1 -1
- package/dist/models/update-models/utils.js +5 -5
- package/dist/pear/pre.js +84 -84
- package/dist/profiling/aggregator.d.ts +1 -1
- package/dist/profiling/aggregator.js +6 -6
- package/dist/profiling/clock.d.ts +1 -1
- package/dist/profiling/clock.js +10 -10
- package/dist/profiling/controller.d.ts +2 -2
- package/dist/profiling/controller.js +11 -12
- package/dist/profiling/envelope.d.ts +1 -1
- package/dist/profiling/envelope.js +4 -6
- package/dist/profiling/events.d.ts +2 -2
- package/dist/profiling/events.js +8 -10
- package/dist/profiling/exporters.d.ts +1 -1
- package/dist/profiling/exporters.js +81 -79
- package/dist/profiling/index.d.ts +8 -8
- package/dist/profiling/index.js +7 -7
- package/dist/profiling/model-execution.js +2 -1
- package/dist/profiling/ring-buffer.js +2 -2
- package/dist/profiling/types.d.ts +3 -3
- package/dist/schemas/archive.d.ts +1 -1
- package/dist/schemas/archive.js +8 -14
- package/dist/schemas/batch-completion-stream.d.ts +463 -0
- package/dist/schemas/batch-completion-stream.js +124 -0
- package/dist/schemas/bci-config.d.ts +1 -1
- package/dist/schemas/bci-config.js +7 -7
- package/dist/schemas/bci.d.ts +3 -3
- package/dist/schemas/bci.js +25 -31
- package/dist/schemas/cancel.d.ts +6 -1
- package/dist/schemas/cancel.js +33 -34
- package/dist/schemas/classification.d.ts +1 -1
- package/dist/schemas/classification.js +7 -7
- package/dist/schemas/common.d.ts +578 -28
- package/dist/schemas/common.js +42 -37
- package/dist/schemas/completion-event.d.ts +11 -8
- package/dist/schemas/completion-event.js +27 -26
- package/dist/schemas/completion-stream.d.ts +190 -5
- package/dist/schemas/completion-stream.js +118 -67
- package/dist/schemas/constants-registry.d.ts +67 -0
- package/dist/schemas/constants-registry.js +51 -0
- package/dist/schemas/delegate.d.ts +1 -1
- package/dist/schemas/delegate.js +7 -7
- package/dist/schemas/delete-cache.d.ts +1 -1
- package/dist/schemas/delete-cache.js +15 -11
- package/dist/schemas/download-asset.d.ts +2 -2
- package/dist/schemas/download-asset.js +21 -21
- package/dist/schemas/embed.d.ts +3 -3
- package/dist/schemas/embed.js +16 -27
- package/dist/schemas/engine-addon-map.d.ts +3 -2
- package/dist/schemas/engine-addon-map.js +25 -25
- package/dist/schemas/error.d.ts +1 -1
- package/dist/schemas/error.js +12 -13
- package/dist/schemas/finetune.d.ts +1 -1
- package/dist/schemas/finetune.js +41 -44
- package/dist/schemas/get-loaded-model-info.d.ts +17 -1
- package/dist/schemas/get-loaded-model-info.js +22 -14
- package/dist/schemas/get-model-info.d.ts +1 -1
- package/dist/schemas/get-model-info.js +48 -91
- package/dist/schemas/heartbeat.d.ts +1 -1
- package/dist/schemas/heartbeat.js +6 -6
- package/dist/schemas/index.d.ts +52 -51
- package/dist/schemas/index.js +52 -51
- package/dist/schemas/json-schema.d.ts +1 -1
- package/dist/schemas/llamacpp-config.d.ts +57 -29
- package/dist/schemas/llamacpp-config.js +43 -35
- package/dist/schemas/load-model.d.ts +1537 -185
- package/dist/schemas/load-model.js +126 -129
- package/dist/schemas/logging-stream.d.ts +1 -1
- package/dist/schemas/logging-stream.js +6 -12
- package/dist/schemas/mcp-adapter.d.ts +1 -1
- package/dist/schemas/model-src-utils.d.ts +1 -1
- package/dist/schemas/model-src-utils.js +13 -13
- package/dist/schemas/model-types.d.ts +1 -1
- package/dist/schemas/model-types.js +27 -27
- package/dist/schemas/ocr.d.ts +1 -1
- package/dist/schemas/ocr.js +18 -18
- package/dist/schemas/path-validation.d.ts +1 -1
- package/dist/schemas/path-validation.js +4 -4
- package/dist/schemas/plugin.d.ts +13 -14
- package/dist/schemas/plugin.js +51 -51
- package/dist/schemas/profiling.d.ts +1 -1
- package/dist/schemas/profiling.js +16 -16
- package/dist/schemas/provide.d.ts +1 -1
- package/dist/schemas/provide.js +8 -8
- package/dist/schemas/rag.d.ts +3 -3
- package/dist/schemas/rag.js +65 -70
- package/dist/schemas/registry.d.ts +1 -1
- package/dist/schemas/registry.js +44 -66
- package/dist/schemas/reload-config.d.ts +1 -1
- package/dist/schemas/reload-config.js +16 -18
- package/dist/schemas/resume.d.ts +1 -1
- package/dist/schemas/resume.js +3 -3
- package/dist/schemas/runtime-context.d.ts +1 -1
- package/dist/schemas/runtime-context.js +4 -4
- package/dist/schemas/sdcpp-config.d.ts +248 -9
- package/dist/schemas/sdcpp-config.js +395 -291
- package/dist/schemas/sdk-config.d.ts +833 -71
- package/dist/schemas/sdk-config.js +25 -29
- package/dist/schemas/sdk-errors-client.d.ts +1 -1
- package/dist/schemas/sdk-errors-client.js +80 -80
- package/dist/schemas/sdk-errors-registry.js +1 -1
- package/dist/schemas/sdk-errors-server.d.ts +1 -1
- package/dist/schemas/sdk-errors-server.js +202 -199
- package/dist/schemas/shard.d.ts +1 -1
- package/dist/schemas/shard.js +4 -4
- package/dist/schemas/state.d.ts +1 -1
- package/dist/schemas/state.js +5 -10
- package/dist/schemas/stop-provide.d.ts +1 -1
- package/dist/schemas/stop-provide.js +4 -4
- package/dist/schemas/suspend.d.ts +1 -1
- package/dist/schemas/suspend.js +3 -3
- package/dist/schemas/text-to-speech.d.ts +469 -3
- package/dist/schemas/text-to-speech.js +151 -109
- package/dist/schemas/tools.d.ts +2 -2
- package/dist/schemas/tools.js +18 -24
- package/dist/schemas/transcription-config.d.ts +1 -1
- package/dist/schemas/transcription-config.js +18 -18
- package/dist/schemas/transcription.d.ts +5 -5
- package/dist/schemas/transcription.js +31 -33
- package/dist/schemas/translate.d.ts +3 -3
- package/dist/schemas/translate.js +49 -72
- package/dist/schemas/translation-config.d.ts +1 -1
- package/dist/schemas/translation-config.js +116 -123
- package/dist/schemas/unload-model.d.ts +1 -1
- package/dist/schemas/unload-model.js +6 -6
- package/dist/schemas/vla.d.ts +11 -1
- package/dist/schemas/vla.js +52 -32
- package/dist/scripts/contract/build-contract.d.ts +38 -0
- package/dist/scripts/contract/build-contract.js +620 -0
- package/dist/scripts/contract/build-error-codes.d.ts +17 -0
- package/dist/scripts/contract/build-error-codes.js +17 -0
- package/dist/scripts/contract/build-model-type-maps.d.ts +22 -0
- package/dist/scripts/contract/build-model-type-maps.js +16 -0
- package/dist/scripts/contract/build-models-registry.d.ts +17 -0
- package/dist/scripts/contract/build-models-registry.js +31 -0
- package/dist/scripts/contract/plugin-contract.d.ts +23 -0
- package/dist/scripts/contract/plugin-contract.js +28 -0
- package/dist/scripts/export-contract.d.ts +2 -0
- package/dist/scripts/export-contract.js +27 -0
- package/dist/scripts/export-plugin-contract.d.ts +2 -0
- package/dist/scripts/export-plugin-contract.js +18 -0
- package/dist/scripts/run-security-tests.js +9 -10
- package/dist/scripts/run-unit-tests.js +11 -12
- package/dist/server/bare/delegate-connect-diagnostics.js +13 -19
- package/dist/server/bare/delegate-rpc-client.d.ts +2 -2
- package/dist/server/bare/delegate-rpc-client.js +32 -34
- package/dist/server/bare/hyperswarm.d.ts +3 -3
- package/dist/server/bare/hyperswarm.js +14 -14
- package/dist/server/bare/ops/bci-transcribe.d.ts +1 -1
- package/dist/server/bare/ops/bci-transcribe.js +44 -44
- package/dist/server/bare/ops/cancel.d.ts +2 -2
- package/dist/server/bare/ops/cancel.js +6 -6
- package/dist/server/bare/ops/embed.d.ts +1 -1
- package/dist/server/bare/ops/embed.js +26 -16
- package/dist/server/bare/ops/kv-cache-utils.d.ts +1 -1
- package/dist/server/bare/ops/kv-cache-utils.js +17 -19
- package/dist/server/bare/ops/load-model.d.ts +2 -2
- package/dist/server/bare/ops/load-model.js +14 -18
- package/dist/server/bare/ops/transcribe.d.ts +3 -3
- package/dist/server/bare/ops/transcribe.js +62 -62
- package/dist/server/bare/ops/translate.d.ts +1 -1
- package/dist/server/bare/ops/translate.js +53 -31
- package/dist/server/bare/ops/unload-model.d.ts +1 -1
- package/dist/server/bare/ops/unload-model.js +12 -12
- package/dist/server/bare/plugins/bci-whispercpp-transcription/args.d.ts +2 -2
- package/dist/server/bare/plugins/bci-whispercpp-transcription/args.js +3 -3
- package/dist/server/bare/plugins/bci-whispercpp-transcription/plugin.d.ts +4 -3
- package/dist/server/bare/plugins/bci-whispercpp-transcription/plugin.js +33 -33
- package/dist/server/bare/plugins/bci-whispercpp-transcription/resolve-config.d.ts +1 -1
- package/dist/server/bare/plugins/bci-whispercpp-transcription/resolve-config.js +1 -1
- package/dist/server/bare/plugins/ggml-classification/ops/classify.d.ts +1 -1
- package/dist/server/bare/plugins/ggml-classification/ops/classify.js +8 -8
- package/dist/server/bare/plugins/ggml-classification/plugin.d.ts +1 -1
- package/dist/server/bare/plugins/ggml-classification/plugin.js +14 -14
- package/dist/server/bare/plugins/ggml-ocr/ops/ocr-stream.d.ts +1 -1
- package/dist/server/bare/plugins/ggml-ocr/ops/ocr-stream.js +27 -26
- package/dist/server/bare/plugins/ggml-ocr/plugin.d.ts +1 -1
- package/dist/server/bare/plugins/ggml-ocr/plugin.js +33 -54
- package/dist/server/bare/plugins/ggml-ocr/resolve-config.d.ts +6 -0
- package/dist/server/bare/plugins/ggml-ocr/resolve-config.js +73 -0
- package/dist/server/bare/plugins/ggml-vla/ops/vla-hparams.d.ts +1 -1
- package/dist/server/bare/plugins/ggml-vla/ops/vla-hparams.js +3 -3
- package/dist/server/bare/plugins/ggml-vla/ops/vla-run.d.ts +1 -1
- package/dist/server/bare/plugins/ggml-vla/ops/vla-run.js +23 -23
- package/dist/server/bare/plugins/ggml-vla/plugin.d.ts +6 -1
- package/dist/server/bare/plugins/ggml-vla/plugin.js +15 -15
- package/dist/server/bare/plugins/index.d.ts +11 -11
- package/dist/server/bare/plugins/index.js +11 -11
- package/dist/server/bare/plugins/llamacpp-completion/ops/batch-cancelled.d.ts +23 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/batch-cancelled.js +30 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/batch-completion-stream.d.ts +32 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/batch-completion-stream.js +99 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/cache-logger.d.ts +1 -1
- package/dist/server/bare/plugins/llamacpp-completion/ops/cache-logger.js +8 -8
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stats.d.ts +3 -2
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stats.js +4 -1
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.d.ts +22 -4
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.js +65 -80
- package/dist/server/bare/plugins/llamacpp-completion/ops/context-overflow.js +5 -5
- package/dist/server/bare/plugins/llamacpp-completion/ops/finetune.d.ts +2 -2
- package/dist/server/bare/plugins/llamacpp-completion/ops/finetune.js +34 -34
- package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-session.d.ts +7 -7
- package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-session.js +19 -23
- package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-state.d.ts +8 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-state.js +12 -6
- package/dist/server/bare/plugins/llamacpp-completion/plugin.d.ts +193 -19
- package/dist/server/bare/plugins/llamacpp-completion/plugin.js +235 -70
- package/dist/server/bare/plugins/llamacpp-completion/transform.d.ts +1 -1
- package/dist/server/bare/plugins/llamacpp-completion/transform.js +15 -15
- package/dist/server/bare/plugins/llamacpp-embedding/plugin.d.ts +9 -4
- package/dist/server/bare/plugins/llamacpp-embedding/plugin.js +27 -29
- package/dist/server/bare/plugins/nmtcpp-translation/plugin.d.ts +1 -1
- package/dist/server/bare/plugins/nmtcpp-translation/plugin.js +38 -39
- package/dist/server/bare/plugins/nmtcpp-translation/resolve-vocab.d.ts +1 -1
- package/dist/server/bare/plugins/nmtcpp-translation/resolve-vocab.js +19 -22
- package/dist/server/bare/plugins/parakeet-transcription/plugin.d.ts +1 -1
- package/dist/server/bare/plugins/parakeet-transcription/plugin.js +36 -36
- package/dist/server/bare/plugins/sdcpp-generation/ops/diffusion.d.ts +1 -1
- package/dist/server/bare/plugins/sdcpp-generation/ops/diffusion.js +15 -17
- package/dist/server/bare/plugins/sdcpp-generation/ops/upscale.d.ts +1 -1
- package/dist/server/bare/plugins/sdcpp-generation/ops/upscale.js +11 -11
- package/dist/server/bare/plugins/sdcpp-generation/ops/video.d.ts +3 -1
- package/dist/server/bare/plugins/sdcpp-generation/ops/video.js +71 -44
- package/dist/server/bare/plugins/sdcpp-generation/plugin.d.ts +132 -4
- package/dist/server/bare/plugins/sdcpp-generation/plugin.js +148 -70
- package/dist/server/bare/plugins/tts-ggml/ops/text-to-speech-stream.d.ts +2 -2
- package/dist/server/bare/plugins/tts-ggml/ops/text-to-speech-stream.js +19 -21
- package/dist/server/bare/plugins/tts-ggml/ops/text-to-speech.d.ts +2 -2
- package/dist/server/bare/plugins/tts-ggml/ops/text-to-speech.js +18 -34
- package/dist/server/bare/plugins/tts-ggml/plugin.d.ts +9 -2
- package/dist/server/bare/plugins/tts-ggml/plugin.js +97 -49
- package/dist/server/bare/plugins/whispercpp-transcription/plugin.d.ts +1 -1
- package/dist/server/bare/plugins/whispercpp-transcription/plugin.js +52 -52
- package/dist/server/bare/rag-hyperdb/handlers/chunk.d.ts +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/chunk.js +2 -2
- package/dist/server/bare/rag-hyperdb/handlers/close-workspace.d.ts +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/close-workspace.js +2 -2
- package/dist/server/bare/rag-hyperdb/handlers/delete-embeddings.d.ts +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/delete-embeddings.js +4 -4
- package/dist/server/bare/rag-hyperdb/handlers/delete-workspace.d.ts +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/delete-workspace.js +3 -3
- package/dist/server/bare/rag-hyperdb/handlers/ingest.d.ts +2 -2
- package/dist/server/bare/rag-hyperdb/handlers/ingest.js +4 -4
- package/dist/server/bare/rag-hyperdb/handlers/list-workspaces.d.ts +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/list-workspaces.js +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/reindex.d.ts +2 -2
- package/dist/server/bare/rag-hyperdb/handlers/reindex.js +5 -5
- package/dist/server/bare/rag-hyperdb/handlers/save-embeddings.d.ts +2 -2
- package/dist/server/bare/rag-hyperdb/handlers/save-embeddings.js +3 -3
- package/dist/server/bare/rag-hyperdb/handlers/search.d.ts +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/search.js +3 -3
- package/dist/server/bare/rag-hyperdb/index.d.ts +11 -11
- package/dist/server/bare/rag-hyperdb/index.js +11 -11
- package/dist/server/bare/rag-hyperdb/rag-operation-manager.js +3 -3
- package/dist/server/bare/rag-hyperdb/rag-workspace-manager.d.ts +1 -1
- package/dist/server/bare/rag-hyperdb/rag-workspace-manager.js +20 -20
- package/dist/server/bare/registry/config-registry.d.ts +1 -1
- package/dist/server/bare/registry/config-registry.js +13 -16
- package/dist/server/bare/registry/logging-stream-registry.d.ts +1 -1
- package/dist/server/bare/registry/logging-stream-registry.js +2 -2
- package/dist/server/bare/registry/model-config-registry.d.ts +2 -2
- package/dist/server/bare/registry/model-config-registry.js +6 -6
- package/dist/server/bare/registry/model-config-utils.d.ts +2 -2
- package/dist/server/bare/registry/model-config-utils.js +35 -35
- package/dist/server/bare/registry/model-registry.d.ts +3 -3
- package/dist/server/bare/registry/model-registry.js +11 -11
- package/dist/server/bare/registry/registry-client.d.ts +1 -1
- package/dist/server/bare/registry/registry-client.js +18 -18
- package/dist/server/bare/registry/runtime-context-registry.d.ts +1 -1
- package/dist/server/bare/registry/runtime-context-registry.js +3 -3
- package/dist/server/bare/runtime/disposable-scope.js +3 -3
- package/dist/server/bare/runtime/index.d.ts +7 -7
- package/dist/server/bare/runtime/index.js +3 -3
- package/dist/server/bare/runtime/request-context.d.ts +4 -4
- package/dist/server/bare/runtime/request-id.js +1 -1
- package/dist/server/bare/runtime/request-registry-singleton.d.ts +1 -1
- package/dist/server/bare/runtime/request-registry-singleton.js +23 -4
- package/dist/server/bare/runtime/request-registry.d.ts +27 -12
- package/dist/server/bare/runtime/request-registry.js +39 -34
- package/dist/server/bare/runtime/with-request-context.d.ts +1 -1
- package/dist/server/bare/runtime/with-request-context.js +11 -11
- package/dist/server/bare/runtime-lifecycle.d.ts +1 -1
- package/dist/server/bare/runtime-lifecycle.js +27 -31
- package/dist/server/bare/types/addon-responses.d.ts +7 -4
- package/dist/server/bare/utils/audio-input.d.ts +2 -2
- package/dist/server/bare/utils/audio-input.js +7 -7
- package/dist/server/bare/utils/transcribe-metadata.d.ts +1 -1
- package/dist/server/bare/utils/transcribe-metadata.js +4 -4
- package/dist/server/bare/utils/tts-stats.d.ts +9 -5
- package/dist/server/bare/utils/tts-stats.js +8 -2
- package/dist/server/env.js +8 -8
- package/dist/server/error-handlers.d.ts +3 -3
- package/dist/server/error-handlers.js +11 -11
- package/dist/server/plugins/index.d.ts +1 -1
- package/dist/server/plugins/index.js +1 -1
- package/dist/server/plugins/registry.d.ts +1 -1
- package/dist/server/plugins/registry.js +12 -14
- package/dist/server/rpc/create-server.d.ts +1 -1
- package/dist/server/rpc/create-server.js +34 -13
- package/dist/server/rpc/delegate-transport.d.ts +3 -3
- package/dist/server/rpc/delegate-transport.js +43 -44
- package/dist/server/rpc/handle-request.d.ts +1 -1
- package/dist/server/rpc/handle-request.js +28 -30
- package/dist/server/rpc/handler-registry.d.ts +1 -1
- package/dist/server/rpc/handler-registry.js +102 -92
- package/dist/server/rpc/handler-selection.d.ts +3 -3
- package/dist/server/rpc/handler-selection.js +3 -3
- package/dist/server/rpc/handler-utils.d.ts +7 -7
- package/dist/server/rpc/handler-utils.js +32 -35
- package/dist/server/rpc/handlers/batch-completion-stream.d.ts +78 -0
- package/dist/server/rpc/handlers/batch-completion-stream.js +4 -0
- package/dist/server/rpc/handlers/bci-transcribe-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/bci-transcribe-stream.js +2 -2
- package/dist/server/rpc/handlers/bci-transcribe.d.ts +1 -1
- package/dist/server/rpc/handlers/bci-transcribe.js +2 -2
- package/dist/server/rpc/handlers/cancel-delegated.d.ts +2 -2
- package/dist/server/rpc/handlers/cancel-delegated.js +13 -13
- package/dist/server/rpc/handlers/cancelHandler.d.ts +1 -1
- package/dist/server/rpc/handlers/cancelHandler.js +11 -11
- package/dist/server/rpc/handlers/classify.d.ts +1 -1
- package/dist/server/rpc/handlers/classify.js +2 -2
- package/dist/server/rpc/handlers/completion-orchestrate.d.ts +42 -0
- package/dist/server/rpc/handlers/completion-orchestrate.js +190 -0
- package/dist/server/rpc/handlers/completion-stream-delegated.d.ts +2 -2
- package/dist/server/rpc/handlers/completion-stream-delegated.js +14 -14
- package/dist/server/rpc/handlers/completion-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/completion-stream.js +2 -2
- package/dist/server/rpc/handlers/delete-cache.d.ts +1 -1
- package/dist/server/rpc/handlers/delete-cache.js +10 -10
- package/dist/server/rpc/handlers/diffusion-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/diffusion-stream.js +2 -2
- package/dist/server/rpc/handlers/download-asset.d.ts +1 -1
- package/dist/server/rpc/handlers/download-asset.js +20 -20
- package/dist/server/rpc/handlers/embed.d.ts +1 -1
- package/dist/server/rpc/handlers/embed.js +2 -2
- package/dist/server/rpc/handlers/finetune.d.ts +1 -1
- package/dist/server/rpc/handlers/finetune.js +8 -6
- package/dist/server/rpc/handlers/get-loaded-model-info.d.ts +1 -1
- package/dist/server/rpc/handlers/get-loaded-model-info.js +15 -9
- package/dist/server/rpc/handlers/get-model-info.d.ts +1 -1
- package/dist/server/rpc/handlers/get-model-info.js +20 -20
- package/dist/server/rpc/handlers/heartbeat-delegated.d.ts +2 -2
- package/dist/server/rpc/handlers/heartbeat-delegated.js +7 -7
- package/dist/server/rpc/handlers/heartbeat.d.ts +1 -1
- package/dist/server/rpc/handlers/heartbeat.js +1 -1
- package/dist/server/rpc/handlers/index.d.ts +35 -31
- package/dist/server/rpc/handlers/index.js +36 -32
- package/dist/server/rpc/handlers/load-model/download-manager.d.ts +4 -4
- package/dist/server/rpc/handlers/load-model/download-manager.js +19 -17
- package/dist/server/rpc/handlers/load-model/download-stats.d.ts +4 -3
- package/dist/server/rpc/handlers/load-model/download-stats.js +9 -11
- package/dist/server/rpc/handlers/load-model/handler.d.ts +1 -1
- package/dist/server/rpc/handlers/load-model/handler.js +42 -43
- package/dist/server/rpc/handlers/load-model/http.d.ts +2 -2
- package/dist/server/rpc/handlers/load-model/http.js +100 -107
- package/dist/server/rpc/handlers/load-model/hyperdrive.d.ts +2 -2
- package/dist/server/rpc/handlers/load-model/hyperdrive.js +72 -74
- package/dist/server/rpc/handlers/load-model/index.d.ts +2 -2
- package/dist/server/rpc/handlers/load-model/index.js +2 -2
- package/dist/server/rpc/handlers/load-model/registry-client-options.d.ts +2 -2
- package/dist/server/rpc/handlers/load-model/registry-client-options.js +2 -3
- package/dist/server/rpc/handlers/load-model/registry-companion-set.d.ts +5 -5
- package/dist/server/rpc/handlers/load-model/registry-companion-set.js +19 -21
- package/dist/server/rpc/handlers/load-model/registry-download-utils.d.ts +6 -6
- package/dist/server/rpc/handlers/load-model/registry-download-utils.js +16 -18
- package/dist/server/rpc/handlers/load-model/registry-metadata.d.ts +11 -0
- package/dist/server/rpc/handlers/load-model/registry-metadata.js +23 -0
- package/dist/server/rpc/handlers/load-model/registry.d.ts +4 -3
- package/dist/server/rpc/handlers/load-model/registry.js +50 -56
- package/dist/server/rpc/handlers/load-model/resolve-session.d.ts +3 -3
- package/dist/server/rpc/handlers/load-model/resolve-session.js +7 -7
- package/dist/server/rpc/handlers/load-model/resolve.d.ts +3 -3
- package/dist/server/rpc/handlers/load-model/resolve.js +36 -35
- package/dist/server/rpc/handlers/load-model/types.d.ts +3 -3
- package/dist/server/rpc/handlers/load-model/types.js +7 -7
- package/dist/server/rpc/handlers/load-model-delegated.d.ts +2 -2
- package/dist/server/rpc/handlers/load-model-delegated.js +31 -30
- package/dist/server/rpc/handlers/logging-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/logging-stream.js +3 -3
- package/dist/server/rpc/handlers/ocr-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/ocr-stream.js +2 -2
- package/dist/server/rpc/handlers/plugin-dispatch.js +9 -9
- package/dist/server/rpc/handlers/plugin-invoke.d.ts +1 -1
- package/dist/server/rpc/handlers/plugin-invoke.js +16 -16
- package/dist/server/rpc/handlers/provideHandler/connection.d.ts +1 -1
- package/dist/server/rpc/handlers/provideHandler/connection.js +16 -16
- package/dist/server/rpc/handlers/provideHandler/handler.d.ts +1 -1
- package/dist/server/rpc/handlers/provideHandler/handler.js +18 -18
- package/dist/server/rpc/handlers/provideHandler/proxy.d.ts +1 -1
- package/dist/server/rpc/handlers/provideHandler/proxy.js +11 -11
- package/dist/server/rpc/handlers/provideHandler.d.ts +1 -1
- package/dist/server/rpc/handlers/provideHandler.js +1 -1
- package/dist/server/rpc/handlers/rag.d.ts +1 -1
- package/dist/server/rpc/handlers/rag.js +50 -50
- package/dist/server/rpc/handlers/registry.d.ts +1 -1
- package/dist/server/rpc/handlers/registry.js +34 -36
- package/dist/server/rpc/handlers/resume.d.ts +1 -1
- package/dist/server/rpc/handlers/resume.js +3 -3
- package/dist/server/rpc/handlers/state.d.ts +1 -1
- package/dist/server/rpc/handlers/state.js +3 -3
- package/dist/server/rpc/handlers/stopProvideHandler.d.ts +1 -1
- package/dist/server/rpc/handlers/stopProvideHandler.js +7 -7
- package/dist/server/rpc/handlers/suspend.d.ts +1 -1
- package/dist/server/rpc/handlers/suspend.js +3 -3
- package/dist/server/rpc/handlers/text-to-speech-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/text-to-speech-stream.js +2 -2
- package/dist/server/rpc/handlers/text-to-speech.d.ts +1 -1
- package/dist/server/rpc/handlers/text-to-speech.js +2 -2
- package/dist/server/rpc/handlers/transcribe-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/transcribe-stream.js +2 -2
- package/dist/server/rpc/handlers/transcribe.d.ts +1 -1
- package/dist/server/rpc/handlers/transcribe.js +2 -2
- package/dist/server/rpc/handlers/translate.d.ts +1 -1
- package/dist/server/rpc/handlers/translate.js +2 -2
- package/dist/server/rpc/handlers/unload-model-delegated.d.ts +1 -1
- package/dist/server/rpc/handlers/unload-model-delegated.js +10 -10
- package/dist/server/rpc/handlers/unload-model.d.ts +1 -1
- package/dist/server/rpc/handlers/unload-model.js +10 -10
- package/dist/server/rpc/handlers/upscale-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/upscale-stream.js +2 -2
- package/dist/server/rpc/handlers/video-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/video-stream.js +2 -2
- package/dist/server/rpc/index.d.ts +2 -2
- package/dist/server/rpc/index.js +2 -2
- package/dist/server/rpc/method-shapes.d.ts +51 -0
- package/dist/server/rpc/method-shapes.js +48 -0
- package/dist/server/rpc/profiling/context.d.ts +1 -1
- package/dist/server/rpc/profiling/context.js +9 -10
- package/dist/server/rpc/profiling/delegation-profiler.d.ts +2 -2
- package/dist/server/rpc/profiling/delegation-profiler.js +23 -24
- package/dist/server/rpc/profiling/index.d.ts +4 -4
- package/dist/server/rpc/profiling/index.js +4 -4
- package/dist/server/rpc/profiling/operation-metrics.d.ts +2 -2
- package/dist/server/rpc/profiling/operation-metrics.js +122 -102
- package/dist/server/rpc/profiling/operation-wrappers.d.ts +1 -1
- package/dist/server/rpc/profiling/operation-wrappers.js +16 -14
- package/dist/server/rpc/profiling/profiler.d.ts +2 -2
- package/dist/server/rpc/profiling/profiler.js +9 -13
- package/dist/server/rpc/rpc-utils.js +1 -4
- package/dist/server/rpc/transport-selector.d.ts +1 -1
- package/dist/server/rpc/transport-selector.js +4 -4
- package/dist/server/utils/archive.js +27 -29
- package/dist/server/utils/audio/decoder.d.ts +2 -2
- package/dist/server/utils/audio/decoder.js +11 -11
- package/dist/server/utils/cache/auto-history.d.ts +1 -1
- package/dist/server/utils/cache/auto-history.js +15 -11
- package/dist/server/utils/cache/paths.d.ts +2 -2
- package/dist/server/utils/cache/paths.js +14 -14
- package/dist/server/utils/checksum.d.ts +1 -1
- package/dist/server/utils/checksum.js +10 -12
- package/dist/server/utils/clear-storage.d.ts +1 -1
- package/dist/server/utils/clear-storage.js +8 -11
- package/dist/server/utils/completion-normalizer.d.ts +1 -1
- package/dist/server/utils/completion-normalizer.js +106 -113
- package/dist/server/utils/config-transform.d.ts +1 -1
- package/dist/server/utils/config-transform.js +2 -2
- package/dist/server/utils/expand-gguf-shards.js +4 -4
- package/dist/server/utils/formatting.js +6 -12
- package/dist/server/utils/gguf-tensor-extractor.js +17 -21
- package/dist/server/utils/index.d.ts +11 -11
- package/dist/server/utils/index.js +11 -11
- package/dist/server/utils/multi-gpu-mobile.js +1 -1
- package/dist/server/utils/path-security.d.ts +1 -1
- package/dist/server/utils/path-security.js +6 -6
- package/dist/server/utils/qvac-paths.js +3 -3
- package/dist/server/utils/response-format.d.ts +1 -1
- package/dist/server/utils/response-format.js +4 -4
- package/dist/server/utils/shard-utils.d.ts +1 -1
- package/dist/server/utils/shard-utils.js +14 -16
- package/dist/server/utils/tool-integration.d.ts +1 -1
- package/dist/server/utils/tool-integration.js +5 -9
- package/dist/server/utils/tools/dialect.d.ts +1 -1
- package/dist/server/utils/tools/dialect.js +7 -7
- package/dist/server/utils/tools/index.d.ts +2 -2
- package/dist/server/utils/tools/index.js +2 -2
- package/dist/server/utils/tools/parser.d.ts +1 -1
- package/dist/server/utils/tools/parser.js +14 -14
- package/dist/server/utils/tools/parsers/gemma4native.d.ts +2 -2
- package/dist/server/utils/tools/parsers/gemma4native.js +13 -8
- package/dist/server/utils/tools/parsers/harmony.d.ts +2 -2
- package/dist/server/utils/tools/parsers/harmony.js +9 -11
- package/dist/server/utils/tools/parsers/hermes.d.ts +2 -2
- package/dist/server/utils/tools/parsers/hermes.js +16 -16
- package/dist/server/utils/tools/parsers/json.d.ts +2 -2
- package/dist/server/utils/tools/parsers/json.js +14 -14
- package/dist/server/utils/tools/parsers/pythonic.d.ts +2 -2
- package/dist/server/utils/tools/parsers/pythonic.js +43 -43
- package/dist/server/utils/tools/parsers/qwen35.d.ts +2 -2
- package/dist/server/utils/tools/parsers/qwen35.js +20 -20
- package/dist/server/utils/tools/shared.d.ts +1 -1
- package/dist/server/utils/tools/shared.js +10 -12
- package/dist/server/utils/worker-lock.js +10 -10
- package/dist/server/worker-core.d.ts +1 -1
- package/dist/server/worker-core.js +44 -43
- package/dist/server/worker.js +9 -9
- package/dist/utils/aggregate-events.d.ts +2 -2
- package/dist/utils/aggregate-events.js +17 -19
- package/dist/utils/cache-normalize.js +1 -4
- package/dist/utils/encoding.js +1 -1
- package/dist/utils/errors-base.d.ts +1 -1
- package/dist/utils/errors-base.js +1 -1
- package/dist/utils/errors-client.d.ts +1 -1
- package/dist/utils/errors-client.js +5 -5
- package/dist/utils/errors-server.d.ts +3 -3
- package/dist/utils/errors-server.js +19 -18
- package/dist/utils/load-model-validation.js +3 -3
- package/dist/utils/mcp-adapter.d.ts +4 -4
- package/dist/utils/mcp-adapter.js +31 -38
- package/dist/utils/path-sanitize.js +14 -17
- package/dist/utils/tool-helpers.d.ts +2 -2
- package/dist/utils/tool-helpers.js +25 -26
- package/dist/utils/withTimeout.d.ts +7 -0
- package/dist/utils/withTimeout.js +11 -1
- package/dist/utils/zod-error.d.ts +1 -1
- package/dist/utils/zod-error.js +1 -1
- package/electron-forge/index.cjs +274 -317
- package/expo/plugins/patches/android-link.mjs +25 -30
- package/expo/plugins/patches/ios-link.mjs +25 -30
- package/package.json +21 -17
|
@@ -1,181 +1,277 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import { modelSrcInputSchema } from
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { modelSrcInputSchema } from './model-src-utils.js';
|
|
3
3
|
const BASE64_PATTERN = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;
|
|
4
4
|
const ABSOLUTE_PATH_PATTERN = /^(\/|[A-Za-z]:[\\/]|\\\\)/;
|
|
5
5
|
const base64StringSchema = z.string().min(1).regex(BASE64_PATTERN);
|
|
6
6
|
const samplingMethodSchema = z.enum([
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
7
|
+
'euler',
|
|
8
|
+
'euler_a',
|
|
9
|
+
'heun',
|
|
10
|
+
'dpm2',
|
|
11
|
+
'dpm++2m',
|
|
12
|
+
'dpm++2mv2',
|
|
13
|
+
'dpm++2s_a',
|
|
14
|
+
'lcm',
|
|
15
|
+
'ipndm',
|
|
16
|
+
'ipndm_v',
|
|
17
|
+
'ddim_trailing',
|
|
18
|
+
'tcd',
|
|
19
|
+
'res_multistep',
|
|
20
|
+
'res_2s'
|
|
21
21
|
]);
|
|
22
22
|
const scheduleTypeSchema = z.enum([
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
'discrete',
|
|
24
|
+
'karras',
|
|
25
|
+
'exponential',
|
|
26
|
+
'ays',
|
|
27
|
+
'gits',
|
|
28
|
+
'sgm_uniform',
|
|
29
|
+
'simple',
|
|
30
|
+
'lcm',
|
|
31
|
+
'smoothstep',
|
|
32
|
+
'kl_optimal',
|
|
33
|
+
'bong_tangent'
|
|
25
34
|
]);
|
|
26
35
|
const cacheModeSchema = z.enum([
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
36
|
+
'disabled',
|
|
37
|
+
'easycache',
|
|
38
|
+
'ucache',
|
|
39
|
+
'dbcache',
|
|
40
|
+
'taylorseer',
|
|
41
|
+
'cache-dit'
|
|
33
42
|
]);
|
|
34
|
-
export const sdcppConfigSchema = z
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
.
|
|
43
|
+
export const sdcppConfigSchema = z.object({
|
|
44
|
+
mode: z
|
|
45
|
+
.enum(['diffusion', 'upscale', 'video'])
|
|
46
|
+
.default('diffusion')
|
|
47
|
+
.describe('Operation mode for the diffusion plugin. ' +
|
|
38
48
|
"`'diffusion'` (default) builds a full SD / SDXL / SD3 / FLUX pipeline from " +
|
|
39
|
-
|
|
40
|
-
|
|
49
|
+
'the primary model plus optional auxiliary text encoders, VAE, unconditional ' +
|
|
50
|
+
'diffusion model, and ESRGAN ' +
|
|
51
|
+
'upscaler, and exposes diffusion({ ... }). ' +
|
|
41
52
|
"`'upscale'` builds a standalone ESRGAN upscaler from the primary model " +
|
|
42
|
-
|
|
43
|
-
"`'video'` builds a
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
53
|
+
'file alone (auxiliary model sources are ignored) and exposes upscale({ ... }). ' +
|
|
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). ' +
|
|
60
|
+
'On React Native, loading the video model on-device will likely fail ' +
|
|
61
|
+
'because the video diffusion models currently ' +
|
|
62
|
+
'shipped by the SDK are too large to load on typical mobile devices; ' +
|
|
63
|
+
'pass a `delegate` to `loadModel(...)` to run generation on a desktop peer instead.'),
|
|
48
64
|
threads: z.number().optional(),
|
|
49
|
-
device: z.enum([
|
|
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).'),
|
|
50
78
|
prediction: z
|
|
51
|
-
.enum([
|
|
79
|
+
.enum(['auto', 'eps', 'v', 'edm_v', 'flow', 'flux2_flow'])
|
|
52
80
|
.optional()
|
|
53
|
-
.describe(
|
|
81
|
+
.describe('Prediction type; auto-detected from model when omitted'),
|
|
54
82
|
type: z
|
|
55
83
|
.enum([
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
84
|
+
'auto',
|
|
85
|
+
'f32',
|
|
86
|
+
'f16',
|
|
87
|
+
'bf16',
|
|
88
|
+
'q2_k',
|
|
89
|
+
'q3_k',
|
|
90
|
+
'q4_0',
|
|
91
|
+
'q4_1',
|
|
92
|
+
'q4_k',
|
|
93
|
+
'q5_0',
|
|
94
|
+
'q5_1',
|
|
95
|
+
'q5_k',
|
|
96
|
+
'q6_k',
|
|
97
|
+
'q8_0'
|
|
59
98
|
])
|
|
60
99
|
.optional()
|
|
61
|
-
.describe(
|
|
62
|
-
rng: z.enum([
|
|
63
|
-
sampler_rng: z.enum([
|
|
64
|
-
clip_on_cpu: z.boolean().optional().describe(
|
|
65
|
-
vae_on_cpu: z.boolean().optional().describe(
|
|
66
|
-
vae_tiling: z.boolean().optional().describe(
|
|
67
|
-
offload_to_cpu: z
|
|
68
|
-
.
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
100
|
+
.describe('Weight quantization type override; auto-detected when omitted'),
|
|
101
|
+
rng: z.enum(['cpu', 'cuda', 'std_default']).optional(),
|
|
102
|
+
sampler_rng: z.enum(['cpu', 'cuda', 'std_default']).optional(),
|
|
103
|
+
clip_on_cpu: z.boolean().optional().describe('Force CLIP text encoder to run on CPU'),
|
|
104
|
+
vae_on_cpu: z.boolean().optional().describe('Force VAE decoder to run on CPU'),
|
|
105
|
+
vae_tiling: z.boolean().optional().describe('Enable VAE tiling for large images on limited VRAM'),
|
|
106
|
+
offload_to_cpu: z
|
|
107
|
+
.boolean()
|
|
108
|
+
.optional()
|
|
109
|
+
.describe('Keep model weights in CPU memory and offload them during GPU compute'),
|
|
110
|
+
flash_attn: z.boolean().optional().describe('Enable flash attention to reduce memory usage'),
|
|
111
|
+
diffusion_fa: z
|
|
112
|
+
.boolean()
|
|
113
|
+
.optional()
|
|
114
|
+
.describe('Enable flash attention for the diffusion transformer only'),
|
|
115
|
+
lora_apply_mode: z
|
|
116
|
+
.enum(['auto', 'immediately', 'at_runtime'])
|
|
117
|
+
.optional()
|
|
118
|
+
.describe('How LoRA adapters passed via diffusion({ lora }) are applied. ' +
|
|
73
119
|
"'auto' (default): picked based on weight type — 'at_runtime' for " +
|
|
74
120
|
"quantized weights, 'immediately' for full-precision. " +
|
|
75
121
|
"'immediately': adapter is fused into the model on first use and " +
|
|
76
|
-
|
|
77
|
-
|
|
122
|
+
'persists across subsequent diffusion() calls until the model is ' +
|
|
123
|
+
'unloaded. ' +
|
|
78
124
|
"'at_runtime': adapter is applied per-call and not persisted."),
|
|
79
125
|
verbosity: z.number().optional(),
|
|
80
|
-
clipLModelSrc: modelSrcInputSchema
|
|
81
|
-
.
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
.describe(
|
|
86
|
-
|
|
87
|
-
.
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
.describe(
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
126
|
+
clipLModelSrc: modelSrcInputSchema
|
|
127
|
+
.optional()
|
|
128
|
+
.describe('CLIP-L text encoder model — required for SD3'),
|
|
129
|
+
clipGModelSrc: modelSrcInputSchema
|
|
130
|
+
.optional()
|
|
131
|
+
.describe('CLIP-G text encoder model — required for SDXL and SD3'),
|
|
132
|
+
t5XxlModelSrc: modelSrcInputSchema
|
|
133
|
+
.optional()
|
|
134
|
+
.describe('T5-XXL text encoder model — required for SD3'),
|
|
135
|
+
llmModelSrc: modelSrcInputSchema
|
|
136
|
+
.optional()
|
|
137
|
+
.describe('LLM text encoder model — required for FLUX.2 [klein] (Qwen3), ' +
|
|
138
|
+
'Ideogram 4 (Qwen3-VL), and LTX-2 video (Gemma).'),
|
|
139
|
+
vaeModelSrc: modelSrcInputSchema
|
|
140
|
+
.optional()
|
|
141
|
+
.describe('VAE decoder model — required for FLUX.2 [klein], Ideogram 4, and ' +
|
|
142
|
+
'LTX-2 video (video VAE); optional for SDXL.'),
|
|
143
|
+
highNoiseDiffusionModelSrc: modelSrcInputSchema
|
|
144
|
+
.optional()
|
|
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."),
|
|
152
|
+
clipVisionModelSrc: modelSrcInputSchema
|
|
153
|
+
.optional()
|
|
154
|
+
.describe('OpenCLIP ViT-H/14 weights (`clip_vision_h.safetensors`). Required for ' +
|
|
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.'),
|
|
168
|
+
upscaler: z
|
|
169
|
+
.object({
|
|
170
|
+
type: z
|
|
171
|
+
.literal('esrgan')
|
|
172
|
+
.optional()
|
|
173
|
+
.describe('Type of upscaler to use for post-generation upscaling when requested in diffusion({ upscale }).'),
|
|
174
|
+
model_src: modelSrcInputSchema
|
|
175
|
+
.optional()
|
|
176
|
+
.describe('ESRGAN upscaler model (e.g. RealESRGAN_x4plus_anime_6B.pth). ' +
|
|
177
|
+
'Required in diffusion mode when this `upscaler` block is set — ' +
|
|
178
|
+
'configures the post-generation upscaler invoked via diffusion({ upscale }). ' +
|
|
102
179
|
"In `mode: 'upscale'` the primary modelSrc itself is the ESRGAN model, " +
|
|
103
|
-
|
|
104
|
-
tile_size: z
|
|
105
|
-
.
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
.describe("Use direct convolution in the ESRGAN upscaler instead of im2col + " +
|
|
109
|
-
"GEMM. Faster on some backends, slower on others."),
|
|
110
|
-
offload_params_to_cpu: z.boolean().optional()
|
|
111
|
-
.describe("Keep ESRGAN upscaler weights on CPU and offload them during compute. " +
|
|
112
|
-
"Trades latency for VRAM headroom on memory-constrained GPUs."),
|
|
113
|
-
threads: z.union([
|
|
114
|
-
z.literal(-1),
|
|
115
|
-
z.number().int().positive(),
|
|
116
|
-
])
|
|
180
|
+
'so this field is ignored.'),
|
|
181
|
+
tile_size: z
|
|
182
|
+
.number()
|
|
183
|
+
.int()
|
|
184
|
+
.positive()
|
|
117
185
|
.optional()
|
|
118
|
-
.describe(
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
186
|
+
.describe('ESRGAN upscaler tile size in pixels. Smaller tiles use less VRAM ' +
|
|
187
|
+
'at the cost of more passes.'),
|
|
188
|
+
direct: z
|
|
189
|
+
.boolean()
|
|
190
|
+
.optional()
|
|
191
|
+
.describe('Use direct convolution in the ESRGAN upscaler instead of im2col + ' +
|
|
192
|
+
'GEMM. Faster on some backends, slower on others.'),
|
|
193
|
+
offload_params_to_cpu: z
|
|
194
|
+
.boolean()
|
|
195
|
+
.optional()
|
|
196
|
+
.describe('Keep ESRGAN upscaler weights on CPU and offload them during compute. ' +
|
|
197
|
+
'Trades latency for VRAM headroom on memory-constrained GPUs.'),
|
|
198
|
+
threads: z
|
|
199
|
+
.union([z.literal(-1), z.number().int().positive()])
|
|
200
|
+
.optional()
|
|
201
|
+
.describe('Number of CPU threads dedicated to the ESRGAN upscaler. -1 = auto.')
|
|
202
|
+
})
|
|
203
|
+
.strict()
|
|
204
|
+
.optional()
|
|
205
|
+
.describe('ESRGAN upscaler configuration. In diffusion mode this enables the ' +
|
|
206
|
+
'post-generation upscale path invoked via diffusion({ upscale }) and ' +
|
|
122
207
|
"requires `model_src`. In `mode: 'upscale'` only the tuning fields " +
|
|
123
|
-
|
|
124
|
-
|
|
208
|
+
'(tile_size, direct, offload_params_to_cpu, threads) are honored — ' +
|
|
209
|
+
'the primary modelSrc IS the ESRGAN model in that mode and ' +
|
|
125
210
|
"`model_src` here is ignored. In `mode: 'video'` the entire `upscaler` " +
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
211
|
+
'object is ignored. Mode-dependent constraints (e.g. `model_src` ' +
|
|
212
|
+
'required in diffusion mode) are enforced by the sdcpp-generation ' +
|
|
213
|
+
'plugin at load time, not at the schema layer.')
|
|
129
214
|
});
|
|
130
215
|
export const diffusionStatsSchema = z.object({
|
|
131
216
|
modelLoadMs: z
|
|
132
217
|
.number()
|
|
133
218
|
.optional()
|
|
134
|
-
.describe(
|
|
219
|
+
.describe('Time in milliseconds spent loading the diffusion model.'),
|
|
135
220
|
generationMs: z
|
|
136
221
|
.number()
|
|
137
222
|
.optional()
|
|
138
|
-
.describe(
|
|
139
|
-
|
|
223
|
+
.describe('Wall-clock time in milliseconds spent generating the output.'),
|
|
224
|
+
conditionerMs: z
|
|
140
225
|
.number()
|
|
141
226
|
.optional()
|
|
142
|
-
.describe(
|
|
143
|
-
|
|
227
|
+
.describe('Time in milliseconds spent conditioning the prompt before denoising.'),
|
|
228
|
+
denoiseMs: z
|
|
144
229
|
.number()
|
|
145
230
|
.optional()
|
|
146
|
-
.describe(
|
|
147
|
-
|
|
231
|
+
.describe('Time in milliseconds spent in the diffusion denoising loop.'),
|
|
232
|
+
vaeMs: z
|
|
148
233
|
.number()
|
|
149
234
|
.optional()
|
|
150
|
-
.describe(
|
|
151
|
-
|
|
235
|
+
.describe('Time in milliseconds spent decoding diffusion latents with the VAE.'),
|
|
236
|
+
postProcessMs: z
|
|
152
237
|
.number()
|
|
153
238
|
.optional()
|
|
154
|
-
.describe(
|
|
155
|
-
|
|
239
|
+
.describe('Time in milliseconds spent encoding, upscaling, muxing, and emitting outputs.'),
|
|
240
|
+
stepsPerSecond: z
|
|
156
241
|
.number()
|
|
157
242
|
.optional()
|
|
158
|
-
.describe(
|
|
159
|
-
|
|
243
|
+
.describe('Diffusion denoising throughput in sampling steps per second.'),
|
|
244
|
+
totalGenerationMs: z
|
|
160
245
|
.number()
|
|
161
246
|
.optional()
|
|
162
|
-
.describe(
|
|
163
|
-
|
|
247
|
+
.describe('Total generation time in milliseconds across all images in the batch.'),
|
|
248
|
+
totalWallMs: z
|
|
164
249
|
.number()
|
|
165
250
|
.optional()
|
|
166
|
-
.describe(
|
|
167
|
-
|
|
251
|
+
.describe('Total wall-clock time in milliseconds including model load and sampling.'),
|
|
252
|
+
totalSteps: z.number().optional().describe('Total number of diffusion sampling steps executed.'),
|
|
253
|
+
totalGenerations: z.number().optional().describe('Total number of generation passes executed.'),
|
|
254
|
+
totalImages: z.number().optional().describe('Total number of images produced.'),
|
|
255
|
+
totalPixels: z
|
|
168
256
|
.number()
|
|
169
257
|
.optional()
|
|
170
|
-
.describe(
|
|
258
|
+
.describe('Total number of pixels generated across all images.'),
|
|
259
|
+
width: z.number().optional().describe('Width in pixels of each generated image.'),
|
|
260
|
+
height: z.number().optional().describe('Height in pixels of each generated image.'),
|
|
171
261
|
seed: z
|
|
172
262
|
.number()
|
|
173
263
|
.optional()
|
|
174
|
-
.describe(
|
|
264
|
+
.describe('Seed that produced these outputs (randomized when not supplied by the caller).')
|
|
175
265
|
});
|
|
176
|
-
export const videoStatsSchema = diffusionStatsSchema
|
|
266
|
+
export const videoStatsSchema = diffusionStatsSchema
|
|
267
|
+
.pick({
|
|
177
268
|
modelLoadMs: true,
|
|
178
269
|
generationMs: true,
|
|
270
|
+
conditionerMs: true,
|
|
271
|
+
denoiseMs: true,
|
|
272
|
+
vaeMs: true,
|
|
273
|
+
postProcessMs: true,
|
|
274
|
+
stepsPerSecond: true,
|
|
179
275
|
totalGenerationMs: true,
|
|
180
276
|
totalWallMs: true,
|
|
181
277
|
totalSteps: true,
|
|
@@ -184,298 +280,287 @@ export const videoStatsSchema = diffusionStatsSchema.pick({
|
|
|
184
280
|
totalPixels: true,
|
|
185
281
|
width: true,
|
|
186
282
|
height: true,
|
|
187
|
-
seed: true
|
|
188
|
-
})
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
283
|
+
seed: true
|
|
284
|
+
})
|
|
285
|
+
.extend({
|
|
286
|
+
totalVideos: z.number().optional().describe('Total number of videos produced.'),
|
|
287
|
+
totalVideoFrames: z.number().optional().describe('Total number of video frames produced.'),
|
|
288
|
+
videoFrames: z.number().optional().describe('Frame count of the most recent generated video.'),
|
|
289
|
+
fps: z
|
|
194
290
|
.number()
|
|
195
291
|
.optional()
|
|
196
|
-
.describe(
|
|
197
|
-
|
|
198
|
-
.
|
|
292
|
+
.describe('Frames-per-second metadata for the most recent generated video.'),
|
|
293
|
+
hasAudio: z
|
|
294
|
+
.boolean()
|
|
199
295
|
.optional()
|
|
200
|
-
.describe(
|
|
201
|
-
|
|
296
|
+
.describe('True when the output AVI includes a muxed audio track (LTX-2 loaded ' +
|
|
297
|
+
'with audioVaeModelSrc), false otherwise.'),
|
|
298
|
+
audioSampleRate: z
|
|
202
299
|
.number()
|
|
203
300
|
.optional()
|
|
204
|
-
.describe(
|
|
301
|
+
.describe('Sample rate (Hz) of the muxed audio track; 0 when there is no audio.')
|
|
205
302
|
});
|
|
206
303
|
export const diffusionStreamResponseSchema = z.object({
|
|
207
|
-
type: z.literal(
|
|
304
|
+
type: z.literal('diffusionStream'),
|
|
208
305
|
step: z.number().optional(),
|
|
209
306
|
totalSteps: z.number().optional(),
|
|
210
307
|
elapsedMs: z.number().optional(),
|
|
211
308
|
data: z.string().optional(),
|
|
212
309
|
outputIndex: z.number().optional(),
|
|
213
310
|
done: z.boolean().optional(),
|
|
214
|
-
stats: diffusionStatsSchema.optional()
|
|
311
|
+
stats: diffusionStatsSchema.optional()
|
|
215
312
|
});
|
|
216
313
|
export const videoStreamResponseSchema = z.object({
|
|
217
|
-
type: z.literal(
|
|
314
|
+
type: z.literal('videoStream'),
|
|
218
315
|
step: z.number().optional(),
|
|
219
316
|
totalSteps: z.number().optional(),
|
|
220
317
|
elapsedMs: z.number().optional(),
|
|
221
318
|
data: z.string().optional(),
|
|
222
319
|
outputIndex: z.number().optional(),
|
|
223
320
|
done: z.boolean().optional(),
|
|
224
|
-
stats: videoStatsSchema.optional()
|
|
321
|
+
stats: videoStatsSchema.optional()
|
|
225
322
|
});
|
|
226
|
-
export const diffusionRequestSchema = z
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
prompt: z.string().describe("Positive prompt describing the image to generate."),
|
|
323
|
+
export const diffusionRequestSchema = z
|
|
324
|
+
.object({
|
|
325
|
+
modelId: z.string().describe('The identifier of the diffusion model to use for generation.'),
|
|
326
|
+
prompt: z.string().describe('Positive prompt describing the image to generate.'),
|
|
231
327
|
negative_prompt: z
|
|
232
328
|
.string()
|
|
233
329
|
.optional()
|
|
234
|
-
.describe(
|
|
330
|
+
.describe('Optional negative prompt describing what to avoid.'),
|
|
235
331
|
width: z
|
|
236
332
|
.number()
|
|
237
333
|
.int()
|
|
238
334
|
.positive()
|
|
239
335
|
.multipleOf(8)
|
|
240
336
|
.optional()
|
|
241
|
-
.describe(
|
|
337
|
+
.describe('Image width in pixels (must be a multiple of 8).'),
|
|
242
338
|
height: z
|
|
243
339
|
.number()
|
|
244
340
|
.int()
|
|
245
341
|
.positive()
|
|
246
342
|
.multipleOf(8)
|
|
247
343
|
.optional()
|
|
248
|
-
.describe(
|
|
249
|
-
steps: z
|
|
250
|
-
.number()
|
|
251
|
-
.int()
|
|
252
|
-
.positive()
|
|
253
|
-
.optional()
|
|
254
|
-
.describe("Number of sampling steps to run."),
|
|
344
|
+
.describe('Image height in pixels (must be a multiple of 8).'),
|
|
345
|
+
steps: z.number().int().positive().optional().describe('Number of sampling steps to run.'),
|
|
255
346
|
cfg_scale: z
|
|
256
347
|
.number()
|
|
257
348
|
.optional()
|
|
258
|
-
.describe(
|
|
349
|
+
.describe('Classifier-free guidance scale for SD 1.x / 2.x / XL / SD3 models; typical range 1–20, default 7'),
|
|
259
350
|
img_cfg_scale: z
|
|
260
351
|
.number()
|
|
261
352
|
.default(-1)
|
|
262
|
-
.describe(
|
|
353
|
+
.describe('Image CFG scale for img2img/inpaint workflows where the image and prompt should have different guidance weights; defaults to -1 which reuses cfg_scale'),
|
|
263
354
|
guidance: z
|
|
264
355
|
.number()
|
|
265
356
|
.optional()
|
|
266
|
-
.describe(
|
|
357
|
+
.describe('Distilled guidance for FLUX models; typical range 1–10, default 3.5'),
|
|
267
358
|
sampling_method: samplingMethodSchema
|
|
268
359
|
.optional()
|
|
269
|
-
.describe(
|
|
270
|
-
scheduler: scheduleTypeSchema
|
|
271
|
-
.optional()
|
|
272
|
-
.describe("Noise schedule to apply when sampling."),
|
|
360
|
+
.describe('Sampling algorithm used by the diffusion scheduler.'),
|
|
361
|
+
scheduler: scheduleTypeSchema.optional().describe('Noise schedule to apply when sampling.'),
|
|
273
362
|
seed: z
|
|
274
363
|
.number()
|
|
275
364
|
.int()
|
|
276
365
|
.optional()
|
|
277
|
-
.describe(
|
|
366
|
+
.describe('Random seed; when omitted the SDK picks one and returns it in stats.'),
|
|
278
367
|
batch_count: z
|
|
279
368
|
.number()
|
|
280
369
|
.int()
|
|
281
370
|
.positive()
|
|
282
371
|
.optional()
|
|
283
|
-
.describe(
|
|
372
|
+
.describe('Number of images to generate in this call.'),
|
|
284
373
|
vae_tiling: z
|
|
285
374
|
.boolean()
|
|
286
375
|
.optional()
|
|
287
|
-
.describe(
|
|
376
|
+
.describe('Enable VAE tiling for large images on constrained VRAM (overrides model config).'),
|
|
288
377
|
cache_preset: z
|
|
289
378
|
.string()
|
|
290
379
|
.optional()
|
|
291
|
-
.describe(
|
|
380
|
+
.describe('Optional name of a cached sampler preset to reuse.'),
|
|
292
381
|
init_image: base64StringSchema
|
|
293
382
|
.optional()
|
|
294
|
-
.describe(
|
|
295
|
-
init_images: z
|
|
383
|
+
.describe('Base64-encoded image for img2img generation. Mutually exclusive with init_images.'),
|
|
384
|
+
init_images: z
|
|
385
|
+
.array(base64StringSchema)
|
|
296
386
|
.min(1)
|
|
297
387
|
.optional()
|
|
298
|
-
.describe(
|
|
299
|
-
|
|
300
|
-
|
|
388
|
+
.describe('FLUX.2-only multi-reference fusion: array of base64-encoded PNG/JPEG buffers. ' +
|
|
389
|
+
'Each buffer becomes a separate reference image that the FLUX.2 transformer attends to. ' +
|
|
390
|
+
'Mutually exclusive with init_image; requires the model to be loaded with ' +
|
|
301
391
|
"config.prediction='flux2_flow' and a Qwen3 text encoder via llmModelSrc."),
|
|
302
|
-
increase_ref_index: z
|
|
303
|
-
.
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
392
|
+
increase_ref_index: z
|
|
393
|
+
.boolean()
|
|
394
|
+
.optional()
|
|
395
|
+
.describe('FLUX.2 fusion only. When omitted, the addon default (false) is used. When false, all ' +
|
|
396
|
+
'reference latents share one RoPE index slot and blend via attention (recommended for ' +
|
|
397
|
+
'FLUX.2-klein). When true, each reference gets its own RoPE index slot — use only with ' +
|
|
398
|
+
'text encoders that receive per-image vision tokens.'),
|
|
399
|
+
auto_resize_ref_image: z
|
|
400
|
+
.boolean()
|
|
401
|
+
.optional()
|
|
402
|
+
.describe('FLUX.2 only. When omitted, the addon default (true) is used. When true, every reference ' +
|
|
403
|
+
'image (single or fusion) is auto-resized to the target width/height before VAE-encoding. ' +
|
|
404
|
+
'Disable only if the buffers are already at the exact target dimensions.'),
|
|
311
405
|
lora: z
|
|
312
406
|
.string()
|
|
313
407
|
.min(1)
|
|
314
408
|
.regex(ABSOLUTE_PATH_PATTERN, {
|
|
315
|
-
message:
|
|
409
|
+
message: 'lora must be an absolute path'
|
|
316
410
|
})
|
|
317
411
|
.optional()
|
|
318
|
-
.describe(
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
412
|
+
.describe('Optional local LoRA adapter path to apply for this generation. ' +
|
|
413
|
+
'Must be an absolute filesystem path. ' +
|
|
414
|
+
'Whether the adapter persists across subsequent diffusion() calls is controlled ' +
|
|
415
|
+
'by sdcppConfigSchema.lora_apply_mode (set at loadModel time).'),
|
|
322
416
|
strength: z
|
|
323
417
|
.number()
|
|
324
418
|
.min(0)
|
|
325
419
|
.max(1)
|
|
326
420
|
.optional()
|
|
327
|
-
.describe(
|
|
421
|
+
.describe('img2img denoising strength (0.0 = keep source, 1.0 = ignore source); used by the SD/SDXL SDEdit path. No-op for FLUX.2, which uses in-context conditioning and ignores this field.'),
|
|
328
422
|
upscale: z
|
|
329
423
|
.union([
|
|
330
424
|
z.boolean(),
|
|
331
|
-
z
|
|
332
|
-
|
|
333
|
-
|
|
425
|
+
z
|
|
426
|
+
.object({
|
|
427
|
+
repeats: z.number().int().positive().optional()
|
|
428
|
+
})
|
|
429
|
+
.strict()
|
|
334
430
|
])
|
|
335
431
|
.optional()
|
|
336
|
-
.describe(
|
|
337
|
-
|
|
432
|
+
.describe('Post-generation ESRGAN upscale. ' +
|
|
433
|
+
'`true` (or `{}` / `{ repeats: 1 }`) runs a single upscale pass at the ' +
|
|
338
434
|
"model's native scale factor (e.g. x4 for RealESRGAN_x4plus). " +
|
|
339
|
-
|
|
340
|
-
|
|
435
|
+
'`false` is a no-op (same as omitting the field). ' +
|
|
436
|
+
'`{ repeats: N }` runs the upscaler N times sequentially — each pass ' +
|
|
341
437
|
"multiplies the output dimensions by the model's scale factor. When " +
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
})
|
|
345
|
-
|
|
438
|
+
'`batch_count > 1`, every output image is upscaled independently. ' +
|
|
439
|
+
'Requires the model to be loaded with `upscaler.model_src` set in modelConfig.')
|
|
440
|
+
})
|
|
441
|
+
.refine((d) => d.init_image === undefined || d.init_images === undefined, {
|
|
442
|
+
message: 'init_image and init_images are mutually exclusive — pass one or the other, not both.'
|
|
346
443
|
});
|
|
347
444
|
export const diffusionStreamRequestSchema = diffusionRequestSchema.extend({
|
|
348
|
-
type: z.literal(
|
|
445
|
+
type: z.literal('diffusionStream')
|
|
349
446
|
});
|
|
350
447
|
const videoGenerationBaseSchema = z.object({
|
|
351
448
|
modelId: z
|
|
352
449
|
.string()
|
|
353
|
-
.describe(
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
450
|
+
.describe('The identifier of the loaded video model to use for generation. ' +
|
|
451
|
+
'On React Native, prefer a `modelId` loaded with a `delegate` because ' +
|
|
452
|
+
'the video diffusion models currently shipped by the SDK are too ' +
|
|
453
|
+
'large to load on typical mobile devices.'),
|
|
357
454
|
requestId: z
|
|
358
455
|
.string()
|
|
359
456
|
.min(1)
|
|
360
457
|
.optional()
|
|
361
|
-
.describe(
|
|
362
|
-
prompt: z.string().describe(
|
|
458
|
+
.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.'),
|
|
459
|
+
prompt: z.string().describe('Positive prompt describing the video to generate.'),
|
|
363
460
|
negative_prompt: z
|
|
364
461
|
.string()
|
|
365
462
|
.optional()
|
|
366
|
-
.describe(
|
|
463
|
+
.describe('Optional negative prompt describing what to avoid.'),
|
|
367
464
|
width: z
|
|
368
465
|
.number()
|
|
369
466
|
.int()
|
|
370
467
|
.positive()
|
|
371
468
|
.multipleOf(16)
|
|
372
469
|
.optional()
|
|
373
|
-
.describe(
|
|
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.'),
|
|
374
472
|
height: z
|
|
375
473
|
.number()
|
|
376
474
|
.int()
|
|
377
475
|
.positive()
|
|
378
476
|
.multipleOf(16)
|
|
379
477
|
.optional()
|
|
380
|
-
.describe(
|
|
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.'),
|
|
381
480
|
video_frames: z
|
|
382
481
|
.number()
|
|
383
482
|
.int()
|
|
384
483
|
.refine((value) => value >= 5 && (value - 1) % 4 === 0, {
|
|
385
|
-
message:
|
|
484
|
+
message: 'video_frames must be an integer >= 5 of the form (4*k + 1)'
|
|
386
485
|
})
|
|
387
486
|
.optional()
|
|
388
|
-
.describe(
|
|
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.'),
|
|
389
490
|
fps: z
|
|
390
491
|
.number()
|
|
391
492
|
.positive()
|
|
392
493
|
.max(120)
|
|
393
494
|
.optional()
|
|
394
|
-
.describe(
|
|
495
|
+
.describe('AVI framerate metadata in frames per second; must be in (0, 120].'),
|
|
395
496
|
seed: z
|
|
396
497
|
.number()
|
|
397
498
|
.int()
|
|
398
499
|
.optional()
|
|
399
|
-
.describe(
|
|
500
|
+
.describe('Random seed; when omitted the SDK picks one and returns it in stats.'),
|
|
400
501
|
steps: z
|
|
401
502
|
.number()
|
|
402
503
|
.int()
|
|
403
504
|
.positive()
|
|
404
505
|
.optional()
|
|
405
|
-
.describe(
|
|
506
|
+
.describe('Low-noise or single-expert denoising step count.'),
|
|
406
507
|
sampling_method: samplingMethodSchema
|
|
407
508
|
.optional()
|
|
408
|
-
.describe(
|
|
509
|
+
.describe('Sampling algorithm used by the low-noise diffusion scheduler.'),
|
|
409
510
|
scheduler: scheduleTypeSchema
|
|
410
511
|
.optional()
|
|
411
|
-
.describe(
|
|
412
|
-
cfg_scale: z
|
|
413
|
-
|
|
414
|
-
.optional()
|
|
415
|
-
.describe("Classifier-free guidance scale."),
|
|
416
|
-
flow_shift: z
|
|
417
|
-
.number()
|
|
418
|
-
.optional()
|
|
419
|
-
.describe("Per-request flow-matching guidance shift override."),
|
|
512
|
+
.describe('Noise schedule to apply for the low-noise diffusion path.'),
|
|
513
|
+
cfg_scale: z.number().optional().describe('Classifier-free guidance scale.'),
|
|
514
|
+
flow_shift: z.number().optional().describe('Per-request flow-matching guidance shift override.'),
|
|
420
515
|
high_noise_steps: z
|
|
421
516
|
.number()
|
|
422
517
|
.int()
|
|
423
518
|
.positive()
|
|
424
519
|
.optional()
|
|
425
|
-
.describe(
|
|
520
|
+
.describe('Wan 2.2 high-noise expert step count.'),
|
|
426
521
|
high_noise_sampler: samplingMethodSchema
|
|
427
522
|
.optional()
|
|
428
|
-
.describe(
|
|
523
|
+
.describe('Wan 2.2 high-noise expert sampler.'),
|
|
429
524
|
high_noise_scheduler: scheduleTypeSchema
|
|
430
525
|
.optional()
|
|
431
|
-
.describe(
|
|
432
|
-
high_noise_cfg_scale: z
|
|
433
|
-
.number()
|
|
434
|
-
.optional()
|
|
435
|
-
.describe("Wan 2.2 high-noise expert CFG scale."),
|
|
526
|
+
.describe('Wan 2.2 high-noise expert scheduler.'),
|
|
527
|
+
high_noise_cfg_scale: z.number().optional().describe('Wan 2.2 high-noise expert CFG scale.'),
|
|
436
528
|
high_noise_flow_shift: z
|
|
437
529
|
.number()
|
|
438
530
|
.optional()
|
|
439
|
-
.describe(
|
|
531
|
+
.describe('Wan 2.2 high-noise expert flow shift override.'),
|
|
440
532
|
moe_boundary: z
|
|
441
533
|
.number()
|
|
442
534
|
.min(0)
|
|
443
535
|
.max(1)
|
|
444
536
|
.optional()
|
|
445
|
-
.describe(
|
|
446
|
-
vace_strength: z
|
|
447
|
-
|
|
448
|
-
.
|
|
449
|
-
.max(1)
|
|
450
|
-
.optional()
|
|
451
|
-
.describe("Control-frame guidance strength."),
|
|
452
|
-
control_frames: z.array(base64StringSchema)
|
|
537
|
+
.describe('Wan 2.2 mixture-of-experts boundary in [0, 1].'),
|
|
538
|
+
vace_strength: z.number().min(0).max(1).optional().describe('Control-frame guidance strength.'),
|
|
539
|
+
control_frames: z
|
|
540
|
+
.array(base64StringSchema)
|
|
453
541
|
.min(1)
|
|
454
542
|
.optional()
|
|
455
|
-
.describe(
|
|
543
|
+
.describe('Optional array of base64-encoded control-frame images.'),
|
|
456
544
|
vae_tiling: z
|
|
457
545
|
.boolean()
|
|
458
546
|
.optional()
|
|
459
|
-
.describe(
|
|
547
|
+
.describe('Enable VAE tiling for large videos on constrained VRAM.'),
|
|
460
548
|
vae_tile_size: z
|
|
461
549
|
.union([z.number().positive(), z.string().min(1)])
|
|
462
550
|
.optional()
|
|
463
|
-
.describe(
|
|
464
|
-
vae_tile_overlap: z
|
|
465
|
-
|
|
466
|
-
.
|
|
467
|
-
.describe("VAE tile overlap override."),
|
|
468
|
-
cache_mode: cacheModeSchema
|
|
551
|
+
.describe('VAE tile size override.'),
|
|
552
|
+
vae_tile_overlap: z.number().optional().describe('VAE tile overlap override.'),
|
|
553
|
+
temporal_tiling: z
|
|
554
|
+
.boolean()
|
|
469
555
|
.optional()
|
|
470
|
-
.describe(
|
|
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).'),
|
|
558
|
+
cache_mode: cacheModeSchema.optional().describe('Step-caching algorithm.'),
|
|
471
559
|
cache_preset: z
|
|
472
560
|
.string()
|
|
473
561
|
.optional()
|
|
474
|
-
.describe(
|
|
475
|
-
cache_threshold: z
|
|
476
|
-
.number()
|
|
477
|
-
.optional()
|
|
478
|
-
.describe("Direct cache reuse threshold override."),
|
|
562
|
+
.describe('Optional name of a cached sampler preset to reuse.'),
|
|
563
|
+
cache_threshold: z.number().optional().describe('Direct cache reuse threshold override.')
|
|
479
564
|
});
|
|
480
565
|
// Single wire object with mode-dependent rules expressed via a shared refine.
|
|
481
566
|
// Keeping the wire schema a plain object (instead of a discriminated union)
|
|
@@ -485,46 +570,71 @@ const videoGenerationBaseSchema = z.object({
|
|
|
485
570
|
// discriminated union types below.
|
|
486
571
|
const videoRequestObjectSchema = videoGenerationBaseSchema.extend({
|
|
487
572
|
mode: z
|
|
488
|
-
.enum([
|
|
573
|
+
.enum(['txt2vid', 'img2vid'])
|
|
489
574
|
.describe("Generation mode: 'txt2vid' (no source frame) or 'img2vid' (first-frame image)."),
|
|
490
575
|
init_image: base64StringSchema
|
|
491
576
|
.optional()
|
|
492
|
-
.describe(
|
|
577
|
+
.describe('Base64-encoded first-frame image (PNG/JPEG). Required for img2vid; rejected for txt2vid.'),
|
|
493
578
|
strength: z
|
|
494
579
|
.number()
|
|
495
580
|
.min(0)
|
|
496
581
|
.max(1)
|
|
497
582
|
.optional()
|
|
498
|
-
.describe(
|
|
583
|
+
.describe('img2vid denoise strength in [0, 1]; rejected for txt2vid.')
|
|
499
584
|
});
|
|
500
585
|
function refineVideoMode(data, ctx) {
|
|
501
|
-
if (data.mode ===
|
|
586
|
+
if (data.mode === 'img2vid' && data.init_image === undefined) {
|
|
502
587
|
ctx.addIssue({
|
|
503
|
-
code:
|
|
504
|
-
path: [
|
|
505
|
-
message: "init_image is required when mode is 'img2vid'."
|
|
588
|
+
code: 'custom',
|
|
589
|
+
path: ['init_image'],
|
|
590
|
+
message: "init_image is required when mode is 'img2vid'."
|
|
506
591
|
});
|
|
507
592
|
}
|
|
508
|
-
if (data.mode ===
|
|
593
|
+
if (data.mode === 'txt2vid') {
|
|
509
594
|
if (data.init_image !== undefined) {
|
|
510
595
|
ctx.addIssue({
|
|
511
|
-
code:
|
|
512
|
-
path: [
|
|
513
|
-
message:
|
|
596
|
+
code: 'custom',
|
|
597
|
+
path: ['init_image'],
|
|
598
|
+
message: 'init_image is only valid for img2vid.'
|
|
514
599
|
});
|
|
515
600
|
}
|
|
516
601
|
if (data.strength !== undefined) {
|
|
517
602
|
ctx.addIssue({
|
|
518
|
-
code:
|
|
519
|
-
path: [
|
|
520
|
-
message:
|
|
603
|
+
code: 'custom',
|
|
604
|
+
path: ['strength'],
|
|
605
|
+
message: 'strength is only valid for img2vid.'
|
|
521
606
|
});
|
|
522
607
|
}
|
|
523
608
|
}
|
|
524
609
|
}
|
|
525
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);
|
|
526
636
|
export const videoStreamRequestSchema = videoRequestObjectSchema
|
|
527
|
-
.extend({ type: z.literal(
|
|
637
|
+
.extend({ type: z.literal('videoStream') })
|
|
528
638
|
.superRefine(refineVideoMode);
|
|
529
639
|
// ============================================
|
|
530
640
|
// Standalone ESRGAN upscale (mode: "upscale")
|
|
@@ -533,70 +643,64 @@ export const upscaleStatsSchema = z.object({
|
|
|
533
643
|
modelLoadMs: z
|
|
534
644
|
.number()
|
|
535
645
|
.optional()
|
|
536
|
-
.describe(
|
|
646
|
+
.describe('Wall-clock time in milliseconds spent loading the upscaler model.'),
|
|
537
647
|
upscaleMs: z
|
|
538
648
|
.number()
|
|
539
649
|
.optional()
|
|
540
|
-
.describe(
|
|
650
|
+
.describe('Wall-clock time in milliseconds for the most recent upscale job.'),
|
|
541
651
|
totalUpscaleMs: z
|
|
542
652
|
.number()
|
|
543
653
|
.optional()
|
|
544
|
-
.describe(
|
|
654
|
+
.describe('Cumulative upscale time in milliseconds across all jobs.'),
|
|
545
655
|
totalWallMs: z
|
|
546
656
|
.number()
|
|
547
657
|
.optional()
|
|
548
|
-
.describe(
|
|
549
|
-
totalUpscales: z
|
|
550
|
-
|
|
551
|
-
.optional()
|
|
552
|
-
.describe("Cumulative number of upscale calls."),
|
|
553
|
-
totalImages: z
|
|
554
|
-
.number()
|
|
555
|
-
.optional()
|
|
556
|
-
.describe("Cumulative number of images produced."),
|
|
658
|
+
.describe('Total wall-clock time in milliseconds including model load and upscaling.'),
|
|
659
|
+
totalUpscales: z.number().optional().describe('Cumulative number of upscale calls.'),
|
|
660
|
+
totalImages: z.number().optional().describe('Cumulative number of images produced.'),
|
|
557
661
|
totalPixels: z
|
|
558
662
|
.number()
|
|
559
663
|
.optional()
|
|
560
|
-
.describe(
|
|
561
|
-
width: z.number().optional().describe(
|
|
562
|
-
height: z.number().optional().describe(
|
|
664
|
+
.describe('Cumulative number of pixels produced across all images.'),
|
|
665
|
+
width: z.number().optional().describe('Width of the most recent emitted PNG.'),
|
|
666
|
+
height: z.number().optional().describe('Height of the most recent emitted PNG.'),
|
|
563
667
|
repeats: z
|
|
564
668
|
.number()
|
|
565
669
|
.optional()
|
|
566
|
-
.describe(
|
|
670
|
+
.describe('Number of ESRGAN passes used by the most recent upscale job.'),
|
|
567
671
|
backendDevice: z
|
|
568
|
-
.enum([
|
|
672
|
+
.enum(['cpu', 'gpu'])
|
|
569
673
|
.optional()
|
|
570
|
-
.describe(
|
|
571
|
-
|
|
572
|
-
|
|
674
|
+
.describe('Actual compute device used by the ESRGAN upscaler. ' +
|
|
675
|
+
'Reflects the backend stable-diffusion.cpp selected (e.g. Android `gpu` ' +
|
|
676
|
+
'falls back to `cpu` because the mobile GPU/OpenCL path is unstable).')
|
|
573
677
|
});
|
|
574
678
|
export const upscaleRequestSchema = z.object({
|
|
575
679
|
modelId: z
|
|
576
680
|
.string()
|
|
577
|
-
.describe(
|
|
681
|
+
.describe('Identifier of the loaded upscaler model. The model must have been loaded ' +
|
|
578
682
|
"with `modelType: 'diffusion'` and `modelConfig.mode: 'upscale'`."),
|
|
579
683
|
image: z
|
|
580
684
|
.string()
|
|
581
685
|
.min(1)
|
|
582
686
|
.regex(BASE64_PATTERN)
|
|
583
|
-
.describe(
|
|
687
|
+
.describe('Base64-encoded PNG/JPEG bytes of the source image.'),
|
|
584
688
|
repeats: z
|
|
585
689
|
.number()
|
|
586
690
|
.int()
|
|
587
691
|
.positive()
|
|
588
692
|
.optional()
|
|
589
|
-
.describe(
|
|
693
|
+
.describe('Number of ESRGAN passes to run sequentially. Each pass multiplies ' +
|
|
590
694
|
"dimensions by the model's native scale factor; only the final image " +
|
|
591
|
-
|
|
695
|
+
'is emitted (`outputs.length === 1`). Defaults to 1.')
|
|
592
696
|
});
|
|
593
697
|
export const upscaleStreamRequestSchema = upscaleRequestSchema.extend({
|
|
594
|
-
type: z.literal(
|
|
698
|
+
type: z.literal('upscaleStream')
|
|
595
699
|
});
|
|
596
700
|
export const upscaleStreamResponseSchema = z.object({
|
|
597
|
-
type: z.literal(
|
|
701
|
+
type: z.literal('upscaleStream'),
|
|
598
702
|
data: z.string().optional(),
|
|
599
703
|
outputIndex: z.number().optional(),
|
|
600
704
|
done: z.boolean().optional(),
|
|
601
|
-
stats: upscaleStatsSchema.optional()
|
|
705
|
+
stats: upscaleStatsSchema.optional()
|
|
602
706
|
});
|