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.

The command line generates correctly from a deep install root

Bowen Xuec992a188ef32
diff --git a/freevideo_engine/cli.py b/freevideo_engine/cli.py
index 399a450..2767d47 100644
--- a/freevideo_engine/cli.py
+++ b/freevideo_engine/cli.py
@@ -30,6 +30,13 @@ def main():
if len(sys.argv) > 1 and sys.argv[1] in ('projects', 'sessions'):
from .agent.cli import main as agent
return agent(sys.argv[1:])
+ if not getattr(sys, 'frozen', False) and not {'-h', '--help'} & set(sys.argv[1:]):
+ from .launch_view import restart_arguments
+ restart = restart_arguments(sys.argv[1:])
+ if restart is not None:
+ # Deep installation folder: Windows cannot load the libraries by their full path.
+ from . import processes
+ raise SystemExit(processes.run(restart[0], env=restart[1], start_new_session=False).returncode)
if len(sys.argv) > 1 and sys.argv[1] == 'predict':
from .prediction_cli import main as predict
raise SystemExit(predict(sys.argv[2:]))
diff --git a/freevideo_engine/launch_view.py b/freevideo_engine/launch_view.py
index e97ef24..c679583 100644
--- a/freevideo_engine/launch_view.py
+++ b/freevideo_engine/launch_view.py
@@ -11,6 +11,7 @@ import json
import os
from pathlib import Path
import re
+import sys
from .long_paths import io_path, plain
@@ -93,6 +94,30 @@ def for_engine(engine_root) -> View:
return View(engine, engine)
+def restart_arguments(arguments, prefix=None, environ=None):
+ """The command line and environment that run this command again from the engine's short folder.
+
+ None where the process is not an engine's own Python on Windows, already runs from a
+ short folder, or its folder needs none. A command-line run reaches the libraries
+ (torch\\lib\\c10.dll) by the interpreter's own path, so only a restart can shorten it.
+ """
+ from . import runtime_alias
+ environ = os.environ if environ is None else environ
+ if not runtime_alias._backend.windows() or current(environ) is not None:
+ return None
+ prefix = Path(plain(sys.prefix if prefix is None else prefix))
+ if prefix.parent.name.casefold() != 'envs':
+ return None
+ try:
+ view = for_engine(prefix.parent.parent)
+ except OSError:
+ return None
+ if not view.used:
+ return None
+ command, child, _ = execution([sys.executable, '-m', 'freevideo_engine', *arguments], environ, None, view)
+ return command, child
+
+
def for_file(path):
"""The view of the offline runtime that holds this file, or None.