Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
1e8dbec
Editor: the track head gives its name 5 px more, so the default track…
KBRASK Nov 20, 2026
761f792
MOSS-Image layer streaming: when the system will not lock the host bu…
KBRASK Nov 20, 2026
0735c78
Creations: the count mark on a task's newest video is a button that u…
KBRASK Nov 20, 2026
233c95f
Export window: a Sound group (Compatible or Lossless) beside the fram…
KBRASK Nov 20, 2026
175784a
Creations: a folded cover keeps its "N results" name and expanded sta…
KBRASK Nov 20, 2026
447b579
Prompt rewrites no longer run the prompt through the math attention k…
KBRASK Nov 20, 2026
8a90a72
Picture page and editor: a prompt the engine would refuse (nothing le…
KBRASK Nov 20, 2026
e4559b4
The page check lists the ComfyUI templates window script, so its list…
KBRASK Nov 20, 2026
6b4e577
Reference video, lines only: disk space, clip change, memory stop and…
KBRASK Nov 20, 2026
5de9a92
Assistant tasks: a poll keeps the rows whose task did not change, so …
KBRASK Nov 20, 2026
1fa7934
Tests follow the redesigned pages: the report, sound, What's new, uni…
KBRASK Nov 20, 2026
3b2d7c2
Editor: a finished continued part gets its next part only at an open …
KBRASK Nov 20, 2026
ecd1607
Image pack: the video encoder folder setup recorded is used also when…
KBRASK Nov 20, 2026
ebb8b9c
Settings: "Open settings" from a failure puts the focus on Check inst…
KBRASK Nov 20, 2026
d7bc579
Image failure card: a failure that carries only the catch-all code an…
KBRASK Nov 20, 2026
1bd66f0
Studio: opening the panel again right after switching to the node vie…
KBRASK Nov 20, 2026
d1400ba
Creations: Continue does not open the editor over a share or delete d…
KBRASK Nov 20, 2026
598828d
Editor: a picture whose file was moved or deleted is named once in th…
KBRASK Nov 20, 2026
2158e47
Public CI: the Linux ARM64 job is removed for now, because the public…
KBRASK Nov 20, 2026
05face4
Keep the saved GPU facts per interpreter
KBRASK Nov 21, 2026
6ad2fae
Top bar: assistant tasks join the run status as task rows, the separa…
KBRASK Nov 21, 2026
e2ea91e
After releasing an idle encoder, wait for the card to give its video …
KBRASK Nov 21, 2026
73519af
Setup downloads: a source that fails on an untrusted certificate is r…
KBRASK Nov 21, 2026
900de79
Editor: each large-box session is one undo step of the small descript…
KBRASK Nov 21, 2026
f8fa5ce
Editor: browser tests follow the redesign; the large description box …
KBRASK Nov 21, 2026
72df2d2
Launcher failure card: the laptop GeForce RTX 2050 is no longer liste…
KBRASK Nov 20, 2026
251bc40
Editor: the preview gets the room, and the Media, LoRA and Advanced w…
KBRASK Nov 21, 2026
1e38b65
Editor: in a narrow window the chips stay on one line and the key sta…
KBRASK Nov 21, 2026
eea3502
Play bar of our own replaces the browser's media controls: click to p…
KBRASK Nov 21, 2026
1b142dc
Every select inside a FreeVideo page opens the FreeVideo menu instead…
KBRASK Nov 21, 2026
c09d74c
One focus ring: drop the three rings beside a11y.css, no ring after a…
KBRASK Nov 19, 2026
03e46d6
Upscale: a merged video can go to the large size, and a refused video…
KBRASK Nov 21, 2026
017ae4b
Editor: closing or reloading the page gives the open edit back at onc…
KBRASK Nov 21, 2026
8e854fd
Mac: a sampling pass that reaches the RAM floor retries once with the…
KBRASK Nov 21, 2026
914316c
Image worker: after a model is closed the worker also empties torch's…
KBRASK Nov 21, 2026
128bd48
Launcher: the card for a video that still generates when the update r…
KBRASK Nov 21, 2026
e900648
Name a driverless NVIDIA card from the system's PCI device list when …
KBRASK Nov 21, 2026
e4dc63e
Privacy residue checks for pictures, uploads, thumbnails and logs
KBRASK Nov 21, 2026
01a0735
Retry a failed Git download with the Windows certificate store when t…
KBRASK Nov 21, 2026
4ebc975
Creation panel: a LoRA strength typed past the limit keeps its "At mo…
KBRASK Nov 20, 2026
13bc7b8
Editor: the adjust panel is glass only when docked (1280 px and wider…
KBRASK Nov 21, 2026
1740ab2
Editor: Escape during a pending replace-audio ends only the replace a…
KBRASK Nov 20, 2026
d176e6a
Library: download several selected works as one zip file
KBRASK Nov 21, 2026
1fe4a96
Launcher: a missing entry script is restored from the program's own f…
KBRASK Nov 21, 2026
64e59b9
Restore lost or re-written files of a downloaded ComfyUI, name edited…
KBRASK Nov 21, 2026
3f7a380
Prompt enhancement: MOSS-Image prompts are rewritten with Qwen-Image'…
KBRASK Nov 21, 2026
fc45f8a
Release 0.6.7: update notes
KBRASK Nov 21, 2026
b93078d
Release 0.6.7: update notes, Mac low-memory item reworded
KBRASK Nov 21, 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
16 changes: 16 additions & 0 deletions freevideo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,22 @@ try {
-Arguments @('python', 'install', '--no-bin', '--no-registry', '--no-progress', '--color', 'never', $versions.python) `
-LogPath $bootstrapLog -Label $pythonLabel `
-Direct:($proxyRoute -eq 'direct') -OutputTail ([ref]$pythonOutput)
if ($pythonExit -ne 0 -and (Test-FreeVideoCertificateFailure $pythonOutput)) {
$originalOutput = $pythonOutput
$originalExit = $pythonExit
$retryOutput = ''
$retryExit = Invoke-FreeVideoBootstrapCommand -Executable $uv `
-Arguments @('--native-tls', 'python', 'install', '--no-bin', '--no-registry', '--no-progress', '--color', 'never', $versions.python) `
-LogPath $bootstrapLog -Label ($pythonLabel + ', system certificates') `
-Direct:($proxyRoute -eq 'direct') -OutputTail ([ref]$retryOutput)
if ($retryExit -eq 0) {
$pythonExit = 0
$pythonOutput = $retryOutput
} else {
$pythonExit = $originalExit
$pythonOutput = $originalOutput
}
}
if ($pythonExit -eq 0) { $installed = $true; break }
if (Test-FreeVideoAccessDenied $pythonOutput) { $deniedRoutes[$route] = $true }
elseif (Test-FreeVideoSlowDownloadFailure $pythonOutput) { $slowRoutes[$route] = $true }
Expand Down
4 changes: 3 additions & 1 deletion freevideo_engine/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -2061,9 +2061,11 @@ def python_install(self, uv):
return
custom = self.env.get('UV_PYTHON_INSTALL_MIRROR') if self.network.get('mode') != 'official' else None
isolation = ['--no-bin', '--no-registry']
def attempt(source, route, retry_mode):
def attempt(source, route, retry_mode, native_tls=False):
env = network.download_environment(
network.route_environment(self.network, 'github', source, self.env, route), retry_mode)
if native_tls:
env['UV_NATIVE_TLS'] = '1'
env['UV_PYTHON_INSTALL_MIRROR'] = (custom if source == 'user-python' else network.PYTHON_MIRRORS[source]
if source in network.PYTHON_MIRRORS else
network.source_url('github', source, self.env) + '/astral-sh/python-build-standalone/releases/download')
Expand Down
174 changes: 173 additions & 1 deletion freevideo_engine/comfy_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,8 @@ def list_videos(output_directory, *, before=None, limit=24, favorite=None):
if key[1] + '/video.mp4' in tokens:
summary['report_id'] = tokens[key[1] + '/video.mp4']
folders[key[1]], reports[key[1]] = path.parent, report
# A video made without a request of its own (the editor's merged export) can go to 4K but not up one step.
summary['saved_request'] = (path.parent / 'comfy-request.json').is_file()
rows.append(dict(summary, id=key[1], bytes=info.st_size, favorite=is_favorite,
created_at=datetime.fromtimestamp(info.st_mtime, timezone.utc).isoformat(),
cursor=str(key[0]) + ':' + key[1]))
Expand Down Expand Up @@ -390,6 +392,120 @@ def video_download(output_directory, identity, *, workflow=False):
return copy, name, copy


ZIP_MOST_ITEMS = 500


class _ZipSink:
"""An unseekable target for zipfile: each take() hands over what was written since the last one."""
def __init__(self):
self.parts = []

def write(self, data):
self.parts.append(bytes(data))
return len(data)

def flush(self):
pass

def take(self):
data, self.parts = b''.join(self.parts), []
return data


def zip_plan(output_directory, input_directory, items):
"""Which of the asked-for works can be packed: ``([(kind, key, arcname)], [left out])``.

A video is named by its saved id and a picture by its file in the image engine's own folder; anything else,
a repeat, or a work that cannot be read now is left out (and named in the zip's skipped.txt)."""
if not isinstance(items, list) or not items or len(items) > ZIP_MOST_ITEMS:
raise ValueError('Invalid selection')
from .work_thumbnails import FOLDER, PICTURE
plan, left, seen, taken = [], [], set(), set()
for item in items:
if not isinstance(item, dict):
raise ValueError('Invalid selection')
kind = item.get('kind')
key = item.get('id') if kind == 'video' else item.get('file') if kind == 'image' else None
if not isinstance(key, str):
raise ValueError('Invalid selection')
if (kind, key) in seen:
continue
seen.add((kind, key))
try:
if kind == 'video':
path = _video(output_directory, key)
_report(path)
if not path.stat().st_size:
raise ValueError('Video is empty')
stamp = datetime.fromtimestamp(path.stat().st_mtime, timezone.utc).strftime('%Y%m%d_%H%M%S')
name = 'videos/FreeVideo_%s_%s.mp4' % (stamp, key.split('/')[-1][:12])
else:
leaf = key.rpartition('/')[2]
if not PICTURE.fullmatch(leaf) or key != FOLDER + '/' + leaf:
raise ValueError('Invalid picture')
info = os.lstat(Path(input_directory) / FOLDER / leaf)
if not stat.S_ISREG(info.st_mode):
raise ValueError('Picture is not a plain file')
name = 'images/' + leaf
except (OSError, ValueError):
left.append(key)
continue
base, dot, extension = name.rpartition('.')
number = 1
while name in taken:
number += 1
name = '%s-%d.%s' % (base, number, extension)
taken.add(name)
plan.append((kind, key, name))
return plan, left


def zip_stream(output_directory, input_directory, plan, left, *, workflow=False, copies=None):
"""The bytes of one zip of the planned works, produced piece by piece (stored, not recompressed, zip64).

Every video's copy without the prompt and workflow is deleted as soon as it is written, also when the
generator is closed half way. A work that cannot be read by now is added to skipped.txt at the end.
``copies``, when given, receives the path of each copy as it is made, for a caller that has to delete them itself."""
import zipfile
from .work_thumbnails import FOLDER
sink = _ZipSink()
left = list(left)
with zipfile.ZipFile(sink, 'w', zipfile.ZIP_STORED, allowZip64=True) as archive:
for kind, key, name in plan:
copy, started = None, False
try:
if kind == 'video':
path, _, copy = video_download(output_directory, key, workflow=workflow)
if copy is not None and copies is not None:
copies.append(copy)
else:
path = Path(input_directory) / FOLDER / key.rpartition('/')[2]
if not stat.S_ISREG(os.lstat(path).st_mode):
raise ValueError('Picture is not a plain file')
with open(path, 'rb') as source:
mtime = time.localtime(os.fstat(source.fileno()).st_mtime)[:6]
entry = zipfile.ZipInfo(name, date_time=max(mtime, (1980, 1, 1, 0, 0, 0)))
entry.compress_type = zipfile.ZIP_STORED
entry.external_attr = 0o644 << 16
with archive.open(entry, 'w', force_zip64=True) as target:
started = True
while True:
chunk = source.read(1024 * 1024)
if not chunk:
break
target.write(chunk)
yield sink.take()
except (OSError, ValueError, TypeError):
left.append(key + ' (only part of it is in this zip)' if started else key)
finally:
if copy is not None:
copy.unlink(missing_ok=True)
yield sink.take()
if left:
archive.writestr('skipped.txt', 'These works could not be read and are not in this zip:\n' + '\n'.join(left) + '\n')
yield sink.take()


# What a FreeVideo request writes into its own run folder, including the
# prompt-enhancement record and the staging copy monitoring.save keeps when
# Windows would not let it replace a JSON record. A creation whose folder
Expand Down Expand Up @@ -1017,7 +1133,10 @@ def _forget_works(root, facts):


def _forget_results(identities, root):
"""A result-cache row naming a deleted creation can no longer be reused."""
"""A result-cache row naming a deleted creation can no longer be reused, and the record of finished jobs in the
output folder keeps no line naming it."""
from . import jobs_journal
jobs_journal.forget(identities, root=root.parent)
for index in (root / '.result-cache').glob('*.json'):
try:
if index.stat().st_size <= 1024 * 1024 and json.loads(index.read_text(encoding='utf-8')).get('id') in identities:
Expand Down Expand Up @@ -1841,6 +1960,59 @@ async def sizes(request):
raise web.HTTPBadRequest(text='Invalid selection') from None
return web.json_response(dict(sizes=result), headers={'Cache-Control': 'no-store'})

@server.routes.post('/freevideo/library/download-zip')
async def download_zip(request):
# One zip of several works. The page posts a form (so the browser streams the answer straight to disk) with
# the choice in its ``payload`` field; a JSON body is read the same way.
try:
if request.content_type == 'application/json':
body = await request.json()
else:
body = json.loads((await request.post()).get('payload'))
if not isinstance(body, dict):
raise ValueError('Invalid selection')
output, source = folder_paths.get_output_directory(), folder_paths.get_input_directory()
plan, left = await asyncio.to_thread(zip_plan, output, source, body.get('items'))
except (OSError, ValueError, TypeError):
raise web.HTTPBadRequest(text='Invalid selection') from None
if not plan:
raise web.HTTPNotFound(text='Saved works unavailable')
if body.get('check') is True:
# What the page asks before posting the form: the answer to a form lands in a hidden frame, where an error
# would be seen by no one.
return web.json_response(dict(ready=len(plan), skipped=len(left)), headers={'Cache-Control': 'no-store'})
stamp = datetime.now().strftime('%Y%m%d_%H%M%S')
response = web.StreamResponse(headers={'Content-Type': 'application/zip', 'Cache-Control': 'private, no-store',
'Content-Disposition': 'attachment; filename="FreeVideo_%s.zip"' % stamp,
'X-FreeVideo-Skipped': str(len(left))})
copies = []
pieces = zip_stream(output, source, plan, left, workflow=body.get('workflow') is True, copies=copies)
try:
await response.prepare(request)
while True:
chunk = await asyncio.to_thread(next, pieces, None)
if chunk is None:
break
if chunk:
await response.write(chunk)
await response.write_eof()
finally:
# Also when the browser cancelled: the copies without the prompt and workflow are deleted.
for _ in range(600):
try:
await asyncio.to_thread(pieces.close)
break
except ValueError: # still reading its last piece in another thread
await asyncio.sleep(0.1)
else:
logging.warning('FreeVideo is still preparing a video for a cancelled zip download; its copy is removed when done.')
for copy in copies:
try:
await asyncio.to_thread(copy.unlink, missing_ok=True)
except OSError:
pass # Still open (Windows): the generator removes it itself once it returns.
return response

@server.routes.get('/freevideo/library/download')
async def download(request):
headers = {'Content-Type': 'video/mp4', 'Cache-Control': 'private, no-store'}
Expand Down
74 changes: 73 additions & 1 deletion freevideo_engine/comfy_source.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Install a pinned ComfyUI application into a newly selected workspace."""
import json
import subprocess
from pathlib import Path

from .long_paths import io_path, resolved, plain, plain_errors
Expand Down Expand Up @@ -50,7 +51,14 @@ def download(target, *, plan, env, run):
validate_target(target)
spec = specification()
if target.exists():
return network.clone(target, spec['url'], spec['commit'], network=plan, env=env, run=run)
try:
return network.clone(target, spec['url'], spec['commit'], network=plan, env=env, run=run)
except ValueError:
# A folder FreeVideo downloaded (it holds the receipt) that lost files or only
# differs in permissions or line endings is repaired; the user's edits never are.
if not restore_untouched(target, spec['commit'], plan=plan, env=env, run=run):
raise
return network.clone(target, spec['url'], spec['commit'], network=plan, env=env, run=run)
stage = target.with_name(target.name + '.freevideo-download')
# A finished checkout survives cancellation before publication.
network.clone(stage, spec['url'], spec['commit'], network=plan, env=env, run=run)
Expand All @@ -61,3 +69,67 @@ def download(target, *, plan, env, run):
raise ValueError('The ComfyUI destination changed during installation; the downloaded files are retained: ' + str(stage))
stage.rename(target)
return target


RESTORE_BATCH = 100


WAYS_OUT = ('To download a fresh copy, rename or move this folder, then click "Retry installation". '
'To keep using it as it is, choose "Use existing ComfyUI".')


def different_message(first):
return first + ' FreeVideo left the folder unchanged. ' + WAYS_OUT


def restore_untouched(target, commit, *, plan, env, run):
"""Bring back the downloaded files an existing ComfyUI lost or only re-wrote; refuse anything else.

Returns True when the folder now matches the pinned source, False when this cannot
be judged (not a readable Git checkout, or nothing differs), and raises ValueError
naming the files when the folder holds another version or edited files.
"""
if not io_path(Path(target) / '.git').exists():
return False
env = dict(env or {}, GIT_TERMINAL_PROMPT='0')
git = env.get('FREEVIDEO_GIT') or 'git'
base = [git, '-c', 'core.longpaths=true', '-C', str(target)]
content = ['-c', 'core.filemode=false', '-c', 'core.autocrlf=false']
def output(*arguments, settings=()):
command = [base[0], *settings, *base[1:], *arguments]
return network.subprocess_output.output_external(command, env=env, timeout=120, **network.hidden_console())
try:
head = output('rev-parse', 'HEAD').strip()
# Files whose content changed; a file that only lost its permissions or got other line endings is not one.
changed = [row.split('\t', 2)[2] for row in output(
'diff', '--numstat', '-z', '--ignore-cr-at-eol', '--diff-filter=d', 'HEAD', settings=content).split('\0') if row]
listed = output('status', '--porcelain', '-z', '--untracked-files=no').split('\0')
except (subprocess.CalledProcessError, subprocess.TimeoutExpired, OSError, IndexError):
return False
if head != commit:
raise ValueError(different_message('The ComfyUI folder %s holds a different version from the one FreeVideo needs.' % plain(target)))
if changed:
shown = ', '.join(changed[:8]) + (', and %d more' % (len(changed) - 8) if len(changed) > 8 else '')
raise ValueError(different_message('Some files in the ComfyUI folder %s differ from the version FreeVideo needs. '
'Changed files (%d): %s.' % (plain(target), len(changed), shown)))
names = [row[3:] for row in listed if len(row) > 3]
if not names:
return False
for start in range(0, len(names), RESTORE_BATCH):
command = [git, '-c', 'core.longpaths=true', '-C', str(target), '-c', 'core.autocrlf=false',
'checkout', '--force', commit, '--', *names[start:start + RESTORE_BATCH]]
if run:
run('ComfyUI-restore', command, env=env)
else:
result = network.subprocess_output.run_external(list(map(str, command)), env=env, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT, **network.hidden_console())
if result.returncode:
raise RuntimeError(result.stdout[-2500:])
try:
if output('status', '--porcelain', '--untracked-files=no').strip():
# The file system cannot hold permissions; Git is told to stop comparing them.
output('config', 'core.fileMode', 'false')
except (subprocess.CalledProcessError, subprocess.TimeoutExpired, OSError):
return False
network.event(plan or {}, category='git', file=Path(target).name, action='restored', commit=commit, files=len(names))
return True
Loading