mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-05 23:02:10 +03:00
Add 6 TTS providers (Nvidia NIM, ElevenLabs, HuggingFace, Coqui, Tortoise, Qwen3), 3 STT providers (Nvidia NIM, HuggingFace, Qwen3), 2 local image providers (SD WebUI, ComfyUI), and two new modalities — Text-to-Video (/v1/videos/generations) and Text-to-Music (/v1/music/generations). Key design decisions: - Format-based unified providers: local providers grouped by API format (comfyui, sdwebui, coqui, tortoise, openai-compatible) with configurable base URLs and expandable model lists - Cloud providers kept separate (unique auth and API shapes) - Local providers use authType: "none" — credential checks bypassed at both route and handler level - Shared ComfyUI client (comfyuiClient.ts) reused across image/video/music - Shared registry utilities (registryUtils.ts) for model parsing and listing - Qwen3 TTS/ASR use format: "openai" — no custom handler needed Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
69 lines
1.5 KiB
TypeScript
69 lines
1.5 KiB
TypeScript
/**
|
|
* Video Generation Provider Registry
|
|
*
|
|
* Defines providers that support the /v1/videos/generations endpoint.
|
|
* Currently supports local providers (ComfyUI, SD WebUI with AnimateDiff).
|
|
*/
|
|
|
|
import { parseModelFromRegistry, getAllModelsFromRegistry } from "./registryUtils.ts";
|
|
|
|
interface VideoModel {
|
|
id: string;
|
|
name: string;
|
|
}
|
|
|
|
interface VideoProvider {
|
|
id: string;
|
|
baseUrl: string;
|
|
authType: string;
|
|
authHeader: string;
|
|
format: string;
|
|
models: VideoModel[];
|
|
}
|
|
|
|
export const VIDEO_PROVIDERS: Record<string, VideoProvider> = {
|
|
comfyui: {
|
|
id: "comfyui",
|
|
baseUrl: "http://localhost:8188",
|
|
authType: "none",
|
|
authHeader: "none",
|
|
format: "comfyui",
|
|
models: [
|
|
{ id: "animatediff", name: "AnimateDiff" },
|
|
{ id: "svd-xt", name: "Stable Video Diffusion XT" },
|
|
],
|
|
},
|
|
|
|
sdwebui: {
|
|
id: "sdwebui",
|
|
baseUrl: "http://localhost:7860",
|
|
authType: "none",
|
|
authHeader: "none",
|
|
format: "sdwebui-video",
|
|
models: [
|
|
{ id: "animatediff-webui", name: "AnimateDiff (WebUI)" },
|
|
],
|
|
},
|
|
};
|
|
|
|
/**
|
|
* Get video provider config by ID
|
|
*/
|
|
export function getVideoProvider(providerId: string): VideoProvider | null {
|
|
return VIDEO_PROVIDERS[providerId] || null;
|
|
}
|
|
|
|
/**
|
|
* Parse video model string (format: "provider/model" or just "model")
|
|
*/
|
|
export function parseVideoModel(modelStr: string | null) {
|
|
return parseModelFromRegistry(modelStr, VIDEO_PROVIDERS);
|
|
}
|
|
|
|
/**
|
|
* Get all video models as a flat list
|
|
*/
|
|
export function getAllVideoModels() {
|
|
return getAllModelsFromRegistry(VIDEO_PROVIDERS);
|
|
}
|