Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
73e90be
[feat] canvas: rebuild a video as a 3D blockout from its cameras and …
princepride Dec 2, 2026
a712d09
[bugfix] canvas: bound video blockout memory and check the tracked fr…
princepride Dec 2, 2026
96160f2
[bugfix] canvas: render video blockout bodies in bounded parts
princepride Dec 2, 2026
42ac484
[bugfix] canvas: check video blockout depth answers in the adapter an…
princepride Dec 2, 2026
98cb96c
[bugfix] canvas: refuse incomplete video blockout body answers
princepride Dec 3, 2026
1105e57
[feat] agent: submit, read and publish video blockout tasks from the …
princepride Dec 3, 2026
a4e5836
[refactor] canvas: drop video blockout docstrings and steady its memo…
princepride Dec 3, 2026
46805fe
[bugfix] canvas: correct the blockout guides and copy, bound camera m…
princepride Dec 3, 2026
3a3b9de
[bugfix] tests: expect the 3D body preset in the provider settings br…
princepride Dec 4, 2026
c91e25c
Merge main into feat/video-blockout-3d and settle what the structure …
princepride Dec 4, 2026
6f094ae
[bugfix] canvas: render a video blockout frame with no scene and no p…
princepride Dec 4, 2026
3974668
[bugfix] canvas: name the blockout result in English and record which…
princepride Dec 4, 2026
f3092d7
[bugfix] media: measure the blockout frame rate from steady frame gap…
princepride Dec 4, 2026
8f625ec
Merge origin/main into feat/video-blockout-3d
princepride Dec 4, 2026
e10a5da
[bugfix] media: retime a blockout source whose frames sit on a regula…
princepride Dec 4, 2026
bcc6e7a
[bugfix] media: give retimed blockout frames their duration so the en…
princepride Dec 4, 2026
be0d878
[test] blockout: do not depend on the rate FFmpeg probes for the reti…
princepride Dec 4, 2026
3feace3
[bugfix] media: give a regular blockout source the listed rate its ti…
princepride Dec 4, 2026
2840931
Merge origin/main into feat/video-blockout-3d
princepride Dec 4, 2026
9726bd6
[bugfix] media: anchor the blockout frame grid on all frames, not the…
princepride Dec 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions apps/api/src/opendirector_api/localization.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@
'tool_structure_reference_duration': 'Structure reference needs a clip no longer than 30 seconds. Trim the video first.',
'tool_structure_reference_frames': 'Structure reference processes at most 2048 frames at a time. Trim the video or lower its frame rate first.',
'tool_structure_reference_misaligned': 'Tracking or depth returned a different number of frames than the video, so the frames cannot be aligned. Try again.',
'tool_blockout_duration': 'Video blockout needs a clip no longer than 30 seconds. Trim the video first.',
'tool_blockout_frames': 'Video blockout processes at most 2048 frames at a time. Trim the video or lower its frame rate first.',
'tool_blockout_people': 'Video blockout handles at most 8,192 person-frames (each person on each frame counts once) at a time. Trim the video or use a shot with fewer people.',
'tool_blockout_misaligned': 'Tracking and the video differ in frame count or picture size, so they cannot be aligned frame by frame. Re-export the video as a constant-frame-rate H.264 MP4 and process that.',
'voice_upload_type': 'Upload the voice recording using multipart/form-data.',
'voice_upload_form': 'Check the recording, form fields and text lengths, then try the upload again.',
'voice_model_unsupported': 'This checkpoint does not accept uploaded voices. Choose a Base model for voice cloning or a compatible built-in voice.',
Expand Down
2 changes: 1 addition & 1 deletion apps/api/src/opendirector_api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class UrlSource(Model):

class ModelConnection(Model):
connectionType: Literal['api', 'self_hosted'] = 'api'
protocol: Literal['openai', 'volcengine', 'higgsfield_open', 'bigmodel_video', 'kling_video', 'minimax_video_v2', 'vllm_omni', 'vllm_omni_segmentation', 'vllm_omni_music', 'vllm_omni_depth', 'vllm_omni_score'] | None = None
protocol: Literal['openai', 'volcengine', 'higgsfield_open', 'bigmodel_video', 'kling_video', 'minimax_video_v2', 'vllm_omni', 'vllm_omni_segmentation', 'vllm_omni_music', 'vllm_omni_depth', 'vllm_omni_score', 'vllm_omni_bodies'] | None = None
authMode: Literal['none', 'bearer'] | None = None
proxyMode: Literal['system', 'direct'] | None = None
capabilityAutoCheck: bool | None = Field(default=None, strict=True, exclude_if=lambda value: value is None)
Expand Down
2 changes: 1 addition & 1 deletion docs/architecture/capability-contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ One boundary is left, and it now cuts the other way: a route this table cannot p

