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.

Setup or Repair stopped by a running job waits for it and continues by itself

Bowen Xuec0c5a8878e8b
diff --git a/freevideo_engine/comfy_launcher_runtime.py b/freevideo_engine/comfy_launcher_runtime.py
index dd44469..b8118d5 100644
--- a/freevideo_engine/comfy_launcher_runtime.py
+++ b/freevideo_engine/comfy_launcher_runtime.py
@@ -502,6 +502,8 @@ def launcher_comfy(selected, info):
ENGINE_UPDATE_WAITS = 'ComfyUI is running a job, so the engine update waits'
+# Setup or Repair never starts beside a job; the launcher continues it when the queue is empty.
+SETUP_WAITS_FOR_JOB = 'ComfyUI is running a job. Try again after it finishes; the job is left running.'
def _refused(error):
@@ -1229,7 +1231,7 @@ class Controller:
worker. Stop our own idle server; connecting after setup starts it
again. A running job is never stopped, in a server another program started either."""
if queue_busy(loopback_url(self.server_address or url)):
- raise RuntimeError('ComfyUI is running a job. Try again after it finishes; the job is left running.')
+ raise RuntimeError(SETUP_WAITS_FOR_JOB)
if self.owns_server():
self.stop_owned_server()
diff --git a/freevideo_engine/failure_details.py b/freevideo_engine/failure_details.py
index 0e41438..b435913 100644
--- a/freevideo_engine/failure_details.py
+++ b/freevideo_engine/failure_details.py
@@ -652,6 +652,12 @@ def _launcher_failure(value, *, zh=False, other_disk=False, disk_name='', can_re
('A video is still generating', '还有视频正在生成'),
('Click Update now again when this video has finished. The video being generated is not interrupted.',
'这个视频生成完成后,再点击“立即更新”。正在生成的视频不会被打断。')),
+ # Setup or Repair never starts beside a job (a server another program started either), and Repair
+ # runs into the same check, so the card offers Retry installation only.
+ (r'ComfyUI is running a job\. Try again after it finishes', 'setup-busy',
+ ('A video is still generating', '还有视频正在生成'),
+ ('Setup stopped so that the video being generated is not interrupted. When it has finished, click "Retry installation" and confirm the installation again. Completed steps are kept.',
+ '安装已停止,以免打断正在生成的视频。视频生成完成后,请点击“重试安装”,并再次确认安装。已完成的步骤会保留。')),
# Moving the engine's editable install to the new source failed and was undone (engine_binding).
(r'Editable install failed for|Editable verification failed for|The engine.s uv is missing', 'update-unfinished',
('The update did not finish', '这次更新没有完成'),
diff --git a/freevideo_engine/launcher/FButton.qml b/freevideo_engine/launcher/FButton.qml
index e5217e2..b7c8145 100644
--- a/freevideo_engine/launcher/FButton.qml
+++ b/freevideo_engine/launcher/FButton.qml
@@ -7,6 +7,8 @@ Button {
property bool selected: false
property bool danger: false
property bool singleLine: false
+ // A disabled button that is the only statement of what is happening: full strength, not a call to act.
+ property bool waiting: false
// A text link: accent text, no frame.
property bool link: false
implicitHeight: Math.max(theme.height, contentItem.implicitHeight + 14)
@@ -15,10 +17,10 @@ Button {
topPadding: 7; bottomPadding: 7
font.pixelSize: theme.body; font.weight: primary ? Font.DemiBold : Font.Medium
hoverEnabled: true
- opacity: enabled ? 1 : 0.42
+ opacity: enabled || waiting ? 1 : 0.42
contentItem: Text {
text: control.text; font: control.font
- color: control.primary ? theme.bg : control.danger ? theme.danger : control.selected ? theme.accent
+ color: control.waiting ? theme.text : control.primary ? theme.bg : control.danger ? theme.danger : control.selected ? theme.accent
: control.link ? (control.hovered ? theme.accentHover : theme.accent)
: control.flat && !control.hovered ? theme.muted : theme.text
horizontalAlignment: Text.AlignHCenter; verticalAlignment: Text.AlignVCenter
@@ -28,10 +30,10 @@ Button {
}
background: Rectangle {
radius: theme.radiusSm
- color: control.primary ? (control.down ? theme.accentDim : control.hovered ? theme.accentHover : theme.accent) :
+ color: control.waiting ? theme.raised : control.primary ? (control.down ? theme.accentDim : control.hovered ? theme.accentHover : theme.accent) :
control.selected ? theme.accentSubtle : control.down ? theme.sheen : control.hovered ? theme.hover :
control.flat ? "transparent" : theme.raised
- border.width: control.activeFocus && control.visualFocus ? 2 : control.primary || control.flat ? 0 : 1
+ border.width: control.activeFocus && control.visualFocus ? 2 : (control.primary && !control.waiting) || control.flat ? 0 : 1
border.color: control.activeFocus && control.visualFocus ? theme.accentHover : control.selected ? theme.accentDim : theme.border
Behavior on color { ColorAnimation { duration: 110 } }
}
diff --git a/freevideo_engine/launcher/Main.qml b/freevideo_engine/launcher/Main.qml
index 06beb9d..154194b 100644
--- a/freevideo_engine/launcher/Main.qml
+++ b/freevideo_engine/launcher/Main.qml
@@ -32,6 +32,7 @@ ApplicationWindow {
property bool releaseNotesOpen: false
property bool licensesOpen: false
property string previousStatus: ""
+ property bool previousJobWait: false
property string previousReview: ""
property bool compact: width < 1000
property bool narrow: width < 640
@@ -137,6 +138,8 @@ ApplicationWindow {
// The label before diskLine() when the line states the disk rather than a problem.
function diskLabel() { return disk && !disk.problem && !disk.short ? t("Disk:", "所在硬盘:") : "" }
// On a Mac, a disk problem is fixed by choosing another disk, not by reporting a fault.
+ // Not a fault: a video is still generating, and the one way on is Retry installation.
+ readonly property bool notAFault: s.failure.kind === "setup-busy" || s.failure.kind === "update-busy"
readonly property bool diskFailure: !!disk && (s.failure.kind || "").indexOf("disk") === 0
readonly property bool updateOffered: s.update.engine || (!!s.update.candidate && ["available", "downloading", "ready", "error", "cancelled"].indexOf(s.update.status) >= 0)
// An engine update needs no download; offer it as the way to launch.
@@ -231,6 +234,8 @@ ApplicationWindow {
if (s.update.candidate) return t("Current version ", "当前版本 ") + releaseVersion(currentRelease) + t(". Updating keeps your models and settings and takes about a minute.", "。更新会保留模型和设置,约需 1 分钟。")
return t("Installed engine ", "已安装引擎 ") + engineVersion + t(". Updating takes about a minute and keeps your models and settings.", "。更新约需 1 分钟,模型和设置都会保留。")
}
+ // A narrow window may wrap the waiting sentence; "自动继续" is not split in the middle.
+ function keepTogether(text) { return String(text).replace("自动继续", "自\u2060动\u2060继\u2060续") }
function primaryText() {
if (s.retry_kind) return retryText()
if (needsRuntime) return t("Choose environment package", "选择运行环境包")
@@ -254,7 +259,10 @@ ApplicationWindow {
if (previousPage) pageEnter.restart()
}
previousPage = s.page
- if (s.status !== previousStatus || s.review_id !== previousReview) accepted = false
+ // A setup that waits for a video keeps the user's consent; leaving the wait asks again.
+ if (s.status !== previousStatus || s.review_id !== previousReview) accepted = !!s.setup_job_wait
+ else if (previousJobWait && !s.setup_job_wait) accepted = false
+ previousJobWait = !!s.setup_job_wait
previousStatus = s.status; previousReview = s.review_id
if (s.error !== previousError) {
errorDetailsOpen = false
@@ -457,7 +465,7 @@ ApplicationWindow {
FText { objectName: "repairUpdatesEngine"; visible: !!s.update.with_repair; Layout.fillWidth: true; color: theme.text
text: t("Repair also updates the engine to " + releaseVersion(currentRelease) + ".", "修复时会一并更新到新版引擎 " + releaseVersion(currentRelease) + "。") }
Flow {
- Layout.fillWidth: true; spacing: 8
+ visible: !notAFault; Layout.fillWidth: true; spacing: 8
FButton { objectName: "moveToDisk"; visible: diskFailure && s.form.new_comfy && !!bestDisk; enabled: !s.busy; primary: true
text: bestDisk ? t("Install on \"" + bestDisk.name + "\"", "改装到“" + bestDisk.name + "”") : ""
onClicked: backend.useDisk(bestDisk.path) }
@@ -469,13 +477,13 @@ ApplicationWindow {
FButton { objectName: "repairCardButton"; primary: true; visible: !!s.repair_offered; text: t("Repair", "修复"); onClicked: backend.action("repair", false) }
FButton { objectName: "latestLauncherLink"; visible: s.failure.kind === "older-launcher"; flat: true
text: t("Download the latest ↗", "下载最新版 ↗"); onClicked: backend.link("https://github.com/FlashML-org/FreeVideo/releases/latest") }
- FButton { objectName: "copyError"; visible: !diskFailure; text: t("Copy details", "复制详情"); onClicked: backend.copy(s.error) }
- FButton { objectName: "showError"; text: errorDetailsOpen ? t("Hide details", "收起详情") : t("Show details", "查看详情"); flat: true; onClicked: errorDetailsOpen = !errorDetailsOpen }
- FButton { objectName: "reportProblem"; visible: !diskFailure && s.failure.kind !== "port-taken"; text: t("Report a problem", "提交问题"); onClicked: backend.reportProblem(s.error, s.failure.title || "") }
- FButton { objectName: "exportError"; visible: !diskFailure; text: t("Export report", "导出报告"); enabled: s.report.status !== "running"; onClicked: backend.exportReport() }
+ FButton { objectName: "copyError"; visible: !diskFailure && !notAFault; text: t("Copy details", "复制详情"); onClicked: backend.copy(s.error) }
+ FButton { objectName: "showError"; visible: !notAFault; text: errorDetailsOpen ? t("Hide details", "收起详情") : t("Show details", "查看详情"); flat: true; onClicked: errorDetailsOpen = !errorDetailsOpen }
+ FButton { objectName: "reportProblem"; visible: !diskFailure && !notAFault && s.failure.kind !== "port-taken"; text: t("Report a problem", "提交问题"); onClicked: backend.reportProblem(s.error, s.failure.title || "") }
+ FButton { objectName: "exportError"; visible: !diskFailure && !notAFault; text: t("Export report", "导出报告"); enabled: s.report.status !== "running"; onClicked: backend.exportReport() }
}
ScrollView {
- visible: errorDetailsOpen; Layout.fillWidth: true; Layout.preferredHeight: Math.min(160, errorText.implicitHeight+10); clip: true
+ visible: errorDetailsOpen && !notAFault; Layout.fillWidth: true; Layout.preferredHeight: Math.min(160, errorText.implicitHeight+10); clip: true
TextArea { id: errorText; objectName: "failureDetails"; text: s.error; readOnly: true; selectByMouse: true; wrapMode: Text.Wrap; color: theme.muted; font.family: theme.mono; font.pixelSize: theme.micro; background: null; textFormat: TextEdit.PlainText }
}
}
@@ -791,7 +799,7 @@ ApplicationWindow {
}
}
}
- FCheck { objectName: "installConsent"; text: s.consent; checked: accepted; onToggled: accepted = checked; Layout.fillWidth: true }
+ FCheck { objectName: "installConsent"; text: s.consent; checked: accepted; enabled: !s.setup_job_wait; onToggled: accepted = checked; Layout.fillWidth: true }
FButton { objectName: "planLicensesButton"; text: t("View licenses", "查看许可证"); flat: true; implicitHeight: theme.heightSm - 2; leftPadding: 32; font.pixelSize: theme.micro + 1; onClicked: licensesOpen = true }
}
}
@@ -957,7 +965,7 @@ ApplicationWindow {
FText { objectName: "oldVersions"; visible: !!s.old_versions; text: "✓ " + s.old_versions; color: theme.success; font.pixelSize: theme.micro; Layout.fillWidth: true }
FText { objectName: "copiedModels"; visible: !!s.copied_models; text: s.copied_models || ""; color: theme.muted; font.pixelSize: theme.micro; wrapMode: Text.WordWrap; Layout.fillWidth: true }
FText { objectName: "archivesDone"; visible: !!s.archives_toast; text: s.archives_toast || ""; color: theme.success; font.pixelSize: theme.micro; Layout.fillWidth: true }
- FCheck { visible: s.needs_consent; text: s.consent; checked: accepted; onToggled: accepted = checked; Layout.fillWidth: true }
+ FCheck { visible: s.needs_consent; text: s.consent; checked: accepted; enabled: !s.setup_job_wait; onToggled: accepted = checked; Layout.fillWidth: true }
FButton { objectName: "bundleLicensesButton"; visible: s.needs_consent; text: t("View licenses", "查看许可证"); flat: true; implicitHeight: theme.heightSm - 2; leftPadding: 32; font.pixelSize: theme.micro + 1; onClicked: licensesOpen = true }
}
FCard {
@@ -1020,7 +1028,7 @@ ApplicationWindow {
}
Rectangle {
id: footer; objectName: "footer"
- height: win.narrow ? (narrowActions.twoRows ? 112 : 64) : shortWindow ? 64 : 76
+ height: win.narrow ? (narrowActions.twoRows ? 112 : s.setup_job_wait ? 84 : 64) : shortWindow ? 64 : 76
anchors.bottom: parent.bottom; width: parent.width; color: theme.canvas
Rectangle { height: 1; width: parent.width; color: theme.border }
RowLayout {
@@ -1031,7 +1039,7 @@ ApplicationWindow {
FButton { visible: s.busy && !s.cleanup.busy; text: t("Pause", "暂停"); onClicked: backend.action("stop", false) }
FButton { objectName: win.narrow ? "" : "launchInstalledButton"; visible: updateFirst && s.retry_kind !== "launch"; flat: true; text: t("Launch current version", "启动当前版本"); onClicked: backend.action("primary", accepted) }
FButton {
- objectName: win.narrow ? "" : "primaryButton"; primary: !s.repair_offered && !(s.retry_kind === "launch" && engineUpdate.visible) && !manualFailure; implicitWidth: Math.max(160, contentItem.implicitWidth+40); implicitHeight: theme.heightLg
+ objectName: win.narrow ? "" : "primaryButton"; primary: !s.repair_offered && !(s.retry_kind === "launch" && engineUpdate.visible) && !manualFailure; implicitWidth: Math.max(160, contentItem.implicitWidth+40); implicitHeight: theme.heightLg; waiting: !!s.setup_job_wait
text: s.setup_pending ? s.setup_wait_text : s.busy ? t("Working…", "正在处理…") : primaryText()
enabled: !s.busy && !s.setup_pending && !(s.page === "launcher" && s.needs_consent && !accepted)
&& !(s.page === "progress" && s.status === "review" && !s.retry_kind && (!accepted || !!s.error))
@@ -1070,12 +1078,12 @@ ApplicationWindow {
anchors.right: parent.right; y: narrowActions.twoRows ? parent.height - height - 10 : (parent.height - height) / 2
primary: !s.repair_offered && !(s.retry_kind === "launch" && engineUpdate.visible) && !manualFailure
leftPadding: 12; rightPadding: 12
- singleLine: true
- implicitWidth: Math.max(120, contentItem.implicitWidth + leftPadding + rightPadding); implicitHeight: theme.heightLg
+ singleLine: !s.setup_job_wait; waiting: !!s.setup_job_wait
+ implicitWidth: Math.max(120, contentItem.implicitWidth + leftPadding + rightPadding); implicitHeight: s.setup_job_wait ? Math.max(theme.heightLg, contentItem.implicitHeight + 18) : theme.heightLg
width: Math.min(implicitWidth, Math.max(0, narrowActions.width - (narrowActions.twoRows ? 0 :
(backButton.visible ? backButton.width + 8 : 0) + (pauseButton.visible ? pauseButton.width + 8 : 0) +
(launchInstalled.visible ? launchInstalled.width + 8 : 0))))
- text: s.setup_pending ? s.setup_wait_text : s.busy ? t("Working…", "正在处理…") : primaryText()
+ text: s.setup_pending ? keepTogether(s.setup_wait_text) : s.busy ? t("Working…", "正在处理…") : primaryText()
enabled: !s.busy && !s.setup_pending && !(s.page === "launcher" && s.needs_consent && !accepted)
&& !(s.page === "progress" && s.status === "review" && !s.retry_kind && (!accepted || !!s.error))
onClicked: { if (s.retry_kind) { backend.action("retry", accepted); return } if (needsRuntime) { backend.browseRuntimePackage(); return } if (needsPackages) { backend.browsePackages(); return } if (updateFirst) { backend.update(""); return } backend.action(s.page === "launcher" && s.status === "open" ? "browser" : "primary", accepted) }
diff --git a/freevideo_engine/launcher_copy.py b/freevideo_engine/launcher_copy.py
index 940e711..9cc9d1f 100644
--- a/freevideo_engine/launcher_copy.py
+++ b/freevideo_engine/launcher_copy.py
@@ -25,6 +25,8 @@ ACTION_COPY = {
'已记下,处理完当前任务后自动导入'),
'setup_queued': ('Models are being prepared in the background. Setup will continue when they are ready.',
'后台正在准备模型,好了会接着继续'),
+ 'setup_job': ('A video is still generating. Setup will continue when it has finished.',
+ '还有视频正在生成,完成后将自动继续'),
'update_queued': ('The update will start after the current task finishes.',
'当前任务完成后会自动更新'),
}
diff --git a/freevideo_engine/launcher_session.py b/freevideo_engine/launcher_session.py
index 7eca332..66b2559 100644
--- a/freevideo_engine/launcher_session.py
+++ b/freevideo_engine/launcher_session.py
@@ -14,8 +14,8 @@ from urllib.parse import parse_qsl, urlencode, urlsplit, urlunsplit
from . import __version__
from . import disk_space
-from .comfy_launcher_runtime import (ENGINE_UPDATE_WAITS, Controller, layout, local_url, loopback_url, managed_frontend,
- new_layout, queue_busy)
+from .comfy_launcher_runtime import (ENGINE_UPDATE_WAITS, SETUP_WAITS_FOR_JOB, Controller, layout, local_url, loopback_url,
+ managed_frontend, new_layout, queue_busy)
from .desktop_runtime import launcher_root, materialize_source
from .download_settings import Probe, read as download_preferences, speed_text
from .launcher_settings import Store, default_language
@@ -94,6 +94,8 @@ class Session:
update_waiting = update_restarting = False
engine_updating = engine_autoinstall = reload_expected = resume_pages = False
browser_wait = queue_state = queue_thread = bridge = None
+ # Setup that stopped for a running job and continues by itself once the queue is empty.
+ setup_job_wait, setup_job_tries = False, 0
foreign_state = foreign_thread = None
clients_polled = queue_polled = foreign_polled = receipt_polled = resume_until = resume_polled = bridge_polled = 0.
bridge_pending = False
@@ -550,6 +552,11 @@ class Session:
self.pending_action = None
if self.action_notice == 'setup_queued':
self.action_notice = ''
+ self.setup_job_wait = False
+ if name != 'stop':
+ self.setup_job_tries = 0
+ if name in ('back', 'setup', 'launcher'):
+ self.setup_job_wait = False
setup_action = (name == 'primary' and self.page != 'launcher'
or name == 'retry' and self.retry_kind() != 'launch')
if setup_action and self.task_busy():
@@ -1793,6 +1800,12 @@ class Session:
if saved['lan_access'] != (self.form.get('lan_access') is True):
self.edit('lan_access', saved['lan_access'])
+ def setup_replayable(self):
+ """Whether the accepted plan can still be installed as it is. The engine's own install consumes
+ the plan, so a job met after it (the ComfyUI environment step of a first installation) leaves
+ Retry installation, which inspects again."""
+ return bool((self.controller.selection or {}).get('ready')) or getattr(self.controller, 'section', None) == 'engine'
+
def tick(self):
if isinstance(self.controller, Controller) and not self.controller.busy:
self.controller.poll_access_proxy()
@@ -1850,6 +1863,21 @@ class Session:
# Nothing new to download or approve: deploy, then restart ComfyUI.
self.controller.run('install', True)
row, busy = self.controller.state, self.controller.busy
+ if (not busy and row.get('status') == 'failed' and row.get('action') == 'install'
+ and str(row.get('error') or '').startswith(SETUP_WAITS_FOR_JOB) and self.setup_job_tries < 3
+ and self.setup_replayable()):
+ # A video is generating, so setup stopped before it changed anything. Keep the plan the user
+ # accepted and install it when the queue is empty, instead of a failure card.
+ self.setup_job_tries += 1
+ self.setup_job_wait = True
+ self.queue_state = None
+ self.controller.state = row = dict(row, status='review', action='inspect', error=None, exception=None)
+ if self.setup_job_wait and row.get('status') != 'review':
+ self.setup_job_wait = False
+ if self.setup_job_wait and not self.task_busy() and self._queue_busy(any_server=True) is False:
+ self.setup_job_wait = False
+ self.controller.run('install', True)
+ row, busy = self.controller.state, self.controller.busy
if (self.engine_updating and not busy and row.get('status') == 'failed'
and str(row.get('error') or '').startswith(ENGINE_UPDATE_WAITS)):
# A video started after the check: keep waiting for it instead of showing a failure.
@@ -2404,7 +2432,8 @@ class Session:
disk=disk, decimal_sizes=sys.platform == 'darwin', zh=self.language.startswith('zh'), form=dict(self.form),
page=self.page, status=row.get('status', 'idle'), busy=busy, working=working,
action_notice=self.t(*ACTION_COPY[self.action_notice]) if self.action_notice else '',
- setup_pending=bool(self.pending_action), setup_wait_text=self.t(*ACTION_COPY['setup_queued']),
+ setup_pending=bool(self.pending_action) or self.setup_job_wait, setup_job_wait=self.setup_job_wait,
+ setup_wait_text=self.t(*ACTION_COPY['setup_job' if self.setup_job_wait else 'setup_queued']),
can_manage=self.can_manage(), busy_reason=self.t(*ACTION_COPY['busy']),
cleanup=cleanup,
can_cleanup=self.can_manage() and not (self.updater and self.updater.busy),