diff --git a/freevideo_engine/access_proxy.py b/freevideo_engine/access_proxy.py index 5c559bb4..eb84391e 100644 --- a/freevideo_engine/access_proxy.py +++ b/freevideo_engine/access_proxy.py @@ -18,8 +18,9 @@ import os import re from pathlib import Path +import secrets import ssl -from urllib.parse import urlencode, urlsplit +from urllib.parse import parse_qsl, urlencode, urlsplit from aiohttp import ClientSession, ClientTimeout, DummyCookieJar, TCPConnector, WSMsgType, client_exceptions, web from yarl import URL @@ -37,6 +38,7 @@ 'FreeVideo
') COOKIE = 'freevideo_access' +PROOF_COOKIE = 'freevideo_proof' DAYS = 30 LOGIN_PATH = '/m/login' # All password-page text lives here; the lockout line matches web/phone_model.js. @@ -110,6 +112,114 @@ def same_origin(request): return False +# A signed-in browser sends its cookie with any request, also one another website makes it send, so a request that can +# change something needs the device's proof in proxy_identity.CSRF_HEADER. An API client that sends only its bearer token +# is not a browser and is not asked. The only change made before there is a device to prove is signing in. The proof is +# never put in an address (addresses end up in logs, histories and diagnostic reports): the one form the page posts +# (FORM_PROOF, it cannot send a header) carries it as a field, read and removed here. +SAFE_METHODS = ('GET', 'HEAD', 'OPTIONS') +WITHOUT_PROOF = {('POST', LOGIN_PATH): 'signing in comes before there is a signed-in device to give a proof to'} +FORM_PROOF = frozenset(('/freevideo/library/download-zip', '/api/freevideo/library/download-zip')) +# What is read of such a form: the page splits a download into forms of at most 1 MiB (web/output_download.js). +FORM_PROOF_BYTES = 4 << 20 +FORM_TOO_LARGE = 'This download asks for too many creations at once. Download them in smaller groups.' +PROOF_MISSING = 'This change has to come from the FreeVideo page opened with the access link. Reload the page and try again.' + + +async def needs_proof(request, secret): + """True for a change from a signed-in browser that does not carry its device's proof ('too_large' for a form on + FORM_PROOF past FORM_PROOF_BYTES). Such a form proves itself with its proxy_identity.PROOF_FIELD, which is taken out + of the body it forwards (request['body']).""" + device = request.get('lan_device') + if request.method in SAFE_METHODS or not device or (request.method, request.path) in WITHOUT_PROOF: + return False + if proxy_identity.proof_matches(secret, device, request.headers.get(proxy_identity.CSRF_HEADER, '')): + return False + if request.method != 'POST' or request.path not in FORM_PROOF or request.content_type != 'application/x-www-form-urlencoded': + return True + data = b'' + while len(data) <= FORM_PROOF_BYTES: # read() may give less than asked: read to the end, or past the limit + chunk = await request.content.read(FORM_PROOF_BYTES + 1 - len(data)) + if not chunk: + break + data += chunk + if len(data) > FORM_PROOF_BYTES: + return 'too_large' + fields = parse_qsl(data.decode('utf-8', 'replace'), keep_blank_values=True) + offered = [value for name, value in fields if name == proxy_identity.PROOF_FIELD] + if len(offered) != 1 or not proxy_identity.proof_matches(secret, device, offered[0]): + return True + request['body'] = urlencode([(name, value) for name, value in fields if name != proxy_identity.PROOF_FIELD]).encode() + return False + + +# The first script of the signed-in page (injected into ComfyUI's page by inject_proof, served at PROOF_SCRIPT_PATH): it +# runs before every module, so every change the page makes through fetch or XMLHttpRequest to this server carries the +# device's proof (the freevideo_proof cookie), whoever holds a reference to fetch. A change refused for an old proof +# (FreeVideo restarted) is sent once more with the current one, which the refusal brought; when that fails too, the page +# hears 'freevideo-proof-expired' (web/proxy_proof.js says so). The wrappers name the functions they wrap +# (freevideoNative), so the page's check for other programs wrapping fetch still sees through them. +# scripts/test_proxy_page_proof.mjs runs this text. +PROOF_SCRIPT_PATH = '/m/proof.js' +PAGE_PROOF_SCRIPT = r"""(() => { + if (window.fetch && window.fetch.freevideoProof) return; + const COOKIE = /(?:^|;\s*)freevideo_proof=([0-9a-f]{64})(?:;|$)/, UNSAFE = /^(POST|PUT|PATCH|DELETE)$/i, HEADER = 'X-FreeVideo-CSRF'; + const proof = () => { try { return COOKIE.exec(document.cookie || '')?.[1] || ''; } catch { return ''; } }; + const own = url => { try { return new URL(url, location.href).origin === location.origin; } catch { return false; } }; + const expired = async answer => { + if (!answer || answer.status !== 403) return false; + try { return (await answer.clone().json())?.error?.code === 'page_session_required'; } catch { return false; } + }; + const native = window.fetch; + const proved = async function (input, init) { + let request; + try { request = new Request(input, init); } catch { return native.call(window, input, init); } + if (!UNSAFE.test(request.method) || !own(request.url) || !proof()) return native.call(window, input, init); + const send = () => { + const copy = request.clone(); + const headers = new Headers(copy.headers); + headers.set(HEADER, proof()); + return native.call(window, new Request(copy, {headers})); + }; + const first = await send(); + if (!await expired(first)) return first; + const again = await send(); + if (await expired(again)) window.dispatchEvent(new CustomEvent('freevideo-proof-expired')); + return again; + }; + proved.freevideoProof = true; proved.freevideoNative = native; + window.fetch = proved; + const XHR = window.XMLHttpRequest && window.XMLHttpRequest.prototype; + if (!XHR) return; + const open = XHR.open, send = XHR.send, header = XHR.setRequestHeader; + XHR.open = function (method, url, ...rest) { + this.__freevideoChange = UNSAFE.test(String(method)) && own(url); + this.__freevideoProved = false; + return open.call(this, method, url, ...rest); + }; + // A request that names its proof itself keeps it (a second value would be joined to the first, and refused). + XHR.setRequestHeader = function (name, value) { + if (String(name).toLowerCase() === HEADER.toLowerCase()) this.__freevideoProved = true; + return header.call(this, name, value); + }; + XHR.send = function (body) { + const value = this.__freevideoChange && !this.__freevideoProved ? proof() : ''; + if (value) { try { header.call(this, HEADER, value); } catch { /* already sent */ } } + return send.call(this, body); + }; + XHR.open.freevideoProof = XHR.send.freevideoProof = XHR.setRequestHeader.freevideoProof = true; + XHR.open.freevideoNative = open; XHR.send.freevideoNative = send; XHR.setRequestHeader.freevideoNative = header; +})(); +""" +PROOF_TAG = b'' + + +def inject_proof(html): + """ComfyUI's page with the proof script first in its head (unchanged when it has no head).""" + match = re.search(rb']*)?>', html, re.IGNORECASE) + return html if match is None else html[:match.end()] + PROOF_TAG + html[match.end():] + + # Hop-by-hop headers belong to one connection; Content-Length follows the body actually sent. HOP_BY_HOP = frozenset(('connection', 'keep-alive', 'proxy-authenticate', 'proxy-authorization', 'proxy-connection', 'te', 'trailer', 'transfer-encoding', 'upgrade', 'content-length')) @@ -176,7 +286,7 @@ def forwarded(request): continue if lower == 'cookie': value = '; '.join(part for part in value.split(';') if part.strip() and - part.split('=', 1)[0].strip() not in (COOKIE, DEVICE_COOKIE)) + part.split('=', 1)[0].strip() not in (COOKIE, DEVICE_COOKIE, PROOF_COOKIE)) if not value: continue headers.append((name, value)) @@ -188,13 +298,22 @@ def create(upstream, token, engine=None): sockets = 'ws' + upstream[len('http'):] client = [] hop_secret = os.environ.pop(proxy_identity.ENV, '') + # The device proofs this proxy gives and checks: the hop secret, or one of its own when none was configured (the + # services behind it then trust nothing from it, and a browser still proves its changes here). + proof_secret = hop_secret or secrets.token_hex(32) auth = PasswordAuth(engine) login_lock = asyncio.Lock() def browser_headers(response, request): device = request.get('lan_device') if device and request.path in ('/m/', '/m/csrf'): - response.headers['X-FreeVideo-CSRF'] = proxy_identity.csrf(hop_secret, device) + response.headers['X-FreeVideo-CSRF'] = proxy_identity.csrf(proof_secret, device) + if device: + # The signed-in page reads its proof here (web/proxy_proof.js), with no request of its own; this proxy never + # takes the cookie as a proof, and other websites can neither read it nor have it sent. + value = proxy_identity.csrf(proof_secret, device) + if request.cookies.get(PROOF_COOKIE) != value: + response.set_cookie(PROOF_COOKIE, value, httponly=False, samesite='Strict', secure=request.secure, path='/') session = request.get('lan_session') if session and session['remember']: response.set_cookie(DEVICE_COOKIE, request.cookies[DEVICE_COOKIE], max_age=REMEMBER_SECONDS, @@ -264,10 +383,22 @@ async def cleanup(app): await client[0].close() async def forward(request): - body = request.content if request.body_exists else None + body = request.get('body', request.content if request.body_exists else None) + # ComfyUI's page for a signed-in browser gets the proof script first (inject_proof): asked for uncompressed. + page = request.method == 'GET' and bool(request.get('lan_device')) and request.path in ('/', '/index.html') + headers = [(name, value) for name, value in forwarding_headers(request) if not (page and name.lower() == 'accept-encoding')] + if page: + headers.append(('Accept-Encoding', 'identity')) # the client would otherwise ask for a compressed answer itself try: async with client[0].request(request.method, URL(upstream + request.raw_path, encoded=True), - headers=forwarding_headers(request), data=body, allow_redirects=False) as reply: + headers=headers, data=body, allow_redirects=False) as reply: + if page and reply.status == 200 and reply.content_type == 'text/html' and not reply.headers.get('Content-Encoding'): + response = web.Response(status=200, body=inject_proof(await reply.read())) + for name, value in reply.headers.items(): + if name.lower() not in HOP_BY_HOP and name.lower() not in ('content-length', 'etag', 'last-modified'): + response.headers.add(name, value) + response.headers['Cache-Control'] = 'no-store' + return browser_headers(response, request) response = web.StreamResponse(status=reply.status, reason=reply.reason) for name, value in reply.headers.items(): if name.lower() not in HOP_BY_HOP: @@ -353,11 +484,20 @@ async def handle(request): rest = [(k, v) for k, v in request.rel_url.query.items() if k != 'token'] location = request.path + ('?' + urlencode(rest) if rest else '') return browser_headers(web.Response(status=303, headers={'Location': location}), request) + refused = await needs_proof(request, proof_secret) + if refused == 'too_large': + return browser_headers(web.json_response(dict(error=dict(code='request_too_large', message=FORM_TOO_LARGE)), + status=413, headers={'Cache-Control': 'no-store'}), request) + if refused: + return browser_headers(web.json_response(dict(error=dict(code='page_session_required', message=PROOF_MISSING)), + status=403, headers={'Cache-Control': 'no-store'}), request) if request.path.startswith('/m/') and request.path != LOGIN_PATH and request.method in ('GET', 'HEAD'): if not request.get('lan_device'): return web.Response(status=403) if request.path == '/m/csrf': - response = web.json_response(dict(csrf=proxy_identity.csrf(hop_secret, request['lan_device']))) + response = web.json_response(dict(csrf=proxy_identity.csrf(proof_secret, request['lan_device']))) + elif request.path == PROOF_SCRIPT_PATH: + response = web.Response(text=PAGE_PROOF_SCRIPT if request.method == 'GET' else '', content_type='text/javascript', charset='utf-8') elif request.path == '/m/': response = web.Response(text=PHONE_PAGE if request.method == 'GET' else '', content_type='text/html', charset='utf-8') else: diff --git a/freevideo_engine/agent/cast.py b/freevideo_engine/agent/cast.py index 076f0393..2fc1c8b3 100644 --- a/freevideo_engine/agent/cast.py +++ b/freevideo_engine/agent/cast.py @@ -47,16 +47,18 @@ SCENE = dict(aspect='16:9', seconds=6) PROP = dict(aspect='1:1', seconds=4) -# The sheet of every view a shot carries for each person, put together here from the card's own pictures: up to six -# equal cells (three to a row) on a light grey ground, each picture scaled whole and centred, no text. -SHEET_VERSION = 1 -SHEET_ORDER = ('front', 'three_quarter', 'side', 'back', 'face') # then any other label, in card order -SHEET_CELL = (736, 828) +# The sheet of every view a shot carries for each person, put together here from the card's own pictures, as the +# new-character dialog draws its own (web/cast_photo.js SHEET): one row of four cells of one height on a light grey ground, +# the first cell (the face close-up) 1.4 times as wide as the other three (front, side, back), no text (compose_sheet says +# how each picture fits its cell). A card with fewer pictures keeps the same size; the cells it has no picture for stay ground. +SHEET_VERSION = 2 +SHEET_ORDER = ('face', 'front', 'side', 'back', 'three_quarter') # then any other label, in card order +SHEET_CELLS = ((1030, 1302), (736, 1302), (736, 1302), (736, 1302)) SHEET_GAP = 48 SHEET_GROUND = (238, 238, 238) -SHEET_COLUMNS = 3 -SHEET_MAX = 6 -SHEET_SIZE = (SHEET_COLUMNS * SHEET_CELL[0] + (SHEET_COLUMNS + 1) * SHEET_GAP, 2 * SHEET_CELL[1] + 3 * SHEET_GAP) # 2400 x 1800 +SHEET_MAX = len(SHEET_CELLS) +SHEET_FILL = .03 # how far a picture's shape may differ from its cell's and still fill it (a 4:5 close-up in the face cell) +SHEET_SIZE = (sum(width for width, _ in SHEET_CELLS) + (SHEET_MAX + 1) * SHEET_GAP, SHEET_CELLS[0][1] + 2 * SHEET_GAP) # 3478 x 1398 _SHEETS_SEEN = set() @@ -1165,14 +1167,17 @@ def _sheet_intact(path): def compose_sheet(pictures, out): - """Write one PNG of these pictures (two to six, as file bytes or paths): always three columns by two rows of - equal cells, a light grey ground (cells with no picture stay empty), each picture scaled whole to fit its cell - and centred, nothing cropped, no text.""" + """Write one PNG of these pictures (two to four, as file bytes or paths), in the given order: always one row of the + four cells of SHEET_CELLS (the first one wider), a light grey ground (cells with no picture stay empty), no text. + A picture of about its cell's shape (within SHEET_FILL, as the views made for a card are) fills the cell, so the four + share their top and bottom edges, the few pixels over trimmed evenly from its sides; any other picture is scaled + whole to fit its cell and centred, nothing cropped.""" import io from PIL import Image, ImageOps - (width, height), gap = SHEET_CELL, SHEET_GAP + gap = SHEET_GAP sheet = Image.new('RGB', SHEET_SIZE, SHEET_GROUND) - for index, source in enumerate(pictures[:SHEET_MAX]): + left = gap + for (width, height), source in zip(SHEET_CELLS, pictures): with Image.open(io.BytesIO(source) if isinstance(source, bytes) else source) as opened: picture = ImageOps.exif_transpose(opened) if picture.mode in ('RGBA', 'LA', 'P'): @@ -1180,10 +1185,12 @@ def compose_sheet(pictures, out): picture = picture.convert('RGBA') flat.paste(picture, mask=picture.getchannel('A')) picture = flat - picture = ImageOps.contain(picture.convert('RGB'), (width, height), Image.LANCZOS) - row, column = divmod(index, SHEET_COLUMNS) - sheet.paste(picture, (gap + column * (width + gap) + (width - picture.width) // 2, - gap + row * (height + gap) + (height - picture.height) // 2)) + picture = picture.convert('RGB') + shape = (picture.width / picture.height) / (width / height) + picture = (ImageOps.fit(picture, (width, height), Image.LANCZOS) if abs(shape - 1) <= SHEET_FILL + else ImageOps.contain(picture, (width, height), Image.LANCZOS)) + sheet.paste(picture, (left + (width - picture.width) // 2, gap + (height - picture.height) // 2)) + left += width + gap sheet.save(out, format='PNG') diff --git a/freevideo_engine/bootstrap.py b/freevideo_engine/bootstrap.py index d7eff1f5..493d7722 100644 --- a/freevideo_engine/bootstrap.py +++ b/freevideo_engine/bootstrap.py @@ -805,6 +805,13 @@ def plan(args, *, local_progress=None, stage=None): directories = ([str(local_folder)] if local_folder else []) + libraries['roots'] from .local_models import library_roots directories = library_roots(library_roots(directories) + saved_libraries, keep_first=True) + # Folders the person chose to skip for this check (one held too much to check), saved ones included. + skipped = libraries.get('skip', []) + if not isinstance(skipped, list) or any(not isinstance(path, str) for path in skipped): + raise ValueError('Invalid model library manifest') + if skipped: + left_out = set(library_roots(skipped, skip_missing=True)) + directories = [path for path in directories if path not in left_out] scan_library = lambda: scan_many(directories, needed, prior=previous_reuse, callback=local_progress) elif saved_libraries: from .local_models import library_roots diff --git a/freevideo_engine/checkpoint_files.py b/freevideo_engine/checkpoint_files.py new file mode 100644 index 00000000..64b77081 --- /dev/null +++ b/freevideo_engine/checkpoint_files.py @@ -0,0 +1,29 @@ +"""The weight files a model folder's checkpoint consists of. Standard library only.""" +import json +from pathlib import Path + +INDEX = 'diffusion_pytorch_model.safetensors.index.json' +SINGLE = 'diffusion_pytorch_model.safetensors' + + +def checkpoint_files(directory): + """The .safetensors files of the checkpoint in `directory`, sorted. + + With an index, the files its weight_map names that are present; otherwise the single file of the conventional + name. Any other .safetensors file in the folder (a copy, another model's weights) is not part of the checkpoint + and is never read: one such file made every load fail, and no check of the listed files could see it. A folder + with neither keeps every .safetensors file, as before. + """ + directory = Path(directory) + index = directory / INDEX + if index.is_file(): + weight_map = json.loads(index.read_text(encoding='utf-8')).get('weight_map') + names = set(weight_map.values()) if isinstance(weight_map, dict) else set() + if not names or not all(isinstance(name, str) and name.endswith('.safetensors') and Path(name).name == name + for name in names): + raise ValueError('The checkpoint index does not list its weight files: ' + str(index)) + return [directory / name for name in sorted(names) if (directory / name).is_file()] + single = directory / SINGLE + if single.is_file(): + return [single] + return sorted(directory.glob('*.safetensors')) diff --git a/freevideo_engine/cold_pages.py b/freevideo_engine/cold_pages.py index f1f9694c..29a41e8e 100644 --- a/freevideo_engine/cold_pages.py +++ b/freevideo_engine/cold_pages.py @@ -15,6 +15,7 @@ import shutil import subprocess import time +from .checkpoint_files import checkpoint_files from freevideo_engine.locking import runtime_lock from freevideo_engine.paths import base_path @@ -78,8 +79,8 @@ def main(): if args.cache is None: parser.error('--cache or --model-files is required') paths = list(args.cache.rglob('*.safetensors')) - paths += list((args.base / 'vae').glob('*.safetensors')) - paths += list((args.base / 'audio_vae').glob('*.safetensors')) + paths += checkpoint_files(args.base / 'vae') + paths += checkpoint_files(args.base / 'audio_vae') if args.encoder: paths.append(args.encoder) paths = sorted({p.resolve() for p in paths}) diff --git a/freevideo_engine/comfy_launcher_runtime.py b/freevideo_engine/comfy_launcher_runtime.py index bbe4b018..8131411e 100644 --- a/freevideo_engine/comfy_launcher_runtime.py +++ b/freevideo_engine/comfy_launcher_runtime.py @@ -1265,6 +1265,7 @@ def _inspect(self, values): # package) has nothing to reuse; it must not stop the installation. extra = [p for p in dict.fromkeys(extra) if p.strip() and io_path(Path(p).expanduser()).is_dir()] self.setup.inspect(dict(root=str(engine), extra_libraries=extra, copy=False, + skip_libraries=[p for p in values.get('skip_libraries') or [] if isinstance(p, str)], sampling_caches=bool(values.get('sampling_caches')), prepared_format=values.get('prepared_format'), **({'download_list': True} if checked else {}), **({'only': 'image'} if values.get('only') == 'image' else {}), frontend=dict(root=descriptor['root'], separate=descriptor['separate'], download=fresh, diff --git a/freevideo_engine/comfy_nodes.py b/freevideo_engine/comfy_nodes.py index b0c1ee82..e5cdb77e 100644 --- a/freevideo_engine/comfy_nodes.py +++ b/freevideo_engine/comfy_nodes.py @@ -114,6 +114,15 @@ def fast_mode_option(value): UPSCALE_OPTIONS = ('2', '1.5', '1.2') # two_pass.SCALES as the widget shows them +def interrupted(): + """Whether ComfyUI was asked to cancel the running prompt.""" + try: + import comfy.model_management + return bool(comfy.model_management.processing_interrupted()) + except Exception: + return False + + def upscale_option(value): """Bridge keyword for the Upscale factor widget; 2, a value that is not an option, or a workflow without the widget adds nothing. Workflows saved before it existed hold '' in its position.""" @@ -319,15 +328,35 @@ def execute(cls, text, width, height, seconds, seed, first=None, last=None, from .background_compile import COMPILE from . import video_warm # Returns once the idle compile released the GPU and the engine lease; a lease the warm-up holds is not waited - # for, as the warm-up is stopped just below. + # for, as the warm-up is stopped (or joined) just below. COMPILE.stop(final=True, lease_held=video_warm.lease_held) - # A warm-up for this video gives the lease back; the worker and the encoder it placed stay for the video. - video_warm.stop() + # A warm-up for this video gives the lease back; the worker and the encoder it placed stay for the video. A + # plain text-to-video request waits instead for a preload of its own video model under way. The fastest mode + # builds its engine with an adapter and no video decoder, never the model a plain preload holds: it does not wait. + # Total frames alone (the creation panel and the Agent API send it with every video) still makes a plain request; + # continuing another video does not. + plain = not any((first, last, references, loras, conditioning, media, refine_from, upscale_from, + any(value for name, value in options.items() if name != 'frames'), + chain is not None and chain.get('count', 1) > 1, preview, hide_tail, frames_upscale, + first_frame_reference, voice_reference, fast_mode_option(fast_mode))) + from .comfy_progress import publish + loading = [] + + def waiting(): + # The page shows the existing model-loading stage while the video waits for the preload; it starts this + # request, so the later steps continue it without resetting (and stay so if the video loads the model itself). + loading.append(True) + publish(PromptServer.instance, node_id, {'label': 'Loading the model', 'phase': 'load', 'timing_phase': 'load', + 'new_request': True}) + video_warm.stop(join=video_warm.request_geometry( + width, height, seconds, two_pass=two_pass, base_steps=base_steps, refine_steps=refine_steps, + scale=upscale_option(upscale_factor).get('upscale_factor', 2), + frames=options.get('frames')) if plain else None, + cancelled=interrupted, on_wait=waiting) from .comfy_media import continued, export import folder_paths import comfy.model_management as memory from comfy.utils import ProgressBar - from .comfy_progress import publish from .encoder_prewarm import IDLE from .resident_process import OWNER from .prompt_vlm.service import stop_prestart_for_generation @@ -458,7 +487,7 @@ def kept(exported): logging.info('[FreeVideo] %s', line) if notes and PromptServer.instance is not None: PromptServer.instance.send_progress_text(said().rstrip('\n'), node_id) - publish(PromptServer.instance, node_id, {'label': 'Preparing video', 'new_request': True}) + publish(PromptServer.instance, node_id, dict(label='Preparing video', **({} if loading else {'new_request': True}))) try: output = comfy_bridge.generate(text, width, height, seconds, seed, output_root, metadata=metadata.get('workflow', metadata), progress=progress, two_pass=two_pass, diff --git a/freevideo_engine/comfy_setup.py b/freevideo_engine/comfy_setup.py index a148e309..ce891ffe 100644 --- a/freevideo_engine/comfy_setup.py +++ b/freevideo_engine/comfy_setup.py @@ -313,15 +313,23 @@ def inspect(self, value): raise ValueError('FreeVideo setup is already running') root = self.validate_root(value.get('root')) extra = value.get('extra_libraries', []) - if not isinstance(extra, list) or not isinstance(value.get('copy', False), bool): + skipped = value.get('skip_libraries', []) + if (not isinstance(extra, list) or not isinstance(value.get('copy', False), bool) or not isinstance(skipped, list) + or any(not isinstance(path, str) for path in skipped)): raise ValueError('Invalid setup choices') # Folders the user chose are validated and kept first; folders found - # automatically fill the remaining places. + # automatically fill the remaining places. A folder the person chose to skip (it held too much to check) is + # left out of this check only; nothing is saved. chosen = library_roots(extra, skip_missing=True) libraries = library_roots(chosen + discover_libraries(self.folder_paths), keep_first=True) + if skipped: + left_out = set(library_roots(skipped, skip_missing=True)) + libraries = [path for path in libraries if path not in left_out] io_path(self.logs).mkdir(parents=True, exist_ok=True) manifest = self.logs / ('libraries-' + uuid.uuid4().hex + '.json') - save(manifest, dict(version=1, roots=libraries)) + # The plan worker adds the saved model folders itself, so the folders to skip travel in the manifest too; the + # installation that follows this check runs with the same manifest. + save(manifest, dict(version=1, roots=libraries, **({'skip': skipped} if skipped else {}))) # A download that cannot resume (for example a Xet partial) starts again # instead of pausing every retry; the old partial is set aside. arguments = ['setup', '--reuse-models-manifest', str(manifest), '--allow-model-restart'] @@ -386,6 +394,9 @@ def calibrate(self, value): polls, and it refuses to start beside queued generation work rather than competing with it for the card. """ + if sys.platform == 'darwin': + # The sweep measures NVIDIA cards; a Mac generates through its own backend and has nothing to measure here. + raise ValueError('Needs an NVIDIA graphics card') state = self.status() # Order matters: a machine with no installation cannot calibrate no # matter how idle the worker is, and being told to wait for a task it diff --git a/freevideo_engine/decode.py b/freevideo_engine/decode.py index 114f1672..c51a0350 100644 --- a/freevideo_engine/decode.py +++ b/freevideo_engine/decode.py @@ -6,6 +6,7 @@ import torch +from .checkpoint_files import checkpoint_files from .offload import LayerOffloader, pin_layer_weights from .vae_tiles import TileDecoder, compile_blocks @@ -89,7 +90,7 @@ def room(): from .system import memory_sample used = memory_sample(ProcessMemory().sample(os.getpid())) return ram_budget_bytes - used if type(used) is int and used >= 0 else None - weight_source = SafetensorLayers((Path(base)/'vae').glob('*.safetensors'), + weight_source = SafetensorLayers(checkpoint_files(Path(base) / 'vae'), [f'decoder.transformer_blocks.{index}.' for index in range(count, layers)], intermediate_dtype=torch.float32 if linear_compute_cache else None, keep_converted=True, converted_room=room, @@ -141,7 +142,7 @@ def room(): # buffers, avoiding small random page faults in the offload thread. read_started = time.perf_counter() buffer = bytearray(8 * 1024 * 1024) - for path in sorted((Path(base) / 'vae').glob('*.safetensors')): + for path in checkpoint_files(Path(base) / 'vae'): with path.open('rb', buffering=0) as stream: while stream.readinto(buffer): pass diff --git a/freevideo_engine/decode_prefetch.py b/freevideo_engine/decode_prefetch.py index 1fbeb573..85114785 100644 --- a/freevideo_engine/decode_prefetch.py +++ b/freevideo_engine/decode_prefetch.py @@ -24,6 +24,7 @@ from pathlib import Path import threading import time +from .checkpoint_files import checkpoint_files from .encoder_prewarm import CHUNK, GiB, available_memory as host_available_memory, cgroup_memory @@ -50,7 +51,7 @@ def available_memory(): def decoder_ranges(base): plans = [] - for path in sorted((Path(base) / 'vae').glob('*.safetensors')): + for path in checkpoint_files(Path(base) / 'vae'): size = path.stat().st_size with path.open('rb') as file: length = int.from_bytes(file.read(8), 'little') diff --git a/freevideo_engine/diagnostic_resources.py b/freevideo_engine/diagnostic_resources.py index 66f22c54..26aae8ce 100644 --- a/freevideo_engine/diagnostic_resources.py +++ b/freevideo_engine/diagnostic_resources.py @@ -105,7 +105,8 @@ def checkpoint_change(value): if value.get('source') in ('path', 'handle'): result['source'] = value['source'] fields = value.get('fields', ()) - result['fields'] = [field for field in ('st_dev', 'st_ino', 'st_size', 'st_mtime_ns', 'st_ctime_ns') + # content_sample: only the metadata change time moved, and the shard's header or sampled blocks no longer match. + result['fields'] = [field for field in ('st_dev', 'st_ino', 'st_size', 'st_mtime_ns', 'st_ctime_ns', 'content_sample') if field in sequence(fields)] return result diff --git a/freevideo_engine/download_settings.py b/freevideo_engine/download_settings.py index d9e4b83b..755af185 100644 --- a/freevideo_engine/download_settings.py +++ b/freevideo_engine/download_settings.py @@ -20,6 +20,10 @@ '测速超时,网络可能较慢。请再点击“测速”。'), 'other': ('The speed test did not finish. Click "Test speed" again.', '测速未完成,请再点击“测速”。'), } +# Reason 'denied': the result could not be written because the installation folder is closed to this account. Testing +# again does not help, so it says what to do instead, in the installation folder failure card's words. +SPEED_TEST_DENIED = ('Windows does not let this account create folders in this location. Choose a folder in the user folder or on another drive.', + 'Windows 不允许当前账户在这个位置创建文件夹。请改选用户文件夹或其他硬盘上的文件夹。') def speed_test_reason(error): @@ -197,10 +201,13 @@ def progress(value): save(root/'download-settings.json',value) self.state=dict(status='complete',root=str(root),**result) except Exception as error: + from .denied_access import engine_folder_error + # Where the result cannot be written, trying again does not help: the folder is closed to this account. + reason='denied' if engine_folder_error(error,root) is not None else speed_test_reason(error) with self.lock: # Provider exceptions can contain request headers/URLs. self.state=dict(status='failed',root=str(root), - error=SPEED_TEST_FAILED,reason=speed_test_reason(error)) + error=SPEED_TEST_FAILED,reason=reason) self.thread=threading.Thread(target=work,daemon=True) self.thread.start() return dict(self.state) diff --git a/freevideo_engine/engine_preload.py b/freevideo_engine/engine_preload.py index 99a75596..67d8a247 100644 --- a/freevideo_engine/engine_preload.py +++ b/freevideo_engine/engine_preload.py @@ -4,7 +4,7 @@ the card: the first video after any of them still loaded the video model itself. Now the settings that decide whether a loaded video model can serve a request (``ModelBank.engine_parts``: the model pack and LoRAs, the size and length, the execution options the planner chose) are kept from the last successful video, and the warm-up loads the video -model with them into the resident worker, once the encoder is in place: +model with them into the resident worker, before the encoder when a video was used last and after it otherwise: - only into room that is free: the card holds the model beside everything on it now, and host memory holds the weights it keeps there beside the next encoder's start, as after a video (``ModelBank.settle``); nothing else is diff --git a/freevideo_engine/failure_details.py b/freevideo_engine/failure_details.py index bb94e00a..b1a5b2e7 100644 --- a/freevideo_engine/failure_details.py +++ b/freevideo_engine/failure_details.py @@ -2,6 +2,7 @@ import json import errno from pathlib import Path +import os import re import sys @@ -693,6 +694,19 @@ def _model_unchanged(tail): # Windows refused to load a file (Smart App Control or another application control policy). APPLICATION_CONTROL = r'WinError 4551|Application Control policy has blocked' +# What happened, what can be done, and what turning it off costs: one line each, as the launcher looks each line up. +# Facts only; the card does not advise turning it off. +APPLICATION_CONTROL_LINES = ( + ('Smart App Control in Windows blocked files that FreeVideo needs, so FreeVideo cannot run on this computer.', + 'Windows 的“智能应用控制”拦截了 FreeVideo 需要的文件,FreeVideo 无法在这台电脑上运行。'), + ('Smart App Control cannot make an exception for one program. FreeVideo can run only if it is turned off: ' + 'search Windows for "Smart App Control" and open its settings.', + '智能应用控制不能为单个程序设置例外。只有关闭它,FreeVideo 才能运行:在 Windows 搜索中输入“智能应用控制”,打开它的设置。'), + ("Turning it off lowers Windows' protection against unknown programs. On some versions of Windows, " + 'it can be turned on again only by resetting Windows.', + '关闭后,Windows 对未知程序的防护会降低;在部分 Windows 版本上,关闭后只有重置 Windows 才能重新打开。'), +) +APPLICATION_CONTROL_ACTION = tuple('\n'.join(line[zh] for line in APPLICATION_CONTROL_LINES) for zh in (0, 1)) # vc_runtime.require() before the first import of torch, or torch's own error when c10.dll could not be loaded or did not # initialize (Windows error 126 or 1114), or torch_python.dll could not be loaded (126). c10.dll needs only the Visual C++ @@ -707,6 +721,28 @@ def _model_unchanged(tail): # The card's "Download runtime" key opens Microsoft's page (Main.qml, vcRuntimeLink); the person installs it there. VC_RUNTIME_NEXT = ('Choose "Download runtime", download and install the {arch} version from the Microsoft page, then choose "Retry installation".', '请点击“下载运行库”,在微软页面下载并安装 {arch} 版本,然后点击“重试安装”。') +# local_models.CrowdedFolder: a model folder held too many files, or too many possible models, to check one by one. The +# folder is filled in after the sentence is translated ({folder}); a folder the person added under "Reuse models" on the +# launcher's Models page can also be removed there. +MODEL_FOLDER_CROWDED = r'^\[MODEL_FOLDER_CROWDED\] (.+)$' +MODEL_FOLDER_CROWDED_TITLE = ('Too many files to check in a model folder', '模型文件夹中的文件太多,无法检查') +MODEL_FOLDER_CROWDED_REUSED = ( + '"{folder}" holds too many files that could be models for FreeVideo to check one by one. Skip this folder and ' + 'download the models instead, or remove it from "Reuse models" on the Models page.', + '“{folder}”里可能是模型的文件太多,FreeVideo 无法逐个核对。可以跳过这个文件夹、改为下载需要的模型,或在“模型”页的“复用已有模型”里把它移除。') +MODEL_FOLDER_CROWDED_FOUND = ( + '"{folder}" holds too many files that could be models for FreeVideo to check one by one. Skip this folder and ' + 'download the models instead.', + '“{folder}”里可能是模型的文件太多,FreeVideo 无法逐个核对。可以跳过这个文件夹,改为下载需要的模型。') +# With offline packages nothing is downloaded: the folder is removed from "Reuse models", or a package's own folder tidied. +MODEL_FOLDER_CROWDED_OFFLINE_REUSED = ( + '"{folder}" holds too many files that could be models for FreeVideo to check one by one. Offline packages cannot ' + 'download the models instead, so remove this folder from "Reuse models" on the Models page.', + '“{folder}”里可能是模型的文件太多,FreeVideo 无法逐个核对。使用离线包时不能改为下载,请在“模型”页的“复用已有模型”里把它移除。') +MODEL_FOLDER_CROWDED_OFFLINE_PACKAGE = ( + '"{folder}" holds too many files that could be models for FreeVideo to check one by one. Move the files that are ' + 'not models out of this folder, then try again.', + '“{folder}”里可能是模型的文件太多,FreeVideo 无法逐个核对。请把不是模型的文件移出这个文件夹,然后重试。') VC_RUNTIME_FILES = ('Not loaded: %s', '未能加载:%s') VC_RUNTIME_FILE = ('%s (Windows error %s)', '%s(Windows 错误 %s)') VC_RUNTIME_JOIN = ('; ', ';') @@ -1091,7 +1127,7 @@ def launcher_failure(value, *, zh=False, **options): def _launcher_failure(value, *, zh=False, other_disk=False, disk_name='', can_repair=False, repairs_comfy=False, - unavailable='none', model_package='', exception=None, launch=False, check=False): + unavailable='none', model_package='', exception=None, launch=False, check=False, reuse_folders=(), crowded_folder='', offline=False): """Short guidance for known failures; callers retain the full error separately. other_disk: the launcher can offer another disk with enough room (macOS). @@ -1103,6 +1139,10 @@ def _launcher_failure(value, *, zh=False, other_disk=False, disk_name='', can_re class names and errno, no text), when the message is that exception's str(); it tells an unexpected failure from a message the launcher wrote itself. launch: the failure is of starting FreeVideo, whose button is "Retry launch" (LAUNCH_ACTIONS). + reuse_folders: the folders the person added under "Reuse models" on the Models page; one of them that held too much to + check can be removed there. + crowded_folder: that folder as the unredacted error names it; the card shows it whole (the text handed in is redacted). + offline: the failure is of preparing offline packages, which download nothing: the folder cannot be skipped there. """ if not value: return dict(title='', detail='', action='', kind='') @@ -1114,6 +1154,17 @@ class names and errno, no text), when the message is that exception's str(); it cause = re.sub(r'^(?:[A-Za-z_][\w.]*(?:Error|Exception)):\s*', '', causes[index]) if len(causes) > index else '' if cause == ENGINE_BUSY: return dict(title=ENGINE_BUSY_TITLE[zh], detail=ENGINE_BUSY_DETAIL[zh], action='', kind='engine-busy') + crowded = re.search(MODEL_FOLDER_CROWDED, text, re.M) + if crowded: + folder = crowded_folder or crowded.group(1).strip() + same = lambda path: os.path.normcase(os.path.normpath(str(path))) + removable = same(folder) in {same(path) for path in reuse_folders or ()} + if offline: + detail = MODEL_FOLDER_CROWDED_OFFLINE_REUSED if removable else MODEL_FOLDER_CROWDED_OFFLINE_PACKAGE + else: + detail = MODEL_FOLDER_CROWDED_REUSED if removable else MODEL_FOLDER_CROWDED_FOUND + return dict(title=MODEL_FOLDER_CROWDED_TITLE[zh], kind='model-folder-crowded', folder=folder, removable=removable, + offline=bool(offline), detail=detail[zh], action='') from .offline_errors import alias_failure, guidance if alias_failure(text): return dict(title=guidance('title', zh), detail=guidance('runtime-alias', zh), @@ -1481,11 +1532,10 @@ class names and errno, no text), when the message is that exception's str(); it 'Controlled folder access, and the exclusions list), then click Retry installation.', '安全软件或 Windows 的保护功能拦截了 FreeVideo 运行环境中的 Python 文件。请在其中允许 FreeVideo 所在的文件夹' '(Windows 安全中心:病毒和威胁防护 → 管理勒索软件防护 → 受控文件夹访问,以及排除项),然后点“重试安装”。')), - # Windows refuses PyTorch's unsigned DLLs under Smart App Control; reinstalling changes nothing. + # Windows refuses unsigned files under Smart App Control: PyTorch's DLLs, or the loader files Triton builds on + # this computer. Reinstalling changes nothing, and it has no exception for one program. (APPLICATION_CONTROL, 'app-control', - ('Windows blocked some runtime files', 'Windows 拦截了运行组件'), - ('Smart App Control in Windows blocked these files. Search Windows for "Smart App Control", or open Windows Security → App & browser control → Smart App Control settings.', - 'Windows 的“智能应用控制”拦截了这些文件。在 Windows 中搜索“智能应用控制”,或打开“Windows 安全中心 → 应用和浏览器控制 → 智能应用控制设置”。')), + ('Windows blocked some runtime files', 'Windows 拦截了运行组件'), APPLICATION_CONTROL_ACTION), (r'PermissionError|Access is denied|Permission denied|WinError 5\b|os error 5\b', 'permission', ('Access denied', '访问被拒绝'), ('Choose an installation folder you can write to, then retry.', '选择有写入权限的安装目录后重试。')), diff --git a/freevideo_engine/idle_encoder.py b/freevideo_engine/idle_encoder.py index 8eea26ee..ab154f61 100644 --- a/freevideo_engine/idle_encoder.py +++ b/freevideo_engine/idle_encoder.py @@ -243,11 +243,12 @@ def work(): def watch(endpoint, worker_request, environment, descriptor, result_path, cancelled, ram_budget_bytes, result, memory, *, started=None, held=None, stop=None, module='freevideo_engine.encode_worker', - capability='encoder-weight-preload'): + capability='encoder-weight-preload', progress=None): """Run one weights-only request in the resident worker under ``descriptor`` and watch it until it ends; the worker is appended to ``held`` as soon as it exists, so the caller can stop it. ``stop`` (an event) cancels it like the cancel file. ``module`` and ``capability``: the encoder's placement, or the video model's preload - (freevideo_engine.worker, 'engine-preload'). + (freevideo_engine.worker, 'engine-preload'). ``progress``, when given, is called with each memory sample of the + worker and its process id (the video model's preload tells a video that waits for it whether it still moves). Every speculative request in the resident worker is watched here, so this is the one place that decides how long a cancelled request has to yield: KEPT_YIELD_SECONDS while the worker keeps video models, else YIELD_SECONDS, and @@ -270,6 +271,8 @@ def watch(endpoint, worker_request, environment, descriptor, result_path, cancel while worker.poll() is None: sample = memory.sample(worker.pid) used = inference_memory_sample(sample) + if progress is not None: + progress(sample, worker.pid) if used is None or used > ram_budget_bytes or inference_headroom(sample) < (2 if windows() else 1)*2**30: cancelled.touch(exist_ok=True) result.update(state='released', reason='Live RAM pressure interrupted speculative loading') diff --git a/freevideo_engine/image_gen/cast_views.py b/freevideo_engine/image_gen/cast_views.py index 359f0d66..d689c32d 100644 --- a/freevideo_engine/image_gen/cast_views.py +++ b/freevideo_engine/image_gen/cast_views.py @@ -7,16 +7,17 @@ import re -VIEWS = ('front', 'three_quarter', 'side', 'back', 'face') +# A character's four views, as on the new-character dialog's 1 x 4 sheet (face close-up | front | side | back); the front +# is made first, from the description or a photo, and the other three are edits of it. +VIEWS = ('front', 'face', 'side', 'back') SETTING_VIEWS = ('scene',) PROP_VIEWS = ('prop',) SIZES = { 'front': (832, 1472), - 'three_quarter': (832, 1472), 'side': (832, 1472), 'back': (832, 1472), - 'face': (1024, 1024), + 'face': (1024, 1280), # 4:5, the sheet's face cell (about 1.4 times as wide as a full-body one) 'scene': (1344, 768), 'prop': (1024, 1024), } @@ -26,9 +27,6 @@ 'feet visible, plain light grey background, soft even light. One photograph of one person.') _VIEW_TEXT = { - 'three_quarter': ('Turn the person in image 1 toward the left side of the picture by 45 degrees. ' - 'Turn the head and body together. Show the front-left three-quarter view, ' - 'with both eyes visible.'), 'side': ('将图1中的同一个人完全转向画面左边,呈现90度正侧面。鼻尖、胸口、脚尖朝向画面左边,' '只能看见一只眼睛,近侧肩膀遮住远侧肩膀。'), 'back': ('将图1中的同一个人整个身体转过180度,完全背对镜头。' diff --git a/freevideo_engine/launcher/Main.qml b/freevideo_engine/launcher/Main.qml index e698e0f9..538ed531 100644 --- a/freevideo_engine/launcher/Main.qml +++ b/freevideo_engine/launcher/Main.qml @@ -214,6 +214,10 @@ ApplicationWindow { // A card whose way out is the user's own step (open a newer launcher, move a file) marks itself manual: // retrying first cannot help, so it is not the primary action. readonly property bool manualFailure: !!s.retry_kind && s.failure.manual === true + // The crowded model folder card's own button leads; the footer's retry stays, as a secondary button, for after the folder + // was removed. A package's own folder offline has no button on the card: there the footer's retry leads. + readonly property bool crowdedFolderCard: s.failure.kind === "model-folder-crowded" && (!s.failure.offline || !!s.failure.removable) + readonly property bool crowdedFolderNoButtons: s.failure.kind === "model-folder-crowded" && !!s.failure.offline && !s.failure.removable readonly property bool updateStartRefused: s.failure.kind === "update-start-blocked" && ["threat", "policy", "smart-app-control"].indexOf(s.failure.reason) >= 0 readonly property bool updateFirst: s.page === "launcher" && s.update.engine && !s.update.phase && !s.busy && s.status !== "open" && s.status !== "restart-required" && !s.needs_consent && !s.repair_offered function percent(row) { return row && row.total ? Math.floor(100 * row.done / row.total) + "%" : "" } @@ -606,7 +610,14 @@ ApplicationWindow { ColumnLayout { id: failureBody; x: 18; y: 18; width: parent.width - 36; spacing: 10 FText { text: holdNames(s.failure.title) || t("Couldn’t complete this step", "暂时未能完成"); color: theme.danger; font.weight: Font.DemiBold; Layout.fillWidth: true } - FText { visible: !!(s.failure.detail || s.failure.action); text: holdNames(s.failure.detail || s.failure.action); color: theme.text; Layout.fillWidth: true } + // One paragraph per line, 8 px apart, so what happened, what to do and what it costs read apart. + ColumnLayout { + objectName: "failureParagraphs"; visible: !!(s.failure.detail || s.failure.action); Layout.fillWidth: true; spacing: 8 + Repeater { + model: String(s.failure.detail || s.failure.action || "").split("\n").filter(line => line.trim().length > 0) + FText { text: holdNames(modelData); color: theme.text; Layout.fillWidth: true } + } + } FText { visible: !!s.failure.note; text: holdNames(s.failure.note); color: theme.muted; Layout.fillWidth: true } // What each download source returned: one short line per source. FText { objectName: "failureSources"; visible: !!s.failure.sources; text: sourceLines(s.failure.sources); color: theme.muted; font.pixelSize: theme.micro; Layout.fillWidth: true } @@ -620,7 +631,8 @@ ApplicationWindow { FText { objectName: "repairUpdatesEngine"; visible: !!s.update.with_repair; Layout.fillWidth: true; color: theme.text text: t("Repair also updates the engine to {version}.", "修复时会一并更新到新版引擎 {version}。", {version: releaseVersion(currentRelease)}) } Flow { - visible: !notAFault; Layout.fillWidth: true; spacing: 8 + // No row (and no space for one) when the card has no button to show. + objectName: "failureActions"; visible: !notAFault && !crowdedFolderNoButtons; Layout.fillWidth: true; spacing: 8 // Actions that resolve the problem first, then the report buttons. FButton { objectName: "moveToDisk"; visible: diskFailure && s.form.new_comfy && !!bestDisk; enabled: !s.busy; primary: true text: bestDisk ? t("Install on \"{name}\"", "改装到“{name}”", {name: bestDisk.name}) : "" @@ -630,6 +642,12 @@ ApplicationWindow { FButton { objectName: "diskCleanupButton"; visible: s.failure.kind === "disk"; enabled: s.can_cleanup; text: t("Clean download cache", "清理缓存"); onClicked: { settingsTab = "general"; settingsOpen = true; backend.cleanupDownloads(false) } } FButton { objectName: "changeSource"; visible: s.failure.kind === "download" || s.failure.kind === "model-source"; text: t("Change source", "切换下载源"); onClicked: { settingsTab = "downloads"; settingsOpen = true } } FButton { objectName: "changeAddress"; visible: s.failure.kind === "port-taken"; text: t("Change address", "更改地址"); onClicked: { settingsTab = "advanced"; settingsOpen = true } } + // A model folder that held too much to check: check again without it, or remove it under "Reuse models". + // Offline packages download nothing, so there the folder can only be removed (the main button). + FButton { objectName: "skipModelFolder"; visible: s.failure.kind === "model-folder-crowded" && !s.failure.offline; primary: true; enabled: !s.busy; width: Math.min(implicitWidth, parent.width) + text: t("Skip this folder and download", "跳过此文件夹并下载"); onClicked: backend.skipModelFolder(s.failure.folder) } + FButton { objectName: "manageModelFolders"; visible: s.failure.kind === "model-folder-crowded" && !!s.failure.removable; primary: !!s.failure.offline; enabled: !s.busy; width: Math.min(implicitWidth, parent.width) + text: t("Manage model folders", "管理模型文件夹"); onClicked: backend.manageModelFolder(s.failure.folder) } FButton { objectName: "repairCardButton"; primary: true; visible: !!s.repair_offered; text: t("Repair", "修复"); onClicked: backend.action("repair", false) } FButton { objectName: "openInstallFolder"; visible: s.failure.kind === "missing-file"; primary: true text: t("Open install folder", "打开安装目录"); onClicked: backend.openInstallFolder() } @@ -644,8 +662,8 @@ ApplicationWindow { // A missing Visual C++ runtime: Microsoft's page, not the installer file itself; the person can fix it, so no report. FButton { objectName: "vcRuntimeLink"; visible: s.failure.kind === "vc-runtime" text: t("Download runtime ↗", "下载运行库 ↗"); onClicked: backend.link("https://learn.microsoft.com/cpp/windows/latest-supported-vc-redist") } - FButton { objectName: "exportError"; visible: !diskFailure && !notAFault; text: t("Export report", "导出报告"); enabled: s.report.status !== "running"; onClicked: backend.exportReport() } - FButton { objectName: "reportProblem"; visible: !diskFailure && !notAFault && !unsupportedGpu && s.failure.kind !== "port-taken" && s.failure.kind !== "comfy-restart" && s.failure.kind !== "comfy-folder" && s.failure.kind !== "engine-folder-denied" && s.failure.kind !== "folder-name-invalid" && s.failure.kind !== "vc-runtime" && s.failure.kind !== "python-file-blocked"; text: reportOpened(s.error, s.failure.title || "") ? t("Opened", "已打开") : t("Report a problem", "提交问题"); widthText: t("Report a problem", "提交问题"); enabled: !reportOpened(s.error, s.failure.title || ""); onClicked: backend.reportProblem(plainText(s.error), plainText(s.failure.title || "")) } + FButton { objectName: "exportError"; visible: !diskFailure && !notAFault && s.failure.kind !== "model-folder-crowded"; text: t("Export report", "导出报告"); enabled: s.report.status !== "running"; onClicked: backend.exportReport() } + FButton { objectName: "reportProblem"; visible: s.failure.kind !== "model-folder-crowded" && !diskFailure && !notAFault && !unsupportedGpu && s.failure.kind !== "port-taken" && s.failure.kind !== "comfy-restart" && s.failure.kind !== "comfy-folder" && s.failure.kind !== "engine-folder-denied" && s.failure.kind !== "folder-name-invalid" && s.failure.kind !== "vc-runtime" && s.failure.kind !== "python-file-blocked"; text: reportOpened(s.error, s.failure.title || "") ? t("Opened", "已打开") : t("Report a problem", "提交问题"); widthText: t("Report a problem", "提交问题"); enabled: !reportOpened(s.error, s.failure.title || ""); onClicked: backend.reportProblem(plainText(s.error), plainText(s.failure.title || "")) } } FButton { objectName: "showError"; visible: !notAFault; text: t("Technical details", "技术详情"); flat: true @@ -808,13 +826,28 @@ ApplicationWindow { Repeater { model: s.form.model_dirs delegate: Rectangle { + id: folderRow required property string modelData; required property int index + // The folder a crowded-folder card sent the person to: in view, outlined, its Remove focused. + readonly property bool sentHere: modelData === s.focus_model_folder + objectName: "modelFolderRow-" + index Layout.fillWidth: true; implicitHeight: 42; radius: theme.radiusSm; color: theme.bg + border.width: sentHere ? 2 : 0; border.color: theme.accent + function reveal() { + const flick = scroll.contentItem + const y = folderRow.mapToItem(flick.contentItem, 0, 0).y + flick.contentY = Math.max(0, Math.min(y - (flick.height - folderRow.height) / 2, flick.contentHeight - flick.height)) + removeFolderButton.forceActiveFocus(Qt.TabFocusReason) // the focus ring shows, as for a keyboard + } + // After the page change has scrolled to the top. + Timer { id: revealLater; interval: 60; onTriggered: folderRow.reveal() } + onSentHereChanged: if (sentHere) revealLater.restart() + Component.onCompleted: if (sentHere) revealLater.restart() RowLayout { anchors.fill: parent; anchors.leftMargin: 12; anchors.rightMargin: 4; spacing: 10 FIcon { kind: "folder"; ink: theme.muted; Layout.preferredWidth: 16; Layout.preferredHeight: 16 } FText { text: modelData; font.pixelSize: theme.micro + 1; Layout.fillWidth: true; elide: Text.ElideMiddle; maximumLineCount: 1 } - FButton { text: t("Remove", "移除"); flat: true; implicitHeight: theme.heightSm; font.pixelSize: theme.micro; enabled: !s.busy; onClicked: backend.removeFolder(index) } + FButton { id: removeFolderButton; objectName: "removeModelFolder-" + index; text: t("Remove", "移除"); flat: true; implicitHeight: theme.heightSm; font.pixelSize: theme.micro; enabled: !s.busy; onClicked: backend.removeFolder(index) } } } } @@ -1315,7 +1348,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; waiting: !!s.setup_job_wait + objectName: win.narrow ? "" : "primaryButton"; primary: !s.repair_offered && !(s.retry_kind === "launch" && engineUpdate.visible) && !manualFailure && !crowdedFolderCard; 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)) @@ -1352,7 +1385,7 @@ ApplicationWindow { FButton { id: primaryButton; objectName: win.narrow ? "primaryButton" : "" 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 + primary: !s.repair_offered && !(s.retry_kind === "launch" && engineUpdate.visible) && !manualFailure && !crowdedFolderCard leftPadding: 12; rightPadding: 12 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 diff --git a/freevideo_engine/launcher_session.py b/freevideo_engine/launcher_session.py index 686315e5..a6a221ac 100644 --- a/freevideo_engine/launcher_session.py +++ b/freevideo_engine/launcher_session.py @@ -145,6 +145,11 @@ class Session: bundled = False # Update flow defaults; __init__ starts each launcher session from these. update_snoozed = {} + # Model folders this session leaves out of the check because they held too much to check (never saved). + skipped_model_folders = () + skip_check_ran = False # the check started with skipped folders has been seen running + # The "Reuse models" folder the Models page brings into view with its Remove focused (from a crowded-folder card). + focus_model_folder = '' update_intent = None update_source = 'launcher' update_waiting = update_restarting = False @@ -425,6 +430,9 @@ def remember(self, selection, persist=True): self.persist() def edit(self, key, value): + if key == 'model_dirs': + # A changed list of folders starts afresh: nothing is skipped any more. + self.skipped_model_folders, self.skip_check_ran = (), False # A rejected entry stays explained until that field is accepted; the text is in the old # interface language after a switch. if self.field_error and key in (self.field_error.get('key'), 'language'): @@ -634,6 +642,8 @@ def downloads_view(self): def remove_folder(self, index): removed = self.form['model_dirs'][index] + if removed == self.focus_model_folder: + self.focus_model_folder = '' self.edit('model_dirs', [p for i, p in enumerate(self.form['model_dirs']) if i != index]) self.edit('offline_models', [p for p in self.form['offline_models'] if io_path(p) / 'models' != io_path(removed)]) @@ -742,6 +752,8 @@ def setup_values(self, form=None, **extra): """Only the visible automatic-setup option can request every quality level.""" form = self.form if form is None else form values = dict(form, token=self.token, **extra) + if self.skipped_model_folders: + values['skip_libraries'] = list(self.skipped_model_folders) if self.image_only_choice(form): # MiniMax H3 Image alone: an automatic download of the engine and the image model, nothing of the video model. values.update(only='image', model_method='auto', offline_models=[], sampling_caches=False, @@ -1019,6 +1031,37 @@ def nvidia_device_state(self): last = self._nvidia_device_state = (now, nvidia_state()) return last[1] + def skip_model_folder(self, folder): + """Check again without the model folder that held too much to check, for this session only: the models it + could have provided are downloaded instead. The folder stays in Settings.""" + if not isinstance(folder, str) or not folder.strip(): + return + self.skipped_model_folders = tuple(dict.fromkeys((*self.skipped_model_folders, folder))) + self.skip_check_ran = False + self.focus_model_folder = '' + self.controller.run('inspect', self.setup_values(self.repair_request or self.form)) + self.page = 'progress' + self.model_groups = [] + self.started = time.monotonic() + + def manage_model_folder(self, folder): + """Back to the Models page with the folder that held too much to check in view, its Remove button focused.""" + if not isinstance(folder, str) or folder not in (self.form.get('model_dirs') or []): + return + self.focus_model_folder = folder + self.page = 'models' + + def _end_skip_when_check_ends(self): + """A skipped folder is for one check only: once the check that started with it has ended (reviewed, failed or + cancelled) the list is empty again. The installation after the review keeps it: it runs with that check's + manifest, which names the folders to skip.""" + if not self.skipped_model_folders: + return + if self.controller.busy: + self.skip_check_ran = True + elif self.skip_check_ran: + self.skipped_model_folders, self.skip_check_ran = (), False + def retry_kind(self): if self.importer.state.get('status') == 'error' and self.import_retry: return self.import_retry[0] @@ -1635,10 +1678,23 @@ def cause(t, error=error): 'FreeVideo 已就绪。请重新打开浏览器,或复制地址手动打开。\n') + cause(t)) def select_source(self, name): - self.probe.select(self.engine_root(), name) + self._engine_write(lambda root: self.probe.select(root, name)) def select_proxy_mode(self, mode): - self.probe.select(self.engine_root(), proxy_mode=mode) + self._engine_write(lambda root: self.probe.select(root, proxy_mode=mode)) + + def _engine_write(self, write): + """A choice saved in the engine folder, which may not exist before installing: where Windows does not let this + account create it there, the error says so in the installation folder failure's words, not as a bare refusal.""" + root = self.engine_root() + try: + return write(root) + except OSError as error: + from .denied_access import engine_folder_error + explained = engine_folder_error(error, root) + if explained is None: + raise + raise explained from error def speed_test(self): self.probe.start(self.engine_root(), self.token) @@ -2884,6 +2940,7 @@ def snapshot(self): overall = dict(label=label, done=state.get('done'), total=state.get('total')) shortcut = row.get('shortcut') or {} # The offline import reports through self.error; what the idle installer last reported stays off its page. + self._end_skip_when_check_ends() raw_error = self._raw_error(installer=not self.offline_page()) error = redacted_launcher_error(raw_error, [(self.token, '')] if self.token else []) @@ -3022,8 +3079,9 @@ def snapshot(self): update = self.update_view() probe = self.probe.snapshot() if probe.get('status') == 'failed' and probe.get('error'): - from .download_settings import SPEED_TEST_REASONS - probe = dict(probe, error=self.t(*SPEED_TEST_REASONS.get(probe.get('reason'), SPEED_TEST_REASONS['other']))) + from .download_settings import SPEED_TEST_DENIED, SPEED_TEST_REASONS + reasons = dict(SPEED_TEST_REASONS, denied=SPEED_TEST_DENIED) + probe = dict(probe, error=self.t(*reasons.get(probe.get('reason'), SPEED_TEST_REASONS['other']))) speeds = [] for group, entries in probe.get('sources', {}).items(): for entry in entries: @@ -3045,9 +3103,18 @@ def snapshot(self): repair_state = dict(can_repair=self.can_repair(), repairs_comfy=self.repairs_comfy(), unavailable=self.repair_unavailable()) retry = self.retry_kind() launch = retry == 'launch' + import re + from .failure_details import MODEL_FOLDER_CROWDED + # The person's own folder, as the unredacted error names it: shown whole on the card, matched with "Reuse models". + crowded = re.search(MODEL_FOLDER_CROWDED, str(raw_error or ''), re.M) failure = self.both(lambda zh: launcher_failure(error, zh=zh, **repair_state, model_package=model_mismatch_package(raw_error, zh), exception=row.get('exception') if own else None, launch=launch, - check=retry == 'check')) + check=retry == 'check', reuse_folders=self.form.get('model_dirs') or (), + crowded_folder=crowded.group(1).strip() if crowded else '', + offline=retry in ('import', 'prepare'))) + if failure.get('kind') == 'model-folder-crowded': + # Translated with the placeholder; the path is shown whole, as found. + failure['detail'] = failure['detail'].replace('{folder}', failure['folder']) if retry == 'check' and '{button}' in failure.get('detail', ''): # The sentence was translated with the placeholder; the button keeps its own name in the interface language. from .i18n import fill @@ -3162,6 +3229,7 @@ def snapshot(self): adaln_dialog=self.adaln_dialog_view(error, update), selected=bool(self.selected), can_repair=self.can_repair(), repair_offered=repair_offered, error=error, field_error=dict(self.field_error or {}), retry_kind=self.retry_kind(), notice=self.notice, + focus_model_folder=self.focus_model_folder, # Qt reads a list as an array; LEVELS is a tuple. compatibility=dict(self.compatibility, levels=list(self.compatibility.get('levels') or ())), report=dict(self.report, error=self.t(*EXPORT_FAILURES.get(self.report.get('reason') or 'other', diff --git a/freevideo_engine/local_models.py b/freevideo_engine/local_models.py index 0619cd61..db31b648 100644 --- a/freevideo_engine/local_models.py +++ b/freevideo_engine/local_models.py @@ -1,6 +1,7 @@ """Find pinned models in an existing library without changing that library.""" import json import os +import re from pathlib import Path import stat import time @@ -12,6 +13,24 @@ BLOCK = 4 * 2**20 MAX_ENTRIES = 200_000 MAX_CANDIDATES = 2048 +# The line the launcher reads to name the folder that holds too much to check (failure_details.MODEL_FOLDER_CROWDED). +CROWDED_MARKER = '[MODEL_FOLDER_CROWDED]' + + +class CrowdedFolder(ValueError): + """A library folder holds too many files, or too many possible models, to check one by one.""" + def __init__(self, message, folder): + super().__init__('%s\n%s %s' % (message, CROWDED_MARKER, plain(folder))) + self.folder = plain(folder) +# A folder of sampling tables as the engine names it (adaln_assets.directory). Every generation has files of the same +# few sizes, so the folders of earlier generations are never walked: only the ones a needed file names. +TABLE_FOLDER = re.compile(r'adaln-tables-v2-[0-9a-f]{24}') +# A needed file this small that is not a weight file (a config, a tokenizer list): when a library holds so many files of +# such sizes that the candidates would pass MAX_CANDIDATES, only those under its own name (the file's, its link's, or +# its hub blob's) stay candidates. Below the limit every file of the size is a candidate, as before: offline packages +# and portable installations have no download to fall back on. Weights are found under any name, as people rename them. +SMALL_FILE = 64 * 1024 +WEIGHTS = ('.safetensors', '.gguf', '.bin', '.pt', '.pth', '.ckpt', '.onnx') MAX_ROOTS = 64 MAX_LISTED = 4096 # Paths accepted before duplicates and nested folders are merged. @@ -184,7 +203,8 @@ def hash_source(path, row, progress=None, output=None): return digest.hexdigest(), before -def files(directory, progress): +def files(directory, progress, tables=frozenset()): + """The regular files under a library folder. Sampling-table folders other than ``tables`` are skipped.""" directory = io_path(directory) seen = 0 def failed(error): @@ -195,12 +215,13 @@ def failed(error): path = Path(root) / name info = path.lstat() if (name not in ('.git', '.venv', 'envs', 'node_modules', '__pycache__') + and not (TABLE_FOLDER.fullmatch(name) and name not in tables) and not stat.S_ISLNK(info.st_mode) and not getattr(info, 'st_file_attributes', 0) & 0x400): kept.append(name) directories[:] = kept seen += len(names) + len(directories) if seen > MAX_ENTRIES: - raise ValueError('Too many files to scan. Select a narrower model folder.') + raise CrowdedFolder('Too many files to scan. Select a narrower model folder.', directory) progress.send('scan', done=seen) for name in sorted(names): path = Path(root) / name @@ -210,7 +231,7 @@ def failed(error): resolved = path.resolve(strict=True) info = resolved.stat() if stat.S_ISREG(info.st_mode): - yield Path(plain(resolved)), info + yield Path(plain(resolved)), info, name except (OSError, RuntimeError): continue @@ -226,15 +247,33 @@ def scan(directory, rows, *, prior=None, callback=None): by_size = {} for row in rows: by_size.setdefault(row['bytes'], []).append(row) - candidates, seen = [], set() - for path, info in files(directory, progress): + small_names = {} + for row in rows: + if row['bytes'] < SMALL_FILE and not row['file'].lower().endswith(WEIGHTS): + small_names.setdefault(row['bytes'], set()).update((Path(row['file']).name, expected(row))) + candidates, unnamed, seen = [], {}, set() + tables = frozenset(part for row in rows for part in Path(row['file']).parts if TABLE_FOLDER.fullmatch(part)) + for path, info, link in files(directory, progress, tables): path = io_path(path) identity = (info.st_dev, info.st_ino) if info.st_ino else plain(path) - if info.st_size in by_size and identity not in seen: - candidates.append(path) + if info.st_size not in by_size: + continue + named = info.st_size not in small_names or bool({path.name, link} & small_names[info.st_size]) + if identity in seen: + # A file first met under another name (a hub blob) and now reached through a link that names it. + if named and identity in unnamed: + candidates.append(unnamed.pop(identity)) + else: seen.add(identity) - if len(candidates) > MAX_CANDIDATES: - raise ValueError('Too many possible models. Select a narrower model folder.') + # Small non-weight files under another name wait aside; they count only while the total stays in the limit. + if named: + candidates.append(path) + else: + unnamed[identity] = path + if len(candidates) > MAX_CANDIDATES: + raise CrowdedFolder('Too many possible models. Select a narrower model folder.', directory) + if len(candidates) + len(unnamed) <= MAX_CANDIDATES: + candidates += list(unnamed.values()) # Prefer expected names/known HF blobs; still verify the actual content. names = {Path(row['file']).name for row in rows} | {expected(row) for row in rows} candidates.sort(key=lambda path: (path.name not in names, plain(path))) diff --git a/freevideo_engine/macos_decode.py b/freevideo_engine/macos_decode.py index 71072ae8..cd9fa8e2 100644 --- a/freevideo_engine/macos_decode.py +++ b/freevideo_engine/macos_decode.py @@ -3,6 +3,7 @@ import json from pathlib import Path import time +from .checkpoint_files import checkpoint_files def weight_cache_limits(allocator_bytes): @@ -84,7 +85,7 @@ def finite_video(module, inputs, output): phase('Loading video VAE') vae = skeleton(AutoencoderKLMiniMaxH3, base / 'vae') vae.encoder = vae.quant_conv = None - paths = tuple(sorted((base / 'vae').glob('*.safetensors'))) + paths = tuple(checkpoint_files(base / 'vae')) load_parameters(vae, paths, device_for_name=lambda name: 'meta' if name.startswith('decoder.transformer_blocks.') else 'mps', linear_fp16=False, mapped=False) diff --git a/freevideo_engine/media_encoding.py b/freevideo_engine/media_encoding.py index c03f8889..9fd465b5 100644 --- a/freevideo_engine/media_encoding.py +++ b/freevideo_engine/media_encoding.py @@ -11,6 +11,7 @@ import math from contextlib import nullcontext from pathlib import Path +from .checkpoint_files import checkpoint_files REFERENCE_FRAMES = 360 # 15 s at 24 fps, the longest H3 generation @@ -331,7 +332,7 @@ def vae_identity(base): """File identity of the VAE encoder, matching existing model identity fields.""" from .input_cache import digest directory = Path(base) / 'vae' - files = sorted(directory.glob('*.safetensors')) + files = checkpoint_files(directory) if not files: return None return { @@ -437,7 +438,7 @@ def _latent_cache(root, base, device, *, folder='vae', recipe='reference-latent- from .input_cache import InputCache, digest from .paths import data_root directory = Path(base) / folder - files = sorted(directory.glob('*.safetensors')) + files = checkpoint_files(directory) if not files: return None kind = torch.device(device).type diff --git a/freevideo_engine/modern_launcher.py b/freevideo_engine/modern_launcher.py index bf524880..a4fe9d93 100644 --- a/freevideo_engine/modern_launcher.py +++ b/freevideo_engine/modern_launcher.py @@ -313,6 +313,14 @@ def action(self, name, accepted=False): def useDisk(self, folder): self.invoke(session.use_disk, folder) + @Slot(str) + def skipModelFolder(self, folder): + self.invoke(session.skip_model_folder, folder) + + @Slot(str) + def manageModelFolder(self, folder): + self.invoke(session.manage_model_folder, folder) + @Slot(bool) def cleanupDownloads(self, remove=False): self.invoke(session.cleanup_downloads, remove) diff --git a/freevideo_engine/private_refs.py b/freevideo_engine/private_refs.py index acd1be51..8dbdeaac 100644 --- a/freevideo_engine/private_refs.py +++ b/freevideo_engine/private_refs.py @@ -83,10 +83,12 @@ def _walk(folder, suffixes, *, skip=()): def _holds(path): - """Whether a record in one of the extra folders keeps the files it names. A card's tombstone does not, nor the - backup of ComfyUI's unsaved workflow tabs (in the browser they never kept a file either).""" + """Whether a record in one of the extra folders keeps the files it names. A card's tombstone does not, nor a copy + of typed words the user data keeps (a backup of ComfyUI's unsaved workflow tabs, an edit's view): in the browser + they never kept a file either.""" + from .user_store import SCREENED posix = Path(path).as_posix() - return '/cast/.deleted/' not in posix and not Path(path).name.startswith('comfy-workflow-draft~') + return '/cast/.deleted/' not in posix and not Path(path).name.startswith(tuple(name + '~' for name in SCREENED)) def _is_draft(path): diff --git a/freevideo_engine/proxy_identity.py b/freevideo_engine/proxy_identity.py index 03e3a048..25b4de8e 100644 --- a/freevideo_engine/proxy_identity.py +++ b/freevideo_engine/proxy_identity.py @@ -12,6 +12,9 @@ PEER = 'X-FreeVideo-Proxy-Peer' ORIGIN = 'X-FreeVideo-Proxy-Origin' DEVICE = 'X-FreeVideo-Proxy-Device' +# The proof a signed-in browser sends with a change (a form post, which cannot send a header: a PROOF_FIELD field). +CSRF_HEADER = 'X-FreeVideo-CSRF' +PROOF_FIELD = 'fv_csrf' @lru_cache(maxsize=1) @@ -44,8 +47,10 @@ def device(request): return request.headers.get(DEVICE, '') if trusted(request) else '' +def proof_matches(secret, identity, offered): + """Whether `offered` is the proof csrf() gives this device under this hop secret (compared in constant time).""" + return bool(secret and identity and offered) and hmac.compare_digest(offered.encode(), csrf(secret, identity).encode()) + + def check_csrf(request): - identity = device(request) - offered = request.headers.get('X-FreeVideo-CSRF', '') - secret = request.app.get(app_key(), '') - return bool(identity and offered) and hmac.compare_digest(offered.encode(), csrf(secret, identity).encode()) + return proof_matches(request.app.get(app_key(), ''), device(request), request.headers.get(CSRF_HEADER, '')) diff --git a/freevideo_engine/release_notes.json b/freevideo_engine/release_notes.json index 328d9835..01aae3a3 100644 --- a/freevideo_engine/release_notes.json +++ b/freevideo_engine/release_notes.json @@ -2,15 +2,37 @@ "schema": 1, "product_version": "0.6.19", "en": { - "summary": "0.6.19 fixes an error message and a wait of about 15 seconds each time ComfyUI started in the single-file Windows version.", + "summary": "0.6.19 fixes the error window and the wait of about 15 seconds each time the single-file Windows version started ComfyUI, and improves model reuse, how the first video starts, the edit view, character pictures, settings, the access link, and Russian and Ukrainian line breaks.", "changes": [ - "Windows: With the single-file FreeVideo.exe, starting ComfyUI no longer shows \"Unhandled exception in script\" and no longer takes about 15 seconds longer." + "Windows: With the single-file FreeVideo.exe, starting ComfyUI no longer shows \"Unhandled exception in script\" and no longer takes about 15 seconds longer.", + "Launcher and opening screen: When Windows Smart App Control blocks a file, the card says what it blocked, what you can do and what turning it off costs. Refreshing the tab the launcher opened brings back FreeVideo's workflow instead of ComfyUI's default one. Before installing, when the chosen folder cannot be written while you pick the connection or download source or test the speed, the launcher asks you to choose another folder. A launch whose workflow opens late is no longer reported as failed; the opening screen stays, and the card goes away by itself when the page reports in.", + "Reusing models: Older sampling tables in a model library no longer stop setup, and many small files of the same size no longer make the check give up. When one folder holds too much to check, the launcher names it and offers to skip it for this check and download instead, or to remove it under Reuse models. Only a checkpoint's own weight files are read; other .safetensors files beside them are left alone.", + "Starting a video: After a warm-up, the video model is loaded first when a video was made last, so the next video starts sooner. A video started while that model is still loading waits for it and shows the model loading, instead of stopping the load and starting over. A run no longer stops when only a model file's change time moved, for example after a backup or a virus scan, while its content is the same.", + "Character pictures: New character cards get one sheet of four views: a face close-up, front, side and back. The three-quarter view is no longer made. A photo saved as .jfif or with no extension can now be used for a character, and a file type FreeVideo cannot use is named with the reason.", + "Creation panel: The quality levels you can choose look ready to press, and the one in use stands out in dark and light; only a level that cannot be used is grey. A rewrite that your own edit made out of date says so instead of disappearing, and the keys under the prompt stay on one line while a rewrite runs. Hover tips sit next to their control, feature cards keep one layout instead of switching back and forth, and a two-line notice puts its icon beside the first line.", + "Edit view, saving: Closing or reloading the page asks first while changes are neither saved nor kept on this computer. Every Not saved state shows in the caution colour with the reason below it, and restored changes say up to when they were kept, in words such as \"yesterday\".", + "Edit view, tracks: Remove Audio 2 also removes the empty separated tracks, and Reattach audio adds Audio 2 back; when Audio 2 cannot be removed yet, the key says why. While a part generates, Cancel is no longer hidden under the creation bar. The recording bar keeps the microphone you chose when it is opened again.", + "Settings: On This computer, a value still being read shows a thin placeholder, and one this computer does not give says Not detected instead of an empty bar. The models card's title wraps instead of being cut off. On a Mac, the performance measurement is not offered, and Preload ahead says it uses unified memory.", + "Saved data: The words typed in a saved edit, its queued parts and unsent feedback are also kept in FreeVideo's user data.", + "Access link: When FreeVideo is used through the access link, only the page opened with that link can make changes. Large downloads through the link are split so they complete, and a change refused because the connection expired says what to do next.", + "Languages and narrow windows: In Russian and Ukrainian, one- and two-letter words stay on the line of the word that follows them, and in Russian, taking something out of a list or a queue no longer says Delete. Long names in quotation marks are no longer matched with the wrong quotes. In narrow windows, tutorial steps put Take me there under their words and feature card buttons stay on screen." ] }, "zh": { - "summary": "0.6.19 修复了 Windows 单文件版每次启动 ComfyUI 时弹出的错误提示和约 15 秒的等待。", + "summary": "0.6.19 修复了 Windows 单文件版每次启动 ComfyUI 时弹出的错误提示和约 15 秒的等待,并改进了模型复用、第一个视频的启动、剪辑视图、人物图、设置、访问链接,以及俄语和乌克兰语的换行。", "changes": [ - "Windows:使用单文件版 FreeVideo.exe 时,启动 ComfyUI 不再弹出 “Unhandled exception in script”,也不再多等约 15 秒。" + "Windows:使用单文件版 FreeVideo.exe 时,启动 ComfyUI 不再弹出 “Unhandled exception in script”,也不再多等约 15 秒。", + "启动器和开场画面:Windows 的“智能应用控制”拦下文件时,卡片会写明拦下了什么、可以怎么做、关掉它的代价。刷新启动器打开的标签页时,会恢复 FreeVideo 的工作流,而不是 ComfyUI 的默认工作流。安装前选择连接方式、下载源或测速时,所选文件夹写不进去,启动器会提示换一个文件夹。工作流打开得晚的启动不再被报为失败:开场画面保留,页面报到后卡片自动消失。", + "复用模型:模型库里旧版本的采样表不再让安装停下,大量大小相同的小文件也不再让检查放弃。某个文件夹内容太多、检查不过来时,启动器会写出这个文件夹,可以在这次检查中跳过它改为下载,或在“复用已有模型”里移除它。只读取检查点自己的权重文件,旁边其他的 .safetensors 文件不再读取。", + "开始生成视频:上次生成的是视频时,预热会先载入视频模型,下一个视频开始得更快。在这个模型还在载入时开始的视频会等它载完,并显示正在载入模型,不再打断载入重新开始。模型文件内容没变、只是修改时间变了(例如备份或杀毒软件扫描之后),生成不再因此中止。", + "人物图:新建人物卡时生成一张四视角的图:面部特写、正面、侧面和背面,不再生成四分之三侧面。扩展名是 .jfif 或没有扩展名的照片现在也能用来建人物;FreeVideo 用不了的文件类型,会写出文件名和原因。", + "创作面板:能选的画质档位看起来就能按,正在用的那一档在深色和浅色下都突出;只有用不了的档位是灰色。你自己的修改让改写结果过时时,会写明这一点,不再直接消失;改写进行中,提示词下方的按键保持一行。悬停提示贴着对应的按钮出现;功能卡片的版面固定,不再来回跳;两行的提示条,图标和第一行文字对齐。", + "剪辑视图·保存:改动既没保存、也没存在本机时,关闭或刷新页面前会先确认。所有“未保存”状态都用提醒色,原因写在下方;恢复的改动会写明保存到什么时候,用“昨天”这样的说法。", + "剪辑视图·轨道:“移除声音 2”会一并移除空的分离轨,“放回原声”会把声音 2 加回来;声音 2 暂时不能移除时,按钮会说明原因。片段生成中,“取消”不再被创作栏盖住。录音条再次打开时,保留之前选的麦克风。", + "设置:“本机”里还在读取的数值显示一条细的占位,本机提供不了的数值写“未检测到”,不再显示空的条。模型卡片的标题会换行,不再被截断。在 Mac 上不再提供性能测量,“积极预加载”写明用的是统一内存。", + "保存的内容:剪辑里打的字、排队的片段和还没发送的反馈,也会保存到 FreeVideo 的用户数据中。", + "访问链接:通过访问链接使用 FreeVideo 时,只有用这个链接打开的页面才能做改动。通过链接下载大文件时会分段进行,能够下载完成;连接过期导致改动被拒时,提示会写明下一步。", + "语言和窄窗口:俄语和乌克兰语里,一两个字母的短词和后面的词保持在同一行;俄语里从列表或队列中移出时,不再写成“删除”。引号里的长名字不再和错误的引号配对。窄窗口下,教程步骤把“带我去”放在文字下方,功能卡片的按钮留在屏幕内。" ] }, "history": [ diff --git a/freevideo_engine/resident_models.py b/freevideo_engine/resident_models.py index 66fbd36f..fd9464f2 100644 --- a/freevideo_engine/resident_models.py +++ b/freevideo_engine/resident_models.py @@ -5,6 +5,7 @@ from pathlib import Path import sys import time +from .checkpoint_files import checkpoint_files import torch from . import usage_habit @@ -538,7 +539,7 @@ def input_video_encoder(self, base, canvas, *, device='cuda'): from .vae_weights import load_video_encoder directory = Path(base) / 'vae' identity = key(dict(files=[file_identity(path) for path in - sorted([directory/'config.json', *directory.glob('*.safetensors')])], + sorted([directory/'config.json', *checkpoint_files(directory)])], device=str(device))) found = self.take('input_video_vae', identity) if found is not None: @@ -554,7 +555,7 @@ def input_audio_encoder(self, base, canvas, *, device='cuda'): from .vae_weights import load_audio_vae directory = Path(base) / 'audio_vae' identity = key(dict(files=[file_identity(path) for path in - sorted([directory/'config.json', *directory.glob('*.safetensors')])], + sorted([directory/'config.json', *checkpoint_files(directory)])], device=str(device))) found = self.take('input_audio_vae', identity) if found is not None: diff --git a/freevideo_engine/streamed_weights.py b/freevideo_engine/streamed_weights.py index 92437a74..db71ec4c 100644 --- a/freevideo_engine/streamed_weights.py +++ b/freevideo_engine/streamed_weights.py @@ -13,16 +13,49 @@ _IDENTITY_FIELDS = ('st_dev', 'st_ino', 'st_size', 'st_mtime_ns', 'st_ctime_ns') +# The fields that say the file itself was replaced or written. st_ctime_ns alone also moves when only the file's +# metadata changes (a hard link made or removed, permissions, attributes a scanner writes): the content is then +# checked against the shard's fingerprint before the run is stopped. +_STRONG = 4 +# The fingerprint: the safetensors header and four 64 KiB blocks of the data, at its start, a third, two thirds +# and its end. +_SAMPLE = 64 * 1024 def _file_identity(value): return tuple(getattr(value, name) for name in _IDENTITY_FIELDS) +def _fingerprint(path): + """sha256 of a shard's header and four fixed sample blocks of its data (256 KiB read in all).""" + import hashlib + import struct + digest = hashlib.sha256() + with Path(path).open('rb', buffering=0) as stream: + head = stream.read(8) + if len(head) != 8: + raise ValueError('Invalid safetensors header size') + length = struct.unpack('= COPIES: - raise StoreError(413, 'too_many', limit=COPIES) + most_copies = _copies(family(key)) + if record is None and family(key) is not None and _family_count(family(key), folder) >= most_copies: + raise StoreError(413, 'too_many', limit=most_copies) kept, filtered = value, 0 if key in HISTORIES: kept, filtered = _without_forgotten(value, _stored_value(HISTORIES[key], folder), salt_root=salt_root, now=now) @@ -253,6 +260,10 @@ def clear(keys=None, *, folder=None): return removed +def _copies(name): + return next((copies for family_name, _, _, copies in FAMILIES if family_name == name), COPIES) + + def _family_count(name, folder): try: return sum(1 for entry in os.listdir(io_path(root(folder))) if entry.startswith(name + '~') and FILE.fullmatch(entry)) @@ -355,8 +366,8 @@ def _forgotten_in(value, *, salt_root=None, now=None): def forget(hashes, *, folder=None, salt_root=None, now=None): """Take out of the kept histories every row whose prompt is one of ``hashes`` (keyed hashes of prompts only deleted works had), unless the matching presets keep it. Each changed history gets a new rev. A backup of - ComfyUI's unsaved workflow tabs that has one of those prompts anywhere in it is removed whole: it is never written - back, and the page sends it again, without the words, when the tab next changes. Returns how many history rows and + ComfyUI's unsaved workflow tabs, or an edit's view, that has one of those prompts anywhere in it is removed whole: + the browser keeps its own copy, and the page sends it again, without the words, when it next changes. Returns how many history rows and backups went. A file that cannot be changed now raises OSError, and the caller's next cleanup tries again.""" hashes = {h for h in hashes or () if isinstance(h, str) and re.fullmatch('[0-9a-f]{64}', h)} if not hashes: @@ -368,7 +379,7 @@ def forget(hashes, *, folder=None, salt_root=None, now=None): except FileNotFoundError: names = [] for name in names: - if not (name.startswith('comfy-workflow-draft~') and FILE.fullmatch(name)): + if not (name.split('~', 1)[0] in SCREENED and '~' in name and FILE.fullmatch(name)): continue path = base / name with _lock(path): diff --git a/freevideo_engine/vae_weights.py b/freevideo_engine/vae_weights.py index 498fff2d..c9a93a9e 100644 --- a/freevideo_engine/vae_weights.py +++ b/freevideo_engine/vae_weights.py @@ -15,6 +15,7 @@ """ from contextlib import contextmanager from pathlib import Path +from .checkpoint_files import checkpoint_files # The initializers from_pretrained skips while constructing its skeleton. @@ -239,7 +240,7 @@ def placement(name): # which the RAM guard credits and the kernel can reclaim; Windows would # charge a mapping whole to commit, so there they are private copies, as # disable_mmap made them. The Linear cache converts every tensor it reads. - metrics = load_parameters(model, directory.glob('*.safetensors'), device_for_name=placement, + metrics = load_parameters(model, checkpoint_files(directory), device_for_name=placement, linear_fp16=linear_fp16, mapped=not linear_fp16 and _mapped()) if weight_source is not None: from .offload import initialize_streamed_layer @@ -262,7 +263,7 @@ def load_video_encoder(base, *, before_upload=None, device='cuda'): model.post_quant_conv = None if before_upload is not None: before_upload(model) - metrics = load_state(model, directory.glob('*.safetensors'), device_for_name=lambda name: device, + metrics = load_state(model, checkpoint_files(directory), device_for_name=lambda name: device, skip=('decoder.', 'post_quant_conv.'), mapped=_mapped()) model.to(device).eval().requires_grad_(False) return model, metrics @@ -275,7 +276,7 @@ def load_audio_vae(base, *, before_upload=None, device='cuda'): model = skeleton(AutoencoderKLMiniMaxH3Audio, directory) if before_upload is not None: before_upload(model) - metrics = load_state(model, directory.glob('*.safetensors'), device_for_name=lambda name: device, + metrics = load_state(model, checkpoint_files(directory), device_for_name=lambda name: device, mapped=_mapped()) model.to(device).eval().requires_grad_(False) return model, metrics diff --git a/freevideo_engine/video_warm.py b/freevideo_engine/video_warm.py index cb8153e2..72f34948 100644 --- a/freevideo_engine/video_warm.py +++ b/freevideo_engine/video_warm.py @@ -10,11 +10,23 @@ picture model is kept), nothing is taken from it: the files are read ahead, and the video model only when the encoder is already on the card. The kept worker is released by the same idle hold as after a video.""" import logging +import os import threading +import time from pathlib import Path LEVELS = ('light', 'full') MODES = ('eager', 'conservative') +# A video waits for a preload of its own video model under way while the preload moves: the worker's memory, the bytes +# it read or the card memory it holds change by PROGRESS_BYTES, or its log grows. Weights often go from the file cache +# to the card through a mapping, which moves the card memory and the bytes read but hardly the worker's own memory. +# With no such progress for JOIN_STALL_SECONDS the video stops waiting and loads its model as before; +# JOIN_LIMIT_SECONDS bounds the whole wait. The bytes read and the card memory are read every READ_EVERY_SECONDS. +JOIN_STALL_SECONDS = 20. +JOIN_LIMIT_SECONDS = 180. +JOIN_POLL_SECONDS = .5 +PROGRESS_BYTES = 16 << 20 +READ_EVERY_SECONDS = 1. def skipped(reason): @@ -37,6 +49,67 @@ def encoder_file(machine): return [path] if path.is_file() else [] +def video_used_last(): + """Whether the last operation was a video, or nothing has been used yet (usage_habit).""" + from . import usage_habit + ops = usage_habit.ops() + return not ops or ops[-1] == 'video' + + +def request_geometry(width, height, seconds, *, two_pass, base_steps, refine_steps, scale=2, frames=None): + """The geometry a plain text-to-video request builds its video model with, as the video's own process works it + out (sampling_canvas, then two_pass.plan) and engine_preload keeps it; None when it cannot be worked out. Asked as + a video starts, it never fails that video: anything it cannot work out only means the video does not wait. + ``frames`` is the node's Total frames: when given, the length is that count, as the bridge builds the canvas + (comfy_bridge.validate_request); the creation panel and the Agent API send it with every video.""" + try: + from .geometry import geometry + from .two_pass import plan, sampling_canvas + canvas = sampling_canvas(geometry(width, height, frames=frames, seconds=None if frames else seconds), + conditioned=False)[0] + sampling = plan(canvas, bool(two_pass), 't2va', base_steps=base_steps, refine_steps=refine_steps, + staged=False, scale=scale) + return dict(canvas, sampling_plan=sampling) if sampling['enabled'] or sampling['version'] == 2 else canvas + except Exception as error: + from .failure_details import raised_at + # Where it was raised, not its message or stack: those carry the installation's path. + logging.warning('[FreeVideo] The video settings for the preload under way could not be worked out: %s at %s', + type(error).__name__, raised_at(error)) + return None + + +def worker_reads(pid): + """(bytes the worker process read from storage, bytes it read through read calls, from the file cache too); None + for what cannot be read. Linux: /proc//io read_bytes and rchar; Windows: the process's I/O counters.""" + try: + if os.name == 'nt': + from .win32 import process_memory + row = process_memory(pid) or {} + return row.get('read_bytes') if row.get('io_complete') else None, None + fields = dict(line.split(':', 1) for line in Path('/proc/%d/io' % pid).read_text(encoding='utf-8').splitlines()) + return int(fields['read_bytes']), int(fields['rchar']) + except (OSError, ValueError, KeyError, TypeError, AttributeError, ImportError): + return None, None + + +def worker_card_bytes(gpu): + """The card memory this process tree (the resident worker) holds, or, where the driver does not list it per + process, the card's used memory; None when unreadable.""" + from .resident_process import gpu_memory, gpu_own + own = gpu_own(gpu) + if own is not None: + return own + memory = gpu_memory(gpu) + return memory[0] if memory else None + + +def not_preloaded(settings, reason): + """One line when a warm-up stops before the video model's preload began although the last video's settings are + kept; without them there was nothing to preload.""" + if settings is not None: + logging.info('[FreeVideo] Video model not preloaded: %s', reason) + + class VideoWarmer: def __init__(self, installation, *, busy): self.installation = installation @@ -48,6 +121,11 @@ def __init__(self, installation, *, busy): self.last = None # True while the warm-up holds the installation lease (lease_held). self.leased = False + # The geometry of the video model preload under way, when it last moved, and the event a video sets that + # waits for it. + self.preloading = None + self.progress_at = None + self.joined = threading.Event() def alive(self): return self.thread is not None and self.thread.is_alive() @@ -79,6 +157,7 @@ def warm(self, value): self.stop() with self.mutex: self.halt = threading.Event() + self.joined = threading.Event() self.level = level self.thread = threading.Thread(target=self.run, args=(level, root, machine, self.halt), name='freevideo-video-warm', daemon=True) @@ -101,11 +180,17 @@ def read_ahead(self, root, machine, *, encoder): return dict(state='reading' if started else 'skipped', encoder_read=encoder and started) def prepare(self, root, machine, halt): - """Encoder on the card in the resident worker, under the lease; then the video model read ahead.""" - from . import comfy_bridge, resident_process + """Encoder on the card in the resident worker, under the lease; then the video model read ahead. + + With the last video's settings kept and a video used last, the video model is preloaded before the encoder + is placed: on a computer whose worker starts slowly, a video asked for soon after the start found the + warm-up still placing the encoder, and the video model was never preloaded. The encoder then takes the room + that is left, as it does beside a video model kept after a video.""" + from . import comfy_bridge, engine_preload, resident_process from .image_gen.h3_pipeline import placed_encoder_bytes from .locking import runtime_lock owner = resident_process.OWNER + settings = engine_preload.recall() try: lease = runtime_lock(Path(root) / 'engine.lock', inherit=False) descriptor = lease.__enter__() @@ -114,9 +199,11 @@ def prepare(self, root, machine, halt): # The image worker keeps a picture model: nothing is taken from it. endpoint = owner.endpoint if owner.process is not None and owner.process.poll() is None else None on_card = endpoint is not None and placed_encoder_bytes(str(endpoint)) > 0 + not_preloaded(settings, 'the picture model keeps the card') return dict(self.read_ahead(root, machine, encoder=not on_card), state='lease_busy', encoder_kept=on_card) try: if halt.is_set() or self.busy(): + not_preloaded(settings, 'another task started before the warm-up') return dict(state='cancelled') source = comfy_bridge.source_root() environment = comfy_bridge.engine_environment(root, source) @@ -124,13 +211,31 @@ def prepare(self, root, machine, halt): try: endpoint = owner.start(root, source, machine['python'], environment, stop=halt) except resident_process.StartStopped: + not_preloaded(settings, 'another task started while the worker was starting') return dict(state='cancelled') - if placed_encoder_bytes(endpoint) > 0: + on_card = placed_encoder_bytes(endpoint) > 0 + video_model = None + if settings is not None and not on_card and video_used_last(): + video_model, joined = self.preload(endpoint, environment, descriptor, halt, settings, + gpu=machine.get('gpu_uuid')) + if joined: + return dict(state='joined', video_model=video_model, video_model_first=True) + if halt.is_set(): + return dict(state='cancelled', video_model=video_model, video_model_first=True) + if on_card: placed = dict(state='kept', reason='The encoder is already on the card') else: placed = self.place(endpoint, machine, environment, descriptor, halt) - if not halt.is_set(): - placed = dict(placed, video_model=self.place_engine(endpoint, environment, descriptor, halt)) + if video_model is not None: + placed = dict(placed, video_model=video_model, video_model_first=True) + elif halt.is_set(): + not_preloaded(settings, 'another task started while the encoder was being placed') + else: + video_model, joined = self.preload(endpoint, environment, descriptor, halt, settings, + gpu=machine.get('gpu_uuid')) + if joined: + return dict(placed, state='joined', video_model=video_model) + placed = dict(placed, video_model=video_model) finally: self.leased = False lease.__exit__(None, None, None) @@ -161,14 +266,64 @@ def place(endpoint, machine, environment, descriptor, halt): gpu_budget_bytes=policy.gpu_budget_bytes, ram_budget_bytes=policy.ram_budget_bytes, allocator=policy.allocator_config, limits=dict(system=hardware.system), stop=halt) + def preload(self, endpoint, environment, descriptor, halt, settings, gpu=None): + """place_engine, marked as under way so that a video with the same geometry waits for it (stop(join=...)). + Returns (result, joined): joined when such a video waits, and the warm-up then gives it the lease at once.""" + with self.mutex: + joined = self.joined + self.preloading = (settings or {}).get('geometry') + self.progress_at = time.monotonic() + log = Path(endpoint).parent / 'engine-preload-worker.log' + # The figures at the last progress (worker memory, its guard metric, bytes read from storage, bytes read, card + # memory; then the log size), and the last slow reading (bytes read and card memory) with its time. + marks, slow = [None], dict(at=None, values=(None, None, None)) + + def progress(sample, pid=None): + from .system import inference_memory_sample + try: + size = log.stat().st_size + except OSError: + size = 0 + try: + memory = (sample.get('rss_bytes'), inference_memory_sample(sample)) + except Exception: + memory = (None, None) # An unreadable sample is no progress; the others still count. + now = time.monotonic() + if slow['at'] is None or now - slow['at'] >= READ_EVERY_SECONDS: + read = worker_reads(pid) if pid is not None else (None, None) + try: + card = worker_card_bytes(gpu) + except Exception: + card = None + slow.update(at=now, values=(*read, card)) + current = (*memory, *slow['values'], size) + previous = marks[0] + moved = previous is None or current[-1] > previous[-1] or any( + type(new) is int and type(old) is int and abs(new - old) >= PROGRESS_BYTES + for new, old in zip(current[:-1], previous[:-1])) + if moved: + marks[0] = current + with self.mutex: + self.progress_at = now + try: + result = self.place_engine(endpoint, environment, descriptor, halt, settings, progress=progress) + finally: + with self.mutex: + self.preloading = None + waited = joined.is_set() + return result, waited + @staticmethod - def place_engine(endpoint, environment, descriptor, halt): - """The video model with the last video's settings into the resident worker, under the caller's lease.""" + def place_engine(endpoint, environment, descriptor, halt, value=None, progress=None): + """The video model with the last video's settings (``value``, from engine_preload.recall) into the resident + worker, under the caller's lease. ``progress`` is called with each memory sample of the worker and its process id + (watch).""" from . import engine_preload, resident_process from .idle_encoder import PreloadCancelled, watch from .monitoring import save from .ram import ProcessMemory - value = engine_preload.recall() + if value is None: + value = engine_preload.recall() if value is None: return dict(state='skipped', reason='no_settings') environment = dict(environment, **{resident_process.ENV: str(endpoint)}) @@ -194,7 +349,8 @@ def place_engine(endpoint, environment, descriptor, halt): try: result.update(watch(endpoint, request_path, environment, descriptor, result_path, cancelled, int(value.get('ram_budget_bytes') or 1 << 62), result, memory, held=workers, - stop=halt, module='freevideo_engine.worker', capability=engine_preload.CAPABILITY)) + stop=halt, module='freevideo_engine.worker', capability=engine_preload.CAPABILITY, + progress=progress)) except PreloadCancelled as error: if workers: try: @@ -221,11 +377,53 @@ def cancel(self): IDLE.stop() return dict(warm='cancelled') - def stop(self, timeout=8.): - """A video or a picture starts, or the page left: the warm-up stops; the file read stops with IDLE.stop().""" + def stop(self, timeout=8., join=None, cancelled=None, on_wait=None): + """A video or a picture starts, or the page left: the warm-up stops; the file read stops with IDLE.stop(). + + ``join`` is the geometry of a video that starts (request_geometry). While the video model is being preloaded + with that same geometry, the video waits for the preload instead of stopping it, and then uses the loaded model + (the worker still compares every setting: a hit or a miss). The wait ends when ``cancelled()`` says the video + was cancelled, when the preload made no progress for JOIN_STALL_SECONDS, or after JOIN_LIMIT_SECONDS; the + warm-up is then stopped as before.""" from .idle_encoder import KEPT_YIELD_SECONDS + current = threading.current_thread() with self.mutex: thread, halt = self.thread, self.halt + waiting = (join is not None and self.preloading is not None and self.preloading == join + and thread is not None and thread is not current and thread.is_alive()) + if waiting: + self.joined.set() + if waiting: + logging.info('[FreeVideo] The video waits for the video model preload under way with the same settings') + if on_wait is not None: + try: + on_wait() # the page shows the model loading while this video waits (comfy_nodes) + except Exception: + logging.warning('[FreeVideo] Could not show that the video waits for the video model', exc_info=True) + began = time.monotonic() + reason = None + while thread.is_alive(): + thread.join(JOIN_POLL_SECONDS) + if not thread.is_alive(): + break + if cancelled is not None and cancelled(): + reason = 'the video was cancelled' + break + with self.mutex: + still = time.monotonic() - (self.progress_at or began) + if still >= JOIN_STALL_SECONDS: + reason = 'the preload made no progress for %.0f s' % JOIN_STALL_SECONDS + break + if time.monotonic() - began >= JOIN_LIMIT_SECONDS: + reason = 'the preload took longer than %.0f s' % JOIN_LIMIT_SECONDS + break + if reason is None: + logging.info('[FreeVideo] The video joined the video model preload after %.1f s', + time.monotonic() - began) + return dict(warm='joined') + logging.info('[FreeVideo] The video stopped waiting for the video model preload: %s', reason) + with self.mutex: + self.joined.clear() halt.set() if thread is not None and thread is not threading.current_thread(): # The placement's watch() decides its yield time (longer while the worker keeps video models); this @@ -255,6 +453,9 @@ def warmer(installation=None, busy=None): return WARMER -def stop(): +def stop(join=None, cancelled=None, on_wait=None): + """Stop the warm-up for a task that starts; a video passes its geometry as ``join``, and ``on_wait``, called once + when it starts to wait for the preload under way (see VideoWarmer.stop).""" if WARMER is not None: - WARMER.stop() + return WARMER.stop(join=join, cancelled=cancelled, on_wait=on_wait) + return dict(warm='cancelled') diff --git a/web/autopilot_panels.js b/web/autopilot_panels.js index 1cf716b0..7840a756 100644 --- a/web/autopilot_panels.js +++ b/web/autopilot_panels.js @@ -46,16 +46,26 @@ export function statusText(job, t, fraction = null) { } // A time of day for today, with the day before it otherwise; nothing when the time is not known. `short` drops the -// hour from earlier days (a list where the date is enough). -export function localTime(value, t, now = new Date(), {short = false, language = LANGUAGE} = {}) { +// hour from earlier days (a list where the date is enough). `inSentence` is the form that stands inside a sentence +// ("restored up to …"): each language's own words, never a capitalised "Yesterday" in mid-sentence. +export function localTime(value, t, now = new Date(), {short = false, language = LANGUAGE, inSentence = false} = {}) { const at = value instanceof Date ? value : typeof value === 'number' ? new Date(value * (value < 1e12 ? 1000 : 1)) : value ? new Date(value) : null; if (!at || Number.isNaN(at.getTime())) return ''; const hm = `${String(at.getHours()).padStart(2, '0')}:${String(at.getMinutes()).padStart(2, '0')}`; const day = d => new Date(d.getFullYear(), d.getMonth(), d.getDate()).getTime(); const days = Math.round((day(now) - day(at)) / 86400000); if (days === 0) return hm; - if (days === 1) return short ? t('Yesterday', '昨天') : t('Yesterday {hm}', '昨天 {hm}', { hm }); const thisYear = at.getFullYear() === now.getFullYear(), year = at.getFullYear(), date = at.getDate(); + if (inSentence) { + if (days === 1) return t('yesterday at {time}', '昨天 {time}', { time: hm }); + const day = language !== 'en' && language !== 'zh-Hans' + ? new Intl.DateTimeFormat(language, {...(thisYear ? {} : {year: 'numeric'}), month: 'short', day: 'numeric'}).format(at) + : t(...(thisYear ? [`${['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'][at.getMonth()]} ${date}`, `${at.getMonth() + 1}月${date}日`] + : [`${['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'][at.getMonth()]} ${date}, ${year}`, `${year}年${at.getMonth() + 1}月${date}日`])); + // i18n-no-han + return t('{date} at {time}', '{date} {time}', { date: day, time: hm }); + } + if (days === 1) return short ? t('Yesterday', '昨天') : t('Yesterday {hm}', '昨天 {hm}', { hm }); // A language file's page: the date as that language writes it. if (language !== 'en' && language !== 'zh-Hans') return new Intl.DateTimeFormat(language, {...(thisYear ? {} : {year: 'numeric'}), month: 'short', ...(short && !thisYear ? {} : {day: 'numeric'}), ...(short ? {} : {hour: '2-digit', minute: '2-digit', hourCycle: 'h23'})}).format(at); diff --git a/web/browser_extension.js b/web/browser_extension.js index 45ff28b8..46e98949 100644 --- a/web/browser_extension.js +++ b/web/browser_extension.js @@ -138,13 +138,16 @@ export async function addConnectionFacts(error, api) { try { error.connection = await connectionFacts(api); } catch { /* The report only loses these facts. */ } return error; } +// The sign-in proxy's own page script wraps fetch and XMLHttpRequest so changes carry the device's proof +// (access_proxy.PAGE_PROOF_SCRIPT); it names what it wraps, and that is what is checked. +const unwrapped = value => (typeof value === 'function' && value.freevideoProof && value.freevideoNative) || value; export function nativeFetch(fetchFunction = globalThis.fetch) { - try { return typeof fetchFunction === 'function' && /\[native code\]/.test(Function.prototype.toString.call(fetchFunction)); } + try { fetchFunction = unwrapped(fetchFunction); return typeof fetchFunction === 'function' && /\[native code\]/.test(Function.prototype.toString.call(fetchFunction)); } catch { return false; } } const nativeXHR = () => { try { - return ['open', 'send'].every(method => /\[native code\]/.test(Function.prototype.toString.call(XMLHttpRequest.prototype[method]))); + return ['open', 'send'].every(method => /\[native code\]/.test(Function.prototype.toString.call(unwrapped(XMLHttpRequest.prototype[method])))); } catch { return false; } }; export function userScriptName(text) { diff --git a/web/cast_generate.js b/web/cast_generate.js index 9a21eb8f..cae9e23d 100644 --- a/web/cast_generate.js +++ b/web/cast_generate.js @@ -1,7 +1,7 @@ -// "Generate with AI" page of the new-character dialog: one description becomes five pictures of the -// same person (front, three-quarter, side, back, face). Each picture shows as it is finished; the -// dialog's Save waits for all five. Pictures are made one by one through the page's image client -// and stay in the input folder; the dialog puts them on the card. +// The pictures of a new card: a character's four views (front, face close-up, side, back; cast_photo.js draws the +// character dialog around them and puts them on one 1 x 4 sheet) or a scene's three candidates ("Generate with AI" page of +// the new-scene dialog, below). Each picture shows as it is finished; the dialog's Save waits for all of them. Pictures +// are made one by one through the page's image client and stay in the input folder; the dialog puts them on the card. import { setTip } from './tip_words.js'; import {createImageGenClient, imageGenProgress, imagePackUnavailableMessage, renderImageFailure, originStep, errorType, IMAGE_GEN_POLL_MS, IMAGE_GEN_INFO_POLL_MS} from './image_generation.js'; @@ -11,11 +11,12 @@ import { translatorFor } from './i18n.js'; export {imageGenerationSupported as castGenerateSupported} from './image_generation.js'; -export const CAST_VIEWS = Object.freeze(['front', 'three_quarter', 'side', 'back', 'face']); +// In the engine's order (image_gen/cast_views.py VIEWS): the front first, the other three made from it. +export const CAST_VIEWS = Object.freeze(['front', 'face', 'side', 'back']); // A scene is not a sheet of views: one description is drawn three times with different seeds and the user picks one. export const SCENE_CANDIDATES = Object.freeze(['a', 'b', 'c']); const VIEW_TITLES = Object.freeze({ - front: ['Front', '正面'], three_quarter: ['Three-quarter', '四分之三'], side: ['Side', '侧面'], + front: ['Front', '正面'], side: ['Side', '侧面'], back: ['Back', '背面'], face: ['Face', '脸部'], }); @@ -558,7 +559,7 @@ export function mountCastGenerate({container, api, text, t = text, viewURL, onSt field.readOnly = running; if (picker) picker.element.inert = running; action.hidden = !!isMissing; - // One accent button at a time: Generate until the five pictures exist, then Regenerate is neutral. + // One accent button at a time: Generate until every picture exists, then Regenerate is neutral. const finishedAll = generator.done() && !running; action.textContent = running ? tr('Stop', '停止') : finishedAll ? tr('Regenerate', '重新生成') : tr('Generate', '生成'); action.dataset.primary = String(!running && !finishedAll); diff --git a/web/cast_library.css b/web/cast_library.css index 4174534d..3aef72c5 100644 --- a/web/cast_library.css +++ b/web/cast_library.css @@ -40,7 +40,9 @@ .fv-cast-slot-error{position:absolute;left:1px;right:1px;bottom:1px;padding:4px 3px;border-radius:0 0 var(--fv-r-sm,8px) var(--fv-r-sm,8px);background:var(--fv-bg);color:var(--fv-danger);font-size:12px;line-height:1.4;word-break:keep-all;overflow:hidden;pointer-events:none} .fv-cast-slot-line{display:block} .fv-cast-slot-error .fv-issue-button{pointer-events:auto;font-size:11px;min-height:24px;padding:2px 5px;max-width:100%} -.fv-cast-message{margin-top:12px;color:var(--fv-danger);white-space:nowrap;text-overflow:ellipsis;overflow:hidden} +/* A message says the whole of what went wrong (a refused file names the file and why): it wraps between words; a long file name is cut short in the sentence itself (media_upload.js). */ +.fv-cast-message{margin-top:12px;color:var(--fv-danger);overflow-wrap:break-word} +.fv-cast-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap} .fv-cast-message.fv-cast-notice{color:var(--fv-muted)} .fv-cast-dialog .fv-cast-delete.fv-cast-confirm{border-color:#c9414f;background:#c9414f;color:#fff} .fv-cast-dialog .fv-cast-delete.fv-cast-confirm:hover{border-color:#b0343f;background:#b0343f} diff --git a/web/cast_library.js b/web/cast_library.js index 27b3deac..233aa2a4 100644 --- a/web/cast_library.js +++ b/web/cast_library.js @@ -3,6 +3,8 @@ import {agentInterfaceEnabled} from './agent_connect.js'; import {issueButton} from './issue_button.js'; import { skin } from './glass/library.js'; import {userMessage} from './user_message.js'; +import { holdShortWordsIn } from './i18n.js'; +import { holdFileName } from './media_upload.js'; const CAST_ISSUE = ['Character library', '角色库']; // The optional generator owns its UI and job lifecycle; keep its contract here. @@ -37,11 +39,26 @@ const button = (className, label, action) => { const path = id => '/freevideo/agent/cast/' + encodeURIComponent(id); // A row whose items wrap their words stands as a column (data-stack) where one word is wider than its item: on a // narrow window and in languages with long words, no word is cut or broken. Measured again when the row's width changes. -function stackWhenTooWide(row, items) { +// The lines a box's text takes (its text's own boxes, not those of what holds a word with the next one). +function lineCount(node) { + const tops = []; + const walker = document.createTreeWalker(node, NodeFilter.SHOW_TEXT); + for (let text = walker.nextNode(); text; text = walker.nextNode()) { + const range = document.createRange(); range.selectNodeContents(text); + for (const rect of range.getClientRects()) if (rect.width > 0) tops.push(rect.top); + } + tops.sort((a, b) => a - b); + return tops.reduce((count, top, i) => count + (i === 0 || top - tops[i - 1] > 4 ? 1 : 0), 0); +} +// Too narrow, besides a word wider than its item: an item of four lines or more, or a short word held with the next +// one (holdShortWordsIn) that has to break inside its piece. The row then stands as a column. +const tooNarrow = (node, most) => node.scrollWidth > node.clientWidth + 1 || (most && lineCount(node) > most) + || [...node.querySelectorAll('.fv-keep')].some(piece => lineCount(piece) > 1); +function stackWhenTooWide(row, items, {most = 0} = {}) { const fit = () => { if (!row.isConnected) return; delete row.dataset.stack; - if (items().some(node => node.offsetParent !== null && node.scrollWidth > node.clientWidth + 1)) row.dataset.stack = 'true'; + if (items().some(node => node.offsetParent !== null && tooNarrow(node, most))) row.dataset.stack = 'true'; }; const observer = typeof ResizeObserver === 'function' ? new ResizeObserver(fit) : null; observer?.observe(row); @@ -171,7 +188,10 @@ export function createCastLibrary({api, text, viewURL, uploadOne, onChange = () const photoTab = button('', text('From a photo', '从照片生成'), () => select('photo')); photoTab.hidden = true; for (const tab of [photoTab, uploadTab, aiTab]) tab.setAttribute('role', 'tab'); // The three tabs share the width and wrap their words; one under another where a word does not fit its tab. - const tabFit = stackWhenTooWide(tabs, () => [photoTab, uploadTab, aiTab].filter(tab => !tab.hidden)); + // A tab's short words stay with the next word (Russian, Ukrainian); a tab that would take four lines makes the + // tabs a column, as a word wider than its tab does. + for (const tab of [photoTab, uploadTab, aiTab]) holdShortWordsIn(tab); + const tabFit = stackWhenTooWide(tabs, () => [photoTab, uploadTab, aiTab].filter(tab => !tab.hidden), {most: 3}); // Tab panels are dialog-local, so multiple material panels can coexist. const uploadPane = el('div', 'fv-cast-upload'), views = el('div', 'fv-cast-views'); const aiPane = el('div', 'fv-cast-generate'); aiPane.hidden = true; @@ -194,7 +214,9 @@ export function createCastLibrary({api, text, viewURL, uploadOne, onChange = () tipOf(aiTab, text('Generate with AI', 'AI 生成'), views4 ? text('Make the face close-up, front, side and back from a prompt', '按提示词生成脸部特写、正面、侧面和背面') : text('Make the images from a prompt', '按提示词生成图片')); tipOf(photoTab, text('From a photo', '从照片生成'), text('Make the face close-up, front, side and back from one photo of the person', '用一张人物照片生成脸部特写、正面、侧面和背面')); - const issue = issueButton(text, () => ({where: CAST_ISSUE, message: status.textContent})); issue.hidden = true; + // shown: what the message line says on screen (it may also hold a fuller text for screen readers). + let shown = ''; + const issue = issueButton(text, () => ({where: CAST_ISSUE, message: shown})); issue.hidden = true; // A character's voice, under the pictures: the stretch of an audio file or a video with sound from the start chosen // here to the end of the file, at most 15 s; the server keeps that stretch as the card's clip (agent/cast.py). const voiceBox = el('section', 'fv-cast-voicefield'); voiceBox.hidden = scene; @@ -231,9 +253,20 @@ export function createCastLibrary({api, text, viewURL, uploadOne, onChange = () dialog.append(top, name, tabs, photoPane, uploadPane, imagePane, aiPane, voiceBox, status, issue, actions); tabs.append(photoTab, uploadTab, aiTab); // A refresh notice is plain secondary text; only failures are shown as errors. - const message = (content, notice = false) => { + const message = (content, notice = false, spoken = '', fileName = '') => { if (closed) return; - status.textContent = content; status.hidden = !content; status.classList.toggle('fv-cast-notice', notice); + shown = content; + // A fuller text for screen readers (a refused file's whole name): the line shown is hidden from them instead. + if (spoken && spoken !== content) { + const seen = el('span', '', content); seen.setAttribute('aria-hidden', 'true'); + status.replaceChildren(seen, el('span', 'fv-cast-sr', spoken)); + } + else status.textContent = content; + // A refused file's name stays on one line with its quotes (media_upload.js holdFileName). + if (fileName) holdFileName(status.querySelector('[aria-hidden=true]') || status, fileName); + // A short word (Russian "не") stays on the line of the word it goes with, as in the tabs. + holdShortWordsIn(status); + status.hidden = !content; status.classList.toggle('fv-cast-notice', notice); issue.hidden = !content || notice; }; const aiBusy = () => aiState.busy || !!generator?.isBusy() || Object.keys(makers).some(key => makerStates[key]?.busy || makers[key]?.isBusy()); @@ -260,7 +293,7 @@ export function createCastLibrary({api, text, viewURL, uploadOne, onChange = () save.hidden = !!current && !makerStates[current]?.done; if (missing) { save.setAttribute('aria-disabled', 'true'); save.title = missing; save.dataset.fvTipWhy = missing; } else { save.removeAttribute('aria-disabled'); save.removeAttribute('title'); delete save.dataset.fvTipWhy; } - if (before && before !== missing && status.textContent === before) message(''); + if (before && before !== missing && shown === before) message(''); for (let index = 0; index < slotUI.length; index++) { slotUI[index].choose.disabled = busy; slotUI[index].remove.disabled = busy; } @@ -396,7 +429,7 @@ export function createCastLibrary({api, text, viewURL, uploadOne, onChange = () function mark(index, content = '') { const {slot, problem} = slotUI[index]; // Clear the line only while it still holds this tile's words, not a later message. - if (markedBelow === index) { markedBelow = -1; if (status.textContent === problem.dataset.message) message(''); } + if (markedBelow === index) { markedBelow = -1; if (shown === problem.dataset.message) message(''); } problem.dataset.message = content; // One line per clause, so "这张图片" is never split across lines. problem.replaceChildren(...content.replace(/([,。]|\. )/g, '$1\n').split('\n').filter(Boolean).map(part => el('span', 'fv-cast-slot-line', part))); @@ -516,7 +549,11 @@ export function createCastLibrary({api, text, viewURL, uploadOne, onChange = () await load(); message(text('Changed elsewhere. Showing the latest version.', '已在别处修改,已显示最新内容'), true); } catch (error) { message(userMessage(error, text, text('Could not show the latest version. Close and open it again.', '未能显示最新内容,请关闭后重新打开。'))); } - } else message(userMessage(error, text)); + } else { + const said = userMessage(error, text); + const own = said === error?.message; + message(said, false, own && typeof error?.spoken === 'string' ? error.spoken : '', own && typeof error?.fileName === 'string' ? error.fileName : ''); + } } async function saveCard() { if (closed || save.disabled) return; diff --git a/web/cast_mention.js b/web/cast_mention.js index f32eba6e..43f4807c 100644 --- a/web/cast_mention.js +++ b/web/cast_mention.js @@ -7,6 +7,8 @@ export const MAX_PICTURES_EACH = 2; export const MAX_REFERENCES = 32; export const MAX_PROPS = 2; // Which of a card's pictures stands for the person after the sheet; the others follow in the card's own order. +// three_quarter stays though new cards no longer get that view: older cards, and cards whose pictures were taken from a +// turning video, carry it; the engine picks the same way (agent/drama.py FACE_ORDER). export const PICTURE_ORDER = ['face', 'front', 'three_quarter']; // subjects: [{name, description, pictures: [first, last] | null, audio: number | null}]. This is the one JS place for diff --git a/web/cast_photo.js b/web/cast_photo.js index 1a143013..9699c006 100644 --- a/web/cast_photo.js +++ b/web/cast_photo.js @@ -16,6 +16,7 @@ import {createImageGenClient, imagePackUnavailableMessage, renderImageFailure, I import {createCastGenerator} from './cast_generate.js'; import {faceCloseUp, dressMaskFile, facesCamera, repaintTook, closeUpShare, neutralCloseUp, CLOSEUP_FRAME} from './cast_face_crop.js'; import {createOtherUsageNotice} from './other_usage.js'; +import { holdShortWordsIn } from './i18n.js'; // Generation order per source; the order on screen and on the sheet is SHOW. The first view made is the one the others // are drawn from (the face from a picture; the front from a description). @@ -23,18 +24,48 @@ const MAKE = Object.freeze({photo: Object.freeze(['face', 'front', 'side', 'back ai: Object.freeze(['front', 'face', 'side', 'back'])}); const SHOW = Object.freeze(['face', 'front', 'side', 'back']); const VIEW_TITLES = Object.freeze({front: ['Front', '正面'], side: ['Side', '侧面'], back: ['Back', '背面'], face: ['Face', '脸部特写']}); -// The sheet: the cast sheet's rules (equal height, light grey ground, 48 px gaps, each picture whole and centred), one -// row of four, the face cell 1.4 times as wide as a full-body cell. -const SHEET = Object.freeze({body: [736, 1302], face: [1030, 1302], gap: 48, ground: 'rgb(238 238 238)'}); +// The sheet: the cast sheet's rules (equal height, light grey ground, 48 px gaps), one row of four, the face cell 1.4 times +// as wide as a full-body cell; the engine draws the same sheet for a card made there (agent/cast.py SHEET_CELLS, SHEET_FILL). +const SHEET = Object.freeze({body: [736, 1302], face: [1030, 1302], gap: 48, ground: 'rgb(238 238 238)', fill: .03}); +// Where each of the four pictures (in SHOW order, as {width, height}) goes on the sheet: the part of the picture drawn +// (sx, sy, sw, sh) and where on the sheet (dx, dy, dw, dh). A picture of about its cell's shape (within SHEET.fill: the +// 4:5 close-up, the full-body views) fills the cell, the few pixels over trimmed evenly from its sides, so the four share +// their top and bottom edges (as agent/cast.py compose_sheet); a picture of another shape is drawn whole and centred. +export function sheetLayout(pictures) { + const {body: [bw, bh], face: [fw], gap, fill} = SHEET; + let x = gap; + const cells = SHOW.map((view, i) => { + const {width, height} = pictures[i], cw = view === 'face' ? fw : bw, shape = (width / height) / (cw / bh); + let cell; + if (Math.abs(shape - 1) <= fill) { + const k = Math.max(cw / width, bh / height), sw = cw / k, sh = bh / k; + cell = {sx: (width - sw) / 2, sy: (height - sh) / 2, sw, sh, dx: x, dy: gap, dw: cw, dh: bh}; + } else { + const k = Math.min(cw / width, bh / height), dw = Math.round(width * k), dh = Math.round(height * k); + cell = {sx: 0, sy: 0, sw: width, sh: height, dx: x + Math.round((cw - dw) / 2), dy: gap + Math.round((bh - dh) / 2), dw, dh}; + } + x += cw + gap; + return cell; + }); + return {width: fw + 3 * bw + 5 * gap, height: bh + 2 * gap, cells}; +} const ORIGINAL = 'photo:original'; const el = (tag, cls, text) => { const e = document.createElement(tag); if (cls) e.className = cls; if (text != null) e.textContent = text; return e; }; // A row whose items wrap their words stands as a column (data-stack) where one word is wider than its item: on a // narrow window and in languages with long words, no word is cut or broken. Measured again when the row's width changes. +// A short word held with the next one (holdShortWordsIn) that has to break inside its piece: the row is too narrow too. +function keepBreaks(node) { + return [...node.querySelectorAll('.fv-keep')].some(piece => { + const tops = []; + for (const text of piece.childNodes) if (text.nodeType === 3) { const range = document.createRange(); range.selectNodeContents(text); for (const rect of range.getClientRects()) if (rect.width > 0) tops.push(rect.top); } + return tops.length > 1 && Math.max(...tops) - Math.min(...tops) > 4; + }); +} function stackWhenTooWide(row, items) { const fit = () => { if (!row.isConnected) return; delete row.dataset.stack; - if (items().some(node => node.offsetParent !== null && node.scrollWidth > node.clientWidth + 1)) row.dataset.stack = 'true'; + if (items().some(node => node.offsetParent !== null && (node.scrollWidth > node.clientWidth + 1 || keepBreaks(node)))) row.dataset.stack = 'true'; }; const observer = typeof ResizeObserver === 'function' ? new ResizeObserver(fit) : null; observer?.observe(row); @@ -175,7 +206,7 @@ export function mountCastPhoto({container, api, text, viewURL, onState = () => { ['text', tr('Describe', '按描述更换'), tr('Dress the views as described', '各视角按描述更换服装')], ['image', tr('Image', '上传服装图'), tr('Dress the views in the clothes of an image', '各视角换上服装图里的衣服')]]; wear.dataset.count = String(modes.length); - const modeButtons = modes.map(([value, name, use]) => { const b = el('button', null, name); b.type = 'button'; b.setAttribute('role', 'radio'); b.dataset.value = value; tip(b, name, use); b.onclick = () => setWear(value); wear.append(b); return b; }); + const modeButtons = modes.map(([value, name, use]) => { const b = holdShortWordsIn(el('button', null, name)); b.type = 'button'; b.setAttribute('role', 'radio'); b.dataset.value = value; tip(b, name, use); b.onclick = () => setWear(value); wear.append(b); return b; }); const outfitSlot = slot({label: tr('Clothes image', '服装图'), empty: [tr('Add a clothes image', '添加服装图'), tr('Drop it here, or choose one', '拖到这里,或点击选择')], use: tr('An image of the clothes to wear', '要换上的服装图片'), onChange: () => { outfitRef = ''; render(); }}); outfitSlot.element.classList.add('fv-cp-outfit-slot'); @@ -222,7 +253,7 @@ export function mountCastPhoto({container, api, text, viewURL, onState = () => { const cell = el('div', 'fv-cg-view'); cell.dataset.view = view; cell.tabIndex = 0; cell.setAttribute('role', 'button'); const title = tr(...VIEW_TITLES[view]); const image = el('img'); image.alt = ''; image.draggable = false; - const label = el('span', 'fv-cp-label', title); + const label = holdShortWordsIn(el('span', 'fv-cp-label', title)); const edited = el('span', 'fv-cp-edited', tr('Edited', '已编辑')); edited.hidden = true; const percent = el('span', 'fv-cg-percent'); const meter = el('i', 'fv-cg-meter'); const fill = el('b'); meter.append(fill); const tools = el('div', 'fv-cp-cell-tools'); @@ -455,18 +486,15 @@ export function mountCastPhoto({container, api, text, viewURL, onState = () => { async function picture(src) { const blob = await (await fetch(src)).blob(); return createImageBitmap(blob); } const shownFile = view => { const r = pictureOf(view); return edits[view]?.file || own[view]?.file || (r.original ? photoSlot.get().file : r.file); }; async function sheet() { - const {body: [bw, bh], face: [fw], gap, ground} = SHEET; - const width = fw + 3 * bw + 5 * gap, height = bh + 2 * gap; - const canvas = new OffscreenCanvas(width, height), g = canvas.getContext('2d'); - g.fillStyle = ground; g.fillRect(0, 0, width, height); - let x = gap; + const images = []; for (const view of SHOW) { - const r = pictureOf(view), cw = view === 'face' ? fw : bw; - const image = await picture(edits[view]?.url || own[view]?.url || (r.original ? photoSlot.get().url : viewURL(r.file))); - const k = Math.min(cw / image.width, bh / image.height), w = Math.round(image.width * k), h = Math.round(image.height * k); - g.drawImage(image, x + Math.round((cw - w) / 2), gap + Math.round((bh - h) / 2), w, h); image.close?.(); - x += cw + gap; + const r = pictureOf(view); + images.push(await picture(edits[view]?.url || own[view]?.url || (r.original ? photoSlot.get().url : viewURL(r.file)))); } + const {width, height, cells} = sheetLayout(images); + const canvas = new OffscreenCanvas(width, height), g = canvas.getContext('2d'); + g.fillStyle = SHEET.ground; g.fillRect(0, 0, width, height); + cells.forEach(({sx, sy, sw, sh, dx, dy, dw, dh}, i) => { g.drawImage(images[i], sx, sy, sw, sh, dx, dy, dw, dh); images[i].close?.(); }); const blob = await canvas.convertToBlob({type: 'image/png'}); return new File([blob], 'character-sheet.png', {type: 'image/png'}); } diff --git a/web/compatibility.js b/web/compatibility.js index 467e9781..41b7c82a 100644 --- a/web/compatibility.js +++ b/web/compatibility.js @@ -2,7 +2,7 @@ import { api } from '../../scripts/api.js'; import './fv_select.js'; import './glass/library.js'; import {userMessage} from './user_message.js'; -import { isChinese, translator } from './i18n.js'; +import { isChinese, keepShortWordsIn, translator } from './i18n.js'; import { localized } from './i18n_tables.js'; // FreeVideo's own reason keeps the lead-in that says what failed; browser or program wording becomes a plain sentence. @@ -70,10 +70,10 @@ export function compatibilityCard({t: tt = t, api: client0 = api} = {}) { const element = node('div', 'st-card st-compat'); const head = node('div', 'st-row has-ic'); const tile = node('span', 'st-ic'); const text = node('div', 'st-rt'); const title = node('b', '', tt('Compatibility level', '兼容档位')); const line = node('span', '', tt('Loading settings…', '正在读取设置…')); - text.append(title, line); const end = node('div', 'st-re'); head.append(tile, text, end); + text.append(keepShortWordsIn(title), keepShortWordsIn(line)); const end = node('div', 'st-re'); head.append(tile, text, end); const autoRow = node('div', 'st-row'); const autoText = node('div', 'st-rt'); - autoText.append(node('b', '', tt('Raise the level automatically after an unexpected interruption', '意外中断后自动提高档位')), - node('span', '', tt('After raising it, a few smooth generations bring it back down', '提高后,连续顺利完成几次会再降回来'))); + autoText.append(keepShortWordsIn(node('b', '', tt('Raise the level automatically after an unexpected interruption', '意外中断后自动提高档位'))), + keepShortWordsIn(node('span', '', tt('After raising it, a few smooth generations bring it back down', '提高后,连续顺利完成几次会再降回来')))); const autoEnd = node('div', 'st-re'); autoRow.append(autoText, autoEnd); const note = node('p', 'st-note', tt('Applies from the next generation. Higher levels have the GPU handle less at a time, so generation is slower and the picture differs slightly; resolution, duration and steps stay the same.', '从下一次生成起生效。档位越高,显卡每次处理的数据越少,生成越慢,画面也会有细微差别;分辨率、时长和步数不变。')); const foot = node('div', 'st-foot'); const status = node('p', 'st-slot'); status.setAttribute('role', 'status'); status.setAttribute('aria-live', 'polite'); @@ -82,6 +82,7 @@ export function compatibilityCard({t: tt = t, api: client0 = api} = {}) { foot.append(status, revert, save); const mac = node('div', 'st-row'); const macText = node('div', 'st-rt'); macText.append(node('b', '', tt('This computer needs no compatibility level', '这台电脑不需要兼容档位')), node('span', '', tt('Generation on this computer shares its memory, so the level does not apply.', '这台电脑生成时共用内存,兼容档位不适用。'))); mac.append(macText, node('div', 'st-re')); mac.hidden = true; + keepShortWordsIn(note); macText.querySelectorAll('b, span').forEach(part => keepShortWordsIn(part)); element.append(head, autoRow, note, foot, mac); const level = document.createElement('select'); level.setAttribute('aria-label', tt('Compatibility level', '兼容档位')); [tt('Off', '关闭'), tt('Level 1', '1 级'), tt('Level 2', '2 级'), tt('Level 3', '3 级')].forEach((name, i) => { const o = node('option', '', name); o.value = String(i); level.append(o); }); diff --git a/web/editor.css b/web/editor.css index 75ba07e8..36b3906c 100644 --- a/web/editor.css +++ b/web/editor.css @@ -383,10 +383,12 @@ .fv-ed-save-state{flex:none;display:inline-flex;align-items:center;gap:8px;height:24px;padding:0 8px;border-radius:var(--fv-r-pill);font-size:12px;color:var(--fv-muted);white-space:nowrap} .fv-ed-save-state::before{content:"";width:7px;height:7px;border-radius:var(--fv-r-pill);background:var(--fv-success)} .fv-ed-save-state[data-state=saving]::before{background:var(--fv-accent)} -.fv-ed-save-state[data-state=unsaved]{color:var(--fv-danger);background:var(--fv-danger-subtle)} -.fv-ed-save-state[data-state=unsaved]::before{background:var(--fv-danger)} +/* Not saved is a caution, not an error: the changes are still here (a loss is said by its own notice). */ +.fv-ed-save-state[data-state=unsaved]{color:var(--fv-warning);background:color-mix(in srgb,var(--fv-warning) 14%,transparent)} +.fv-ed-save-state[data-state=unsaved]::before{background:var(--fv-warning)} .fv-editor .fv-ed-save-state:is(button){height:24px;min-height:24px;border:0;cursor:pointer} -.fv-ed-save-state[data-shown=false]{visibility:hidden} +/* A saved edit shows no state, and the name uses its room (editor.js fitProjectRow marks the row). */ +.fv-ed-save-state[data-shown=false]{display:none} .fv-ed-project-row .fv-ed-export-box{margin-left:auto;height:100%} /* Hangs under the name in the project row at every width (the phone rule above, fixed at 120 px, is for a name in the scrolling header; with fixed, 100% here would be the window's height and the menu would open below the screen). */ @@ -407,6 +409,14 @@ .fv-ed-notice-close svg{width:12px;height:12px} @media(max-width:680px){.fv-ed-notice-stack{position:relative;inset:auto;align-self:start;justify-self:stretch;width:auto;margin:8px 12px 0}} @media(max-width:680px){.fv-ed-project-row .fv-ed-name{max-width:calc(100% - 200px)}} +@media(max-width:680px){.fv-editor .fv-ed-project-row[data-save-shown=false] .fv-ed-name{max-width:100%}} +/* A name the save state would cut short (editor.js fitProjectRow): the name has its line, the state and Export the next. */ +.fv-studio.fv-editor[data-project-stacked=true]{--fv-ed-project-h:72px} +.fv-ed-project-row[data-stacked=true]{flex-wrap:wrap;align-content:center;row-gap:4px} +.fv-editor .fv-ed-project-row[data-stacked=true] .fv-ed-name{flex:1 0 100%;max-width:100%} +.fv-ed-project-row[data-stacked=true] .fv-ed-save-state{order:1} +.fv-ed-project-row[data-stacked=true] .fv-ed-export-box{order:2;height:32px} +@media(max-width:680px){.fv-studio.fv-editor[data-project-stacked=true]{--fv-ed-project-h:96px}.fv-ed-project-row[data-stacked=true] .fv-ed-export-box{height:44px}} /* ── Library cards: the add and remove buttons are reachable without hover and big enough to hit (E20) ── */ .fv-editor .fv-ed-source-add,.fv-editor .fv-ed-source-remove{width:28px;height:28px;min-height:28px;border-radius:var(--fv-r-sm)} @@ -671,7 +681,8 @@ .fv-ed-genbar-borrowed>.fv-ed-refs,.fv-ed-genbar-borrowed>.fv-ed-description-box,.fv-ed-genbar-borrowed>.fv-ed-duration,.fv-ed-genbar-borrowed>.fv-ed-first-frame,.fv-ed-genbar-borrowed>.fv-ed-generate,.fv-ed-genbar-borrowed>.fv-ed-pass-options{display:none!important} .fv-ed-genbar-borrowed>.fv-borrowed{flex:1 1 100%;min-width:0;position:static;display:block;width:auto;height:auto;max-height:none;padding:0;border:0;background:none;box-shadow:none;transform:none;inset:auto} .fv-ed-genbar-borrowed>.fv-borrowed>.fv-body{display:block;position:static;width:auto;height:auto;padding:0} -.fv-editor[data-bar-borrowed=true] .fv-ed-genbar-borrowed>.fv-borrowed .fv-controls{position:static;justify-self:stretch;width:auto;max-width:none} +/* No layer of their own: where the creation panel's sheets load after this one (the real page), the lent body stays a grid and the controls' z-index would lay the whole bar over the editor's Cancel. */ +.fv-editor[data-bar-borrowed=true] .fv-ed-genbar-borrowed>.fv-borrowed .fv-controls{position:static;justify-self:stretch;width:auto;max-width:none;z-index:auto} /* The lent bar draws no blur of its own: a backdrop-filter makes the box the containing block of every position:fixed window inside it (the Media, LoRA and Advanced windows), which are placed in window coordinates and would land outside it, clipped by the dialog. The bar lies on the editor's flat ground, so there is nothing for the blur to show. */ .fv-editor[data-bar-borrowed=true] .fv-ed-genbar-borrowed>.fv-borrowed .fv-controls.fv-glass{-webkit-backdrop-filter:none;backdrop-filter:none} /* While a part is generating, the editor's Cancel (never its Continue; found by its class, in every language) stands on the lent bar's greyed Generate key, as wide as the key. On a row of its own under the bar it lay beneath the timeline toolbar, out of the mouse's reach. */ diff --git a/web/editor.js b/web/editor.js index c0afe376..f53baf5b 100644 --- a/web/editor.js +++ b/web/editor.js @@ -10,7 +10,7 @@ import {openSetup} from './setup.js'; import {feedbackButton, guideButton} from './feedback.js'; import {issueButton} from './issue_button.js'; import * as model from './editor_model.js'; -import {discardEmptyEdit, hiddenEmptyEdit, deleteEditText} from './editor_lifecycle.js'; +import {discardEmptyEdit, hiddenEmptyEdit, deleteEditText, stemsHeldText} from './editor_lifecycle.js'; import {createEditorState} from './editor_state.js'; import {createEditorStore, sourceKey, mediaURL, isReportableSaveFailure} from './editor_store.js'; import {createPicturePoster} from './editor_poster.js'; @@ -415,8 +415,20 @@ export function openEditor({api, app, from = null, panel = {}, components: given headerActions.append(phoneAccess.element, guideButton(t), feedbackButton(t), settingsButton); top.append(brand, navigation, headerActions); const projectRow = el('div', 'fv-ed-project-row'); - const saveState = button('', () => { if (queue.dirty) void retrySave(); }, 'fv-ed-save-state'); saveState.setAttribute('role', 'status'); + const saveState = button('', () => { if (queue.dirty) void retrySave(); }, 'fv-ed-save-state'); saveState.setAttribute('role', 'status'); saveState.dataset.fvTipSide = 'below'; projectRow.append(title, saveState, exportBox); + // A name the shown save state would cut short gets the row to itself; the state (and Export) go on the line below. + // Measured one-line each time, so a wider window or a shorter name brings the single row back. + function fitProjectRow() { + if (disposed) return; + delete projectRow.dataset.stacked; delete element.dataset.projectStacked; + projectRow.dataset.saveShown = saveState.dataset.shown === 'true' ? 'true' : 'false'; + const label = title.firstElementChild; + if (saveState.dataset.shown !== 'true' || !label || label.scrollWidth <= label.clientWidth + 1) return; + projectRow.dataset.stacked = 'true'; element.dataset.projectStacked = 'true'; + } + const projectRowWatch = typeof ResizeObserver === 'function' ? new ResizeObserver(() => fitProjectRow()) : null; + projectRowWatch?.observe(projectRow); // The header fit only keeps the shared entries readable now; the name has its own row. const headerName = el('button'); headerName.append(el('span')); const headerFit = fitEditorHeader(top, brand, headerName, navigation, headerActions); @@ -554,7 +566,7 @@ export function openEditor({api, app, from = null, panel = {}, components: given const noticeTimers = new Set(); // `report: false` keeps a problem's 20 s and its name but leaves out "Report a problem", for a cause that is not a fault. // `facts` (what the server said about a failed request) go with "Report a problem" into the report's details. - function notify(text, where = null, kind = null, action = null, {report = true, facts = null} = {}) { + function notify(text, where = null, kind = null, action = null, {report = true, facts = null, stay = false} = {}) { if (disposed) return; if (!text) { for (const timer of noticeTimers) clearTimeout(timer); noticeTimers.clear(); notices.replaceChildren(); return; } const last = notices.lastElementChild; @@ -573,6 +585,8 @@ export function openEditor({api, app, from = null, panel = {}, components: given else card.append(words, close); notices.append(card); while (notices.children.length > 3) notices.firstElementChild.remove(); + // A notice that must be read (changes that were lost) stays until it is closed. + if (stay) return card; const timer = setTimeout(() => { noticeTimers.delete(timer); card.remove(); }, where ? 20000 : 9000); noticeTimers.add(timer); return card; } @@ -644,6 +658,8 @@ export function openEditor({api, app, from = null, panel = {}, components: given if (step === 'generate' && genbar && out === notify) genbar.say(text, false, null, true); else out(text); return {ok: false, reason: code, say: text}; } + // Not a fault: the separated-sound tracks still hold parts, so Audio 2 stays (no "Report a problem"). + if (code === 'stems_present') { const text = stemsHeldText(t); out(text); return {ok: false, reason: code, say: text}; } if (['busy', 'locked', 'text', 'audio_full', 'overlap', 'range', 'no_audio'].includes(code)) { if (['locked', 'audio_full', 'overlap', 'range'].includes(code)) tracks?.flashBlocked?.(value.displayFrame); const said = {busy: t('This part is generating.', '这一段正在生成。'), locked: t('This track is locked.', '这条轨道已锁定。'), @@ -715,21 +731,38 @@ export function openEditor({api, app, from = null, panel = {}, components: given EDITOR_ISSUE, failureKind('save', {reason: saveReason(error)})); }}); // Whether the edit is saved, beside its name only when it needs attention: a failed save (which offers to save - // again from there), changes left unsaved, or saving that takes longer than 2 s. A saved edit shows nothing; the - // place is kept, so nothing beside it moves. + // again from there), changes left unsaved, or saving that takes longer than 2 s. A saved edit shows nothing, and + // the name has that room (on a phone the name is otherwise held back to leave the state and Export theirs). let savingSince = 0, saveShowTimer = null; + // Changes the server has not taken yet and this computer could not keep either (the edit is too large for the + // browser's storage, or that storage is full): closing or reloading the page asks first, as the image editor does. + let unloadGuard = false; + function beforeUnload(event) { event.preventDefault(); event.returnValue = ''; } + function syncUnloadGuard() { + const exposed = !disposed && queue.dirty && !queue.locallyRetained && !discardOnSwitch; + if (exposed === unloadGuard) return; + unloadGuard = exposed; + window[exposed ? 'addEventListener' : 'removeEventListener']('beforeunload', beforeUnload); + } function updateSaveState() { if (disposed) return; - const now = !queue.dirty ? 'saved' : queue.failure || discardOnSwitch ? 'unsaved' : 'saving'; + syncUnloadGuard(); + // Changes neither saved nor kept on this computer read as not saved at once, with a warning dot, until saved. + const pageOnly = unloadGuard; + const now = !queue.dirty ? 'saved' : queue.failure || discardOnSwitch || pageOnly ? 'unsaved' : 'saving'; savingSince = now === 'saving' ? savingSince || performance.now() : 0; const slow = now === 'saving' && performance.now() - savingSince >= 2000; clearTimeout(saveShowTimer); if (now === 'saving' && !slow) saveShowTimer = setTimeout(updateSaveState, 2020 - (performance.now() - savingSince)); saveState.dataset.shown = String(now === 'unsaved' || slow); - if (saveState.dataset.state === now) return; - saveState.dataset.state = now; + fitProjectRow(); + if (saveState.dataset.state === now && saveState.dataset.pageOnly === String(pageOnly)) return; + saveState.dataset.state = now; saveState.dataset.pageOnly = String(pageOnly); saveState.textContent = {saved: t('Saved', '已保存'), saving: t('Saving…', '正在保存…'), unsaved: t('Not saved', '未保存')}[now]; - tip(saveState, {name: saveState.textContent, use: now === 'unsaved' ? t('Click to save the changes again', '点击重新保存改动') + tip(saveState, {name: saveState.textContent, use: pageOnly + ? t('These changes have not been saved and are only in this page. Keep the page open until they are saved; closing it now would lose them.', + '这些改动还没有保存,只在当前页面里。请保持页面打开,直到保存完成;现在关闭会丢失这些改动。') + : now === 'unsaved' ? t('Click to save the changes again', '点击重新保存改动') : t('Changes save by themselves as you edit', '改动会自动保存')}); } async function retrySave() { @@ -999,7 +1032,7 @@ export function openEditor({api, app, from = null, panel = {}, components: given function updateTop() { updateSaveState(); const name = state.record.name || new Date().toLocaleDateString(); - if (title.firstElementChild?.textContent !== name) { title.replaceChildren(el('span', '', name), icon('m4 6 4 4 4-4')); headerFit.check(); } + if (title.firstElementChild?.textContent !== name) { title.replaceChildren(el('span', '', name), icon('m4 6 4 4 4-4')); headerFit.check(); fitProjectRow(); } title.title = state.record.name; // The name may be cut short on a narrow window; its tip says it whole (the tip's own label is cut at 40 characters). title.dataset.fvTip = 'editor.name'; title.dataset.fvTipName = name; @@ -2688,7 +2721,7 @@ export function openEditor({api, app, from = null, panel = {}, components: given window.addEventListener('freevideo-view', otherView); listeners.push(() => window.removeEventListener('freevideo-view', otherView)); function teardown() { if (disposed) return; - releaseTakes(); rememberView(); disposed = true; handle.kept = false; poster.dispose(); music.dispose(); narration.dispose(); voice.dispose(); voiceInstall.dispose(); guide?.dispose(); transportControls.dispose(); toolbarMore.dispose(); player.dispose(); + releaseTakes(); rememberView(); disposed = true; syncUnloadGuard(); projectRowWatch?.disconnect(); handle.kept = false; poster.dispose(); music.dispose(); narration.dispose(); voice.dispose(); voiceInstall.dispose(); guide?.dispose(); transportControls.dispose(); toolbarMore.dispose(); player.dispose(); textTools.dispose(); adjust.dispose(); notes.dispose(); pictureEdit.dispose(); audio.dispose(); stems?.dispose(); recording.dispose(); headerFit.dispose(); cleanupBar?.(); diff --git a/web/editor_audio_rules.js b/web/editor_audio_rules.js index 2ca2a3a0..f4a9eaf8 100644 --- a/web/editor_audio_rules.js +++ b/web/editor_audio_rules.js @@ -44,7 +44,8 @@ export function restoreOriginal(record, id) { if (value) sound[name] = value; else delete sound[name]; } sound.link = picture.id; picture.link = sound.id; delete picture.detached_from; delete sound.detached_from; - if (!next.tracks.some(track => track.id === lane.id)) next.tracks.push(lane); + // A lane added here goes in its place in the track order (Audio 2 right after Audio 1, before a recording track). + if (!next.tracks.some(track => track.id === lane.id)) next.tracks.splice(next.tracks.findIndex(track => track.id === 'a1') + 1, 0, lane); const row = next.tracks.find(track => track.id === lane.id); row.clips.push(sound); row.clips.sort((a, b) => a.start - b.start); return model.parse(next); diff --git a/web/editor_lifecycle.js b/web/editor_lifecycle.js index 30a2ee88..7638a6f9 100644 --- a/web/editor_lifecycle.js +++ b/web/editor_lifecycle.js @@ -47,3 +47,6 @@ export const deleteEditText = (t, name = '') => ({ generation_active: t('This edit is still generating. You can delete it when it finishes.', '正在生成,完成后才能删除。'), delete_failed: t('Could not delete this edit. Please try again.', '删除失败,请重试。'), }); +// Why Audio 2 cannot go while the separated-sound tracks hold parts (the greyed key's tip, and the edit's refusal). +export const stemsHeldText = t => t('Audio 2 cannot be removed while the Dialogue, Music and Ambience tracks still have parts. Delete those parts first.', + '人声、音乐、环境声轨道上还有片段,暂时不能移除声音 2。请先删除这些片段。'); diff --git a/web/editor_model.js b/web/editor_model.js index c7610eeb..91c4eba2 100644 --- a/web/editor_model.js +++ b/web/editor_model.js @@ -127,11 +127,15 @@ export function addAudioTrack(record) { next.tracks.sort((a, b) => TRACK_ORDER.indexOf(a.id) - TRACK_ORDER.indexOf(b.id)); return parse(next); } +// The separated-sound tracks (a4–a6) need Audio 2: with no part left on them they go with it; while one is there, +// Audio 2 stays (code stems_present, which the page says in its own words). +export const separatedTracksUsed = record => record.tracks.some(track => track.stem !== undefined && track.clips.length > 0); export function removeAudioTrack(record) { const next = serialize(record), track = trackBy(next, 'a2'); busy(track.clips); + check(!separatedTracksUsed(next), 'stems_present'); const removed = new Set(track.clips.map(clip => clip.id)); - next.tracks = next.tracks.filter(track => track.id !== 'a2'); + next.tracks = next.tracks.filter(track => track.id !== 'a2' && track.stem === undefined); for (const clip of all(next)) if (removed.has(clip.link)) clip.link = null; return parse(next); } diff --git a/web/editor_record.js b/web/editor_record.js index 891c9bf2..56eaf139 100644 --- a/web/editor_record.js +++ b/web/editor_record.js @@ -74,14 +74,19 @@ export function createEditorRecord({state, player, library, t, error = () => {}, const all = (await media().enumerateDevices()).filter(device => device.kind === 'audioinput'); // Chrome lists the default and communications choices again under the real device's name: they are left out when a real one exists. const real = all.filter(device => !['default', 'communications'].includes(device.deviceId)), inputs = real.length ? real : all.slice(0, 1); + // The microphone the stream was opened on, when one was chosen before (the bar opened again): it stays shown and listened to. + const opened = stream && listening && inputs.some(device => device.deviceId === listening) ? listening : null; devices.replaceChildren(...inputs.map((device, index) => { const option = el('option', null, deviceName(device.label, index + 1, t)); option.value = device.deviceId; return option; })); devices.hidden = inputs.length < 2; - // The stream was opened on the system default: show the real device behind it, or open the one shown when none is known. - const behind = all.find(device => device.deviceId === 'default' && device.groupId); - const match = behind && inputs.find(device => device.groupId === behind.groupId); - if (match) devices.value = match.deviceId; - if (stream) listening = match || inputs.length < 2 ? devices.value : null; - if (stream && listening === null) await listen(); + if (opened) devices.value = opened; + else { + // The stream was opened on the system default: show the real device behind it, or open the one shown when none is known. + const behind = all.find(device => device.deviceId === 'default' && device.groupId); + const match = behind && inputs.find(device => device.groupId === behind.groupId); + if (match) devices.value = match.deviceId; + if (stream) listening = match || inputs.length < 2 ? devices.value : null; + if (stream && listening === null) await listen(); + } paint(); } catch { if (mine === session && !disposed) denial(); } } diff --git a/web/editor_store.js b/web/editor_store.js index 027b5cf2..209af42a 100644 --- a/web/editor_store.js +++ b/web/editor_store.js @@ -68,7 +68,14 @@ function saveOutbox(session, entry) { try { if (entry) { if (new TextEncoder().encode(JSON.stringify(entry.project)).length > 2 * 1024 * 1024) { - console.info('[FreeVideo editor] Record exceeds 2 MB; outbox skipped.'); return false; + console.info('[FreeVideo editor] Record exceeds 2 MB; outbox skipped.'); + // The copy kept before is now older than the page: it says so, so a recovery can tell the user what it + // brings back and from when. + try { + const kept = JSON.parse(localStorage.getItem(lockName(session)) || 'null'); + if (kept?.project && !kept.later_lost) localStorage.setItem(lockName(session), JSON.stringify({...kept, later_lost: true})); + } catch { /* nothing more can be kept */ } + return false; } localStorage.setItem(lockName(session), JSON.stringify(entry)); } else localStorage.removeItem(lockName(session)); @@ -362,6 +369,12 @@ export function createEditorStore(api, {t = en => en, notify = () => {}, onGener onCopied: () => notice('conflict', 'This edit was changed elsewhere, so your changes here were saved as a copy.', '这个剪辑在别处改过,这里的改动已另存为副本。')}); try { q.enqueue(entry.project); await q.flush(); + if (entry.later_lost) { + // What comes back is the last copy this computer could keep; what was changed after it is gone. + const {localTime} = await import('./autopilot_panels.js'); + notify(t('Restored your changes up to {time}. Later changes could not be kept on this computer and were lost.', + '已恢复到 {time} 的改动。之后的改动未能保存在这台电脑上,已经丢失。', {time: localTime(new Date(entry.updated_at), t, new Date(), {inSentence: true})}), null, null, null, {stay: true}); + } if (q.dirty) { // Transfer the unresolved request and latest edit to this live // session before releasing the abandoned session's lock. @@ -483,6 +496,8 @@ export function createEditorStore(api, {t = en => en, notify = () => {}, onGener const release = () => { uploads.delete(upload); xhr.onload = xhr.onerror = null; xhr.upload.onprogress = null; }; const upload = {xhr, release, reject}; uploads.add(upload); xhr.open('POST', api.apiURL?.('/freevideo/editor/import') || '/freevideo/editor/import'); + const proof = globalThis.__freevideoProof?.(); // through the sign-in proxy (web/proxy_proof.js) + if (proof) xhr.setRequestHeader('X-FreeVideo-CSRF', proof); xhr.setRequestHeader('X-FreeVideo-Filename', encodeURIComponent(file.name)); xhr.setRequestHeader('Content-Type', 'application/octet-stream'); xhr.upload.onprogress = event => { if (event.lengthComputable) progress(event.loaded / event.total); }; diff --git a/web/editor_tracks.css b/web/editor_tracks.css index 56411391..c383694e 100644 --- a/web/editor_tracks.css +++ b/web/editor_tracks.css @@ -14,8 +14,11 @@ .fv-ed-track-view:where([data-hx-a2]){height:260px} .fv-editor .fv-ed-track-heads,.fv-editor .fv-ed-track-scroll{bottom:0} .fv-ed-track-view .fv-ed-add-audio{position:absolute;left:0;width:100%;height:28px;padding:0 4px;border:0;border-radius:0;background:transparent;color:var(--fv-muted);font:400 13px/1.4 var(--fv-font,system-ui);text-align:center;white-space:nowrap;overflow:hidden;cursor:pointer} -.fv-ed-track-view .fv-ed-add-audio:hover:not(:disabled){color:var(--fv-ink)} +.fv-ed-track-view .fv-ed-add-audio:hover:not(:disabled,[aria-disabled=true]){color:var(--fv-ink)} .fv-ed-track-view .fv-ed-add-audio:disabled{opacity:.4;cursor:default} +/* Held (aria-disabled): it keeps its focus and its tip, so only the sign and the words fade, over a solid ground. */ +.fv-ed-track-view .fv-ed-track-heads .fv-ed-add-audio[aria-disabled=true]{cursor:default;color:var(--fv-muted)} +.fv-ed-track-view .fv-ed-track-heads .fv-ed-add-audio[aria-disabled=true]::before{opacity:.4} .fv-ed-track-view .fv-ed-track-head{position:absolute;left:0;width:100%;display:flex;align-items:center;justify-content:center;gap:6px;font-size:13px;color:var(--fv-ink)} .fv-ed-track-view .fv-ed-track-head svg{width:16px;height:16px;flex:none;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linejoin:round;stroke-linecap:round} .fv-ed-track-scroll{position:absolute;left:var(--fv-ed-head-width);top:0;right:0;bottom:40px;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--fv-border) transparent;overscroll-behavior:contain} @@ -88,7 +91,7 @@ .fv-ed-clip-popover button+button{margin-left:6px} .fv-ed-clip-popover{max-height:calc(100% - 16px);overflow:auto} .fv-ed-track-view [hidden]{display:none!important} -@media(max-width:520px){.fv-ed-track-view,.fv-ed-track-view[data-track-switches=true],.fv-studio.fv-editor .fv-ed-track-view[data-track-switches],.fv-studio.fv-editor[data-text-tracks] .fv-ed-track-view{--fv-ed-head-width:64px}.fv-studio.fv-editor .fv-ed-track-head>svg{display:none}.fv-ed-track-view .fv-ed-track-heads .fv-ed-track-head,.fv-ed-track-view .fv-ed-track-heads .fv-ed-track-head[data-text-track=true]{padding:0 2px 0 12px;box-sizing:border-box}.fv-ed-track-head>span:first-of-type{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px}.fv-ed-track-zoom{right:8px}.fv-ed-clip-status{left:5px;font-size:11px}} +@media(max-width:520px){.fv-ed-track-view,.fv-ed-track-view[data-track-switches=true],.fv-studio.fv-editor .fv-ed-track-view[data-track-switches],.fv-studio.fv-editor[data-text-tracks] .fv-ed-track-view{--fv-ed-head-width:76px}.fv-studio.fv-editor .fv-ed-track-head>svg{display:none}.fv-ed-track-view .fv-ed-track-heads .fv-ed-track-head,.fv-ed-track-view .fv-ed-track-heads .fv-ed-track-head[data-text-track=true]{padding:0 2px 0 12px;box-sizing:border-box}.fv-ed-track-head>span:first-of-type{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px}.fv-ed-track-zoom{right:8px}.fv-ed-clip-status{left:5px;font-size:11px}} @media(forced-colors:active){.fv-ed-clip,.fv-ed-selection,.fv-ed-gesture-preview{border-color:Highlight}.fv-ed-playhead,.fv-ed-snap-line{background:CanvasText}.fv-ed-beat-line{background:GrayText;opacity:1}} /* Gesture affordances; track slots and heads are owned by the track layout. */ @@ -135,8 +138,9 @@ .fv-studio.fv-editor .fv-ed-track-head>span:first-of-type{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap} .fv-studio.fv-editor .fv-ed-track-head>svg{width:16px;height:16px;color:var(--fv-fg3)} .fv-studio.fv-editor .fv-ed-add-audio{color:var(--fv-fg3);font-size:var(--fv-fs-1,12px);border-radius:var(--fv-r-sm);margin:0 4px;width:calc(100% - 8px);transition:background-color var(--fv-dur-1,160ms) var(--fv-ease-out,ease-out),color var(--fv-dur-1,160ms) var(--fv-ease-out,ease-out)} -.fv-studio.fv-editor .fv-ed-add-audio:hover:not(:disabled){background:var(--fv-ctl-bg);color:var(--fv-fg)} -.fv-studio.fv-editor .fv-ed-add-audio:active:not(:disabled){background:var(--fv-ctl-hover)} +/* The key's hover and press tints are laid over the timeline's colour, so the head icon under the key never shows through. */ +.fv-studio.fv-editor .fv-ed-add-audio:hover:not(:disabled,[aria-disabled=true]){background:linear-gradient(var(--fv-ctl-bg),var(--fv-ctl-bg)),var(--fv-ed-timeline,var(--fv-bg));color:var(--fv-fg)} +.fv-studio.fv-editor .fv-ed-add-audio:active:not(:disabled,[aria-disabled=true]){background:linear-gradient(var(--fv-ctl-hover),var(--fv-ctl-hover)),var(--fv-ed-timeline,var(--fv-bg))} /* Ruler: hairline ticks, numbers in the caption size, tabular. */ .fv-studio.fv-editor .fv-ed-ruler{border-bottom-color:var(--fv-line)} .fv-studio.fv-editor .fv-ed-tick{border-left-color:var(--fv-line2)} @@ -227,9 +231,11 @@ /* The heads have their final width from the first frame, before the switches are drawn (they no longer widen on arrival); a language whose longest track name needs more room adds the difference (editor_tracks.js fitHeads). */ @media(min-width:521px){.fv-studio.fv-editor .fv-ed-track-view,.fv-studio.fv-editor .fv-ed-track-view[data-track-switches=true]{--fv-ed-head-width:calc(184px + var(--fv-ed-head-width-extra, 0px))}} -/* Up to 520 px a head is the name alone, centred in the 64 px column (editor.css), without the icon: it keeps the - wide layout's type, but not its left alignment or the room it leaves for the icon, so "Subtitles" fits. */ -@media(max-width:520px){.fv-studio.fv-editor .fv-ed-track-view .fv-ed-track-head{justify-content:center;padding:0 4px}} +/* Up to 520 px a head is the name alone, from the left of the 76 px column, without the icon: it keeps the wide layout's + type, not the room it leaves for the icon, so "Subtitles" fits. Audio 2's head keeps the right 28 px for its remove key + at all times, so the name never moves when the key appears and the key never covers it. */ +@media(max-width:520px){.fv-studio.fv-editor .fv-ed-track-view .fv-ed-track-head{justify-content:flex-start;padding:0 4px} + .fv-studio.fv-editor .fv-ed-track-view .fv-ed-track-head[data-track=a2]{padding-right:28px}} @media(max-width:480px){ .fv-studio.fv-editor .fv-ed-add-audio{padding:0;font-size:0;margin:0 auto;display:grid;place-items:center} .fv-studio.fv-editor .fv-ed-add-audio::before{content:attr(data-sign);display:grid;place-items:center;width:28px;height:28px;font-size:16px;line-height:1;border:1px solid var(--fv-line2);border-radius:var(--fv-r-sm);color:var(--fv-fg2)} @@ -274,7 +280,7 @@ left:0;width:100%;margin:0;padding:0 2px 0 12px;border-radius:0;text-align:left;font-size:0;color:var(--fv-fg3)} .fv-studio.fv-editor .fv-ed-track-view .fv-ed-track-heads>.fv-ed-add-audio::before{content:attr(data-sign);display:grid;place-items:center;flex:none;width:16px;height:16px;margin-right:6px;font-size:14px;line-height:1} .fv-studio.fv-editor .fv-ed-track-view .fv-ed-track-heads>.fv-ed-add-audio::after{content:attr(data-label);min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--fv-fs-1,12px);line-height:16px} - .fv-studio.fv-editor .fv-ed-track-view .fv-ed-track-heads>.fv-ed-add-audio:hover:not(:disabled){background:var(--fv-ctl-bg);color:var(--fv-fg)} + .fv-studio.fv-editor .fv-ed-track-view .fv-ed-track-heads>.fv-ed-add-audio:hover:not(:disabled,[aria-disabled=true]){background:linear-gradient(var(--fv-ctl-bg),var(--fv-ctl-bg)),var(--fv-ed-timeline,var(--fv-bg));color:var(--fv-fg)} } /* A selected clip is outlined on its own row (each clip carries the ring); the box that spanned a picture and its sound across two rows and the gap between them is not drawn (C6). Ranges, gaps and planned parts keep their box. */ @@ -294,19 +300,33 @@ .fv-studio.fv-editor .fv-ed-track-view .fv-ed-track-heads>.fv-ed-add-audio{top:0!important;height:28px;translate:none!important;z-index:3;background:var(--fv-ed-timeline,var(--fv-bg))} } /* Until the timeline module has drawn, the page's placeholder heads take the final head width, so nothing moves when - the rows arrive (heads with switches 184 px, phone width 64 px). */ + the rows arrive (heads with switches 184 px, phone width 76 px). */ .fv-studio.fv-editor .fv-ed-tracks-skeleton>b{width:184px} -@media(max-width:520px){.fv-studio.fv-editor .fv-ed-tracks-skeleton>b{width:64px}} +@media(max-width:520px){.fv-studio.fv-editor .fv-ed-tracks-skeleton>b{width:76px}} /* Remove Audio 2 is not a standing key (CEO-EYES): it takes the place of the Audio 2 head's icon, only while Audio 2 or something on it is selected, or the pointer is over that head or the key. Otherwise it is not there. */ .fv-studio.fv-editor .fv-ed-track-view .fv-ed-track-heads>.fv-ed-add-audio[data-mode=remove]{top:var(--fv-ed-remove-top,0px)!important;left:6px;right:auto;width:28px;height:28px;padding:0;margin:0;justify-content:center;border-radius:8px;background:var(--fv-ed-timeline,var(--fv-bg))} .fv-studio.fv-editor .fv-ed-track-view .fv-ed-track-heads>.fv-ed-add-audio[data-mode=remove]::after{display:none} -.fv-studio.fv-editor .fv-ed-track-view .fv-ed-track-heads>.fv-ed-add-audio[data-mode=remove]::before{margin:0} +/* The remove sign is drawn, not typed: two crossed 1.5 px strokes in the sign's colour, a 10 px square centred in its box, + so it is the same size in every language and state (a typed × took each language's first face). The key keeps its + aria-label for screen readers. */ +.fv-studio.fv-editor .fv-ed-track-view .fv-ed-track-heads>.fv-ed-add-audio[data-mode=remove]::before{margin:0;content:""; + background:linear-gradient(45deg,transparent calc(50% - .75px),currentColor calc(50% - .75px),currentColor calc(50% + .75px),transparent calc(50% + .75px)) center/10px 10px no-repeat, + linear-gradient(-45deg,transparent calc(50% - .75px),currentColor calc(50% - .75px),currentColor calc(50% + .75px),transparent calc(50% + .75px)) center/10px 10px no-repeat} .fv-studio.fv-editor .fv-ed-track-view .fv-ed-track-heads:not([data-hx-a2hover])>.fv-ed-add-audio[data-mode=remove]:not([data-shown=true]):not(:hover){visibility:hidden} .fv-studio.fv-editor .fv-ed-track-view .fv-ed-track-heads[data-hx-a2hover]>.fv-ed-add-audio[data-mode=remove]{visibility:visible} /* The remove key sits beside Audio 2's head, in the rows' coordinates: when the rows scroll it moves with the heads. */ .fv-studio.fv-editor .fv-ed-track-view[data-vertical-overflow=true] .fv-ed-track-heads>.fv-ed-add-audio[data-mode=remove]{translate:0 var(--fv-ed-track-offset,0px)!important} -@media(max-width:520px){.fv-studio.fv-editor .fv-ed-track-view .fv-ed-track-heads>.fv-ed-add-audio[data-mode=remove]{left:calc(100% - 32px)}} +/* From 521 px the key stands left of Audio 2's name, flush with it: its keyboard ring is drawn inside the key, 2 px in from + its edge, so the ring keeps 2 px from the name and 2 px from the 16 px sign, and nothing moves. (Up to 520 px a11y.js + already draws it inside.) The id-weight :not() is a11y.css's own way to outweigh its ring rule. */ +@media(min-width:521px){.fv-studio.fv-editor .fv-ed-track-view .fv-ed-track-heads>.fv-ed-add-audio[data-mode=remove]:focus-visible:not(#fv-ring-inside){outline-offset:-4px!important}} +/* Up to 520 px the key sits after Audio 2's name, in the room its head keeps: a 24 px sign box, 2 px from the column's edge. + The press area is the key's 44 px height (a11y.css), centred on the row; it never reaches over the name. */ +@media(max-width:520px){ + .fv-studio.fv-editor .fv-ed-track-view .fv-ed-track-heads>.fv-ed-add-audio[data-mode=remove]{left:calc(100% - 26px);width:24px;height:44px;margin-top:-8px;font-size:0} + .fv-studio.fv-editor .fv-ed-track-view .fv-ed-track-heads>.fv-ed-add-audio[data-mode=remove]::before{position:absolute;inset:0;margin:auto;display:block;box-sizing:border-box;width:24px;height:24px;border:1px solid var(--fv-line2);border-radius:var(--fv-r-sm)} +} /* A track below the timeline's foot: a fade says there is more until it is scrolled to (editor_tracks.js fitRows). */ .fv-ed-track-view[data-track-below=true]::after{content:"";position:absolute;left:0;right:0;bottom:0;height:24px;pointer-events:none;z-index:7;background:linear-gradient(to bottom,transparent,var(--fv-ed-timeline,var(--fv-bg)))} diff --git a/web/editor_tracks.js b/web/editor_tracks.js index a93ed4d5..68ceea6d 100644 --- a/web/editor_tracks.js +++ b/web/editor_tracks.js @@ -6,6 +6,7 @@ import {displayTracks, isText, isTextTrack, textDropLocked} from './editor_text_ // These exports deliberately have no DOM dependencies, so input arithmetic can // be checked in Node with the same code that runs in the browser. import * as model from './editor_model.js'; +import {stemsHeldText} from './editor_lifecycle.js'; import {timeEstimate} from './editor_genbar.js'; import {clipPictureSize, updatePictureBadge} from './editor_frame.js'; import {createSelectionGestures, isMultiple, isTyping} from './editor_select.js'; @@ -800,6 +801,9 @@ export function createTracks(host, {state, sources = {}, t = translatorFor(null, for (const [id, item] of clips) if (!retained.has(id)) { item.component?.dispose(); item.element.remove(); clips.delete(id); progresses.delete(id); } heads.append(addAudio); addAudio.disabled = tracks.find(track => track.id === 'a2')?.clips.some(busy) || false; + // Audio 2 stays while the separated tracks hold parts: the key is greyed but stays focusable, so its reason can be read. + const stemsHeld = twoAudio && !addAudio.disabled && model.separatedTracksUsed(state.record); + if (stemsHeld) addAudio.setAttribute('aria-disabled', 'true'); else addAudio.removeAttribute('aria-disabled'); // With Audio 2 present the key removes it: it shows beside that track's head only while Audio 2 (or something on it) // is selected, or the pointer is over its head; it is not there the rest of the time. addAudio.dataset.mode = twoAudio ? 'remove' : 'add'; @@ -808,7 +812,8 @@ export function createTracks(host, {state, sources = {}, t = translatorFor(null, // Wide heads draw the sign in the icon column and these words in the name column, like a track head. addAudio.dataset.label = twoAudio ? t('Remove Audio 2', '移除声音 2') : t('Audio track', '声音轨'); applyTip(addAudio, twoAudio ? 'removeAudio' : 'addAudio', t, - {why: addAudio.disabled ? t('A clip on Audio 2 is generating; wait for it to finish', '声音 2 上有片段在生成,等它完成') : ''}); + {why: addAudio.disabled ? t('A clip on Audio 2 is generating; wait for it to finish', '声音 2 上有片段在生成,等它完成') + : stemsHeld ? stemsHeldText(t) : ''}); addAudio.setAttribute('aria-label', addAudio.textContent); // Without Audio 2 the guide points at the button that adds it. if (twoAudio) delete addAudio.dataset.tourId; else addAudio.dataset.tourId = 'audio-a2-track'; @@ -1480,6 +1485,7 @@ export function createTracks(host, {state, sources = {}, t = translatorFor(null, on(addAudio, 'pointerdown', event => event.stopPropagation()); const activateAudio = event => { event.stopPropagation(); + if (addAudio.getAttribute('aria-disabled') === 'true') { actions.notify?.(stemsHeldText(t)); return; } if (!addAudio.disabled) { const removing = state.record.tracks.some(track => track.id === 'a2'); attempt(removing ? t('Remove Audio 2', '移除声音 2') : t('Add audio track', '添加声音轨'), diff --git a/web/error_panel.js b/web/error_panel.js index a0d897ab..ad50743d 100644 --- a/web/error_panel.js +++ b/web/error_panel.js @@ -1,5 +1,5 @@ // Shared by the Studio and graph view. Text only; never render exception HTML. -import { holdNames, plainText } from './i18n.js'; +import { holdNames, holdShortWordsIn, plainText } from './i18n.js'; import {readOtherUsage, otherUsageText} from './other_usage.js'; import {pageRepair, repairAction, repairButton} from './repair_hint.js'; import {detectBrowserExtension, browserExtensionAdvice, extensionSteps, isNetworkTypeError, connectionLostText, engineNotRunning, engineNotRunningText, engineNotResponding, engineNotRespondingText, isRequestTimeout, requestTimeoutText, requestTimeoutAction} from './browser_extension.js'; @@ -715,6 +715,7 @@ function showFailureDialog(report, t) { if (next.textContent.includes(button)) { next.textContent = next.textContent.replace(button, t(...to)); break; } } } + holdShortWordsIn(next); } const close = document.createElement('button'); close.type = 'button'; close.className = 'fv-failure-primary'; close.textContent = t('Close', '关闭'); close.onclick = () => dialog.close(); @@ -942,6 +943,7 @@ export function createErrorPanel(t, route = null) { }); } title.textContent = advice.title; explanation.textContent = advice.summary; explanation.hidden = !advice.summary; action.textContent = advice.action; + for (const node of [title, explanation, action]) holdShortWordsIn(node); element.querySelector('.fv-extension-steps')?.remove(); if (advice.kind === 'browser-extension') action.after(extensionSteps(advice)); knownAdvice = advice.plain && PLAIN_ERRORS.some(error => error.key === advice.kind) ? advice.summary : ''; adviceShown = false; diff --git a/web/feature_tour.css b/web/feature_tour.css index 10be7488..815e9830 100644 --- a/web/feature_tour.css +++ b/web/feature_tour.css @@ -119,6 +119,13 @@ .fv-tour-pop .fv-tour-pair .fv-tour-to{display:grid;place-items:center;color:var(--fv-fg3)} .fv-tour-pop .fv-tour-live{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap} @media(prefers-reduced-motion:reduce){.fv-tour-layer,.fv-tour-layer *{transition:none!important;animation:none!important}.fv-tour-layer .fv-tour-ghost{transform:none;opacity:1}} +/* A wide card too narrow for its example beside 160 px of words: the example above the title, the whole width; buttons + that do not fit one line in the card's shape: one under another, at the right (data-stack, fitCard in feature_tour.js). */ +.fv-tour-layer .fv-tour-pop[data-shape=wide][data-stack=true]{grid-template-columns:minmax(0,1fr);row-gap:var(--fv-sp-12,12px)} +.fv-tour-pop[data-shape=wide][data-stack=true] .fv-tour-body{padding:var(--fv-sp-4,4px)} +/* The foot lists the shapes whose line does not hold its buttons; they stack only while the card has one of those shapes. */ +.fv-tour-pop[data-shape=stand] .fv-tour-foot[data-stack~=stand],.fv-tour-pop[data-shape=wide] .fv-tour-foot[data-stack~=wide]{flex-direction:column;align-items:flex-end} +.fv-tour-pop[data-shape=stand] .fv-tour-foot[data-stack~=stand] .fv-tour-grow,.fv-tour-pop[data-shape=wide] .fv-tour-foot[data-stack~=wide] .fv-tour-grow{display:none} /* Phones: the card spans the window less 12 px a side; the wide card's example shrinks; 40 px buttons. */ @media(max-width:719px){ .fv-tour-layer .fv-tour-pop,.fv-tour-layer .fv-tour-pop[data-shape=wide],.fv-tour-layer .fv-tour-pop[data-shape=text]{width:calc(100vw - 24px);max-width:none} diff --git a/web/feature_tour.js b/web/feature_tour.js index 1ab67e95..2dacc57e 100644 --- a/web/feature_tour.js +++ b/web/feature_tour.js @@ -3,7 +3,7 @@ import {readGuideRecord, saveGuideRecord, guideRecord, CARDS_OFF} from './first_ import './glass/library.js'; import {openAnchor, anchorOpen, closeAnchor} from './feature_tour_layer.js'; import {reducedMotion} from './context_menu.js'; -import { isChinese, translator, fill } from './i18n.js'; +import { isChinese, translator, fill, holdShortWordsIn } from './i18n.js'; import { localized } from './i18n_tables.js'; export const TOUR_TEXT = { @@ -21,6 +21,40 @@ const el = (tag, cls, text) => { const node = document.createElement(tag); if (c const tip = (node, name, use = '', key = '') => { node.dataset.fvTipName = name; if (use) node.dataset.fvTipUse = use; if (key) node.dataset.fvTipKey = key; return node; }; const contexts = new Map(); let active = null, opening = false; +// A narrow card: its example goes above the title where the column beside it would leave the words less than 160 px +// (data-stack on the card), and its buttons stand one under another, at the right, in each shape whose line does not +// hold them (data-stack on its foot lists those shapes; the stylesheet stacks them only in a shape it lists). The +// decision is the same whatever shape, height and place the card has right now: the words are measured in the wide +// shape laid out side by side, the buttons in every shape the card may take (shapes, as the layer is given them), each +// with the card's own decision applied. The tour layer re-places the card, and may change its +// shape, whenever the card's size changes; a decision that followed the card's current shape turned over at each +// re-placing and the card went back and forth. Measured again when the card's size changes (the same answer stops it +// there) and once the page's fonts have loaded. Returns the stop. +function fitCard(pop, body, foot, shapes = ['stand']) { + if (!pop || !body || !foot) return () => {}; + const set = (node, value) => { if (value && node.dataset.stack !== value) node.dataset.stack = value; else if (!value && node.dataset.stack !== undefined) delete node.dataset.stack; }; + const fit = () => { + if (!pop.isConnected) return; + const shape = pop.dataset.shape, was = pop.dataset.stack, wasFoot = foot.dataset.stack; + delete pop.dataset.stack; delete foot.dataset.stack; + let stack = false; const footStack = []; + if (shapes.includes('wide')) { pop.dataset.shape = 'wide'; stack = body.getBoundingClientRect().width < 160; } + for (const tried of shapes) { + pop.dataset.shape = tried; + if (tried === 'wide' && stack) pop.dataset.stack = 'true'; else delete pop.dataset.stack; + if (foot.scrollWidth > foot.clientWidth + 0.5) footStack.push(tried); + } + // Put back what was there, then write only what changed. + if (shape === undefined) delete pop.dataset.shape; else pop.dataset.shape = shape; + if (was === undefined) delete pop.dataset.stack; else pop.dataset.stack = was; + if (wasFoot !== undefined) foot.dataset.stack = wasFoot; + set(pop, stack ? 'true' : ''); set(foot, footStack.join(' ')); + }; + const watch = typeof ResizeObserver === 'function' ? new ResizeObserver(fit) : null; + watch?.observe(pop); fit(); + document.fonts?.ready?.then(fit); + return () => watch?.disconnect(); +} export function registerTourWorkspace(context) { contexts.set(context.dialog, context); return () => { contexts.delete(context.dialog); if (active?.owner === context.dialog) active.close(); if (anchorOpen()?.owner === context.dialog) closeAnchor('now'); }; @@ -240,10 +274,10 @@ function cardMedia(card, videos, t, text, reduced) { function openAnchorCard({api, cn, loaded, owner, automatic = true, badge = ''}) { const t = translator(cn), text = localized(CARD_TEXT, t), reduced = reducedMotion(); const scope = owner?.isConnected ? owner : document; - let index = 0, media = null, layer = null, finished = false; + let index = 0, media = null, layer = null, finished = false, unfit = () => {}; const stopAll = () => { media?.stop?.(); for (const {videos} of loaded) for (const video of videos) video.pause(); }; const finish = reason => { - if (reason === 'replace' || finished) return; finished = true; stopAll(); release(loaded); active = null; + if (reason === 'replace' || finished) return; finished = true; unfit(); stopAll(); release(loaded); active = null; // Putting a card away counts as seen; a card that left with its view, or whose control went away, comes again. if (!['leave', 'gone', 'dialog'].includes(reason)) markTourSeen(api, loaded.slice(0, index + 1).map(item => item.card)); }; @@ -283,10 +317,12 @@ function openAnchorCard({api, cn, loaded, owner, automatic = true, badge = ''}) const done = button(text.gotIt, 'fill', [text.gotIt, text.gotItUse, 'Esc']); done.dataset.fvTourPrimary = ''; done.onclick = () => layer?.close('fade', 'dismiss'); foot.append(done); } - body.append(head, el('p', 'fv-tour-text', localized(card.line, t)), live, foot); + body.append(holdShortWordsIn(head), holdShortWordsIn(el('p', 'fv-tour-text', localized(card.line, t))), live, foot); const keep = found?.keep || []; - layer = openAnchor({owner, target: found ? (TARGETS[card.target] || found.node) : null, keep, level: 2, shapes: card.quality ? ['stand'] : ['stand', 'wide'], + const shapes = card.quality ? ['stand'] : ['stand', 'wide']; + layer = openAnchor({owner, target: found ? (TARGETS[card.target] || found.node) : null, keep, level: 2, shapes, content: [media.box, body], ghost: card.target === 'sound-range', focus, label: title.id, onClose: finish}); + unfit(); unfit = fitCard(layer?.pop, body, foot, shapes); if (!reduced) for (const video of media.playing()) video.play().catch(() => {}); for (const video of videos) video.onerror = () => { if (loaded[index]?.videos.includes(video)) layer?.close('now', 'gone'); }; } diff --git a/web/freevideo.js b/web/freevideo.js index 2c99b063..183a29d9 100644 --- a/web/freevideo.js +++ b/web/freevideo.js @@ -6,6 +6,9 @@ import { installNativeErrorGuard } from './native_errors.js'; import { installTranslateGuard } from './translate_guard.js'; import { app } from "../../scripts/app.js"; import { api } from "../../scripts/api.js"; +// Through the sign-in proxy every change ComfyUI's page and FreeVideo make proves this device (web/proxy_proof.js; it +// also installs itself when ComfyUI loads it, this is in case it loads later). +import('./proxy_proof.js').then(({installProof}) => installProof(api)).catch(() => {}); import { openEditorView } from './editor_loader.js'; import { beginWorkspaceRestore, finishWorkspaceRestore, waitForLauncherRestore } from './workspace_restore.js'; import { skinSelect } from './fv_select.js'; diff --git a/web/glass/editor.css b/web/glass/editor.css index c01c4886..eca1b6f8 100644 --- a/web/glass/editor.css +++ b/web/glass/editor.css @@ -62,7 +62,7 @@ dialog.fv-studio.fv-editor:not([open]){display:none!important} .fv-editor .fv-ed-project-row .fv-ed-name{border-radius:var(--fv-r-md);color:var(--fv-fg)} .fv-editor .fv-ed-project-row .fv-ed-name:hover{background:var(--fv-ctl-bg)} .fv-editor .fv-ed-save-state{background:var(--fv-ctl-bg);color:var(--fv-fg3)} -.fv-editor .fv-ed-save-state[data-state=unsaved]{background:var(--fv-warn-soft);color:var(--fv-warn)} +.fv-editor .fv-ed-save-state[data-state=unsaved]{background:color-mix(in srgb,var(--fv-warning) 14%,transparent);color:var(--fv-warning)} .fv-studio.fv-editor .fv-ed-export-box>.fv-ed-export-main,.fv-studio.fv-editor .fv-primary{background:var(--fv-accent-fill);border-color:transparent;color:#fff; box-shadow:inset 0 1px 0 rgb(255 255 255 / .22),inset 0 -1px 0 rgb(0 0 0 / .12),0 8px 20px -10px rgb(15 116 214 / .75)} .fv-studio.fv-editor .fv-ed-export-box>.fv-ed-export-main:hover,.fv-studio.fv-editor .fv-primary:hover{background:var(--fv-accent-fill-hover,var(--fv-accent-fill));color:#fff} diff --git a/web/glass/settings.css b/web/glass/settings.css index d8ee9e8c..318168cb 100644 --- a/web/glass/settings.css +++ b/web/glass/settings.css @@ -80,6 +80,18 @@ dialog.fv-set .st-meter .l{display:flex;justify-content:space-between;align-item dialog.fv-set .st-meter .l span{color:var(--fv-fg2)} dialog.fv-set .st-meter .l b{font-weight:var(--fv-fw-2);color:var(--fv-fg);font-size:var(--fv-fs-1);font-feature-settings:var(--fv-num)} dialog.fv-set .st-meter .st-bar{margin-top:var(--fv-sp-8)} +/* A value still being read keeps its place without a mark for its first 300 ms, then shows a thin skeleton about as + wide as its usual value, on the middle of the line (its words stay for a screen reader); the video memory bar waits + the same way. One this computer does not give is said in quieter words. The skeleton fades in and out where motion + is welcome and stays still otherwise. */ +dialog.fv-set .st-meter .l b.is-wait{flex:none;align-self:center;box-sizing:border-box;width:var(--st-skel,48px);height:12px;overflow:hidden;white-space:nowrap;font-size:0;border-radius:var(--fv-r-xs);color:transparent;user-select:none;-webkit-user-select:none} +dialog.fv-set .st-meter .l b.is-wait.is-show{background:var(--fv-line2)} +dialog.fv-set .st-meter .st-bar.is-wait:not(.is-show){visibility:hidden} +dialog.fv-set .st-meter .l b.is-none{font-weight:var(--fv-fw-1);color:var(--fv-fg2);font-feature-settings:normal;text-align:end} +@media (prefers-reduced-motion:no-preference){ + dialog.fv-set .st-meter :is(.l b.is-wait,.st-bar.is-wait).is-show{animation:st-wait 1.4s ease-in-out infinite} +} +@keyframes st-wait{50%{opacity:.6}} dialog.fv-set .st-quick{padding:var(--fv-sp-4) var(--fv-sp-8)} dialog.fv-set .st-qi{display:grid;grid-template-columns:var(--fv-icon-s) minmax(0,1fr);align-items:center;column-gap:var(--fv-sp-12);width:100%;height:var(--fv-ctl-l);padding:0 var(--fv-sp-12); border-radius:var(--fv-rad-ctl);text-align:left;color:var(--fv-fg);transition:background-color var(--fv-dur-1) var(--fv-ease-out),scale var(--fv-dur-press) var(--fv-ease-out)} @@ -296,7 +308,8 @@ dialog.fv-set .st-hic.is-accent{background:var(--fv-accent-soft);color:var(--fv- @media (prefers-reduced-motion:no-preference){dialog.fv-set .st-hic.is-run .fv-i{animation:st-bob 1.4s var(--fv-ease-out) infinite}} @keyframes st-bob{50%{translate:0 2px}} dialog.fv-set .st-ht{min-width:0} -dialog.fv-set .st-ht h2{margin:0;font-size:var(--fv-fs-3);line-height:var(--fv-lh-3);font-weight:var(--fv-fw-3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap} +/* The card's title wraps instead of being cut short: a long one (an error, a longer language, a phone) takes a second line. */ +dialog.fv-set .st-ht h2{margin:0;font-size:var(--fv-fs-3);line-height:var(--fv-lh-3);font-weight:var(--fv-fw-3);overflow-wrap:break-word;hyphens:auto;text-wrap:pretty} dialog.fv-set .st-ht p{margin:var(--fv-sp-2) 0 0;font-size:var(--fv-fs-1);line-height:var(--fv-lh-1);color:var(--fv-fg3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap} dialog.fv-set .st-ht p .st-path{color:var(--fv-fg3)} dialog.fv-set .st-ha{display:flex;align-items:center;gap:var(--fv-sp-8)} @@ -437,8 +450,8 @@ dialog.fv-set .st-mi[aria-checked=true] .ck{visibility:visible} dialog.fv-set .st-mhead{position:relative;display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--fv-sp-16)} dialog.fv-set .st-picker{height:var(--fv-touch);padding:0 var(--fv-sp-16);border-radius:var(--fv-rad-pill);background:rgb(var(--fv-tint) / var(--fv-a1));box-shadow:inset 0 0 0 1px var(--fv-edge);color:var(--fv-fg);font-weight:var(--fv-fw-3)} dialog.fv-set .st-mhead .st-close{width:var(--fv-touch);height:var(--fv-touch)} - dialog.fv-set .st-hero{height:288px} - dialog.fv-set .st-hero[data-state=failed],dialog.fv-set .st-hero[data-state=readerr]{height:auto;min-height:288px} + /* At least the phone card's height; a title wrapped onto more lines makes it taller instead of squeezing its body. */ + dialog.fv-set .st-hero{height:auto;min-height:288px} dialog.fv-set .st-hero-top{grid-template-columns:var(--fv-sp-40) minmax(0,1fr);row-gap:var(--fv-sp-12)} dialog.fv-set .st-ha{grid-column:1 / -1;flex-wrap:wrap} dialog.fv-set .st-ha .st-btn{flex:1;height:var(--fv-touch)} diff --git a/web/health.js b/web/health.js index 9e1159b5..49dd6bf2 100644 --- a/web/health.js +++ b/web/health.js @@ -15,7 +15,13 @@ const t = (en, zh) => cn ? zh : en; // t for the other modules' texts, which hold {name} placeholders. const filled = (en, zh, values) => (cn ? zh : en).replace(/\{(\w+)\}/g, (whole, name) => values && Object.hasOwn(values, name) ? String(values[name]) : whole); // launcher.js removes this flag during setup; read it before that. -const launchVisit = query.get('freevideo') === 'launch'; +let launchVisit = query.get('freevideo') === 'launch'; +// A refresh of the tab the launcher opened: the address no longer has the flag, but the tab keeps freevideo.launched +// (launch_visit.js, read here directly because this file imports nothing at load). Whether it counts as the launch is +// decided in check(), as launcher.js decides it. +const launchMark = !launchVisit && (() => { + try { return sessionStorage.getItem('freevideo.launched') === '1'; } catch { return false; } +})(); // Every script this folder ships; a test keeps the list in step with web/*.js. export const MODULES = ['video_enlarge.js', 'batch_line_media.js', 'user_store_mirror.js', 'audio_original.js', 'chat_data.js', 'phone_model.js', 'phone.js', 'lan_access.js', 'monitor_panel.js', 'qrcodegen.js', 'agent_activity.js', 'agent_tasks.js', 'agent_confirm_settings.js', 'private_pin.js', 'private_settings.js', 'agent_connect.js', 'agent_session.js', 'autopilot.js', 'autopilot_chat.js', 'chat_attachments.js', 'autopilot_conversations.js', 'browser_extension.js', 'caret_rect.js', 'chain_support.js', 'chain_rules.js', 'timed_prompt.js', 'capability_view.js', 'cast_generate.js', 'cast_mention.js', 'cast_overlay.js', 'cast_source.js', 'compatibility.js', 'entry_showcase.js', 'engine_exit.js', 'error_panel.js', 'first_run_guide.js', 'fonts.js', 'freevideo.js', 'generation_progress.js', 'editor.js', 'editor_actions.js', 'editor_lifecycle.js', 'editor_adjust.js', 'editor_adjust_picture.js', 'editor_picture_fields.js', 'editor_picture_session.js', 'editor_preview_picture.js', 'editor_entry.js', 'editor_expand.js', 'editor_export_dialog.js', 'editor_first_frame.js', 'editor_media_references.js', 'editor_references.js', 'middle_frames.js', 'editor_genbar.js', 'editor_duration.js', 'editor_geometry.js', 'editor_library.js', 'editor_menu.js', 'editor_stems.js', 'editor_record.js', 'editor_record_model.js', 'editor_voice.js', 'editor_voice_install.js', 'editor_voice_model.js', 'editor_voice_store.js', 'editor_model.js', 'editor_frame.js', 'editor_player.js', 'editor_room.js', 'editor_select.js', 'editor_state.js', 'editor_store.js', 'editor_tracks.js', 'editor_generation.js', 'editor_transport.js', 'editor_transport_model.js', 'editor_audio.js', 'editor_audio_model.js', 'editor_audio_notes.js', 'editor_audio_replace.js', 'editor_audio_rules.js', 'editor_music.js', 'editor_music_model.js', 'editor_speed.js', 'editor_speed_model.js', 'editor_failure.js', 'editor_header_fit.js', 'studio_header_fit.js', @@ -33,7 +39,7 @@ export const MODULES = ['video_enlarge.js', 'batch_line_media.js', 'user_store_m 'studio_console.js', 'studio_stage.js', 'prompt_library.js', 'autopilot_panels.js', 'autopilot_tips.js', 'autopilot_history.js', 'a11y.js', 'topbar.js', 'view_switch_place.js', 'view_navigation_fit.js', 'editor_tips.js', 'editor_narration.js', 'editor_narration_model.js', 'editor_beats_model.js', 'empty_frame.js', 'studio_compare.js', 'image_library.js', 'fv_select.js', 'preview_style.js', 'feature_tour_layer.js', 'settings_room.js', 'settings_kit.js', 'settings_words.js', 'language_picker.js', - 'image_works.js', 'cast_photo.js', 'editor_opening.js', 'editor_poster.js', 'topbar_state.js', 'preload_setting.js', 'private_offers.js', 'cast_face_crop.js', 'cast_from_image.js', 'context_fallback.js', 'studio_warm.js', + 'image_works.js', 'cast_photo.js', 'editor_opening.js', 'editor_poster.js', 'topbar_state.js', 'preload_setting.js', 'private_offers.js', 'proxy_proof.js', 'cast_face_crop.js', 'cast_from_image.js', 'context_fallback.js', 'studio_warm.js', 'pose_body.js', 'pose_props.js', 'pose_stage.js', 'pose_tool.js', 'release_media.js', 'ui_speed.js', 'lora_menu.js', 'upscale_offer.js', 'user_message.js', 'workflow_drafts.js', 'comfy_templates.js']; const sleep = ms => new Promise(resolve => setTimeout(resolve, ms)); @@ -496,7 +502,7 @@ function withdrawWhenOpened(missing) { if (!workspaceOpened()) return; clearInterval(timer); const rest = lastProblems.filter(problem => problem !== missing); - if (rest.every(problem => problem.advice === 'plugin')) { card?.remove(); card = null; lastProblems = []; send('ready', []); } + if (rest.every(problem => problem.advice === 'plugin')) { removeCard(); lastProblems = []; send('ready', []); } else { show(rest); send('error', rest); } }, 250); } @@ -680,9 +686,21 @@ function addQuoteFaces() { const dismissKey = problems => 'freevideo.health.closed:' + problems.map(p => p.text).sort().join('|'); const dismissed = problems => { try { return sessionStorage.getItem(dismissKey(problems)) === '1'; } catch { return false; } }; +// The card goes; when the focus was in it, it returns to the page's main area (the view in front, or ComfyUI's +// canvas), never to the bare page where the next key would reach nothing. +function removeCard() { + const inside = !!card?.contains(document.activeElement); + card?.remove(); card = null; + if (!inside) return; + const host = window.FreeVideoShell?.overlayHost?.(); + const main = host && host !== document.body && host.isConnected ? host : document.getElementById('graph-canvas'); + if (!main) return; + if (main.tabIndex < 0 && !main.hasAttribute('tabindex')) main.tabIndex = -1; + main.focus({preventScroll: true}); +} function dismiss() { try { if (lastProblems.length) sessionStorage.setItem(dismissKey(lastProblems), '1'); } catch { /* Shown again after a reload. */ } - card?.remove(); card = null; + removeCard(); } // On the window in the capture phase, registered before any view opens: a view's key routing (dialog_keys) stops the // event there, and the card's Esc must not close the view under it. @@ -701,7 +719,7 @@ function rawDetails(problems) { function show(problems, asked = false) { opening?.finish(); opening = null; lastProblems = problems; - if (!asked && dismissed(problems)) { card?.remove(); card = null; return; } + if (!asked && dismissed(problems)) { removeCard(); return; } addQuoteFaces(); card?.remove(); card = document.createElement('section'); @@ -824,7 +842,10 @@ function send(state, problems) { if (same === sent) return; sent = same; const body = JSON.stringify(Object.keys(openingTimes).length ? {...report, opening: {...openingTimes}} : report); - fetch(new URL('../../api/freevideo/launcher/ui', base), {method: 'POST', headers: {'Content-Type': 'application/json'}, body, keepalive: true}) + // Through the sign-in proxy the change carries this device's proof: the rule of web/proxy_proof.js, written out here + // because this file imports nothing at load. + const proof = /(?:^|;\s*)freevideo_proof=([0-9a-f]{64})(?:;|$)/.exec(document.cookie || '')?.[1]; + fetch(new URL('../../api/freevideo/launcher/ui', base), {method: 'POST', headers: {'Content-Type': 'application/json', ...(proof ? {'X-FreeVideo-CSRF': proof} : {})}, body, keepalive: true}) .catch(() => { /* An older or stopped server; the card on the page still shows the problem. */ }); } document.addEventListener('visibilitychange', async () => { @@ -851,7 +872,24 @@ async function check() { // freevideo.js marks itself ready in its setup; launcher.js reports once // the workflow is open and in front. await waitFor(() => window.FreeVideoUI?.ready, 10000); - const launched = launchVisit ? await waitFor(() => reports.find(r => r.type === 'launch'), 30000) : null; + // A refresh of the launcher's tab is the launch only where launcher.js takes it so: where ComfyUI keeps no workflow + // drafts. With drafts on, ComfyUI brings its own tabs back and launcher.js sends no report, so nothing is waited for. + if (launchMark) { + const drafts = await import('./workflow_drafts.js').catch(() => null); + try { launchVisit = drafts?.workflowPersist(app) === false; } catch { launchVisit = false; } + } + // A slow machine's first start can take far longer to open the workflow than half a minute. A page that is ready and + // has seen no failure of launcher.js waits as long as the opening screen may stay (OPENING_LIMIT from the page's + // start), as the workspace check below does; otherwise half a minute, as before. + let launched = null; + if (launchVisit) { + const since = Date.now(); + // launcher.js could not load (named by its file), or its setup failed (named by its extension, as ComfyUI names it). + const launcherFailed = () => seen.some(row => /(^|[\/\s])launcher\.js\b|\bFreeVideo\.Launcher\b/.test(row.text)); + await waitFor(() => (launched = reports.find(r => r.type === 'launch')) + || (Date.now() - since >= 30000 && (!window.FreeVideoUI?.ready || launcherFailed())), + Math.max(30000, openingLimit() - performance.now())); + } // FreeVideo is in front: the page itself now says what it is doing. if (window.FreeVideoUI?.ready) { opening?.finish(); opening = null; } // Opening the workspace waits for an animation frame. @@ -866,6 +904,8 @@ async function check() { // FreeVideo's delays it. Give it the rest of the minute before naming it. if (!window.FreeVideoUI?.ready && !problems.length) await waitFor(() => window.FreeVideoUI?.ready, 50000); opening?.finish(); opening = null; + // launcher.js has not said that the workflow opened. It may still say so later: the card then takes this back. + const notReported = {text: t('The page did not finish loading. Reload and try again.', '页面未能加载完成,请刷新后再试。'), detail: 'The FreeVideo workflow did not open: launcher.js did not report back.', advice: 'reload'}; const notStarted = {text: t('The page did not finish loading. Reload and try again.', '页面未能加载完成,请刷新后再试。'), detail: 'FreeVideo’s scripts loaded, but ComfyUI did not start them.', advice: 'reload'}; if (!window.FreeVideoUI?.ready && !problems.length) { problems.push(notStarted); @@ -874,14 +914,14 @@ async function check() { if (!window.FreeVideoUI?.ready) return; clearInterval(timer); if (!card || !lastProblems.length || !lastProblems.every(p => p === notStarted || p.advice === 'plugin')) return; - card.remove(); card = null; lastProblems = []; + removeCard(); lastProblems = []; send('ready', []); }, 1000); } if (!problems.length) problems.push(...await diagnoseStyles()); let checkStudio = false; if (launchVisit && !problems.length) { - if (!launched) problems.push({text: t('The page did not finish loading. Reload and try again.', '页面未能加载完成,请刷新后再试。'), detail: 'The FreeVideo workflow did not open: launcher.js did not report back.', advice: 'reload'}); + if (!launched) problems.push(notReported); else if (launched.error) problems.push(reportText(launched)); else if (!studioWorkflow(app.graph)) problems.push({text: t('The interface opened another workspace; FreeVideo is in another tab.', '界面打开了另一个工作区,FreeVideo 在其他标签页中。'), detail: 'ComfyUI shows another workflow.', advice: 'relaunch'}); else checkStudio = true; @@ -894,6 +934,13 @@ async function check() { } // Later failures, such as the workspace failing to open from a node. listener = item => { + if (item.type === 'launch' && !item.error && lastProblems.includes(notReported)) { + // The workflow opened after all, later than the check waited: the card no longer says it did not. + const rest = lastProblems.filter(problem => problem !== notReported); + if (rest.every(problem => problem.advice === 'plugin')) { removeCard(); lastProblems = []; send('ready', []); } + else { show(rest); send('error', rest); } + return; + } if (item.type !== 'error') return; // Opening from the menu is a click the user just made: its failure leads the card and shows even after an earlier card was closed. const asked = item.where === 'menu', fresh = reportText(item); @@ -928,6 +975,9 @@ async function check() { problems.push(...lastProblems); // Started while this check was waiting for the page to be in front. if (window.FreeVideoUI?.ready && problems.includes(notStarted)) problems.splice(problems.indexOf(notStarted), 1); + // Reported while this check was waiting for the page to be in front. + if (problems.includes(notReported) && reports.some(item => item.type === 'launch' && !item.error)) + problems.splice(problems.indexOf(notReported), 1); if (problems.length) { problems.push(...pluginErrors()); show(distinct(problems)); send('error', distinct(problems)); diff --git a/web/i18n.js b/web/i18n.js index d1dca355..bbea5380 100644 --- a/web/i18n.js +++ b/web/i18n.js @@ -68,13 +68,16 @@ export const pageLanguage = () => LANGUAGE === 'zh-Hans' ? 'zh-CN' : LANGUAGE; // Names held together on screen. The language files and the code keep plain text; what the page shows holds a button's // or a level's name on one line: a name in paired quotes (any language's marks, up to 32 characters) and a quality // level's Chinese name get a word joiner (U+2060) between ideographs and no-break spaces, as the launcher's t() does. +// Quotes are paired whatever their length; a longer quoted name is left as written (it may wrap), so its closing mark +// never pairs with the next name's opening mark and the words between two names are never held as one. // Copying and reports turn it back into plain text (plainText). const ideograph = ch => { const n = ch.codePointAt(0); return n >= 0x2e80 && n <= 0x9fff || n >= 0xf900 && n <= 0xfaff || n >= 0x20000; }; const holdName = name => { const chars = Array.from(name.replace(/\u2060/g, '').replace(/ /g, '\u00a0')); // held once, also when held text is filled into another return chars.map((c, i) => i && (ideograph(c) || ideograph(chars[i - 1])) ? '\u2060' + c : c).join(''); }; -const QUOTED = /"([^"\n]{1,32})"|“([^“”\n]{1,32})”|「([^「」\n]{1,32})」|『([^『』\n]{1,32})』|«([^«»\n]{1,32})»|„([^„“”\n]{1,32})“/g; +const QUOTED = /"([^"\n]+)"|“([^“”\n]+)”|「([^「」\n]+)」|『([^『』\n]+)』|«([^«»\n]+)»|„([^„“”\n]+)“/g; +const HELD_NAME_MAX = 32; // The quality levels' names as the Chinese files write them (Simplified and Traditional), held by value wherever they stand. export const LEVEL_NAMES = ['极速档', '轻量档', '标准档', '精细档', '极致档', '極速檔', '輕量檔', '標準檔', '精細檔', '極致檔']; const LEVELS = new RegExp(LEVEL_NAMES.join('|'), 'g'); @@ -121,10 +124,123 @@ export function holdNamesIn(root) { } return root; } +// Short words held to the word after them: Russian and Ukrainian set a one- or two-letter preposition, conjunction or +// negation ("в", "с", "и", "не", "на", "від") on the line of the word it belongs to, never at the end of a line. +// Words that lean on the word before them ("же", "ли", "бы") are not in the lists. +export const SHORT_WORDS = Object.freeze({ + ru: Object.freeze(['в', 'во', 'к', 'ко', 'с', 'со', 'о', 'об', 'от', 'до', 'по', 'за', 'на', 'из', 'у', 'и', 'а', 'но', 'да', 'не', 'ни']), + uk: Object.freeze(['в', 'у', 'з', 'із', 'зі', 'о', 'до', 'на', 'по', 'за', 'від', 'і', 'й', 'а', 'та', 'чи', 'не', 'ні']), +}); +// What a held word may not be held into or out of: names already held whole, inputs, code and the notice's quoted name. +// .st-path: a folder or file path shown for copying (Settings); [data-fv-plain]: other things the user named. +const KEEP_SKIP = '.fv-keep, .fv-name, .fv-toast-name, [contenteditable="true"], input, textarea, select, script, style, code, kbd, pre, svg, .st-path, [data-fv-plain]'; +// An element that may move into the held piece with the word before it: inline words, never a control or a link. +const KEEP_WITH = '.fv-name, .fv-book-ctl, b, strong, em, i, span:not([role]):not([tabindex]):not([class*=fv-tip])'; +const keepWord = list => `(?:${[...list].sort((a, b) => b.length - a.length).join('|')})`; +// The words, each with its space, then the next word: a media label ("") whole, else a run of anything but a +// plain space (a name held with no-break spaces and word joiners stays one piece). +const keepPatterns = lang => SHORT_WORDS[lang] && { + inside: new RegExp(`(^|[^\\p{L}\\p{N}\\-’'])((?:${keepWord(SHORT_WORDS[lang])} )+)(<(?:Picture|Video|Audio) \\d+>|[^ \\t\\n\\r]+)`, 'giu'), + atEnd: new RegExp(`(^|[^\\p{L}\\p{N}\\-’'])((?:${keepWord(SHORT_WORDS[lang])} )+)$`, 'iu'), +}; +const keepPiece = doc => { + const piece = doc.createElement('span'); + // An inline block is placed whole on a line when it fits; it is never wider than the line (max-width), so a piece + // longer than the line breaks inside rather than stand out of its box. + piece.className = 'fv-keep'; piece.style.display = 'inline-block'; piece.style.maxWidth = '100%'; + return piece; +}; +/** In a Russian or Ukrainian page, each short word of SHORT_WORDS in the element's text put in a span with the word + * after it, as written (plain spaces, no added character): find in page, copying and screen readers read the same text. + * Called again after the text changes; a word already held is left as it is. Other languages: the element as it is. */ +export function holdShortWordsIn(root, lang = LANGUAGE) { + const doc = root?.ownerDocument, patterns = keepPatterns(String(lang || '').split('-')[0]); + if (!doc || !patterns) return root; + const walker = doc.createTreeWalker(root, 4), texts = []; + for (let node = walker.nextNode(); node; node = walker.nextNode()) + if (!node.parentElement?.closest(KEEP_SKIP) && /\S/.test(node.data)) texts.push(node); + for (const node of texts) { + const parts = []; + let last = 0; + for (const match of node.data.matchAll(patterns.inside)) { + const start = match.index + match[1].length, end = match.index + match[0].length; + if (start > last) parts.push(node.data.slice(last, start)); + const piece = keepPiece(doc); piece.textContent = node.data.slice(start, end); parts.push(piece); + last = end; + } + // A short word that ends the text before an inline word element ("в " and a held name): the two go together. + const rest = node.data.slice(last), next = node.nextSibling, tail = patterns.atEnd.exec(rest); + let moved = null; + if (tail && next?.nodeType === 1 && next.matches(KEEP_WITH) && !next.matches(KEEP_SKIP.replace('.fv-name, ', '')) && !next.querySelector('a, button, input, [role], [tabindex]')) { + const at = last + tail.index + tail[1].length; + if (at > last) parts.push(node.data.slice(last, at)); + moved = keepPiece(doc); moved.append(node.data.slice(at)); parts.push(moved); + last = node.data.length; + } + if (!parts.length) continue; + if (last < node.data.length) parts.push(node.data.slice(last)); + // The text stays one piece around what it holds, as holdNamesIn keeps it: in a flex key ("Выполнять по шагам") + // the words are one item, not two items a gap apart that a screen reader reads as two lines. Its class tells + // code that reads a line's words (the status line's report) that it is still the line's text. + if (parts.length === 1 && !moved) node.replaceWith(parts[0]); + else { const whole = doc.createElement('span'); whole.className = 'fv-keep-run'; whole.append(...parts); node.replaceWith(whole); } + if (moved) moved.append(next); + } + return root; +} + +/** The same holding for a page that draws its own text (the standalone page): the text cut into [piece, held] in order, + * which joined again is the text as written. A held piece (a short word with the word after it) goes in one inline-block + * span; the rest stays plain. A language without short words, or a text without any, gives [[text, false]]. */ +export function shortWordPieces(text, lang = LANGUAGE) { + const value = String(text ?? ''), patterns = keepPatterns(String(lang || '').split('-')[0]); + if (!patterns || !value) return [[value, false]]; + const pieces = []; + let last = 0; + for (const match of value.matchAll(patterns.inside)) { + const start = match.index + match[1].length, end = match.index + match[0].length; + if (start > last) pieces.push([value.slice(last, start), false]); + pieces.push([value.slice(start, end), true]); + last = end; + } + if (last < value.length) pieces.push([value.slice(last), false]); + return pieces.length ? pieces : [[value, false]]; +} +// The same for words that code may rewrite later (a settings row's line, a status): held now and again whenever its text +// changes, in Russian and Ukrainian only. Holding again finds nothing new, so the watch settles after one pass. +export function keepShortWordsIn(node, lang = LANGUAGE) { + if (!node || !SHORT_WORDS[String(lang || '').split('-')[0]]) return node; + holdShortWordsIn(node, lang); + if (typeof MutationObserver === 'function') + new MutationObserver(() => holdShortWordsIn(node, lang)).observe(node, {childList: true, characterData: true, subtree: true}); + return node; +} +// The same for every piece of text that code writes anywhere inside a container later (a settings dialog): each new or +// changed piece is held when it appears, in Russian and Ukrainian only. The watch is off while it holds, so its own +// changes never call it again, and it runs before the page is drawn, so nothing is seen moving. Names, paths and other +// things the user wrote are marked [data-fv-plain] and never held. +export function keepShortWordsUnder(root, lang = LANGUAGE) { + if (!root || !SHORT_WORDS[String(lang || '').split('-')[0]] || typeof MutationObserver !== 'function') return root; + holdShortWordsIn(root, lang); + const options = {childList: true, characterData: true, subtree: true}; + const watch = new MutationObserver(records => { + const changed = new Set(); + for (const record of records) { + if (record.type === 'characterData') changed.add(record.target.parentElement); + else for (const node of record.addedNodes) changed.add(node.nodeType === 1 ? node : record.target); + } + watch.disconnect(); + for (const node of changed) if (node?.isConnected) holdShortWordsIn(node, lang); + watch.observe(root, options); + }); + watch.observe(root, options); + return root; +} export function holdNames(text) { if (typeof text !== 'string' || !text) return text; return text.replace(QUOTED, (whole, ...groups) => { const name = groups.slice(0, 6).find(value => value !== undefined); + if (Array.from(name).length > HELD_NAME_MAX) return whole; return whole.slice(0, whole.length - name.length - 1) + holdName(name) + whole.slice(-1); }).replace(LEVELS, holdName).replace(LEVEL_AFTER_QUOTE, (whole, mark, word) => mark + '\u2060' + holdName(word)) .replace(MODELS, (whole, before, name) => before + holdModel(name)); diff --git a/web/image_generation.js b/web/image_generation.js index 765f9a9c..467ca704 100644 --- a/web/image_generation.js +++ b/web/image_generation.js @@ -170,7 +170,7 @@ export function createImageGenClient(fetchImpl = globalThis.fetch.bind(globalThi // after it, even when the page is closed; history-undo brings a batch back. async historyTrash(files) { const answer = await post('history-trash', {files}); return {items: answer.items || [], failed: answer.failed || [], batch: answer.batch || null}; }, historyUndo: batch => post('history-undo', {batch}), - // The prompts and sizes of a new character's five pictures (the Agent's cards use the same ones). + // The prompts and sizes of a new character's four views (the Agent's cards use the same ones). castViews: async (description, kind = 'character') => (await post('cast-views', {description, kind})).views, async upload(file) { // Never under the user's own file name: a random name the service knows as a temporary page upload, removed diff --git a/web/image_view_prompts.js b/web/image_view_prompts.js index 12394326..4e4cb507 100644 --- a/web/image_view_prompts.js +++ b/web/image_view_prompts.js @@ -3,6 +3,8 @@ // shape, size and seed (and optionally the prompt), applied in one click. import { el, t, tip, button, readStore, writeStore } from './image_view_ui.js'; import { privacyOffered } from './private_offers.js'; +// Through the sign-in proxy a change carries this device's proof (web/proxy_proof.js); nothing on this computer. +const proofHeader = () => { const proof = globalThis.__freevideoProof?.(); return proof ? {'X-FreeVideo-CSRF': proof} : {}; }; export const HISTORY_KEY = 'freevideo.imageView.prompts'; export const PRESET_KEY = 'freevideo.imageView.presets'; @@ -35,7 +37,7 @@ export async function forgetDeletedPrompts({fetchImpl = (...args) => globalThis. if (!texts.length || !await offered()) return 0; let answer; try { - const response = await fetchImpl('/freevideo/private/forgotten', {method: 'POST', cache: 'no-store', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({prompts: texts})}); + const response = await fetchImpl('/freevideo/private/forgotten', {method: 'POST', cache: 'no-store', headers: {'Content-Type': 'application/json', ...proofHeader()}, body: JSON.stringify({prompts: texts})}); if (!response?.ok) return 0; answer = await response.json(); } catch { return 0; } diff --git a/web/issue_button.js b/web/issue_button.js index be7059cd..5984f5b0 100644 --- a/web/issue_button.js +++ b/web/issue_button.js @@ -38,6 +38,9 @@ export const REPEAT_MS = 10000; let lastOpened = {key: '', at: -Infinity, url: ''}; // The address of the form opened last: the way to it again when a click within REPEAT_MS opened nothing. export const lastIssueURL = () => lastOpened.url; +// Forgets the form opened last, so the next click opens one whatever it reports (checks that open the same report in +// separate cases, on a clock that does not move, start each case from here). +export const forgetOpened = () => { lastOpened = {key: '', at: -Infinity, url: ''}; }; // Opens the prefilled form for `value` ({where, message, kind, facts}); also used by a notice's "Report a problem". // Returns false when it was the same report again within REPEAT_MS, so nothing opened. export async function openIssue(t, value, open = (url, features) => globalThis.open?.(url, '_blank', features), now = () => Date.now()) { diff --git a/web/launcher.js b/web/launcher.js index 2a66dd95..06c8918a 100644 --- a/web/launcher.js +++ b/web/launcher.js @@ -4,6 +4,8 @@ import { restorePromptDraft } from './prompt_draft.js'; import { takePortMarker } from './port_notice.js'; import { launcherRestoreFinished } from './workspace_restore.js'; import { clonePrompt } from './optional_inputs.js'; +import { isLaunchVisit } from './launch_visit.js'; +import { workflowPersist } from './workflow_drafts.js'; // health.js names what failed; files loaded before it queue their reports. const health = item => (window.__freevideoHealth ||= []).push(item); @@ -198,9 +200,16 @@ app.registerExtension({ async setup() { takePortMarker(); const url = new URL(window.location.href); - if (url.searchParams.get('freevideo') !== 'launch') return; - url.searchParams.delete('freevideo'); - window.history.replaceState(window.history.state, '', url); + // The launcher's visit, or a refresh of that tab (launch_visit.js keeps the mark for the tab): where ComfyUI keeps + // no workflow drafts (the FreeVideo-installed ComfyUI), only this brings FreeVideo's workflow back after a refresh. + if (!isLaunchVisit(url.search, window.sessionStorage)) return; + // Where ComfyUI keeps workflow drafts, a refresh is left to it, as before: it brings its tabs back with every edit + // and the tab that was in front. A setting not readable yet counts as drafts kept. + if (url.searchParams.get('freevideo') !== 'launch' && workflowPersist(app) !== false) return; + if (url.searchParams.get('freevideo') === 'launch') { + url.searchParams.delete('freevideo'); + window.history.replaceState(window.history.state, '', url); + } let workflow; const cached = cachedStudioProject(); try { diff --git a/web/library.js b/web/library.js index ed88e227..d588c06c 100644 --- a/web/library.js +++ b/web/library.js @@ -1785,7 +1785,14 @@ export function openLibrary(t, options = {}) { const zips = payloads.length > 1 ? t(' in {count} zip files', ',分成 {count} 个压缩包', { count: payloads.length }) : ''; const missing = left > 0 ? t(', {left} could not be read', ',其中 {left} 个无法读取', { left }) : ''; say((count === 1 ? t('Downloading 1 creation', '正在下载 1 个作品') : t('Downloading {count} creations', '正在下载 {count} 个作品', { count })) + zips + missing, left > 0); - try { await postZips(api, payloads, {alive: () => !disposed}); } + // An answer that is not the file lands in the form's hidden frame; it is said here, not lost there. + const onFailure = code => { + if (disposed) return; + if (code === 'page_session_required' && globalThis.__freevideoProofExpired) globalThis.__freevideoProofExpired(); + else say(code === 'request_too_large' ? t('Too many creations for one download. Download them in smaller groups.', '一次下载的作品太多,请分几次下载。') + : t('Could not start the download. Try again.', '无法开始下载,请重试。'), true); + }; + try { await postZips(api, payloads, {alive: () => !disposed, onFailure}); } catch { say(t('Could not start the download. Try again.', '无法开始下载,请重试。'), true); } } async function favoritePicked() { diff --git a/web/locales/de.json b/web/locales/de.json index f6bcbd18..97750c9d 100644 --- a/web/locales/de.json +++ b/web/locales/de.json @@ -70,6 +70,10 @@ "\"Use as is\" is not available here.": "„Unverändert“ ist hier nicht verfügbar.", "\"Use as is\" is not available on this computer yet.": "„Unverändert verwenden“ ist auf diesem Computer noch nicht verfügbar.", "\"Use as is\" is not available while extending a video. Remove \"Extends this video\" first.": "„Unverändert“ ist nicht verfügbar, solange ein Video verlängert wird. Entfernen Sie zuerst „Verlängert dieses Video“.", + "\"{folder}\" holds too many files that could be models for FreeVideo to check one by one. Move the files that are not models out of this folder, then try again.": "„{folder}“ enthält zu viele Dateien, die Modelle sein könnten, als dass FreeVideo sie einzeln prüfen kann. Verschieben Sie die Dateien, die keine Modelle sind, aus diesem Ordner und versuchen Sie es dann erneut.", + "\"{folder}\" holds too many files that could be models for FreeVideo to check one by one. Offline packages cannot download the models instead, so remove this folder from \"Reuse models\" on the Models page.": "„{folder}“ enthält zu viele Dateien, die Modelle sein könnten, als dass FreeVideo sie einzeln prüfen kann. Mit Offline-Paketen können die Modelle stattdessen nicht heruntergeladen werden. Entfernen Sie diesen Ordner daher auf der Seite Modelle unter „Modelle wiederverwenden“.", + "\"{folder}\" holds too many files that could be models for FreeVideo to check one by one. Skip this folder and download the models instead, or remove it from \"Reuse models\" on the Models page.": "„{folder}“ enthält zu viele Dateien, die Modelle sein könnten, als dass FreeVideo sie einzeln prüfen kann. Überspringen Sie diesen Ordner und laden Sie die Modelle stattdessen herunter, oder entfernen Sie ihn auf der Seite Modelle unter „Modelle wiederverwenden“.", + "\"{folder}\" holds too many files that could be models for FreeVideo to check one by one. Skip this folder and download the models instead.": "„{folder}“ enthält zu viele Dateien, die Modelle sein könnten, als dass FreeVideo sie einzeln prüfen kann. Überspringen Sie diesen Ordner und laden Sie die Modelle stattdessen herunter.", "\"{media}\" could not be found. Upload or select it again, then generate.": "„{media}“ wurde nicht gefunden. Laden Sie die Datei erneut hoch oder wählen Sie sie erneut aus und generieren Sie dann.", "\"{name}\" can't hold FreeVideo. Choose another disk.": "Auf „{name}“ kann FreeVideo nicht installiert werden. Wählen Sie einen anderen Datenträger.", "\"{name}\" can't store files over 4 GB. Choose another disk.": "Auf „{name}“ können keine Dateien über 4 GB gespeichert werden. Wählen Sie einen anderen Datenträger.", @@ -552,6 +556,7 @@ "Attached images": "Angehängte Bilder", "Audio 1": "Audio 1", "Audio 2": "Audio 2", + "Audio 2 cannot be removed while the Dialogue, Music and Ambience tracks still have parts. Delete those parts first.": "„Audio 2“ kann nicht entfernt werden, solange auf den Spuren „Dialog“, „Musik“ und „Umgebungston“ noch Clips liegen. Löschen Sie zuerst diese Clips.", "Audio and video cache": "Audio- und Video-Cache", "Audio length: {seconds} s; uses up to the first 15 s within the video length.": "Audiolänge: {seconds} s; es werden höchstens die ersten 15 s verwendet, nicht mehr als die Videolänge.", "Audio longer than 30 seconds used as is is made in parts, which needs \"Faster second pass\". Turn it on or set the audio to \"Reference\".": "Audio, das länger als 30 Sekunden ist und unverändert verwendet wird, wird in Abschnitten generiert; dafür ist „Schnellerer zweiter Durchgang“ erforderlich. Schalten Sie ihn ein oder setzen Sie das Audio auf „Referenz“.", @@ -2245,6 +2250,7 @@ "FreeVideo asks before deleting a video, and a video used in an edit cannot be deleted.": "FreeVideo fragt vor dem Löschen eines Videos nach, und ein Video, das in einem Schnitt verwendet wird, kann nicht gelöscht werden.", "FreeVideo cannot read its own files": "FreeVideo kann seine eigenen Dateien nicht lesen", "FreeVideo cannot run from this disk": "FreeVideo kann nicht von diesem Datenträger ausgeführt werden", + "FreeVideo cannot use \"{name}\": this file type is not supported. Use a PNG, JPEG or WebP image, an MP4, MOV or WebM video, or WAV or MP3 audio.": "FreeVideo kann „{name}“ nicht verwenden: Dieser Dateityp wird nicht unterstützt. Verwenden Sie ein PNG-, JPEG- oder WebP-Bild, ein MP4-, MOV- oder WebM-Video oder eine WAV- oder MP3-Audiodatei.", "FreeVideo closed unexpectedly while generating.": "FreeVideo wurde während der Generierung unerwartet geschlossen.", "FreeVideo could not be opened from the menu": "FreeVideo konnte nicht über das Menü geöffnet werden", "FreeVideo could not reach the network.": "FreeVideo konnte das Netzwerk nicht erreichen.", @@ -3111,6 +3117,7 @@ "Making music": "Musik wird erstellt", "Making the video": "Video wird erstellt", "Male": "Männlich", + "Manage model folders": "Modellordner verwalten", "Mannequin": "Gliederpuppe", "Mark all as read": "Alle als gelesen markieren", "Mark as read": "Als gelesen markieren", @@ -3400,6 +3407,7 @@ "Not deleted: saved edits could not be checked. Try again in a moment.": "Nicht gelöscht: Die gespeicherten Schnitte konnten nicht geprüft werden. Versuchen Sie es gleich noch einmal.", "Not deleted: the folder also holds files FreeVideo did not write: ": "Nicht gelöscht: Der Ordner enthält auch Dateien, die nicht von FreeVideo erstellt wurden: ", "Not deleted: these edits use it: ": "Nicht gelöscht: Diese Schnitte verwenden es: ", + "Not detected": "Nicht erkannt", "Not enabled. Your prompt is unchanged.": "Nicht aktiviert. Ihr Prompt ist unverändert.", "Not enough GPU memory": "Nicht genügend GPU-Speicher", "Not enough GPU memory for depth": "Nicht genügend GPU-Speicher für die Tiefenextraktion", @@ -4362,6 +4370,7 @@ "Restore original": "Original wiederherstellen", "Restored the original image.": "Das Originalbild wurde wiederhergestellt.", "Restored the original image. Edit it again to reapply the changes.": "Das Originalbild wurde wiederhergestellt. Bearbeiten Sie es erneut, um die Änderungen wieder anzuwenden.", + "Restored your changes up to {time}. Later changes could not be kept on this computer and were lost.": "Ihre Änderungen wurden bis {time} wiederhergestellt. Spätere Änderungen konnten auf diesem Computer nicht gesichert werden und sind verloren gegangen.", "Restored, but {lost} could not be brought back.": "Wiederhergestellt, aber {lost} konnten nicht zurückgebracht werden.", "Restored.": "Wiederhergestellt.", "Restore␟恢复": "Zurückholen", @@ -4875,6 +4884,7 @@ "Sketch mannequin": "Skizzen-Gliederpuppe", "Sketch␟画草图": "Skizzieren", "Sketch␟草图": "Skizze", + "Skip this folder and download": "Diesen Ordner überspringen und herunterladen", "Skipped": "Übersprungen", "Skipped 1 unsupported file": "1 nicht unterstützte Datei übersprungen", "Skipped 1 unsupported file ({types})": "1 nicht unterstützte Datei übersprungen ({types})", @@ -4892,7 +4902,8 @@ "Small file": "Kleine Datei", "Smaller than the {vsize} video; the result will look softer.": "Kleiner als das Video mit {vsize}; das Ergebnis wirkt unschärfer.", "Smaller tiles, more at once": "Kleinere Kacheln, mehr auf einmal", - "Smart App Control in Windows blocked these files. Search Windows for \"Smart App Control\", or open Windows Security → App & browser control → Smart App Control settings.": "Die Intelligente App-Steuerung von Windows hat diese Dateien blockiert. Suchen Sie in Windows nach „Intelligente App-Steuerung“ oder öffnen Sie Windows-Sicherheit → App- und Browsersteuerung → Einstellungen der Intelligenten App-Steuerung.", + "Smart App Control cannot make an exception for one program. FreeVideo can run only if it is turned off: search Windows for \"Smart App Control\" and open its settings.": "Für die intelligente App-Steuerung lässt sich keine Ausnahme für ein einzelnes Programm festlegen. FreeVideo kann nur ausgeführt werden, wenn sie ausgeschaltet ist: Suchen Sie in Windows nach „Intelligente App-Steuerung“ und öffnen Sie die zugehörigen Einstellungen.", + "Smart App Control in Windows blocked files that FreeVideo needs, so FreeVideo cannot run on this computer.": "Die intelligente App-Steuerung von Windows hat Dateien blockiert, die FreeVideo benötigt, daher kann FreeVideo auf diesem Computer nicht ausgeführt werden.", "Smart App Control in Windows stopped it": "Die Intelligente App-Steuerung von Windows hat es blockiert", "Smart App Control in Windows stopped setup from writing a file.": "Die Intelligente App-Steuerung von Windows hat verhindert, dass die Installation eine Datei schreibt.", "Smart App Control in Windows stopped the downloaded launcher. This version of FreeVideo keeps working.": "Die Intelligente App-Steuerung von Windows hat den heruntergeladenen Launcher blockiert. Diese Version von FreeVideo funktioniert weiterhin.", @@ -5740,6 +5751,7 @@ "There is not enough free graphics or system memory for this image": "Nicht genügend freier Grafik- oder Arbeitsspeicher für dieses Bild", "There is not enough free memory to continue installing": "Es ist nicht genügend freier Arbeitsspeicher vorhanden, um die Installation fortzusetzen", "There must be a clip under the playhead. A part that is still being generated can be saved once it is done.": "Unter dem Abspielkopf muss sich ein Clip befinden. Ein Abschnitt, der noch generiert wird, kann gespeichert werden, sobald er fertig ist.", + "These changes have not been saved and are only in this page. Keep the page open until they are saved; closing it now would lose them.": "Diese Änderungen sind noch nicht gespeichert und nur auf dieser Seite vorhanden. Lassen Sie die Seite geöffnet, bis sie gespeichert sind; wenn Sie sie jetzt schließen, gehen sie verloren.", "These creations cannot be downloaded.": "Diese Werke können nicht heruntergeladen werden.", "These creations cannot be read.": "Diese Werke können nicht gelesen werden.", "These files are downloaded or reused. Closing Settings does not stop the installation.": "Diese Dateien werden heruntergeladen oder wiederverwendet. Das Schließen der Einstellungen beendet die Installation nicht.", @@ -5862,6 +5874,7 @@ "This node is disabled or no longer in the workflow.": "Dieser Knoten ist deaktiviert oder nicht mehr im Workflow.", "This page": "Diese Seite", "This page was opened on port {opened}, but FreeVideo runs on port {port}. The two must match: open {address}. If you reach FreeVideo through port forwarding or a tunnel, use {port} as the local port as well. Then retry.": "Diese Seite wurde über Port {opened} geöffnet, FreeVideo läuft aber auf Port {port}. Beide müssen übereinstimmen: Öffnen Sie {address}. Wenn Sie FreeVideo über eine Portweiterleitung oder einen Tunnel erreichen, verwenden Sie auch {port} als lokalen Port. Versuchen Sie es dann erneut.", + "This page's connection to FreeVideo has expired, so the change was not saved. Reload the page and repeat the action.": "Die Verbindung dieser Seite zu FreeVideo ist abgelaufen, daher wurde die Änderung nicht gespeichert. Laden Sie die Seite neu und wiederholen Sie die Aktion.", "This part changed during dubbing, so the new voice was not placed. Redub it.": "Dieser Abschnitt wurde während der Synchronisation geändert, daher wurde die neue Stimme nicht eingefügt. Synchronisieren Sie ihn erneut.", "This part could not be generated. Continue from this part; if it fails again, send a report.": "Dieser Abschnitt konnte nicht generiert werden. Setzen Sie ab diesem Abschnitt fort; falls es erneut fehlschlägt, senden Sie einen Bericht.", "This part has no audio": "Dieser Abschnitt hat kein Audio", @@ -5921,7 +5934,6 @@ "This workflow uses nodes that FreeVideo cannot read. Open it in Nodes.": "Dieser Workflow verwendet Knoten, die FreeVideo nicht lesen kann. Öffnen Sie ihn in der Knotenansicht.", "Three steps around Create or Edit": "Drei Schritte rund um Erstellen oder Schnitt", "Three steps around the screen": "Drei Schritte rund um die Oberfläche", - "Three-quarter": "Dreiviertel", "Thumbnails and durations could not be loaded. Try again; if it still fails, choose \"Report a problem\".": "Miniaturen und Dauer konnten nicht geladen werden. Versuchen Sie es erneut; falls es weiterhin fehlschlägt, wählen Sie „Problem melden“.", "Thumbnails only, a larger picture": "Nur Miniaturen, größeres Bild", "Tick \"I accept the installation plan and model / toolkit licenses.\" and choose \"Confirm & continue\".": "Setzen Sie ein Häkchen bei „Ich akzeptiere den Installationsplan sowie die Modell- und Toolkit-Lizenzen.“ und wählen Sie „Bestätigen & fortsetzen“.", @@ -5963,6 +5975,8 @@ "Tolerance": "Toleranz", "Too many attempts. Try again in {count} s.": "Zu viele Versuche. Versuchen Sie es in {count} s erneut.", "Too many attempts. Try again in {minutes} min.": "Zu viele Versuche. Versuchen Sie es in {minutes} min erneut.", + "Too many creations for one download. Download them in smaller groups.": "Zu viele Werke für einen Download. Laden Sie sie in kleineren Gruppen herunter.", + "Too many files to check in a model folder": "Zu viele Dateien zum Prüfen in einem Modellordner", "Took": "Dauer", "Took too long. Try again.": "Zeitüberschreitung. Versuchen Sie es erneut.", "Tools that do not fit in the bar": "Werkzeuge, die nicht in die Leiste passen", @@ -6038,6 +6052,7 @@ "Turn this part upside down": "Diesen Abschnitt auf den Kopf stellen", "Turn this preview into the final video": "Diese Vorschau in das fertige Video umwandeln", "Turn this preview part into the full-resolution video, in place": "Diesen Vorschauabschnitt an Ort und Stelle in das Video mit voller Auflösung umwandeln", + "Turning it off lowers Windows' protection against unknown programs. On some versions of Windows, it can be turned on again only by resetting Windows.": "Wenn sie ausgeschaltet ist, schützt Windows schlechter vor unbekannten Programmen. Bei einigen Windows-Versionen lässt sie sich nur durch Zurücksetzen von Windows wieder einschalten.", "Tutorial": "Tutorial", "Tutorials": "Tutorials", "Two friends sit by a café window at dusk. She says: \"You came back.\" He smiles: \"I promised.\" Warm light, quiet street sounds.": "Zwei Freunde sitzen in der Abenddämmerung am Fenster eines Cafés. Sie sagt: „Du bist zurückgekommen.“ Er lächelt: „Ich habe es versprochen.“ Warmes Licht, ruhige Straßengeräusche.", @@ -6382,6 +6397,7 @@ "When it shows \"Assistant connected\" or the assistant's name, describe the video under \"Tell the assistant…\", for example \"Make a 1-minute vertical short film: a day in a coffee shop\".": "Wenn „Assistent verbunden“ oder der Name des Assistenten angezeigt wird, beschreiben Sie das Video unter „Dem Assistenten mitteilen…“, zum Beispiel „Erstellen Sie einen 1-Minuten-Kurzfilm im Hochformat: ein Tag in einem Café“.", "When model files are incomplete or changed, import the same offline packages again in the launcher; only the files with problems are completed or replaced.": "Wenn Modelldateien unvollständig oder verändert sind, importieren Sie im Launcher dieselben Offline-Pakete erneut; nur die betroffenen Dateien werden vervollständigt oder ersetzt.", "When off, nothing takes VRAM before a generation; models already used stay loaded for the next one.": "Wenn ausgeschaltet, belegt vor einer Generierung nichts VRAM; bereits verwendete Modelle bleiben für die nächste geladen.", + "When off, nothing takes unified memory before a generation; models already used stay loaded for the next one.": "Wenn ausgeschaltet, belegt vor einer Generierung nichts einheitlichen Arbeitsspeicher; bereits verwendete Modelle bleiben für die nächste geladen.", "When on, other devices on the same network can open FreeVideo with the link below and enter the password the first time.": "Wenn aktiviert, können andere Geräte im selben Netzwerk FreeVideo über den Link unten öffnen und beim ersten Mal das Passwort eingeben.", "When on, other devices on the same network can open FreeVideo with the link below. Anyone with the link can use it, so keep it private.": "Wenn aktiviert, können andere Geräte im selben Netzwerk FreeVideo über den Link unten öffnen. Jeder mit dem Link kann FreeVideo verwenden; halten Sie den Link daher privat.", "When something goes wrong": "Wenn etwas schiefgeht", @@ -6709,6 +6725,7 @@ "video model": "Videomodell", "wide shot": "wide shot", "with prompt": "mit Prompt", + "yesterday at {time}": "gestern um {time}", "your Python mirror": "Ihr Python-Mirror", "your configured source": "Ihre konfigurierte Quelle", "zoom in": "zoom in", @@ -6757,6 +6774,7 @@ "{count} tasks, {active} under way": "{count} Aufgaben, {active} laufend", "{count} videos from this task": "{count} Videos aus dieser Aufgabe", "{count} voiceovers": "{count} Sprechertexte", + "{date} at {time}": "{date} um {time}", "{done} / {total} files": "{done} / {total} Dateien", "{done} / {total} frames": "{done} / {total} Einzelbilder", "{done} / {total} layers": "{done} / {total} Ebenen", diff --git a/web/locales/es.json b/web/locales/es.json index 4ee41a12..8fb6bfbe 100644 --- a/web/locales/es.json +++ b/web/locales/es.json @@ -58,6 +58,10 @@ "\"Use as is\" is not available here.": "\"Usar tal cual\" no está disponible aquí.", "\"Use as is\" is not available on this computer yet.": "\"Usar tal cual\" aún no está disponible en este equipo.", "\"Use as is\" is not available while extending a video. Remove \"Extends this video\" first.": "\"Usar tal cual\" no está disponible al extender un video. Quite primero \"Extiende este video\".", + "\"{folder}\" holds too many files that could be models for FreeVideo to check one by one. Move the files that are not models out of this folder, then try again.": "\"{folder}\" contiene demasiados archivos que podrían ser modelos para que FreeVideo los compruebe uno por uno. Mueva fuera de esta carpeta los archivos que no son modelos y vuelva a intentarlo.", + "\"{folder}\" holds too many files that could be models for FreeVideo to check one by one. Offline packages cannot download the models instead, so remove this folder from \"Reuse models\" on the Models page.": "\"{folder}\" contiene demasiados archivos que podrían ser modelos para que FreeVideo los compruebe uno por uno. Con paquetes sin conexión no se pueden descargar los modelos en su lugar, así que quite esta carpeta de \"Reutilizar modelos\" en la página Modelos.", + "\"{folder}\" holds too many files that could be models for FreeVideo to check one by one. Skip this folder and download the models instead, or remove it from \"Reuse models\" on the Models page.": "\"{folder}\" contiene demasiados archivos que podrían ser modelos para que FreeVideo los compruebe uno por uno. Omita esta carpeta y descargue los modelos en su lugar, o quítela de \"Reutilizar modelos\" en la página Modelos.", + "\"{folder}\" holds too many files that could be models for FreeVideo to check one by one. Skip this folder and download the models instead.": "\"{folder}\" contiene demasiados archivos que podrían ser modelos para que FreeVideo los compruebe uno por uno. Omita esta carpeta y descargue los modelos en su lugar.", "\"{media}\" could not be found. Upload or select it again, then generate.": "No se encontró \"{media}\". Súbalo o selecciónelo de nuevo y luego genere.", "\"{name}\" can't hold FreeVideo. Choose another disk.": "\"{name}\" no puede alojar FreeVideo. Elija otro disco.", "\"{name}\" can't store files over 4 GB. Choose another disk.": "\"{name}\" no puede almacenar archivos de más de 4 GB. Elija otro disco.", @@ -540,6 +544,7 @@ "Attached images": "Imágenes adjuntas", "Audio 1": "Audio 1", "Audio 2": "Audio 2", + "Audio 2 cannot be removed while the Dialogue, Music and Ambience tracks still have parts. Delete those parts first.": "No se puede eliminar \"Audio 2\" mientras las pistas \"Diálogo\", \"Música\" y \"Ambiente\" aún tengan clips. Elimine primero esos clips.", "Audio and video cache": "Caché de audio y video", "Audio length: {seconds} s; uses up to the first 15 s within the video length.": "Duración del audio: {seconds} s; se usan hasta los primeros 15 s dentro de la duración del video.", "Audio longer than 30 seconds used as is is made in parts, which needs \"Faster second pass\". Turn it on or set the audio to \"Reference\".": "El audio de más de 30 segundos usado tal cual se genera por partes, lo que requiere \"Segunda pasada más rápida\". Actívela o establezca el audio en \"Referencia\".", @@ -2233,6 +2238,7 @@ "FreeVideo asks before deleting a video, and a video used in an edit cannot be deleted.": "FreeVideo pide confirmación antes de eliminar un video, y un video usado en una edición no se puede eliminar.", "FreeVideo cannot read its own files": "FreeVideo no puede leer sus propios archivos", "FreeVideo cannot run from this disk": "FreeVideo no se puede ejecutar desde este disco", + "FreeVideo cannot use \"{name}\": this file type is not supported. Use a PNG, JPEG or WebP image, an MP4, MOV or WebM video, or WAV or MP3 audio.": "FreeVideo no puede usar \"{name}\": este tipo de archivo no es compatible. Use una imagen PNG, JPEG o WebP, un video MP4, MOV o WebM, o un audio WAV o MP3.", "FreeVideo closed unexpectedly while generating.": "FreeVideo se cerró inesperadamente durante la generación.", "FreeVideo could not be opened from the menu": "No se pudo abrir FreeVideo desde el menú", "FreeVideo could not reach the network.": "FreeVideo no pudo conectarse a la red.", @@ -3099,6 +3105,7 @@ "Making music": "Creando música", "Making the video": "Creando el video", "Male": "Masculino", + "Manage model folders": "Gestionar carpetas de modelos", "Mannequin": "Maniquí", "Mark all as read": "Marcar todo como leído", "Mark as read": "Marcar como leído", @@ -3388,6 +3395,7 @@ "Not deleted: saved edits could not be checked. Try again in a moment.": "No se eliminó: no se pudieron comprobar las ediciones guardadas. Vuelva a intentarlo en un momento.", "Not deleted: the folder also holds files FreeVideo did not write: ": "No se eliminó: la carpeta también contiene archivos que FreeVideo no creó: ", "Not deleted: these edits use it: ": "No se eliminó: se usa en estas ediciones: ", + "Not detected": "No detectado", "Not enabled. Your prompt is unchanged.": "No activado. Su prompt no ha cambiado.", "Not enough GPU memory": "Memoria de GPU insuficiente", "Not enough GPU memory for depth": "Memoria de GPU insuficiente para la profundidad", @@ -4350,6 +4358,7 @@ "Restore original": "Restaurar el original", "Restored the original image.": "Se restauró la imagen original.", "Restored the original image. Edit it again to reapply the changes.": "Se restauró la imagen original. Edítela de nuevo para volver a aplicar los cambios.", + "Restored your changes up to {time}. Later changes could not be kept on this computer and were lost.": "Se restauraron sus cambios (último guardado: {time}). Los cambios posteriores no se pudieron conservar en este equipo y se perdieron.", "Restored, but {lost} could not be brought back.": "Restaurado, pero no se pudo recuperar: {lost}.", "Restored.": "Restaurado.", "Restore␟恢复": "Restaurar", @@ -4863,6 +4872,7 @@ "Sketch mannequin": "Maniquí de boceto", "Sketch␟画草图": "Boceto", "Sketch␟草图": "Boceto", + "Skip this folder and download": "Omitir esta carpeta y descargar", "Skipped": "Omitido", "Skipped 1 unsupported file": "Se omitió 1 archivo no compatible", "Skipped 1 unsupported file ({types})": "Se omitió 1 archivo no compatible ({types})", @@ -4880,7 +4890,8 @@ "Small file": "Archivo pequeño", "Smaller than the {vsize} video; the result will look softer.": "Menor que el video de {vsize}; el resultado se verá más borroso.", "Smaller tiles, more at once": "Miniaturas más pequeñas, más a la vez", - "Smart App Control in Windows blocked these files. Search Windows for \"Smart App Control\", or open Windows Security → App & browser control → Smart App Control settings.": "Control inteligente de aplicaciones en Windows bloqueó estos archivos. Busque \"Control inteligente de aplicaciones\" en Windows o abra Seguridad de Windows → Control de aplicaciones y del navegador → Configuración de Control inteligente de aplicaciones.", + "Smart App Control cannot make an exception for one program. FreeVideo can run only if it is turned off: search Windows for \"Smart App Control\" and open its settings.": "El Control inteligente de aplicaciones no permite hacer una excepción para un solo programa. FreeVideo solo puede ejecutarse si se desactiva: busque \"Control inteligente de aplicaciones\" en Windows y abra su configuración.", + "Smart App Control in Windows blocked files that FreeVideo needs, so FreeVideo cannot run on this computer.": "El Control inteligente de aplicaciones de Windows bloqueó archivos que FreeVideo necesita, por lo que FreeVideo no puede ejecutarse en este equipo.", "Smart App Control in Windows stopped it": "El Control inteligente de aplicaciones de Windows lo bloqueó", "Smart App Control in Windows stopped setup from writing a file.": "El Control inteligente de aplicaciones de Windows impidió que la instalación escribiera un archivo.", "Smart App Control in Windows stopped the downloaded launcher. This version of FreeVideo keeps working.": "El Control inteligente de aplicaciones de Windows bloqueó el iniciador descargado. Esta versión de FreeVideo sigue funcionando.", @@ -5728,6 +5739,7 @@ "There is not enough free graphics or system memory for this image": "No hay suficiente memoria gráfica o del sistema libre para esta imagen", "There is not enough free memory to continue installing": "No hay suficiente memoria libre para continuar con la instalación", "There must be a clip under the playhead. A part that is still being generated can be saved once it is done.": "Debe haber un clip bajo el cabezal de reproducción. Una parte que aún se está generando se puede guardar cuando termine.", + "These changes have not been saved and are only in this page. Keep the page open until they are saved; closing it now would lose them.": "Estos cambios aún no se han guardado y solo están en esta página. Mantenga la página abierta hasta que se guarden; si la cierra ahora, se perderán.", "These creations cannot be downloaded.": "No se pueden descargar estas creaciones.", "These creations cannot be read.": "No se pueden leer estas creaciones.", "These files are downloaded or reused. Closing Settings does not stop the installation.": "Estos archivos se descargan o se reutilizan. Cerrar Ajustes no detiene la instalación.", @@ -5850,6 +5862,7 @@ "This node is disabled or no longer in the workflow.": "Este nodo está deshabilitado o ya no está en el flujo de trabajo.", "This page": "Esta página", "This page was opened on port {opened}, but FreeVideo runs on port {port}. The two must match: open {address}. If you reach FreeVideo through port forwarding or a tunnel, use {port} as the local port as well. Then retry.": "Esta página se abrió en el puerto {opened}, pero FreeVideo se ejecuta en el puerto {port}. Los dos deben coincidir: abra {address}. Si accede a FreeVideo mediante reenvío de puertos o un túnel, use también {port} como puerto local. Luego vuelva a intentarlo.", + "This page's connection to FreeVideo has expired, so the change was not saved. Reload the page and repeat the action.": "La conexión de esta página con FreeVideo ha caducado, por lo que el cambio no se guardó. Vuelva a cargar la página y repita la acción.", "This part changed during dubbing, so the new voice was not placed. Redub it.": "Esta parte cambió durante el doblaje, por lo que no se colocó la nueva voz. Vuelva a doblar.", "This part could not be generated. Continue from this part; if it fails again, send a report.": "No se pudo generar esta parte. Continúe desde esta parte; si vuelve a fallar, envíe un informe.", "This part has no audio": "Esta parte no tiene audio", @@ -5909,7 +5922,6 @@ "This workflow uses nodes that FreeVideo cannot read. Open it in Nodes.": "Este flujo de trabajo usa nodos que FreeVideo no puede leer. Ábralo en la vista de nodos.", "Three steps around Create or Edit": "Tres pasos para conocer Crear o Edición", "Three steps around the screen": "Tres pasos para conocer la pantalla", - "Three-quarter": "Tres cuartos", "Thumbnails and durations could not be loaded. Try again; if it still fails, choose \"Report a problem\".": "No se pudieron cargar las miniaturas y las duraciones. Vuelva a intentarlo; si sigue fallando, elija \"Informar de un problema\".", "Thumbnails only, a larger picture": "Solo miniaturas, una imagen más grande", "Tick \"I accept the installation plan and model / toolkit licenses.\" and choose \"Confirm & continue\".": "Marque \"Acepto el plan de instalación y las licencias de modelos / kits de herramientas.\" y elija \"Confirmar y continuar\".", @@ -5951,6 +5963,8 @@ "Tolerance": "Tolerancia", "Too many attempts. Try again in {count} s.": "Demasiados intentos. Inténtelo de nuevo en {count} s.", "Too many attempts. Try again in {minutes} min.": "Demasiados intentos. Inténtelo de nuevo en {minutes} min.", + "Too many creations for one download. Download them in smaller groups.": "Hay demasiadas creaciones para una sola descarga. Descárguelas en grupos más pequeños.", + "Too many files to check in a model folder": "Demasiados archivos que comprobar en una carpeta de modelos", "Took": "Tiempo", "Took too long. Try again.": "Tardó demasiado. Inténtelo de nuevo.", "Tools that do not fit in the bar": "Herramientas que no caben en la barra", @@ -6026,6 +6040,7 @@ "Turn this part upside down": "Voltear esta parte verticalmente", "Turn this preview into the final video": "Convertir esta vista previa en el video final", "Turn this preview part into the full-resolution video, in place": "Convertir esta parte de vista previa en el video de resolución completa, en su misma posición", + "Turning it off lowers Windows' protection against unknown programs. On some versions of Windows, it can be turned on again only by resetting Windows.": "Desactivarlo reduce la protección de Windows contra programas desconocidos. En algunas versiones de Windows, solo se puede volver a activar restableciendo Windows.", "Tutorial": "Tutorial", "Tutorials": "Tutoriales", "Two friends sit by a café window at dusk. She says: \"You came back.\" He smiles: \"I promised.\" Warm light, quiet street sounds.": "Dos amigos se sientan junto a la ventana de un café al anochecer. Ella dice: \"Volviste.\" Él sonríe: \"Lo prometí.\" Luz cálida, sonidos tranquilos de la calle.", @@ -6370,6 +6385,7 @@ "When it shows \"Assistant connected\" or the assistant's name, describe the video under \"Tell the assistant…\", for example \"Make a 1-minute vertical short film: a day in a coffee shop\".": "Cuando muestre \"Asistente conectado\" o el nombre del asistente, describa el video en \"Dígale al asistente…\", por ejemplo \"Crear un cortometraje vertical de 1 minuto: un día en una cafetería\".", "When model files are incomplete or changed, import the same offline packages again in the launcher; only the files with problems are completed or replaced.": "Cuando los archivos de modelo están incompletos o modificados, vuelva a importar los mismos paquetes sin conexión en el iniciador; solo se completan o reemplazan los archivos con problemas.", "When off, nothing takes VRAM before a generation; models already used stay loaded for the next one.": "Si está desactivado, nada ocupa VRAM antes de una generación; los modelos ya usados permanecen cargados para la siguiente.", + "When off, nothing takes unified memory before a generation; models already used stay loaded for the next one.": "Si está desactivado, nada ocupa memoria unificada antes de una generación; los modelos ya usados permanecen cargados para la siguiente.", "When on, other devices on the same network can open FreeVideo with the link below and enter the password the first time.": "Si está activado, otros dispositivos de la misma red pueden abrir FreeVideo con el enlace de abajo; la primera vez deben introducir la contraseña.", "When on, other devices on the same network can open FreeVideo with the link below. Anyone with the link can use it, so keep it private.": "Si está activado, otros dispositivos de la misma red pueden abrir FreeVideo con el enlace de abajo. Cualquier persona que tenga el enlace puede usarlo, así que manténgalo en privado.", "When something goes wrong": "Cuando algo sale mal", @@ -6697,6 +6713,7 @@ "video model": "modelo de video", "wide shot": "plano general", "with prompt": "con prompt", + "yesterday at {time}": "ayer a las {time}", "your Python mirror": "su espejo de Python", "your configured source": "su fuente configurada", "zoom in": "acercar zoom", @@ -6745,6 +6762,7 @@ "{count} tasks, {active} under way": "{count} tareas, {active} en curso", "{count} videos from this task": "{count} videos de esta tarea", "{count} voiceovers": "{count} locuciones", + "{date} at {time}": "{date} a las {time}", "{done} / {total} files": "{done} / {total} archivos", "{done} / {total} frames": "{done} / {total} fotogramas", "{done} / {total} layers": "{done} / {total} capas", diff --git a/web/locales/fr.json b/web/locales/fr.json index c4f8ce6c..b6324944 100644 --- a/web/locales/fr.json +++ b/web/locales/fr.json @@ -142,6 +142,10 @@ "\"Use as is\" is not available here.": "« Utiliser tel quel » n’est pas disponible ici.", "\"Use as is\" is not available on this computer yet.": "« Utiliser tel quel » n’est pas encore disponible sur cet ordinateur.", "\"Use as is\" is not available while extending a video. Remove \"Extends this video\" first.": "« Utiliser tel quel » n’est pas disponible pendant la prolongation d’une vidéo. Retirez d’abord « Prolonge cette vidéo ».", + "\"{folder}\" holds too many files that could be models for FreeVideo to check one by one. Move the files that are not models out of this folder, then try again.": "« {folder} » contient trop de fichiers susceptibles d’être des modèles pour que FreeVideo les vérifie un par un. Déplacez hors de ce dossier les fichiers qui ne sont pas des modèles, puis réessayez.", + "\"{folder}\" holds too many files that could be models for FreeVideo to check one by one. Offline packages cannot download the models instead, so remove this folder from \"Reuse models\" on the Models page.": "« {folder} » contient trop de fichiers susceptibles d’être des modèles pour que FreeVideo les vérifie un par un. Avec des paquets hors ligne, les modèles ne peuvent pas être téléchargés à la place : retirez donc ce dossier de « Réutiliser des modèles » sur la page Modèles.", + "\"{folder}\" holds too many files that could be models for FreeVideo to check one by one. Skip this folder and download the models instead, or remove it from \"Reuse models\" on the Models page.": "« {folder} » contient trop de fichiers susceptibles d’être des modèles pour que FreeVideo les vérifie un par un. Ignorez ce dossier et téléchargez plutôt les modèles, ou retirez-le de « Réutiliser des modèles » sur la page Modèles.", + "\"{folder}\" holds too many files that could be models for FreeVideo to check one by one. Skip this folder and download the models instead.": "« {folder} » contient trop de fichiers susceptibles d’être des modèles pour que FreeVideo les vérifie un par un. Ignorez ce dossier et téléchargez plutôt les modèles.", "\"{media}\" could not be found. Upload or select it again, then generate.": "« {media} » est introuvable. Téléversez-le ou sélectionnez-le de nouveau, puis lancez la génération.", "\"{name}\" can't hold FreeVideo. Choose another disk.": "« {name} » ne peut pas accueillir FreeVideo. Choisissez un autre disque.", "\"{name}\" can't store files over 4 GB. Choose another disk.": "« {name} » ne peut pas stocker de fichiers de plus de 4 GB. Choisissez un autre disque.", @@ -624,6 +628,7 @@ "Attached images": "Images jointes", "Audio 1": "Audio 1", "Audio 2": "Audio 2", + "Audio 2 cannot be removed while the Dialogue, Music and Ambience tracks still have parts. Delete those parts first.": "Impossible de supprimer « Audio 2 » tant que les pistes « Dialogue », « Musique » et « Ambiance » contiennent des clips. Supprimez d’abord ces clips.", "Audio and video cache": "Cache audio et vidéo", "Audio length: {seconds} s; uses up to the first 15 s within the video length.": "Durée de l’audio : {seconds} s ; les 15 s du début au maximum sont utilisés, dans la limite de la durée de la vidéo.", "Audio longer than 30 seconds used as is is made in parts, which needs \"Faster second pass\". Turn it on or set the audio to \"Reference\".": "Un audio de plus de 30 secondes utilisé tel quel est généré en plusieurs parties, ce qui nécessite « Deuxième passe accélérée ». Activez cette option ou réglez l’audio sur « Référence ».", @@ -2317,6 +2322,7 @@ "FreeVideo asks before deleting a video, and a video used in an edit cannot be deleted.": "FreeVideo demande une confirmation avant de supprimer une vidéo, et une vidéo utilisée dans un montage ne peut pas être supprimée.", "FreeVideo cannot read its own files": "FreeVideo ne peut pas lire ses propres fichiers", "FreeVideo cannot run from this disk": "FreeVideo ne peut pas s’exécuter depuis ce disque", + "FreeVideo cannot use \"{name}\": this file type is not supported. Use a PNG, JPEG or WebP image, an MP4, MOV or WebM video, or WAV or MP3 audio.": "FreeVideo ne peut pas utiliser « {name} » : ce type de fichier n’est pas pris en charge. Utilisez une image PNG, JPEG ou WebP, une vidéo MP4, MOV ou WebM, ou un fichier audio WAV ou MP3.", "FreeVideo closed unexpectedly while generating.": "FreeVideo s’est fermé de façon inattendue pendant la génération.", "FreeVideo could not be opened from the menu": "FreeVideo n’a pas pu être ouvert depuis le menu", "FreeVideo could not reach the network.": "FreeVideo n’a pas pu accéder au réseau.", @@ -3183,6 +3189,7 @@ "Making music": "Création de la musique", "Making the video": "Assemblage de la vidéo", "Male": "Homme", + "Manage model folders": "Gérer les dossiers de modèles", "Mannequin": "Mannequin", "Mark all as read": "Tout marquer comme lu", "Mark as read": "Marquer comme lu", @@ -3472,6 +3479,7 @@ "Not deleted: saved edits could not be checked. Try again in a moment.": "Non supprimé : impossible de vérifier les montages enregistrés. Réessayez dans un instant.", "Not deleted: the folder also holds files FreeVideo did not write: ": "Non supprimé : le dossier contient aussi des fichiers non créés par FreeVideo : ", "Not deleted: these edits use it: ": "Non supprimé : ces montages l’utilisent : ", + "Not detected": "Non détecté", "Not enabled. Your prompt is unchanged.": "Non activé. Votre prompt est inchangé.", "Not enough GPU memory": "Mémoire GPU insuffisante", "Not enough GPU memory for depth": "Mémoire GPU insuffisante pour la profondeur", @@ -4434,6 +4442,7 @@ "Restore original": "Restaurer l’original", "Restored the original image.": "L’image d’origine a été restaurée.", "Restored the original image. Edit it again to reapply the changes.": "L’image d’origine a été restaurée. Modifiez-la de nouveau pour réappliquer les modifications.", + "Restored your changes up to {time}. Later changes could not be kept on this computer and were lost.": "Vos modifications ont été restaurées jusqu’à {time}. Les modifications suivantes n’ont pas pu être conservées sur cet ordinateur et ont été perdues.", "Restored, but {lost} could not be brought back.": "Restauré, mais impossible de récupérer {lost}.", "Restored.": "Restauré.", "Restore␟恢复": "Restaurer", @@ -4947,6 +4956,7 @@ "Sketch mannequin": "Mannequin d’esquisse", "Sketch␟画草图": "Esquisser", "Sketch␟草图": "Esquisse", + "Skip this folder and download": "Ignorer ce dossier et télécharger", "Skipped": "Ignoré", "Skipped 1 unsupported file": "1 fichier non pris en charge ignoré", "Skipped 1 unsupported file ({types})": "1 fichier non pris en charge ignoré ({types})", @@ -4964,7 +4974,8 @@ "Small file": "Petit fichier", "Smaller than the {vsize} video; the result will look softer.": "Plus petite que la vidéo de {vsize} ; le résultat sera plus flou.", "Smaller tiles, more at once": "Vignettes plus petites, davantage à la fois", - "Smart App Control in Windows blocked these files. Search Windows for \"Smart App Control\", or open Windows Security → App & browser control → Smart App Control settings.": "Le Contrôle intelligent des applications de Windows a bloqué ces fichiers. Recherchez « Contrôle intelligent des applications » dans Windows, ou ouvrez Sécurité Windows → Contrôle des applications et du navigateur → Paramètres du Contrôle intelligent des applications.", + "Smart App Control cannot make an exception for one program. FreeVideo can run only if it is turned off: search Windows for \"Smart App Control\" and open its settings.": "Le contrôle intelligent des applications ne permet pas d’exception pour un seul programme. FreeVideo ne peut s’exécuter que s’il est désactivé : recherchez « Contrôle intelligent des applications » dans Windows et ouvrez ses paramètres.", + "Smart App Control in Windows blocked files that FreeVideo needs, so FreeVideo cannot run on this computer.": "Le contrôle intelligent des applications de Windows a bloqué des fichiers dont FreeVideo a besoin ; FreeVideo ne peut donc pas s’exécuter sur cet ordinateur.", "Smart App Control in Windows stopped it": "Le Contrôle intelligent des applications de Windows l’a bloqué", "Smart App Control in Windows stopped setup from writing a file.": "Le Contrôle intelligent des applications de Windows a empêché le programme d’installation d’écrire un fichier.", "Smart App Control in Windows stopped the downloaded launcher. This version of FreeVideo keeps working.": "Le Contrôle intelligent des applications de Windows a bloqué le lanceur téléchargé. Cette version de FreeVideo continue de fonctionner.", @@ -5812,6 +5823,7 @@ "There is not enough free graphics or system memory for this image": "La mémoire graphique ou système disponible est insuffisante pour cette image", "There is not enough free memory to continue installing": "La mémoire libre est insuffisante pour poursuivre l’installation", "There must be a clip under the playhead. A part that is still being generated can be saved once it is done.": "Un clip doit se trouver sous la tête de lecture. Une partie encore en cours de génération peut être enregistrée une fois terminée.", + "These changes have not been saved and are only in this page. Keep the page open until they are saved; closing it now would lose them.": "Ces modifications ne sont pas encore enregistrées et n’existent que dans cette page. Gardez la page ouverte jusqu’à leur enregistrement ; la fermer maintenant les ferait perdre.", "These creations cannot be downloaded.": "Ces créations ne peuvent pas être téléchargées.", "These creations cannot be read.": "Ces créations ne peuvent pas être lues.", "These files are downloaded or reused. Closing Settings does not stop the installation.": "Ces fichiers sont téléchargés ou réutilisés. La fermeture des Paramètres n’interrompt pas l’installation.", @@ -5934,6 +5946,7 @@ "This node is disabled or no longer in the workflow.": "Ce nœud est désactivé ou ne fait plus partie du flux de travail.", "This page": "Cette page", "This page was opened on port {opened}, but FreeVideo runs on port {port}. The two must match: open {address}. If you reach FreeVideo through port forwarding or a tunnel, use {port} as the local port as well. Then retry.": "Cette page a été ouverte sur le port {opened}, mais FreeVideo s’exécute sur le port {port}. Les deux doivent correspondre : ouvrez {address}. Si vous accédez à FreeVideo par une redirection de port ou un tunnel, utilisez aussi {port} comme port local. Réessayez ensuite.", + "This page's connection to FreeVideo has expired, so the change was not saved. Reload the page and repeat the action.": "La connexion de cette page à FreeVideo a expiré ; la modification n’a donc pas été enregistrée. Rechargez la page, puis recommencez l’action.", "This part changed during dubbing, so the new voice was not placed. Redub it.": "Cette partie a été modifiée pendant le doublage ; la nouvelle voix n’a donc pas été placée. Refaites le doublage.", "This part could not be generated. Continue from this part; if it fails again, send a report.": "Cette partie n’a pas pu être générée. Continuez à partir de cette partie ; si elle échoue de nouveau, envoyez un rapport.", "This part has no audio": "Cette partie n’a pas d’audio", @@ -5993,7 +6006,6 @@ "This workflow uses nodes that FreeVideo cannot read. Open it in Nodes.": "Ce flux de travail utilise des nœuds que FreeVideo ne peut pas lire. Ouvrez-le dans la vue Nœuds.", "Three steps around Create or Edit": "Trois étapes pour découvrir Créer ou Montage", "Three steps around the screen": "Trois étapes pour découvrir l’interface", - "Three-quarter": "Trois-quarts", "Thumbnails and durations could not be loaded. Try again; if it still fails, choose \"Report a problem\".": "Les miniatures et les durées n’ont pas pu être chargées. Réessayez ; si l’échec persiste, choisissez « Signaler un problème ».", "Thumbnails only, a larger picture": "Miniatures seules, image plus grande", "Tick \"I accept the installation plan and model / toolkit licenses.\" and choose \"Confirm & continue\".": "Cochez « J’accepte le plan d’installation et les licences des modèles / du kit d’outils. » et choisissez « Confirmer et continuer ».", @@ -6035,6 +6047,8 @@ "Tolerance": "Tolérance", "Too many attempts. Try again in {count} s.": "Trop de tentatives. Réessayez dans {count} s.", "Too many attempts. Try again in {minutes} min.": "Trop de tentatives. Réessayez dans {minutes} min.", + "Too many creations for one download. Download them in smaller groups.": "Trop de créations pour un seul téléchargement. Téléchargez-les par petits groupes.", + "Too many files to check in a model folder": "Trop de fichiers à vérifier dans un dossier de modèles", "Took": "Temps", "Took too long. Try again.": "L’opération a pris trop de temps. Réessayez.", "Tools that do not fit in the bar": "Outils qui ne tiennent pas dans la barre", @@ -6110,6 +6124,7 @@ "Turn this part upside down": "Retourner cette partie verticalement", "Turn this preview into the final video": "Transformer cet aperçu en vidéo finale", "Turn this preview part into the full-resolution video, in place": "Convertir cette partie d’aperçu en vidéo pleine résolution, sur place", + "Turning it off lowers Windows' protection against unknown programs. On some versions of Windows, it can be turned on again only by resetting Windows.": "Le désactiver réduit la protection de Windows contre les programmes inconnus. Sur certaines versions de Windows, il ne peut être réactivé qu’en réinitialisant Windows.", "Tutorial": "Tutoriel", "Tutorials": "Tutoriels", "Two friends sit by a café window at dusk. She says: \"You came back.\" He smiles: \"I promised.\" Warm light, quiet street sounds.": "Deux amis sont assis près de la fenêtre d’un café au crépuscule. Elle dit : « Tu es revenu. » Il sourit : « Je te l’avais promis. » Lumière chaude, bruits calmes de la rue.", @@ -6454,6 +6469,7 @@ "When it shows \"Assistant connected\" or the assistant's name, describe the video under \"Tell the assistant…\", for example \"Make a 1-minute vertical short film: a day in a coffee shop\".": "Lorsque « Assistant connecté » ou le nom de l’assistant s’affiche, décrivez la vidéo sous « Parler à l’assistant… », par exemple « Créer un court métrage vertical de 1 minute : une journée dans un café ».", "When model files are incomplete or changed, import the same offline packages again in the launcher; only the files with problems are completed or replaced.": "Lorsque des fichiers de modèle sont incomplets ou modifiés, importez de nouveau les mêmes paquets hors ligne dans le lanceur ; seuls les fichiers problématiques sont complétés ou remplacés.", "When off, nothing takes VRAM before a generation; models already used stay loaded for the next one.": "Lorsque cette option est désactivée, rien n’occupe de VRAM avant une génération ; les modèles déjà utilisés restent chargés pour la suivante.", + "When off, nothing takes unified memory before a generation; models already used stay loaded for the next one.": "Lorsque cette option est désactivée, rien n’occupe la mémoire unifiée avant une génération ; les modèles déjà utilisés restent chargés pour la suivante.", "When on, other devices on the same network can open FreeVideo with the link below and enter the password the first time.": "Lorsque cette option est activée, les autres appareils du même réseau peuvent ouvrir FreeVideo avec le lien ci-dessous et saisir le mot de passe la première fois.", "When on, other devices on the same network can open FreeVideo with the link below. Anyone with the link can use it, so keep it private.": "Lorsque cette option est activée, les autres appareils du même réseau peuvent ouvrir FreeVideo avec le lien ci-dessous. Toute personne disposant du lien peut l’utiliser ; gardez-le donc confidentiel.", "When something goes wrong": "En cas de problème", @@ -6781,6 +6797,7 @@ "video model": "modèle vidéo", "wide shot": "wide shot", "with prompt": "avec le prompt", + "yesterday at {time}": "hier à {time}", "your Python mirror": "votre miroir Python", "your configured source": "votre source configurée", "zoom in": "zoom in", @@ -6829,6 +6846,7 @@ "{count} tasks, {active} under way": "{count} tâches, {active} en cours", "{count} videos from this task": "{count} vidéos de cette tâche", "{count} voiceovers": "{count} voix off", + "{date} at {time}": "{date} à {time}", "{done} / {total} files": "{done} / {total} fichiers", "{done} / {total} frames": "{done} / {total} images", "{done} / {total} layers": "{done} / {total} calques", diff --git a/web/locales/id.json b/web/locales/id.json index 3da77528..57f8d3fe 100644 --- a/web/locales/id.json +++ b/web/locales/id.json @@ -107,6 +107,10 @@ "\"Use as is\" is not available here.": "“Gunakan apa adanya” tidak tersedia di sini.", "\"Use as is\" is not available on this computer yet.": "“Gunakan apa adanya” belum tersedia di komputer ini.", "\"Use as is\" is not available while extending a video. Remove \"Extends this video\" first.": "“Gunakan apa adanya” tidak tersedia saat memperpanjang video. Hapus “Memperpanjang video ini” terlebih dahulu.", + "\"{folder}\" holds too many files that could be models for FreeVideo to check one by one. Move the files that are not models out of this folder, then try again.": "“{folder}” berisi terlalu banyak file yang mungkin berupa model sehingga FreeVideo tidak dapat memeriksanya satu per satu. Pindahkan file yang bukan model keluar dari folder ini, lalu coba lagi.", + "\"{folder}\" holds too many files that could be models for FreeVideo to check one by one. Offline packages cannot download the models instead, so remove this folder from \"Reuse models\" on the Models page.": "“{folder}” berisi terlalu banyak file yang mungkin berupa model sehingga FreeVideo tidak dapat memeriksanya satu per satu. Paket offline tidak dapat mengunduh model sebagai gantinya, jadi hapus folder ini dari “Gunakan ulang model” di halaman Model.", + "\"{folder}\" holds too many files that could be models for FreeVideo to check one by one. Skip this folder and download the models instead, or remove it from \"Reuse models\" on the Models page.": "“{folder}” berisi terlalu banyak file yang mungkin berupa model sehingga FreeVideo tidak dapat memeriksanya satu per satu. Lewati folder ini dan unduh modelnya saja, atau hapus folder ini dari “Gunakan ulang model” di halaman Model.", + "\"{folder}\" holds too many files that could be models for FreeVideo to check one by one. Skip this folder and download the models instead.": "“{folder}” berisi terlalu banyak file yang mungkin berupa model sehingga FreeVideo tidak dapat memeriksanya satu per satu. Lewati folder ini dan unduh modelnya saja.", "\"{media}\" could not be found. Upload or select it again, then generate.": "“{media}” tidak ditemukan. Unggah atau pilih lagi, lalu hasilkan.", "\"{name}\" can't hold FreeVideo. Choose another disk.": "“{name}” tidak dapat menampung FreeVideo. Pilih disk lain.", "\"{name}\" can't store files over 4 GB. Choose another disk.": "“{name}” tidak dapat menyimpan file lebih dari 4 GB. Pilih disk lain.", @@ -589,6 +593,7 @@ "Attached images": "Gambar terlampir", "Audio 1": "Audio 1", "Audio 2": "Audio 2", + "Audio 2 cannot be removed while the Dialogue, Music and Ambience tracks still have parts. Delete those parts first.": "“Audio 2” tidak dapat dihapus selama trek “Vokal”, “Musik”, dan “Suara latar” masih berisi klip. Hapus klip tersebut terlebih dahulu.", "Audio and video cache": "Cache audio dan video", "Audio length: {seconds} s; uses up to the first 15 s within the video length.": "Durasi audio: {seconds} dtk; menggunakan hingga 15 dtk pertama dalam batas durasi video.", "Audio longer than 30 seconds used as is is made in parts, which needs \"Faster second pass\". Turn it on or set the audio to \"Reference\".": "Audio berdurasi lebih dari 30 detik yang digunakan apa adanya dibuat per bagian, sehingga memerlukan “Tahap kedua cepat”. Aktifkan opsi tersebut atau atur audio ke “Referensi”.", @@ -2282,6 +2287,7 @@ "FreeVideo asks before deleting a video, and a video used in an edit cannot be deleted.": "FreeVideo meminta konfirmasi sebelum menghapus video, dan video yang digunakan dalam suntingan tidak dapat dihapus.", "FreeVideo cannot read its own files": "FreeVideo tidak dapat membaca file miliknya sendiri", "FreeVideo cannot run from this disk": "FreeVideo tidak dapat berjalan dari disk ini", + "FreeVideo cannot use \"{name}\": this file type is not supported. Use a PNG, JPEG or WebP image, an MP4, MOV or WebM video, or WAV or MP3 audio.": "FreeVideo tidak dapat menggunakan “{name}”: jenis file ini tidak didukung. Gunakan gambar PNG, JPEG, atau WebP; video MP4, MOV, atau WebM; atau audio WAV atau MP3.", "FreeVideo closed unexpectedly while generating.": "FreeVideo tertutup secara tidak terduga saat menghasilkan.", "FreeVideo could not be opened from the menu": "FreeVideo tidak dapat dibuka dari menu", "FreeVideo could not reach the network.": "FreeVideo tidak dapat menjangkau jaringan.", @@ -3148,6 +3154,7 @@ "Making music": "Membuat musik", "Making the video": "Membuat video", "Male": "Laki-laki", + "Manage model folders": "Kelola folder model", "Mannequin": "Manekin", "Mark all as read": "Tandai semua sudah dibaca", "Mark as read": "Tandai sudah dibaca", @@ -3437,6 +3444,7 @@ "Not deleted: saved edits could not be checked. Try again in a moment.": "Tidak dihapus: suntingan tersimpan tidak dapat diperiksa. Coba lagi sebentar lagi.", "Not deleted: the folder also holds files FreeVideo did not write: ": "Tidak dihapus: folder juga berisi file yang tidak ditulis oleh FreeVideo: ", "Not deleted: these edits use it: ": "Tidak dihapus: suntingan berikut menggunakannya: ", + "Not detected": "Tidak terdeteksi", "Not enabled. Your prompt is unchanged.": "Tidak diaktifkan. Prompt Anda tidak berubah.", "Not enough GPU memory": "Memori GPU tidak cukup", "Not enough GPU memory for depth": "Memori GPU tidak cukup untuk kedalaman", @@ -4399,6 +4407,7 @@ "Restore original": "Pulihkan asli", "Restored the original image.": "Gambar asli dipulihkan.", "Restored the original image. Edit it again to reapply the changes.": "Gambar asli dipulihkan. Sunting lagi untuk menerapkan kembali perubahan.", + "Restored your changes up to {time}. Later changes could not be kept on this computer and were lost.": "Perubahan Anda dipulihkan hingga {time}. Perubahan setelahnya tidak dapat disimpan di komputer ini dan hilang.", "Restored, but {lost} could not be brought back.": "Dipulihkan, tetapi {lost} tidak dapat dikembalikan.", "Restored.": "Dipulihkan.", "Restore␟恢复": "Pulihkan", @@ -4912,6 +4921,7 @@ "Sketch mannequin": "Manekin sketsa", "Sketch␟画草图": "Buat sketsa", "Sketch␟草图": "Sketsa", + "Skip this folder and download": "Lewati folder ini dan unduh", "Skipped": "Dilewati", "Skipped 1 unsupported file": "1 file yang tidak didukung dilewati", "Skipped 1 unsupported file ({types})": "1 file yang tidak didukung dilewati ({types})", @@ -4929,7 +4939,8 @@ "Small file": "File kecil", "Smaller than the {vsize} video; the result will look softer.": "Lebih kecil daripada video {vsize}; hasilnya akan terlihat kurang tajam.", "Smaller tiles, more at once": "Ubin lebih kecil, lebih banyak sekaligus", - "Smart App Control in Windows blocked these files. Search Windows for \"Smart App Control\", or open Windows Security → App & browser control → Smart App Control settings.": "Kontrol Aplikasi Cerdas di Windows memblokir file-file ini. Cari “Kontrol Aplikasi Cerdas” di Windows, atau buka Keamanan Windows → Kontrol aplikasi & browser → Pengaturan Kontrol Aplikasi Cerdas.", + "Smart App Control cannot make an exception for one program. FreeVideo can run only if it is turned off: search Windows for \"Smart App Control\" and open its settings.": "Kontrol Aplikasi Pintar tidak dapat membuat pengecualian untuk satu program. FreeVideo hanya dapat berjalan jika fitur ini dimatikan: cari “Kontrol Aplikasi Pintar” di Windows, lalu buka pengaturannya.", + "Smart App Control in Windows blocked files that FreeVideo needs, so FreeVideo cannot run on this computer.": "Kontrol Aplikasi Pintar di Windows memblokir file yang diperlukan FreeVideo, sehingga FreeVideo tidak dapat berjalan di komputer ini.", "Smart App Control in Windows stopped it": "Kontrol Aplikasi Cerdas di Windows memblokirnya", "Smart App Control in Windows stopped setup from writing a file.": "Kontrol Aplikasi Cerdas di Windows mencegah penyiapan menulis file.", "Smart App Control in Windows stopped the downloaded launcher. This version of FreeVideo keeps working.": "Kontrol Aplikasi Cerdas di Windows menghentikan peluncur yang diunduh. Versi FreeVideo ini tetap berfungsi.", @@ -5777,6 +5788,7 @@ "There is not enough free graphics or system memory for this image": "Memori grafis atau memori sistem yang tersedia tidak cukup untuk gambar ini", "There is not enough free memory to continue installing": "Memori kosong tidak cukup untuk melanjutkan instalasi", "There must be a clip under the playhead. A part that is still being generated can be saved once it is done.": "Harus ada klip di bawah playhead. Bagian yang masih dibuat dapat disimpan setelah selesai.", + "These changes have not been saved and are only in this page. Keep the page open until they are saved; closing it now would lose them.": "Perubahan ini belum disimpan dan hanya ada di halaman ini. Biarkan halaman tetap terbuka sampai perubahan tersimpan; jika ditutup sekarang, perubahan akan hilang.", "These creations cannot be downloaded.": "Karya ini tidak dapat diunduh.", "These creations cannot be read.": "Karya ini tidak dapat dibaca.", "These files are downloaded or reused. Closing Settings does not stop the installation.": "File ini akan diunduh atau digunakan ulang. Menutup Pengaturan tidak akan menghentikan instalasi.", @@ -5899,6 +5911,7 @@ "This node is disabled or no longer in the workflow.": "Node ini dinonaktifkan atau tidak lagi ada di alur kerja.", "This page": "Halaman ini", "This page was opened on port {opened}, but FreeVideo runs on port {port}. The two must match: open {address}. If you reach FreeVideo through port forwarding or a tunnel, use {port} as the local port as well. Then retry.": "Halaman ini dibuka melalui port {opened}, tetapi FreeVideo berjalan di port {port}. Keduanya harus sama: buka {address}. Jika Anda mengakses FreeVideo melalui penerusan port atau tunnel, gunakan juga {port} sebagai port lokal. Setelah itu, coba lagi.", + "This page's connection to FreeVideo has expired, so the change was not saved. Reload the page and repeat the action.": "Koneksi halaman ini ke FreeVideo sudah kedaluwarsa, sehingga perubahan tidak disimpan. Muat ulang halaman dan ulangi tindakan ini.", "This part changed during dubbing, so the new voice was not placed. Redub it.": "Bagian ini berubah selama sulih suara, sehingga suara baru tidak ditempatkan. Sulih suara ulang.", "This part could not be generated. Continue from this part; if it fails again, send a report.": "Bagian ini tidak dapat dibuat. Lanjutkan dari bagian ini; jika gagal lagi, kirim laporan.", "This part has no audio": "Bagian ini tidak memiliki audio", @@ -5958,7 +5971,6 @@ "This workflow uses nodes that FreeVideo cannot read. Open it in Nodes.": "Alur kerja ini menggunakan node yang tidak dapat dibaca FreeVideo. Buka di tampilan Node.", "Three steps around Create or Edit": "Tiga langkah seputar Buat atau Sunting", "Three steps around the screen": "Mengenal layar dalam tiga langkah", - "Three-quarter": "Tiga perempat", "Thumbnails and durations could not be loaded. Try again; if it still fails, choose \"Report a problem\".": "Gambar mini dan durasi tidak dapat dimuat. Coba lagi; jika masih gagal, pilih “Laporkan masalah”.", "Thumbnails only, a larger picture": "Hanya gambar mini, tampilan lebih besar", "Tick \"I accept the installation plan and model / toolkit licenses.\" and choose \"Confirm & continue\".": "Centang “Saya menyetujui rencana instalasi serta lisensi model / toolkit.”, lalu pilih “Konfirmasi & lanjutkan”.", @@ -6000,6 +6012,8 @@ "Tolerance": "Toleransi", "Too many attempts. Try again in {count} s.": "Terlalu banyak percobaan. Coba lagi dalam {count} dtk.", "Too many attempts. Try again in {minutes} min.": "Terlalu banyak percobaan. Coba lagi dalam {minutes} mnt.", + "Too many creations for one download. Download them in smaller groups.": "Terlalu banyak karya untuk satu unduhan. Unduh dalam kelompok yang lebih kecil.", + "Too many files to check in a model folder": "Terlalu banyak file untuk diperiksa di folder model", "Took": "Waktu proses", "Took too long. Try again.": "Terlalu lama. Coba lagi.", "Tools that do not fit in the bar": "Alat yang tidak muat di bilah", @@ -6075,6 +6089,7 @@ "Turn this part upside down": "Balikkan bagian ini atas ke bawah", "Turn this preview into the final video": "Jadikan pratinjau ini video final", "Turn this preview part into the full-resolution video, in place": "Ubah bagian pratinjau ini menjadi video resolusi penuh, di tempat yang sama", + "Turning it off lowers Windows' protection against unknown programs. On some versions of Windows, it can be turned on again only by resetting Windows.": "Mematikannya menurunkan perlindungan Windows terhadap program yang tidak dikenal. Pada beberapa versi Windows, fitur ini hanya dapat diaktifkan kembali dengan mengatur ulang Windows.", "Tutorial": "Tutorial", "Tutorials": "Tutorial", "Two friends sit by a café window at dusk. She says: \"You came back.\" He smiles: \"I promised.\" Warm light, quiet street sounds.": "Dua sahabat duduk di dekat jendela kafe saat senja. Yang perempuan berkata: “Kamu kembali.” Yang laki-laki tersenyum: “Aku sudah berjanji.” Cahaya hangat, suara jalan yang tenang.", @@ -6419,6 +6434,7 @@ "When it shows \"Assistant connected\" or the assistant's name, describe the video under \"Tell the assistant…\", for example \"Make a 1-minute vertical short film: a day in a coffee shop\".": "Setelah “Asisten terhubung” atau nama asisten ditampilkan, jelaskan video di “Sampaikan ke asisten…”, misalnya “Buat film pendek vertikal 1 menit: sehari di sebuah kedai kopi”.", "When model files are incomplete or changed, import the same offline packages again in the launcher; only the files with problems are completed or replaced.": "Jika file model tidak lengkap atau berubah, impor lagi paket offline yang sama di peluncur; hanya file yang bermasalah yang dilengkapi atau diganti.", "When off, nothing takes VRAM before a generation; models already used stay loaded for the next one.": "Jika nonaktif, tidak ada yang memakai VRAM sebelum pembuatan; model yang sudah digunakan tetap dimuat untuk pembuatan berikutnya.", + "When off, nothing takes unified memory before a generation; models already used stay loaded for the next one.": "Saat nonaktif, tidak ada yang memakai memori terpadu sebelum pembuatan; model yang sudah digunakan tetap dimuat untuk pembuatan berikutnya.", "When on, other devices on the same network can open FreeVideo with the link below and enter the password the first time.": "Jika diaktifkan, perangkat lain di jaringan yang sama dapat membuka FreeVideo dengan tautan di bawah dan memasukkan kata sandi saat pertama kali.", "When on, other devices on the same network can open FreeVideo with the link below. Anyone with the link can use it, so keep it private.": "Jika diaktifkan, perangkat lain di jaringan yang sama dapat membuka FreeVideo dengan tautan di bawah. Siapa pun yang memiliki tautan dapat menggunakannya, jadi jangan bagikan tautan ini.", "When something goes wrong": "Jika terjadi masalah", @@ -6746,6 +6762,7 @@ "video model": "model video", "wide shot": "shot lebar", "with prompt": "dengan prompt", + "yesterday at {time}": "kemarin pukul {time}", "your Python mirror": "mirror Python Anda", "your configured source": "sumber yang Anda konfigurasi", "zoom in": "zoom mendekat", @@ -6794,6 +6811,7 @@ "{count} tasks, {active} under way": "{count} tugas, {active} sedang berjalan", "{count} videos from this task": "{count} video dari tugas ini", "{count} voiceovers": "{count} sulih suara", + "{date} at {time}": "{date} pukul {time}", "{done} / {total} files": "{done} / {total} file", "{done} / {total} frames": "{done} / {total} frame", "{done} / {total} layers": "{done} / {total} lapisan", diff --git a/web/locales/pt-BR.json b/web/locales/pt-BR.json index 78ca6143..12ea78d1 100644 --- a/web/locales/pt-BR.json +++ b/web/locales/pt-BR.json @@ -50,6 +50,10 @@ "\"Use as is\" is not available here.": "\"Usar como está\" não está disponível aqui.", "\"Use as is\" is not available on this computer yet.": "\"Usar como está\" ainda não está disponível neste computador.", "\"Use as is\" is not available while extending a video. Remove \"Extends this video\" first.": "\"Usar como está\" não está disponível ao estender um vídeo. Remova \"Estende este vídeo\" primeiro.", + "\"{folder}\" holds too many files that could be models for FreeVideo to check one by one. Move the files that are not models out of this folder, then try again.": "\"{folder}\" tem arquivos demais que podem ser modelos para o FreeVideo verificar um a um. Mova para fora desta pasta os arquivos que não são modelos e tente novamente.", + "\"{folder}\" holds too many files that could be models for FreeVideo to check one by one. Offline packages cannot download the models instead, so remove this folder from \"Reuse models\" on the Models page.": "\"{folder}\" tem arquivos demais que podem ser modelos para o FreeVideo verificar um a um. Com pacotes offline não é possível baixar os modelos, então remova esta pasta de \"Reutilizar modelos\" na página Modelos.", + "\"{folder}\" holds too many files that could be models for FreeVideo to check one by one. Skip this folder and download the models instead, or remove it from \"Reuse models\" on the Models page.": "\"{folder}\" tem arquivos demais que podem ser modelos para o FreeVideo verificar um a um. Pule esta pasta e baixe os modelos, ou remova-a de \"Reutilizar modelos\" na página Modelos.", + "\"{folder}\" holds too many files that could be models for FreeVideo to check one by one. Skip this folder and download the models instead.": "\"{folder}\" tem arquivos demais que podem ser modelos para o FreeVideo verificar um a um. Pule esta pasta e baixe os modelos.", "\"{media}\" could not be found. Upload or select it again, then generate.": "\"{media}\" não foi encontrado. Envie ou selecione novamente e depois gere.", "\"{name}\" can't hold FreeVideo. Choose another disk.": "\"{name}\" não comporta o FreeVideo. Escolha outro disco.", "\"{name}\" can't store files over 4 GB. Choose another disk.": "\"{name}\" não armazena arquivos com mais de 4 GB. Escolha outro disco.", @@ -532,6 +536,7 @@ "Attached images": "Imagens anexadas", "Audio 1": "Áudio 1", "Audio 2": "Áudio 2", + "Audio 2 cannot be removed while the Dialogue, Music and Ambience tracks still have parts. Delete those parts first.": "Não é possível remover \"Áudio 2\" enquanto as faixas \"Diálogo\", \"Música\" e \"Som ambiente\" ainda tiverem clipes. Exclua esses clipes primeiro.", "Audio and video cache": "Cache de áudio e vídeo", "Audio length: {seconds} s; uses up to the first 15 s within the video length.": "Duração do áudio: {seconds} s; usa até os primeiros 15 s, dentro da duração do vídeo.", "Audio longer than 30 seconds used as is is made in parts, which needs \"Faster second pass\". Turn it on or set the audio to \"Reference\".": "Um áudio com mais de 30 segundos usado como está é gerado em partes, o que exige \"Segunda passagem mais rápida\". Ative essa opção ou defina o áudio como \"Referência\".", @@ -2225,6 +2230,7 @@ "FreeVideo asks before deleting a video, and a video used in an edit cannot be deleted.": "O FreeVideo pede confirmação antes de excluir um vídeo, e um vídeo usado em uma edição não pode ser excluído.", "FreeVideo cannot read its own files": "O FreeVideo não consegue ler os próprios arquivos", "FreeVideo cannot run from this disk": "O FreeVideo não pode ser executado neste disco", + "FreeVideo cannot use \"{name}\": this file type is not supported. Use a PNG, JPEG or WebP image, an MP4, MOV or WebM video, or WAV or MP3 audio.": "O FreeVideo não pode usar \"{name}\": este tipo de arquivo não é compatível. Use uma imagem PNG, JPEG ou WebP, um vídeo MP4, MOV ou WebM, ou um áudio WAV ou MP3.", "FreeVideo closed unexpectedly while generating.": "O FreeVideo foi fechado inesperadamente durante a geração.", "FreeVideo could not be opened from the menu": "Não foi possível abrir o FreeVideo pelo menu", "FreeVideo could not reach the network.": "O FreeVideo não conseguiu acessar a rede.", @@ -3091,6 +3097,7 @@ "Making music": "Criando a música", "Making the video": "Criando o vídeo", "Male": "Masculino", + "Manage model folders": "Gerenciar pastas de modelos", "Mannequin": "Manequim", "Mark all as read": "Marcar todas como lidas", "Mark as read": "Marcar como lida", @@ -3380,6 +3387,7 @@ "Not deleted: saved edits could not be checked. Try again in a moment.": "Não excluído: não foi possível verificar as edições salvas. Tente novamente em instantes.", "Not deleted: the folder also holds files FreeVideo did not write: ": "Não excluído: a pasta também contém arquivos que o FreeVideo não gravou: ", "Not deleted: these edits use it: ": "Não excluído: estas edições o utilizam: ", + "Not detected": "Não detectado", "Not enabled. Your prompt is unchanged.": "Não ativado. Seu prompt não foi alterado.", "Not enough GPU memory": "Memória da GPU insuficiente", "Not enough GPU memory for depth": "Memória da GPU insuficiente para a profundidade", @@ -4342,6 +4350,7 @@ "Restore original": "Restaurar original", "Restored the original image.": "Imagem original restaurada.", "Restored the original image. Edit it again to reapply the changes.": "Imagem original restaurada. Edite-a novamente para reaplicar as alterações.", + "Restored your changes up to {time}. Later changes could not be kept on this computer and were lost.": "Suas alterações foram restauradas até {time}. As alterações posteriores não puderam ser mantidas neste computador e foram perdidas.", "Restored, but {lost} could not be brought back.": "Restaurado, mas não foi possível restaurar {lost}.", "Restored.": "Restaurado.", "Restore␟恢复": "Restaurar", @@ -4855,6 +4864,7 @@ "Sketch mannequin": "Manequim de esboço", "Sketch␟画草图": "Esboço", "Sketch␟草图": "Esboço", + "Skip this folder and download": "Pular esta pasta e baixar", "Skipped": "Pulado", "Skipped 1 unsupported file": "1 arquivo sem suporte foi ignorado", "Skipped 1 unsupported file ({types})": "1 arquivo sem suporte foi ignorado ({types})", @@ -4872,7 +4882,8 @@ "Small file": "Arquivo pequeno", "Smaller than the {vsize} video; the result will look softer.": "Menor que o vídeo de {vsize}; o resultado ficará menos nítido.", "Smaller tiles, more at once": "Miniaturas menores, mais itens por vez", - "Smart App Control in Windows blocked these files. Search Windows for \"Smart App Control\", or open Windows Security → App & browser control → Smart App Control settings.": "O Controle Inteligente de Aplicativos do Windows bloqueou estes arquivos. Pesquise \"Controle Inteligente de Aplicativos\" no Windows ou abra Segurança do Windows → Controle de aplicativo e navegador → Configurações do Controle Inteligente de Aplicativos.", + "Smart App Control cannot make an exception for one program. FreeVideo can run only if it is turned off: search Windows for \"Smart App Control\" and open its settings.": "O Controle Inteligente de Aplicativos não permite criar uma exceção para um único programa. O FreeVideo só pode ser executado se ele for desativado: pesquise \"Controle Inteligente de Aplicativos\" no Windows e abra as configurações dele.", + "Smart App Control in Windows blocked files that FreeVideo needs, so FreeVideo cannot run on this computer.": "O Controle Inteligente de Aplicativos do Windows bloqueou arquivos de que o FreeVideo precisa, por isso o FreeVideo não pode ser executado neste computador.", "Smart App Control in Windows stopped it": "O Controle Inteligente de Aplicativos do Windows bloqueou isso", "Smart App Control in Windows stopped setup from writing a file.": "O Controle Inteligente de Aplicativos do Windows impediu que a instalação gravasse um arquivo.", "Smart App Control in Windows stopped the downloaded launcher. This version of FreeVideo keeps working.": "O Controle Inteligente de Aplicativos do Windows bloqueou o iniciador baixado. Esta versão do FreeVideo continua funcionando.", @@ -5720,6 +5731,7 @@ "There is not enough free graphics or system memory for this image": "Não há memória livre suficiente, de vídeo ou do sistema, para esta imagem", "There is not enough free memory to continue installing": "Não há memória livre suficiente para continuar a instalação", "There must be a clip under the playhead. A part that is still being generated can be saved once it is done.": "Deve haver um clipe sob o cursor de reprodução. Uma parte que ainda está sendo gerada só pode ser salva depois de concluída.", + "These changes have not been saved and are only in this page. Keep the page open until they are saved; closing it now would lose them.": "Estas alterações ainda não foram salvas e estão apenas nesta página. Mantenha a página aberta até que sejam salvas; se fechá-la agora, elas serão perdidas.", "These creations cannot be downloaded.": "Estas criações não podem ser baixadas.", "These creations cannot be read.": "Estas criações não podem ser lidas.", "These files are downloaded or reused. Closing Settings does not stop the installation.": "Estes arquivos serão baixados ou reutilizados. Fechar as Configurações não interrompe a instalação.", @@ -5842,6 +5854,7 @@ "This node is disabled or no longer in the workflow.": "Este nó está desativado ou não faz mais parte do fluxo de trabalho.", "This page": "Esta página", "This page was opened on port {opened}, but FreeVideo runs on port {port}. The two must match: open {address}. If you reach FreeVideo through port forwarding or a tunnel, use {port} as the local port as well. Then retry.": "Esta página foi aberta na porta {opened}, mas o FreeVideo é executado na porta {port}. As duas precisam ser iguais: abra {address}. Se você acessa o FreeVideo por encaminhamento de portas ou por um túnel, use também {port} como porta local. Depois, tente novamente.", + "This page's connection to FreeVideo has expired, so the change was not saved. Reload the page and repeat the action.": "A conexão desta página com o FreeVideo expirou, por isso a alteração não foi salva. Recarregue a página e repita a ação.", "This part changed during dubbing, so the new voice was not placed. Redub it.": "Esta parte mudou durante a dublagem, por isso a nova voz não foi colocada. Refaça a dublagem.", "This part could not be generated. Continue from this part; if it fails again, send a report.": "Não foi possível gerar esta parte. Continue a partir desta parte; se falhar novamente, envie um relatório.", "This part has no audio": "Esta parte não tem áudio", @@ -5901,7 +5914,6 @@ "This workflow uses nodes that FreeVideo cannot read. Open it in Nodes.": "Este fluxo de trabalho usa nós que o FreeVideo não consegue ler. Abra-o na visualização de Nós.", "Three steps around Create or Edit": "Três passos para conhecer Criar ou Editar", "Three steps around the screen": "Três passos para conhecer a tela", - "Three-quarter": "Três quartos", "Thumbnails and durations could not be loaded. Try again; if it still fails, choose \"Report a problem\".": "Não foi possível carregar as miniaturas e as durações. Tente novamente; se ainda falhar, escolha \"Relatar um problema\".", "Thumbnails only, a larger picture": "Apenas miniaturas, imagem maior", "Tick \"I accept the installation plan and model / toolkit licenses.\" and choose \"Confirm & continue\".": "Marque \"Aceito o plano de instalação e as licenças dos modelos / do kit de ferramentas.\" e escolha \"Confirmar e continuar\".", @@ -5943,6 +5955,8 @@ "Tolerance": "Tolerância", "Too many attempts. Try again in {count} s.": "Muitas tentativas. Tente novamente em {count} s.", "Too many attempts. Try again in {minutes} min.": "Muitas tentativas. Tente novamente em {minutes} min.", + "Too many creations for one download. Download them in smaller groups.": "Há criações demais para um único download. Baixe-as em grupos menores.", + "Too many files to check in a model folder": "Arquivos demais para verificar em uma pasta de modelos", "Took": "Tempo gasto", "Took too long. Try again.": "Demorou demais. Tente novamente.", "Tools that do not fit in the bar": "Ferramentas que não cabem na barra", @@ -6018,6 +6032,7 @@ "Turn this part upside down": "Virar esta parte de cabeça para baixo", "Turn this preview into the final video": "Transformar esta prévia no vídeo final", "Turn this preview part into the full-resolution video, in place": "Transformar esta parte da prévia no vídeo em resolução total, no mesmo lugar", + "Turning it off lowers Windows' protection against unknown programs. On some versions of Windows, it can be turned on again only by resetting Windows.": "Desativá-lo reduz a proteção do Windows contra programas desconhecidos. Em algumas versões do Windows, ele só pode ser reativado redefinindo o Windows.", "Tutorial": "Tutorial", "Tutorials": "Tutoriais", "Two friends sit by a café window at dusk. She says: \"You came back.\" He smiles: \"I promised.\" Warm light, quiet street sounds.": "Dois amigos estão sentados junto à janela de um café ao entardecer. Ela diz: \"Você voltou.\" Ele sorri: \"Eu prometi.\" Luz quente, sons tranquilos da rua.", @@ -6362,6 +6377,7 @@ "When it shows \"Assistant connected\" or the assistant's name, describe the video under \"Tell the assistant…\", for example \"Make a 1-minute vertical short film: a day in a coffee shop\".": "Quando aparecer \"Assistente conectado\" ou o nome do assistente, descreva o vídeo em \"Diga ao assistente…\", por exemplo \"Crie um curta-metragem vertical de 1 minuto: um dia em uma cafeteria\".", "When model files are incomplete or changed, import the same offline packages again in the launcher; only the files with problems are completed or replaced.": "Quando os arquivos de modelos estiverem incompletos ou alterados, importe novamente os mesmos pacotes offline no iniciador; somente os arquivos com problemas são completados ou substituídos.", "When off, nothing takes VRAM before a generation; models already used stay loaded for the next one.": "Desativado, nada ocupa VRAM antes de uma geração; os modelos já usados continuam carregados para a próxima.", + "When off, nothing takes unified memory before a generation; models already used stay loaded for the next one.": "Desativado, nada ocupa memória unificada antes de uma geração; os modelos já usados continuam carregados para a próxima.", "When on, other devices on the same network can open FreeVideo with the link below and enter the password the first time.": "Quando ativado, outros dispositivos na mesma rede podem abrir o FreeVideo pelo link abaixo e inserir a senha na primeira vez.", "When on, other devices on the same network can open FreeVideo with the link below. Anyone with the link can use it, so keep it private.": "Quando ativado, outros dispositivos na mesma rede podem abrir o FreeVideo pelo link abaixo. Qualquer pessoa com o link pode usá-lo; por isso, mantenha-o privado.", "When something goes wrong": "Quando algo dá errado", @@ -6689,6 +6705,7 @@ "video model": "modelo de vídeo", "wide shot": "plano aberto", "with prompt": "com prompt", + "yesterday at {time}": "ontem às {time}", "your Python mirror": "seu espelho do Python", "your configured source": "sua fonte configurada", "zoom in": "ampliar zoom", @@ -6737,6 +6754,7 @@ "{count} tasks, {active} under way": "{count} tarefas, {active} em andamento", "{count} videos from this task": "{count} vídeos desta tarefa", "{count} voiceovers": "{count} narrações", + "{date} at {time}": "{date} às {time}", "{done} / {total} files": "{done} / {total} arquivos", "{done} / {total} frames": "{done} / {total} quadros", "{done} / {total} layers": "{done} / {total} camadas", diff --git a/web/locales/ru.json b/web/locales/ru.json index 4cc6d1e3..8aa7f469 100644 --- a/web/locales/ru.json +++ b/web/locales/ru.json @@ -99,6 +99,10 @@ "\"Use as is\" is not available here.": "Вариант «Как есть» здесь недоступен.", "\"Use as is\" is not available on this computer yet.": "Вариант «Как есть» на этом компьютере пока недоступен.", "\"Use as is\" is not available while extending a video. Remove \"Extends this video\" first.": "Вариант «Как есть» недоступен при продлении видео. Сначала удалите «Продлевает это видео».", + "\"{folder}\" holds too many files that could be models for FreeVideo to check one by one. Move the files that are not models out of this folder, then try again.": "В папке «{folder}» слишком много файлов, которые могут быть моделями: FreeVideo не может проверить их по одному. Переместите из этой папки файлы, которые не являются моделями, и повторите попытку.", + "\"{folder}\" holds too many files that could be models for FreeVideo to check one by one. Offline packages cannot download the models instead, so remove this folder from \"Reuse models\" on the Models page.": "В папке «{folder}» слишком много файлов, которые могут быть моделями: FreeVideo не может проверить их по одному. С офлайн-пакетами скачать модели вместо этого нельзя, поэтому уберите эту папку из раздела «Повторно использовать модели» на странице «Модели».", + "\"{folder}\" holds too many files that could be models for FreeVideo to check one by one. Skip this folder and download the models instead, or remove it from \"Reuse models\" on the Models page.": "В папке «{folder}» слишком много файлов, которые могут быть моделями: FreeVideo не может проверить их по одному. Пропустите эту папку и скачайте модели или уберите ее из раздела «Повторно использовать модели» на странице «Модели».", + "\"{folder}\" holds too many files that could be models for FreeVideo to check one by one. Skip this folder and download the models instead.": "В папке «{folder}» слишком много файлов, которые могут быть моделями: FreeVideo не может проверить их по одному. Пропустите эту папку и скачайте модели.", "\"{media}\" could not be found. Upload or select it again, then generate.": "Медиафайл «{media}» не найден. Загрузите или выберите его снова, затем повторите генерацию.", "\"{name}\" can't hold FreeVideo. Choose another disk.": "На диск «{name}» нельзя установить FreeVideo. Выберите другой диск.", "\"{name}\" can't store files over 4 GB. Choose another disk.": "На диске «{name}» нельзя хранить файлы больше 4 GB. Выберите другой диск.", @@ -581,6 +585,7 @@ "Attached images": "Прикрепленные изображения", "Audio 1": "Звук 1", "Audio 2": "Звук 2", + "Audio 2 cannot be removed while the Dialogue, Music and Ambience tracks still have parts. Delete those parts first.": "«Звук 2» нельзя удалить, пока на дорожках «Голос», «Музыка» и «Фоновые звуки» есть клипы. Сначала удалите эти клипы.", "Audio and video cache": "Кэш аудио и видео", "Audio length: {seconds} s; uses up to the first 15 s within the video length.": "Длительность аудио: {seconds} с; используются не более чем первые 15 с в пределах длительности видео.", "Audio longer than 30 seconds used as is is made in parts, which needs \"Faster second pass\". Turn it on or set the audio to \"Reference\".": "Аудио длиннее 30 секунд при использовании как есть создается фрагментами, для чего нужен «Ускоренный второй проход». Включите его или выберите для аудио вариант «Образец».", @@ -2274,6 +2279,7 @@ "FreeVideo asks before deleting a video, and a video used in an edit cannot be deleted.": "Перед удалением видео FreeVideo запрашивает подтверждение; видео, используемое в монтаже, удалить нельзя.", "FreeVideo cannot read its own files": "FreeVideo не может прочитать собственные файлы", "FreeVideo cannot run from this disk": "FreeVideo не может работать с этого диска", + "FreeVideo cannot use \"{name}\": this file type is not supported. Use a PNG, JPEG or WebP image, an MP4, MOV or WebM video, or WAV or MP3 audio.": "FreeVideo не может использовать «{name}»: этот тип файлов не поддерживается. Используйте изображение PNG, JPEG или WebP, видео MP4, MOV или WebM либо аудио WAV или MP3.", "FreeVideo closed unexpectedly while generating.": "Программа FreeVideo неожиданно закрылась во время генерации.", "FreeVideo could not be opened from the menu": "Не удалось открыть FreeVideo из меню", "FreeVideo could not reach the network.": "FreeVideo не удалось подключиться к сети.", @@ -3140,6 +3146,7 @@ "Making music": "Создание музыки", "Making the video": "Сборка видео", "Male": "Мужской", + "Manage model folders": "Управлять папками моделей", "Mannequin": "Манекен", "Mark all as read": "Отметить все как прочитанные", "Mark as read": "Отметить как прочитанное", @@ -3429,6 +3436,7 @@ "Not deleted: saved edits could not be checked. Try again in a moment.": "Не удалено: не удалось проверить сохраненные проекты монтажа. Повторите попытку чуть позже.", "Not deleted: the folder also holds files FreeVideo did not write: ": "Не удалено: в папке есть файлы, созданные не FreeVideo: ", "Not deleted: these edits use it: ": "Не удалено: используется в этих проектах монтажа: ", + "Not detected": "Не определено", "Not enabled. Your prompt is unchanged.": "Не включено. Ваш запрос не изменен.", "Not enough GPU memory": "Недостаточно видеопамяти", "Not enough GPU memory for depth": "Недостаточно видеопамяти для извлечения глубины", @@ -4301,7 +4309,7 @@ "Remove…": "Удалить…", "Remove␟删除": "Удалить", "Remove␟取消排队": "Удалить", - "Remove␟移除": "Удалить", + "Remove␟移除": "Убрать", "Removing": "Удаление", "Removing the old model": "Удаление старой модели", "Removing the old model after the current video": "Старая модель будет удалена после текущего видео", @@ -4391,6 +4399,7 @@ "Restore original": "Восстановить оригинал", "Restored the original image.": "Исходное изображение восстановлено.", "Restored the original image. Edit it again to reapply the changes.": "Исходное изображение восстановлено. Отредактируйте его снова, чтобы повторно применить изменения.", + "Restored your changes up to {time}. Later changes could not be kept on this computer and were lost.": "Изменения восстановлены: последнее сохранение — {time}. Более поздние изменения не удалось сохранить на этом компьютере, они потеряны.", "Restored, but {lost} could not be brought back.": "Восстановлено, но не удалось вернуть: {lost}.", "Restored.": "Восстановлено.", "Restore␟恢复": "Восстановить", @@ -4904,6 +4913,7 @@ "Sketch mannequin": "Манекен для эскиза", "Sketch␟画草图": "Эскиз", "Sketch␟草图": "Эскиз", + "Skip this folder and download": "Пропустить эту папку и скачать", "Skipped": "Пропущено", "Skipped 1 unsupported file": "Пропущен 1 неподдерживаемый файл", "Skipped 1 unsupported file ({types})": "Пропущен 1 неподдерживаемый файл ({types})", @@ -4921,7 +4931,8 @@ "Small file": "Маленький файл", "Smaller than the {vsize} video; the result will look softer.": "Меньше видео {vsize}; результат будет менее четким.", "Smaller tiles, more at once": "Более мелкие миниатюры, больше на экране", - "Smart App Control in Windows blocked these files. Search Windows for \"Smart App Control\", or open Windows Security → App & browser control → Smart App Control settings.": "Интеллектуальное управление приложениями в Windows заблокировало эти файлы. Найдите в Windows «Интеллектуальное управление приложениями» или откройте «Безопасность Windows» → «Управление приложениями/браузером» → «Параметры интеллектуального управления приложениями».", + "Smart App Control cannot make an exception for one program. FreeVideo can run only if it is turned off: search Windows for \"Smart App Control\" and open its settings.": "Для интеллектуального управления приложениями нельзя задать исключение для одной программы. FreeVideo сможет работать, только если отключить эту функцию: найдите в поиске Windows «Интеллектуальное управление приложениями» и откройте его параметры.", + "Smart App Control in Windows blocked files that FreeVideo needs, so FreeVideo cannot run on this computer.": "Интеллектуальное управление приложениями в Windows заблокировало файлы, необходимые FreeVideo, поэтому FreeVideo не может работать на этом компьютере.", "Smart App Control in Windows stopped it": "интеллектуальное управление приложениями в Windows заблокировало запись", "Smart App Control in Windows stopped setup from writing a file.": "Интеллектуальное управление приложениями в Windows не позволило записать файл во время установки.", "Smart App Control in Windows stopped the downloaded launcher. This version of FreeVideo keeps working.": "Интеллектуальное управление приложениями в Windows заблокировало скачанную программу запуска. Текущая версия FreeVideo продолжает работать.", @@ -5769,6 +5780,7 @@ "There is not enough free graphics or system memory for this image": "Недостаточно свободной видеопамяти или оперативной памяти для создания этого изображения", "There is not enough free memory to continue installing": "Недостаточно свободной памяти для продолжения установки", "There must be a clip under the playhead. A part that is still being generated can be saved once it is done.": "Под курсором воспроизведения должен быть клип. Кадр из фрагмента, который еще создается, можно сохранить после завершения.", + "These changes have not been saved and are only in this page. Keep the page open until they are saved; closing it now would lose them.": "Эти изменения еще не сохранены и есть только на этой странице. Не закрывайте страницу, пока они не сохранятся; если закрыть ее сейчас, они будут потеряны.", "These creations cannot be downloaded.": "Эти работы невозможно скачать.", "These creations cannot be read.": "Эти работы невозможно прочитать.", "These files are downloaded or reused. Closing Settings does not stop the installation.": "Эти файлы будут скачаны или использованы повторно. Закрытие настроек не останавливает установку.", @@ -5891,6 +5903,7 @@ "This node is disabled or no longer in the workflow.": "Этот узел отключен или больше не входит в рабочий процесс.", "This page": "Эта страница", "This page was opened on port {opened}, but FreeVideo runs on port {port}. The two must match: open {address}. If you reach FreeVideo through port forwarding or a tunnel, use {port} as the local port as well. Then retry.": "Эта страница открыта через порт {opened}, но FreeVideo работает на порту {port}. Номера портов должны совпадать: откройте {address}. Если вы подключаетесь к FreeVideo через переадресацию портов или туннель, укажите {port} и в качестве локального порта. Затем повторите попытку.", + "This page's connection to FreeVideo has expired, so the change was not saved. Reload the page and repeat the action.": "Срок действия соединения этой страницы с FreeVideo истек, поэтому изменение не сохранено. Перезагрузите страницу и повторите действие.", "This part changed during dubbing, so the new voice was not placed. Redub it.": "Фрагмент изменился во время переозвучивания, поэтому новый голос не был добавлен. Переозвучьте его еще раз.", "This part could not be generated. Continue from this part; if it fails again, send a report.": "Не удалось создать этот фрагмент. Продолжите с этого фрагмента; если ошибка повторится, отправьте отчет.", "This part has no audio": "У этого фрагмента нет звука", @@ -5950,7 +5963,6 @@ "This workflow uses nodes that FreeVideo cannot read. Open it in Nodes.": "В этом рабочем процессе есть узлы, которые FreeVideo не может прочитать. Откройте его в представлении узлов.", "Three steps around Create or Edit": "Три шага по разделам «Создание» и «Монтаж»", "Three steps around the screen": "Знакомство с экраном за три шага", - "Three-quarter": "Три четверти", "Thumbnails and durations could not be loaded. Try again; if it still fails, choose \"Report a problem\".": "Не удалось загрузить миниатюры и длительность работ. Повторите попытку; если ошибка сохраняется, выберите «Сообщить о проблеме».", "Thumbnails only, a larger picture": "Только миниатюры, изображение крупнее", "Tick \"I accept the installation plan and model / toolkit licenses.\" and choose \"Confirm & continue\".": "Установите флажок «Я принимаю план установки и лицензии на модели и наборы инструментов.» и выберите «Подтвердить и продолжить».", @@ -5992,6 +6004,8 @@ "Tolerance": "Допуск", "Too many attempts. Try again in {count} s.": "Слишком много попыток. Повторите через {count} с.", "Too many attempts. Try again in {minutes} min.": "Слишком много попыток. Повторите через {minutes} мин.", + "Too many creations for one download. Download them in smaller groups.": "Слишком много работ, чтобы скачать их за один раз. Скачайте их по частям.", + "Too many files to check in a model folder": "Слишком много файлов для проверки в папке моделей", "Took": "Время", "Took too long. Try again.": "Превышено время ожидания. Повторите попытку.", "Tools that do not fit in the bar": "Инструменты, не поместившиеся на панели", @@ -6067,6 +6081,7 @@ "Turn this part upside down": "Отразить фрагмент сверху вниз", "Turn this preview into the final video": "Сделать из этого просмотра итоговое видео", "Turn this preview part into the full-resolution video, in place": "Превратить этот фрагмент предварительного просмотра в видео полного разрешения на том же месте", + "Turning it off lowers Windows' protection against unknown programs. On some versions of Windows, it can be turned on again only by resetting Windows.": "Отключение ослабляет защиту Windows от неизвестных программ. В некоторых версиях Windows снова включить эту функцию можно только после сброса Windows.", "Tutorial": "Уроки", "Tutorials": "Уроки", "Two friends sit by a café window at dusk. She says: \"You came back.\" He smiles: \"I promised.\" Warm light, quiet street sounds.": "Двое друзей сидят у окна кафе в сумерках. Она говорит: «Ты вернулся». Он улыбается: «Я обещал». Теплый свет, тихие звуки улицы.", @@ -6411,6 +6426,7 @@ "When it shows \"Assistant connected\" or the assistant's name, describe the video under \"Tell the assistant…\", for example \"Make a 1-minute vertical short film: a day in a coffee shop\".": "Когда отображается «Помощник подключен» или имя помощника, опишите видео в поле «Сообщите помощнику…», например «Снимите вертикальный короткометражный фильм на 1 минуту: один день в кофейне».", "When model files are incomplete or changed, import the same offline packages again in the launcher; only the files with problems are completed or replaced.": "Если файлы моделей неполны или изменены, снова импортируйте те же автономные пакеты в программе запуска; будут дополнены или заменены только проблемные файлы.", "When off, nothing takes VRAM before a generation; models already used stay loaded for the next one.": "Если выключено, до генерации видеопамять не занимается; уже использованные модели остаются загруженными для следующей генерации.", + "When off, nothing takes unified memory before a generation; models already used stay loaded for the next one.": "Если выключено, перед генерацией ничто не занимает единую память; уже использованные модели остаются загруженными для следующей.", "When on, other devices on the same network can open FreeVideo with the link below and enter the password the first time.": "Если включено, другие устройства в той же сети могут открыть FreeVideo по ссылке ниже, введя пароль при первом открытии.", "When on, other devices on the same network can open FreeVideo with the link below. Anyone with the link can use it, so keep it private.": "Если включено, другие устройства в той же сети могут открыть FreeVideo по ссылке ниже. Любой, у кого есть ссылка, может пользоваться им, поэтому не передавайте ее посторонним.", "When something goes wrong": "Если что-то пошло не так", @@ -6738,6 +6754,7 @@ "video model": "модель видео", "wide shot": "общий план", "with prompt": "с запросом", + "yesterday at {time}": "вчера в {time}", "your Python mirror": "ваше зеркало Python", "your configured source": "настроенный вами источник", "zoom in": "приближение", @@ -6786,6 +6803,7 @@ "{count} tasks, {active} under way": "Задач: {count}, выполняется: {active}", "{count} videos from this task": "Видео из этой задачи: {count}", "{count} voiceovers": "озвучивания ({count})", + "{date} at {time}": "{date} в {time}", "{done} / {total} files": "Файлы: {done} / {total}", "{done} / {total} frames": "Кадры: {done} / {total}", "{done} / {total} layers": "Слои: {done} / {total}", diff --git a/web/locales/tr.json b/web/locales/tr.json index da92e380..5ed5ed45 100644 --- a/web/locales/tr.json +++ b/web/locales/tr.json @@ -91,6 +91,10 @@ "\"Use as is\" is not available here.": "“Olduğu gibi kullan” burada kullanılamıyor.", "\"Use as is\" is not available on this computer yet.": "“Olduğu gibi kullan” henüz bu bilgisayarda kullanılamıyor.", "\"Use as is\" is not available while extending a video. Remove \"Extends this video\" first.": "Bir video uzatılırken “Olduğu gibi kullan” kullanılamaz. Önce “Bu videoyu uzatır” öğesini kaldırın.", + "\"{folder}\" holds too many files that could be models for FreeVideo to check one by one. Move the files that are not models out of this folder, then try again.": "“{folder}” içinde model olabilecek çok fazla dosya var; FreeVideo bunları tek tek denetleyemez. Model olmayan dosyaları bu klasörün dışına taşıyın, sonra yeniden deneyin.", + "\"{folder}\" holds too many files that could be models for FreeVideo to check one by one. Offline packages cannot download the models instead, so remove this folder from \"Reuse models\" on the Models page.": "“{folder}” içinde model olabilecek çok fazla dosya var; FreeVideo bunları tek tek denetleyemez. Çevrimdışı paketlerle modeller bunun yerine indirilemez, bu yüzden bu klasörü Modeller sayfasında “Modelleri yeniden kullan” bölümünden kaldırın.", + "\"{folder}\" holds too many files that could be models for FreeVideo to check one by one. Skip this folder and download the models instead, or remove it from \"Reuse models\" on the Models page.": "“{folder}” içinde model olabilecek çok fazla dosya var; FreeVideo bunları tek tek denetleyemez. Bu klasörü atlayın ve modelleri indirin ya da Modeller sayfasında “Modelleri yeniden kullan” bölümünden kaldırın.", + "\"{folder}\" holds too many files that could be models for FreeVideo to check one by one. Skip this folder and download the models instead.": "“{folder}” içinde model olabilecek çok fazla dosya var; FreeVideo bunları tek tek denetleyemez. Bu klasörü atlayın ve modelleri indirin.", "\"{media}\" could not be found. Upload or select it again, then generate.": "“{media}” bulunamadı. Yeniden yükleyin veya seçin, ardından üretin.", "\"{name}\" can't hold FreeVideo. Choose another disk.": "“{name}” FreeVideo’yu barındıramaz. Başka bir disk seçin.", "\"{name}\" can't store files over 4 GB. Choose another disk.": "“{name}” 4 GB’tan büyük dosyaları saklayamaz. Başka bir disk seçin.", @@ -573,6 +577,7 @@ "Attached images": "Eklenen görseller", "Audio 1": "Ses 1", "Audio 2": "Ses 2", + "Audio 2 cannot be removed while the Dialogue, Music and Ambience tracks still have parts. Delete those parts first.": "“Vokal”, “Müzik” ve “Ortam sesi” izlerinde hâlâ klipler varken “Ses 2” kaldırılamaz. Önce bu klipleri silin.", "Audio and video cache": "Ses ve video önbelleği", "Audio length: {seconds} s; uses up to the first 15 s within the video length.": "Ses uzunluğu: {seconds} sn; video süresini aşmadan en fazla ilk 15 sn kullanılır.", "Audio longer than 30 seconds used as is is made in parts, which needs \"Faster second pass\". Turn it on or set the audio to \"Reference\".": "Olduğu gibi kullanılan 30 saniyeden uzun ses bölümler halinde üretilir ve bunun için “Hızlı ikinci geçiş” gerekir. Bu seçeneği açın veya sesi “Referans” olarak ayarlayın.", @@ -2266,6 +2271,7 @@ "FreeVideo asks before deleting a video, and a video used in an edit cannot be deleted.": "FreeVideo bir videoyu silmeden önce sorar; bir kurguda kullanılan video silinemez.", "FreeVideo cannot read its own files": "FreeVideo kendi dosyalarını okuyamıyor", "FreeVideo cannot run from this disk": "FreeVideo bu diskten çalışamaz", + "FreeVideo cannot use \"{name}\": this file type is not supported. Use a PNG, JPEG or WebP image, an MP4, MOV or WebM video, or WAV or MP3 audio.": "FreeVideo “{name}” dosyasını kullanamıyor: Bu dosya türü desteklenmiyor. PNG, JPEG veya WebP görsel, MP4, MOV veya WebM video ya da WAV veya MP3 ses dosyası kullanın.", "FreeVideo closed unexpectedly while generating.": "FreeVideo üretim sırasında beklenmedik şekilde kapandı.", "FreeVideo could not be opened from the menu": "FreeVideo menüden açılamadı", "FreeVideo could not reach the network.": "FreeVideo ağa ulaşamadı.", @@ -3132,6 +3138,7 @@ "Making music": "Müzik hazırlanıyor", "Making the video": "Video oluşturma", "Male": "Erkek", + "Manage model folders": "Model klasörlerini yönet", "Mannequin": "Manken", "Mark all as read": "Tümünü okundu olarak işaretle", "Mark as read": "Okundu olarak işaretle", @@ -3421,6 +3428,7 @@ "Not deleted: saved edits could not be checked. Try again in a moment.": "Silinmedi: kaydedilmiş kurgular denetlenemedi. Biraz sonra yeniden deneyin.", "Not deleted: the folder also holds files FreeVideo did not write: ": "Silinmedi: klasörde FreeVideo tarafından yazılmamış dosyalar da var: ", "Not deleted: these edits use it: ": "Silinmedi: şu kurgular bunu kullanıyor: ", + "Not detected": "Algılanmadı", "Not enabled. Your prompt is unchanged.": "Etkinleştirilmedi. İsteminiz değiştirilmedi.", "Not enough GPU memory": "Yeterli GPU belleği yok", "Not enough GPU memory for depth": "Derinlik için yeterli GPU belleği yok", @@ -4383,6 +4391,7 @@ "Restore original": "Orijinali geri yükle", "Restored the original image.": "Orijinal görsel geri yüklendi.", "Restored the original image. Edit it again to reapply the changes.": "Orijinal görsel geri yüklendi. Değişiklikleri yeniden uygulamak için görseli tekrar düzenleyin.", + "Restored your changes up to {time}. Later changes could not be kept on this computer and were lost.": "Değişiklikleriniz {time} itibarıyla geri yüklendi. Sonraki değişiklikler bu bilgisayarda tutulamadı ve kayboldu.", "Restored, but {lost} could not be brought back.": "Geri yüklendi, ancak {lost} öğe geri getirilemedi.", "Restored.": "Geri yüklendi.", "Restore␟恢复": "Geri yükle", @@ -4896,6 +4905,7 @@ "Sketch mannequin": "Eskiz mankeni", "Sketch␟画草图": "Eskiz çiz", "Sketch␟草图": "Eskiz", + "Skip this folder and download": "Bu klasörü atla ve indir", "Skipped": "Atlandı", "Skipped 1 unsupported file": "Desteklenmeyen 1 dosya atlandı", "Skipped 1 unsupported file ({types})": "Desteklenmeyen 1 dosya atlandı ({types})", @@ -4913,7 +4923,8 @@ "Small file": "Küçük dosya", "Smaller than the {vsize} video; the result will look softer.": "{vsize} boyutundaki videodan daha küçük; sonuç daha az keskin görünür.", "Smaller tiles, more at once": "Daha küçük kutucuklar, aynı anda daha fazlası", - "Smart App Control in Windows blocked these files. Search Windows for \"Smart App Control\", or open Windows Security → App & browser control → Smart App Control settings.": "Windows’daki Akıllı Uygulama Denetimi bu dosyaları engelledi. Windows’da “Akıllı Uygulama Denetimi” araması yapın veya Windows Güvenliği → Uygulama ve tarayıcı denetimi → Akıllı Uygulama Denetimi ayarları yolunu açın.", + "Smart App Control cannot make an exception for one program. FreeVideo can run only if it is turned off: search Windows for \"Smart App Control\" and open its settings.": "Akıllı Uygulama Denetimi tek bir program için özel durum tanımlayamaz. FreeVideo yalnızca bu özellik kapatılırsa çalışabilir: Windows’ta “Akıllı Uygulama Denetimi” araması yapın ve ayarlarını açın.", + "Smart App Control in Windows blocked files that FreeVideo needs, so FreeVideo cannot run on this computer.": "Windows’taki Akıllı Uygulama Denetimi, FreeVideo’nun ihtiyaç duyduğu dosyaları engelledi; bu nedenle FreeVideo bu bilgisayarda çalışamaz.", "Smart App Control in Windows stopped it": "Windows’daki Akıllı Uygulama Denetimi bunu engelledi", "Smart App Control in Windows stopped setup from writing a file.": "Windows’daki Akıllı Uygulama Denetimi, kurulumun bir dosya yazmasını engelledi.", "Smart App Control in Windows stopped the downloaded launcher. This version of FreeVideo keeps working.": "Windows’daki Akıllı Uygulama Denetimi indirilen başlatıcıyı durdurdu. FreeVideo’nun bu sürümü çalışmaya devam ediyor.", @@ -5761,6 +5772,7 @@ "There is not enough free graphics or system memory for this image": "Bu görsel için yeterli boş ekran kartı belleği veya sistem belleği yok", "There is not enough free memory to continue installing": "Kuruluma devam etmek için yeterli boş bellek yok", "There must be a clip under the playhead. A part that is still being generated can be saved once it is done.": "Oynatma kafasının altında bir klip olmalıdır. Hâlâ üretilmekte olan bir bölümün karesi, üretim tamamlandığında kaydedilebilir.", + "These changes have not been saved and are only in this page. Keep the page open until they are saved; closing it now would lose them.": "Bu değişiklikler henüz kaydedilmedi ve yalnızca bu sayfada duruyor. Kaydedilene kadar sayfayı açık tutun; şimdi kapatırsanız kaybolur.", "These creations cannot be downloaded.": "Bu eserler indirilemiyor.", "These creations cannot be read.": "Bu eserler okunamıyor.", "These files are downloaded or reused. Closing Settings does not stop the installation.": "Bu dosyalar indirilir veya yeniden kullanılır. Ayarları kapatmak kurulumu durdurmaz.", @@ -5883,6 +5895,7 @@ "This node is disabled or no longer in the workflow.": "Bu düğüm devre dışı veya artık iş akışında değil.", "This page": "Bu sayfa", "This page was opened on port {opened}, but FreeVideo runs on port {port}. The two must match: open {address}. If you reach FreeVideo through port forwarding or a tunnel, use {port} as the local port as well. Then retry.": "Bu sayfa {opened} numaralı bağlantı noktasından açıldı, ancak FreeVideo {port} numaralı bağlantı noktasında çalışıyor. İkisinin aynı olması gerekir: {address} adresini açın. FreeVideo’ya bağlantı noktası yönlendirme veya tünel üzerinden erişiyorsanız yerel bağlantı noktasını da {port} olarak ayarlayın. Ardından yeniden deneyin.", + "This page's connection to FreeVideo has expired, so the change was not saved. Reload the page and repeat the action.": "Bu sayfanın FreeVideo ile bağlantısının süresi dolduğu için değişiklik kaydedilmedi. Sayfayı yeniden yükleyip işlemi tekrarlayın.", "This part changed during dubbing, so the new voice was not placed. Redub it.": "Bu bölüm yeniden seslendirme sırasında değiştiği için yeni ses yerleştirilmedi. Yeniden seslendirin.", "This part could not be generated. Continue from this part; if it fails again, send a report.": "Bu bölüm üretilemedi. Bu bölümden devam edin; yine başarısız olursa rapor gönderin.", "This part has no audio": "Bu bölümde ses yok", @@ -5942,7 +5955,6 @@ "This workflow uses nodes that FreeVideo cannot read. Open it in Nodes.": "Bu iş akışı, FreeVideo’nun okuyamadığı düğümler kullanıyor. İş akışını düğüm görünümünde açın.", "Three steps around Create or Edit": "Oluştur veya Kurgu çevresinde üç adım", "Three steps around the screen": "Ekran çevresinde üç adım", - "Three-quarter": "Üç çeyrek", "Thumbnails and durations could not be loaded. Try again; if it still fails, choose \"Report a problem\".": "Eserlerin küçük resimleri ve süreleri yüklenemedi. Yeniden deneyin; sorun sürerse “Sorun bildir” seçeneğini seçin.", "Thumbnails only, a larger picture": "Yalnızca küçük resimler, daha büyük görüntü", "Tick \"I accept the installation plan and model / toolkit licenses.\" and choose \"Confirm & continue\".": "“Kurulum planını ve model / araç seti lisanslarını kabul ediyorum.” kutusunu işaretleyin ve “Onayla ve devam et” seçeneğini seçin.", @@ -5984,6 +5996,8 @@ "Tolerance": "Tolerans", "Too many attempts. Try again in {count} s.": "Çok fazla deneme yapıldı. {count} sn sonra yeniden deneyin.", "Too many attempts. Try again in {minutes} min.": "Çok fazla deneme yapıldı. {minutes} dk sonra yeniden deneyin.", + "Too many creations for one download. Download them in smaller groups.": "Tek bir indirme için çok fazla eser var. Bunları daha küçük gruplar hâlinde indirin.", + "Too many files to check in a model folder": "Bir model klasöründe denetlenecek çok fazla dosya var", "Took": "Geçen süre", "Took too long. Try again.": "İşlem çok uzun sürdü. Yeniden deneyin.", "Tools that do not fit in the bar": "Çubuğa sığmayan araçlar", @@ -6059,6 +6073,7 @@ "Turn this part upside down": "Bu bölümü baş aşağı çevirin", "Turn this preview into the final video": "Bu önizlemeyi son videoya dönüştürün", "Turn this preview part into the full-resolution video, in place": "Bu önizleme bölümünü yerinde tam çözünürlüklü videoya dönüştürün", + "Turning it off lowers Windows' protection against unknown programs. On some versions of Windows, it can be turned on again only by resetting Windows.": "Kapatmak, Windows’un bilinmeyen programlara karşı korumasını azaltır. Bazı Windows sürümlerinde yalnızca Windows sıfırlanarak yeniden açılabilir.", "Tutorial": "Eğitim", "Tutorials": "Eğitimler", "Two friends sit by a café window at dusk. She says: \"You came back.\" He smiles: \"I promised.\" Warm light, quiet street sounds.": "Alacakaranlıkta iki arkadaş bir kafenin penceresinin yanında oturuyor. Kadın diyor ki: “Geri döndün.” Adam gülümsüyor: “Söz vermiştim.” Sıcak ışık, sakin sokak sesleri.", @@ -6403,6 +6418,7 @@ "When it shows \"Assistant connected\" or the assistant's name, describe the video under \"Tell the assistant…\", for example \"Make a 1-minute vertical short film: a day in a coffee shop\".": "“Asistan bağlandı” veya asistanın adı göründüğünde videoyu “Asistana söyleyin…” alanında tanımlayın; örneğin “1 dakikalık dikey bir kısa film yap: bir kafede bir gün”.", "When model files are incomplete or changed, import the same offline packages again in the launcher; only the files with problems are completed or replaced.": "Model dosyaları eksik veya değiştirilmişse aynı çevrimdışı paketleri başlatıcıda yeniden içe aktarın; yalnızca sorunlu dosyalar tamamlanır veya değiştirilir.", "When off, nothing takes VRAM before a generation; models already used stay loaded for the next one.": "Kapalıyken üretimden önce VRAM kullanılmaz; daha önce kullanılan modeller bir sonraki üretim için yüklü kalır.", + "When off, nothing takes unified memory before a generation; models already used stay loaded for the next one.": "Kapalıyken üretimden önce hiçbir şey birleşik bellek ayırmaz; daha önce kullanılan modeller bir sonraki üretim için yüklü kalır.", "When on, other devices on the same network can open FreeVideo with the link below and enter the password the first time.": "Açık olduğunda aynı ağdaki diğer cihazlar FreeVideo’yu aşağıdaki bağlantıyla açabilir ve ilk seferde parolayı girer.", "When on, other devices on the same network can open FreeVideo with the link below. Anyone with the link can use it, so keep it private.": "Açık olduğunda aynı ağdaki diğer cihazlar FreeVideo’yu aşağıdaki bağlantıyla açabilir. Bağlantıya sahip olan herkes FreeVideo’yu kullanabilir; bu nedenle bağlantıyı gizli tutun.", "When something goes wrong": "Sorun çıktığında", @@ -6730,6 +6746,7 @@ "video model": "video modeli", "wide shot": "geniş çekim", "with prompt": "istem dahil", + "yesterday at {time}": "dün {time}", "your Python mirror": "Python yansınız", "your configured source": "yapılandırdığınız kaynak", "zoom in": "yakınlaştırma", @@ -6778,6 +6795,7 @@ "{count} tasks, {active} under way": "{count} görev, {active} tanesi sürüyor", "{count} videos from this task": "Bu görevden {count} video", "{count} voiceovers": "{count} seslendirme", + "{date} at {time}": "{date} {time}", "{done} / {total} files": "{done} / {total} dosya", "{done} / {total} frames": "{done} / {total} kare", "{done} / {total} layers": "{done} / {total} katman", diff --git a/web/locales/uk.json b/web/locales/uk.json index 14085014..68534eec 100644 --- a/web/locales/uk.json +++ b/web/locales/uk.json @@ -120,6 +120,10 @@ "\"Use as is\" is not available here.": "Варіант «Як є» тут недоступний.", "\"Use as is\" is not available on this computer yet.": "Варіант «Як є» на цьому комп’ютері поки недоступний.", "\"Use as is\" is not available while extending a video. Remove \"Extends this video\" first.": "Варіант «Як є» недоступний під час подовження відео. Спочатку вилучіть «Подовжує це відео».", + "\"{folder}\" holds too many files that could be models for FreeVideo to check one by one. Move the files that are not models out of this folder, then try again.": "У папці «{folder}» забагато файлів, які можуть бути моделями: FreeVideo не може перевірити їх по одному. Перемістіть із цієї папки файли, що не є моделями, і спробуйте ще раз.", + "\"{folder}\" holds too many files that could be models for FreeVideo to check one by one. Offline packages cannot download the models instead, so remove this folder from \"Reuse models\" on the Models page.": "У папці «{folder}» забагато файлів, які можуть бути моделями: FreeVideo не може перевірити їх по одному. З офлайн-пакетами завантажити моделі замість цього не можна, тож вилучіть цю папку з розділу «Повторне використання моделей» на сторінці «Моделі».", + "\"{folder}\" holds too many files that could be models for FreeVideo to check one by one. Skip this folder and download the models instead, or remove it from \"Reuse models\" on the Models page.": "У папці «{folder}» забагато файлів, які можуть бути моделями: FreeVideo не може перевірити їх по одному. Пропустіть цю папку й завантажте моделі або вилучіть її з розділу «Повторне використання моделей» на сторінці «Моделі».", + "\"{folder}\" holds too many files that could be models for FreeVideo to check one by one. Skip this folder and download the models instead.": "У папці «{folder}» забагато файлів, які можуть бути моделями: FreeVideo не може перевірити їх по одному. Пропустіть цю папку й завантажте моделі.", "\"{media}\" could not be found. Upload or select it again, then generate.": "Медіафайл «{media}» не знайдено. Вивантажте або виберіть його знову, потім згенеруйте.", "\"{name}\" can't hold FreeVideo. Choose another disk.": "На диск «{name}» неможливо встановити FreeVideo. Виберіть інший диск.", "\"{name}\" can't store files over 4 GB. Choose another disk.": "Диск «{name}» не може зберігати файли понад 4 GB. Виберіть інший диск.", @@ -602,6 +606,7 @@ "Attached images": "Додані зображення", "Audio 1": "Звук 1", "Audio 2": "Звук 2", + "Audio 2 cannot be removed while the Dialogue, Music and Ambience tracks still have parts. Delete those parts first.": "«Звук 2» не можна вилучити, поки на доріжках «Голос», «Музика» і «Фонові звуки» є кліпи. Спершу видаліть ці кліпи.", "Audio and video cache": "Кеш аудіо та відео", "Audio length: {seconds} s; uses up to the first 15 s within the video length.": "Тривалість аудіо: {seconds} с; використовується щонайбільше перші 15 с у межах тривалості відео.", "Audio longer than 30 seconds used as is is made in parts, which needs \"Faster second pass\". Turn it on or set the audio to \"Reference\".": "Аудіо довше за 30 секунд у варіанті «Як є» створюється фрагментами, для чого потрібен «Прискорений другий прохід». Увімкніть його або виберіть для аудіо варіант «Зразок».", @@ -2295,6 +2300,7 @@ "FreeVideo asks before deleting a video, and a video used in an edit cannot be deleted.": "Перед видаленням відео FreeVideo запитує підтвердження, а відео, використане в монтажі, видалити не можна.", "FreeVideo cannot read its own files": "FreeVideo не може прочитати власні файли", "FreeVideo cannot run from this disk": "FreeVideo не може працювати з цього диска", + "FreeVideo cannot use \"{name}\": this file type is not supported. Use a PNG, JPEG or WebP image, an MP4, MOV or WebM video, or WAV or MP3 audio.": "FreeVideo не може використати «{name}»: цей тип файлів не підтримується. Використайте зображення PNG, JPEG або WebP, відео MP4, MOV або WebM чи аудіо WAV або MP3.", "FreeVideo closed unexpectedly while generating.": "FreeVideo несподівано закрився під час генерації.", "FreeVideo could not be opened from the menu": "Не вдалося відкрити FreeVideo з меню", "FreeVideo could not reach the network.": "FreeVideo не вдалося підключитися до мережі.", @@ -3161,6 +3167,7 @@ "Making music": "Створення музики", "Making the video": "Створення відео", "Male": "Чоловік", + "Manage model folders": "Керувати папками моделей", "Mannequin": "Манекен", "Mark all as read": "Позначити все як прочитане", "Mark as read": "Позначити як прочитане", @@ -3450,6 +3457,7 @@ "Not deleted: saved edits could not be checked. Try again in a moment.": "Не видалено: не вдалося перевірити збережені проєкти монтажу. Спробуйте ще раз трохи згодом.", "Not deleted: the folder also holds files FreeVideo did not write: ": "Не видалено: у папці також є файли, які створено не FreeVideo: ", "Not deleted: these edits use it: ": "Не видалено: її використовують такі проєкти монтажу: ", + "Not detected": "Не визначено", "Not enabled. Your prompt is unchanged.": "Не ввімкнено. Ваш запит не змінено.", "Not enough GPU memory": "Недостатньо відеопам’яті", "Not enough GPU memory for depth": "Недостатньо відеопам’яті для глибини", @@ -4412,6 +4420,7 @@ "Restore original": "Відновити оригінал", "Restored the original image.": "Оригінальне зображення відновлено.", "Restored the original image. Edit it again to reapply the changes.": "Оригінальне зображення відновлено. Відредагуйте його знову, щоб повторно застосувати зміни.", + "Restored your changes up to {time}. Later changes could not be kept on this computer and were lost.": "Зміни відновлено: останнє збереження — {time}. Пізніші зміни не вдалося зберегти на цьому комп’ютері, їх втрачено.", "Restored, but {lost} could not be brought back.": "Відновлено, але не вдалося повернути: {lost}.", "Restored.": "Відновлено.", "Restore␟恢复": "Відновити", @@ -4925,6 +4934,7 @@ "Sketch mannequin": "Манекен для ескізу", "Sketch␟画草图": "Ескіз", "Sketch␟草图": "Ескіз", + "Skip this folder and download": "Пропустити цю папку й завантажити", "Skipped": "Пропущено", "Skipped 1 unsupported file": "Пропущено 1 непідтримуваний файл", "Skipped 1 unsupported file ({types})": "Пропущено 1 непідтримуваний файл ({types})", @@ -4942,7 +4952,8 @@ "Small file": "Малий файл", "Smaller than the {vsize} video; the result will look softer.": "Менше за відео {vsize}; результат буде менш чітким.", "Smaller tiles, more at once": "Менші мініатюри, більше на екрані", - "Smart App Control in Windows blocked these files. Search Windows for \"Smart App Control\", or open Windows Security → App & browser control → Smart App Control settings.": "Функція «Інтелектуальне керування програмами» (Smart App Control) у Windows заблокувала ці файли. Знайдіть «Інтелектуальне керування програмами» в пошуку Windows або відкрийте «Безпека Windows» → «Керування програмами та браузером» → «Параметри інтелектуального керування програмами».", + "Smart App Control cannot make an exception for one program. FreeVideo can run only if it is turned off: search Windows for \"Smart App Control\" and open its settings.": "Для інтелектуального керування програмами не можна задати виняток для однієї програми. FreeVideo зможе працювати, лише якщо вимкнути цю функцію: знайдіть у пошуку Windows «Інтелектуальне керування програмами» й відкрийте його параметри.", + "Smart App Control in Windows blocked files that FreeVideo needs, so FreeVideo cannot run on this computer.": "Інтелектуальне керування програмами в Windows заблокувало файли, потрібні FreeVideo, тому FreeVideo не може працювати на цьому комп’ютері.", "Smart App Control in Windows stopped it": "функція «Інтелектуальне керування програмами» (Smart App Control) у Windows заблокувала запис", "Smart App Control in Windows stopped setup from writing a file.": "Функція «Інтелектуальне керування програмами» (Smart App Control) у Windows не дала записати файл під час встановлення.", "Smart App Control in Windows stopped the downloaded launcher. This version of FreeVideo keeps working.": "Функція «Інтелектуальне керування програмами» (Smart App Control) у Windows заблокувала завантажену програму запуску. Ця версія FreeVideo і далі працює.", @@ -5790,6 +5801,7 @@ "There is not enough free graphics or system memory for this image": "Недостатньо вільної відеопам’яті або оперативної пам’яті для цього зображення", "There is not enough free memory to continue installing": "Недостатньо вільної пам’яті, щоб продовжити встановлення", "There must be a clip under the playhead. A part that is still being generated can be saved once it is done.": "Під курсором відтворення має бути кліп. Фрагмент, який ще генерується, можна зберегти після завершення.", + "These changes have not been saved and are only in this page. Keep the page open until they are saved; closing it now would lose them.": "Ці зміни ще не збережено, вони є лише на цій сторінці. Не закривайте сторінку, доки їх не буде збережено; якщо закрити її зараз, вони втратяться.", "These creations cannot be downloaded.": "Ці роботи не можна завантажити.", "These creations cannot be read.": "Не вдається прочитати ці роботи.", "These files are downloaded or reused. Closing Settings does not stop the installation.": "Ці файли буде завантажено або використано повторно. Закриття налаштувань не зупиняє встановлення.", @@ -5912,6 +5924,7 @@ "This node is disabled or no longer in the workflow.": "Цей вузол вимкнено або його більше немає в робочому процесі.", "This page": "Ця сторінка", "This page was opened on port {opened}, but FreeVideo runs on port {port}. The two must match: open {address}. If you reach FreeVideo through port forwarding or a tunnel, use {port} as the local port as well. Then retry.": "Цю сторінку відкрито через порт {opened}, але FreeVideo працює на порту {port}. Порти мають збігатися: відкрийте {address}. Якщо ви підключаєтеся до FreeVideo через переадресацію портів або тунель, також укажіть {port} як локальний порт. Потім повторіть спробу.", + "This page's connection to FreeVideo has expired, so the change was not saved. Reload the page and repeat the action.": "Термін дії з’єднання цієї сторінки з FreeVideo минув, тому зміну не збережено. Перезавантажте сторінку й повторіть дію.", "This part changed during dubbing, so the new voice was not placed. Redub it.": "Цей фрагмент змінився під час переозвучення, тому новий голос не розміщено. Переозвучте його знову.", "This part could not be generated. Continue from this part; if it fails again, send a report.": "Не вдалося згенерувати цей фрагмент. Продовжте з цього фрагмента; якщо знову не вдасться, надішліть звіт.", "This part has no audio": "Цей фрагмент не має звуку", @@ -5971,7 +5984,6 @@ "This workflow uses nodes that FreeVideo cannot read. Open it in Nodes.": "У цьому робочому процесі є вузли, які FreeVideo не може прочитати. Відкрийте його в поданні вузлів.", "Three steps around Create or Edit": "Три кроки в розділі «Створення» або «Монтаж»", "Three steps around the screen": "Знайомство з інтерфейсом у три кроки", - "Three-quarter": "Три чверті", "Thumbnails and durations could not be loaded. Try again; if it still fails, choose \"Report a problem\".": "Не вдалося завантажити мініатюри й тривалість. Повторіть спробу; якщо помилка не зникає, виберіть «Повідомити про проблему».", "Thumbnails only, a larger picture": "Лише мініатюри, більше зображення", "Tick \"I accept the installation plan and model / toolkit licenses.\" and choose \"Confirm & continue\".": "Позначте «Я приймаю план встановлення та ліцензії на моделі й набори інструментів.» і виберіть «Підтвердити й продовжити».", @@ -6013,6 +6025,8 @@ "Tolerance": "Допуск", "Too many attempts. Try again in {count} s.": "Забагато спроб. Повторіть через {count} с.", "Too many attempts. Try again in {minutes} min.": "Забагато спроб. Повторіть через {minutes} хв.", + "Too many creations for one download. Download them in smaller groups.": "Забагато робіт для одного завантаження. Завантажте їх частинами.", + "Too many files to check in a model folder": "Забагато файлів для перевірки в папці моделей", "Took": "Час", "Took too long. Try again.": "Перевищено час очікування. Спробуйте ще раз.", "Tools that do not fit in the bar": "Інструменти, що не вмістилися на панелі", @@ -6088,6 +6102,7 @@ "Turn this part upside down": "Перевернути цей фрагмент догори ногами", "Turn this preview into the final video": "Перетворити цей попередній перегляд на остаточне відео", "Turn this preview part into the full-resolution video, in place": "Перетворити цей фрагмент попереднього перегляду на відео з повною роздільною здатністю на тому самому місці", + "Turning it off lowers Windows' protection against unknown programs. On some versions of Windows, it can be turned on again only by resetting Windows.": "Вимкнення послаблює захист Windows від невідомих програм. У деяких версіях Windows знову ввімкнути цю функцію можна лише після скидання Windows.", "Tutorial": "Уроки", "Tutorials": "Уроки", "Two friends sit by a café window at dusk. She says: \"You came back.\" He smiles: \"I promised.\" Warm light, quiet street sounds.": "Двоє друзів сидять біля вікна кав’ярні в сутінках. Вона каже: «Ти повернувся». Він усміхається: «Я обіцяв». Тепле світло, тихі звуки вулиці.", @@ -6432,6 +6447,7 @@ "When it shows \"Assistant connected\" or the assistant's name, describe the video under \"Tell the assistant…\", for example \"Make a 1-minute vertical short film: a day in a coffee shop\".": "Коли з’явиться «Помічника під’єднано» або ім’я помічника, опишіть відео в полі «Напишіть помічнику…», наприклад «Зніми вертикальний короткий фільм на 1 хвилину: день у кав’ярні».", "When model files are incomplete or changed, import the same offline packages again in the launcher; only the files with problems are completed or replaced.": "Якщо файли моделей неповні або змінені, повторно імпортуйте ті самі офлайн-пакети в програмі запуску; буде довантажено або замінено лише проблемні файли.", "When off, nothing takes VRAM before a generation; models already used stay loaded for the next one.": "Якщо вимкнено, до початку генерації відеопам’ять не займається; уже використані моделі залишаються завантаженими для наступної генерації.", + "When off, nothing takes unified memory before a generation; models already used stay loaded for the next one.": "Якщо вимкнено, перед генерацією ніщо не займає уніфіковану пам’ять; уже використані моделі залишаються завантаженими для наступної.", "When on, other devices on the same network can open FreeVideo with the link below and enter the password the first time.": "Якщо ввімкнено, інші пристрої в тій самій мережі можуть відкрити FreeVideo за посиланням нижче й під час першого відкриття ввести пароль.", "When on, other devices on the same network can open FreeVideo with the link below. Anyone with the link can use it, so keep it private.": "Якщо ввімкнено, інші пристрої в тій самій мережі можуть відкрити FreeVideo за посиланням нижче. Користуватися ним може будь-хто, хто має посилання, тому не поширюйте його.", "When something goes wrong": "Якщо щось пішло не так", @@ -6759,6 +6775,7 @@ "video model": "відеомодель", "wide shot": "загальний план", "with prompt": "із запитом", + "yesterday at {time}": "учора о {time}", "your Python mirror": "ваше дзеркало Python", "your configured source": "ваше налаштоване джерело", "zoom in": "зум-наближення", @@ -6807,6 +6824,7 @@ "{count} tasks, {active} under way": "Завдань: {count}, виконується: {active}", "{count} videos from this task": "Відео з цього завдання: {count}", "{count} voiceovers": "озвучення ({count})", + "{date} at {time}": "{date} о {time}", "{done} / {total} files": "Файли: {done} / {total}", "{done} / {total} frames": "Кадри: {done} / {total}", "{done} / {total} layers": "Шари: {done} / {total}", diff --git a/web/locales/zh-Hant.json b/web/locales/zh-Hant.json index 1ae1a50f..af7f211a 100644 --- a/web/locales/zh-Hant.json +++ b/web/locales/zh-Hant.json @@ -5,8 +5,8 @@ "fallback": "zh-Hans", "ready": true, "generated_by": "scripts/i18n_hant.py", -"entries": 6856, -"reviewed": 805, +"entries": 6874, +"reviewed": 804, "note": "Generated from zh-Hans.json; do not edit. Corrections go in scripts/i18n_hant_review.json.", "chars": "‘『’』“「”」㐷傌㐽偑㑇㑳㑈倲㑔㑯㑩儸㓆𠗣㓥劏㓰劃㔉劚㖊噚㖞喎㘎㘚㚯㜄㛀媰㛟𡞵㛠𡢃㛣㜏㛤孋㛿𡠹㟆㠏㟜𡾱㟥嵾㡎幓㤘㥮㤽懤㥪慺㧏掆㧐㩳㧑撝㧟擓㧰擽㨫㩜㭎棡㭏椲㭣𣙎㭤樢㭴樫㱩殰㱮殨㲿瀇㳔濧㳕灡㳠澾㳡濄㳢𣾷㳽瀰㴋潚㶉鸂㶶燶㶽煱㺍獱㻅璯㻏𤫩㻘𤪺䀥䁻䁖瞜䂵碽䃅磾䅉稏䅟穇䅪𥢢䇲筴䉤籔䌶䊷䌷紬䌸縳䌹絅䌺䋙䌻䋚䌼綐䌽綵䌾䋻䌿䋹䍀繿䍁繸䍠䍦䎬䎱䏝膞䑽𦪙䓓薵䓕薳䓖藭䓨罃䗖螮䘛𧝞䘞𧜗䙊𧜵䙌䙡䙓襬䜣訢䜤鿁䜥𧩙䜧䜀䜩讌䝙貙䞌𧵳䞍䝼䞎𧶧䞐賰䟢躎䢀𨊰䢁𨊸䢂𨋢䥺釾䥽鏺䥾䥱䥿𨯅䦀𨦫䦁𨧜䦂䥇䦃鐯䦅鐥䦆钁䦶䦛䦷䦟䩄靦䭪𩞯䯃𩣑䯄騧䯅䯀䲝䱽䲞𩶘䲟鮣䲠鰆䲡鰌䲢鰧䲣䱷䴓鳾䴔鵁䴕鴷䴖鶄䴗鶪䴘鷉䴙鸊䶮龑万萬与與专專业業丛叢东東丝絲丢丟两兩严嚴丧喪个個临臨为為丽麗举舉么麼义義乌烏乐樂乔喬习習乡鄉书書买買乱亂争爭于於亏虧云雲亚亞产產亩畝亲親亵褻亸嚲亿億仅僅从從仑侖仓倉仪儀们們众眾优優会會伛傴伞傘伟偉传傳伡俥伣俔伤傷伥倀伦倫伧傖伪偽伫佇体體余餘佥僉侠俠侣侶侥僥侦偵侧側侨僑侩儈侪儕侬儂侭儘俣俁俦儔俨儼俩倆俪儷俫倈俭儉债債倾傾偬傯偻僂偾僨偿償傤儎傥儻傧儐储儲傩儺儿兒兑兌兖兗兰蘭关關兴興兹茲养養兽獸冁囅内內冈岡册冊写寫军軍农農冯馮冲衝决決况況冻凍净淨凄悽凉涼减減凑湊凛凜几幾凤鳳凫鳧凭憑凯凱击擊凿鑿刍芻刘劉则則刚剛创創删刪别別刬剗刭剄刹剎刽劊刾㓨刿劌剀剴剂劑剐剮剑劍剥剝剧劇劝勸办辦务務劢勱动動励勵劲勁劳勞势勢勋勳勚勩匀勻匦匭匮匱区區医醫华華协協单單卖賣卢盧卤滷卧臥卫衛却卻卺巹厅廳历歷厉厲压壓厌厭厍厙厐龎厕廁厢廂厣厴厦廈厨廚厩廄厮廝县縣叁叄参參叆靉叇靆双雙发發变變叙敘叠疊号號叹嘆叽嘰吓嚇吕呂吗嗎吨噸听聽启啟吴吳呐吶呒嘸呓囈呕嘔呖嚦呗唄员員呙咼呛嗆呜嗚咏詠咙嚨咛嚀咝噝咤吒响響哑啞哒噠哓嘵哔嗶哕噦哗譁哙噲哜嚌哝噥哟喲唛嘜唝嗊唠嘮唡啢唢嗩唤喚啧嘖啬嗇啭囀啮齧啯嘓啰囉啴嘽啸嘯喷噴喽嘍喾嚳嗫囁嗳噯嘘噓嘤嚶嘱囑噜嚕嚣囂团團园園囱囪围圍囵圇国國图圖圆圓圣聖圹壙场場坏壞块塊坚堅坛壇坜壢坝壩坞塢坟墳坠墜垄壟垅壠垆壚垒壘垦墾垩堊垫墊垭埡垯墶垱壋垲塏垴堖埘塒埙壎埚堝堑塹堕墮塆壪墙牆壮壯声聲壳殼壶壺壸壼处處备備复復够夠头頭夹夾夺奪奁奩奂奐奋奮奖獎奥奧妆妝妇婦妈媽妩嫵妪嫗妫媯姗姍姹奼娄婁娅婭娆嬈娇嬌娈孌娱娛娲媧娴嫻婳嫿婴嬰婵嬋婶嬸媪媼媭嬃嫒嬡嫔嬪嫱嬙嬷嬤孙孫学學孪孿宁寧宝寶实實宠寵审審宪憲宫宮宽寬宾賓寝寢对對寻尋导導寿壽将將尔爾尘塵尝嘗尧堯尴尷尽盡层層屃屓屉屜届屆属屬屡屢屦屨屿嶼岁歲岂豈岖嶇岗崗岘峴岚嵐岛島岭嶺岽崬岿巋峃嶨峄嶧峡峽峣嶢峤嶠峥崢峦巒崂嶗崃崍崄嶮崭嶄嵘嶸嵚嶔嵝嶁巅巔巩鞏巯巰币幣帅帥师師帏幃帐帳帜幟带帶帮幫帱幬帻幘帼幗幂冪并並广廣庄莊庆慶庐廬庑廡库庫应應庙廟庞龐废廢庼廎廪廩开開异異弃棄弑弒张張弥彌弪弳弯彎弹彈强強归歸当當录錄彟彠彦彥彨彲彻徹径徑徕徠忆憶忏懺忧憂忾愾怀懷态態怂慫怃憮怄慪怅悵怆愴怜憐总總怼懟怿懌恋戀恒恆恳懇恶惡恸慟恹懨恺愷恻惻恼惱恽惲悦悅悫愨悬懸悭慳悮悞悯憫惊驚惧懼惨慘惩懲惫憊惬愜惭慚惮憚惯慣愠慍愤憤愦憒慑懾慭憖懑懣懒懶懔懍戆戇戋戔戏戲戗戧战戰戬戩戯戱户戶扑撲执執扩擴扪捫扫掃扬揚扰擾抚撫抛拋抟摶抠摳抡掄抢搶护護报報担擔拟擬拢攏拣揀拥擁拦攔拧擰拨撥择擇挂掛挚摯挛攣挜掗挝撾挞撻挟挾挠撓挡擋挢撟挣掙挤擠挥揮挦撏捝挩捞撈损損捡撿换換捣搗据據掳擄掴摑掷擲掸撣掺摻掼摜揽攬揾搵揿撳搀攙搁擱搂摟搄揯搅攪携攜摄攝摅攄摆擺摇搖摈擯摊攤撄攖撑撐撵攆撷擷撸擼撺攛擜㩵擞擻攒攢敌敵敚敓敛斂敩斆数數斋齋斓斕斩斬断斷无無旧舊时時旷曠旸暘昙曇昵暱昼晝昽曨显顯晋晉晒曬晓曉晔曄晕暈晖暉暂暫暅𣈶暧曖术術机機杀殺杂雜权權条條来來杨楊杩榪极極构構枞樅枢樞枣棗枥櫪枧梘枨棖枪槍枫楓枭梟柜櫃柠檸柽檉栀梔栅柵标標栈棧栉櫛栊櫳栋棟栌櫨栎櫟栏欄树樹栖棲样樣栾欒桠椏桡橈桢楨档檔桤榿桥橋桦樺桧檜桨槳桩樁桪樳梦夢梼檮梾棶梿槤检檢棁梲棂欞椁槨椝槼椟櫝椠槧椢槶椤欏椫樿椭橢椮槮楼樓榄欖榅榲榇櫬榈櫚榉櫸榝樧槚檟槛檻槟檳槠櫧横橫樯檣樱櫻橥櫫橱櫥橹櫓橼櫞檩檁欢歡欤歟欧歐歼殲殁歿殇殤残殘殒殞殓殮殚殫殡殯殴毆毁毀毂轂毕畢毙斃毡氈毵毿毶𣯶氇氌气氣氢氫氩氬氲氳汇匯汉漢汤湯汹洶沄澐沟溝没沒沣灃沤漚沥瀝沦淪沧滄沨渢沩溈沪滬泞濘泪淚泶澩泷瀧泸瀘泺濼泻瀉泼潑泽澤泾涇洁潔洒灑洼窪浃浹浅淺浆漿浇澆浈湞浉溮浊濁测測浍澮济濟浏瀏浐滻浑渾浒滸浓濃浔潯浕濜涂塗涚涗涛濤涝澇涞淶涟漣涠潿涡渦涢溳涣渙涤滌润潤涧澗涨漲涩澀渊淵渌淥渍漬渎瀆渐漸渑澠渔漁渖瀋渗滲温溫湾灣湿溼溁濚溃潰溅濺溆漵溇漊滗潷滚滾滞滯滟灩滠灄满滿滢瀅滤濾滥濫滦灤滨濱滩灘滪澦潆瀠潇瀟潋瀲潍濰潜潛潴瀦澛瀂澜瀾濑瀨濒瀕灏灝灭滅灯燈灵靈灾災灿燦炀煬炉爐炖燉炜煒炝熗点點炼煉炽熾烁爍烂爛烃烴烛燭烟煙烦煩烧燒烨燁烩燴烫燙烬燼热熱焕煥焖燜焘燾煴熅爱愛爷爺牍牘牦犛牵牽牺犧犊犢状狀犷獷犸獁犹猶狈狽狝獮狞獰独獨狭狹狮獅狯獪狰猙狱獄狲猻猃獫猎獵猕獼猡玀猪豬猫貓猬蝟献獻獭獺玑璣玙璵玚瑒玛瑪玮瑋环環现現玱瑲玺璽珐琺珑瓏珰璫珲琿琎璡琏璉琐瑣琼瓊瑶瑤瑷璦瑸璸璎瓔瓒瓚瓮甕瓯甌电電画畫畅暢畴疇疖癤疗療疟瘧疠癘疡瘍疬癧疭瘲疮瘡疯瘋疱皰疴痾痈癰痉痙痒癢痖瘂痨癆痪瘓痫癇瘅癉瘆瘮瘗瘞瘘瘻瘪癟瘫癱瘾癮瘿癭癞癩癣癬癫癲皑皚皱皺皲皸盏盞盐鹽监監盖蓋盗盜盘盤眍瞘眦眥眬矓着著睁睜睐睞睑瞼瞆瞶瞒瞞瞩矚矫矯矶磯矾礬矿礦砀碭码碼砖磚砗硨砚硯砜碸砺礪砻礱砾礫础礎硁硜硕碩硖硤硗磽硙磑硚礄确確硵磠碍礙碛磧碜磣碱鹼礼禮祃禡祎禕祢禰祯禎祷禱祸禍禀稟禄祿禅禪离離秃禿秆稈种種积積称稱秽穢秾穠稆穭税稅稣穌稳穩穑穡穞穭穷窮窃竊窍竅窎窵窑窯窜竄窝窩窥窺窦竇窭窶竖豎竞競笃篤笋筍笔筆笕筧笺箋笼籠笾籩筚篳筛篩筜簹筝箏筹籌筼篔签籤筿篠简簡箓籙箦簀箧篋箨籜箩籮箪簞箫簫篑簣篓簍篮籃篯籛篱籬簖籪籁籟籴糴类類籼秈粜糶粝糲粤粵粪糞粮糧糁糝糇餱糍餈紧緊絷縶緼縕縆緪纟糹纠糾纡紆红紅纣紂纤纖纥紇约約级級纨紈纩纊纪紀纫紉纬緯纭紜纮紘纯純纰紕纱紗纲綱纳納纴紝纵縱纶綸纷紛纸紙纹紋纺紡纻紵纼紖纽紐纾紓线線绀紺绁紲绂紱练練组組绅紳细細织織终終绉縐绊絆绋紼绌絀绍紹绎繹经經绐紿绑綁绒絨结結绔絝绕繞绖絰绗絎绘繪给給绚絢绛絳络絡绝絕绞絞统統绠綆绡綃绢絹绣繡绤綌绥綏绦絛继繼绨綈绩績绪緒绫綾绬緓续續绮綺绯緋绰綽绱鞝绲緄绳繩维維绵綿绶綬绷繃绸綢绹綯绺綹绻綣综綜绽綻绾綰绿綠缀綴缁緇缂緙缃緗缄緘缅緬缆纜缇緹缈緲缉緝缊縕缋繢缌緦缍綞缎緞缏緶缐線缑緱缒縋缓緩缔締缕縷编編缗緡缘緣缙縉缚縛缛縟缜縝缝縫缞縗缟縞缠纏缡縭缢縊缣縑缤繽缥縹缦縵缧縲缨纓缩縮缪繆缫繅缬纈缭繚缮繕缯繒缰韁缱繾缲繰缳繯缴繳缵纘罂罌网網罗羅罚罰罢罷罴羆羁羈羟羥羡羨翘翹翙翽翚翬耢耮耧耬耸聳耻恥聂聶聋聾职職聍聹联聯聩聵聪聰肃肅肠腸肤膚肮骯肴餚肾腎肿腫胀脹胁脅胆膽胧朧胨腖胪臚胫脛胶膠脉脈脍膾脏髒脐臍脑腦脓膿脔臠脚腳脱脫脶腡脸臉腘膕腭顎腻膩腼靦腽膃腾騰膑臏臜臢臺台舆輿舣艤舰艦舱艙舻艫艰艱艳豔艺藝节節芈羋芗薌芜蕪芦蘆苁蓯苇葦苈藶苋莧苌萇苍蒼苏蘇苧薴茎莖茏蘢茑蔦茔塋茕煢茧繭荆荊荐薦荙薘荚莢荛蕘荜蓽荝萴荞蕎荟薈荠薺荡蕩荣榮荤葷荥滎荦犖荧熒荨蕁荩藎荪蓀荫蔭荬蕒荭葒荮葤药藥莅蒞莱萊莲蓮莳蒔莴萵莶薟获獲莸蕕莹瑩莺鶯莼蓴萚蘀萝蘿萤螢营營萦縈萧蕭萨薩葱蔥蒀蒕蒇蕆蒉蕢蒋蔣蒌蔞蒏醟蓝藍蓟薊蓠蘺蓣蕷蓥鎣蓦驀蔂虆蔷薔蔹蘞蔺藺蔼藹蕰薀蕲蘄蕴蘊薮藪藓蘚藴蘊蘖櫱虏虜虑慮虚虛虬虯虮蟣虱蝨虽雖虾蝦虿蠆蚀蝕蚁蟻蚂螞蚃蠁蚕蠶蚬蜆蛊蠱蛎蠣蛏蟶蛮蠻蛰蟄蛱蛺蛲蟯蛳螄蛴蠐蜕蛻蜗蝸蝇蠅蝈蟈蝉蟬蝼螻蝾蠑螀螿螨蟎蟏蠨衅釁衔銜补補衬襯衮袞袄襖袅嫋袆褘袜襪袭襲袯襏装裝裆襠裈褌裢褳裣襝裤褲裥襉褛褸褴襤襕襴见見观觀觃覎规規觅覓视視觇覘览覽觉覺觊覬觋覡觌覿觍覥觎覦觏覯觐覲觑覷觞觴触觸觯觶訚誾詟讋誉譽誊謄讠訁计計订訂讣訃认認讥譏讦訐讧訌讨討让讓讪訕讫訖讬託训訓议議讯訊记記讱訒讲講讳諱讴謳讵詎讶訝讷訥许許讹訛论論讻訩讼訟讽諷设設访訪诀訣证證诂詁诃訶评評诅詛识識诇詗诈詐诉訴诊診诋詆诌謅词詞诎詘诏詔诐詖译譯诒詒诓誆诔誄试試诖詿诗詩诘詰诙詼诚誠诛誅诜詵话話诞誕诟詬诠詮诡詭询詢诣詣诤諍该該详詳诧詫诨諢诩詡诪譸诫誡诬誣语語诮誚误誤诰誥诱誘诲誨诳誑说說诵誦诶誒请請诸諸诹諏诺諾读讀诼諑诽誹课課诿諉谀諛谁誰谂諗调調谄諂谅諒谆諄谇誶谈談谉讅谊誼谋謀谌諶谍諜谎謊谏諫谐諧谑謔谒謁谓謂谔諤谕諭谖諼谗讒谘諮谙諳谚諺谛諦谜謎谝諞谞諝谟謨谠讜谡謖谢謝谣謠谤謗谥諡谦謙谧謐谨謹谩謾谪謫谫譾谬謬谭譚谮譖谯譙谰讕谱譜谲譎谳讞谴譴谵譫谶讖豮豶贝貝贞貞负負贠貟贡貢财財责責贤賢败敗账賬货貨质質贩販贪貪贫貧贬貶购購贮貯贯貫贰貳贱賤贲賁贳貰贴貼贵貴贶貺贷貸贸貿费費贺賀贻貽贼賊贽贄贾賈贿賄赀貲赁賃赂賂赃贓资資赅賅赆贐赇賕赈賑赉賚赊賒赋賦赌賭赍齎赎贖赏賞赐賜赑贔赒賙赓賡赔賠赕賧赖賴赗賵赘贅赙賻赚賺赛賽赜賾赝贗赞贊赟贇赠贈赡贍赢贏赣贛赪赬赵趙赶趕趋趨趱趲趸躉跃躍跄蹌跞躒践踐跶躂跷蹺跸蹕跹躚跻躋踌躊踪蹤踬躓踯躑蹑躡蹒蹣蹰躕蹿躥躏躪躜躦躯軀輼轀车車轧軋轨軌轩軒轪軑轫軔转轉轭軛轮輪软軟轰轟轱軲轲軻轳轤轴軸轵軹轶軼轷軤轸軫轹轢轺軺轻輕轼軾载載轾輊轿轎辀輈辁輇辂輅较較辄輒辅輔辆輛辇輦辈輩辉輝辊輥辋輞辌輬辍輟辎輜辏輳辐輻辑輯辒轀输輸辔轡辕轅辖轄辗輾辘轆辙轍辚轔辞辭辩辯辫辮边邊辽遼达達迁遷过過迈邁运運还還这這进進远遠违違连連迟遲迩邇迳逕迹跡适適选選逊遜递遞逦邐逻邏遗遺遥遙邓鄧邝鄺邬鄔邮郵邹鄒邺鄴邻鄰郏郟郐鄶郑鄭郓鄆郦酈郧鄖郸鄲酂酇酝醞酦醱酱醬酽釅酾釃酿釀醖醞释釋鉴鑑銮鑾錾鏨钅釒钆釓钇釔针針钉釘钊釗钋釙钌釕钍釷钎釺钏釧钐釤钑鈒钒釩钓釣钔鍆钕釹钖鍚钗釵钘鈃钙鈣钚鈈钛鈦钜鉅钝鈍钞鈔钟鍾钠鈉钡鋇钢鋼钣鈑钤鈐钥鑰钦欽钧鈞钨鎢钩鉤钪鈧钫鈁钬鈥钭鈄钮鈕钯鈀钰鈺钱錢钲鉦钳鉗钴鈷钵缽钶鈳钷鉕钸鈽钹鈸钺鉞钻鑽钼鉬钽鉭钾鉀钿鈿铀鈾铁鐵铂鉑铃鈴铄鑠铅鉛铆鉚铇鉋铈鈰铉鉉铊鉈铋鉍铌鈮铍鈹铎鐸铏鉶铐銬铑銠铒鉺铓鋩铔錏铕銪铖鋮铗鋏铘鋣铙鐃铚銍铛鐺铜銅铝鋁铞銱铟銦铠鎧铡鍘铢銖铣銑铤鋌铥銩铦銛铧鏵铨銓铩鎩铪鉿铫銚铬鉻铭銘铮錚铯銫铰鉸铱銥铲鏟铳銃铴鐋铵銨银銀铷銣铸鑄铹鐒铺鋪铻鋙铼錸铽鋱链鏈铿鏗销銷锁鎖锂鋰锃鋥锄鋤锅鍋锆鋯锇鋨锈鏽锉銼锊鋝锋鋒锌鋅锍鋶锎鐦锏鐧锐銳锑銻锒鋃锓鋟锔鋦锕錒锖錆锗鍺锘鍩错錯锚錨锛錛锜錡锝鍀锞錁锟錕锠錩锡錫锢錮锣鑼锤錘锥錐锦錦锧鑕锨鍁锩錈锪鍃锫錇锬錟锭錠键鍵锯鋸锰錳锱錙锲鍥锳鍈锴鍇锵鏘锶鍶锷鍔锸鍤锹鍬锺鍾锻鍛锼鎪锽鍠锾鍰锿鎄镀鍍镁鎂镂鏤镃鎡镄鐨镅鎇镆鏌镇鎮镈鎛镉鎘镊鑷镋钂镌鐫镍鎳镎鎿镏鎦镐鎬镑鎊镒鎰镓鎵镔鑌镕鎔镖鏢镗鏜镘鏝镙鏍镚鏰镛鏞镜鏡镝鏑镞鏃镟鏇镠鏐镡鐔镢钁镣鐐镤鏷镥鑥镦鐓镧鑭镨鐠镩鑹镪鏹镫鐙镬鑊镭鐳镮鐶镯鐲镰鐮镱鐿镲鑔镳鑣镴鑞镵鑱镶鑲长長门門闩閂闪閃闫閆闬閈闭閉问問闯闖闰閏闱闈闲閒闳閎间間闵閔闶閌闷悶闸閘闹鬧闺閨闻聞闼闥闽閩闾閭闿闓阀閥阁閣阂閡阃閫阄鬮阅閱阆閬阇闍阈閾阉閹阊閶阋鬩阌閿阍閽阎閻阏閼阐闡阑闌阒闃阓闠阔闊阕闋阖闔阗闐阘闒阙闕阚闞阛闤队隊阳陽阴陰阵陣阶階际際陆陸陇隴陈陳陉陘陕陝陦隯陧隉陨隕险險随隨隐隱隶隸隽雋难難雇僱雏雛雠讎雳靂雾霧霁霽霉黴霡霢霭靄靓靚靔靝静靜靥靨鞑韃鞒鞽鞯韉鞲韝韦韋韧韌韨韍韩韓韪韙韫韞韬韜韵韻页頁顶頂顷頃顸頇项項顺順须須顼頊顽頑顾顧顿頓颀頎颁頒颂頌颃頏预預颅顱领領颇頗颈頸颉頡颊頰颋頲颌頜颍潁颎熲颏頦颐頤频頻颒頮颓頹颔頷颕頴颖穎颗顆题題颙顒颚顎颛顓颜顏额額颞顳颟顢颠顛颡顙颢顥颣纇颤顫颥顬颦顰颧顴风風飏颺飐颭飑颮飒颯飓颶飔颸飕颼飖颻飗飀飘飄飙飆飚飈飞飛飨饗餍饜饣飠饤飣饥飢饦飥饧餳饨飩饩餼饪飪饫飫饬飭饭飯饮飲饯餞饰飾饱飽饲飼饳飿饴飴饵餌饶饒饷餉饸餄饹餎饺餃饻餏饼餅饽餑饾餖饿餓馀餘馁餒馂餕馃餜馄餛馅餡馆館馇餷馈饋馉餶馊餿馋饞馌饁馍饃馎餺馏餾馐饈馑饉馒饅馓饊馔饌馕饢马馬驭馭驮馱驯馴驰馳驱驅驲馹驳駁驴驢驵駔驶駛驷駟驸駙驹駒驺騶驻駐驼駝驽駑驾駕驿驛骀駘骁驍骂罵骃駰骄驕骅驊骆駱骇駭骈駢骉驫骊驪骋騁验驗骍騂骎駸骏駿骐騏骑騎骒騍骓騅骔騌骕驌骖驂骗騙骘騭骙騤骚騷骛騖骜驁骝騮骞騫骟騸骠驃骡騾骢驄骣驏骤驟骥驥骦驦骧驤髅髏髋髖髌髕鬓鬢鬶鬹魇魘魉魎鱼魚鱽魛鱾魢鱿魷鲀魨鲁魯鲂魴鲃䰾鲄魺鲅鮁鲆鮃鲇鯰鲈鱸鲉鮋鲊鮓鲋鮒鲌鮊鲍鮑鲎鱟鲏鮍鲐鮐鲑鮭鲒鮚鲓鮳鲔鮪鲕鮞鲖鮦鲗鰂鲘鮜鲙鱠鲚鱭鲛鮫鲜鮮鲝鮺鲞鯗鲟鱘鲠鯁鲡鱺鲢鰱鲣鰹鲤鯉鲥鰣鲦鰷鲧鯀鲨鯊鲩鯇鲪鮶鲫鯽鲬鯒鲭鯖鲮鯪鲯鯕鲰鯫鲱鯡鲲鯤鲳鯧鲴鯝鲵鯢鲶鯰鲷鯛鲸鯨鲹鰺鲺鯴鲻鯔鲼鱝鲽鰈鲾鰏鲿鱨鳀鯷鳁鰮鳂鰃鳃鰓鳄鱷鳅鰍鳆鰒鳇鰉鳈鰁鳉鱂鳊鯿鳋鰠鳌鰲鳍鰭鳎鰨鳏鰥鳐鰩鳑鰟鳒鰜鳓鰳鳔鰾鳕鱈鳖鱉鳗鰻鳘鰵鳙鱅鳚䲁鳛鰼鳜鱖鳝鱔鳞鱗鳟鱒鳠鱯鳡鱤鳢鱧鳣鱣鳤䲘鸟鳥鸠鳩鸡雞鸢鳶鸣鳴鸤鳲鸥鷗鸦鴉鸧鶬鸨鴇鸩鴆鸪鴣鸫鶇鸬鸕鸭鴨鸮鴞鸯鴦鸰鴒鸱鴟鸲鴝鸳鴛鸴鷽鸵鴕鸶鷥鸷鷙鸸鴯鸹鴰鸺鵂鸻鴴鸼鵃鸽鴿鸾鸞鸿鴻鹀鵐鹁鵓鹂鸝鹃鵑鹄鵠鹅鵝鹆鵒鹇鷳鹈鵜鹉鵡鹊鵲鹋鶓鹌鵪鹍鵾鹎鵯鹏鵬鹐鵮鹑鶉鹒鶊鹓鵷鹔鷫鹕鶘鹖鶡鹗鶚鹘鶻鹙鶖鹚鷀鹛鶥鹜鶩鹝鷊鹞鷂鹟鶲鹠鶹鹡鶺鹢鷁鹣鶼鹤鶴鹥鷖鹦鸚鹧鷓鹨鷚鹩鷯鹪鷦鹫鷲鹬鷸鹭鷺鹮䴉鹯鸇鹰鷹鹱鸌鹲鸏鹳鸛鹴鸘鹾鹺麦麥麸麩麹麴麺麵麽麼黄黃黉黌黡黶黩黷黪黲黾黽鼋黿鼌鼂鼍鼉鼹鼴齐齊齑齏齿齒龀齔龁齕龂齗龃齟龄齡龅齙龆齠龇齜龈齦龉齬龊齪龋齲龌齷龙龍龚龔龛龕龟龜鿎䃮鿏䥑鿒鿓鿔鎶𠀾𠁞𠆲儣𠆿𠌥𠇹俓𠉂㒓𠉗𠏢𠋆儭𠚳𠠎𠛅剾𠛆𠞆𠛾𪟖𠡠勑𠮶嗰𠯟哯𠯠噅𠰱㘉𠰷嚧𠱞囃𠲥𡅏𠴛𡃕𠴢𡄔𠵸𡄣𠵾㗲𡋀𡓾𡋗𡑭𡋤壗𡍣𡔖𡒄壈𡝠㜷𡞋㜗𡞱㜢𡠟孎𡥧孻𡭜𡮉𡭬𡮣𡳃𡳳𡳒𦘧𡶴嵼𡸃𡽗𡺃嶈𡺄嶘𢋈㢝𢗓㦛𢘙𢤱𢘝𢣚𢘞𢣭𢙏愻𢙐憹𢙑𢠼𢙒憢𢙓懀𢛯㦎𢠁懎𢢐𤢻𢧐戰𢫊𢷮𢫞𢶫𢫬摋𢬍擫𢬦𢹿𢭏擣𢽾斅𣃁斸𣆐曥𣈣𣋋𣍨𦢈𣍯腪𣍰脥𣎑臗𣏢槫𣐕桱𣐤欍𣑶𣠲𣒌楇𣓿橯𣔌樤𣗊樠𣗋欓𣗙㰙𣘐㯤𣘓𣞻𣘴檭𣘷𣝕𣚚欘𣞎𣠩𣨼殢𣭤𣯴𣯣𣯩𣱝氭𣲗湋𣲘潕𣳆㵗𣶩澅𣶫𣿉𣶭𪷓𣷷𤅶𣸣濆𣺼灙𣺽𤁣𣽷瀃𤆡熓𤆢㷍𤇃爄𤇄熌𤇭爖𤇹熚𤈶熉𤈷㷿𤊀𤒎𤊰𤓩𤋏熡𤎺𤓎𤎻𤑳𤙯𤛮𤝢𤢟𤞃獩𤞤玁𤠋㺏𤦀瓕𤩽瓛𤳄𤳸𤶊癐𤶧𤸫𤻊㿗𤽯㿧𤾀皟𤿲麬𥁢䀉𥅘𥌃𥅴䀹𥅿𥊝𥆧瞤𥇢䁪𥎝䂎𥐟礒𥐯𥖅𥐰𥕥𥐻碙𥞦𥞵𥧂𥨐𥩟竚𥩺𥪂𥫣籅𥬀䉙𥬞籋𥬠篘𥭉𥵊𥮋𥸠𥮜䉲𥮾篸𥱔𥵃𥹥𥼽𥺅䊭𥺇𥽖𦈈𥿊𦈉緷𦈋綇𦈌綀𦈎繟𦈏緍𦈐縺𦈑緸𦈒𦂅𦈓䋿𦈔縎𦈕緰𦈖䌈𦈗𦃄𦈘䌋𦈙䌰𦈚縬𦈛繓𦈜䌖𦈝繏𦈞䌟𦈟䌝𦈠䌥𦈡繻𦍠䍽𦛨朥𦝼膢𦟗𦣎𦨩𦪽𦰏蓧𦰴䕳𦶟爇𦶻𦾟𦻕蘟𧉐𧕟𧉞䗿𧌥𧎈𧏖蠙𧏗蠀𧑏蠾𧒭𧔥𧜭䙱𧝝襰𧝧𧟀𧮪詀𧳕𧳟𧹑䞈𧹒買𧹓𧶔𧹔賬𧹕䝻𧹖賟𧹗贃𧿈𨇁𨀁躘𨀱𨄣𨁴𨅍𨂺𨈊𨄄𨈌𨅛䠱𨅫𨇞𨅬躝𨉗軉𨐅軗𨐆𨊻𨐇𨏠𨐈輄𨐉𨎮𨐊𨏥𨑹䢨𨟳𨣞𨠨𨣧𨡙𨢿𨡺𨣈𨤰𨤻𨰾鎷𨰿釳𨱀𨥛𨱁鈠𨱂鈋𨱃鈲𨱄鈯𨱅鉁𨱆龯𨱇銶𨱈鋉𨱉鍄𨱊𨧱𨱋錂𨱌鏆𨱍鎯𨱎鍮𨱏鎝𨱐𨫒𨱑鐄𨱒鏉𨱓鐎𨱔鐏𨱕𨮂𨱖䥩𨷿䦳𨸀𨳕𨸁𨳑𨸂閍𨸃閐𨸄䦘𨸅𨴗𨸆𨵩𨸇𨵸𨸉𨶀𨸊𨶏𨸋𨶲𨸌𨶮𨸎𨷲𨸘𨽏𨸟䧢𩏼䪏𩏽𩏪𩏾𩎢𩏿䪘𩐀䪗𩓋顂𩖕𩓣𩖖顃𩖗䫴𩙥颰𩙦𩗀𩙧䬞𩙨𩘹𩙩𩘀𩙪颷𩙫颾𩙬𩘺𩙭𩘝𩙮䬘𩙯䬝𩙰𩙈𩟿𩚛𩠀𩚥𩠁𩚵𩠂𩛆𩠃𩛩𩠅𩟐𩠆𩜦𩠇䭀𩠈䭃𩠉𩜇𩠊𩜵𩠋𩝔𩠌餸𩠎𩞄𩠏𩞦𩠠𩠴𩡖𩡣𩧦𩡺𩧨駎𩧩𩤊𩧪䮾𩧫駚𩧬𩢡𩧭䭿𩧮𩢾𩧯驋𩧰䮝𩧱𩥉𩧲駧𩧳𩢸𩧴駩𩧵𩢴𩧶𩣏𩧸𩣫𩧺駶𩧻𩣵𩧼𩣺𩧿䮠𩨀騔𩨁䮞𩨂驄𩨃騝𩨄騪𩨅𩤸𩨆𩤙𩨇䮫𩨈騟𩨉𩤲𩨊騚𩨋𩥄𩨌𩥑𩨍𩥇𩨎龭𩨏䮳𩨐𩧆𩩈䯤𩬣𩭙𩬤𩰀𩭹鬖𩯒𩯳𩰰𩰹𩲒𩳤𩴌𩴵𩽹魥𩽺𩵩𩽻𩵹𩽼鯶𩽽𩶱𩽾鮟𩽿𩶰𩾁鯄𩾂䲖𩾃鮸𩾄𩷰𩾅𩸃𩾆𩸦𩾇鯱𩾈䱙𩾊䱬𩾋䱰𩾌鱇𩾎𩽇𪉂䲰𪉃鳼𪉄𩿪𪉅𪀦𪉆鴲𪉈鴜𪉉𪁈𪉊鷨𪉋𪀾𪉌𪁖𪉍鵚𪉎𪂆𪉏𪃏𪉐𪃍𪉑鷔𪉒𪄕𪉔𪄆𪉕𪇳𪎈䴬𪎉麲𪎊麨𪎋䴴𪎌麳𪑅䵳𪔭𪔵𪚏𪘀𪚐𪘯𪜎𠿕𪞝凙𪟎㔋𪟝勣𪠀𧷎𪠟㓄𪠡𠬙𪠳唓𪠵㖮𪠸嚛𪠺𠽃𪠽噹𪡀嘺𪡃嘪𪡋噞𪡏嗹𪡛㗿𪡞嘳𪡺𡃄𪢌㘓𪢐𡃤𪢒𡂡𪢕嚽𪢖𡅯𪢠囒𪢮圞𪢸墲𪣆埬𪣒堚𪣻塿𪤄𡓁𪤚壣𪥠𧹈𪥫孇𪥰嬣𪥿嬻𪧀孾𪧘寠𪨊㞞𪨗屩𪨧崙𪨩𡸗𪨶輋𪨷巗𪨹𡹬𪩇㟺𪩎巊𪩘巘𪩛𡿖𪩷幝𪩸幩𪪏廬𪪑㢗𪪞廧𪪴𢍰𪪼彃𪫌徿𪫡𢤩𪫷㦞𪫺憸𪬚𢣐𪬯𢤿𪭝𢯷𪭢摐𪭧擟𪭯𢶒𪭵掚𪭾撊𪮃㨻𪮋㩋𪮖撧𪮳𢺳𪮶攋𪯋㪎𪰶曊𪱥膹𪱷梖𪲎櫅𪲔欐𪲛檵𪲮櫠𪳍欇𪳗𣜬𪴙欑𪵑毊𪵣霼𪵱濿𪶄溡𪶒𤄷𪶮𣽏𪷍㵾𪷽灒𪸕熂𪸩煇𪹀𤑹𪹠𤓌𪹳爥𪹹𤒻𪺣𤘀𪺪𤜆𪺭犞𪺷獊𪺸𤠮𪺻㺜𪺽猌𪻐瑽𪻨瓄𪻲瑻𪻺璝𪼋㻶𪼴𤬅𪽈畼𪽝𤳷𪽪痮𪽭𤷃𪽮㿖𪽴𤺔𪽷瘱𪾔盨𪾢睍𪾣眝𪾦矑𪾸矉𪿊𥏝𪿞𥖲𪿫礮𪿵𥗇𫀌𥜰𫀓𥜐𫀨䅐𫀬䅳𫀮𥢷𫁂䆉𫁟竱𫁡鴗𫁱𥶽𫁲䉑𫁳𥯤𫁷䉶𫁺𥴼𫂃簢𫂆簂𫂈䉬𫂖𥴨𫂿𥻦𫃗𩏷𫄙糺𫄚䊺𫄛紟𫄜䋃𫄝𥾯𫄞䋔𫄟絁𫄠絙𫄡絧𫄢絥𫄣繷𫄤繨𫄥纚𫄦𦀖𫄧綖𫄨絺𫄩䋦𫄪𦅇𫄫綟𫄬緤𫄭緮𫄮䋼𫄯𦃩𫄰縍𫄱繬𫄲縸𫄳縰𫄴繂𫄵𦅈𫄶繈𫄷繶𫄸纁𫄹纗𫅅䍤𫅗羵𫅥𦒀𫅭䎙𫅼𦔖𫆏聻𫆝𦟼𫆫𦡝𫇘𦧺𫇛艣𫇪𦱌𫇭蒍𫇴蒭𫇽蕽𫈉蕳𫈎葝𫈟蔯𫈵蕝𫉁薆𫉄藷𫊪䗅𫊮蠦𫊸蟜𫊹𧒯𫊻蟳𫋇蟂𫋌蟘𫋲䙔𫋷襗𫋹襓𫋻襘𫌀襀𫌇襵𫌋𧞫𫌨覼𫌪覛𫌫𧡴𫌬𧢄𫌭覹𫌯䚩𫍐𧭹𫍙訑𫍚訞𫍛訜𫍜詓𫍝諫𫍞𧦝𫍟𧦧𫍠䛄𫍡詑𫍢譊𫍣詷𫍤譑𫍥誂𫍦譨𫍧誺𫍨誫𫍩諣𫍪誋𫍫䛳𫍬誷𫍭𧩕𫍮誳𫍯諴𫍰諰𫍱諯𫍲謏𫍳諥𫍴謱𫍵謸𫍶𧩼𫍷謉𫍸謆𫍹謯𫍺𧫝𫍻譆𫍼𧬤𫍽譞𫍾𧭈𫍿譾𫎆豵𫎌貗𫎦贚𫎧䝭𫎨𧸘𫎩賝𫎪䞋𫎫贉𫎬贑𫎭䞓𫎱䟐𫎳䟆𫎸𧽯𫎺䟃𫏃䠆𫏆蹳𫏋蹻𫏌𨂐𫏐蹔𫏑𨇽𫏕𨆪𫏞𨇰𫏨𨇤𫐄軏𫐅軕𫐆轣𫐇軜𫐈軷𫐉軨𫐊軬𫐋𨎌𫐌軿𫐍𨌈𫐎輢𫐏輖𫐐輗𫐑輨𫐒輷𫐓輮𫐔𨍰𫐕轊𫐖轇𫐗轐𫐘轗𫐙轠𫐷遱𫑘鄟𫑡鄳𫑷醶𫓥釟𫓦釨𫓧鈇𫓨鈛𫓩鏦𫓪鈆𫓫𨥟𫓬鉔𫓭鉠𫓮𨪕𫓯銈𫓰銊𫓱鐈𫓲銁𫓳𨰋𫓴鉾𫓵鋠𫓶鋗𫓷𫒡𫓸錽𫓹錤𫓺鐪𫓻錜𫓼𨨛𫓽錝𫓾錥𫓿𨨢𫔀鍊𫔁鐼𫔂鍉𫔃𨰲𫔄鍒𫔅鎍𫔆䥯𫔇鎞𫔈鎙𫔉𨰃𫔊鏥𫔋䥗𫔌鏾𫔍鐇𫔎鐍𫔏𨬖𫔐𨭸𫔑𨭖𫔒𨮳𫔓𨯟𫔔鑴𫔕𨰥𫔖𨲳𫔭開𫔮閒𫔯閗𫔰閞𫔲𨴹𫔴閵𫔵䦯𫔶闑𫔽𨼳𫕚𩀨𫕥霣𫕨𩅙𫖃靧𫖅䪊𫖇鞾𫖑𩎖𫖒韠𫖓𩏂𫖔韛𫖕韝𫖖𩏠𫖪𩑔𫖫䪴𫖬䪾𫖭𩒎𫖮顗𫖯頫𫖰䫂𫖱䫀𫖲䫟𫖳頵𫖴𩔳𫖵𩓥𫖶顅𫖷𩔑𫖸願𫖹顣𫖺䫶𫗇䫻𫗈𩗓𫗉𩗴𫗊䬓𫗋飋𫗚𩟗𫗞飦𫗟䬧𫗠餦𫗡𩚩𫗢飵𫗣飶𫗤𩛌𫗥餫𫗦餔𫗧餗𫗨𩛡𫗩饠𫗪餧𫗫餬𫗬餪𫗭餵𫗮餭𫗯餱𫗰䭔𫗱䭑𫗳𩝽𫗴饘𫗵饟𫘛馯𫘜馼𫘝駃𫘞駞𫘟駊𫘠駤𫘡駫𫘣駻𫘤騃𫘥騉𫘦騊𫘧騄𫘨騠𫘩騜𫘪騵𫘫騴𫘬騱𫘭騻𫘮䮰𫘯驓𫘰驙𫘱驨𫘽鬠𫙂𩯁𫚈鱮𫚉魟𫚊鰑𫚋鱄𫚌魦𫚍魵𫚎𩶁𫚏䱁𫚐䱀𫚑鮅𫚒鮄𫚓鮤𫚔鮰𫚕鰤𫚖鮆𫚗鮯𫚘𩻮𫚙鯆𫚚鮿𫚛鮵𫚜䲅𫚝𩸄𫚞鯬𫚟𩸡𫚠䱧𫚡鯞𫚢鰋𫚣鯾𫚤鰦𫚥鰕𫚦鰫𫚧鰽𫚨𩻗𫚩𩻬𫚪鱊𫚫鱢𫚬𩼶𫚭鱲𫛚鳽𫛛鳷𫛜鴀𫛝鴅𫛞鴃𫛟鸗𫛠𩿤𫛡鴔𫛢鸋𫛣鴥𫛤鴐𫛥鵊𫛦鴮𫛧𪀖𫛨鵧𫛩鴳𫛪鴽𫛫鶰𫛬䳜𫛭鵟𫛮䳤𫛯鶭𫛰䳢𫛱鵫𫛲鵰𫛳鵩𫛴鷤𫛵鶌𫛶鶒𫛷鶦𫛸鶗𫛹𪃧𫛺䳧𫛻𪃒𫛼䳫𫛽鷅𫛾𪆷𫜀鷐𫜁鷩𫜂𪅂𫜃鷣𫜄鷷𫜅䴋𫜊𪉸𫜑麷𫜒䴱𫜓𪌭𫜔䴽𫜕𪍠𫜙䵴𫜟𪓰𫜨䶕𫜩齧𫜪齩𫜫𫜦𫜬齰𫜭齭𫜮齴𫜯𪙏𫜰齾𫜲龓𫜳䶲𫝈㑮𫝋𠐊𫝦㛝𫝧㜐𫝨媈𫝩嬦𫝪𡟫𫝫婡𫝬嬇𫝭孆𫝮孄𫝵嶹𫞅𦠅𫞗潣𫞚澬𫞛㶆𫞝灍𫞠爧𫞡爃𫞢𤛱𫞣㹽𫞥珼𫞦璾𫞧𤩂𫞨璼𫞩璊𫞷𥢶𫟃絍𫟄綋𫟅綡𫟆緟𫟇𦆲𫟑䖅𫟕䕤𫟞訨𫟟詊𫟠譂𫟡誴𫟢䜖𫟤䡐𫟥䡩𫟦䡵𫟫𨞺𫟬𨟊𫟲釚𫟳釲𫟴鈖𫟵鈗𫟶銏𫟷鉝𫟸鉽𫟹鉷𫟺䤤𫟻銂𫟼鐽𫟽𨧰𫟾𨩰𫟿鎈𫠀䥄𫠁鑉𫠂閝𫠅韚𫠆頍𫠇𩖰𫠈䫾𫠊䮄𫠋騼𫠌𩦠𫠏𩵦𫠐魽𫠑䱸𫠒鱆𫠖𩿅𫠜齯𫢸僤𫧃𣍐𫧮𪋿𫫇噁𫬐㘔𫭟塸𫭢埨𫭼𡑍𫮃墠𫰛娙𫵷㠣𫶇嵽𫷷廞𫸩彄𬀩暐𬀪晛𬂩梜𬃊櫍𬇕澫𬇙浿𬇹漍𬉼熰𬊈燖𬊤燀𬍛瓅𬍡璗𬍤璕𬒈礐𬒗𥗽𬕂篢𬘓紃𬘘紞𬘡絪𬘩綎𬘫綄𬘬綪𬘭綝𬘯綧𬙂縯𬙊纆𬙋纕𬜬蔄𬜯䓣𬞟蘋𬟁虉𬟽蝀𬣙訏𬣞詝𬣡諓𬣳詪𬤇諲𬤊諟𬤝譓𬨂軝𬨎輶𬩽鄩𬪩醲𬬩釴𬬭錀𬬮鋹𬬱釿𬬸鉥𬬹鉮𬬻鑪𬬿鉊𬭁鉧𬭊𨧀𬭎鋐𬭚錞𬭛𨨏𬭤鍭𬭩鎓𬭬鏏𬭭鏚𬭯䥕𬭳𨭎𬭶𨭆𬭸鏻𬭼鐩𬮱闉𬮿隑𬯀隮𬯎隤𬱖頔𬱟頠𬳵駓𬳶駉𬳽駪𬳿駼𬴂騑𬴃騞𬴊驎𬶋鮈𬶍鮀𬶏鮠𬶐鮡𬶟鯻𬶠鰊𬶨鱀𬶭鰶𬶮鱚𬷕鵏𬸘鶠𬸚鸑𬸣鶱𬸦鷟𬸪鷭𬸯鷿𬹼齘𬺈齮𬺓齼𰬸繐𰰨菕𰶎譅𰾄鋂𰾭鑀𱊜𪈼" }, @@ -49,6 +49,10 @@ "\"Use as is\" is not available here.": "這裡不能「原樣使用」。", "\"Use as is\" is not available on this computer yet.": "這台電腦上還不能用「原樣使用」。", "\"Use as is\" is not available while extending a video. Remove \"Extends this video\" first.": "接在影片之後時不能「原樣使用」,請先移除「接在這段影片後面」。", +"\"{folder}\" holds too many files that could be models for FreeVideo to check one by one. Move the files that are not models out of this folder, then try again.": "「{folder}」裡可能是模型的檔案太多,FreeVideo 無法逐個核對。請把不是模型的檔案移出這個資料夾,然後重試。", +"\"{folder}\" holds too many files that could be models for FreeVideo to check one by one. Offline packages cannot download the models instead, so remove this folder from \"Reuse models\" on the Models page.": "「{folder}」裡可能是模型的檔案太多,FreeVideo 無法逐個核對。使用離線安裝包時不能改為下載,請在「模型」頁的「複用已有模型」裡把它移除。", +"\"{folder}\" holds too many files that could be models for FreeVideo to check one by one. Skip this folder and download the models instead, or remove it from \"Reuse models\" on the Models page.": "「{folder}」裡可能是模型的檔案太多,FreeVideo 無法逐個核對。可以跳過這個資料夾、改為下載需要的模型,或在「模型」頁的「複用已有模型」裡把它移除。", +"\"{folder}\" holds too many files that could be models for FreeVideo to check one by one. Skip this folder and download the models instead.": "「{folder}」裡可能是模型的檔案太多,FreeVideo 無法逐個核對。可以跳過這個資料夾,改為下載需要的模型。", "\"{media}\" could not be found. Upload or select it again, then generate.": "素材「{media}」已不存在,請重新上傳或選擇後再生成。", "\"{name}\" can't hold FreeVideo. Choose another disk.": "「{name}」 不能安裝 FreeVideo,請換一塊硬碟。", "\"{name}\" can't store files over 4 GB. Choose another disk.": "「{name}」 不能存放 4 GB 以上的檔案,請換一塊硬碟。", @@ -531,6 +535,7 @@ "Attached images": "已新增的圖片", "Audio 1": "聲音 1", "Audio 2": "聲音 2", +"Audio 2 cannot be removed while the Dialogue, Music and Ambience tracks still have parts. Delete those parts first.": "人聲、音樂、環境聲軌道上還有片段,暫時不能移除聲音 2。請先刪除這些片段。", "Audio and video cache": "影音快取", "Audio length: {seconds} s; uses up to the first 15 s within the video length.": "音訊長 {seconds} 秒,最多取前 15 秒且不超過影片時長。", "Audio longer than 30 seconds used as is is made in parts, which needs \"Faster second pass\". Turn it on or set the audio to \"Reference\".": "超過 30 秒的音訊選「原樣使用」時會分段生成,需要「第二階段加速」。請開啟「第二階段加速」,或把音訊改選「參考」。", @@ -2224,6 +2229,7 @@ "FreeVideo asks before deleting a video, and a video used in an edit cannot be deleted.": "刪除作品前會確認;被剪輯使用的作品不能刪除。", "FreeVideo cannot read its own files": "FreeVideo 讀不到自己的程式檔案", "FreeVideo cannot run from this disk": "這塊硬碟上無法執行 FreeVideo", +"FreeVideo cannot use \"{name}\": this file type is not supported. Use a PNG, JPEG or WebP image, an MP4, MOV or WebM video, or WAV or MP3 audio.": "無法使用「{name}」:不支援這種檔案類型。請改用 PNG、JPEG 或 WebP 圖片,MP4、MOV 或 WebM 影片,或 WAV 或 MP3 音訊。", "FreeVideo closed unexpectedly while generating.": "生成過程中 FreeVideo 意外關閉。", "FreeVideo could not be opened from the menu": "從選單開啟 FreeVideo 失敗", "FreeVideo could not reach the network.": "FreeVideo 無法連上網路。", @@ -3090,6 +3096,7 @@ "Making music": "製作配樂", "Making the video": "合成影片", "Male": "男", +"Manage model folders": "管理模型資料夾", "Mannequin": "人偶", "Mark all as read": "全部標為已讀", "Mark as read": "標為已讀", @@ -3379,6 +3386,7 @@ "Not deleted: saved edits could not be checked. Try again in a moment.": "未刪除:暫時無法檢查已儲存的剪輯,請稍後再試。", "Not deleted: the folder also holds files FreeVideo did not write: ": "未刪除:資料夾裡還有不是 FreeVideo 生成的檔案:", "Not deleted: these edits use it: ": "未刪除:這些剪輯正在使用它:", +"Not detected": "未檢測到", "Not enabled. Your prompt is unchanged.": "未啟用,原文已保留。", "Not enough GPU memory": "顯示卡記憶體不足", "Not enough GPU memory for depth": "顯示卡記憶體不足,無法提取深度", @@ -4341,6 +4349,7 @@ "Restore original": "恢復原圖", "Restored the original image.": "已恢復原圖。", "Restored the original image. Edit it again to reapply the changes.": "已恢復原圖;再次編輯可以重新應用修改。", +"Restored your changes up to {time}. Later changes could not be kept on this computer and were lost.": "已恢復到 {time} 的變更。之後的變更未能儲存在這台電腦上,已經遺失。", "Restored, but {lost} could not be brought back.": "已恢復,其中 {lost} 個未能恢復。", "Restored.": "已恢復。", "Restore␟恢复": "恢復", @@ -4854,6 +4863,7 @@ "Sketch mannequin": "草圖人偶", "Sketch␟画草图": "畫草圖", "Sketch␟草图": "草圖", +"Skip this folder and download": "跳過此資料夾並下載", "Skipped": "已跳過", "Skipped 1 unsupported file": "已跳過 1 個不支援的檔案", "Skipped 1 unsupported file ({types})": "已跳過 1 個不支援的檔案({types})", @@ -4871,7 +4881,8 @@ "Small file": "省空間", "Smaller than the {vsize} video; the result will look softer.": "比 {vsize} 的影片小,生成的畫面會變模糊。", "Smaller tiles, more at once": "縮圖更小,一次顯示更多", -"Smart App Control in Windows blocked these files. Search Windows for \"Smart App Control\", or open Windows Security → App & browser control → Smart App Control settings.": "Windows 的「智慧型應用程式控制」攔截了這些檔案。在 Windows 中搜尋「智慧型應用程式控制」,或開啟「Windows 安全性 → 應用程式與瀏覽器控制 → 智慧型應用程式控制設定」。", +"Smart App Control cannot make an exception for one program. FreeVideo can run only if it is turned off: search Windows for \"Smart App Control\" and open its settings.": "智慧型應用程式控制不能為單個程式設定例外。只有關閉它,FreeVideo 才能執行:在 Windows 搜尋中輸入「智慧型應用程式控制」,開啟它的設定。", +"Smart App Control in Windows blocked files that FreeVideo needs, so FreeVideo cannot run on this computer.": "Windows 的「智慧型應用程式控制」攔截了 FreeVideo 需要的檔案,FreeVideo 無法在這台電腦上執行。", "Smart App Control in Windows stopped it": "Windows 的「智慧型應用程式控制」阻止了寫入", "Smart App Control in Windows stopped setup from writing a file.": "Windows 的「智慧型應用程式控制」阻止了安裝程式寫入檔案。", "Smart App Control in Windows stopped the downloaded launcher. This version of FreeVideo keeps working.": "Windows 的「智慧型應用程式控制」阻止了下載的啟動器。目前版本的 FreeVideo 照常可用。", @@ -5719,6 +5730,7 @@ "There is not enough free graphics or system memory for this image": "可用顯示卡記憶體或記憶體不足,無法生成這張圖片", "There is not enough free memory to continue installing": "可用記憶體不足,無法繼續安裝", "There must be a clip under the playhead. A part that is still being generated can be saved once it is done.": "播放頭下方須有片段;正在生成的一段完成後才能儲存。", +"These changes have not been saved and are only in this page. Keep the page open until they are saved; closing it now would lose them.": "這些變更還沒有儲存,只在目前頁面裡。請保持頁面開啟,直到儲存完成;現在關閉會遺失這些變更。", "These creations cannot be downloaded.": "這些作品無法下載。", "These creations cannot be read.": "無法讀取這些作品。", "These files are downloaded or reused. Closing Settings does not stop the installation.": "將下載或重複使用以下檔案。關閉設定不會中斷安裝。", @@ -5841,6 +5853,7 @@ "This node is disabled or no longer in the workflow.": "該節點已停用或已從工作流程移除。", "This page": "本頁面", "This page was opened on port {opened}, but FreeVideo runs on port {port}. The two must match: open {address}. If you reach FreeVideo through port forwarding or a tunnel, use {port} as the local port as well. Then retry.": "這個頁面經連接埠 {opened} 開啟,但 FreeVideo 在連接埠 {port} 上執行,兩者需要一致。請開啟 {address};如果經連接埠轉送或通道存取,請把本機連接埠也設為 {port}。然後重試。", +"This page's connection to FreeVideo has expired, so the change was not saved. Reload the page and repeat the action.": "這個頁面與 FreeVideo 的連線已過期,變更沒有儲存。重新整理頁面後再操作一次。", "This part changed during dubbing, so the new voice was not placed. Redub it.": "這一段在配音期間有變更,新聲未放入。請重新配音。", "This part could not be generated. Continue from this part; if it fails again, send a report.": "這一段未能生成。請從這段繼續;如果再次失敗,請傳送診斷報告。", "This part has no audio": "這一段沒有聲音", @@ -5900,7 +5913,6 @@ "This workflow uses nodes that FreeVideo cannot read. Open it in Nodes.": "這個工作流用到了 FreeVideo 無法讀取的節點,請在節點檢視中開啟。", "Three steps around Create or Edit": "三步認識創作面板或剪輯檢視", "Three steps around the screen": "三步認識介面", -"Three-quarter": "四分之三", "Thumbnails and durations could not be loaded. Try again; if it still fails, choose \"Report a problem\".": "作品的縮圖和時長未能載入。請重試;仍然失敗時,請點選「提交問題」。", "Thumbnails only, a larger picture": "只留縮圖,畫面更大", "Tick \"I accept the installation plan and model / toolkit licenses.\" and choose \"Confirm & continue\".": "勾選「我同意安裝計畫及模型/工具套件授權條款。」,點一下「確認並繼續」。", @@ -5942,6 +5954,8 @@ "Tolerance": "容差", "Too many attempts. Try again in {count} s.": "嘗試次數過多,請 {count} 秒後再試。", "Too many attempts. Try again in {minutes} min.": "嘗試次數過多,請 {minutes} 分鐘後再試。", +"Too many creations for one download. Download them in smaller groups.": "一次下載的作品太多,請分幾次下載。", +"Too many files to check in a model folder": "模型資料夾中的檔案太多,無法檢查", "Took": "用時", "Took too long. Try again.": "生成提示詞逾時,請重試。", "Tools that do not fit in the bar": "顯示工具列放不下的工具", @@ -6017,6 +6031,7 @@ "Turn this part upside down": "上下翻轉這段畫面", "Turn this preview into the final video": "把預覽做成全解析度成片", "Turn this preview part into the full-resolution video, in place": "把這段預覽原地做成全解析度成片", +"Turning it off lowers Windows' protection against unknown programs. On some versions of Windows, it can be turned on again only by resetting Windows.": "關閉後,Windows 對未知程式的防護會降低;在部分 Windows 版本上,關閉後只有重置 Windows 才能重新開啟。", "Tutorial": "教學", "Tutorials": "教學", "Two friends sit by a café window at dusk. She says: \"You came back.\" He smiles: \"I promised.\" Warm light, quiet street sounds.": "黃昏,兩位朋友坐在咖啡館窗邊。她說:「你回來了。」他笑著說:「我答應過。」暖色光,安靜的街道聲。", @@ -6361,6 +6376,7 @@ "When it shows \"Assistant connected\" or the assistant's name, describe the video under \"Tell the assistant…\", for example \"Make a 1-minute vertical short film: a day in a coffee shop\".": "狀態顯示「助手已連線」或所連助手的名字後,在「對助手說…」中描述想做的影片,例如「做一部 1 分鐘的直式短片:咖啡店的一天」。", "When model files are incomplete or changed, import the same offline packages again in the launcher; only the files with problems are completed or replaced.": "模型檔案不完整或被修改時,在啟動器裡把同一份離線安裝包再匯入一次,只補齊和替換有問題的檔案。", "When off, nothing takes VRAM before a generation; models already used stay loaded for the next one.": "關閉後不會在生成前主動佔用顯示卡記憶體;用過的模型仍會保留,改提示詞繼續生成不受影響。", +"When off, nothing takes unified memory before a generation; models already used stay loaded for the next one.": "關閉後不會在生成前主動佔用統一記憶體;用過的模型仍會保留,改提示詞繼續生成不受影響。", "When on, other devices on the same network can open FreeVideo with the link below and enter the password the first time.": "開啟後,同一網路中的其他裝置可以用下面的連結開啟 FreeVideo,第一次開啟時要輸入密碼。", "When on, other devices on the same network can open FreeVideo with the link below. Anyone with the link can use it, so keep it private.": "開啟後,同一網路中的其他裝置可以用下面的連結開啟 FreeVideo。拿到連結的人都能使用,請勿公開。", "When something goes wrong": "出錯了怎麼辦", @@ -6688,6 +6704,7 @@ "video model": "影片模型", "wide shot": "遠景", "with prompt": "含提示詞", +"yesterday at {time}": "昨天 {time}", "your Python mirror": "自訂 Python 鏡像", "your configured source": "自訂來源", "zoom in": "變焦推近", @@ -6736,6 +6753,7 @@ "{count} tasks, {active} under way": "{count} 個任務,{active} 個進行中", "{count} videos from this task": "同一任務的 {count} 個影片", "{count} voiceovers": "{count} 段配音", +"{date} at {time}": "{date} {time}", "{done} / {total} files": "{done} / {total} 個檔案", "{done} / {total} frames": "{done} / {total} 影格", "{done} / {total} layers": "{done} / {total} 層", diff --git a/web/media_upload.js b/web/media_upload.js index 171baa44..fbd1315d 100644 --- a/web/media_upload.js +++ b/web/media_upload.js @@ -6,10 +6,14 @@ const text = translator(cn); const uploadRunning = active => { try { globalThis.dispatchEvent?.(new CustomEvent('freevideo-upload', {detail: {active}})); } catch { /* no page */ } }; // The server's limit; a bigger file is turned away before a byte is sent. export const MAX_UPLOAD_BYTES = 2 * 1024 ** 3; -const failures = () => ({ +// name: the user's own name for the file, so a refused one says which file it was and why. +const failures = (name = '') => ({ too_large: text('This file is over 2 GiB. Trim or compress it, then try again.', '文件超过 2 GiB,请先剪短或压缩后再上传。'), empty: text('This file is empty. Choose another file.', '这个文件是空的,请换一个文件。'), - unsupported: text('Choose an image, video or audio file', '请选择图片、视频或音频文件'), + // A file with no name of its own (a Blob) cannot be named: the plain request for a kind it takes. + unsupported: name ? text('FreeVideo cannot use "{name}": this file type is not supported. Use a PNG, JPEG or WebP image, an MP4, MOV or WebM video, or WAV or MP3 audio.', + '无法使用“{name}”:不支持这种文件类型。请改用 PNG、JPEG 或 WebP 图片,MP4、MOV 或 WebM 视频,或 WAV 或 MP3 音频。', {name}) + : text('Choose an image, video or audio file', '请选择图片、视频或音频文件'), multiple: text('Upload one file at a time.', '一次只能上传一个文件。'), invalid: text('This file name cannot be used. Rename the file and try again.', '这个文件名不能使用,请改名后再试。'), disk_full: text('The upload stopped: the disk is full. Free some space, then try again.', '上传中断:磁盘空间不足,请清理出空间后重试。'), @@ -23,6 +27,8 @@ function sendWithProgress(api, body, onProgress, timeoutMs) { return new Promise((resolve, reject) => { const xhr = new XMLHttpRequest(); xhr.open('POST', api.apiURL('/freevideo/media/upload'), true); + const proof = globalThis.__freevideoProof?.(); // through the sign-in proxy (web/proxy_proof.js) + if (proof) xhr.setRequestHeader('X-FreeVideo-CSRF', proof); xhr.setRequestHeader('Comfy-User', api.user ?? ''); xhr.timeout = timeoutMs; xhr.upload.onprogress = event => { if (event.lengthComputable && event.total > 0) onProgress(Math.min(1, event.loaded / event.total)); }; @@ -38,11 +44,61 @@ function sendWithProgress(api, body, onProgress, timeoutMs) { // What a media item is called on screen: its card's name, the name the user's file had (kept with the item, since an // engine that stores one copy per content gives the file a plain name), or the stored file's own name. export const mediaName = row => row?.cast?.name || row?.name || String(row?.source || row?.file || '').split('/').pop(); +// The engine knows a file's kind by its name's extension (comfy_assets.EXTENSIONS). A file whose name has none of those +// but whose type says what it is (a JPEG saved as .jfif, a picture dragged from a web page with no extension) goes +// under its name with the extension of its type; any other file goes as it is. +const KNOWN = /\.(png|jpe?g|webp|bmp|tiff?|mp4|mov|webm|mkv|m4v|wav|mp3|flac|ogg|m4a|aac|opus)$/i; +const EXTENSION_OF = {'image/jpeg': '.jpg', 'image/pjpeg': '.jpg', 'image/png': '.png', 'image/webp': '.webp', 'image/bmp': '.bmp', + 'image/tiff': '.tif', 'video/mp4': '.mp4', 'video/quicktime': '.mov', 'video/webm': '.webm', 'video/x-matroska': '.mkv', + 'video/x-m4v': '.m4v', 'audio/wav': '.wav', 'audio/x-wav': '.wav', 'audio/wave': '.wav', 'audio/mpeg': '.mp3', 'audio/flac': '.flac', + 'audio/x-flac': '.flac', 'audio/ogg': '.ogg', 'audio/mp4': '.m4a', 'audio/x-m4a': '.m4a', 'audio/aac': '.aac', 'audio/opus': '.opus'}; +// A file's name as a sentence shows it: a long one cut in the middle to about `most` characters, its extension kept +// (IMG_20261130…sheet.gif), so the reason after it is read too; the whole name goes to screen readers (error.spoken). +export function shortFileName(name, most = 24) { + const chars = Array.from(String(name ?? '')); + if (chars.length <= most) return chars.join(''); + const extension = Array.from(/\.[^.\s]{1,8}$/.exec(chars.join(''))?.[0] ?? ''); + const tail = Math.max(9, extension.length + 4), head = Math.max(1, most - 3 - tail); + return chars.slice(0, head).join('') + '…' + chars.slice(-tail).join(''); +} +// The refused file's name as a message shows it (Lane): cut short, and held on one line with the quote marks around it +// (and the spaces inside French guillemets) in an inline-block span that does not wrap, so a line never breaks inside +// the name. The text node of `element` holding the name is split around it. Returns the span, or null. +const QUOTES = /["'\u2018\u2019\u201c\u201d\u201e\u00ab\u00bb\u300c\u300d\u00a0\u202f]/; +export function holdFileName(element, name) { + const short = shortFileName(name), doc = element?.ownerDocument; + if (!short || !doc) return null; + const walker = doc.createTreeWalker(element, 4); + for (let node = walker.nextNode(); node; node = walker.nextNode()) { + const at = node.data.indexOf(short); + if (at < 0) continue; + let start = at, end = at + short.length; + while (start > 0 && QUOTES.test(node.data[start - 1])) start--; + while (end < node.data.length && QUOTES.test(node.data[end])) end++; + const held = node.splitText(start); + held.splitText(end - start); + const span = doc.createElement('span'); + span.className = 'fv-held-name'; span.style.display = 'inline-block'; span.style.whiteSpace = 'nowrap'; + span.textContent = held.data; + held.replaceWith(span); + return span; + } + return null; +} +export function uploadFile(file) { + const name = typeof file?.name === 'string' ? file.name : ''; + const extension = EXTENSION_OF[String(file?.type || '').toLowerCase()]; + if (KNOWN.test(name) || !extension || typeof File !== 'function' || !(file instanceof Blob)) return file; + // Only a last part that looks like an extension (1 to 5 letters or digits, at least one a letter: .jfif, .jpe) is + // replaced; any other name ("Screenshot 2024.11.30", "images") keeps all of itself and gains the extension. + const stem = name.replace(/\.(?=[^.]*[A-Za-z])[A-Za-z0-9]{1,5}$/, '') || 'file'; + return new File([file], stem + extension, {type: file.type, lastModified: file.lastModified}); +} export async function uploadMedia(api, file, {onProgress = null, timeoutMs = uploadTimeoutMs(file.size)} = {}) { - const found = failures(); + const name = typeof file?.name === 'string' ? file.name : '', found = failures(shortFileName(name)); if (file.size > MAX_UPLOAD_BYTES) throw new Error(found.too_large); if (file.size === 0) throw new Error(found.empty); - const body = new FormData(); body.append('file', file); + const body = new FormData(); body.append('file', uploadFile(file)); let response, result = {}; const abort = new AbortController(), timer = setTimeout(() => abort.abort(), timeoutMs); uploadRunning(true); @@ -53,6 +109,14 @@ export async function uploadMedia(api, file, {onProgress = null, timeoutMs = upl result = await response.json(); } catch { if (!response || response.ok) throw new Error(generic()); } finally { clearTimeout(timer); uploadRunning(false); } - if (!response.ok) throw Object.assign(new Error(found[result?.code] || generic()), {code: typeof result?.code === 'string' ? result.code : undefined}); + if (!response.ok) { + const code = typeof result?.code === 'string' ? result.code : undefined, error = new Error(found[code] || generic()); + // The refusal names the file cut short (holdFileName keeps it on one line); screen readers get the sentence with the whole name. + if (code === 'unsupported' && name) { + error.fileName = name; + if (shortFileName(name) !== name) error.spoken = failures(name).unsupported; + } + throw Object.assign(error, {code}); + } return result; } diff --git a/web/notifications.css b/web/notifications.css index 795b5ab6..e3eab724 100644 --- a/web/notifications.css +++ b/web/notifications.css @@ -132,6 +132,8 @@ flex: 1 1 calc(100% - 16px - 2 * var(--fv-sp-8, 8px)); white-space: normal; overflow-wrap: break-word; text-overflow: clip; line-height: 18px; } .fv-toast.is-stacked .fv-toast-msg + * { margin-left: auto; } +/* The icon stands on the middle of the first line of words, not of the whole block (its box is one line high). */ +.fv-toast.is-stacked .fv-toast-ic { align-self: flex-start; height: 18px; } .fv-toast.is-stacked .fv-toast-name { display: inline-flex; max-width: 100%; border-radius: var(--fv-r-xs, 4px); } .fv-toast.is-stacked .fv-toast-name-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .fv-toast.is-stacked .fv-toast-mark { flex: none; white-space: nowrap; } diff --git a/web/notifications.js b/web/notifications.js index 05bf0b7e..16d3ae0b 100644 --- a/web/notifications.js +++ b/web/notifications.js @@ -5,6 +5,7 @@ // The list is kept in this browser (freevideo.notifications, 50 rows, a week). Also here: toast(), one short line // at the bottom of the window for things the command layer has to say. import { cutTip } from './cut_tip.js'; +import { holdShortWordsIn } from './i18n.js'; import { setTip } from './tip_words.js'; import { t, words, CN, glyph, floatingHost, reducedMotion, EASE, addSheet, openContextMenu } from './context_menu.js'; import { jobs, ACTIVE, FINAL } from './task_store.js'; @@ -553,6 +554,7 @@ function buildToast(item, more) { msg.replaceChildren(spec.text.slice(0, at), piece, spec.text.slice(at + whole.length)); cutTip(piece, name, inner); } + holdShortWordsIn(msg); if (spec.detail) { const small = document.createElement('small'); small.textContent = spec.detail; msg.append(small); } cutTip(msg, [spec.text, spec.detail].filter(Boolean).join(' · ')); box.append(msg); @@ -606,7 +608,8 @@ function showToast(item, more) { if (!reducedMotion() && next.animate) next.animate([{opacity: 0, transform: 'scaleX(.6)'}, {opacity: 1, transform: 'none'}], {duration: 200, easing: EASE}); runTimer(item); toastResized(); - if (item.spec.tone === 'fail') store().add({id: `toast:${Date.now()}`, type: 'toast', status: 'failed', title: item.spec.text, reason: item.spec.detail, at: Date.now()}); + // A failure's row says its next step when the toast gives one (keep.sub), even where the row cuts its title short. + if (item.spec.tone === 'fail') store().add({id: `toast:${Date.now()}`, type: 'toast', status: 'failed', title: item.spec.text, reason: item.spec.keep?.sub || item.spec.detail, at: Date.now()}); else if (item.spec.keep) store().add({id: item.spec.keep.id || `toast:${Date.now()}`, type: 'toast', status: 'notice', title: item.spec.keep.title || item.spec.text, reason: item.spec.keep.sub || item.spec.detail || (item.spec.action ? words(item.spec.action.label) : ''), setup: item.spec.keep.setup || null, at: Date.now()}); } // A message that does not fit on one line beside its controls, at any width, takes its own row (notifications.css, diff --git a/web/output_download.js b/web/output_download.js index f371dbc8..d33707b4 100644 --- a/web/output_download.js +++ b/web/output_download.js @@ -41,9 +41,20 @@ export function zipItems(rows) { } return items; } +// One form's encoded size, at most: well under what the sign-in proxy reads of a form (access_proxy.FORM_PROOF_BYTES), +// so long names (each Chinese character is 9 bytes in a form) split into more zips instead of failing unseen. +export const ZIP_FORM_BYTES = 1 << 20; +const formBytes = value => encodeURIComponent(JSON.stringify(value)).length; export function zipPayloads(rows, workflow = exportKeepsWorkflow()) { - const items = zipItems(rows), payloads = []; - for (let at = 0; at < items.length; at += ZIP_LIMIT) payloads.push({items: items.slice(at, at + ZIP_LIMIT), workflow: Boolean(workflow)}); + const items = zipItems(rows), payloads = [], room = ZIP_FORM_BYTES - 512; // the field names, the flag and the proof + let current = null, size = 0; + for (const item of items) { + const bytes = formBytes(item) + 3; // and its comma + if (!current || current.items.length >= ZIP_LIMIT || size + bytes > room) { + current = {items: [], workflow: Boolean(workflow)}; payloads.push(current); size = formBytes(current); + } + current.items.push(item); size += bytes; + } return payloads; } // What each request can pack right now, asked before the form is posted (the answer to a form lands in a hidden frame, @@ -61,21 +72,36 @@ export async function checkZips(api, payloads) { return answers; } let zipFrames = 0; -export function postZip(api, payload, {doc = document, keep = 600000} = {}) { +// A form's answer that is not the file lands in its hidden frame (a file is saved and leaves the frame as it was): +// onFailure(code) hears it, with the error code it names (page_session_required, request_too_large) or ''. +export function postZip(api, payload, {doc = document, keep = 600000, onFailure = null} = {}) { const name = `fv-zip-${Date.now().toString(36)}-${++zipFrames}`; const frame = doc.createElement('iframe'); frame.name = name; frame.hidden = true; frame.setAttribute('aria-hidden', 'true'); frame.tabIndex = -1; const form = doc.createElement('form'); form.method = 'post'; form.action = api.apiURL('/freevideo/library/download-zip'); form.target = name; form.hidden = true; const field = doc.createElement('input'); field.type = 'hidden'; field.name = 'payload'; field.value = JSON.stringify(payload); - form.append(field); doc.body.append(frame, form); + form.append(field); + // A form sends no header: through the sign-in proxy it carries this device's proof as a field (web/proxy_proof.js), + // never in its address. + const proof = globalThis.__freevideoProof?.(); + if (proof) { const proved = doc.createElement('input'); proved.type = 'hidden'; proved.name = 'fv_csrf'; proved.value = proof; form.append(proved); } + frame.addEventListener('load', () => { + let page = null; + try { page = frame.contentDocument; } catch { /* not this page's: nothing to read */ } + if (!page || page.location?.href === 'about:blank') return; + let code = ''; + try { code = JSON.parse(page.body?.textContent || '')?.error?.code || ''; } catch { /* not an answer of ours */ } + onFailure?.(typeof code === 'string' ? code : ''); + }); + doc.body.append(frame, form); form.submit(); form.remove(); // The frame stays while the browser takes the file, then goes. setTimeout(() => frame.remove(), keep); } // Sends every payload, about a second apart; resolves when the last one is submitted. -export async function postZips(api, payloads, {doc = document, wait = ms => new Promise(resolve => setTimeout(resolve, ms)), gap = 1000, alive = () => true, keep} = {}) { +export async function postZips(api, payloads, {doc = document, wait = ms => new Promise(resolve => setTimeout(resolve, ms)), gap = 1000, alive = () => true, keep, onFailure = null} = {}) { for (let at = 0; at < payloads.length; at++) { if (at) { await wait(gap); if (!alive()) return; } - postZip(api, payloads[at], keep === undefined ? {doc} : {doc, keep}); + postZip(api, payloads[at], keep === undefined ? {doc, onFailure} : {doc, keep, onFailure}); } } diff --git a/web/panel_shell.css b/web/panel_shell.css index 68b75b05..b69f2213 100644 --- a/web/panel_shell.css +++ b/web/panel_shell.css @@ -83,7 +83,16 @@ .fv-body[data-cols="3"] .fvs-console-prompt{background:none;border:0;padding:0;margin:0} .fv-body[data-cols="3"] .fvs-console-prompt .fv-section{margin:0;padding:0;border:0;background:none} .fv-studio.fv-create .fv-body[data-cols="3"] .fv-sc-tools{flex-wrap:wrap;height:auto;min-height:28px;row-gap:4px;gap:2px} -.fv-body[data-cols="3"] .fv-sc-section .fv-enhance-bar{flex:1 0 100%;min-height:36px;padding:0;border:0} +/* The rewrite keys (Cancel, rewrite again) stand in the key row's free space at the chips' height, so the row keeps its one line + while a rewrite starts, runs and ends; a row with too little room wraps as a whole. */ +.fv-body[data-cols="3"] .fv-sc-section .fv-enhance-bar{flex:0 0 auto;min-height:0;height:28px;padding:0;border:0;gap:2px} +/* Too long even as icons (the two versions' names in a narrow column): the bar takes its own line, under the keys and Expand. */ +.fv-body[data-cols="3"] .fv-sc-tools[data-wrap=true]>.fv-enhance-bar{order:1;flex-basis:100%} +/* The rewrite's line stands right under the key row, by the key it is about, with what the console's status slot gave it: small + muted text, the danger tint for an error, room to wrap. */ +.fv-body[data-cols="3"] .fv-sc-section .fv-enhance-status{margin:var(--fv-sp-4) 0 0;padding:0;border:0;background:none;font-size:var(--fv-fs-1);line-height:20px;color:var(--fv-fg3);white-space:normal;text-wrap:pretty} +.fv-body[data-cols="3"] .fv-sc-section .fv-enhance-status[data-state=error]{color:var(--fv-danger);background:color-mix(in srgb,var(--fv-danger) 7%,transparent);border-radius:var(--fv-r-sm,8px);padding:var(--fv-sp-4) var(--fv-sp-8)} +.fv-body[data-cols="3"] .fv-sc-section .fv-enhance-status .fv-issue-button{margin:var(--fv-sp-4) 0 0;min-height:24px;padding:0 var(--fv-sp-8)} .fv-body[data-cols="3"] .fv-sc-section .fv-iv-sec-inner>:is(.fvp-chip,.fvs-stepper){width:100%;justify-content:flex-start;box-sizing:border-box} /* quality: the four names as one segmented row, in place of the slider */ .fv-body[data-cols="3"] .fv-effort-heading>span:first-child{display:none} @@ -94,7 +103,9 @@ /* the slider rail is not seen here (sampling_effort.js also takes it out of the tab order and the reader's tree): the four names are the control, a radio group the arrows move through */ .fv-body[data-cols="3"] .fv-effort{position:relative} .fv-body[data-cols="3"] .fv-effort-rail{position:absolute;left:0;top:0;width:1px;height:1px;overflow:hidden;opacity:0;pointer-events:none} -.fv-body[data-cols="3"] .fv-effort-names{height:auto;margin:0;display:grid;grid-template-columns:repeat(4,1fr);gap:2px;padding:2px;border-radius:var(--fv-r-md,10px);background:var(--fv-ctl-bg,rgb(var(--fv-tint) / .06))} +/* The strip is the second-pass switch's track (studio.css .fv-pass-mode): its ground and its line, so the level in use + stands out from it as the chosen half of the switch does. */ +.fv-body[data-cols="3"] .fv-effort-names{height:auto;margin:0;display:grid;grid-template-columns:repeat(4,1fr);gap:2px;padding:2px;border:1px solid var(--fv-border);border-radius:var(--fv-r-md,10px);background:var(--fv-bg)} /* With the Fast level listed (sampling_effort.js data-fast) the strip has five levels, one row of five. */ .fv-body[data-cols="3"] .fv-effort-names[data-fast]{grid-template-columns:repeat(5,1fr)} /* The level's line under the strip, in the Quality section of the three-column create panel: a quiet note at @@ -106,8 +117,23 @@ .fv-studio.fv-create .fv-body[data-cols="3"] .fv-sc-section .fvp-level-use:empty::before{content:"\200b"} /* A video made in parts at the Fast level: the line says each part uses Light, in the warning's colour (studio.js sayLevel). */ .fv-studio.fv-create .fv-body[data-cols="3"] .fv-sc-section .fvp-level-use[data-tone=warning]{color:var(--fv-warning)} -.fv-studio .fv-body[data-cols="3"] .fv-effort .fv-effort-name{position:static;transform:none;height:28px;min-width:0;padding:0 2px;border-radius:var(--fv-r-sm,8px);font-size:var(--fv-fs-1,12px);line-height:28px;text-align:center;overflow:hidden;text-overflow:ellipsis} -.fv-studio .fv-body[data-cols="3"] .fv-effort .fv-effort-name[data-active]{background:var(--fv-ctl-hover,rgb(var(--fv-tint) / .14));color:var(--fv-fg,inherit)} +/* A level that can be chosen is in the text colour, as ready to press as the one in use; under the pointer its cell is one + step lighter, halfway from the track to the level in use and never as marked as it, in either theme. The level in use looks as the chosen half of the second-pass switch does (studio.css .fv-pass-mode): a + raised cell, the text colour, semibold. Only a level that cannot be chosen is grey (a level this + installation cannot use, or every level while the panel cannot change the quality), and its hover card says why. */ +.fv-studio .fv-body[data-cols="3"] .fv-effort .fv-effort-name{position:static;transform:none;height:28px;min-width:0;padding:0 2px;border-radius:var(--fv-r-sm,8px);color:var(--fv-ink,inherit);font-size:var(--fv-fs-1,12px);line-height:28px;text-align:center;overflow:hidden;text-overflow:ellipsis;transition:background-color var(--fv-dur-1,160ms) var(--fv-ease-out,ease-out),color var(--fv-dur-1,160ms) var(--fv-ease-out,ease-out)} +.fv-studio .fv-body[data-cols="3"] .fv-effort .fv-effort-name:hover{background:color-mix(in srgb,var(--fv-raised) 50%,var(--fv-bg))} +.fv-studio .fv-body[data-cols="3"] .fv-effort .fv-effort-name[data-active]{background:var(--fv-raised);color:var(--fv-ink,inherit);font-weight:var(--fv-semibold,600)} +.fv-studio .fv-body[data-cols="3"] .fv-effort .fv-effort-name:is([data-unavailable],:disabled):not([data-active]){background:none;color:var(--fv-muted)} +/* Light: the raised ground is almost the track's own, so in both controls the chosen cell is white with a 1 px line + (a border, not a shadow: glass/polish.css takes the switch's shadows away), on a track one step darker; white on this + track is 1.34:1, as the chosen cell on the track in dark. A hovered cell stays halfway between the two. The cells keep + a clear border of the same width, so nothing moves when the choice does. */ +.fv-studio .fv-body[data-cols="3"] .fv-effort .fv-effort-name{box-sizing:border-box;border:1px solid transparent;line-height:26px} +:root[data-theme=light] .fv-studio .fv-body[data-cols="3"] :is(.fv-effort-names,.fv-pass-mode){background:#dcdfe4} +:root[data-theme=light] .fv-studio .fv-body[data-cols="3"] :is(.fv-effort .fv-effort-name[data-active],.fv-pass-mode button[aria-checked=true]){background:#fff;border-color:var(--fv-border)} +:root[data-theme=light] .fv-studio .fv-body[data-cols="3"] .fv-effort .fv-effort-name:not([data-active]):hover{background:color-mix(in srgb,#fff 50%,#dcdfe4)} +:root[data-theme=light] .fv-studio .fv-body[data-cols="3"] .fv-effort .fv-effort-name:is([data-unavailable],:disabled):not([data-active]):hover{background:none} /* second pass: three equal segments */ .fv-body[data-cols="3"] .fv-pass-mode{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;width:100%;box-sizing:border-box} .fv-body[data-cols="3"] .fv-pass-mode button{min-width:0;padding:0 2px;overflow:hidden;text-overflow:ellipsis} diff --git a/web/private_settings.js b/web/private_settings.js index dd7b980e..fd20f2f3 100644 --- a/web/private_settings.js +++ b/web/private_settings.js @@ -112,6 +112,7 @@ export function privacySettings(t, api) { if (!items.length) { nothingOld(true); return; } for (const item of items) { const cell = el('figure', 'st-private-cell'), image = el('img'), caption = el('figcaption', '', item.name); + caption.dataset.fvPlain = ''; // the file's own name image.src = view(item.name); image.alt = ''; image.loading = 'lazy'; cutTip(caption, item.name); const remove = button(t('Delete', '删除')); confirming(remove, t('Delete', '删除'), t('Confirm', '确认删除'), async () => { diff --git a/web/prompt_enhance.js b/web/prompt_enhance.js index 683fd363..bdd1fa7b 100644 --- a/web/prompt_enhance.js +++ b/web/prompt_enhance.js @@ -201,6 +201,7 @@ export function createPromptEnhancer({node, input, editor, api, context, setText meter.append(fill); status.append(statusText, meter, report, undoKey); // One place sets what the status line says and how it looks. function show(text, state = '', fraction = null, quote = text, offerReport = true) { + staleShown = false; // anything said next replaces the notice about an outdated rewrite if (downloadOnly) { publishModel({text: text || ''}); return; } busyNoteShown = false; wordsShown = false; delete status.dataset.words; @@ -242,7 +243,7 @@ export function createPromptEnhancer({node, input, editor, api, context, setText const actions = el('div', null, 'fv-enhance-install-actions'); actions.append(agree, decline, license); install.append(detail, actions); bar.append(label, tabs, redo, cancel); element.append(bar, editor || input, status, install); - let disposed = false, token = '', job = '', running = null, consent = null, cancelling = false, waiting = false, replacing = false; + let disposed = false, token = '', job = '', running = null, consent = null, cancelling = false, waiting = false, replacing = false, staleShown = false; let retryWait = null; // A task the page cannot see (another workflow, another window) made the server answer busy: the key waits a while. const SERVER_BUSY_MS = 15000, BLOCKED_NOTE_MS = 3000; @@ -330,7 +331,7 @@ export function createPromptEnhancer({node, input, editor, api, context, setText // The message says only how far over the limit the request is; the token counts go to the feedback form. const contextNumbers = error => ({ percent: String(Math.max(1, Math.ceil((error.context.input_tokens - error.context.input_limit) / error.context.input_limit * 100))) }); // Errors whose cause is known and that the user can fix in the prompt offer no "Report a problem". - const ownFix = error => ['invalid_prompt', 'too_many_images', 'busy'].includes(error?.message) || (error?.message === 'context_length' && Boolean(error?.context)); + const ownFix = error => ['invalid_prompt', 'too_many_images', 'busy', 'stale'].includes(error?.message) || (error?.message === 'context_length' && Boolean(error?.context)); const gib = value => String(Math.round(value / 2 ** 30)); // Mentions are counted as the character descriptions they expand to, so the count can exceed what the box shows. const tooLong = error => ({ number: error.characters.toLocaleString('en-US') }); @@ -456,6 +457,7 @@ export function createPromptEnhancer({node, input, editor, api, context, setText } if (!undoKey.hidden) show(''); if (waiting) { waiting = false; show(''); } + if (staleShown) { staleShown = false; show(''); } versions.edit(input.value, replacing || !input.value.trim()); replacing = false; save(); render(); } const replace = () => { replacing = input.value.length > 0 && input.selectionStart === 0 && input.selectionEnd === input.value.length; }; @@ -643,12 +645,15 @@ export function createPromptEnhancer({node, input, editor, api, context, setText apply(); show(added.length ? addedText(added) : '', added.length ? 'note' : '', null, undefined, false); }; running = Promise.resolve().then(execute).catch(error => { - // Only a failure the user can act on is said; a cancel or a rewrite outdated by an edit says nothing. - // A running task is no failure: the line says when the rewrite is available, and the key waits until then. + // A cancel says nothing. A rewrite the user's own edit outdated is not used, and the line says so (until the + // next edit or rewrite), so nobody waits for it. A running task is no failure: the line says when the rewrite + // is available and goes by itself once nothing holds, and the key waits until then. Other failures are said as errors. if (error?.message === 'busy') heldBack(); - if (!disposed) show(['cancelled', 'stale'].includes(error?.message) ? '' : errorText(error), error?.message === 'busy' ? 'note' : 'error', null, + const outdated = error?.message === 'stale'; + if (!disposed) show(error?.message === 'cancelled' ? '' : errorText(error), outdated || error?.message === 'busy' ? 'note' : 'error', null, errorText({name: error?.name, message: error?.message, ramBytes: error?.ramBytes, characters: error?.characters, expanded: error?.expanded}), !ownFix(error)); if (error?.message === 'busy') busyNoteShown = true; + if (!disposed && outdated) staleShown = true; throw error; }).finally(() => { running = null; cancelling = false; install.hidden = true; render(); }); render(); diff --git a/web/prompt_library.js b/web/prompt_library.js index 6d6c7ce5..c17ba2a4 100644 --- a/web/prompt_library.js +++ b/web/prompt_library.js @@ -4,6 +4,8 @@ // prompt and seed value when asked); files are never stored, only names, and a missing LoRA is named when applied. import { fieldNote } from './field_note.js'; import {privacyOffered} from './private_offers.js'; +// Through the sign-in proxy a change carries this device's proof (web/proxy_proof.js); nothing on this computer. +const proofHeader = () => { const proof = globalThis.__freevideoProof?.(); return proof ? {'X-FreeVideo-CSRF': proof} : {}; }; export const HISTORY_KEY = 'freevideo.prompts.history', PRESET_KEY = 'freevideo.prompts.presets'; export const HISTORY_MAX = 60, PRESET_MAX = 30; @@ -35,7 +37,7 @@ export async function forgetDeletedPrompts({storage, fetchImpl = (...args) => gl if (!texts.length || !(await offered())) return 0; let answer; try { - const response = await fetchImpl('/freevideo/private/forgotten', {method: 'POST', cache: 'no-store', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({prompts: texts})}); + const response = await fetchImpl('/freevideo/private/forgotten', {method: 'POST', cache: 'no-store', headers: {'Content-Type': 'application/json', ...proofHeader()}, body: JSON.stringify({prompts: texts})}); if (!response?.ok) return 0; answer = await response.json(); } catch { return 0; } diff --git a/web/proxy_proof.js b/web/proxy_proof.js new file mode 100644 index 00000000..39783705 --- /dev/null +++ b/web/proxy_proof.js @@ -0,0 +1,72 @@ +// A page opened through the sign-in proxy proves each change it makes: the proxy hands the signed-in page its device's +// proof in the freevideo_proof cookie (readable by this page only), and a change sends it back as X-FreeVideo-CSRF, or, +// for a form post, as its fv_csrf field (never in an address). A page opened on this computer directly has no such cookie, and nothing +// is added to its requests. +const COOKIE = /(?:^|;\s*)freevideo_proof=([0-9a-f]{64})(?:;|$)/; +export const PROOF_HEADER = 'X-FreeVideo-CSRF'; +export const PROOF_FIELD = 'fv_csrf'; +const UNSAFE = new Set(['POST', 'PUT', 'PATCH', 'DELETE']); +const unsafe = method => UNSAFE.has(String(method || 'GET').toUpperCase()); + +export function proof(doc = globalThis.document) { + try { return COOKIE.exec(doc?.cookie || '')?.[1] || ''; } catch { return ''; } +} + +// `headers` with the proof added for a change (a plain object; a Headers object or entries become one). +export function proofHeaders(method, headers = {}, doc) { + const value = unsafe(method) ? proof(doc) : ''; + if (!value) return headers; + const plain = typeof Headers === 'function' && headers instanceof Headers ? Object.fromEntries(headers.entries()) + : Array.isArray(headers) ? Object.fromEntries(headers) : {...headers}; + if (!Object.keys(plain).some(name => name.toLowerCase() === PROOF_HEADER.toLowerCase())) plain[PROOF_HEADER] = value; + return plain; +} + +// fetch options with the proof for a change. +export function withProof(init = {}, doc) { + if (!unsafe(init?.method) || !proof(doc)) return init; + return {...init, headers: proofHeaders(init.method, init.headers ?? {}, doc)}; +} + +// For XMLHttpRequest: call after open(). +export function proveRequest(xhr, method, doc) { + const value = unsafe(method) ? proof(doc) : ''; + if (value) xhr.setRequestHeader(PROOF_HEADER, value); +} + +// The page's proof no longer holds even after the change was sent again (the page's session ended): said once, as a +// failure with the way back. +let expiredSaid = false; +export async function sayProofExpired() { + if (expiredSaid) return; + expiredSaid = true; + try { + const [{toast}, {isChinese, translator}] = await Promise.all([import('./notifications.js'), import('./i18n.js')]); + const t = translator(isChinese()); + toast(t("This page's connection to FreeVideo has expired, so the change was not saved. Reload the page and repeat the action.", + '这个页面与 FreeVideo 的连接已过期,改动没有保存。刷新页面后再操作一次。'), + {tone: 'fail', action: {label: t('Reload page', '刷新页面'), run: () => globalThis.location?.reload()}, + keep: {sub: t('Reload the page and repeat the action', '刷新页面后再操作一次')}}); + } catch { /* not a page */ } +} + +// Every change ComfyUI's page and FreeVideo send through api.fetchApi carries the proof (when there is one). The sign-in +// proxy's own first script (access_proxy.PAGE_PROOF_SCRIPT) also proves every fetch and XMLHttpRequest and sends a change +// refused for an old proof once more; this covers a page where that script did not run. +export function installProof(api) { + if (!api || typeof api.fetchApi !== 'function' || api.fetchApi.freevideoProof) return; + const original = api.fetchApi.bind(api); + const proved = (route, options = {}) => original(route, unsafe(options?.method) ? withProof(options) : options); + proved.freevideoProof = true; + api.fetchApi = proved; +} + +// Installed as soon as this file loads (ComfyUI loads every FreeVideo file): ComfyUI's api proves its changes, and the +// few FreeVideo requests sent around api.fetchApi (an upload with progress, the download form) ask __freevideoProof. +try { + globalThis.__freevideoProof = () => proof(); + globalThis.__freevideoProofExpired = () => sayProofExpired(); + globalThis.addEventListener?.('freevideo-proof-expired', () => sayProofExpired()); + const comfy = globalThis.comfyAPI?.api?.api; + if (comfy) installProof(comfy); +} catch { /* not a page */ } diff --git a/web/settings_kit.js b/web/settings_kit.js index a3403fde..a531eb82 100644 --- a/web/settings_kit.js +++ b/web/settings_kit.js @@ -4,6 +4,7 @@ // and the assistant settings runs unchanged; the drawn face repaints whenever the native value changes, also when code // sets it. Styles: glass/settings.css (tokens from tokens.css). import { listenDialogKey } from './dialog_keys.js'; +import { keepShortWordsIn as keepWords } from './i18n.js'; export const ICONS = { trash: '', @@ -87,10 +88,12 @@ export function hookProp(node, prop, after) { // ── Rows and cards ── // A row: optional icon tile, a title with a line under it, and whatever sits at its end. -export function row({iconName = '', title = '', sub = '', end = [], cls = ''} = {}) { +// plain: the title is something the user named (a file), never changed for short words. +export function row({iconName = '', title = '', sub = '', end = [], cls = '', plain = false} = {}) { const node = el('div', `st-row${iconName ? ' has-ic' : ''}${cls ? ' ' + cls : ''}`); if (iconName) { const tile = el('span', 'st-ic'); tile.append(icon(iconName, 'fv-i s')); node.append(tile); } - const text = el('div', 'st-rt'), titleEl = el('b', '', title), subEl = el('span', '', sub); + const titleEl = el('b', '', title); if (plain) titleEl.dataset.fvPlain = ''; else keepWords(titleEl); + const text = el('div', 'st-rt'), subEl = keepWords(el('span', '', sub)); subEl.hidden = !sub; text.append(titleEl, subEl); const endEl = el('div', 'st-re'); endEl.append(...end); node.append(text, endEl); @@ -98,13 +101,13 @@ export function row({iconName = '', title = '', sub = '', end = [], cls = ''} = } export function card(...children) { const node = el('div', 'st-card'); node.append(...children.filter(Boolean)); return node; } export function groupHead(text, right = null) { - const node = el('h3', 'st-gh'); node.append(el('span', '', text)); + const node = el('h3', 'st-gh'); node.append(keepWords(el('span', '', text))); if (right) { right.classList.add('r'); node.append(right); } return node; } export function groupNote(text, iconName = 'info') { const node = el('p', 'st-gn'); if (iconName) node.append(icon(iconName, 'fv-i')); - node.append(document.createTextNode(text)); return node; + node.append(document.createTextNode(text)); return keepWords(node); } // A status line that is always there (its text changes, its height does not). export function slot(cls = '') { @@ -116,7 +119,7 @@ export function fold({iconName = '', title = '', sub = '', body = [], cls = ''} const details = el('details', `st-card st-fold${iconName ? '' : ' plain'}${cls ? ' ' + cls : ''}`); const summary = el('summary'); if (iconName) { const tile = el('span', 'st-ic'); tile.append(icon(iconName, 'fv-i s')); summary.append(tile); } - const text = el('div', 'st-rt'), titleEl = el('b', '', title), subEl = el('span', '', sub); subEl.hidden = !sub; + const text = el('div', 'st-rt'), titleEl = keepWords(el('b', '', title)), subEl = keepWords(el('span', '', sub)); subEl.hidden = !sub; text.append(titleEl, subEl); const end = el('div', 'st-re'); summary.append(text, end, icon('chev', 'fv-i chev')); @@ -194,7 +197,7 @@ export function radioList(select, {label = '', describe = () => ({})} = {}) { const rows = [...select.options].map(option => { const choice = el('button', 'st-src'); choice.type = 'button'; choice.setAttribute('role', 'radio'); choice.dataset.value = option.value; const mark = el('span', 'st-ra'); mark.setAttribute('aria-hidden', 'true'); - const text = el('span', 'st-rt'), name = el('b', '', option.textContent), sub = el('span', ''); + const text = el('span', 'st-rt'), name = keepWords(el('b', '', option.textContent)), sub = keepWords(el('span', '')); text.append(name, sub); const end = el('span', 'sp'); choice.append(mark, text, end); diff --git a/web/settings_room.js b/web/settings_room.js index 2cc7af52..64de6c3c 100644 --- a/web/settings_room.js +++ b/web/settings_room.js @@ -38,7 +38,7 @@ if (typeof document !== 'undefined') { import { nearestAllowed } from './field_note.js'; import { cn, t, INSTALLED_HINT, gib, bytesText, atLeast, WAIT_REFUSAL, reportable, reportText, failureText, setupError, SECTIONS, sectionOf } from './settings_words.js'; -import { holdNames, holdNamesIn, holdPhrase, isChinese, languageUrl } from './i18n.js'; +import { holdNames, holdNamesIn, holdPhrase, isChinese, keepShortWordsUnder, languageUrl } from './i18n.js'; import { languagePicker, addressLanguage } from './language_picker.js'; import { localized } from './i18n_tables.js'; export { failureText, sectionOf, SECTIONS, bytesText }; @@ -285,6 +285,7 @@ export async function openSetup(options) { // Folders: set once and rarely again, folded away. const folders = fold({iconName: 'folder', title: t('Advanced: installation and model folders', '高级:安装位置与模型文件夹'), sub: ''}); + folders.sub.dataset.fvPlain = ''; // it shows the installation folder, as the user typed it const inputs = el("div", 'st-sub'); const rootLabel = el('label', 'st-label'); rootLabel.append(el('span', '', t("Installation folder", "安装位置"))); const root = el("input"); root.type = "text"; root.spellcheck = false; root.autocomplete = 'off'; @@ -396,7 +397,7 @@ export async function openSetup(options) { const loraVerdicts = createVerdicts((path, options) => api.fetchApi(path, options)); let loraLoaded = false, loraRun = 0; const loraRow = name => { - const r = row({iconName: 'layers', title: name.split('/').pop(), sub: t('Checking…', '正在检查…'), cls: 'st-lrow'}); + const r = row({iconName: 'layers', title: name.split('/').pop(), sub: t('Checking…', '正在检查…'), cls: 'st-lrow', plain: true}); setTip(r.title, {name}); const chip = el('span', 'st-chip', t('Checking', '检查中')); r.end.append(chip); const more = el('div', 'st-sub st-ldetail'); more.hidden = true; @@ -699,9 +700,12 @@ export async function openSetup(options) { tip(preloadSwitch, t('Preload ahead', '积极预加载'), t('Load the models early when a generation looks near', '判断快要生成时提前加载模型')); preloadSwitch.onchange = () => setPreloadMode(preloadSwitch.checked ? 'eager' : 'conservative'); later(onPreload(mode => { preloadSwitch.checked = mode === 'eager'; })); - const preloadRow = row({iconName: 'gauge', title: t('Preload ahead', '积极预加载'), - sub: t('When off, nothing takes VRAM before a generation; models already used stay loaded for the next one.', - '关闭后不会在生成前主动占用显存;用过的模型仍会保留,改提示词继续生成不受影响。'), end: [preloadSwitch]}); + const preloadSub = unified => unified + ? t('When off, nothing takes unified memory before a generation; models already used stay loaded for the next one.', + '关闭后不会在生成前主动占用统一内存;用过的模型仍会保留,改提示词继续生成不受影响。') + : t('When off, nothing takes VRAM before a generation; models already used stay loaded for the next one.', + '关闭后不会在生成前主动占用显存;用过的模型仍会保留,改提示词继续生成不受影响。'); + const preloadRow = row({iconName: 'gauge', title: t('Preload ahead', '积极预加载'), sub: preloadSub(false), end: [preloadSwitch]}); advanced.append(groupHead(t('Model loading', '模型加载')), card(preloadRow.element)); // Performance measurement. A measurement, not a setting: it changes nothing about this installation, it reports // what this machine measures so the choices that are currently limited to one platform can be settled. @@ -714,7 +718,10 @@ export async function openSetup(options) { const calibrateStatus = slot(); calibrateStatus.textContent = t('Measures this computer and writes a report; no setting changes.', '测量本机性能并生成报告,不改变任何设置。'); const calibrateFoot = el('div', 'st-foot'); calibrateFoot.append(calibrateStatus, calibrateButton); - advanced.append(groupHead(t('Performance measurement', '性能测量')), card(repeatsRow.element, calibrateFoot)); + // It measures NVIDIA graphics cards only; on a Mac (unified memory) the group is hidden with the compatibility level. + const calibrateHead = groupHead(t('Performance measurement', '性能测量')); + const calibrateCard = card(repeatsRow.element, calibrateFoot); + advanced.append(calibrateHead, calibrateCard); // ════════════ Version & updates ════════════ const about = pane('about', t('Version & updates', '版本与更新')); @@ -774,36 +781,52 @@ export async function openSetup(options) { } // ── Right dock content: this computer, what FreeVideo keeps on disk, quick actions ── + // A value in this dock is in one of three states: still being read (a thin skeleton about as wide as its usual + // value, shown only once the reading has taken 300 ms, with the words kept for a screen reader), read, or not given + // by this computer (said in words, never a dash). + const notDetected = t('Not detected', '未检测到'), notRead = t('Not available right now', '暂时无法读取'); + const dockValue = width => { const node = el('b', 'is-wait', t('Reading…', '正在读取…')); node.style.setProperty('--st-skel', `${width}px`); return node; }; + const setValue = (node, text, missing = false) => { node.textContent = text; node.classList.remove('is-wait', 'is-show'); node.classList.toggle('is-none', missing); }; const machineHead = el('div', 'st-rh', t('This computer', '本机')); - const gpuName = el('div', 'st-gpu'); gpuName.hidden = true; + const gpuName = el('div', 'st-gpu'); gpuName.hidden = true; gpuName.dataset.fvPlain = ''; const meterRow = label => { - const box = el('div', 'st-meter'); const line = el('div', 'l'); const value = el('b', '', '—'); - line.append(el('span', '', label), value); const m = bar(); box.append(line, m); return {box, value, m}; + const box = el('div', 'st-meter'); const line = el('div', 'l'); const value = dockValue(72); + line.append(el('span', '', label), value); const m = bar(); m.classList.add('is-wait'); box.append(line, m); return {box, value, m}; }; const vram = meterRow(t('VRAM', '显存')); - const tempBox = el('div', 'st-meter'); const tempLine = el('div', 'l'); const tempValue = el('b', '', '—'); + const tempBox = el('div', 'st-meter'); const tempLine = el('div', 'l'); const tempValue = dockValue(40); tempLine.append(el('span', '', t('Temperature', '温度')), tempValue); tempBox.append(tempLine); - const disk = el('div', 'st-meter'); const diskLine = el('div', 'l'); const diskValue = el('b', '', '—'); + const disk = el('div', 'st-meter'); const diskLine = el('div', 'l'); const diskValue = dockValue(64); diskLine.append(el('span', '', t('Disk free', '磁盘可用')), diskValue); disk.append(diskLine); const usageHead = el('div', 'st-rh', t('FreeVideo keeps', 'FreeVideo 占用')); - const usageLine = el('div', 'st-meter'); const usageL = el('div', 'l'); const usageValue = el('b', '', '—'); + const usageLine = el('div', 'st-meter'); const usageL = el('div', 'l'); const usageValue = dockValue(48); usageL.append(el('span', '', t('Temporary files', '临时文件')), usageValue); usageLine.append(usageL); const rightBody = el('div', 'st-rb'); rightBody.append(gpuName, vram.box, tempBox, disk); const usageBody = el('div', 'st-rb'); usageBody.append(usageLine); right.append(machineHead, rightBody, usageHead, usageBody); - let monitorTimer = 0; + let monitorTimer = 0, machineRead = false, skeletonTimer = 0; + // The video memory has its bar only with a reading: no empty bar for a card that gives none. + const paintMachine = s => { + gpuName.textContent = s.name || ''; gpuName.hidden = !s.name; + vram.m.classList.remove('is-wait', 'is-show'); vram.m.hidden = !s.memory_total; + if (s.memory_total) { setValue(vram.value, `${gib(s.memory_used)} / ${gib(s.memory_total)}`); vram.m.set(s.memory_used / s.memory_total); } + else setValue(vram.value, notDetected, true); + if (s.temperature != null) setValue(tempValue, `${s.temperature} °C`); else setValue(tempValue, notDetected, true); + if (s.disk_free != null) setValue(diskValue, gib(s.disk_free)); else setValue(diskValue, notRead, true); + }; const readMachine = async () => { clearTimeout(monitorTimer); if (!dialog.open) return; + // The skeletons show only once the first reading has taken 300 ms, so a quick one does not flash them. + if (!skeletonTimer) skeletonTimer = setTimeout(() => { for (const node of right.querySelectorAll('.is-wait')) node.classList.add('is-show'); }, 300); try { const response = await api.fetchApi('/freevideo/monitor', {signal: AbortSignal.timeout(6000)}); - const s = response.ok ? await response.json() : {}; - gpuName.textContent = s.name || ''; gpuName.hidden = !s.name; - if (s.memory_total) { vram.value.textContent = `${gib(s.memory_used)} / ${gib(s.memory_total)}`; vram.m.set(s.memory_used / s.memory_total); } - else { vram.value.textContent = '—'; vram.m.set(0); } - tempValue.textContent = s.temperature != null ? `${s.temperature} °C` : '—'; - diskValue.textContent = s.disk_free != null ? gib(s.disk_free) : '—'; - } catch { /* The dock keeps the last reading. */ } + if (!response.ok) throw new Error(); + paintMachine(await response.json()); machineRead = true; + } catch { + // The dock keeps the last reading; with none yet, it says so in place of the skeletons. + if (!machineRead) { vram.m.hidden = true; vram.m.classList.remove('is-wait', 'is-show'); for (const node of [vram.value, tempValue, diskValue]) setValue(node, notRead, true); } + } monitorTimer = setTimeout(readMachine, 3000); }; @@ -976,6 +999,8 @@ export async function openSetup(options) { document.body.append(dialog); dialog.showModal(); dialog.append(sheet); + // Russian and Ukrainian: short words of every text the room shows, now or later, stay with the next word. + keepShortWordsUnder(dialog); // Light the Settings entry of this room's top bar once topbar.js has taken the header over; the version entry // opens the Version page here. const lightEntry = () => { @@ -1007,9 +1032,9 @@ export async function openSetup(options) { const response = await api.fetchApi('/freevideo/library/working-files'); const {bytes} = await response.json(); if (!response.ok || !Number.isFinite(bytes)) throw new Error(); - usageValue.textContent = storageAmount(bytes); + setValue(usageValue, storageAmount(bytes)); if (bytes > 0) storageSay(storageAmount(bytes), true); else storageSay(t('Nothing to clear up', '没有可清理的文件'), false); - } catch { storageSay(t('The output folder cannot be accessed.', '无法访问输出文件夹'), true); } + } catch { storageSay(t('The output folder cannot be accessed.', '无法访问输出文件夹'), true); setValue(usageValue, notRead, true); } }; storageClear.onclick = async () => { storageClear.disabled = true; @@ -1022,7 +1047,7 @@ export async function openSetup(options) { : (freed > 0 ? `Freed ${storageAmount(freed)}. ` : '') + `${left} ${left === 1 ? 'item' : 'items'} could not be deleted.`, true); else if (freed > 0) storageSay(t('Freed {size}', '已释放 {size}', { size: storageAmount(freed) }), false); else storageSay(t('Nothing to clear up', '没有可清理的文件'), false); - if (!(left > 0)) usageValue.textContent = storageAmount(0); + if (!(left > 0)) setValue(usageValue, storageAmount(0)); } catch { storageSay(t('The output folder cannot be accessed.', '无法访问输出文件夹'), true); } }; storageCheck(); @@ -1298,6 +1323,8 @@ export async function openSetup(options) { reserveHead.firstChild.textContent = unified ? t('Reserved unified memory', '预留统一内存') : t('Reserved VRAM', '预留显存'); // Mac generation shares unified memory and has no compatibility levels. compat.setUnified(unified); + calibrateHead.hidden = calibrateCard.hidden = unified; + preloadRow.sub.textContent = preloadSub(unified); reserve.setAttribute('aria-label', reserveHead.firstChild.textContent); reserve.min = unified ? '1' : '0.2'; reserveAuto.checked = value?.[reserveField] == null; @@ -1476,13 +1503,13 @@ export async function openSetup(options) { [t("Already here", "已有模型"), bytesText(value.existing_model_bytes_size_matched || 0)], [t("Reused from this computer", "复用本地模型"), bytesText(local.reused_bytes || 0), t('Linked {linked} · copied {copied}', '链接 {linked} · 复制 {copied}', { linked: bytesText(local.linked_bytes || 0), copied: bytesText(local.copy_bytes || 0) })], [t("Extra disk space", "额外占用磁盘"), bytesText(disksNeeded)], - [t("Graphics card", "显卡"), gpu.name || "—"], + [t("Graphics card", "显卡"), gpu.name || "—", '', true], ]; if (value.prepared_model) facts.push([t("Model version", "模型版本"), value.prepared_model.scale_granularity === "int8_convrot" ? t("Slim int8", "精简 int8 版") : t("Slim FP8", "精简 FP8 版"), t("No conversion on this computer", "无需本地转换")]); const list = el('dl', 'st-facts'); - for (const [key, shownValue, small] of facts) { - const box = el('div'); const dd = el('dd', '', shownValue); cutTip(dd, shownValue); + for (const [key, shownValue, small, plain] of facts) { + const box = el('div'); const dd = el('dd', '', shownValue); cutTip(dd, shownValue); if (plain) dd.dataset.fvPlain = ''; if (small) dd.append(el('small', '', small)); box.append(el('dt', '', key), dd); list.append(box); } @@ -1607,7 +1634,7 @@ export async function openSetup(options) { }; cancel.onclick = async () => { try { render(await request("cancel")); poll(); } catch (error) { fail(error); } }; dialog.addEventListener('close', () => { - clearTimeout(pollTimer); clearTimeout(monitorTimer); clearTimeout(imageTimer); clearTimeout(swapTimer); + clearTimeout(pollTimer); clearTimeout(monitorTimer); clearTimeout(imageTimer); clearTimeout(swapTimer); clearTimeout(skeletonTimer); for (const dispose of disposers) { try { dispose(); } catch { /* Gone already. */ } } compat.dispose?.(); watchAfterClose(); diff --git a/web/studio.js b/web/studio.js index fc8cbacd..2d8dd781 100644 --- a/web/studio.js +++ b/web/studio.js @@ -88,7 +88,7 @@ import { toast, toastHeight } from './notifications.js'; import { mediaQueue } from './work_media.js'; import { userMessage } from './user_message.js'; import { fieldNote } from './field_note.js'; -import { isChinese, translator } from './i18n.js'; +import { isChinese, translator, holdShortWordsIn, LANGUAGE, SHORT_WORDS } from './i18n.js'; const cn = isChinese(); const t = translator(cn); @@ -2129,8 +2129,21 @@ export function openStudio(node, {extendFrom = null} = {}) { // A fault in the status line carries the report button; the next text written to the line removes it. // The run's diagnostic report: errors beside it go the report route instead of the feedback form. const reportRoute = {has: () => progress.hasReport(), download: () => progress.downloadReport(), fetch: progress.fetchReport, version: productVersion}; - const statusIssue = issueButton(t, () => ({where: ['Generate', '生成'], message: status.firstChild?.textContent}), {className: 'fv-status-issue', route: reportRoute}); + // The status's own words: its text, with the words held for Russian and Ukrainian (.fv-keep, .fv-keep-run), up to the + // first thing added after it (the issue button). + const statusWords = () => { + let words = ''; + for (const node of status.childNodes) { if (node.nodeType === 3 || node.matches?.('.fv-keep, .fv-keep-run')) words += node.textContent; else break; } + return words; + }; + const statusIssue = issueButton(t, () => ({where: ['Generate', '生成'], message: statusWords()}), {className: 'fv-status-issue', route: reportRoute}); function fault(text) { status.dataset.error = 'true'; status.textContent = text; status.append(statusIssue); } + // Russian and Ukrainian: whatever writes the status line, its short words are held to the next word (holdShortWordsIn). + // Only this line is watched; holding again finds nothing new, so the watch settles after one pass. + if (SHORT_WORDS[LANGUAGE] && typeof MutationObserver === 'function') { + const keep = new MutationObserver(() => holdShortWordsIn(status)); + keep.observe(status, {childList: true, characterData: true, subtree: true}); cleanup.push(() => keep.disconnect()); + } const stats = el('div', null, 'fv-stats'), budget = el('div', '', 'fv-budget'), links = el('div', null, 'fv-result-links'); // New text in the status line replaces the report card under the result. let statusHeight = 0; @@ -3863,7 +3876,8 @@ export function openStudio(node, {extendFrom = null} = {}) { if (body.dataset.cols === '3') controls.prepend(body.foldLeft), controls.append(body.settingsRail); if (body.dataset.cols === '3') { const part = id => consoleUI.chip(id); - columns = layoutColumns({t, controls, consoleUI, fold: body.foldLeft, rail: body.settingsRail, parts: {media: part('media'), mention, enhance: enhancer.chip, size: framePicker.element, + columns = layoutColumns({t, controls, consoleUI, fold: body.foldLeft, rail: body.settingsRail, parts: {media: part('media'), mention, enhance: enhancer.chip, + enhanceStatus: enhancer.element.querySelector('.fv-enhance-status'), size: framePicker.element, duration: stepper.element, quality: effort.element, pass: passMode, runbar, // The level's line and the Fast level's download row stand under the levels, as in the Quality window (the column has no such window). qualityMore: [levelUse, fastPack.element]}}); @@ -4104,9 +4118,10 @@ export function openStudio(node, {extendFrom = null} = {}) { {keys: 'Escape', title: ['Close the open panel or tray', '关闭打开的面板或托盘']}]); if (typeof off === 'function') cleanup.push(off); }).catch(() => {}); - // Enhancement progress and its errors read in the console's status slot (one line, fixed height). + // Enhancement progress and its errors read in the console's status slot (one line, fixed height); the three-column panel + // keeps them right under the prompt's key row instead (studio_columns.js), and gives them back to the slot when undone. const enhanceStatus = enhancer.element.querySelector('.fv-enhance-status'); - if (enhanceStatus) consoleUI.slot.append(enhanceStatus); + if (enhanceStatus && body.dataset.cols !== '3') consoleUI.slot.append(enhanceStatus); enhancer.chip.after(enhancer.bar); // At phone width the prompt tools stand in a column beside the box, and a third key would make the console taller than it // is without reverse: there the key sits in the options row, right of Enhance, as an icon (same key, same words). diff --git a/web/studio_columns.js b/web/studio_columns.js index b7ebed16..79ed781b 100644 --- a/web/studio_columns.js +++ b/web/studio_columns.js @@ -39,6 +39,7 @@ export function layoutColumns({t, controls, consoleUI, parts, fold, rail}) { fold.remove(); rail.remove(); delete controls.dataset.columns; controls.classList.remove('fv-sc-col'); parts.mention?.querySelector('.fv-sc-mention-name')?.remove(); parts.mention?.classList.remove('fv-sc-mention'); if (bar) parts.enhance.after(bar); + if (parts.enhanceStatus) consoleUI.slot.append(parts.enhanceStatus); }; compactHook(controls); apply(); @@ -67,13 +68,21 @@ export function layoutColumns({t, controls, consoleUI, parts, fold, rail}) { // Prompt history, the writing guide and the draft note stand at the head of the section, as the picture view puts its add key; Expand ends the row. if (expand) tools.append(expand); // The row stays on one line: when its words do not fit, its keys keep their icons only (their hover cards still name them). - // The enhance bar (versions, cancel) wraps under the keys; only the keys and Expand are measured. + // The enhance bar's keys (cancel, rewrite again, the two versions) stand in the row too, so they are measured with the keys + // and Expand. When even the icons do not fit, the row wraps as a whole: the keys and Expand keep the first line and the + // bar takes the line under them, so no key stands alone on a line. const fitTools = () => { - if (!tools.isConnected) return; delete tools.dataset.compact; - const keys = [...tools.children].filter(node => !node.classList.contains('fv-enhance-bar') && !node.classList.contains('fv-iv-grow')); - if (keys.reduce((sum, node) => sum + node.getBoundingClientRect().width, 0) + (parseFloat(getComputedStyle(tools).columnGap) || 0) * (keys.length - 1) > tools.clientWidth + 1) tools.dataset.compact = 'true'; + if (!tools.isConnected) return; delete tools.dataset.compact; delete tools.dataset.wrap; + const over = () => { + const keys = [...tools.children].filter(node => !node.classList.contains('fv-iv-grow') && node.getClientRects().length); + return keys.reduce((sum, node) => sum + node.getBoundingClientRect().width, 0) + (parseFloat(getComputedStyle(tools).columnGap) || 0) * (keys.length - 1) > tools.clientWidth + 1; + }; + if (!over()) return; + tools.dataset.compact = 'true'; + if (over()) tools.dataset.wrap = 'true'; }; tools.watch = typeof ResizeObserver === 'function' ? new ResizeObserver(fitTools) : null; tools.watch?.observe(tools); document.fonts?.ready?.then(fitTools).catch?.(() => {}); + if (bar) tools.watch?.observe(bar); // its keys come and go as a rewrite starts and ends const mediaTray = consoleUI.trays.querySelector('[data-tray=media]'); const trays = ['lora', 'advanced'].map(id => consoleUI.trays.querySelector(`[data-tray=${id}]`)); trays.forEach(tray => { // these two stay open in the column; the console's click-away closing leaves them be @@ -84,7 +93,8 @@ export function layoutColumns({t, controls, consoleUI, parts, fold, rail}) { // Opened at the foot of the column, the new rows would stand below the fold: bring the section's head to the top once it has grown. advanced.element.addEventListener('fv-iv-section', () => { if (advanced.isOpen()) setTimeout(() => advanced.element.scrollIntoView?.({block: 'start', behavior: 'smooth'}), 230); }); scroll.append( - section('prompt', t('Prompt', '描述'), 'prompt', [prompt, tools, bar, mediaTray], {fixed: true, actions: [promptTools].filter(Boolean)}).element, + // The rewrite's line stands right under the key row, by the rewrite key it is about. + section('prompt', t('Prompt', '描述'), 'prompt', [prompt, tools, parts.enhanceStatus, bar, mediaTray].filter(Boolean), {fixed: true, actions: [promptTools].filter(Boolean)}).element, section('size', t('Frame & size', '画幅与尺寸'), 'size', [parts.size], {fixed: true}).element, section('duration', t('Duration', '时长'), 'clock', [parts.duration], {fixed: true}).element, section('quality', t('Quality', '质量'), 'gen', [parts.quality, ...(parts.qualityMore || [])], {fixed: true}).element, diff --git a/web/tooltip.js b/web/tooltip.js index 366a97e8..96fd8bf5 100644 --- a/web/tooltip.js +++ b/web/tooltip.js @@ -3,7 +3,8 @@ // - Keyboard focus shows it too (a control marked data-fv-tip-focus="off" shows it for the pointer only: a group the arrow keys // move through would show a card at every press); a long press shows it on touch (and that press does not also tap the control). // - It never covers the control, the menu the control sits in, another open layer, or the picture when there is room -// elsewhere: below, above, then beside, measured at its real size and always kept inside the window. +// elsewhere: below, above, then beside, measured at its real size and always kept inside the window. On a card it +// stays next to its control when a side there leaves the card's words clear, and it moves with the control. // - It floats in the top layer, so it never changes the layout; it fades only, and not at all under reduced motion. // - A disabled control (disabled or aria-disabled) says why and how to undo it instead of what it does. // Where the words come from, first match wins: @@ -15,7 +16,7 @@ // the words a hover shows; the moment a view writes its own attributes, the copy steps aside. import { TIPS, MATCHES, LABELS } from './tooltip_copy.js'; import { installA11y } from './a11y.js'; -import { isChinese, translator } from './i18n.js'; +import { isChinese, translator, holdShortWordsIn } from './i18n.js'; import { englishOf } from './i18n_tables.js'; if (globalThis.document?.head && !globalThis.document.head.querySelector?.('link[data-fv-sheet=tooltip]')) { @@ -191,9 +192,16 @@ const overlapArea = (a, b) => Math.max(0, Math.min(a.right, b.right) - Math.max( // avoid: rects the tip should not cover (other open layers, the picture). // around: the floating layer the control sits in (a menu, a popover, a tray); the tip goes outside it, lined up with // the control, so it never covers the layer's own words. Without room outside it, the control alone counts. +// within: the words of a card the control sits in (a panel or a popover, inside its padding). The tip first tries the +// control's own sides, GAP from it, where it covers none of those words (a card's buttons on its last line: below +// them); only when every such side would cover them does it go outside the whole layer, as with around. // The first side that fits and covers nothing wins; otherwise the side that fits and covers least; if no side fits, // the side with the most room, pushed back inside the window. The tip never leaves the window. -export function placeTip(target, size, view, {prefer = null, avoid = [], around = null} = {}) { +export function placeTip(target, size, view, {prefer = null, avoid = [], around = null, within = null} = {}) { + if (within) { + const near = placeAt(target, size, view, {prefer, avoid: [...avoid, within], edge: target}); + if (near.fits && !near.cover) return near; + } if (around) { const outside = placeAt(target, size, view, {prefer, avoid, edge: around}); if (outside.fits) return outside; @@ -233,7 +241,7 @@ function placeAt(target, size, view, {prefer, avoid, edge}) { // Whole pixels, and the rounding never pushes the card past the edge. const left = Math.max(MARGIN, Math.min(Math.round(best.left), Math.floor(view.width - MARGIN - width))); const top = Math.max(MARGIN, Math.min(Math.round(best.top), Math.floor(view.height - MARGIN - height))); - return {left, top, side: best.side, width: Math.round(width), fits}; + return {left, top, side: best.side, width: Math.round(width), fits, cover: best.cover || 0}; } // ── The tip itself ───────────────────────────────────────────────────────────────────────────── @@ -289,11 +297,11 @@ function render(content) { if (content.use && !content.off) { const use = document.createElement('div'); use.className = 'fv-tip-use'; if (content.lines) listLines(use, content.use); else use.textContent = content.use; - box.append(use); + box.append(holdShortWordsIn(use)); } // A list (file paths) is wider than other tips; the dataset flag lets the stylesheet say how wide. if (content.lines) box.dataset.lines = ''; else delete box.dataset.lines; - if (content.off) { const off = document.createElement('div'); off.className = 'fv-tip-off'; off.textContent = content.off; box.append(off); } + if (content.off) { const off = document.createElement('div'); off.className = 'fv-tip-off'; off.textContent = content.off; box.append(holdShortWordsIn(off)); } box.dataset.state = content.off ? 'off' : 'on'; } @@ -303,13 +311,15 @@ const visibleRect = element => { const rect = element.getBoundingClientRect(); r function surroundings(element) { const avoid = []; let prefer = null; - let around = null; + let around = null, within = null; const menu = holderLayer(element); if (menu) { const rect = visibleRect(menu); if (rect && rect.height <= innerHeight * 0.6 && rect.width * rect.height < innerWidth * innerHeight * 0.45) { around = rect; if (menu.matches('[role=menu],[role=listbox],.fv-select-menu')) prefer = ['right', 'left', 'below', 'above']; + // A card (a panel, a popover, not a list or a tray): its words are what lies inside its padding. + else if (menu.matches('[popover],[role=dialog]')) within = paddingBox(menu, rect); } } for (const layer of document.querySelectorAll('[popover]:popover-open,[role=menu],[role=listbox],.fv-select-menu')) { @@ -317,6 +327,9 @@ function surroundings(element) { const rect = visibleRect(layer); if (rect && rect.width * rect.height < innerWidth * innerHeight * 0.5) avoid.push(rect); } + // A control that asks for its tip below (data-fv-tip-side="below", on it or a wrapper) gets it there when it fits, even + // over the picture, and above only when it does not: a tip above it would cover the bar it stands under. + if (element.closest('[data-fv-tip-side=below]')) return {avoid, prefer: ['below', 'above', 'right', 'left'], around}; // The user's picture: the main block's video, image or canvas, unless the control sits on it. for (const picture of document.querySelectorAll('[data-fv-main] :is(video,img,canvas),.fv-library-viewer :is(video,img)')) { if (picture.contains(element)) continue; @@ -324,8 +337,14 @@ function surroundings(element) { if (rect && !(element.getBoundingClientRect().top >= rect.top && element.getBoundingClientRect().bottom <= rect.bottom && element.getBoundingClientRect().left >= rect.left && element.getBoundingClientRect().right <= rect.right)) avoid.push(rect); } - return {avoid, prefer, around}; + return {avoid, prefer, around, within}; } +const paddingBox = (node, rect) => { + const style = getComputedStyle(node), px = name => parseFloat(style[name]) || 0; + const left = rect.left + px('borderLeftWidth') + px('paddingLeft'), top = rect.top + px('borderTopWidth') + px('paddingTop'); + const right = rect.right - px('borderRightWidth') - px('paddingRight'), bottom = rect.bottom - px('borderBottomWidth') - px('paddingBottom'); + return {left, top, right, bottom, width: Math.max(0, right - left), height: Math.max(0, bottom - top)}; +}; // The floating layer a control sits in: a menu, a popover, a panel that says it is a dialog, or an open tray that // floats (an open
taken out of the flow). Not the view itself, the top bar or the floating task window. @@ -405,10 +424,15 @@ function follow(element) { watcher.observe(element, {attributes: true, attributeFilter: ['disabled', 'aria-disabled', 'data-fv-tip-name', 'data-fv-tip-use', 'data-fv-tip-key', 'data-fv-tip-why', 'data-fv-tip-off', 'data-fv-tip', 'aria-label', 'title']}); } clearInterval(watch); + // A control that moves while its tip shows (a card that grows as its picture loads, a panel that slides) takes the + // tip with it. + const at = rect => `${Math.round(rect.left)},${Math.round(rect.top)},${Math.round(rect.width)},${Math.round(rect.height)}`; + let last = at(element.getBoundingClientRect()); watch = setInterval(() => { if (shown !== element) { clearInterval(watch); return; } const rect = element.isConnected ? element.getBoundingClientRect() : null; - if (!rect || (!rect.width && !rect.height) || element.closest('[inert],[hidden]')) hideTip({now: true}); + if (!rect || (!rect.width && !rect.height) || element.closest('[inert],[hidden]')) { hideTip({now: true}); return; } + if (at(rect) !== last) { last = at(rect); position(element); } }, 250); } diff --git a/web/tutorial_book.css b/web/tutorial_book.css index 4632fde7..e1340d9c 100644 --- a/web/tutorial_book.css +++ b/web/tutorial_book.css @@ -104,6 +104,9 @@ dialog.fv-book svg.fv-book-i.is-solid{fill:currentColor;stroke:none} .fv-book .fv-book-steps{list-style:none;margin:0;padding:0;counter-reset:fvstep;display:flex;flex-direction:column;gap:var(--fv-sp-4,4px)} .fv-book .fv-book-steps li{counter-increment:fvstep;display:grid;grid-template-columns:24px minmax(0,1fr) auto;column-gap:var(--fv-sp-12,12px);align-items:start;padding:var(--fv-sp-8,8px);border-radius:var(--fv-rad-ctl,12px)} .fv-book .fv-book-steps li:hover{background:var(--fv-ctl-bg)} +/* Words narrower than 180 px beside "Take me there": the button under the words, at their start (fitSteps). */ +.fv-book .fv-book-steps[data-narrow=true] li{grid-template-columns:24px minmax(0,1fr)} +.fv-book .fv-book-steps[data-narrow=true] li > .fv-book-go{grid-column:2;justify-self:start;margin-top:var(--fv-sp-4,4px)} .fv-book .fv-book-steps li::before{content:counter(fvstep);display:grid;place-items:center;width:24px;height:24px;margin-top:-2px;border-radius:var(--fv-r-pill);background:var(--fv-ctl-hover); font-size:var(--fv-fs-1,12px);font-weight:var(--fv-fw-3,600);color:var(--fv-fg);font-variant-numeric:tabular-nums} .fv-book .fv-book-go{align-self:center;display:inline-flex;align-items:center;gap:var(--fv-sp-4,4px);height:var(--fv-ctl-s,28px);padding:0 var(--fv-sp-8,8px);border-radius:var(--fv-rad-sm,8px); diff --git a/web/tutorial_book.js b/web/tutorial_book.js index bd346b06..df0ad5c2 100644 --- a/web/tutorial_book.js +++ b/web/tutorial_book.js @@ -7,7 +7,7 @@ import {FEATURE_TOUR, readyCards} from './feature_tour_content.js'; import {SHOWCASE_TEXT, SHOWCASE_ASSET} from './entry_showcase.js'; import {isolateDialogKeys, listenDialogKey, routeDialogKey} from './dialog_keys.js'; import {reducedMotion} from './context_menu.js'; -import { isChinese, translator, translatorFor, fill } from './i18n.js'; +import { isChinese, translator, translatorFor, fill, holdShortWordsIn } from './i18n.js'; import { localized, pageLang, promptText } from './i18n_tables.js'; // i18n-table @@ -175,6 +175,19 @@ function stepLine(step) { } let current = null, follow = null; +// Steps whose words would get less than 180 px beside "Take me there": the button goes under the words (data-narrow on +// the list). Measured as laid out side by side, and again when the list's width changes. Returns the stop. +function fitSteps(list) { + if (!list) return () => {}; + const fit = () => { + if (!list.isConnected) return; + delete list.dataset.narrow; + if ([...list.querySelectorAll(':scope > li > .fv-book-step')].some(step => step.getBoundingClientRect().width < 180)) list.dataset.narrow = 'true'; + }; + const watch = typeof ResizeObserver === 'function' ? new ResizeObserver(fit) : null; + watch?.observe(list); fit(); + return () => watch?.disconnect(); +} /** Open the tutorial. chapter: an id in tutorial_book_content.js; tab: 'chapters' | 'examples'; example: a feature card id. */ export function openTutorialBook({chapter = TUTORIAL_CHAPTERS[0].id, tab = 'chapters', example = null, note = ''} = {}) { @@ -184,6 +197,7 @@ export function openTutorialBook({chapter = TUTORIAL_CHAPTERS[0].id, tab = 'chap const lang = language(), t = translator(lang === 'zh'), text = localized(COPY, t), L = value => Array.isArray(value) ? t(...value) : localized(value, t); const restore = document.activeElement; const state = {tab, chapter: chapterOf(chapter) ? chapter : TUTORIAL_CHAPTERS[0].id, example, query: '', tocOnly: false, note}; + let unfitSteps = () => {}; const dialog = el('dialog', 'fv-book'); dialog.lang = pageLang(); dialog.setAttribute('aria-labelledby', 'fv-book-title'); dialog.dataset.fvTipScope = ''; // Head: name, the two pages (Chapters, Examples), contents (phones) and close. @@ -289,7 +303,8 @@ export function openTutorialBook({chapter = TUTORIAL_CHAPTERS[0].id, tab = 'chap }; pn.append(side(prevId, text.prev, 'is-prev', true), side(nextId, text.next, 'is-next', false)); inner.append(pn); - page.replaceChildren(inner); + page.replaceChildren(holdShortWordsIn(inner)); + unfitSteps(); unfitSteps = fitSteps(inner.querySelector('ol.fv-book-steps')); markRead(id); } // Whether another view now lies over the book. @@ -347,7 +362,7 @@ export function openTutorialBook({chapter = TUTORIAL_CHAPTERS[0].id, tab = 'chap } } box.append(grid); - page.replaceChildren(box); + page.replaceChildren(holdShortWordsIn(box)); } function drawExample() { const card = FEATURE_TOUR.find(c => c.id === state.example); @@ -380,7 +395,7 @@ export function openTutorialBook({chapter = TUTORIAL_CHAPTERS[0].id, tab = 'chap if (chapter && chapterOf(chapter)) { const r = button('fv-book-btn', t('Read the tutorial', '看教程'), [t('Read the tutorial', '看教程'), text.tips.read]); r.onclick = () => go({tab: 'chapters', chapter, example: null}); acts.append(r); } strip.append(acts, el('span', 'fv-book-hint', text.fills)); box.append(back, eyebrow, h1, el('p', 'fv-book-sum', L(card.line)), pairBig, strip); - page.replaceChildren(box); + page.replaceChildren(holdShortWordsIn(box)); } function go(next = {}) { const changedPage = (next.chapter && next.chapter !== state.chapter) || (next.tab && next.tab !== state.tab) || ('example' in next && next.example !== state.example); @@ -404,6 +419,7 @@ export function openTutorialBook({chapter = TUTORIAL_CHAPTERS[0].id, tab = 'chap if (at < 0) return; event.preventDefault(); items[Math.max(0, Math.min(items.length - 1, at + (event.key === 'ArrowDown' ? 1 : -1)))].focus(); }); dialog.addEventListener('click', event => { if (event.target === dialog) dialog.close(); }); + dialog.addEventListener('close', () => unfitSteps()); dialog.addEventListener('close', () => { dialog.querySelectorAll('video').forEach(video => video.pause()); disposeKeys(); removeKeys(); dialog.remove(); current = null; diff --git a/web/user_store_mirror.js b/web/user_store_mirror.js index c3507889..9857f1eb 100644 --- a/web/user_store_mirror.js +++ b/web/user_store_mirror.js @@ -1,5 +1,6 @@ // What the page keeps only in this browser (prompt histories and presets, picture prompts, tags and favorites, subtitle -// presets, export settings, the editor's unsent saves, recent LoRAs), also kept in the engine's user data +// presets, export settings, the editor's unsent saves and each saved edit's typed words and queued parts, recent LoRAs, +// an unsent feedback text), also kept in the engine's user data // (/freevideo/user-store, freevideo_engine/user_store.py). The browser's copy stays the one the page reads and // writes: a change here is sent there, read back and checked; the engine's copy is written into the browser only for // a key the browser does not have at all (a new address or port, or site data cleared). ComfyUI's unsaved workflow @@ -8,8 +9,11 @@ const KEYS = new Set(['freevideo.prompts.history', 'freevideo.prompts.presets', 'freevideo.imageView.prompts', 'freevideo.imageView.presets', 'freevideo.imageView.meta', 'freevideo.library.tags', 'freevideo.library.picture-favorites', - 'freevideo.subtitle-presets', 'freevideo.editor.export-settings', 'freevideo_lora_recent', 'freevideo_image_loras']); + 'freevideo.subtitle-presets', 'freevideo.editor.export-settings', 'freevideo_lora_recent', 'freevideo_image_loras', + 'freevideo.feedback-draft']); const OUTBOX = /^fv-editor-outbox(?::[A-Za-z0-9_-]{1,64})?$/; +// A saved edit's view (editor.js viewPrefix): an unsaved edit's (draft:…) lives only in its tab. +const VIEW = /^fv-editor-view:e-[0-9a-f]{32}$/; const DRAFT = /^Comfy\.Workflow\.Draft[^\x00-\x1f\x7f]{0,200}$/; const BASE = '/freevideo/user-store'; const WAIT = 800; @@ -23,7 +27,7 @@ const TRIES = 3; const PAUSE = 60_000, PAUSE_MAX = 30 * 60_000; // Whether a key is kept in the engine too, and whether it may ever be written back into the browser. -export const kept = key => typeof key === 'string' && (KEYS.has(key) || OUTBOX.test(key) || DRAFT.test(key)); +export const kept = key => typeof key === 'string' && (KEYS.has(key) || OUTBOX.test(key) || VIEW.test(key) || DRAFT.test(key)); export const restorable = key => kept(key) && !DRAFT.test(key); export const isDraft = key => typeof key === 'string' && DRAFT.test(key); @@ -98,9 +102,10 @@ export function createMirror({storage, request, persist = () => undefined, write } async function call(method, key, body) { + csrf ||= globalThis.__freevideoProof?.() || null; // handed over by the sign-in proxy (web/proxy_proof.js); none here const headers = csrf ? {'X-FreeVideo-CSRF': csrf} : {}; let answer = await ask(method, key == null ? BASE : path(key), body, headers); - if (answer.status === 403 && answer.body?.error === 'forbidden') { + if (answer.status === 403 && (answer.body?.error === 'forbidden' || answer.body?.error?.code === 'page_session_required')) { // Through the sign-in proxy a write carries this device's proof (asked for again when the one held is // refused: the proxy restarted); a page on this machine never needs it. const held = csrf;