## Routes without an operation

`/v1/images/segmentations`, `/v1/videos/segmentations` and `/v1/videos/depth` are registered endpoints that no operation owns; upstream's docs state that "segmentation and depth estimation do not acquire one of these operations merely by being present in a registry" (`docs/serving/capabilities.md:41-43`). `image.segment`, `video.matting` and `video.motion_capture` therefore stay `unknown` with `no_upstream_profile` — the endpoint does not publish the ability, so it cannot be judged, and it must never read as `missing`. `audio.score` is `no_upstream_operation`; `image.cutout` is `parameter_only` (a request field of a published operation, granted per adapter rather than per profile); `audio.separate` is `no_local_adapter`. None of these six ids is a value of `OPERATION_PROFILES`, so `unknown` falls out of "no evidence" rather than a special case.
`/v1/images/segmentations`, `/v1/videos/segmentations` and `/v1/videos/depth` are registered endpoints that no operation owns; upstream's docs state that "segmentation and depth estimation do not acquire one of these operations merely by being present in a registry" (`docs/serving/capabilities.md:41-43`). `/v1/videos/bodies` (3D body reconstruction) is likewise an endpoint without an operation. `image.segment`, `video.matting`, `video.motion_capture`, `video.camera` (cameras and depth from `/v1/videos/depth`) and `video.body_capture` therefore stay `unknown` with `no_upstream_profile` — the endpoint does not publish the ability, so it cannot be judged, and it must never read as `missing`. `audio.score` is `no_upstream_operation`; `image.cutout` is `parameter_only` (a request field of a published operation, granted per adapter rather than per profile); `audio.separate` is `no_local_adapter`. None of these eight ids is a value of `OPERATION_PROFILES`, so `unknown` falls out of "no evidence" rather than a special case.

## ASR: an upstream gap, not a missing row

