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.

Launcher: a failed setup inspection names its action, exit code and output line count on the...

Bowen Xueefe127dea322
diff --git a/freevideo_engine/comfy_setup.py b/freevideo_engine/comfy_setup.py
index e71834c..edfaa55 100644
--- a/freevideo_engine/comfy_setup.py
+++ b/freevideo_engine/comfy_setup.py
@@ -69,6 +69,26 @@ CALIBRATION_PROMPT = ('A neon-lit alley after heavy rain. The camera drifts forw
'on wet stone.')
+def inspection_failed(value):
+ """The first line of a failed inspection: what ran, how it ended and how much the child printed.
+
+ Only integers, fixed words and an exception class name, so a report keeps it whole however the rest is cut."""
+ code, failed = value.get('returncode'), value.get('failed_with')
+ parts = [value.get('action') if value.get('action') in ('plan', 'setup') else 'other']
+ if isinstance(code, int):
+ # Windows reports a crash as a large unsigned code; its hex form is the one people search for
+ parts.append('exit %d' % code + (' (0x%08X)' % code if 0xFFFF < code <= 0xFFFFFFFF else ''))
+ else:
+ parts.append('no exit code')
+ parts.append('%d output lines' % int(value.get('lines') or 0))
+ # A cancelled run never gets here: only a complete or failed plan is read, so cancelling is not a failure to report.
+ if failed in ('TimeoutExpired', 'TimeoutError'):
+ parts.append('timed out')
+ if isinstance(failed, str) and failed.isidentifier() and len(failed) <= 60:
+ parts.append(failed)
+ return 'Setup inspection failed (%s)' % ', '.join(parts)
+
+
class SetupRunner(Runner):
token = ''
@@ -433,7 +453,7 @@ class Setup:
self.plan = preflight_json(value['output'])
self.state.update(plan=self.plan, plan_id=uuid.uuid4().hex)
except ValueError:
- self.state.update(status='failed', error='Setup inspection failed\n' +
+ self.state.update(status='failed', error=inspection_failed(value) + '\n' +
(self.state.get('error') or value.get('output', '')))
elif value['action'] == 'setup' and value['status'] == 'complete':
try:
diff --git a/freevideo_engine/desktop_runtime.py b/freevideo_engine/desktop_runtime.py
index 32e6ba0..b5de434 100644
--- a/freevideo_engine/desktop_runtime.py
+++ b/freevideo_engine/desktop_runtime.py
@@ -308,6 +308,8 @@ class Runner:
def _run_awake(self, action, root, arguments):
run = io_path(self.logs) / (time.strftime('%Y%m%dT%H%M%SZ', time.gmtime()) + '-' + uuid.uuid4().hex[:8])
code, output, error = None, '', None
+ # what a report can say when the child left no text: how much it printed, and what stopped the run
+ lines, failed_with = 0, None
started = time.monotonic()
try:
run.mkdir(parents=True)
@@ -360,6 +362,7 @@ class Runner:
if self.cancelled.is_set():
processes.stop(process)
for line in process.stdout:
+ lines += 1
line = launch_view.line_back(plain_text(line), view)
log.write(line)
output = (output + line)[-2 * 1024 * 1024:]
@@ -373,6 +376,7 @@ class Runner:
code = process.wait(timeout=15)
process.stdout.close()
except BaseException as failure:
+ failed_with = type(failure).__name__
error = plain_text(repr(failure))
detail = plain_text('\n' + traceback.format_exc())
output += detail
@@ -386,7 +390,8 @@ class Runner:
processes.stop(self.process)
finally:
result = dict(action=action, status='cancelled' if self.cancelled.is_set() else 'complete' if code == 0 else 'failed',
- returncode=code, error=error, wall_seconds=time.monotonic()-started, root=str(root), log=plain(run))
+ returncode=code, error=error, wall_seconds=time.monotonic()-started, root=str(root), log=plain(run),
+ lines=lines, failed_with=failed_with)
try:
save(run / 'status.json', result)
except OSError as failure: