From fba355e052729a036c5eda0799eee6142a86c19a Mon Sep 17 00:00:00 2001 From: konstantin-paulus Date: Tue, 21 Jul 2026 14:37:45 +0200 Subject: [PATCH] Update README for clarity and enhance WorldDocument component with timing properties Revised the README to replace "media compositor" with "multimedia editor" and improved the description of the `dapi` CLI. Enhanced the `WorldDocument` class in the JSX utility by updating the `setComponent` logic to conditionally handle trim properties based on the presence of timing attributes, improving the functionality of scene transcriptions. Updated the `CaptionsProps` type to include new timing properties for better integration. --- README.md | 4 ++-- apps/web/src/utils/jsx.ts | 9 ++++++++- packages/jsx/src/types.ts | 3 ++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9763d87..b1df1a0 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Diffusion Studio -**FFmpeg for agents:** a media compositor you drive from the command line, with a generative-AI and vision toolchain built in. +**FFmpeg for agents:** a multimedia editor you drive from the command line, with generative AI and multimodal understanding built in. -What makes Diffusion Studio different is `dapi`, its CLI: every part of the editor (projects, the scene graph, the asset library, AI generation, rendering) is scriptable over a local socket, with JSON on stdout and deterministic exit codes. +What sets Diffusion Studio apart is `dapi`: a CLI that makes every part of the editor (projects, scene graphs, assets, AI generation, and rendering) scriptable over a local socket. ```sh dapi open # use -b to run the editor headless diff --git a/apps/web/src/utils/jsx.ts b/apps/web/src/utils/jsx.ts index 112fa02..e926765 100644 --- a/apps/web/src/utils/jsx.ts +++ b/apps/web/src/utils/jsx.ts @@ -528,7 +528,14 @@ export class WorldDocument implements ProjectDocument { assert(this.engine, "captioning requires an engine (author-mode mount)"); const { asset, trim } = await transcribeScene(this.engine, sceneEid); setComponent(world, nodeEid, c.AssetId, asset.id); - setComponent(world, nodeEid, c.Trim, trim); + + const props = this.data(nodeEid).props; + const hasIn = timingProp(props, "sourceIn") !== undefined; + const hasOut = timingProp(props, "sourceOut") !== undefined || timingProp(props, "end") !== undefined; + setComponent(world, nodeEid, c.Trim, { + start: hasIn ? c.Trim.start[nodeEid] : trim.start, + end: hasOut ? c.Trim.end[nodeEid] : trim.end, + }); } } diff --git a/packages/jsx/src/types.ts b/packages/jsx/src/types.ts index 362ec1b..6a00d83 100644 --- a/packages/jsx/src/types.ts +++ b/packages/jsx/src/types.ts @@ -378,5 +378,6 @@ export type SequenceProps = Pick & { export type CaptionsProps = Pick< PatchProps, - "preset" | "colors" | "verticalAlign" | "offsetX" | "offsetY" | "src" | "start" | "animations" + | "preset" | "colors" | "verticalAlign" | "offsetX" | "offsetY" | "src" + | "start" | "end" | "sourceIn" | "sourceOut" | "animations" >;