The VS Code of video editing, built for agents.
TypeScript
Update model configurations and tool requests for improved functionality
konstantin-pauluse8c1bde745c8
diff --git a/apps/web/src/components/genai/config.ts b/apps/web/src/components/genai/config.tsindex 588610e8..6d8b28a0 100644--- a/apps/web/src/components/genai/config.ts+++ b/apps/web/src/components/genai/config.ts@@ -19,8 +19,8 @@ export const MODEL_MODES: Record<ModelId, PromptMode | "TEXT"> = {"krea-2-large": "IMAGE","flux-2-pro": "IMAGE","flux-2-klein": "IMAGE",- "remove-background": "IMAGE",- "upscale-image": "IMAGE",+ "bria-rmbg-2.0": "IMAGE",+ "seedvr-2": "IMAGE","kling-3-pro": "VIDEO","kling-o3-pro": "VIDEO","wan-3.0": "VIDEO",@@ -30,13 +30,13 @@ export const MODEL_MODES: Record<ModelId, PromptMode | "TEXT"> = {"grok-imagine-video-1.5": "VIDEO","veo-3.1": "VIDEO","veo-3.1-fast": "VIDEO",- "upscale-video": "VIDEO",+ "bytedance-upscaler": "VIDEO","elevenlabs-music": "AUDIO","elevenlabs-sfx": "AUDIO","elevenlabs-v3": "VOICE","gemini-3.8-flash-tts": "VOICE",- "transcribe": "TEXT",- "analyze": "TEXT",+ "universal-3.5-pro": "TEXT",+ "gemini-3.5-flash": "TEXT",};export type PromptMode = "IMAGE" | "VIDEO" | "VOICE" | "AUDIO";diff --git a/apps/web/src/components/genai/use-transforms.ts b/apps/web/src/components/genai/use-transforms.tsindex 38b0ec47..7aeeead4 100644--- a/apps/web/src/components/genai/use-transforms.ts+++ b/apps/web/src/components/genai/use-transforms.ts@@ -33,17 +33,17 @@ const TOOLS: Record<TransformType, Tool> = {title: "Upscale failed",takes: () => true,request: (type, input) =>- type === PaintType.VIDEO ? { model: "upscale-video", video: input } : { model: "upscale-image", image: input },+ type === PaintType.VIDEO ? { model: "bytedance-upscaler", video: input } : { model: "seedvr-2", image: input },price: ({ type, asset }) =>type === PaintType.VIDEO- ? asset?.type === "VIDEO" ? chargeOf("upscale-video", asset.duration) : undefined- : chargeOf("upscale-image"),+ ? asset?.type === "VIDEO" ? chargeOf("bytedance-upscaler", asset.duration) : undefined+ : chargeOf("seedvr-2"),},removeBackground: {title: "Background removal failed",takes: (type) => type === PaintType.IMAGE,- request: (_type, image) => ({ model: "remove-background", image }),- price: () => chargeOf("remove-background"),+ request: (_type, image) => ({ model: "bria-rmbg-2.0", image }),+ price: () => chargeOf("bria-rmbg-2.0"),},};diff --git a/apps/web/src/engine/generate/captions.tsx b/apps/web/src/engine/generate/captions.tsxindex 14131f29..2c81ebe4 100644--- a/apps/web/src/engine/generate/captions.tsx+++ b/apps/web/src/engine/generate/captions.tsx@@ -61,7 +61,7 @@ export async function generateCaptions(world: World, scene: Entity, dir?: stringtry {const audio = await uploadFile(await encodeSceneAudio(world, scene, dir));- const job = await runJob({ model: 'transcribe', audio }, (update) => {+ const job = await runJob({ model: 'universal-3.5-pro', audio }, (update) => {toast.loading('Generating captions', { id, description: status(update) });});if (job.status !== 'succeeded') throw new Error(jobFailure(job));diff --git a/docs/reference/jsx/captions.md b/docs/reference/jsx/captions.mdindex 8a579070..373dbfaa 100644--- a/docs/reference/jsx/captions.md+++ b/docs/reference/jsx/captions.md@@ -13,10 +13,10 @@## Captioning a scene-To caption what a scene plays — every voice in it, as mixed — transcribe the scene itself: pass `{ "scene": "<scene id>" }` as the `transcribe` model's `audio` to [`generate`](../tools/generate.md), save the transcript into the library, and mount it.+To caption what a scene plays — every voice in it, as mixed — transcribe the scene itself: pass `{ "scene": "<scene id>" }` as the `universal-3.5-pro` model's `audio` to [`generate`](../tools/generate.md), save the transcript into the library, and mount it.```bash-diffusion generate transcribe '{"audio":{"scene":"talk"}}' -o transcripts/talk.json+diffusion generate universal-3.5-pro '{"audio":{"scene":"talk"}}' -o transcripts/talk.jsondiffusion job <id> # until its status is succeeded```diff --git a/docs/reference/models.md b/docs/reference/models.mdindex 514a1575..ee7dbc75 100644--- a/docs/reference/models.md+++ b/docs/reference/models.md@@ -8,7 +8,7 @@ Every model [`generate`](./tools/generate.md) runs, and the fields each takes. A| [Video](#video) | `veo-3.1`, `veo-3.1-fast`, `kling-3-pro`, `kling-o3-pro`, `seedance-2.5`, `wan-3.0`, `minimax-h3`, `flux-3-video`, `grok-imagine-video-1.5` | a clip from a prompt, optionally from a start (and end) frame || [Audio](#audio) | `elevenlabs-music`, `elevenlabs-sfx` | music, sound effects || [Voice](#voice) | `elevenlabs-v3`, `gemini-3.8-flash-tts` | speech |-| [Tools](#tools) | `remove-background`, `upscale-image`, `upscale-video`, `transcribe`, `analyze` | one file in, one file out |+| [Tools](#tools) | `bria-rmbg-2.0`, `seedvr-2`, `bytedance-upscaler`, `universal-3.5-pro`, `gemini-3.5-flash` | one file in, one file out || [Local](#local) | `sam-2.1` | runs on this machine, free: an object's mask, tracked through footage |## Image@@ -87,13 +87,13 @@ Durations given as a range take any whole second in it.Each takes one file and returns one.-| Model | Fields | Returns |-| --- | --- | --- |-| `remove-background` | `image`: `{ path }`, required | a PNG of the image with a transparent background |-| `upscale-image` | `image`: `{ path }`, required | a PNG of the image upscaled 2× |-| `upscale-video` | `video`: `{ path }`, required | an MP4 of the video upscaled to 2K at 30 fps |-| `transcribe` | `audio`: `{ path }` (audio or video) or `{ scene }` (the scene's mix, see [Scenes](./tools/generate.md#scenes)), required; `languageCode`: e.g. `en`, `en_us`, `de` (detected when left out) | `transcript.json`: `[{ text, speaker?, words: [{ text, start, end }] }]`, times in seconds, speakers labelled `A`, `B`, … when told apart |-| `analyze` | `media`: `{ path }`, required (image, video or audio); `prompt`: what to look for, up to 10,000 characters (a general description when left out) | the analysis, as a file |+| Model | | Fields | Returns |+| --- | --- | --- | --- |+| `bria-rmbg-2.0` | Bria RMBG 2.0 — background removal | `image`: `{ path }`, required | a PNG of the image with a transparent background |+| `seedvr-2` | SeedVR2 — image upscaling | `image`: `{ path }`, required | a PNG of the image upscaled 2× |+| `bytedance-upscaler` | ByteDance Upscaler — video upscaling | `video`: `{ path }`, required | an MP4 of the video upscaled to 2K at 30 fps |+| `universal-3.5-pro` | AssemblyAI Universal-3.5 Pro — transcription with speaker labels (Universal-2 for languages it lacks) | `audio`: `{ path }` (audio or video) or `{ scene }` (the scene's mix, see [Scenes](./tools/generate.md#scenes)), required; `languageCode`: e.g. `en`, `en_us`, `de` (detected when left out) | `transcript.json`: `[{ text, speaker?, words: [{ text, start, end }] }]`, times in seconds, speakers labelled `A`, `B`, … when told apart |+| `gemini-3.5-flash` | Gemini 3.5 Flash — describes or answers questions about media | `media`: `{ path }`, required (image, video or audio); `prompt`: what to look for, up to 10,000 characters (a general description when left out) | the analysis, as a file |## Localdiff --git a/docs/reference/tools/generate.md b/docs/reference/tools/generate.mdindex 070a0c58..78207481 100644--- a/docs/reference/tools/generate.md+++ b/docs/reference/tools/generate.md@@ -41,7 +41,7 @@ diffusion generate flux-2-klein --prompt "A red fox at dawn, misty meadow, telepdiffusion generate nano-banana-pro --prompt "The fox in the forest" '{"images":[{"path":"./fox.png"},{"path":"./forest.jpg"}],"aspectRatio":"16:9"}'diffusion generate veo-3.1-fast --prompt "The fox turns and runs into the trees" '{"startFrame":{"path":"./fox.png"},"duration":6}' -o ./fox-run.mp4diffusion generate elevenlabs-v3 --prompt "Welcome back to the channel." '{"voice":"JBFqnCBsd6RMkjVDRZzb"}'-diffusion generate remove-background '{"image":{"path":"./fox.png"}}'+diffusion generate bria-rmbg-2.0 '{"image":{"path":"./fox.png"}}'```## Estimating@@ -53,7 +53,7 @@ diffusion generate veo-3.1-fast --prompt "The fox turns and runs into the trees"# prints { "credits": …, "etaSeconds": … }```-Files (`{ "path": … }`) are uploaded first, as for a job, since a tool such as `transcribe` or `upscale-video` is priced by the length of its input; starting the job afterwards reuses the upload. `output` and `maxCredits` are ignored. A [local model](../models.md#local) costs `0`, its `etaSeconds` planned from the file as its job would be. An API model still needs a signed-in account.+Files (`{ "path": … }`) are uploaded first, as for a job, since a tool such as `universal-3.5-pro` or `bytedance-upscaler` is priced by the length of its input; starting the job afterwards reuses the upload. `output` and `maxCredits` are ignored. A [local model](../models.md#local) costs `0`, its `etaSeconds` planned from the file as its job would be. An API model still needs a signed-in account.## Where the files godiff --git a/packages/dapi/src/local/index.ts b/packages/dapi/src/local/index.tsindex e6b127d5..d96a93a6 100644--- a/packages/dapi/src/local/index.ts+++ b/packages/dapi/src/local/index.ts@@ -2,14 +2,6 @@* License, v. 2.0. If a copy of the MPL was not distributed with this* file, You can obtain one at http://mozilla.org/MPL/2.0/. */-// Models the app runs on this machine, behind the same `generate` and `job`-// as the API's: a request is `model` plus the model's fields, and a job is-// shaped like the API's `Job`. Unlike the API's, a local model's request is-// checked here, by its schema, since no server is there to say what to fix.-//-// A model is named for itself (`sam-2.1`), never for its task: task names-// (`transcribe`, `remove-background`) are the API's, and the two lists must-// not share an id.import { samRequest } from "./sam";