Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
f1a142c
Settings: the view keys in the top bar sit where they do on the other…
KBRASK Nov 25, 2026
2b33c33
With glass off or the low-end look, the top bar pills and status caps…
KBRASK Nov 25, 2026
ef1008c
An open tray or pop-up no longer shows the status line beneath it thr…
KBRASK Nov 25, 2026
a62f723
Failure reasons: an engine stop is called likely out of memory only w…
KBRASK Nov 25, 2026
59e9ea2
Windows on Arm: setup no longer stops at package resolution, and an u…
KBRASK Nov 25, 2026
e199c5c
Redaction: local files written as file URLs lose the user name in rep…
KBRASK Nov 25, 2026
9d52c22
Player bar: the browser's own audio controls are hidden without :has,…
KBRASK Nov 25, 2026
b971f1e
Public export: internal folder paths are gone from tiers.py, and the …
KBRASK Nov 25, 2026
6e5686b
Video length planning: a plan that comes out too short is reported as…
KBRASK Nov 25, 2026
8304c65
Redaction: problem reports and download failure records lose email ad…
KBRASK Nov 25, 2026
ae9d948
Studio: one three-column layout, the same as the image view, with the…
KBRASK Nov 25, 2026
40164d6
Interface languages: one rule picks the language file, the page loads…
KBRASK Nov 25, 2026
a845b3a
Interface languages: Settings lists the languages ready to offer and …
KBRASK Nov 25, 2026
7b8c9d9
Interface languages: a glossary of interface terms with its checks, a…
KBRASK Nov 25, 2026
54f4ef5
Interface languages: the launcher speaks the chosen language, engine …
KBRASK Nov 25, 2026
e876908
Interface languages: page sentences take {name} placeholders instead …
KBRASK Nov 25, 2026
5881501
Interface languages: read-back words, one set of interface terms, the…
KBRASK Nov 25, 2026
65951ee
Interface languages: launcher failure cards, plural forms for every l…
KBRASK Nov 25, 2026
bbcc9cf
Interface languages: image failure cards in both languages, and Tradi…
KBRASK Nov 25, 2026
48ea64c
Studio and editor: a chip row short of room folds its chips step by s…
KBRASK Nov 25, 2026
21f4ec0
Interface languages: a check quotes the right control, and the prompt…
KBRASK Nov 25, 2026
d8bc265
Third-party notices: OpenCC, which converts the Traditional Chinese i…
KBRASK Nov 25, 2026
6d494d4
Interface languages: tutorial picture descriptions, per-language keyw…
KBRASK Nov 25, 2026
0a0f34d
Interface languages on the three-column Studio: the media tray's line…
KBRASK Nov 25, 2026
9435a35
Studio: the Steps group in Advanced options marks Custom, shows its n…
KBRASK Nov 25, 2026
5d65cd1
Editor: the Media, LoRA and Advanced windows of the borrowed bar open…
KBRASK Nov 25, 2026
d0ccec8
Fast level: the file list for the 2-step no-decoder adapter
KBRASK Nov 25, 2026
a52740e
Fast level engine: 2-step pi-H3 sampling with the no-decoder pixel he…
KBRASK Nov 25, 2026
3a0fd40
Fast level: the level in the create panel and the editor, with its pl…
KBRASK Nov 25, 2026
b2882a0
Top bar: in Traditional Chinese the top bar takes the page's own font…
KBRASK Nov 25, 2026
bb5b7ed
Studio: with glass off or the low-end look, opening Advanced options …
KBRASK Nov 25, 2026
def395a
Editor bar: on a phone the reverse-prompt key stands in the options r…
KBRASK Nov 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions THIRD_PARTY_NOTICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ FreeVideo code uses [Apache-2.0](LICENSE). Its dependencies and models retain th
| [ComfyUI](https://github.com/Comfy-Org/ComfyUI), including the H3 text encoder code | GPL-3.0 |
| [VDN-H3](https://github.com/OpenVDN/vdn-minimax-h3), [Diffusers](https://github.com/huggingface/diffusers), [SageAttention](https://github.com/thu-ml/SageAttention) | Apache-2.0 |
| [VDN-H3 and H3 model weights](https://huggingface.co/OpenVDN/vdn-minimax-h3-edge/blob/main/LICENSE) | MiniMax H3 Community License |
| [LakonLab](https://github.com/Lakonik/LakonLab/tree/2ee2b334374ec91b7cee371a85a524bf4ba644d3), © 2026 Hansheng Chen. The structure of the fastest mode's pixel head (`freevideo_engine/dwd_head.py`: window attention with register tokens and the pixel projection) follows its reference implementation of the pi-H3 no-decode head; the code is FreeVideo's own. | [Apache-2.0](freevideo_engine/licenses/LakonLab-Apache-2.0.txt) |
| [pi-H3](https://huggingface.co/Lakonik/pi-H3) two-step no-decode adapter (INT8 ConvRot file), a derivative of MiniMax H3 (optional download for the fastest mode, pinned at `4a864589b0fac3d14768f932c930c4dcf1a17b56`) | [MiniMax H3 Community License](freevideo_engine/licenses/MiniMax-H3-Community-License-Agreement.txt) |
| Sampling preview decoder weights (a derivative of the H3 video decoder) | [MiniMax H3 Community License](freevideo_engine/licenses/MiniMax-H3-Community-License-Agreement.txt) |
| [MiniMax H3 Image](https://huggingface.co/MiniMaxAI/MiniMax-H3-Image) prompt expansion instructions, © MiniMax (text kept as published in the ComfyUI H3 Image template and, for prompts with reference pictures, in [MiniMax-H3-Image-PE](https://huggingface.co/MiniMaxAI/MiniMax-H3-Image-PE); FreeVideo appends one instruction) | [MiniMax H3 Image Community License](https://huggingface.co/MiniMaxAI/MiniMax-H3-Image/blob/main/LICENSE) |
| [Qwen-Image](https://github.com/QwenLM/Qwen-Image) prompt rewriting instructions (text kept as published; FreeVideo appends one instruction) | [Apache-2.0](freevideo_engine/licenses/Qwen-Image-Apache-2.0.txt) |
| [OpenCC](https://github.com/BYVoid/OpenCC) 1.4.2, © Carbo Kuo (BYVoid) and contributors: the Traditional Chinese interface text (web/locales/zh-Hant.json) is converted from the Simplified Chinese with it (Taiwan wording, then FreeVideo's own corrections), and scripts/i18n_hans_chars.txt is taken from its character table (data/dictionary/STCharacters.txt, as copied in opencc-python-reimplemented 0.1.7). OpenCC itself is not shipped; it ships no NOTICE file | [Apache-2.0](LICENSE) |
| [MiniMax H3 latent upscaler](https://huggingface.co/LBH-123-AI/Minimax_h3_latent_Upscaler) | [MIT](freevideo_engine/licenses/latent-upscaler-MIT.txt) |
| [FreeToken](https://github.com/FlashML-org/FreeToken) prompt VLM operators, [Qwen3-VL-4B-Instruct](https://huggingface.co/Qwen/Qwen3-VL-4B-Instruct) optional weights | [Apache-2.0](freevideo_engine/licenses/FreeToken-Apache-2.0.txt) |
| [Qwen-Image-2.1](https://huggingface.co/Comfy-Org/Qwen-Image-2.1) Turbo image generation models, including Qwen3-VL-8B and VAE (optional download; [notice](freevideo_engine/image_gen/licenses/NOTICE.txt) installed with the models), © 2026 Hangzhou Tongyi Laboratory Technology Co., Ltd. All Rights Reserved. | [Qwen RESEARCH LICENSE AGREEMENT](https://huggingface.co/Comfy-Org/Qwen-Image-2.1/blob/main/LICENSE) |
Expand Down
2 changes: 2 additions & 0 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ async def comfy_entrypoint():
share_routes()
from .freevideo_engine.swap_lora import register as swap_lora_routes
swap_lora_routes()
from .freevideo_engine.fast_pack import register as fast_pack_routes
fast_pack_routes()
from .freevideo_engine.comfy_metadata import register as workflow_backfill
workflow_backfill()
try:
Expand Down
2 changes: 2 additions & 0 deletions freevideo_engine/adaptive.py
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,8 @@ def execute_attempts(history, identity, profile, canvas, launch, *,
if prepare is not None:
prepare(current)
evidence['request_artifacts'] = report.get('artifacts')
if report.get('fast_tier'):
evidence['fast_tier'] = report['fast_tier']['mode']
if report.get('resource_prediction') is not None:
evidence['prediction'] = copy.deepcopy(report['resource_prediction'])
geometry = attempt_geometry(canvas, current['engine'])
Expand Down
897 changes: 456 additions & 441 deletions freevideo_engine/agent/errors.py

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion freevideo_engine/agent/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,9 @@ def _public(value):
from ..diagnostics import ABSOLUTE_PATH
# Keep prose slashes, URLs and bare roots. Once a path starts, use
# the shared matcher, which includes spaces through the full filename.
starts = re.compile(r'''(?<!\w)(?:[A-Za-z]:[\\/](?=[^\s"'<>|])|\\\\[^\\/\s"'<>]+[\\/])'''
# A file URL (file:///home/..., file://localhost/C:/...) starts one too; the shared matcher reads it whole.
starts = re.compile(r'''(?<![\w/])(?i:file):(?://[^/\s"'<>]*)?(?:/+|(?=[A-Za-z]:[\\/]))'''
r'''|(?<!\w)(?:[A-Za-z]:[\\/](?=[^\s"'<>|])|\\\\[^\\/\s"'<>]+[\\/])'''
r'''|(?<![^\W_])(?<![:/])/(?![/\s])[^/"'<>;|\r\n]+/(?![/\s])''')
parts, cursor = [], 0
for start in starts.finditer(value):
Expand Down
35 changes: 34 additions & 1 deletion freevideo_engine/agent/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,8 @@ def agent_path(path):
return path == '/freevideo/agent' or path.startswith('/freevideo/agent/')

async def no_cross_site_headers(request, response):
if agent_path(request.path) or request.path in ('/freevideo/lan', '/api/freevideo/lan'):
if agent_path(request.path) or request.path in ('/freevideo/lan', '/api/freevideo/lan', '/freevideo/language',
'/api/freevideo/language'):
for key in list(response.headers):
if key.lower().startswith('access-control-'):
del response.headers[key]
Expand Down Expand Up @@ -909,6 +910,38 @@ async def lan_settings(request):
finally:
errors.REQUEST_ID.reset(identity)

# The interface language, shared with the launcher: read anywhere on this computer, changed only by the page.
@routes.get('/freevideo/language')
@routes.post('/freevideo/language')
async def language_setting(request):
from .. import language_page
from ..comfy_bridge import installation_root
identity = errors.REQUEST_ID.set('r-' + uuid.uuid4().hex)
try:
access.check(request, local=True)
root = installation_root()
if request.method == 'POST':
if not valid_page_session(request):
raise JobError('page_session_required', 'Page session required')
value = await read_body(request, contract.MAX_BODY_BYTES)
return reply(await asyncio.to_thread(language_page.apply, root, value))
return reply(await asyncio.to_thread(language_page.read, root))
except language_page.InvalidRequest as error:
field = error.field if error.field in ('language', '') else '<unknown>'
return reply({'error': errors.validation([contract.diagnostic('/' + field, error.allowed, error.got)])}, 422)
except JobError as error:
return reply({'error': error.view()}, errors.ERRORS[error.code][0])
except (json.JSONDecodeError, UnicodeDecodeError, RecursionError):
return problem('invalid_json')
except web.HTTPException as error:
return problem('too_large' if error.status == 413 else 'invalid_request')
except OSError:
return problem('storage_unavailable')
except Exception:
return problem('internal_error')
finally:
errors.REQUEST_ID.reset(identity)

def activity_item(row, *, card=False):
view = jobs.view(row, detail=False)
value = {k: view.get(k) for k in ('id', 'kind', 'status', 'label', 'project', 'client', 'take',
Expand Down
61 changes: 49 additions & 12 deletions freevideo_engine/capabilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,26 @@
TIERS = {name: (tier['steps'], tier['two_pass']) for name, tier in quality_tiers.TIERS.items()}
PLAN_NAMES = {'-1': 'refused', '0': 'normal', '1': 'slower_streaming',
'2': 'admitted_tight_memory'}
# The fastest mode (fast_mode 'fast2'): one pass of two steps, decoded by the adapter's pixel head. It is not one of the
# quality levels (`tiers`), so every reader of those keeps its four levels; `fast_mode` carries its own rows.
FAST2_STEPS = 2


def _fast_mode_listing(machine):
"""Whether this machine is offered the fastest mode at all, and why not: the adapter replaces int8 layers and runs
on NVIDIA's CUDA build only."""
if machine['mac']:
return dict(listed=False, unlisted_reason='mac')
# Setup's vendor first, then the torch build (a ROCm build passes the capability check but saves no CUDA version);
# a record without either is told by the card's name. Older NVIDIA drivers name a card without the vendor
# ("GeForce RTX 3090"), so the name rules out AMD's words rather than asking for NVIDIA's.
name = str(machine['name']).casefold()
if (machine['cap'] is None or machine.get('vendor') not in (None, 'nvidia') or machine.get('cuda_missing')
or any(word in name for word in ('amd', 'radeon', 'instinct'))):
return dict(listed=False, unlisted_reason='gpu')
if machine['precision'] != 'int8':
return dict(listed=False, unlisted_reason='engine')
return dict(listed=True, unlisted_reason=None)
# WholeVideoProgress.for_request starts an ordinary new-prompt request with
# these flags. Unobserved encoder/model residency stays cold; compilation is
# unknown (the prior's half-cold default), even later in the same session.
Expand Down Expand Up @@ -260,14 +280,20 @@ def _machine(machine, in_use=None):
ram_available=max(0, int(ram) - idle['ram']), idle_in_use=idle,
cap=tuple(cap) if not mac else None, precision=precision,
metal=int(metal) if metal is not None else None,
compile_owed=machine.get('compile_owed') is True and not mac)
compile_owed=machine.get('compile_owed') is True and not mac,
# Setup's vendor, and whether the saved torch build is a CUDA one: a ROCm build saves no CUDA version.
# A record from before either was saved has neither, and is judged by the card's name as before.
vendor=str(machine['gpu_vendor']).casefold() if machine.get('gpu_vendor') else None,
cuda_missing='cuda_version' in observed and not observed['cuda_version'])


def _request(width, height, frames, steps, two_pass, task='t2va', refine=3,
references=None, reference_rows=None, upscale=2):
references=None, reference_rows=None, upscale=2, fast_mode=None):
"""Scalar request shared by admission and offline, recorded-row reviews."""
from .two_pass import render_canvas
canvas = dict(render_canvas(geometry(width, height, frames=frames))[0], task=task, steps=steps)
if fast_mode == 'fast2':
canvas['fast_mode'] = fast_mode
if reference_rows is not None:
if not valid_reference_rows(reference_rows):
raise ValueError('Invalid recorded reference rows.')
Expand All @@ -289,14 +315,14 @@ def _request(width, height, frames, steps, two_pass, task='t2va', refine=3,


def _admit(machine, width, height, frames, steps, two_pass, task='t2va', refine=3,
references=None, reference_rows=None, step_cache=None, upscale=2):
references=None, reference_rows=None, step_cache=None, upscale=2, fast_mode=None):
"""Admission of one request; `step_cache` asks the planner for a first-pass cache.

The request carries the cache the planner keeps (on Mac only the audio-video EasyCache), so its
estimate and history follow what the engine will actually run.
"""
canvas, sampling, request = _request(width, height, frames, steps, two_pass, task, refine,
references, reference_rows, upscale)
references, reference_rows, upscale, fast_mode)
rows = dict(video=canvas.get('reference_video_tokens', 0), audio=canvas.get('reference_audio_tokens', 0))
try:
if machine['mac']:
Expand Down Expand Up @@ -341,7 +367,10 @@ def _admit(machine, width, height, frames, steps, two_pass, task='t2va', refine=
return request, int(disk_risk or transfers), 'memory' if disk_risk else 'gpu_memory' if transfers else None
except ResourceBudgetError as error:
# One field cannot encode both failures: prefer the system RAM limit.
return None, -1, 'memory' if 'ram' in error.details['insufficient'] else 'gpu_memory'
if 'ram' in error.details['insufficient']:
return None, -1, 'memory'
# The fast mode's sampling fits and its pixel head does not: the ways out differ from a sampling shortfall.
return None, -1, 'decode_gpu_memory' if error.details.get('gpu_requirement') == 'fast_mode_decode' else 'gpu_memory'
except MemoryError:
return None, -1, 'memory'

Expand Down Expand Up @@ -468,13 +497,11 @@ def estimate(request):
if matches else {})
return local.get('seconds', prior['total']['seconds'] * ratio)

tiers = {}
for name, tier in quality_tiers.table(machine['mac']).items():
steps, two_pass, step_cache, upscale = tier['steps'], tier['two_pass'], tier['step_cache'], tier['upscale']
def rows(steps, two_pass, step_cache, upscale, fast_mode=None):
times, codes, slow_by, maxima, frame_maxima, limits = [], [], [], [], [], []
for size_row in sizes:
admitted = {f: _admit(machine, size_row['width'], size_row['height'], f, steps, two_pass, task,
references=references, step_cache=step_cache, upscale=upscale)
references=references, step_cache=step_cache, upscale=upscale, fast_mode=fast_mode)
for f in range(39, lengths[-1]['frames'] + 1, 17)}
estimates = {}
for f, (request, _, _) in admitted.items():
Expand Down Expand Up @@ -503,14 +530,24 @@ def estimate(request):
times.append(row_times)
codes.append(row_codes)
slow_by.append(row_slow)
tiers[name] = dict(steps=steps, two_pass=two_pass, step_cache=step_cache, upscale=upscale, estimate_seconds=times,
max_seconds=maxima, max_frames=frame_maxima, limit=limits, plan=codes, slow_by=slow_by)
return dict(steps=steps, two_pass=two_pass, step_cache=step_cache, upscale=upscale, estimate_seconds=times,
max_seconds=maxima, max_frames=frame_maxima, limit=limits, plan=codes, slow_by=slow_by)

tiers = {name: rows(tier['steps'], tier['two_pass'], tier['step_cache'], tier['upscale'])
for name, tier in quality_tiers.table(machine['mac']).items()}
fast = _fast_mode_listing(machine)
if fast['listed']:
fast.update(rows(FAST2_STEPS, False, None, 2, fast_mode='fast2'))
# Where a length does not fit: the light level instead, or the longest length that fits at this size (never
# shortened without being asked). The page shows the light level only where it fits that size and length.
fast['shorten_seconds'] = list(fast['max_seconds'])
fast['actions'] = [['use_light', 'shorten'] if longest is not None else ['use_light'] for longest in fast['max_seconds']]
default = next((i for i, s in enumerate(sizes) if s['pixels'] == .98), 0)
result = dict(version=1, status='ready',
machine=dict(gpu_name=machine['name'], vram_gib=machine['vram'] / GiB,
ram_gib=machine['ram'] / GiB, system=machine['system'],
compile_owed=machine['compile_owed']),
aspect=aspect, sizes=sizes, lengths=lengths, tiers=tiers,
aspect=aspect, sizes=sizes, lengths=lengths, tiers=tiers, fast_mode=fast,
summary=dict(width=sizes[default]['width'], height=sizes[default]['height'], tier='light',
max_seconds=tiers['light']['max_seconds'][default],
max_frames=tiers['light']['max_frames'][default]),
Expand Down
8 changes: 5 additions & 3 deletions freevideo_engine/chain_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import math
from pathlib import Path

from .geometry import geometry
from .geometry import SHORTEST_SECONDS, geometry

FPS, UNIT, OVERLAP = 24, 17, 22
SINGLE_SECONDS, BLOCK_SECONDS, SHORTEST_BLOCK = 30, 15, 5
Expand Down Expand Up @@ -64,9 +64,11 @@ def parts_limit(short, first_frame=False, max_parts=MAX_PARTS):


class PlanError(ValueError):
def __init__(self, code, message):
"""`details`: fields the page reads besides the code, such as the shortest length for `too_short`."""
def __init__(self, code, message, **details):
super().__init__(message)
self.code = code
self.details = details


def _number(value, name, whole=False):
Expand Down Expand Up @@ -138,7 +140,7 @@ def plan(seconds, single=False, max_frames=None, single_limit_seconds=None, bloc
except PlanError:
raise
except ValueError as error:
raise PlanError('too_short', str(error)) from None
raise PlanError('too_short', str(error), min_seconds=SHORTEST_SECONDS) from None
if seconds > MAX_SECONDS:
raise PlanError('too_long', 'A video is at most 2 hours long')
# The longest whole-second block this device can start a video with, and continue one with.
Expand Down
5 changes: 5 additions & 0 deletions freevideo_engine/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ def main():
help='Sample a smaller canvas, upscale latents and refine (default: on; 8 + 3 steps)')
generate.add_argument('--step-cache', choices=('easycache-av', 'fbcache'),
help='Approximate reuse between sampling steps (disabled by default)')
generate.add_argument('--fast-mode', choices=('fast2',),
help='Fastest mode: two steps with an additional adapter, pixels without the video VAE')
generate.add_argument('--base-steps', type=int, choices=range(1, 33), metavar='1..32',
help='First-pass steps (default: 8, or explicit profile). Changes may reduce quality.')
generate.add_argument('--refine-steps', type=int, choices=range(1, 32), default=3, metavar='1..31',
Expand Down Expand Up @@ -189,6 +191,9 @@ def main():
validate_route(task=args.task or ('ref2va' if args.continue_anchor else 't2va'),
anchor=args.continue_anchor is not None, two_pass=args.two_pass, preview=args.preview,
refine_from=args.refine_from)
if sys.platform == 'darwin' and args.command == 'generate' and args.fast_mode is not None:
# The Mac route below has its own engine, which would otherwise run the default steps.
raise ValueError('The fastest mode is not available on Mac')
if sys.platform == 'darwin' and args.command == 'generate' and args.upscale_from is not None:
raise ValueError('Upscaling a finished video is not available on Mac yet')
if sys.platform == 'darwin' and args.command in ('plan', 'generate', 'encode', 'doctor'):
Expand Down
Loading