Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
686c454
An offline engine update whose code is already in place returns to th…
KBRASK Nov 28, 2026
11e01c0
Linux setup: an installation folder whose disk cannot keep the Python…
KBRASK Nov 28, 2026
d880de1
Diagnostic reports: why multi-GPU fell back to one card, and only thi…
KBRASK Nov 28, 2026
c24db2b
Creation panel: say when a prompt asks someone to speak but gives non…
KBRASK Nov 28, 2026
1dc6afe
Reports keep the Quality level and the time shown beside Generate
KBRASK Nov 28, 2026
971e866
Prompt enhancement: a media label the rewrite still leaves out after …
KBRASK Nov 28, 2026
50bde56
Image view: a failed download's "Report a problem" goes under the sen…
KBRASK Nov 28, 2026
f24f6d0
Editor API: a request that storage refuses is logged with its error c…
KBRASK Nov 28, 2026
74ffe05
Creation panel: the lines above the Generate key read as one note, le…
KBRASK Nov 28, 2026
a5518d6
Keyboard: a button taken out of the tab order is no tab stop for a la…
KBRASK Nov 28, 2026
f1fb332
Image models that need an NVIDIA graphics card say so instead of "not…
KBRASK Nov 28, 2026
00eee89
Setup: the model code downloads only the files it needs, about 1 MB i…
KBRASK Nov 28, 2026
e8b1e3e
Films: a run of continuing shots longer than one video can be is refu…
KBRASK Nov 28, 2026
bd996d7
Image planner: a request whose smallest layout fits with a smaller ma…
KBRASK Nov 28, 2026
5812760
GPU check: an old NVIDIA driver is named even when the check ends bef…
KBRASK Nov 28, 2026
c55a769
Edit view: each slider of the adjust panel has hover words of its own…
KBRASK Nov 28, 2026
a1c25af
Image failure card: say what the picture needs and what is free, and …
KBRASK Nov 28, 2026
6d38dfe
Model names stay on one line, and read, copy and find as written
KBRASK Nov 28, 2026
d3bf1ec
Problem reports name the system before setup has recorded the hardwar…
KBRASK Nov 28, 2026
e782e2f
Launcher cards: a missing or broken NVIDIA driver found when starting…
KBRASK Nov 28, 2026
b14dd63
Launcher cards: when the NVIDIA driver is installed but does not answ…
KBRASK Nov 28, 2026
7eff087
Launcher cards: the detected graphics card and driver line is shown i…
KBRASK Nov 28, 2026
af8537f
Edit view at 320 px: the play row and the tool row take a second row …
KBRASK Nov 28, 2026
361b97f
At 320 px: the top bar, the Edit image header and the image view's Ge…
KBRASK Nov 28, 2026
7146e22
Autopilot: a task without a label is named by its kind and shows its …
KBRASK Nov 28, 2026
58a1529
Creations and Create's Info name what a video was made with: its qual…
KBRASK Nov 28, 2026
5c2db60
Compare on a phone: the bar's keys keep their words on one line and t…
KBRASK Nov 28, 2026
f223040
Editor: Escape closes the lent bar's prompt library, reference list a…
KBRASK Nov 28, 2026
fff04c2
Focus ring: drawn inside the edge of typing fields, menu rows and opt…
KBRASK Nov 28, 2026
163b208
Image view: the prompt box shows its keyboard focus with the page's r…
KBRASK Nov 28, 2026
ca2e4a2
Escape closes the layer that holds the focus first, before a tour car…
KBRASK Nov 28, 2026
58a65ce
Drama: a continuing shot that would give its video too many parts can…
KBRASK Nov 28, 2026
1ec218d
Release 0.6.17: update notes
KBRASK Nov 29, 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
15 changes: 15 additions & 0 deletions freevideo_engine/agent/builtin_director.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,12 @@ def revise(view, sentence, *, ask):
return Operation('reshoot', reply['shot'], reply.get('reason', sentence), note=note, changes=changes or None)


# What the director says (to a connected assistant and the log, not the page) when a continuing shot cannot be made
# as part of the same video.
OPEN_FROM_PREVIOUS = ('This shot would take the video past the number of continuations one video can have, so it was '
'reshot as a new shot that starts from the last frame of the previous shot.')


