Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
b55054e
[feat] Quote fixed media inputs and complete candidate batches
bread-lxy Nov 22, 2026
f9ab71f
[feat] Admit reviewed batches and project reservations atomically
bread-lxy Nov 22, 2026
1e2cf81
[feat] Show batch estimates and project approvals across creative ent…
bread-lxy Nov 22, 2026
96b407b
[feat] Account for provider calls and resume reviewed media workflows
bread-lxy Nov 22, 2026
92efc61
[feat] Review workflow charges and settled usage in the canvas and chat
bread-lxy Nov 22, 2026
27278d2
[fix] Price canvas workflows together against the saved project budget
bread-lxy Nov 22, 2026
d7dc6c7
[fix] Meter video costs using submitted frames and returned media
bread-lxy Nov 22, 2026
86a243f
[fix] Show each candidate price and verify standalone CLI review
bread-lxy Nov 22, 2026
cf80d57
[fix] Preserve nested workflow parameters in Agent tool discovery
bread-lxy Nov 22, 2026
4555cca
[fix] Keep spend controls reachable as the estimate loads
bread-lxy Nov 22, 2026
145f070
[fix] Let users price chat calls made by media tools
bread-lxy Nov 22, 2026
1115d84
[fix] Calculate the exact project cap for spend reviews
bread-lxy Nov 23, 2026
f2560a1
[fix] Simplify batch spend confirmation on the canvas and in chat
bread-lxy Nov 23, 2026
7478885
[fix] Confirm spending in dialogs and keep chat focused
bread-lxy Nov 24, 2026
1459f3f
[chore] Merge latest upstream and align spend test hardware marks
bread-lxy Nov 24, 2026
05d0739
[fix] Preserve queued budgets and complete spend review integration
bread-lxy Nov 24, 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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Welcome to follow our official Bilibili account, which includes tutorials and sh

