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.

Point to a nearby ComfyUI folder when the chosen folder is not one

Bowen Xued559fea4a17b
diff --git a/freevideo_engine/comfy_launcher_runtime.py b/freevideo_engine/comfy_launcher_runtime.py
index ecaed53..5a9dbed 100644
--- a/freevideo_engine/comfy_launcher_runtime.py
+++ b/freevideo_engine/comfy_launcher_runtime.py
@@ -158,12 +158,35 @@ def disk_review(plan, engine, comfy, *, separate, new_comfy):
return extra, list(disks.values()), errors(disks.values())
+def _is_comfy_root(path):
+ return (path / 'main.py').is_file() and (path / 'folder_paths.py').is_file()
+
+
+def nearby_comfy(selected):
+ """Name of a ComfyUI folder just above or one level below the chosen one, else ''.
+
+ Only a name is returned: the launcher hides absolute paths in its messages.
+ """
+ try:
+ for parent in (selected, *list(selected.parents)[:3]):
+ if _is_comfy_root(parent):
+ return parent.name
+ for child in sorted(p for p in selected.iterdir() if p.is_dir())[:200]:
+ if _is_comfy_root(child) or _is_comfy_root(child / 'ComfyUI'):
+ return child.name
+ except OSError:
+ pass
+ return ''
+
+
def layout(path):
try:
selected = resolved(Path(path).expanduser())
root = selected / 'ComfyUI' if (selected / 'ComfyUI' / 'main.py').is_file() else selected
- if not (root / 'main.py').is_file() or not (root / 'folder_paths.py').is_file():
- raise ValueError('Select the ComfyUI folder, or the portable folder containing ComfyUI.')
+ if not _is_comfy_root(root):
+ found = nearby_comfy(selected)
+ raise ValueError('Select the ComfyUI folder, or the portable folder containing ComfyUI.'
+ + (f' Found one at "{found}"; select that folder.' if found else ''))
if not (root / 'comfy_api' / 'latest').is_dir():
raise ValueError('This ComfyUI is too old for native VIDEO / V3 nodes. Update ComfyUI first; its files have not been changed.')
candidates = []
diff --git a/freevideo_engine/failure_details.py b/freevideo_engine/failure_details.py
index f2dc172..db3dc81 100644
--- a/freevideo_engine/failure_details.py
+++ b/freevideo_engine/failure_details.py
@@ -394,6 +394,16 @@ def launcher_failure(value, *, zh=False, other_disk=False, disk_name='', can_rep
return dict(title='这块硬盘没有连接' if zh else 'The disk is not connected', kind='disk-missing', detail='',
action=('请接上“%s”后点击“重新检查”' % disk_name + (',或者改装到其他硬盘。' if other_disk else '。') if zh else
'Connect "%s" and click Check again' % disk_name + (', or install on another disk.' if other_disk else '.')))
+ folder = re.search(r'Select the ComfyUI folder, or the portable folder containing ComfyUI\.'
+ r'(?: Found one at "([^"\r\n]+)"; select that folder\.)?', summary)
+ if folder:
+ found = folder.group(1)
+ detail = ('在 “%s” 找到了 ComfyUI,请改选这个文件夹。' if zh else
+ 'ComfyUI was found at “%s”. Select that folder instead.') % found if found else ''
+ return dict(title='这不是 ComfyUI 文件夹' if zh else 'This isn’t a ComfyUI folder', detail=detail,
+ action=('请选择包含 main.py 的 ComfyUI 文件夹,或包含它的便携包文件夹。' if zh else
+ 'Select the ComfyUI folder (it contains main.py), or the portable folder that contains it.'),
+ kind='comfy-folder')
for pattern, kind, title, action in PLACE_RULES:
if re.search(pattern, summary):
return dict(title=title[zh], detail='', action=action[zh], kind=kind)