def _context(view, shot_id):
shot = deepcopy(next(s for s in view['shots'] if s['id'] == shot_id))
shot['screenplay'] = next(s for s in view['screenplay']['shots'] if s['id'] == shot_id)
Expand Down Expand Up @@ -593,6 +599,15 @@ def run(tools, production_id, *, ask, stop, wait=25):
fingerprint = _ref(production_id, 'review', shot)
if fingerprint in handed_off or shot['chosen'] is not None or shot['chosen_by'] == 'user':
continue
if action == 'reshoot' and todo.get('changes') == {'continue': False}:
# The same request would fail again (the continuous video would have too many parts): the shot
# becomes a new shot from the last frame of the one before, with no model call.
tools.reshoot(production_id, shot['id'], by='builtin', changes={'continue': False},
reason=OPEN_FROM_PREVIOUS, ref=_ref(production_id, 'reshoot', shot))
errors = conflicts = 0
yield dict(shot=shot['id'], action='reshoot', reason=OPEN_FROM_PREVIOUS)
since, acted = None, True
break
sheets = tools.sheet(production_id, shot['id'], frames=None)
if stop():
return
Expand Down
12 changes: 6 additions & 6 deletions freevideo_engine/agent/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,13 @@
IMAGE_REASONS = {
'small_memory': ('This Mac has less than 16 GB of memory and cannot generate images.',
'这台 Mac 的内存不足 16 GB,无法生成图片。'),
'no_memory': ('Not enough GPU memory, even at the smallest size. Close other apps using the GPU, then try again.',
'显存不足,最小尺寸也无法生成。请关闭其他占用显卡的程序后重试。'),
'no_memory': ('Not enough GPU memory to generate this image. Close other apps using the GPU, then try again.',
'显存不足,无法生成这张图。请关闭其他占用显卡的程序后重试。'),
'busy_video': ('A video is generating. Try again when it finishes.', '视频正在生成,完成后再试。'),
'pack_missing': ('Download "Image generation models" in the launcher first.',
'请先在启动器里下载“图像生成模型”。'),
'model_unavailable': ('This computer does not support the chosen image model. Use Qwen-Image 2.1.',
'这台电脑不支持所选的图片模型。请改用 Qwen-Image 2.1。'),
'model_unavailable': ('The chosen image model needs an NVIDIA graphics card, which this computer does not have. Use Qwen-Image 2.1 instead.',
'所选的图片模型需要 NVIDIA 显卡,这台电脑没有。请改用 Qwen-Image 2.1。'),
'model_unreadable': ('The image generation model files could not be read. Repair them in the launcher and try again.',
'无法读取图像生成模型的文件。请在启动器里修复后再试。'),
'device_unavailable': ('The graphics card is not available right now. Try again later.',
Expand Down Expand Up @@ -343,8 +343,8 @@ def safe_details(value):
'需要的模型尚未安装'),
'pack_missing': ('The image model is not installed yet',
'图片模型尚未安装'),
'model_unavailable': ('This computer does not support the chosen image model',
'这台电脑不支持所选的图片模型'),
'model_unavailable': ('The chosen image model needs an NVIDIA graphics card',
'所选的图片模型需要 NVIDIA 显卡'),
'not_ready': ('The generation environment is not installed yet',
'生成所需的环境尚未安装'),
'cancelled': ('Generation was stopped',
Expand Down
25 changes: 24 additions & 1 deletion freevideo_engine/agent/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,29 @@ def length_problem(seconds, continued, prefix='', *, minimum=None, frames=None):
return problem


def short_parts(blocks, continued, full):
"""Whether any continuing part of these blocks is shorter than `full` frames: such a video has fewer parts."""
return any(block['frames'] < full for index, block in enumerate(blocks) if index or continued)


def chain_after(spec, runner, earlier=(0, False)):
"""(parts, short) of the video a normalized generate spec makes: a new video, or with continue_from the video
of `earlier` (parts, short) it continues. The count parts_problems and the backend hold to the limit."""
from ..chain_plan import FULL_PART_FRAMES, plan
continued = bool(spec.get('continue_from'))
blocks = plan(spec['seconds'], max_frames=single_frame_limit(spec), continued=continued)['blocks']
parts, short = earlier if continued else (0, False)
full = runner.full_part_frames if runner is not None else FULL_PART_FRAMES
return parts + len(blocks), bool(short) or short_parts(blocks, continued, full)


def chain_limit(spec, runner, short):
"""The most parts the video of a normalized spec may have, as the backend counts them."""
from ..chain_plan import MAX_PARTS, parts_limit
return parts_limit(short, spec.get('first_frame_reference') is True,
runner.max_parts if runner is not None else MAX_PARTS)


def parts_problems(spec, runner, prefix='', *, editor=None, work=None, planned=None):
"""One video continues through a limited number of parts; say so before anything is generated.
Expand Down Expand Up @@ -323,7 +346,7 @@ def parts_problems(spec, runner, prefix='', *, editor=None, work=None, planned=N
short_limit = parts_limit(True, spec.get('first_frame_reference') is True, limit)

def short_blocks(blocks):
return any(block['frames'] < full for index, block in enumerate(blocks) if index or continued)
return short_parts(blocks, continued, full)
try:
with runner.lock:
if editor is not None:
Expand Down
88 changes: 78 additions & 10 deletions freevideo_engine/agent/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
ACTIVE = ('waiting', 'queued', 'running', 'cancelling')
TERMINAL = ('succeeded', 'failed', 'cancelled', 'interrupted')
ACTORS = ('agent', 'builtin', 'user')
CHANGES = ('action', 'lines', 'camera', 'framing', 'prompt', 'seconds')
CHANGES = ('action', 'lines', 'camera', 'framing', 'prompt', 'seconds', 'continue')
NEXT = {
'invalid_screenplay': 'Fix every listed problem and retry the request.',
'unknown_shot': 'Use a shot id from the production view.',
Expand Down Expand Up @@ -277,7 +277,8 @@ def _schedule(state, shot, count, by, note=None, *, automatic=False):
job['media'] = {'references': deepcopy(source['references'])}
jobs.append(dict(take=None, job=None, generation=None, seed=None, state='queued', automatic=automatic,
stale=False, continues_take=None, note=note, by=by, library_id=None, seconds=None,
cancel_requested=False, error=None, spec=job))
cancel_requested=False, error=None, spec=job,
**({'opens_take': shot['opens_from']} if shot.get('opens_from') else {})))
if not automatic:
_reserve(state, shot, jobs)
shot['pending'].append(jobs)
Expand Down Expand Up @@ -313,25 +314,33 @@ def _usable(shot):
(t['state'] in ACTIVE + ('paused',) and not t['cancel_requested'])) for t in shot['takes'])


def _bound(take):
"""The take of the shot before that this take starts from: the one it continues, or (in a shot made a new shot
from the last frame of the shot before) the one whose last frame it opens with."""
return take['continues_take'] or take.get('opens_take')


def _remember(shot):
chosen = next((t for t in shot['takes'] if t['take'] == shot['chosen']), None)
if chosen and chosen['continues_take']:
shot.setdefault('choices', {})[chosen['continues_take']] = dict(take=chosen['take'], by=shot['chosen_by'])
if chosen and _bound(chosen):
shot.setdefault('choices', {})[_bound(chosen)] = dict(take=chosen['take'], by=shot['chosen_by'])


def _drop_automatic(shot):
shot['pending'] = [g for g in shot['pending'] if not g[0].get('automatic')]


def _reconnect(state, shot):
"""Derive validity and restore the choice made under this exact parent job."""
if not shot['continues']:
"""Derive validity and restore the choice made under this exact parent job.
A shot that was made a new shot from the last frame of the shot before (opens_from) keeps that bond: its takes,
the earlier continuing ones too, stand while the shot before keeps the take they start from."""
if not shot['continues'] and not shot.get('opens_from'):
return
_remember(shot)
parent = _parent(state, shot)
parent = _parent(state, shot) if shot['continues'] else _chosen(state['shots'][shot['index'] - 2])
for take in shot['takes']:
take['stale'] = bool(take['continues_take'] and
(parent is None or take['continues_take'] != parent['job']))
take['stale'] = bool(_bound(take) and (parent is None or _bound(take) != parent['job']))
if take['stale'] and take['state'] in ACTIVE + ('paused',):
take['cancel_requested'] = True
if not _chosen(shot):
Expand Down Expand Up @@ -629,11 +638,21 @@ def reshoot(state, shot, *, by, note=None, changes=None, takes=1, reason=None, n
for key in changes:
if key not in CHANGES:
problems.append(dict(path='/changes/' + str(key), message='is not an allowed shot change'))
if 'continue' in changes and (changes['continue'] is not False or not (row['continues'] or row.get('opens_from'))):
problems.append(dict(path='/changes/continue', message='can only be false, on a shot that continues the '
'shot before: it becomes a new shot that starts from the last frame of that shot'))
_invalid(problems)
_optional_text(note, '/note')
_optional_text(reason, '/reason')
source = draft['screenplay']['shots'][row['index'] - 1]
source.update(deepcopy(changes or {}))
changes = dict(changes or {})
opening = changes.pop('continue', None) is False or bool(row.get('opens_from'))
if opening and 'seconds' not in changes and 'seconds' not in source:
# Keep the length the shot had: a continuing shot's default length is not a new shot's.
changes['seconds'] = drama.shot_seconds(draft['screenplay'], source)
source.update(deepcopy(changes))
if opening:
_open_from_previous(draft, row, source)
# Recheck the complete effective screenplay, transactionally.
plan(dict(screenplay=draft['screenplay'], takes_per_shot=draft['takes_per_shot'], director=draft['director']),
fields=False, single_seconds=single_seconds)
Expand All @@ -644,6 +663,30 @@ def reshoot(state, shot, *, by, note=None, changes=None, takes=1, reason=None, n
_commit(state, draft, now)


def _opening_problem(state, row, source):
"""Why this shot cannot become a new shot from the last frame of the shot before, or None (with that take)."""
previous = _chosen(state['shots'][row['index'] - 2]) if row['index'] > 1 else None
if previous is None or not previous.get('library_id'):
return 'needs a chosen, saved take of the shot before', None
if source.get('references'):
return ('a shot that starts from the last frame of the shot before cannot also carry reference pictures; this '
'shot has references'), None
return None, previous


def _open_from_previous(state, row, source):
"""Make a continuing shot a new shot whose first frame is the last frame of the chosen take of the shot before.
A continuous video holds a limited number of parts; the shots that continue this one count again from here.
Its earlier takes and its choice stay as they are; they stand while the shot before keeps its take."""
problem, previous = _opening_problem(state, row, source)
if problem:
_invalid([dict(path='/changes/continue', message=problem)])
source['continue'] = False
source['first'] = {'library': previous['library_id'], 'frame': 'last'}
row['continues'] = False
row['opens_from'] = previous['job']


def _missing(state):
result = []
for shot in state['shots']:
Expand Down Expand Up @@ -772,6 +815,13 @@ def _todo(state):
action, why = 'choose', 'Choose a succeeded, non-stale take.'
elif not _usable(shot) and not shot['pending'] and any(t['stale'] for t in shot['takes']):
action, why = 'reshoot', 'The preceding shot changed; this shot no longer connects.'
elif (shot['state'] == 'failed' and shot['continues'] and _too_many_parts(shot)
and _opening_problem(state, shot, state['screenplay']['shots'][shot['index'] - 1])[0] is None):
result.append(dict(action='reshoot', shot=shot['id'], changes={'continue': False},
why='This shot would give the continuous video more parts than one video can have, so '
'the same request fails again. Reshoot it as a new shot that starts from the last '
'frame of the shot before (changes: {"continue": false}).'))
continue
elif shot['state'] == 'failed':
action, why = 'reshoot', 'No selectable take succeeded.'
else:
Expand All @@ -781,6 +831,20 @@ def _todo(state):
return result


def _too_many_parts(shot):
"""The shot's latest take failed because its continuous video would have too many parts: refused when the take
was submitted (the video it continues already has as many parts as it may) or by the backend."""
latest = next((t for t in reversed(shot['takes']) if not t['stale']), None)
if not latest or latest['state'] != 'failed':
return False
error = latest.get('error') or {}
if error.get('code') in ('chain_short_parts', 'chain_too_long'):
return True
return error.get('code') == 'invalid_request' and any(
isinstance(row, dict) and row.get('path') == '/continue_from' and str(row.get('allowed', '')).startswith('a video of fewer than')
for row in error.get('details') or ())


def _public(value):
"""Remove local paths even in free-form notes and screenplay media fields."""
if isinstance(value, dict):
Expand Down Expand Up @@ -825,6 +889,8 @@ def view(state):
for shot in state['shots']:
row = {key: deepcopy(shot[key]) for key in ('id', 'index', 'continues', 'state', 'chosen', 'chosen_by')}
row['pieces'] = deepcopy(shot.get('pieces'))
if shot.get('opens_from'):
row['opens_from'] = shot['opens_from']
# The cast of the latest submitted take: cards are read when a take is submitted.
latest = next((t for t in reversed(shot['takes']) if 'cast_reference' in t), {})
row.update(cast_reference=latest.get('cast_reference'), cast_omitted=deepcopy(latest.get('cast_omitted', [])),
Expand All @@ -836,6 +902,8 @@ def view(state):
item = {key: deepcopy(take[key]) for key in ('take', 'job', 'generation', 'seed', 'state', 'stale',
'continues_take', 'note', 'by', 'library_id', 'seconds')}
item['state'] = public_states.get(item['state'], item['state'])
if take.get('opens_take'):
item['opens_take'] = take['opens_take']
item['cast'] = deepcopy(take.get('cast'))
row['takes'].append(item)
result['shots'].append(row)
Expand Down
Loading