- **Work with AI**: Describe what you want to create, reference canvas assets, and ask the assistant to save text or generate content with your configured models.
- **Canvas and reference assets**: Upload files, connect nodes, or use `@` to add references. Organize assets in one place and review generation history.
- **Project spend**. Preview service costs for a candidate batch, set a project cap, and review requests on the canvas or in chat. [Spending controls](docs/guides/user-guide.md#project-spending)
- **Media editing**: Crop, adjust colors, and work with layers and clips. AI tools such as image extension, erasing, and background removal depend on the connected models' capabilities.
- **Image presets**: Select an image, choose Character three-view, Character four-view, Face three-view, Product three-view, Storyboard, or Multi-camera from **Presets**, then click **Generate**. Character four-view adds a frontal close-up to the right of the full-body front, side, and rear views. Enable **Face emphasis** to ask the model to frame the front and side views from the chin down, keeping the full rear view and frontal close-up. The view presets each produce one reference sheet; Storyboard and Multi-camera each produce four separate images connected to the source.
- **Timeline editing**: Arrange assets, adjust start and end points, speed, and volume, then preview and render an MP4. You can also export JSON, FCPXML, and asset bundles.
Expand Down
3 changes: 2 additions & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ OpenDirector 是一个在本地运行、通过浏览器使用的 AI 视频创作
<a href="https://space.bilibili.com/3747582748658251">
<img src="https://img.shields.io/badge/Bilibili-OpenDirector-00A1D6?logo=bilibili&amp;logoColor=white" alt="OpenDirector 官方 B 站账号" />
</a>
</p>
</p>

## 最新动态

Expand All @@ -40,6 +40,7 @@ OpenDirector 是一个在本地运行、通过浏览器使用的 AI 视频创作

- **与 AI 协作**:描述创作要求,引用画布素材,让助手保存文本并调用已配置的模型生成内容。
- **画布与参考素材**:上传文件、连接节点或用 `@` 添加参考,集中整理素材并查看生成历史。
- **工程费用**。查看整批候选的预计服务费,设置工程上限,在画布或助手对话中确认费用。[费用设置](docs/guides/user-guide.zh-CN.md#工程费用)
- **媒体编辑**:裁剪、调色、处理图层和片段;扩图、消除、抠图等 AI 工具按已接入模型的能力提供。
- **图像预设**:选中图片后,从「预设」选择人物三视图、人物四视图、面部三视图、产品三视图、连续分镜图或多机位,再点「生成」。人物四视图在正面、侧面和背面全身图的右侧加入正脸特写;勾选「脸部强调」后,会提示模型只拍摄正面和侧面从下巴到鞋底的部分,保留完整的背面全身和正脸特写。三视图和四视图各输出一张参考板;连续分镜图和多机位各输出四张独立图片,并关联原图。
- **时间线编排**:安排素材顺序、起止点、速度和音量,预览并合成 MP4,也可导出 JSON、FCPXML 和素材包。
Expand Down
8 changes: 5 additions & 3 deletions apps/api/src/opendirector_api/creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ async def __call__(self, scope, receive, send):
def creation_routes(projects: CreationProjects, generation=None):
router = APIRouter(prefix='/api/creation', tags=['Unified creation projects'])
assets = CreationAssets(projects)
canvas = CreationCanvas(projects)
canvas = CreationCanvas(projects, generation)
history = CreationHistory(projects, assets=assets)
timeline_packages = CreationTimelinePackages(projects)

Expand Down Expand Up @@ -131,14 +131,16 @@ async def execute(project_id: UUID, value: Command, request: Request, x_opendire
session = str(x_opendirector_session) if x_opendirector_session else None
if value.type == 'artifact.publish':
raise ProjectError('产物发布需要服务端执行上下文,不能通过路径直接访问本机文件。', 403)
if value.type == 'job.checkpoint':
if value.type in {'job.checkpoint', 'spend.observe', 'spend.tool', 'spend.advanceGroup'}:
raise ProjectError('任务执行事实只能由后台写入。', 403)
if x_canvas_import is not None and value.type != 'asset.import':
raise ProjectError('归档来源只能随素材导入声明。', 400)
imported_from = x_canvas_import if x_canvas_import in {'generated', 'edited'} else None
if x_canvas_import is not None and imported_from is None:
raise ProjectError('归档来源必须是 generated 或 edited。', 400)
if value.type in {'generation.submit', 'job.cancel', 'job.recover'}:
if value.type in {'spend.review', 'spend.policy'} and request.headers.get('sec-fetch-site') != 'same-origin':
raise ProjectError('Review spending in the local project window.', 403)
if value.type in {'generation.submit', 'generation.group', 'spend.review', 'spend.policy', 'job.cancel', 'job.recover'}:
if generation is None:
raise ProjectError('任务服务不可用。', 503)
receipt = await generation.execute(value, session=session)
Expand Down
11 changes: 10 additions & 1 deletion apps/api/src/opendirector_api/localization.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@
from opendirector.domain.capability_messages import english_capability_message, missing_tool_model_message

ENGLISH_BY_CODE = {
'spend_human_review': 'Review spending in the project window.',
'spend_reviewed': 'This spending request has already been reviewed. Check project spending history.',
'spend_cancelled': 'This spending request was cancelled. Start a new task.',
'selection_preview_started': 'The selection preview has already started. Check project spending history before retrying.',
'spend_call_submitted': 'This tool model call has already been submitted. Check project spending history.',
'spend_quote_changed': 'The request, price or balance changed. Review the current batch.',
'spend_cap': 'This batch exceeds the available project budget.',
'spend_unknown': 'Set a price in the project currency to determine the maximum cost.',
"desktop_auth_required": "The desktop connection has expired. Reopen the application.",
'image_quality_unsupported': 'This model does not support the selected image quality. Choose Auto or select another model.',
'bigmodel_video_model': 'The BigModel video protocol supports CogVideoX-3 only.',
Expand Down Expand Up @@ -151,7 +159,8 @@ def localized_error_for_language(
if specific is not None:
return specific
if not wants_english_language(language):
return chinese
return {'spend_quote_changed': '请求、价格或余额已变更,请重新核对本批报价。', 'spend_cap': '本批费用超过工程可用预算。',
'spend_unknown': '请设置使用工程币种的单价,以确定本批费用上限。'}.get(code, chinese)
if code == 'tool_model_missing':
return missing_tool_model_message(required_capability, english=True)
if code == 'model_list_http_error':
Expand Down
15 changes: 15 additions & 0 deletions apps/api/src/opendirector_api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
from opendirector_api.voices import voice_routes
from opendirector_api.examples import router as example_routes
from opendirector_api.localization import localized_error
from fastapi import Body
from opendirector.domain.creation.spend import ConnectionPrice
from opendirector_api.models import (ModelConfigInput, ModelConfigPublic, AgentModelTest,
ModelCapabilityRequest, ModelDiscoveryRequest, ModelBatchInput,
ToolTaskCreate, ToolPlacement, ImageSelectionCreate, AvailabilityRefresh, AvailabilityCatalog,
Expand Down Expand Up @@ -78,6 +80,7 @@ async def lifespan(app):
availability.probe.close()

app = FastAPI(title="OpenDirector Local API", version="0.1.5", lifespan=lifespan)
creation_generation.tools = creation_tools
app.include_router(creation_routes(creation_projects, creation_generation))
app.include_router(agent_routes(creation_projects, creation_generation, model_configs, chat_provider, active=active_agents))
app.include_router(library_routes(creation_projects))
Expand Down Expand Up @@ -285,6 +288,10 @@ def update_model_config(config_id: UUID, value: ModelConfigInput):
capabilities_supplied='videoCapabilities' in value.model_fields_set, input_modalities=value.inputModalities,
capability_auto_check=value.capabilityAutoCheck)

@app.put('/api/model-configs/{config_id}/price', response_model=ModelConfigPublic)
def update_connection_price(config_id: UUID, value: ConnectionPrice | None = Body()):
return model_configs.set_price(str(config_id), value)

@app.delete("/api/model-configs/{config_id}", status_code=204)
def delete_model_config(config_id: UUID):
catalog.delete(str(config_id))
Expand All @@ -294,6 +301,10 @@ def tool_catalog():
return creation_tools.catalog()

def register_selection_route(service, prefix):
@app.get(prefix + '/{task_id}')
def selection_result(project_id: UUID, task_id: UUID, x_opendirector_session: str = Header()):
return service.selection_result(str(project_id), str(task_id), identifier(x_opendirector_session))

@app.post(prefix)
async def image_selection(project_id: UUID, value: ImageSelectionCreate, request: Request,
x_opendirector_session: str = Header()):
Expand Down Expand Up @@ -326,6 +337,10 @@ def register_tool_routes(service, prefix):
def tool_tasks(project_id: UUID):
return {'tasks': service.list(str(project_id))}

@app.post(prefix + '/quote')
def quote_tool(project_id: UUID, value: ToolTaskCreate, x_opendirector_session: str = Header()):
return service.quote(str(project_id), value.model_dump(mode='json', exclude_none=True), identifier(x_opendirector_session))

@app.post(prefix, status_code=202)
async def submit(project_id: UUID, value: ToolTaskCreate, x_opendirector_session: str = Header()):
return await service.submit(str(project_id), value.model_dump(mode='json', exclude_none=True), identifier(x_opendirector_session))
Expand Down
3 changes: 3 additions & 0 deletions apps/api/src/opendirector_api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from uuid import UUID

from pydantic import model_validator, BaseModel, ConfigDict, Field, SecretStr
from opendirector.domain.creation.spend import ConnectionPrice
from opendirector.domain.creation.editors import ToolDraftBinding
from opendirector.domain.capabilities import AgentInputModality
from opendirector.domain.video_capabilities import VideoAdapter, VideoCapabilities
Expand Down Expand Up @@ -75,6 +76,7 @@ class ModelCapabilityRequest(ModelConfigInput):


class ModelConfigPublic(ModelConnection):
price: ConnectionPrice | None = Field(default=None, exclude_if=lambda value: value is None)
availability: ModelAvailability | None = Field(default=None, exclude_if=lambda value: value is None)
providerId: UUID | None = Field(default=None, exclude_if=lambda value: value is None)
videoAdapter: VideoAdapter = 'auto'
Expand Down Expand Up @@ -115,6 +117,7 @@ def bounded_parameters(self):


class ImageSelectionCreate(Model):
id: UUID | None = None
sourceAssetId: UUID
prompt: str = Field(default='', max_length=2000)
boxes: list[ToolBox] = Field(default_factory=list, max_length=64)
Expand Down
14 changes: 14 additions & 0 deletions docs/guides/user-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,20 @@ Selected voices are saved in the project; favorites are saved as browser prefere

Agents use the same validation through `voice_list`, `voice_create`, and `voice_delete`. The [business CLI](cli.md) also exposes `voice list`, `voice create`, and `voice delete`.

## Project spending

Click the wallet icon at the bottom left of the canvas to open **Project spend**, including spending controls and history. A generation estimate lists the selected model, pricing unit, output count and batch total. Reference music lists transcription of the source recording and generation of the music separately. Following the recording uses the effective duration limit shown by the music model. For editing tools, expand the estimate to see each model call.

In **Model connections**, set a unit price and currency for an individual model. Media tools that translate prompts use the chat model’s **Media tool call price**. A connection price takes precedence over the built-in official price for an exact service endpoint and model. A self-hosted connection defaults to zero service fees. Unknown charges and different currencies remain visible separately. The ledger covers media service calls. Equipment costs and assistant subscriptions are separate expenses.

When a batch exceeds **Confirm above** or needs another spending decision, a confirmation dialog shows the action, quantity and estimated total. Canvas actions and assistant tasks use the same dialog. **Spent so far** is the amount already recorded. **Reserved for tasks** is the budget held for approved work. Hover over either amount for details. When the remaining budget is too low, the confirmation button shows the new project cap needed to run the batch. Click it once to raise the cap and start the work.

Approving or cancelling closes the dialog; multiple new requests are reviewed one at a time. Closing it or pressing Esc leaves the request waiting for approval. A dot on the wallet icon indicates pending requests; click it to reopen the review. **Spending controls and history** in the dialog opens project totals and past calls.

With a cap enabled, calls with an unknown maximum require a price in the project currency. Select a group to see the subtotal for runnable steps and how many are waiting for inputs. If a workflow needs an upstream result, review its runnable steps first and then the downstream estimate based on the saved result. The CLI returns the local review link and supports `query spend.status`.

Spend history retains the original estimate, any charge calculated from confirmed usage, and any amount explicitly reported by the service. A lost response leaves the call pending verification. Restoring a full project backup retains these records. Importing an asset into a new project starts with that project's own usage history. Undo applies to creative edits.

## Monitor and manage generation tasks

Open **Generation history** at the top right to view task progress, results, and failure details.
Expand Down
14 changes: 14 additions & 0 deletions docs/guides/user-guide.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,20 @@ MiniMax 配音使用[同步语音合成接口](https://platform.minimax.cn/docs/

Agent 通过 `voice_list`、`voice_create`、`voice_delete` 使用同一套校验;[业务 CLI](cli.md) 也提供 `voice list`、`voice create`、`voice delete`。

## 工程费用

点击画布左下角的钱包图标打开「工程费用」,查看费用设置与记录。生成报价列出模型、计价单位、生成数量和整批金额。使用参考录音生成音乐时,转谱和音乐生成各有一笔报价。开启跟随参考时长后,音乐生成使用模型实际采用的时长上限。展开媒体编辑工具的报价,可以看到各次模型调用。

在「模型接入」中可以给单个模型设置计价单位、单价和币种。媒体工具调用对话模型翻译提示词时,使用该对话模型的「媒体工具调用单价」。连接单价优先于内置官方价格。官方价格只适用于明确对应的服务地址和模型。自托管连接默认服务费为零。缺价步骤和不同币种分别显示。工程费用记录涵盖媒体服务调用,设备开支和助手订阅单独计算。

整批估价超过「单批确认阈值」或需要其他费用决定时,确认弹窗会显示本次操作、数量和预计总价。画布操作和助手发起的任务共用此弹窗。「已用金额」是已计入工程的费用,「任务占用」是已批准任务尚在占用的预算。把指针移到这两项上可以查看说明。剩余预算不足时,确认按钮会列出运行本批所需的新工程上限,点击一次即可提高上限并运行。

批准或取消后,弹窗关闭;同时存在多项新申请时,依次确认。点击关闭或按 Esc 会保留申请,任务继续等待批准。钱包图标上的小圆点表示仍有申请待处理,点击图标可重新打开。弹窗中的「费用设置与记录」可查看工程总额和历史调用。

开启上限后,最高费用未知的调用需要先配置使用工程币种的价格。选择分组即可查看可执行步骤的小计和仍在等待输入的步骤数。有依赖的分组可以先批准已报价的上游步骤,取得素材后再查看下游报价。命令行返回本地确认页面地址,使用 `query spend.status` 可查看当前决定。

费用记录保留原估价、根据已确认用量计算的金额,以及服务明确报告的金额。服务响应丢失时,相应调用等待核实。恢复完整工程备份会保留费用记录。将素材导入新工程时,新工程独立记录自己的调用。撤销画布编辑会保留已经发生的费用。

## 查看和处理生成任务

打开右上角“生成历史”,查看任务进度、结果和失败原因。
Expand Down
Loading
Loading