feat: release 1.5.7 - per-clip workflows, runtime budgets, media-path guards

Three reported issues:

#66: the Video stage workflow picker was keyed by scene id, so choosing a
workflow for one clip overwrote every sibling clip. It is now keyed by clip
id, hydrates each clip's persisted choice, autosaves both
clips.workflow_id and form_workflow_id, and Generate One / Generate All
resolve the workflow per clip (a scene can mix image->video and
video->video extend across its clips).

#64: a 30-second ask could produce a 1:51 script - prompts carried no
per-scene scale and the duration rescale could only grow. Prompts now
state the total seconds and a per-scene budget, and the rescale may shrink
(floor 0.5) so over-written boards pull toward the target; content itself
is never edited.

#67: a hand-written directory path (e.g. ComfyUI's input dir) reached
ComfyUI and died as an opaque Errno 21. prepare_media_inputs now rejects
directory / missing local files before queueing with a node-naming error,
and the agent's run_workflow validates media input_values at call time.
Bare Comfy-side names pass untouched.

534 backend tests pass; svelte-check clean.
This commit is contained in:
Benjiyaya
2026-09-24 02:26:47 +08:00
parent 7551ba9d88
commit d2240b9c5a
12 changed files with 453 additions and 43 deletions
@@ -296,6 +296,11 @@ async def generate_script(
# guess — and the user's target runtime is the total they sum to. Runs
# AFTER all chunks are committed, as a bulk UPDATE over the durable
# board (the rescale is global; the rows were persisted per chunk).
# Issue #64: the scale may go BELOW 1.0 (floor 0.5) so an over-written
# script's scene budgets shrink toward the target too — the old
# max(..., 1.0) treated the target as a floor, and a 30s ask produced a
# 1:51 script. The floor keeps a wildly over-written board from being
# mislabeled more than 2x; content itself is not edited.
if target_seconds:
all_rows = conn.execute(
"SELECT id, action, dialog FROM scenes WHERE project_id = ? ORDER BY order_index",
@@ -307,7 +312,7 @@ async def generate_script(
]
total_est = sum(estimates)
if total_est > 0:
scale = max(target_seconds / total_est, 1.0)
scale = max(target_seconds / total_est, 0.5)
for row, est in zip(all_rows, estimates):
conn.execute(
"UPDATE scenes SET duration_sec = ? WHERE id = ?",