Expand Down
16 changes: 16 additions & 0 deletions docs/guides/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,22 @@ opendirector video structure-reference-task TASK_ID
opendirector video structure-reference-task TASK_ID --action publish
```

## Video blockout / 视频脱模

**Video blockout** rebuilds a clip of up to 30 seconds in 3D and renders it from the source camera: a gray scene and one solid-colored body model per person, with the source's frame rate and size, plus a layout file with the cameras, the scale and each person's body parameters. A constant-frame-rate clip keeps its frame count; a variable-frame-rate clip is resampled at the rate its frame timestamps show, so the blockout lines up with the source by time, and the layout lists which source frame each output frame shows. It needs a video tracking model (SAM 3), Depth Anything 3 on the vLLM-Omni depth protocol and SAM 3D Body on the vLLM-Omni 3D body protocol. The task keeps the original; when it succeeds, publishing places the blockout video and the layout file on new canvas nodes at the default position. Unlike a run from the canvas toolbar, these nodes are not linked to the source node.

**视频脱模**把不超过 30 秒的视频在三维中重建,并按原片机位渲染:灰色场景,每个人物一个固定颜色的人体模型,帧率和尺寸与原片一致,另附一个记录相机、比例和每个人物人体参数的布局文件。恒定帧率的素材帧数也一致;可变帧率的素材按其帧时间戳体现的帧率重采样,白模按时间与原片对齐,布局会列出每个输出帧显示的原片帧号。需要接入视频跟踪模型(SAM 3)、vLLM-Omni 深度接口上的 Depth Anything 3 和 vLLM-Omni 三维人体接口上的 SAM 3D Body。任务保留原片;成功后发布,会把白模视频和布局文件放到默认位置的新画布节点上。与从画布工具栏运行不同,这些节点不会与来源节点相连。

From the CLI, supply the source asset ID and a stable operation ID, which is also the task ID. Query the task, request cancellation with `--action cancel`, or publish its successful outputs with `--action publish`. Agents use the `video_blockout` and `blockout_task` tools with the same fields.

在 CLI 中传入源素材 ID 和固定的操作 ID,操作 ID 同时也是任务 ID。可以查询任务,用 `--action cancel` 请求取消,或用 `--action publish` 发布成功的结果。Agent 使用字段相同的 `video_blockout` 和 `blockout_task` 工具。

```sh
opendirector video blockout --asset-id ASSET_ID --operation-id TASK_ID
opendirector video blockout-task TASK_ID
opendirector video blockout-task TASK_ID --action publish
```

## Web Motion documents and rendering / 动效编辑文档与渲染

Motion nodes are saved as `editor` documents with `kind: "motion"` and managed via `editor create`, `editor save`, `canvas show`, and `canvas attach-editor`. Use the `motion` command group to inspect skills, run rendered frame diagnostics, export local MP4 files, or atomically publish the rendered MP4 as a video node linked to its source Motion node (`provenance.source: "rendered"` and `provenance.sourceItemId`) through the same server-side headless Chrome + FFmpeg pipeline used by Motion Studio:
Expand Down
2 changes: 2 additions & 0 deletions docs/guides/user-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ To use **Depth motion capture** on a video, add a video model with the **vLLM-Om

**Structure reference** turns a video of up to 30 seconds into a reference for regenerating it with the same motion, timing and camera: a video aligned frame by frame with the source, in which the scene is rendered as gray relief and each tracked subject (people by default; name other subjects separated by commas) gets one fixed solid color. The source's faces, clothing, materials, lighting and colors are not kept. Frame rate and duration match the source, and so does the frame count of a constant-frame-rate clip; a variable-frame-rate clip is first resampled at its nominal rate, so the structure reference lines up with the source by time. The output is silent and capped at 8 Mbit/s. It needs both a segmentation model that can track through video (such as SAM 3) and the depth model above. The structure reference is an ordinary video asset: connect it to a video node as a reference video so the new footage follows the source's motion, pacing, camera and scene structure, and set the new character and style with reference images or the prompt. The structure reference is rendered from per-frame depth and masks. It is not an editable 3D scene and does not infer occluded limbs. When no person is found for the default subject, the result still contains the scene. Agents and the CLI run the same task with the `video_structure_reference` and `structure_reference_task` tools or `opendirector video structure-reference` and `video structure-reference-task` (see the [CLI guide](cli.md)).

**Video blockout** rebuilds a clip of up to 30 seconds in 3D and renders it from the source camera: the scene becomes gray geometry and each person a body model in one fixed color (the first person red), with the same frame rate and size as the source and no sound. The frame rate is read from the gaps between the source's frame timestamps, not from the container's own guess. A constant-frame-rate clip keeps its frame count; a variable-frame-rate clip is resampled at that rate, so the blockout lines up with the source by time. It needs three models: a segmentation model that tracks through video (SAM 3), **Depth Anything 3** on the **vLLM-Omni depth** protocol (for example `depth-anything/DA3-LARGE-1.1`; it estimates the camera of every frame and the scene's depth), and **SAM 3D Body** on the **vLLM-Omni 3D body** protocol (for example `jetjodh/sam-3d-body-dinov3`; it reconstructs each tracked person's pose in meters). A Depth Anything 3 configuration serves video blockout only, not depth motion capture. The scene is built from the estimated depth of up to eight frames with the people, and what they hold, removed, so it stays fixed while the camera moves; areas the depth model is least sure of, such as sky and distant foliage, are left as background. Depth Anything 3 measures depth in a unit of its own, so each person's depth is matched to the depth of their own pixels and the scale in meters is recorded. When no person is tracked there is nothing to set the scale, and the layout says so (`unit` is `depth_model_unit`). Next to the video, the tool saves a layout file (named after the source, `<source>-blockout-layout.json`) with every frame's camera, the scale, and each person's position and body parameters per frame. Its frame `i` is at `i / fps` seconds of the source; `timeline` records the source's own frame count, whether any output frame shows another source frame than its own number, and in that case `sourceFrameOf`, the source frame each output frame shows. The layout's intrinsics and boxes are in the pixels of its own `width` and `height`; for a source above 720 pixels on the short edge that is the working size, smaller than the video. A clip may hold at most 8,192 person-frames (each person on each frame counts once; for example 4 people over 2,048 frames). Bodies that the tracker does not follow, objects other than people, and limbs hidden throughout are not reconstructed, and the layout cannot be edited on the canvas yet. Use the blockout as a reference video so new footage follows the source's motion, timing and camera. Agents and the CLI run the same task with the `video_blockout` and `blockout_task` tools or `opendirector video blockout` and `video blockout-task` (see the [CLI guide](cli.md)).

In **General** settings, you can switch themes and adjust the watermark removal option. Watermark settings affect only content generated afterward, and the actual effect depends on support from the model service.

## Make your first short film
Expand Down
2 changes: 2 additions & 0 deletions docs/guides/user-guide.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ HTTP 400。

**结构参考** 把一段不超过 30 秒的视频转换成与原片逐帧对齐的结构参考视频,用于以相同的动作、节奏和机位重新生成:场景渲染为灰色浮雕,跟踪到的对象(默认人物,可填写其他对象,多个用逗号分隔)各用一种固定的纯色,不保留原片的人物外观、服装、材质和光色。帧率和时长与原片一致,恒定帧率的素材帧数也一致;可变帧率的素材会先按其标称帧率重采样,结构参考按时间与原片对齐。输出没有声音,码率上限为 8 Mbit/s。它需要同时接入具备视频跟踪能力的分割模型(如 SAM 3)和上面的深度模型。结构参考视频是普通的视频素材,可以连到视频节点作为参考视频,让新画面沿用原片的动作、节奏、机位和场景结构,再用参考图片或提示词指定新的人物和风格。结构参考由每帧深度和遮罩渲染得到,不是可编辑的三维场景,也不会推算被遮挡的肢体;没有识别到默认的人物时仍输出只有场景的结构参考。Agent 和 CLI 通过 `video_structure_reference`、`structure_reference_task` 工具或 `opendirector video structure-reference`、`video structure-reference-task` 命令执行同一任务(见 [CLI 指南](cli.md))。

**视频脱模** 把一段不超过 30 秒的视频在三维中重建,并按原片机位逐帧渲染:场景为灰色模型,每个人物为一个固定颜色的人体模型(第一个人物为红色),帧率和尺寸与原片一致,没有声音。帧率由原片相邻帧时间戳的间隔得出,而不是容器自报的帧率。恒定帧率的素材帧数也一致;可变帧率的素材按这个帧率重采样,白模按时间与原片对齐。它需要三个模型:可跟踪视频的分割模型(SAM 3)、在 **vLLM-Omni 深度接口** 上部署的 **Depth Anything 3**(如 `depth-anything/DA3-LARGE-1.1`,估计每一帧的相机和场景深度),以及在 **vLLM-Omni 三维人体接口** 上部署的 **SAM 3D Body**(如 `jetjodh/sam-3d-body-dinov3`,以米为单位重建每个被跟踪人物的姿态)。Depth Anything 3 的配置只用于视频脱模,不用于深度动作捕捉。场景由最多八帧去掉人物及其手持物后的深度构成,因此镜头移动时场景保持不动;深度模型最不确定的区域(如天空和远处的树丛)留作背景。Depth Anything 3 的深度单位不固定,因此每个人物的深度会与其自身像素的深度对齐,并记录换算成米的比例。没有跟踪到人物时无法确定比例,布局会注明(`unit` 为 `depth_model_unit`)。工具会在视频旁另存一个布局文件(以素材命名,`<素材名>-blockout-layout.json`),记录每一帧的相机、比例,以及每个人物逐帧的位置和人体参数。布局的第 `i` 帧对应原片第 `i / fps` 秒;`timeline` 记录原片自身的帧数、是否有输出帧显示的不是同号的原片帧,以及在这种情况下每个输出帧显示的原片帧号(`sourceFrameOf`)。布局中的内参和人物框以布局自身的 `width`、`height` 为像素单位;短边超过 720 像素的素材会按工作尺寸处理,这个尺寸小于视频尺寸。一段素材最多包含 8192 个人物帧(每帧每人计一次,例如 4 个人、2048 帧)。未被跟踪的人物、人物以外的物体和始终被遮挡的肢体不会重建,布局暂不能在画布上编辑。可将白模视频作为参考视频,让新画面沿用原片的动作、节奏和机位。Agent 和 CLI 通过 `video_blockout`、`blockout_task` 工具或 `opendirector video blockout`、`video blockout-task` 命令执行同一任务(见 [CLI 指南](cli.md))。

在设置的“通用”页中可切换主题、调整去除水印选项。水印设置仅影响后续生成的内容,实际效果取决于模型服务是否支持。

vLLM-Omni 视频连接支持直接输入小数秒,例如 `6.583333`。CLI 可使用 `opendirector video create --duration 6.583333` 并填写其余必需参数。先运行 `opendirector video create --help` 和 `opendirector model list`;`inputRules.fractionalDuration` 表示支持小数秒,各输出规格的时长列表定义允许范围。H3 可能按模型支持的帧数对齐,拼接分段前应核对结果的实际时长。
Expand Down
21 changes: 19 additions & 2 deletions packages/core/src/opendirector/agent/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,19 @@ def tools() -> list[dict]:
{'type': 'object', 'properties': {'taskId': {'type': 'string', 'format': 'uuid'},
'action': {'type': 'string', 'enum': ['get', 'cancel', 'publish']}},
'required': ['taskId', 'action'], 'additionalProperties': False}))
result.append(tool_schema('video_blockout',
'Start a 3D blockout of a video (gray scene and one colored body model per person, rendered from the source camera, '
'plus a layout file) without overwriting the source. Needs video tracking, Depth Anything 3 and SAM 3D Body models; '
'clips up to 30 seconds. Returns a durable task; inspect with blockout_task and publish explicitly after success.',
{'type': 'object', 'properties': {'taskId': {'type': 'string', 'format': 'uuid'},
'sourceAssetId': {'type': 'string', 'format': 'uuid'}},
'required': ['taskId', 'sourceAssetId'], 'additionalProperties': False}))
result.append(tool_schema('blockout_task',
'Inspect, request cancellation, or publish a successful video blockout (its video and layout file) as new canvas nodes. '
'Reuse the original task ID.',
{'type': 'object', 'properties': {'taskId': {'type': 'string', 'format': 'uuid'},
'action': {'type': 'string', 'enum': ['get', 'cancel', 'publish']}},
'required': ['taskId', 'action'], 'additionalProperties': False}))
result.append(tool_schema('prompt_optimize',
'Rewrite an image or video draft with its saved references and the configured text model. '
'Return a draft only; does not edit the node or generate media. Use [[OD_REF_n]] and inlineReferences to retain inline reference positions.',
Expand Down Expand Up @@ -419,7 +432,8 @@ async def cli_prompt_rewrite(runtime, model, thinking, messages):


TASK_TOOLS = {'compression_task': ('video-compress', 'Select a video compression task.'),
'structure_reference_task': ('video-structure-reference', 'Select a structure reference task.')}
'structure_reference_task': ('video-structure-reference', 'Select a structure reference task.'),
'blockout_task': ('video-blockout', 'Select a video blockout task.')}


class AgentTools:
Expand All @@ -436,7 +450,7 @@ def __init__(self, projects, generation, configs, chat_provider=None):
async def execute(self, project_id: UUID, turn_id: UUID, session: str, call_id: str,
name: str, arguments: dict, roots: list[Path], config: dict | None, native_runtime: str | None = None,
execution_directory: Path | None = None, *, runtime_model=None, thinking='auto') -> JsonValue:
if name in {'video_compress', 'video_structure_reference', *TASK_TOOLS}:
if name in {'video_compress', 'video_structure_reference', 'video_blockout', *TASK_TOOLS}:
service = self.generation.tool_tasks
task_id = str(UUID(arguments['taskId']))
pid = str(project_id)
Expand All @@ -448,6 +462,9 @@ async def execute(self, project_id: UUID, turn_id: UUID, session: str, call_id:
return await service.submit(pid, dict(id=task_id, tool='video-structure-reference',
sourceAssetIds=[str(UUID(arguments['sourceAssetId']))],
parameters={'resolution': arguments['resolution'], 'prompt': arguments.get('subjects', '')}), session)
if name == 'video_blockout':
return await service.submit(pid, dict(id=task_id, tool='video-blockout',
sourceAssetIds=[str(UUID(arguments['sourceAssetId']))], parameters={}), session)
tool, refusal = TASK_TOOLS[name]
task = await asyncio.to_thread(service.get, pid, task_id)
if task['tool'] != tool:
Expand Down
Loading
Loading