The open creative studio on ComfyUI: images, video, 3D and audio on open weights, on your own GPU or the cloud. Camera motions, effects, apps, Cinema, Layers, Image to 3D and an AI agent.
TypeScript ai-videocomfyuicreative-toolsgenerative-aiideogramimage-generationimage-to-3dimage-to-videoltx-videominimax-h3nextjsopen-sourceopen-weightsqwen-imagetext-to-imagevideo-generationwan
Voices: Qwen3-TTS on fal designs a voice from words and clones a sample in two steps, and a saved voice keeps its model and words
Claude49c8cfaad204
diff --git a/docs/research/new-models-10.json b/docs/research/new-models-10.jsonindex deeb7dee..99c5f512 100644--- a/docs/research/new-models-10.json+++ b/docs/research/new-models-10.json@@ -804,11 +804,17 @@"endpoint": "fal-ai/qwen-3-tts/text-to-speech/1.7b"}],- "comfy": "custom: 1038lab/ComfyUI-QwenTTS and others",+ "comfy": "custom: 1038lab/ComfyUI-QwenTTS @ d8122a8b (GPL-3.0 code; Voice Design and Voice Clone nodes; the pack downloads the weights into models/TTS/Qwen3-TTS/<repo name>)","released": "2026-01 (older, not in Fuobe)","url": "https://huggingface.co/Qwen/Qwen3-TTS-12Hz-1.7B-Base",- "inFuobe": false,- "confirmed": true+ "inFuobe": true,+ "confirmed": true,+ "builtBy": "nm10-voice-design",+ "revisions": {+ "Qwen/Qwen3-TTS-12Hz-1.7B-Base": "fd4b254389122332181a7c3db7f27e918eec64e3",+ "Qwen/Qwen3-TTS-12Hz-1.7B-VoiceDesign": "5ecdb67327fd37bb2e042aab12ff7391903235d3",+ "Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice": "0c0e3051f131929182e2c023b9537f8b1c68adfe"+ }},{"name": "VoxCPM2",@@ -816,11 +822,12 @@"licence": "Apache-2.0","vram": "~8 GB","hosted": [],- "comfy": "custom: Saganaki22/ComfyUI-VoxCPM2, RunningHub ComfyUI_RH_VoxCPM",+ "comfy": "custom: Saganaki22/ComfyUI-VoxCPM2 @ 0e52a6cd (Apache-2.0; VoxCPM2_TTS with voice_description, VoxCPM2_Clone: controllable without a transcript, ultimate with prompt_text; reference up to 50 s; weights downloaded into models/tts/VoxCPM/VoxCPM2)","released": "2026-04-03 (older, trending)","url": "https://huggingface.co/openbmb/VoxCPM2",- "inFuobe": false,- "confirmed": true+ "inFuobe": true,+ "confirmed": true,+ "builtBy": "nm10-voice-design"},{"name": "Fish Audio Drama 3",@@ -832,7 +839,8 @@"released": "2026-10-01 weights; 2026-10-13 partner node","url": "https://huggingface.co/fishaudio/drama-3","inFuobe": false,- "confirmed": true+ "confirmed": true,+ "consideredNotBuilt": "nm10-voice-design (2026-11-02): no local ComfyUI node (only the Fish Audio API partner node) and not hosted on fal or Replicate; running it locally needs an SGLang-Omni worker (35B MoE, about 40 GB). Left for a later package."},{"name": "VEED Dubbing / Dubbing Pro",@@ -3561,6 +3569,380 @@"schemaUrl": "https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=blackforestlabs/flux-3/klein/base/edit-image","capability": "edit","fetched": "2026-11-01"+ },+ {+ "family": "qwen-tts",+ "vendor": "Alibaba Qwen",+ "provider": "fal",+ "status": "active",+ "verified": true,+ "checked": "2026-11-02",+ "model": "Qwen3-TTS voice design",+ "title": "Qwen 3 TTS - Voice Design [1.7B]",+ "operation": "voice-design",+ "endpoint": "fal-ai/qwen-3-tts/voice-design/1.7b",+ "falCategory": "text-to-speech",+ "keyFields": {+ "prompt": "text",+ "voiceDescription": "prompt"+ },+ "inputs": {+ "subtalker_temperature": {+ "nullable": true,+ "minimum": 0,+ "maximum": 1,+ "type": "number",+ "required": false,+ "default": 0.9,+ "desc": "Temperature for sub-talker sampling."+ },+ "temperature": {+ "nullable": true,+ "maximum": 1,+ "type": "number",+ "required": false,+ "default": 0.9,+ "desc": "Sampling temperature; higher => more random."+ },+ "enable_safety_checker": {+ "type": "boolean",+ "required": false,+ "default": true,+ "desc": "Authorized callers may set false to request relaxed screening."+ },+ "max_new_tokens": {+ "nullable": true,+ "minimum": 1,+ "maximum": 8192,+ "type": "integer",+ "required": false,+ "default": 200,+ "desc": "Maximum number of new codec tokens to generate."+ },+ "top_k": {+ "nullable": true,+ "minimum": 0,+ "type": "integer",+ "required": false,+ "default": 50,+ "desc": "Top-k sampling parameter."+ },+ "text": {+ "type": "string",+ "required": true,+ "desc": "The text to be converted to speech.",+ "examples": [+ "It's in the top drawer... wait, it's empty? No way, that's impossible! I'm sure I put it there!"+ ]+ },+ "language": {+ "type": "enum",+ "values": [+ "Auto",+ "English",+ "Chinese",+ "Spanish",+ "French",+ "German",+ "Italian",+ "Japanese",+ "Korean",+ "Portuguese",+ "Russian"+ ],+ "required": false,+ "default": "Auto",+ "desc": "The language of the voice to be designed.",+ "examples": [+ "English"+ ]+ },+ "top_p": {+ "nullable": true,+ "minimum": 0,+ "maximum": 1,+ "type": "number",+ "required": false,+ "default": 1,+ "desc": "Top-p sampling parameter."+ },+ "subtalker_top_k": {+ "nullable": true,+ "minimum": 0,+ "type": "integer",+ "required": false,+ "default": 50,+ "desc": "Top-k for sub-talker sampling."+ },+ "prompt": {+ "type": "string",+ "required": true,+ "desc": "Optional prompt to guide the style of the generated speech.",+ "examples": [+ "Speak in an incredulous tone, but with a hint of panic beginning to creep into your voice."+ ]+ },+ "subtalker_dosample": {+ "nullable": true,+ "type": "boolean",+ "required": false,+ "default": true,+ "desc": "Sampling switch for the sub-talker."+ },+ "repetition_penalty": {+ "nullable": true,+ "minimum": 0,+ "type": "number",+ "required": false,+ "default": 1.05,+ "desc": "Penalty to reduce repeated tokens/codes."+ },+ "subtalker_top_p": {+ "nullable": true,+ "minimum": 0,+ "maximum": 1,+ "type": "number",+ "required": false,+ "default": 1,+ "desc": "Top-p for sub-talker sampling."+ }+ },+ "output": "audio (AudioFile)",+ "price": "$0.09 per 1000 characters",+ "notes": "prompt describes the voice, text is the line spoken. Returns audio only: no reusable voice id, so a designed voice is reused by cloning the chosen take (clone-voice, then text-to-speech with the embedding). max_new_tokens defaults to 200 codec tokens (12 Hz: about 16 s); Fuobe sends 4096.",+ "sourceUrl": "https://fal.ai/models/fal-ai/qwen-3-tts/voice-design/1.7b/api",+ "schemaUrl": "https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=fal-ai/qwen-3-tts/voice-design/1.7b"+ },+ {+ "family": "qwen-tts",+ "vendor": "Alibaba Qwen",+ "provider": "fal",+ "status": "active",+ "verified": true,+ "checked": "2026-11-02",+ "model": "Qwen3-TTS clone",+ "title": "Qwen 3 TTS - Clone Voice [1.7B]",+ "operation": "voice-clone",+ "endpoint": "fal-ai/qwen-3-tts/clone-voice/1.7b",+ "falCategory": "audio-to-audio",+ "keyFields": {+ "referenceVoice": "audio_url",+ "voiceTranscript": "reference_text"+ },+ "inputs": {+ "audio_url": {+ "type": "string",+ "required": true,+ "desc": "URL to the reference audio file used for voice cloning. Must be at most 300 seconds (5 minutes) long; a short clip of clean speech is sufficient.",+ "examples": [+ "https://storage.googleapis.com/falserverless/example_inputs/qwen3-tts/clone_in.mp3"+ ]+ },+ "enable_safety_checker": {+ "type": "boolean",+ "required": false,+ "default": true,+ "desc": "Authorized callers may set false to request relaxed screening."+ },+ "reference_text": {+ "nullable": true,+ "type": "string",+ "required": false,+ "desc": "Optional reference text that was used when creating the speaker embedding. Providing this can improve synthesis quality when using a cloned voice.",+ "examples": [+ "Okay. Yeah. I resent you. I love you. I respect you. But you know what? You blew it! And it is all thanks to you."+ ]+ }+ },+ "output": "speaker_embedding (File, safetensors)",+ "price": "$0.0008 per minutes",+ "notes": "Step 1 of a clone: audio_url (up to 5 minutes) -> speaker_embedding, a safetensors file. Step 2 is text-to-speech/1.7b with speaker_voice_embedding_file_url.",+ "sourceUrl": "https://fal.ai/models/fal-ai/qwen-3-tts/clone-voice/1.7b/api",+ "schemaUrl": "https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=fal-ai/qwen-3-tts/clone-voice/1.7b"+ },+ {+ "family": "qwen-tts",+ "vendor": "Alibaba Qwen",+ "provider": "fal",+ "status": "active",+ "verified": true,+ "checked": "2026-11-02",+ "model": "Qwen3-TTS",+ "title": "Qwen 3 TTS - Text to Speech [1.7B]",+ "operation": "tts",+ "endpoint": "fal-ai/qwen-3-tts/text-to-speech/1.7b",+ "falCategory": "text-to-speech",+ "keyFields": {+ "prompt": "text",+ "voice": "voice",+ "voiceEmbedding": "speaker_voice_embedding_file_url",+ "voiceTranscript": "reference_text"+ },+ "inputs": {+ "subtalker_temperature": {+ "nullable": true,+ "minimum": 0,+ "maximum": 1,+ "type": "number",+ "required": false,+ "default": 0.9,+ "desc": "Temperature for sub-talker sampling."+ },+ "top_k": {+ "nullable": true,+ "minimum": 0,+ "type": "integer",+ "required": false,+ "default": 50,+ "desc": "Top-k sampling parameter."+ },+ "subtalker_top_k": {+ "nullable": true,+ "minimum": 0,+ "type": "integer",+ "required": false,+ "default": 50,+ "desc": "Top-k for sub-talker sampling."+ },+ "top_p": {+ "nullable": true,+ "minimum": 0,+ "maximum": 1,+ "type": "number",+ "required": false,+ "default": 1,+ "desc": "Top-p sampling parameter."+ },+ "reference_text": {+ "nullable": true,+ "type": "string",+ "required": false,+ "desc": "Optional reference text that was used when creating the speaker embedding. Providing this can improve synthesis quality when using a cloned voice.",+ "examples": [+ "Okay. Yeah. I resent you. I love you. I respect you. But you know what? You blew it! And it is all thanks to you."+ ]+ },+ "subtalker_top_p": {+ "nullable": true,+ "minimum": 0,+ "maximum": 1,+ "type": "number",+ "required": false,+ "default": 1,+ "desc": "Top-p for sub-talker sampling."+ },+ "temperature": {+ "nullable": true,+ "maximum": 1,+ "type": "number",+ "required": false,+ "default": 0.9,+ "desc": "Sampling temperature; higher => more random."+ },+ "enable_safety_checker": {+ "type": "boolean",+ "required": false,+ "default": true,+ "desc": "Authorized callers may set false to request relaxed screening."+ },+ "subtalker_dosample": {+ "nullable": true,+ "type": "boolean",+ "required": false,+ "default": true,+ "desc": "Sampling switch for the sub-talker."+ },+ "voice": {+ "nullable": true,+ "type": "enum",+ "values": [+ "Vivian",+ "Serena",+ "Uncle_Fu",+ "Dylan",+ "Eric",+ "Ryan",+ "Aiden",+ "Ono_Anna",+ "Sohee"+ ],+ "required": false,+ "desc": "The voice to be used for speech synthesis, will be ignored if a speaker embedding is provided. Check out the **[documentation](https://github.com/QwenLM/Qwen3-TTS/tree/main?tab=readme-ov-file#custom-voice-generate)** for each voice's details and which language they primarily support.",+ "examples": [+ "Vivian"+ ]+ },+ "text": {+ "type": "string",+ "required": true,+ "desc": "The text to be converted to speech.",+ "examples": [+ "I am solving the equation: x = [-b ± √(b²-4ac)] / 2a? Nobody can — it's a disaster (◍•͈⌔•͈◍), very sad!"+ ]+ },+ "language": {+ "type": "enum",+ "values": [+ "Auto",+ "English",+ "Chinese",+ "Spanish",+ "French",+ "German",+ "Italian",+ "Japanese",+ "Korean",+ "Portuguese",+ "Russian"+ ],+ "required": false,+ "default": "Auto",+ "desc": "The language of the voice.",+ "examples": [+ "English"+ ]+ },+ "prompt": {+ "nullable": true,+ "type": "string",+ "required": false,+ "desc": "Optional prompt to guide the style of the generated speech. This prompt will be ignored if a speaker embedding is provided.",+ "examples": [+ "Very happy."+ ]+ },+ "speaker_voice_embedding_file_url": {+ "nullable": true,+ "type": "string",+ "required": false,+ "desc": "URL to a speaker embedding file in safetensors format, from `fal-ai/qwen-3-tts/clone-voice` endpoint. If provided, the TTS model will use the cloned voice for synthesis instead of the predefined voices.",+ "examples": [+ "https://storage.googleapis.com/falserverless/example_outputs/qwen3-tts/clone_out.safetensors"+ ]+ },+ "max_new_tokens": {+ "nullable": true,+ "minimum": 1,+ "maximum": 8192,+ "type": "integer",+ "required": false,+ "default": 200,+ "desc": "Maximum number of new codec tokens to generate."+ },+ "repetition_penalty": {+ "nullable": true,+ "minimum": 0,+ "type": "number",+ "required": false,+ "default": 1.05,+ "desc": "Penalty to reduce repeated tokens/codes."+ }+ },+ "output": "audio (AudioFile)",+ "price": "$0.09 per 1000 characters",+ "notes": "Nine premade voices (voice enum) or a cloned voice (speaker_voice_embedding_file_url from clone-voice; voice is then ignored). Its own prompt field is a style hint for a premade voice, not a voice design.",+ "sourceUrl": "https://fal.ai/models/fal-ai/qwen-3-tts/text-to-speech/1.7b/api",+ "schemaUrl": "https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=fal-ai/qwen-3-tts/text-to-speech/1.7b"}]}diff --git a/docs/research/paid-model-apis-2.json b/docs/research/paid-model-apis-2.jsonindex e70fd11c..2474bec0 100644--- a/docs/research/paid-model-apis-2.json+++ b/docs/research/paid-model-apis-2.json@@ -18312,7 +18312,7 @@"keyFields": {"prompt": "prompt","voice": "voice",- "referenceVoice": "speaker_voice_embedding_file_url"+ "voiceEmbedding": "speaker_voice_embedding_file_url"},"output": "audio.url","outputShape": {diff --git a/scripts/gen-cloud-models.py b/scripts/gen-cloud-models.pyindex 3b31a8ba..b0eaee0b 100644--- a/scripts/gen-cloud-models.py+++ b/scripts/gen-cloud-models.py@@ -1364,6 +1364,15 @@ model("bria-expand", "Bria Expand", "Bria", "bria", "image", "Extend a picture t# ----- New speech modelsmodel("heygen-voice-turbo", "HeyGen Voice Turbo", "HeyGen", "heygen", "audio", "24 voices or an instant clone of yours, in 39 languages, for almost nothing",[("tts", "heygen/heygen-voice/turbo")], badges=["new", "fast"], pricing=("request", 0.004, "per 1k chars"))+# Qwen3-TTS 1.7B on fal (nm10-voice-design; research new-models-10.json endpointRecords, read 2026-11-02): a voice made from+# words, nine premade voices, and a clone in two steps (clone-voice turns the sample into an embedding file, text-to-speech+# speaks with it; a saved voice keeps the file: src/server/voices.ts). The same model runs on your GPU (oss-qwen3-tts).+# max_new_tokens is 200 codec tokens by default (12 Hz: about 16 s of speech): 4096 lets a long line finish.+model("qwen-3-tts", "Qwen3-TTS (hosted)", "Alibaba Qwen", "qwen-tts", "audio", "Design a voice from a description, or clone one, in 10 languages",+ [("voice-design", "fal-ai/qwen-3-tts/voice-design/1.7b"),+ ("tts", "fal-ai/qwen-3-tts/text-to-speech/1.7b", "fal", {"cloneFirst": {"endpoint": "fal-ai/qwen-3-tts/clone-voice/1.7b", "output": "speaker_embedding"}})],+ badges=["new"], pricing=("request", 0.09, "per 1k chars; cloning a sample adds $0.0008 per minute of it"),+ defaults={"voice": "Vivian"}, api_defaults={"max_new_tokens": 4096}, controls=[("language", "Language")])model("gemini-3-8-flash-tts", "Gemini 3.8 Flash TTS", "Google", "gemini-tts", "audio", "30 Gemini voices with inline <laugh> and <sigh>",[("tts", "google/gemini-3.8-flash-tts")], badges=["new"], pricing=("request", 0.045, "per 1k chars"))@@ -1807,6 +1816,21 @@ def build_route(op, ep, provider, m, opts, ropts=None):opts["voiceClone"] = Trueif "voice" in kf and "[]" not in kf["voice"]:fmap["voice"] = kf["voice"]+ # Voice design and cloning (Qwen3-TTS, nm10-voice-design): the voice in words, what the sample says, a cloned voice's file.+ for k in ("voiceDescription", "voiceTranscript", "voiceEmbedding"):+ if k in kf and kf[k].split(".")[0] in inputs:+ fmap[k] = kf[k]+ # A sample the endpoint can't take is cloned first by a sibling endpoint (fal's clone-voice), whose result file goes in+ # voiceEmbedding (FieldMap.cloneFirst; src/server/providers/fal.ts): the route takes samples.+ cf = ropts.get("cloneFirst")+ if cf:+ ce = EPS.get((provider, cf["endpoint"]))+ ckf = (ce or {}).get("keyFields") or {}+ if not ce or "referenceVoice" not in ckf or "voiceEmbedding" not in fmap:+ warn(f"{m['id']}: {cf['endpoint']} can't clone for {ep}")+ else:+ fmap["cloneFirst"] = {"endpoint": cf["endpoint"], "audio": ckf["referenceVoice"], **({"text": ckf["voiceTranscript"]} if "voiceTranscript" in ckf else {}), "output": cf["output"]}+ opts["voiceClone"] = Trueif "voice" in kf and "elevenlabs" in ep:opts["voices"] = ELEVEN_VOICESelif "voice" in kf and "voices" not in opts and voice_list(spec_at(inputs, kf["voice"])):diff --git a/src/app/api/elements/route.ts b/src/app/api/elements/route.tsindex 38a77b51..014b8a56 100644--- a/src/app/api/elements/route.ts+++ b/src/app/api/elements/route.ts@@ -1,6 +1,7 @@import { connection } from "next/server";import { z } from "zod";-import { MAX_ELEMENT_PHOTOS } from "@/lib/catalog/elements";+import { getModel } from "@/lib/catalog";+import { MAX_ELEMENT_PHOTOS, VOICE_DESCRIPTION_MAX, VOICE_TRANSCRIPT_MAX, type ElementVoice } from "@/lib/catalog/elements";import { createElement, listElements } from "@/server/elements";const Kind = z.enum(["character", "location", "prop", "style", "voice"]);@@ -10,8 +11,24 @@ const Body = z.object({kind: Kind.default("character"),description: z.string().max(500).optional(),references: z.array(z.string().startsWith("/api/files/")).max(MAX_ELEMENT_PHOTOS),+ // Design a voice: the model that made the take, its words and what the take says. The embedding is the server's own+ // (src/server/voices.ts), never taken from a request.+ voice: z+ .object({+ modelId: z.string().max(80),+ description: z.string().trim().max(VOICE_DESCRIPTION_MAX).optional(),+ transcript: z.string().trim().max(VOICE_TRANSCRIPT_MAX).optional(),+ })+ .optional(),});+/** A designed voice's record, from a model that designs voices; null when the model doesn't. */+function designedVoice(v: z.infer<typeof Body>["voice"]): ElementVoice | null {+ const model = v && getModel(v.modelId);+ if (!v || !model?.routes.some((r) => r.op === "voice-design")) return null;+ return { modelId: model.id, engine: model.engine, ...(v.description && { description: v.description }), ...(v.transcript && { transcript: v.transcript }) };+}+export async function GET(request: Request) {await connection();const kind = Kind.safeParse(new URL(request.url).searchParams.get("kind"));@@ -24,5 +41,10 @@ export async function POST(request: Request) {if (!parsed.data.references.length && !parsed.data.description?.trim()) {return Response.json({ error: "Add at least one photo or a description" }, { status: 400 });}- return Response.json(createElement(parsed.data), { status: 201 });+ const { voice: asked, ...rest } = parsed.data;+ const voice = asked ? designedVoice(asked) : null;+ if (asked && (!voice || parsed.data.kind !== "voice" || !parsed.data.references.length)) {+ return Response.json({ error: "Pick a take to save as the voice" }, { status: 400 });+ }+ return Response.json(createElement({ ...rest, ...(voice && { voice }) }), { status: 201 });}diff --git a/src/lib/catalog/cloud-models.generated.ts b/src/lib/catalog/cloud-models.generated.tsindex 953fd6a8..307f210b 100644--- a/src/lib/catalog/cloud-models.generated.ts+++ b/src/lib/catalog/cloud-models.generated.ts@@ -17961,6 +17961,119 @@ export const CLOUD_MODELS: ModelDef[] = ["note": "per 1k chars"}},+ {+ "id": "qwen-3-tts",+ "name": "Qwen3-TTS (hosted)",+ "vendor": "Alibaba Qwen",+ "family": "qwen-tts",+ "engine": "cloud",+ "kind": "audio",+ "tagline": "Design a voice from a description, or clone one, in 10 languages",+ "routes": [+ {+ "op": "voice-design",+ "provider": "fal",+ "endpoint": "fal-ai/qwen-3-tts/voice-design/1.7b",+ "map": {+ "prompt": "text",+ "voiceDescription": "prompt",+ "defaults": {+ "max_new_tokens": 4096+ }+ }+ },+ {+ "op": "tts",+ "provider": "fal",+ "endpoint": "fal-ai/qwen-3-tts/text-to-speech/1.7b",+ "map": {+ "prompt": "text",+ "voice": "voice",+ "voiceTranscript": "reference_text",+ "voiceEmbedding": "speaker_voice_embedding_file_url",+ "cloneFirst": {+ "endpoint": "fal-ai/qwen-3-tts/clone-voice/1.7b",+ "audio": "audio_url",+ "text": "reference_text",+ "output": "speaker_embedding"+ },+ "defaults": {+ "max_new_tokens": 4096+ }+ }+ }+ ],+ "options": {+ "controls": [+ {+ "param": "language",+ "label": "Language",+ "values": [+ "English",+ "Chinese",+ "Spanish",+ "French",+ "German",+ "Italian",+ "Japanese",+ "Korean",+ "Portuguese",+ "Russian"+ ]+ }+ ],+ "voiceClone": true,+ "voices": [+ {+ "id": "Vivian",+ "name": "Vivian"+ },+ {+ "id": "Serena",+ "name": "Serena"+ },+ {+ "id": "Uncle_Fu",+ "name": "Uncle Fu"+ },+ {+ "id": "Dylan",+ "name": "Dylan"+ },+ {+ "id": "Eric",+ "name": "Eric"+ },+ {+ "id": "Ryan",+ "name": "Ryan"+ },+ {+ "id": "Aiden",+ "name": "Aiden"+ },+ {+ "id": "Ono_Anna",+ "name": "Ono Anna"+ },+ {+ "id": "Sohee",+ "name": "Sohee"+ }+ ]+ },+ "badges": [+ "new"+ ],+ "defaults": {+ "voice": "Vivian"+ },+ "pricing": {+ "unit": "request",+ "usd": 0.09,+ "note": "per 1k chars; cloning a sample adds $0.0008 per minute of it"+ }+ },{"id": "gemini-3-8-flash-tts","name": "Gemini 3.8 Flash TTS",diff --git a/src/lib/catalog/elements.ts b/src/lib/catalog/elements.tsindex ff2acc33..d65bbb81 100644--- a/src/lib/catalog/elements.ts+++ b/src/lib/catalog/elements.ts@@ -50,6 +50,27 @@ export interface ElementLora {referenceId?: string;}+/**+ * A voice made with Design a voice (nm10-voice-design), on the element that keeps it: its clip (references[0], the take+ * picked) is what later lines clone, on either engine. The cloud's Qwen3-TTS reuses a voice by cloning that clip into an+ * embedding file, which Fuobe keeps after its first cloud line (src/server/voices.ts), so it isn't cloned again.+ */+export interface ElementVoice {+ /** The model that made it (oss-qwen3-tts, oss-voxcpm2, qwen-3-tts). */+ modelId: string;+ engine: Engine;+ /** The words it was designed from. */+ description?: string;+ /** What the clip says (the take's test line): VoxCPM2's closest ("ultimate") clone and Qwen3-TTS's reference text. */+ transcript?: string;+ /** Qwen3-TTS's embedding of the clip on fal, stored by Fuobe (/api/files/…). */+ embedding?: string;+}++/** Element voices: the most an ElementVoice's words hold (the API and the form keep to these). */+export const VOICE_DESCRIPTION_MAX = 500;+export const VOICE_TRANSCRIPT_MAX = 1000;+export interface StudioElement {id: string;name: string;@@ -58,6 +79,8 @@ export interface StudioElement {description: string | null;references: string[];loras: ElementLora[];+ /** A designed voice's model, words and (once the cloud has cloned it) embedding: voices only. */+ voice?: ElementVoice;status: "ready" | "training" | "failed";createdAt: number;}diff --git a/src/lib/catalog/payload.ts b/src/lib/catalog/payload.tsindex 9368f4c9..86e2372e 100644--- a/src/lib/catalog/payload.ts+++ b/src/lib/catalog/payload.ts@@ -433,6 +433,10 @@ export function buildPayload(map: FieldMap, input: GenInput): Record<string, unk// Voices, dialogue and dubbing.if (map.voice && input.voice) setPath(out, map.voice, input.voice);if (map.voiceAudio && input.voiceAudio) out[map.voiceAudio] = input.voiceAudio;+ // Voice design and cloning (Qwen3-TTS): the voice in words, what the sample says, a saved voice's embedding.+ if (map.voiceDescription && input.voiceDescription?.trim()) out[map.voiceDescription] = input.voiceDescription.trim();+ if (map.voiceTranscript && input.voiceTranscript?.trim()) out[map.voiceTranscript] = input.voiceTranscript.trim();+ if (map.voiceEmbedding && input.voiceEmbedding) out[map.voiceEmbedding] = input.voiceEmbedding;if (map.dialogue && input.dialogue?.length) {const d = map.dialogue;out[d.key] = input.dialogue.map((l) => ({ [d.text]: l.text, [d.voice]: l.voice ?? input.voice }));diff --git a/src/lib/catalog/plan.ts b/src/lib/catalog/plan.tsindex 3f63c3e7..5a3ef2e8 100644--- a/src/lib/catalog/plan.ts+++ b/src/lib/catalog/plan.ts@@ -488,6 +488,7 @@ export function planGeneration(if (op === "finalize" && !params.draftId) throw new Error("Pick a draft to finish");if (op === "dialogue" && !params.dialogue?.some((l) => l.text.trim())) throw new Error("Write at least one line");if (op === "dub" && !params.targetLanguage) throw new Error("Pick a language to translate into");+ if (op === "voice-design" && !params.voiceDescription?.trim()) throw new Error("Describe the voice you want");if (model.options.motionPaths && !(params.extra?.motionPaths as { paths?: unknown[] } | undefined)?.paths?.length) {throw new Error(`Draw on the start frame — ${model.name} moves things along the paths you draw`);}diff --git a/src/lib/catalog/types.ts b/src/lib/catalog/types.tsindex ac15098f..cd5b664b 100644--- a/src/lib/catalog/types.ts+++ b/src/lib/catalog/types.ts@@ -87,7 +87,9 @@ export type Operation =// N7-5| "camera-path" // image + params.cameraPath (+ inputs.video: the open engine's render along the path) → the camera following the path// archive-restore- | "restore-video"; // archive video (+ prompt: period, place, light; negative: what not to invent) → the same shot clean, in colour, larger+ | "restore-video" // archive video (+ prompt: period, place, light; negative: what not to invent) → the same shot clean, in colour, larger+ // nm10-voice-design+ | "voice-design"; // params.voiceDescription (who is speaking) + prompt (the line) → the line in a new voice made from the wordsexport const OPERATION_LABELS: Record<Operation, string> = {t2i: "Text to image",@@ -117,6 +119,7 @@ export const OPERATION_LABELS: Record<Operation, string> = {finalize: "Final render",dialogue: "Dialogue","voice-change": "Voice change",+ "voice-design": "Design a voice",dub: "Translate & dub","bg-remove-video": "Video background removal","depth-video": "Video depth map",@@ -188,6 +191,7 @@ export const OPERATION_OUTPUT: Record<Operation, MediaKind> = {finalize: "video",dialogue: "audio","voice-change": "audio",+ "voice-design": "audio",dub: "video","bg-remove-video": "video","depth-video": "video",@@ -320,6 +324,17 @@ export interface FieldMap {voice?: string;/** Reference clip to clone a voice from (zero-shot TTS) or to convert into (voice change). */voiceAudio?: string;+ /** Words that describe the voice (voice design: fal's Qwen3-TTS `prompt`). */+ voiceDescription?: string;+ /** What the voice sample says (Qwen3-TTS `reference_text`): a closer clone. */+ voiceTranscript?: string;+ /** A cloned voice as a file (Qwen3-TTS `speaker_voice_embedding_file_url`): GenInput.voiceEmbedding. */+ voiceEmbedding?: string;+ /**+ * A voice sample this API can't take directly is cloned first (fal's Qwen3-TTS: clone-voice, then text-to-speech with the+ * embedding it returns): the endpoint, its audio field, its transcript field and the field of the file it returns.+ */+ cloneFirst?: { endpoint: string; audio: string; text?: string; output: string };/** Multi-speaker lines: an array of {text, voice}. */dialogue?: { key: string; text: string; voice: string };/** Language to translate into (dubbing). */@@ -822,6 +837,10 @@ export interface GenParams {enhancePrompt?: boolean;/** Premade voice (TTS, voice change). */voice?: string;+ /** Voice design: the voice in words ("a warm, gravelly 60-year-old narrator"). */+ voiceDescription?: string;+ /** What the voice sample says: a closer clone (VoxCPM2's "ultimate" cloning, Qwen3-TTS's reference text). */+ voiceTranscript?: string;/** Dialogue lines, each with its own voice. */dialogue?: { text: string; voice?: string }[];/** Dubbing target language. */@@ -1172,6 +1191,8 @@ export interface GenInput extends GenParams {audio2?: string;voiceAudio?: string;voiceAudio2?: string;+ /** A saved voice's cloned embedding (fal's Qwen3-TTS), so the sample isn't cloned again (src/server/voices.ts). */+ voiceEmbedding?: string;videos?: string[];audios?: string[];model3d?: string;diff --git a/src/server/db.ts b/src/server/db.tsindex 41614237..b2dce4b7 100644--- a/src/server/db.ts+++ b/src/server/db.ts@@ -605,6 +605,9 @@ export const MIGRATIONS: string[] = [CREATE INDEX IF NOT EXISTS assets_account ON assets(account_id, created_at DESC);CREATE INDEX IF NOT EXISTS assets_rel ON assets(rel_path);CREATE INDEX IF NOT EXISTS assets_generation ON assets(generation_id);`,+ // originals (o/nm10-voice-design): a designed voice on its element (Design a voice): the model, the words, what its clip+ // says and, once the cloud has cloned it, Qwen3-TTS's embedding file (src/lib/catalog/elements.ts ElementVoice).+ `ALTER TABLE characters ADD COLUMN voice_json TEXT;`,];/**diff --git a/src/server/elements.ts b/src/server/elements.tsindex c5d2da2a..147901ba 100644--- a/src/server/elements.ts+++ b/src/server/elements.ts@@ -1,6 +1,6 @@import "server-only";import { nanoid } from "nanoid";-import { handleFor, MAX_ELEMENT_PHOTOS, type ElementKind, type ElementLora, type StudioElement } from "@/lib/catalog/elements";+import { handleFor, MAX_ELEMENT_PHOTOS, type ElementKind, type ElementLora, type ElementVoice, type StudioElement } from "@/lib/catalog/elements";import { db } from "./db";interface Row {@@ -11,6 +11,7 @@ interface Row {description: string | null;reference_asset_ids_json: string;loras_json: string | null;+ voice_json?: string | null;status: StudioElement["status"];created_at: number;}@@ -23,6 +24,7 @@ const toElement = (r: Row): StudioElement => ({description: r.description,references: JSON.parse(r.reference_asset_ids_json) as string[],loras: r.loras_json ? (JSON.parse(r.loras_json) as ElementLora[]) : [],+ ...(r.voice_json && { voice: JSON.parse(r.voice_json) as ElementVoice }),status: r.status,createdAt: r.created_at,});@@ -51,7 +53,7 @@ function uniqueHandle(name: string, exceptId?: string): string {for (let i = 2; ; i++) if (!taken.has(`${base}_${i}`.toLowerCase())) return `${base}_${i}`;}-export function createElement(input: { name: string; kind: ElementKind; description?: string; references: string[] }): StudioElement {+export function createElement(input: { name: string; kind: ElementKind; description?: string; references: string[]; voice?: ElementVoice }): StudioElement {const now = Date.now();const name = input.name.trim().slice(0, 60);const row = {@@ -62,13 +64,15 @@ export function createElement(input: { name: string; kind: ElementKind; descriptdescription: input.description?.trim() || null,reference_asset_ids_json: JSON.stringify(input.references.slice(0, MAX_ELEMENT_PHOTOS)),loras_json: null,+ // A designed voice (Design a voice) keeps its model and words; only a voice element has one.+ voice_json: input.kind === "voice" && input.voice ? JSON.stringify(input.voice) : null,status: "ready" as const,created_at: now,};db().prepare(- `INSERT INTO characters (id, name, handle, kind, description, reference_asset_ids_json, loras_json, status, created_at, updated_at)- VALUES (@id, @name, @handle, @kind, @description, @reference_asset_ids_json, @loras_json, @status, @created_at, @created_at)`,+ `INSERT INTO characters (id, name, handle, kind, description, reference_asset_ids_json, loras_json, voice_json, status, created_at, updated_at)+ VALUES (@id, @name, @handle, @kind, @description, @reference_asset_ids_json, @loras_json, @voice_json, @status, @created_at, @created_at)`,).run(row);return toElement(row);@@ -76,7 +80,7 @@ export function createElement(input: { name: string; kind: ElementKind; descriptexport function updateElement(id: string,- patch: { name?: string; description?: string | null; references?: string[]; loras?: ElementLora[]; status?: StudioElement["status"] },+ patch: { name?: string; description?: string | null; references?: string[]; loras?: ElementLora[]; voice?: ElementVoice | null; status?: StudioElement["status"] },): StudioElement | null {const cur = getElement(id);if (!cur) return null;@@ -84,7 +88,7 @@ export function updateElement(db().prepare(`UPDATE characters SET name = @name, handle = @handle, description = @description, reference_asset_ids_json = @refs,- loras_json = @loras, status = @status, updated_at = @now WHERE id = @id`,+ loras_json = @loras, voice_json = @voice, status = @status, updated_at = @now WHERE id = @id`,).run({id,@@ -93,12 +97,25 @@ export function updateElement(description: patch.description === undefined ? cur.description : patch.description?.trim() || null,refs: JSON.stringify((patch.references ?? cur.references).slice(0, MAX_ELEMENT_PHOTOS)),loras: JSON.stringify(patch.loras ?? cur.loras),+ // A new recording replaces a designed voice's clip: its embedding (of the old clip) goes unless the patch keeps one.+ voice: voiceAfter(cur, patch),status: patch.status ?? cur.status,now: Date.now(),});return getElement(id);}+/** A voice element's voice after a patch: the patch's, or the old one without an embedding of a clip it no longer has. */+function voiceAfter(cur: StudioElement, patch: { references?: string[]; voice?: ElementVoice | null }): string | null {+ if (cur.kind !== "voice") return null;+ if (patch.voice !== undefined) return patch.voice ? JSON.stringify(patch.voice) : null;+ if (!cur.voice) return null;+ const sameClip = !patch.references || patch.references[0] === cur.references[0];+ if (sameClip) return JSON.stringify(cur.voice);+ const { embedding: _gone, transcript: _old, ...rest } = cur.voice;+ return JSON.stringify(rest);+}+export function deleteElement(id: string): void {db().prepare("DELETE FROM characters WHERE id = ?").run(id);}diff --git a/src/server/generations.ts b/src/server/generations.tsindex f8c0ffc4..805d7eb7 100644--- a/src/server/generations.ts+++ b/src/server/generations.ts@@ -375,7 +375,7 @@ export interface AssetRef {*/export const ASSET_REFS: AssetRef[] = [{ table: "generations", cols: ["request_json", "outputs_json"], except: "id", what: "result" },- { table: "characters", cols: ["reference_asset_ids_json", "loras_json", "lora_file"], what: "element", name: "name" },+ { table: "characters", cols: ["reference_asset_ids_json", "loras_json", "lora_file", "voice_json"], what: "element", name: "name" },{ table: "trainings", cols: ["meta_json"], what: "element", key: "element_id", name: "(SELECT name FROM characters WHERE id = element_id)" },{ table: "assist_threads", cols: ["messages_json", "items_json", "pending_json"], what: "Assist chat", name: "title" },// A chat's frozen context names its project's sources; a project's file sources are uploads.diff --git a/src/server/providers/fal.ts b/src/server/providers/fal.tsindex 3bbca721..355acb5a 100644--- a/src/server/providers/fal.ts+++ b/src/server/providers/fal.ts@@ -4,6 +4,7 @@ import { loraEndpointFor, routeLoraField } from "@/lib/catalog/loras";import { buildPayload, extractOutputs, noOutputsError } from "@/lib/catalog/payload";import { accountKeyError, balanceRefusal, cloudKey, missingKeyError, originOf, redactKey, standIn } from "../provider-keys";import { tenant } from "../tenant";+import type { FieldMap } from "@/lib/catalog/types";import { ProviderError, type ProviderAdapter } from "./types";/**@@ -87,6 +88,33 @@ function fileName(name: string | undefined): string | undefined {return base && /^[\w.\-()[\] ]{1,200}\.[A-Za-z0-9]{1,12}$/.test(base) && !base.startsWith(".") ? base : undefined;}+/** How long the clone step of a two-step voice may take (it is a few seconds of work on fal). */+const CLONE_WAIT_MS = 3 * 60 * 1000;++/**+ * Step 1 of a two-step voice (FieldMap.cloneFirst): the sample (and what it says) to the clone endpoint, waited for on its+ * queue, and the URL of the file it returns (Qwen3-TTS's speaker_embedding safetensors).+ */+export async function cloneVoice(cf: NonNullable<FieldMap["cloneFirst"]>, audio: string, transcript?: string, waitMs = CLONE_WAIT_MS): Promise<string> {+ const body = { [cf.audio]: audio, ...(cf.text && transcript?.trim() && { [cf.text]: transcript.trim() }) };+ const job = (await falFetch(`${falQueue()}/${cf.endpoint}`, { method: "POST", body: JSON.stringify(body) })) as { status_url: string; response_url: string };+ const until = Date.now() + waitMs;+ for (let wait = 500; ; wait = Math.min(wait * 1.5, 3000)) {+ const st = (await falFetch(job.status_url)) as { status?: string; error?: string };+ if (st.status === "COMPLETED") {+ if (st.error) throw new ProviderError(`Couldn't clone the voice: ${st.error}`);+ break;+ }+ if (Date.now() + wait > until) throw new ProviderError("Cloning the voice took too long. Try again.");+ await new Promise((r) => setTimeout(r, wait));+ }+ const result = (await falFetch(job.response_url)) as Record<string, unknown>;+ const file = result?.[cf.output] as { url?: unknown } | string | undefined;+ const url = typeof file === "string" ? file : typeof file?.url === "string" ? file.url : undefined;+ if (!url) throw new ProviderError("Couldn't clone the voice: the sample gave no voice back. Try a longer, cleaner sample.");+ return url;+}+export const falProvider: ProviderAdapter = {id: "fal",label: "fal.ai",@@ -111,6 +139,14 @@ export const falProvider: ProviderAdapter = {},async submit({ route, input }) {+ // A voice sample the endpoint can't take is cloned first (Qwen3-TTS: clone-voice makes an embedding file, which the+ // text-to-speech call speaks with). A saved voice that already has its file skips the clone (src/server/voices.ts).+ const cf = route.map?.cloneFirst;+ let embedding: string | undefined;+ if (cf && input.voiceAudio && !input.voiceEmbedding) {+ embedding = await cloneVoice(cf, input.voiceAudio, input.voiceTranscript);+ input = { ...input, voiceEmbedding: embedding };+ }// LoRAs (trained identities, a recipe's looks and motions) go in the route's LoRA field (FieldMap.loras:// `transformer` per file on Wan 2.2, `weight_name`, at most the API's maximum) and switch to its LoRA endpoint.const map = { ...route.map, loras: routeLoraField(route) };@@ -127,7 +163,7 @@ export const falProvider: ProviderAdapter = {})) as { request_id: string; status_url: string; response_url: string; cancel_url: string };return {externalId: res.request_id,- meta: { statusUrl: res.status_url, responseUrl: res.response_url, cancelUrl: res.cancel_url },+ meta: { statusUrl: res.status_url, responseUrl: res.response_url, cancelUrl: res.cancel_url, ...(embedding && { voiceEmbedding: embedding }) },payload,};},diff --git a/src/server/request-schema.ts b/src/server/request-schema.tsindex d9e5db86..2126fd48 100644--- a/src/server/request-schema.ts+++ b/src/server/request-schema.ts@@ -73,6 +73,9 @@ export const GenerationRequestSchema = z.object({draft: z.boolean().optional(),draftId: z.string().max(8192).optional(),voice: z.string().max(200).optional(),+ // Design a voice: the voice in words; what a voice sample says (a closer clone).+ voiceDescription: z.string().max(1000).optional(),+ voiceTranscript: z.string().max(2000).optional(),dialogue: z.array(z.object({ text: z.string().max(5000), voice: z.string().max(200).optional() })).max(200).optional(),targetLanguage: z.string().max(80).optional(),startTime: z.number().min(0).max(36_000).optional(),