Skip to content

Make videos on the computer you already own. FreeVideo runs MiniMax H3 in as little as 8 GB of VRAM and 16 GB of RAM, and adapts its acceleration path to your hardware.

Agent films: a shot that continues the previous one is at least 10 seconds long

Bowen Xued3222262a1b5
diff --git a/freevideo_engine/agent/drama.py b/freevideo_engine/agent/drama.py
index e5631d7..8d1e115 100644
--- a/freevideo_engine/agent/drama.py
+++ b/freevideo_engine/agent/drama.py
@@ -20,6 +20,7 @@ import re
import time
from . import spec as specs
+from ..chain_plan import MIN_PART_SECONDS
EXAMPLE = {
'title': '末班车', 'name': 'the-last-train', 'aspect': '9:16', 'quality': 'light',
@@ -33,7 +34,7 @@ EXAMPLE = {
'looking up at the departure board.', 'camera': 'The camera tracks her with small amplitude, then '
'holds still.', 'lines': [{'who': 'lin', 'line': '还来得及吗?', 'how': 'says breathlessly'}],
'sound': 'Heavy rain on the platform roof, splashing footsteps, the buzz of the lamp.'},
- {'id': 'arrival', 'seconds': 6, 'continue': True, 'framing': 'vertical medium close-up',
+ {'id': 'arrival', 'seconds': 10, 'continue': True, 'framing': 'vertical medium close-up',
'action': 'A train headlight sweeps across Lin\'s face; the wind of the arriving train lifts her wet hair and '
'her worry turns into a relieved smile.', 'camera': 'The camera pushes in slowly toward her face.',
'lines': [{'who': 'lin', 'line': '来了。', 'how': 'says quietly'}],
@@ -406,10 +407,16 @@ def intent(play, shot):
shot.get('camera'), lines, looks) if x and x.strip())
+def shot_seconds(play, shot):
+ """A shot says its length; else the film does; else 6 s, and 10 s for a shot that continues the one before
+ (a part that continues another video is at least 10 s)."""
+ return shot.get('seconds', play.get('seconds', MIN_PART_SECONDS if shot.get('continue') else 6))
+
+
def shot_job(play, shot, index, ref):
job = dict(ref=ref, label='%s · %s' % (play.get('title') or 'drama', shot['id']), project=play.get('name'),
aspect=play.get('aspect', '9:16'), quality=play.get('quality', 'light'),
- seconds=shot.get('seconds', play.get('seconds', 6)), metadata={'drama_shot': shot['id']})
+ seconds=shot_seconds(play, shot), metadata={'drama_shot': shot['id']})
if play.get('megapixels'):
job['megapixels'] = play['megapixels']
if shot.get('seed') is not None:
@@ -448,7 +455,7 @@ def batch(play):
for i, shot in enumerate(play['shots']):
if shot.get('idea') and not shot.get('action') and not shot.get('prompt'):
rows.append(dict(ref='s%d-idea' % i, kind='enhance', text=shot['idea'],
- seconds=shot.get('seconds', play.get('seconds', 6)), project=play.get('name'),
+ seconds=shot_seconds(play, shot), project=play.get('name'),
label='%s · %s idea' % (play.get('title') or 'drama', shot['id'])))
rows.append(shot_job(play, shot, i, 's%d' % i))
rows.append(review_job(play, [(shot, '@s%d' % i) for i, shot in enumerate(play['shots'])]))
diff --git a/freevideo_engine/agent/guide.py b/freevideo_engine/agent/guide.py
index 3ac4ba2..7b95bce 100644
--- a/freevideo_engine/agent/guide.py
+++ b/freevideo_engine/agent/guide.py
@@ -73,7 +73,7 @@ GUIDE = {
'timing': [
'Single-block frames are 24 fps on a 17n+5 grid (6 s -> 6.583 s, 10 s -> 10.125 s). '
'Under 30 s defaults to one generation when the device supports this size and quality; unknown limits use 15 s. '
- 'Otherwise it uses parts of up to 15 s (30 s is 15 + 15), continued and joined automatically. '
+ 'Otherwise it uses as few parts as possible, each at least 10 s; how many depends on how long this computer can generate in one run, and the parts continue and join automatically. '
'Multiple blocks or continue_from need two-pass text generation: quality "light" '
'or sampling.two_pass=true, no preview and no media. '
'Multi-block output is cut to the planned duration. POST /plan shows the chain plan. '
diff --git a/freevideo_engine/agent/jobs.py b/freevideo_engine/agent/jobs.py
index 0d7cfce..b37fc05 100644
--- a/freevideo_engine/agent/jobs.py
+++ b/freevideo_engine/agent/jobs.py
@@ -107,6 +107,40 @@ def cut_problems(spec, seconds, prefix='', *, editor=None):
return [dict(problem, got=got, message=problem['message'].replace('received None', 'received ' + got))]
+def _continued_part_problem(seconds, chain):
+ """True when a video that continues another has a part the backend refuses, or is under 10 s.
+
+ The backend compares each part's node input frames (overlap included); a part that
+ continues is also at least MIN_PART_SECONDS long.
+ """
+ from ..chain_plan import MIN_PART_FRAMES, MIN_PART_SECONDS
+ return seconds < MIN_PART_SECONDS or any(block['frames'] < MIN_PART_FRAMES for block in chain['blocks'])
+
+
+def length_problem(seconds, continued, prefix='', *, minimum=None):
+ """Suggest nearby whole-second lengths the same planner and minimum accept."""
+ from ..chain_plan import PlanError, plan
+ available = []
+ for candidate in range(max(1, int(seconds) - 30), int(seconds) + 31):
+ try:
+ chain = plan(candidate, continued=continued)
+ except PlanError:
+ continue
+ if not continued or not _continued_part_problem(candidate, chain):
+ available.append(candidate)
+ if minimum is not None and seconds >= minimum:
+ minimum = None # long enough on its own: the length only cannot be cut into parts that long
+ nearby = [s for s in available if s < seconds][-2:] + [s for s in available if s > seconds][:2]
+ rule = ('at least %d s per continued part' % minimum if minimum is not None
+ else 'a length that can be split into supported parts')
+ allowed = rule + '; available lengths: ' + ', '.join('%d s' % s for s in nearby)
+ problem = schema.diagnostic(prefix + '/seconds', allowed, seconds, nearest=nearby)
+ if minimum is not None:
+ problem['message'] = ('Each continued part must be at least %d seconds. Make it longer. ' % minimum
+ + problem['message'])
+ return problem
+
+
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.
@@ -114,13 +148,24 @@ def parts_problems(spec, runner, prefix='', *, editor=None, work=None, planned=N
`work` is the saved video continue_from names (output-relative), or None while it cannot be told.
`planned` is the number of parts an unfinished job it continues will have, when that is known instead.
"""
- if runner is None or spec['kind'] != 'generate' or spec.get('refine_from'):
+ if spec['kind'] != 'generate' or spec.get('refine_from'):
return []
- from ..chain_plan import plan
+ from ..chain_plan import MIN_PART_SECONDS, PlanError, plan
from ..chain_runner import ChainTooLong
from ..chain_store import reference
- limit, continued = runner.max_parts, bool(spec.get('continue_from'))
- count = lambda seconds: len(plan(seconds, max_frames=single_frame_limit(spec), continued=continued)['blocks'])
+ continued, frames = bool(spec.get('continue_from')), single_frame_limit(spec)
+ if editor is None:
+ # Planning errors must not be swallowed by the source-depth fallback below.
+ try:
+ chain = plan(spec['seconds'], max_frames=frames, continued=continued)
+ except PlanError:
+ return [length_problem(spec['seconds'], continued, prefix)]
+ if continued and _continued_part_problem(spec['seconds'], chain):
+ return [length_problem(spec['seconds'], continued, prefix, minimum=MIN_PART_SECONDS)]
+ if runner is None:
+ return []
+ limit = runner.max_parts
+ count = lambda seconds: len(plan(seconds, max_frames=frames, continued=continued)['blocks'])
try:
with runner.lock:
if editor is not None:
@@ -130,7 +175,7 @@ def parts_problems(spec, runner, prefix='', *, editor=None, work=None, planned=N
else:
# A source the backend has no record of counts as one part, as it does there.
earlier = (runner._work_parts(work, ()) if work else planned or 1) if continued else 0
- needed = earlier + count(spec['seconds'])
+ needed = earlier + len(chain['blocks'])
except (ValueError, KeyError, TypeError):
return [] # Not a chain the backend accepts; it says why when the chain is created.
if needed <= limit:
@@ -138,7 +183,14 @@ def parts_problems(spec, runner, prefix='', *, editor=None, work=None, planned=N
if editor is not None:
problem, got = schema.diagnostic(prefix + '/target', 'a range that takes at most %d parts' % limit, None), '%d parts' % needed
else:
- fit = next((s for s in range(int(spec['seconds']), 1, -1) if earlier + count(s) <= limit), None)
+ # A length the planner refuses does not fit; a part that continues a video is at least MIN_PART_SECONDS.
+ def parts(seconds):
+ try:
+ return count(seconds)
+ except ValueError:
+ return limit + 1
+ shortest = MIN_PART_SECONDS if continued else 2
+ fit = next((s for s in range(int(spec['seconds']), shortest - 1, -1) if earlier + parts(s) <= limit), None)
if fit is None:
problem = schema.diagnostic(prefix + '/continue_from', 'a video of fewer than %d parts' % limit, None)
got = 'a video of %d parts' % earlier
@@ -1325,7 +1377,8 @@ class Jobs:
else bool(row['spec'].get('continue_from')) or not single_block(row['spec'])) and not self.continuation_ready():
raise continuation_unavailable()
self.touch(row, chain_submission='creating', status='queued', queued_at=self.clock())
- from ..chain_runner import ChainBusy, ChainTooLong
+ from ..chain_plan import PlanError
+ from ..chain_runner import ChainBusy, ChainPartTooShort, ChainTooLong
try:
if resume:
chain = runner.resume(row['chain_id'], client_id='agent:' + row['id'])
@@ -1341,6 +1394,12 @@ class Jobs:
row['resume_pending'] = False
self.finish(row, 'failed', error=errors.build('chain_too_long', validation=True, message=str(error)))
return
+ except (PlanError, ChainPartTooShort) as error:
+ row['resume_pending'] = False
+ problem = length_problem(row['spec']['seconds'], bool(row['spec'].get('continue_from')),
+ minimum=error.limit if isinstance(error, ChainPartTooShort) else None)
+ self.finish(row, 'failed', error=errors.validation([problem]))
+ return
except Exception:
row['resume_pending'] = False
if resume:
diff --git a/freevideo_engine/agent/mcp.py b/freevideo_engine/agent/mcp.py
index 2b683e7..8f10321 100644
--- a/freevideo_engine/agent/mcp.py
+++ b/freevideo_engine/agent/mcp.py
@@ -44,7 +44,7 @@ def tool_list():
dict(name='freevideo_prompt_guide', title='H3 prompt guide', description='How to write prompts: sections, shots and cuts, camera motion, dialogue, references, short-drama tips, and a full example.', annotations=read),
dict(name='freevideo_schema', title='Job JSON Schemas', description='JSON Schemas of every job kind and of image edit recipes.', annotations=read),
dict(name='freevideo_plan', title='Plan a job', description="Validate a job without running it: actual frames/seconds, sampling passes, warnings and a time estimate from this computer's history. Same fields as freevideo_generate.", annotations=read),
- dict(name='freevideo_generate', title='Generate a video', description='Generate one video from an H3 prompt, up to 60 seconds. Under 30 s defaults to one generation if the device supports this size and quality; unknown limits use 15 s. Otherwise parts continue and join automatically (30 s is 15 + 15). Prefer a new shot with its reference pictures wherever the film can cut; continue only a take, action or sound that must stay unbroken. Use this for any single video, also after freevideo_enhance_prompt; the drama tools are only for a film of several separately chosen shots. Optionally from first/last frames or references (files, local paths, or frames of earlier jobs). Returns the job; with wait, its result (video path and URL).', annotations=write),
+ dict(name='freevideo_generate', title='Generate a video', description='Generate one video from an H3 prompt, up to 60 seconds. Under 30 s defaults to one generation if the device supports this size and quality; unknown limits use 15 s. Otherwise the video is cut into as few parts as possible, each at least 10 s, and how many parts depends on how long this computer can generate in one run; the parts continue and join automatically. Prefer a new shot with its reference pictures wherever the film can cut; continue only a take, action or sound that must stay unbroken. Use this for any single video, also after freevideo_enhance_prompt; the drama tools are only for a film of several separately chosen shots. Optionally from first/last frames or references (files, local paths, or frames of earlier jobs). Returns the job; with wait, its result (video path and URL).', annotations=write),
dict(name='freevideo_submit_batch', title='Submit a storyboard', description='Submit several jobs at once. Each row is a job object with "kind" (generate default, assemble, vlm, enhance) and an optional "ref"; later rows use "@ref" wherever a job id is expected (from_job, after, clips, refine_from). FreeVideo runs them in dependency order.', annotations=write),
dict(name='freevideo_job', title='Job status', description='Status, progress, result or error of a job.', annotations=read),
dict(name='freevideo_wait', title='Wait for a job or the user', description="Wait at most 25 seconds for a job (with id) or, without id, at most 50 seconds for what the user says in FreeVideo (inbox). again=true means nothing new yet: call it again. A job wait returns early when the user says something. If the job is still active, call it again with the same ID; do not resubmit.", annotations=read),
diff --git a/freevideo_engine/agent/productions.py b/freevideo_engine/agent/productions.py
index 809b221..d23838c 100644
--- a/freevideo_engine/agent/productions.py
+++ b/freevideo_engine/agent/productions.py
@@ -22,7 +22,7 @@ import time
import uuid
from . import drama, production, schema, spec, errors, operation_receipts
-from .jobs import DONE, JobError, iso
+from .jobs import DONE, JobError, iso, parts_problems
from .forecast import generation_estimate
MAX_GENERATION = 4 # Generations are zero-based: original 0, reshoots 1 through 4.
@@ -306,6 +306,16 @@ class Productions:
problems.append(dict(row, path=new, field=prefix + row.get('field', old),
message=row['message'].replace(old, new, 1), next=row['next'].replace(old, new, 1)))
continue
+ if continued or shot['continues']:
+ # The same length rule as at submission, with this computer's single-run limit rather than the
+ # 15 s default: a shot that cannot be cut into parts of at least 10 s is refused here instead of
+ # starting a film in which that shot never gets a job. A shot not yet submitted carries no parent.
+ try:
+ pinned = spec.normalize(dict(item, continue_from=dict(from_job=placeholder)), port=self.jobs.port)
+ except spec.SpecError:
+ pinned = None # Its other problems are reported where they are found.
+ if pinned is not None:
+ problems.extend(parts_problems(pinned, None, prefix))
for dependency in normalized['depends_on']:
if not (continued and dependency == placeholder) and dependency not in self.jobs.jobs:
problems.append(schema.diagnostic(prefix + '/first', 'a job that exists on this server', dependency))
diff --git a/freevideo_engine/agent/routes.py b/freevideo_engine/agent/routes.py
index 96400e7..b981758 100644
--- a/freevideo_engine/agent/routes.py
+++ b/freevideo_engine/agent/routes.py
@@ -233,6 +233,8 @@ def plan(port, value, jobs=None):
if jobs is not None:
problems += parts_problems(spec, jobs.port.chain_runner(), work=jobs.continued_work(spec),
planned=jobs.planned_parts(spec))
+ else:
+ problems += parts_problems(spec, None)
if problems:
raise specs.SpecError(problems)
if jobs is not None:
diff --git a/freevideo_engine/chain_plan.py b/freevideo_engine/chain_plan.py
index d75a42a..d7cf593 100644
--- a/freevideo_engine/chain_plan.py
+++ b/freevideo_engine/chain_plan.py
@@ -11,6 +11,10 @@ from .geometry import geometry
FPS, UNIT, OVERLAP = 24, 17, 22
SINGLE_SECONDS, BLOCK_SECONDS, SHORTEST_BLOCK = 30, 15, 5
+# A part that continues another is at least this long (the first part is not held to it).
+MIN_PART_SECONDS = 10
+MIN_PART_FRAMES = geometry(seconds=MIN_PART_SECONDS)['frames']
+SHORTEST_FIRST = 2 # whole seconds: what the first part keeps when the continuing parts take the rest
MAX_SECONDS = 7200
MAX_BLOCKS = MAX_SECONDS // SHORTEST_BLOCK
@@ -72,36 +76,51 @@ def plan(seconds, single=False, max_frames=None, single_limit_seconds=None, bloc
fits = frames <= limit
alone = dict(seconds=seconds, frames=new, single=True, hide_frames=0,
blocks=[dict(seconds=seconds, frames=frames, new_frames=new)])
+ head = following if continued else first # the longest part this video can start with
# Under 30 s stays one generation unless a block length was asked for; 30 s is two blocks of 15 s.
- if fits and (single or block_seconds is None and seconds < SINGLE_SECONDS
- or seconds <= min(block, following if continued else first)):
+ if fits and (single or block_seconds is None and seconds < SINGLE_SECONDS or seconds <= min(block, head)):
return alone
- first, following = min(block, following if continued else first), min(block, following)
- if first < SHORTEST_BLOCK or following < SHORTEST_BLOCK:
+ if block < MIN_PART_SECONDS:
+ if fits and seconds < SINGLE_SECONDS:
+ return alone # a block this short cannot continue another: a short video stays one generation
+ raise PlanError('block_too_short', 'A block that continues another is at least %d s long' % MIN_PART_SECONDS)
+ first, following = min(block, head), min(block, following)
+ shortest = MIN_PART_SECONDS if continued else SHORTEST_BLOCK
+ if first < shortest or following < MIN_PART_SECONDS:
+ if fits and seconds < SINGLE_SECONDS:
+ return alone # a requested block length never makes a part this device cannot do
raise PlanError('device_limit', 'This device cannot generate this length at this size')
- total = seconds = math.floor(seconds + .5)
- lengths = [min(first, total)]
- while sum(lengths) < total:
- if len(lengths) >= MAX_BLOCKS:
- raise PlanError('too_long', 'This length needs too many blocks')
- lengths.append(min(following, total - sum(lengths)))
- if len(lengths) > 1 and lengths[-1] < SHORTEST_BLOCK:
- # No short tail: the last two blocks share their length, the earlier one gets the odd second.
- pair = lengths[-2] + lengths[-1]
- lengths[-2:] = [pair - pair // 2, pair // 2]
- if fits and block_seconds is not None and total < SINGLE_SECONDS and min(lengths) < SHORTEST_BLOCK:
- return alone # a requested block length never makes a part under 5 s
+ # Under 30 s the length stays as asked (it may be fractional); from 30 s it is whole seconds already.
+ total = seconds
+ # Every part that continues another is at least MIN_PART_SECONDS and at most `following`. The part that
+ # starts a new video is not held to it; a rest too short for the continuing parts is taken from that part.
+ rest = total if continued else total - min(first, total)
+ count = math.ceil(round(rest, 6) / following) if rest > 0 else 0
+ rest = max(rest, MIN_PART_SECONDS * count)
+ whole = math.ceil(round(rest, 6))
+ if continued and whole > math.ceil(round(total, 6)) or not continued and total - whole < SHORTEST_FIRST:
+ if fits and seconds < SINGLE_SECONDS:
+ return alone
+ raise PlanError('length_not_splittable', 'This length cannot be cut into parts of the requested length')
+ if count > MAX_BLOCKS:
+ raise PlanError('too_long', 'This length needs too many blocks')
+ lengths = [whole // count + (index < whole % count) for index in range(count)]
+ if continued:
+ lengths[0] = round(lengths[0] - (whole - total), 6) # a fractional request keeps its length in the first part
+ else:
+ lengths.insert(0, round(total - whole, 6))
+ frames_all = int(round(FPS * total))
blocks, shown = [], 0
for index, length in enumerate(lengths):
- target = FPS * sum(lengths[:index + 1])
+ target = int(round(FPS * sum(lengths[:index + 1])))
if index == 0 and not continued:
new = requested = _first_frames(length)
else:
# Each block takes the shortest step that reaches its whole second; nothing is cut in between.
new = max(1, math.ceil((target - shown) / UNIT)) * UNIT
requested = new + OVERLAP
- if requested > limit or index and length > following or not index and length > first:
+ if requested > limit or length > (first if not index else following):
raise PlanError('device_limit', 'This device cannot generate this length at this size')
shown += new
blocks.append(dict(seconds=length, frames=requested, new_frames=new))
- return dict(seconds=total, frames=FPS * total, single=False, hide_frames=shown - FPS * total, blocks=blocks)
+ return dict(seconds=total, frames=frames_all, single=False, hide_frames=shown - frames_all, blocks=blocks)
diff --git a/freevideo_engine/chain_runner.py b/freevideo_engine/chain_runner.py
index ffa5b35..469353c 100644
--- a/freevideo_engine/chain_runner.py
+++ b/freevideo_engine/chain_runner.py
@@ -8,7 +8,7 @@ import threading
import time
import uuid
-from . import chain_leads
+from . import chain_leads, chain_plan
from . import chain_store as store
@@ -26,6 +26,16 @@ class ChainTooLong(ValueError):
self.message_zh = '这条视频最多 %d 段,请缩短一些。' % limit
+class ChainPartTooShort(ValueError):
+ """A continuing part shorter than a continued video may have."""
+ code = 'chain_part_too_short'
+
+ def __init__(self, seconds, limit):
+ super().__init__('Each continued part must be at least %d seconds. Make it longer.' % limit)
+ self.seconds, self.limit = seconds, limit
+ self.message_zh = '接着生成的每一段至少 %d 秒,请加长一些。' % limit
+
+
def _work_key(path):
return PurePosixPath(str(path).replace('\\', '/')).as_posix()
@@ -58,9 +68,10 @@ def node_prompt(prompt, node):
class ChainRunner:
def __init__(self, store_dir, host, clock=time.monotonic, wall=time.time, estimate=None, poll=0.5, inputs=None,
- max_parts=None):
+ max_parts=None, min_part_frames=None):
self.store_dir, self.host = store_dir, host
self.max_parts = max_parts or store.MAX_PARTS
+ self.min_part_frames = chain_plan.MIN_PART_FRAMES if min_part_frames is None else min_part_frames
self.clock, self.wall, self.estimate, self.poll = clock, wall, estimate, poll
self.inputs = inputs or host.inputs
self.lock = threading.RLock()
@@ -175,6 +186,11 @@ class ChainRunner:
record = store.validate(payload)
with self.lock:
# Before anything is written or queued: a refused chain leaves every record and file as it was.
+ short = [row['inputs']['frames'] for row in record['blocks']
+ if (row['after'] is not None or row['before'] is not None)
+ and row['inputs']['frames'] < self.min_part_frames]
+ if short:
+ raise ChainPartTooShort(min(short) / chain_plan.FPS, chain_plan.MIN_PART_SECONDS)
parts = max(self._depths(record).values())
if parts > self.max_parts:
raise ChainTooLong(parts, self.max_parts)
diff --git a/freevideo_engine/comfy_chain.py b/freevideo_engine/comfy_chain.py
index ffd73b6..b28625d 100644
--- a/freevideo_engine/comfy_chain.py
+++ b/freevideo_engine/comfy_chain.py
@@ -7,7 +7,7 @@ from pathlib import Path, PurePosixPath
import ssl
from urllib import error, request
-from .chain_runner import ChainBusy, ChainRunner, ChainTooLong
+from .chain_runner import ChainBusy, ChainPartTooShort, ChainRunner, ChainTooLong
from . import chain_plan, chain_store
RUNNER = None
@@ -225,9 +225,10 @@ def register(host_factory=None):
host = host_factory(server) if fake else ComfyHost(server)
if fake:
logging.warning('[FreeVideo] Test background chain host is enabled')
- # Only the test host may lift the limit on parts, never the package.
+ # Only the test host may lift the limits on parts, never the package.
runner = ChainRunner(Path(root) / 'chains', host, estimate=None,
- max_parts=getattr(host, 'max_parts', None) if fake else None)
+ max_parts=getattr(host, 'max_parts', None) if fake else None,
+ min_part_frames=getattr(host, 'min_part_frames', None) if fake else None)
if fake:
host.runner = runner
RUNNER = runner
@@ -275,6 +276,9 @@ def register(host_factory=None):
except ChainTooLong as failure:
return response({'error': str(failure), 'error_zh': failure.message_zh, 'code': failure.code,
'parts': failure.parts, 'max_parts': failure.limit}, 400)
+ except ChainPartTooShort as failure:
+ return response({'error': str(failure), 'error_zh': failure.message_zh, 'code': failure.code,
+ 'min_seconds': failure.limit}, 400)
except chain_plan.PlanError as failure:
return response({'error': str(failure), 'code': failure.code}, 400)
except ValueError as failure: