Free, open-source AI video generator for Mac. Run LTX-2.5 and MiniMax H3 (Hailuo) locally on Apple Silicon: text-to-video and image-to-video with sound, lip-sync, character LoRA training, songs from lyrics (YuE2) and image editing (Qwen-Image-Edit). One-click install via Pinokio. Offline: no cloud, no API key, no NVIDIA GPU.
Python ai-filmmakingai-videoai-video-generatorapple-siliconhailuoimage-to-videolip-synclocal-ailora-trainingltx-2ltx-2-5ltx-videomacosminimax-h3mlxmusic-generationoffline-aipinokiotext-to-videovideo-generation
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Phosphene</title>
<!-- The build this PROCESS is serving, not the one in the working tree.
Server-rendered, so it answers before a byte of JS runs and survives
a page saved to disk. See build_stamp_text(). -->
<meta name="phosphene-build" content="__BUILD_STAMP__">
<link rel="icon" type="image/png" sizes="64x64" href="/assets/favicon-64.png">
<link rel="icon" type="image/png" sizes="256x256" href="/assets/favicon.png">
<!-- The panel stylesheet lives on disk at webapp/style/panel.css (served
by do_GET's /webapp/ route with __ENGINE_RULES__ substituted at request
time from the ENGINES registry — same single-source substitution page()
used to do when the CSS was embedded here). New styles go in that file,
never in this string. See docs/ARCHITECTURE.md. -->
<link rel="stylesheet" href="/webapp/style/panel.css">
</head>
<!-- data-cap-tier is set at request time by page() from _resolve_cap_tier() —
the FEATURE tier: this Mac's RAM, folded down to what the active
generation can serve (or the LTX_FORCE_CAP_TIER env override). CSS rules
`body[data-cap-tier="q4|q8"]` switch which intents are visible.
window.PHOSPHENE_CAP_TIER mirrors it for runtime JS branches.
IT DOES NOT ANSWER "are the weights on disk" — that is `data-q8-pack`,
written every poll from /status. On 2.5 the two diverge for the first
time: a 64 GB Mac holding only the base pack resolves cap_tier=q8 and
still cannot render a trained character. Both must be able to be true;
see §11-E of the v4.0 spec. -->
<!-- data-engine is stamped in the markup, not left for setEngine() to add on
boot: the per-engine fold rules (`body:not([data-engine="ltx"])
[data-ltx-only]`) match a body with NO attribute, so every LTX-only
control would flash hidden for the frame before the script runs. -->
<body data-cap-tier="__CAP_TIER__" data-engine="ltx">
<!-- Phosphor Icons (MIT, https://github.com/phosphor-icons/core) — inline symbol library.
Referenced via <svg class="ph"><use href="#ph-NAME"/></svg>. The symbol set is
curated, not the full Phosphor library — only icons we actually use. License notice
lives at LICENSES/phosphor-icons.txt in the repo root. -->
<svg width="0" height="0" style="position:absolute;width:0;height:0;overflow:hidden" aria-hidden="true">
<defs>
<symbol id="ph-arrow-clockwise" viewBox="0 0 256 256"><polyline points="184 104 232 104 232 56" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><path d="M188.4,192a88,88,0,1,1,1.83-126.23L232,104" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></symbol>
<symbol id="ph-arrow-clockwise-bold" viewBox="0 0 256 256"><polyline points="184 104 232 104 232 56" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"/><path d="M188.4,192a88,88,0,1,1,1.83-126.23L232,104" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"/></symbol>
<symbol id="ph-arrow-square-out" viewBox="0 0 256 256"><polyline points="216 104 215.99 40.01 152 40" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="136" y1="120" x2="216" y2="40" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><path d="M184,136v72a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V80a8,8,0,0,1,8-8h72" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></symbol>
<symbol id="ph-arrow-up" viewBox="0 0 256 256"><line x1="128" y1="216" x2="128" y2="40" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><polyline points="56 112 128 40 200 112" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></symbol>
<symbol id="ph-caret-down-bold" viewBox="0 0 256 256"><polyline points="208 96 128 176 48 96" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"/></symbol>
<symbol id="ph-check-bold" viewBox="0 0 256 256"><polyline points="40 144 96 200 224 72" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"/></symbol>
<symbol id="ph-download-simple" viewBox="0 0 256 256"><line x1="128" y1="144" x2="128" y2="32" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><polyline points="216 144 216 208 40 208 40 144" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><polyline points="168 104 128 144 88 104" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></symbol>
<symbol id="ph-film-slate" viewBox="0 0 256 256"><path d="M216,112H40a8,8,0,0,0-8,8v88a8,8,0,0,0,8,8H216a8,8,0,0,0,8-8V120A8,8,0,0,0,216,112Z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><path d="M32,112,50.6,44.7a8,8,0,0,1,9.8-5.6L213.3,80.4a8,8,0,0,1,5.6,9.8L213,112" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="110.1" y1="59.5" x2="83.2" y2="112" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="163.9" y1="74" x2="137" y2="112" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></symbol>
<symbol id="ph-remote" viewBox="0 0 256 256"><rect x="84" y="24" width="88" height="208" rx="28" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><circle cx="128" cy="78" r="18" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="108" y1="136" x2="148" y2="136" fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="16"/><line x1="108" y1="172" x2="148" y2="172" fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="16"/><path d="M40 92a96 96 0 0 0 0 72M216 92a96 96 0 0 1 0 72" fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="16"/></symbol>
<symbol id="ph-film-strip" viewBox="0 0 256 256"><rect x="32" y="48" width="192" height="160" rx="8" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="128" y1="48" x2="128" y2="208" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="32" y1="80" x2="224" y2="80" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="32" y1="176" x2="224" y2="176" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="80" y1="48" x2="80" y2="80" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="176" y1="48" x2="176" y2="80" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="80" y1="176" x2="80" y2="208" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="176" y1="176" x2="176" y2="208" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></symbol>
<symbol id="ph-scissors" viewBox="0 0 256 256"><circle cx="76" cy="68" r="28" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><circle cx="76" cy="188" r="28" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="96.9" y1="86.6" x2="200" y2="200" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="96.9" y1="169.4" x2="200" y2="56" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></symbol>
<symbol id="ph-gear-six" viewBox="0 0 256 256"><circle cx="128" cy="128" r="40" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><path d="M130.05,206.11c-1.34,0-2.69,0-4,0L94,224a104.61,104.61,0,0,1-34.11-19.2l-.12-36c-.71-1.12-1.38-2.25-2-3.41L25.9,147.24a99.15,99.15,0,0,1,0-38.46l31.84-18.1c.65-1.15,1.32-2.29,2-3.41l.16-36A104.58,104.58,0,0,1,94,32l32,17.89c1.34,0,2.69,0,4,0L162,32a104.61,104.61,0,0,1,34.11,19.2l.12,36c.71,1.12,1.38,2.25,2,3.41l31.85,18.14a99.15,99.15,0,0,1,0,38.46l-31.84,18.1c-.65,1.15-1.32,2.29-2,3.41l-.16,36A104.58,104.58,0,0,1,162,224Z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></symbol>
<symbol id="ph-image" viewBox="0 0 256 256"><rect x="32" y="48" width="192" height="160" rx="8" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><circle cx="156" cy="100" r="12"/><path d="M147.31,164,173,138.34a8,8,0,0,1,11.31,0L224,178.06" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><path d="M32,168.69l54.34-54.35a8,8,0,0,1,11.32,0L191.31,208" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></symbol>
<symbol id="ph-info-fill" viewBox="0 0 256 256"><path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-4,48a12,12,0,1,1-12,12A12,12,0,0,1,124,72Zm12,112a16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40a8,8,0,0,1,0,16Z" fill="currentColor"/></symbol>
<symbol id="ph-info" viewBox="0 0 256 256"><circle cx="128" cy="128" r="96" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><polyline points="120 120 128 120 128 172 136 172" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><circle cx="126" cy="84" r="10" fill="currentColor"/></symbol>
<symbol id="ph-magnifying-glass" viewBox="0 0 256 256"><circle cx="112" cy="112" r="80" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="168.57" y1="168.57" x2="224" y2="224" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></symbol>
<symbol id="ph-book-open" viewBox="0 0 256 256"><path d="M128,88a32,32,0,0,1,32-32h72V200H160a32,32,0,0,0-32,32" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><path d="M24,200H96a32,32,0,0,1,32,32V88A32,32,0,0,0,96,56H24Z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></symbol>
<symbol id="ph-pause-fill" viewBox="0 0 256 256"><path d="M216,48V208a16,16,0,0,1-16,16H160a16,16,0,0,1-16-16V48a16,16,0,0,1,16-16h40A16,16,0,0,1,216,48ZM96,32H56A16,16,0,0,0,40,48V208a16,16,0,0,0,16,16H96a16,16,0,0,0,16-16V48A16,16,0,0,0,96,32Z" fill="currentColor"/></symbol>
<symbol id="ph-pencil-simple" viewBox="0 0 256 256"><path d="M92.69,216H48a8,8,0,0,1-8-8V163.31a8,8,0,0,1,2.34-5.65L165.66,34.34a8,8,0,0,1,11.31,0L221.66,79a8,8,0,0,1,0,11.31L98.34,213.66A8,8,0,0,1,92.69,216Z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="136" y1="64" x2="192" y2="120" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></symbol>
<!-- FILM-43: "Duplicate this storyboard" — two overlapping rounded
rectangles, same currentColor-stroke idiom as every other ph- icon here. -->
<symbol id="ph-copy" viewBox="0 0 256 256"><rect x="88" y="88" width="128" height="128" rx="12" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><path d="M168,88V56a8,8,0,0,0-8-8H56a8,8,0,0,0-8,8V160a8,8,0,0,0,8,8H88" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></symbol>
<symbol id="ph-play-fill" viewBox="0 0 256 256"><path d="M240,128a15.74,15.74,0,0,1-7.6,13.51L88.32,229.65a16,16,0,0,1-16.2.3A15.86,15.86,0,0,1,64,216.13V39.87a15.86,15.86,0,0,1,8.12-13.82,16,16,0,0,1,16.2.3L232.4,114.49A15.74,15.74,0,0,1,240,128Z" fill="currentColor"/></symbol>
<symbol id="ph-sparkle-fill" viewBox="0 0 256 256"><path d="M208,144a15.78,15.78,0,0,1-10.42,14.94L146,178l-19,51.62a15.92,15.92,0,0,1-29.88,0L78,178l-51.62-19a15.92,15.92,0,0,1,0-29.88L78,110l19-51.62a15.92,15.92,0,0,1,29.88,0L146,110l51.62,19A15.78,15.78,0,0,1,208,144ZM152,48h16V64a8,8,0,0,0,16,0V48h16a8,8,0,0,0,0-16H184V16a8,8,0,0,0-16,0V32H152a8,8,0,0,0,0,16Zm88,32h-8V72a8,8,0,0,0-16,0v8h-8a8,8,0,0,0,0,16h8v8a8,8,0,0,0,16,0V96h8a8,8,0,0,0,0-16Z" fill="currentColor"/></symbol>
<symbol id="ph-target" viewBox="0 0 256 256"><line x1="128" y1="128" x2="224" y2="32" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><path d="M195.88,60.12a95.88,95.88,0,1,0,18.77,26.49" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><path d="M161.94,94.06a48,48,0,1,0,14,31.2" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></symbol>
<symbol id="ph-trash-simple" viewBox="0 0 256 256"><line x1="216" y1="56" x2="40" y2="56" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="88" y1="24" x2="168" y2="24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><path d="M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></symbol>
<symbol id="ph-warning-fill" viewBox="0 0 256 256"><path d="M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM120,104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm8,88a12,12,0,1,1,12-12A12,12,0,0,1,128,192Z" fill="currentColor"/></symbol>
<symbol id="ph-x" viewBox="0 0 256 256"><line x1="200" y1="56" x2="56" y2="200" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="200" y1="200" x2="56" y2="56" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></symbol>
<symbol id="ph-x-bold" viewBox="0 0 256 256"><line x1="200" y1="56" x2="56" y2="200" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"/><line x1="200" y1="200" x2="56" y2="56" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="24"/></symbol>
<symbol id="ph-x-circle" viewBox="0 0 256 256"><line x1="160" y1="96" x2="96" y2="160" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="96" y1="96" x2="160" y2="160" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><circle cx="128" cy="128" r="96" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></symbol>
<symbol id="ph-x-circle-fill" viewBox="0 0 256 256"><path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm37.66,130.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32L139.31,128Z" fill="currentColor"/></symbol>
<!-- File-kind icons referenced dynamically by agentAttachIcon(); the
tree-shake regex doesn't see runtime string concatenation. -->
<symbol id="ph-paperclip" viewBox="0 0 256 256"><path d="M160,80,76.69,164.69a16,16,0,0,0,22.63,22.62L198.63,86.63a32,32,0,0,0-45.26-45.26L54.06,142.06a48,48,0,0,0,67.88,67.88L204,128" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></symbol>
<symbol id="ph-file-text" viewBox="0 0 256 256"><path d="M200,224H56a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h96l56,56V216A8,8,0,0,1,200,224Z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><polyline points="152 32 152 88 208 88" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="96" y1="136" x2="160" y2="136" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="96" y1="168" x2="160" y2="168" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></symbol>
<symbol id="ph-file-pdf" viewBox="0 0 256 256"><polyline points="216 152 184 152 184 208" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="208" y1="184" x2="184" y2="184" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><path d="M48,192H64a20,20,0,0,0,0-40H48v56" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><path d="M112,152v56h16a28,28,0,0,0,0-56Z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><path d="M48,112V40a8,8,0,0,1,8-8h96l56,56v24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><polyline points="152 32 152 88 208 88" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></symbol>
<symbol id="ph-folder-simple" viewBox="0 0 256 256"><path d="M224,208H32V72a8,8,0,0,1,8-8H92.69a8,8,0,0,1,5.65,2.34L128,96h88a8,8,0,0,1,8,8V208Z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></symbol>
<symbol id="ph-device-mobile" viewBox="0 0 256 256"><rect x="64" y="24" width="128" height="208" rx="16" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="104" y1="56" x2="152" y2="56" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></symbol>
<symbol id="ph-user-plus" viewBox="0 0 256 256"><circle cx="108" cy="100" r="60" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="200" y1="116" x2="248" y2="116" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="224" y1="92" x2="224" y2="140" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><path d="M16,208c20.83-36.04,57.06-60,104-60s83.17,23.96,104,60" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></symbol>
<symbol id="ph-music-notes" viewBox="0 0 256 256"><circle cx="180" cy="184" r="28" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><circle cx="52" cy="200" r="28" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><polyline points="80 200 80 56 208 24 208 184" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="80" y1="88" x2="208" y2="56" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></symbol>
<symbol id="ph-star" viewBox="0 0 256 256"><path d="M132.4,190.7l50.4,32.5a8,8,0,0,0,12.1-8.7l-15.1-57.7a8,8,0,0,1,2.7-8.3l45.6-37.5a8,8,0,0,0-4.6-14.2l-59.5-3.8a8,8,0,0,1-7-5.1L134.6,31.5a8,8,0,0,0-14.9,0L97.3,87.9a8,8,0,0,1-7,5.1L30.8,96.8a8,8,0,0,0-4.6,14.2l45.6,37.5a8,8,0,0,1,2.7,8.3L60.5,209a8,8,0,0,0,12.1,8.7l50.4-32.5A8,8,0,0,1,132.4,190.7Z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></symbol>
<symbol id="ph-x-brand" viewBox="0 0 24 24"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" fill="currentColor"/></symbol>
<!-- ==== ENGINE MARKS ====================================================
One per row of the ENGINES table (`mark`). Original stroked monograms,
drawn here: this ships in an open-source repo and no third-party brand
mark goes in it, scraped or bundled. Each is a letterform plus one glyph
that says what the engine does, so two engines read apart at 16 px
without impersonating anyone. currentColor throughout — the accent comes
from --eng-accent, which _engine_css() emits from the same table.
ADDING AN ENGINE = one ENGINES entry + one <symbol> here. -->
<!-- LTX-2.3 — "L" with a play wedge. -->
<symbol id="eng-mark-ltx" viewBox="0 0 24 24"><path d="M7.6 6.4v11.2h5.6" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/><path d="M15.6 8.4v7.2l5-3.6z" fill="currentColor"/></symbol>
<!-- Hailuo H3 — "H" with three ascending level bars: the 3, and the sound. -->
<symbol id="eng-mark-h3" viewBox="0 0 24 24"><path d="M5.4 6.4v11.2M11.4 6.4v11.2M5.4 12h6" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round"/><path d="M15.6 10v4M18.6 8.4v7.2M21.4 6.8v10.4" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round"/></symbol>
<!-- Flux Video — "F" with a flow chevron. Rendered only under
LTX_ENGINE_PREVIEW=1; the symbol is free to sit here regardless. -->
<symbol id="eng-mark-music" viewBox="0 0 24 24"><path d="M9 18V5l11-2v13M9 8l11-2" fill="none" stroke="currentColor" stroke-width="2"/><ellipse cx="6" cy="18" rx="3" ry="2" fill="currentColor"/><ellipse cx="17" cy="16" rx="3" ry="2" fill="currentColor"/></symbol>
<symbol id="eng-mark-flux" viewBox="0 0 24 24"><path d="M7.4 17.6V6.4h6.4M7.4 11.6h5" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"/><path d="M16.4 8.6l3.6 3.4-3.6 3.4" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"/></symbol>
<!-- Image models (the Images tab's top picker): a frame plus the model's own sign. -->
<symbol id="eng-mark-img-flux2" viewBox="0 0 24 24"><rect x="3.4" y="4.4" width="17.2" height="15.2" rx="2.6" fill="none" stroke="currentColor" stroke-width="2"/><path d="M8.6 15.6V8.6h4.4M8.6 12h3.4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><circle cx="16" cy="15" r="1.4" fill="currentColor"/></symbol>
<symbol id="eng-mark-img-flux3" viewBox="0 0 24 24"><rect x="3.4" y="4.4" width="17.2" height="15.2" rx="2.6" fill="none" stroke="currentColor" stroke-width="2"/><path d="M7.6 15.6V8.6h4.4M7.6 12h3.4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M14.6 15.6v-2M16.6 15.6v-4M18.2 15.6V9.8" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/></symbol>
<symbol id="eng-mark-img-edit" viewBox="0 0 24 24"><rect x="3.4" y="4.4" width="13.2" height="13.2" rx="2.4" fill="none" stroke="currentColor" stroke-width="2"/><path d="M12.4 19.6l1-3.4 6-6 2.4 2.4-6 6z" fill="currentColor"/></symbol>
<symbol id="eng-mark-img-ideogram" viewBox="0 0 24 24"><rect x="3.4" y="4.4" width="17.2" height="15.2" rx="2.6" fill="none" stroke="currentColor" stroke-width="2"/><path d="M8 9h8M12 9v7" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round"/></symbol>
<symbol id="eng-mark-img-ph3" viewBox="0 0 24 24"><rect x="3.4" y="4.4" width="17.2" height="15.2" rx="2.6" fill="none" stroke="currentColor" stroke-width="2"/><path d="M8 8.6v6.8M12.4 8.6v6.8M8 12h4.4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/><path d="M15.6 10.6v2.8M17.6 9.4v5.2" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/></symbol>
<symbol id="ph-speaker-slash" viewBox="0 0 256 256"><line x1="48" y1="40" x2="208" y2="216" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><path d="M80,168H32a8,8,0,0,1-8-8V96a8,8,0,0,1,8-8H80l72-56V147" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><path d="M152,179v45L94.4,179.2" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></symbol>
</defs>
</svg>
<!-- Update banner. Deliberately a BANNER and not a modal: an update is not an
emergency and a dialog that blocks a running render is worse than being
out of date. Shown only when the version check says we are behind AND the
user has not dismissed THIS version — dismissing 4.1.1 must not silence
4.2.0, which is why the setting stores a version string, not a boolean. -->
<div id="updateBanner" hidden>
<div class="ub-main">
<svg class="ph ub-icon" aria-hidden="true"><use href="#ph-arrow-up"/></svg>
<div class="ub-text">
<strong id="ubTitle">A new version is available</strong>
<span id="ubSub" class="ub-sub"></span>
</div>
<button type="button" class="ub-go" id="ubUpdate">Update now</button>
<button type="button" class="ub-dismiss" id="ubLater" title="Hide until the next version">Later</button>
</div>
<!-- ONE row, both asks, once ever. A second dismissible prompt for
"contribute" would double the nagging to say a smaller thing, and the
moment someone is already looking at our GitHub link is exactly the
moment the contributing link is worth showing. -->
<div class="ub-star" id="ubStar" hidden>
<span>Updating takes a minute — <a href="https://github.com/mrbizarro/phosphene" id="ubStarLink" target="_blank" rel="noopener">a star on GitHub</a> while you wait means the world.</span>
<span class="ub-sep">·</span>
<span>Fixed something, or want to add an engine? <a href="https://github.com/mrbizarro/phosphene/blob/main/CONTRIBUTING.md" id="ubContribLink" target="_blank" rel="noopener">PRs are welcome and get credited</a>.</span>
<button type="button" class="ub-already" id="ubStarDone">Already did</button>
</div>
</div>
<!-- ONE MODAL, TWO SPEAKERS (v4.9): the update pop-up and the maintainer
broadcast share this chrome. A POP-UP, not just the banner, is the owner's
explicit ruling: "it should be a pop-up... people who don't update will be
annoyed by it every time they open the app" — that is the design, not a
defect. Dismissal lasts one page load for updates; broadcasts dismiss
forever per message id. Body renders as textContent, never HTML. -->
<div id="phModalWrap" hidden>
<div id="phModal" role="dialog" aria-modal="true" aria-labelledby="phModalTitle">
<div id="phModalKicker"></div>
<h2 id="phModalTitle"></h2>
<div id="phModalBody"></div>
<div id="phModalActions">
<button type="button" id="phModalSecondary"></button>
<button type="button" id="phModalPrimary"></button>
</div>
</div>
</div>
<header>
<!-- Exact Footer.astro mark; the stage clones this markup. -->
<a href="/" class="brand">
<span class="ph-mark" aria-hidden="true">
<svg class="foot-mark" viewBox="-112 -114 224 228" width="224" height="228">
<g class="fm-morph fm-m0"><g class="fm-spin fm-s0"><path d="M19.00 0.00L29.00 0.00M18.35 4.92L28.01 7.51M16.45 9.50L25.11 14.50M13.44 13.44L20.51 20.51M9.50 16.45L14.50 25.11M4.92 18.35L7.51 28.01M0.00 19.00L0.00 29.00M-4.92 18.35L-7.51 28.01M-9.50 16.45L-14.50 25.11M-13.44 13.44L-20.51 20.51M-16.45 9.50L-25.11 14.50M-18.35 4.92L-28.01 7.51M-19.00 0.00L-29.00 0.00M-18.35 -4.92L-28.01 -7.51M-16.45 -9.50L-25.11 -14.50M-13.44 -13.44L-20.51 -20.51M-9.50 -16.45L-14.50 -25.11M-4.92 -18.35L-7.51 -28.01M-0.00 -19.00L-0.00 -29.00M4.92 -18.35L7.51 -28.01M9.50 -16.45L14.50 -25.11M13.44 -13.44L20.51 -20.51M16.45 -9.50L25.11 -14.50M18.35 -4.92L28.01 -7.51" stroke="#ff3d86" stroke-width="2.6" stroke-linecap="round" fill="none" /></g></g>
<g class="fm-morph fm-m1"><g class="fm-spin fm-s1"><path d="M36.00 0.00L46.00 0.00M35.45 6.25L45.30 7.99M33.83 12.31L43.23 15.73M31.18 18.00L39.84 23.00M27.58 23.14L35.24 29.57M23.14 27.58L29.57 35.24M18.00 31.18L23.00 39.84M12.31 33.83L15.73 43.23M6.25 35.45L7.99 45.30M0.00 36.00L0.00 46.00M-6.25 35.45L-7.99 45.30M-12.31 33.83L-15.73 43.23M-18.00 31.18L-23.00 39.84M-23.14 27.58L-29.57 35.24M-27.58 23.14L-35.24 29.57M-31.18 18.00L-39.84 23.00M-33.83 12.31L-43.23 15.73M-35.45 6.25L-45.30 7.99M-36.00 0.00L-46.00 0.00M-35.45 -6.25L-45.30 -7.99M-33.83 -12.31L-43.23 -15.73M-31.18 -18.00L-39.84 -23.00M-27.58 -23.14L-35.24 -29.57M-23.14 -27.58L-29.57 -35.24M-18.00 -31.18L-23.00 -39.84M-12.31 -33.83L-15.73 -43.23M-6.25 -35.45L-7.99 -45.30M-0.00 -36.00L-0.00 -46.00M6.25 -35.45L7.99 -45.30M12.31 -33.83L15.73 -43.23M18.00 -31.18L23.00 -39.84M23.14 -27.58L29.57 -35.24M27.58 -23.14L35.24 -29.57M31.18 -18.00L39.84 -23.00M33.83 -12.31L43.23 -15.73M35.45 -6.25L45.30 -7.99" stroke="#e2369a" stroke-width="2.6" stroke-linecap="round" fill="none" /></g></g>
<g class="fm-morph fm-m2"><g class="fm-spin fm-s2"><path d="M54.00 0.00L62.00 0.00M53.45 7.69L61.37 8.82M51.81 15.21L59.49 17.47M49.12 22.43L56.40 25.76M45.43 29.19L52.16 33.52M40.81 35.36L46.86 40.60M35.36 40.81L40.60 46.86M29.19 45.43L33.52 52.16M22.43 49.12L25.76 56.40M15.21 51.81L17.47 59.49M7.69 53.45L8.82 61.37M0.00 54.00L0.00 62.00M-7.69 53.45L-8.82 61.37M-15.21 51.81L-17.47 59.49M-22.43 49.12L-25.76 56.40M-29.19 45.43L-33.52 52.16M-35.36 40.81L-40.60 46.86M-40.81 35.36L-46.86 40.60M-45.43 29.19L-52.16 33.52M-49.12 22.43L-56.40 25.76M-51.81 15.21L-59.49 17.47M-53.45 7.69L-61.37 8.82M-54.00 0.00L-62.00 0.00M-53.45 -7.69L-61.37 -8.82M-51.81 -15.21L-59.49 -17.47M-49.12 -22.43L-56.40 -25.76M-45.43 -29.19L-52.16 -33.52M-40.81 -35.36L-46.86 -40.60M-35.36 -40.81L-40.60 -46.86M-29.19 -45.43L-33.52 -52.16M-22.43 -49.12L-25.76 -56.40M-15.21 -51.81L-17.47 -59.49M-7.69 -53.45L-8.82 -61.37M-0.00 -54.00L-0.00 -62.00M7.69 -53.45L8.82 -61.37M15.21 -51.81L17.47 -59.49M22.43 -49.12L25.76 -56.40M29.19 -45.43L33.52 -52.16M35.36 -40.81L40.60 -46.86M40.81 -35.36L46.86 -40.60M45.43 -29.19L52.16 -33.52M49.12 -22.43L56.40 -25.76M51.81 -15.21L59.49 -17.47M53.45 -7.69L61.37 -8.82" stroke="#ba5ce4" stroke-width="2.6" stroke-linecap="round" fill="none" /></g></g>
<g class="fm-morph fm-m3"><g class="fm-spin fm-s3"><path d="M71.00 0.00L80.00 0.00M70.55 7.95L79.50 8.96M69.22 15.80L77.99 17.80M67.02 23.45L75.51 26.42M63.97 30.81L72.08 34.71M60.12 37.77L67.74 42.56M55.51 44.27L62.55 49.88M50.20 50.20L56.57 56.57M44.27 55.51L49.88 62.55M37.77 60.12L42.56 67.74M30.81 63.97L34.71 72.08M23.45 67.02L26.42 75.51M15.80 69.22L17.80 77.99M7.95 70.55L8.96 79.50M0.00 71.00L0.00 80.00M-7.95 70.55L-8.96 79.50M-15.80 69.22L-17.80 77.99M-23.45 67.02L-26.42 75.51M-30.81 63.97L-34.71 72.08M-37.77 60.12L-42.56 67.74M-44.27 55.51L-49.88 62.55M-50.20 50.20L-56.57 56.57M-55.51 44.27L-62.55 49.88M-60.12 37.77L-67.74 42.56M-63.97 30.81L-72.08 34.71M-67.02 23.45L-75.51 26.42M-69.22 15.80L-77.99 17.80M-70.55 7.95L-79.50 8.96M-71.00 0.00L-80.00 0.00M-70.55 -7.95L-79.50 -8.96M-69.22 -15.80L-77.99 -17.80M-67.02 -23.45L-75.51 -26.42M-63.97 -30.81L-72.08 -34.71M-60.12 -37.77L-67.74 -42.56M-55.51 -44.27L-62.55 -49.88M-50.20 -50.20L-56.57 -56.57M-44.27 -55.51L-49.88 -62.55M-37.77 -60.12L-42.56 -67.74M-30.81 -63.97L-34.71 -72.08M-23.45 -67.02L-26.42 -75.51M-15.80 -69.22L-17.80 -77.99M-7.95 -70.55L-8.96 -79.50M-0.00 -71.00L-0.00 -80.00M7.95 -70.55L8.96 -79.50M15.80 -69.22L17.80 -77.99M23.45 -67.02L26.42 -75.51M30.81 -63.97L34.71 -72.08M37.77 -60.12L42.56 -67.74M44.27 -55.51L49.88 -62.55M50.20 -50.20L56.57 -56.57M55.51 -44.27L62.55 -49.88M60.12 -37.77L67.74 -42.56M63.97 -30.81L72.08 -34.71M67.02 -23.45L75.51 -26.42M69.22 -15.80L77.99 -17.80M70.55 -7.95L79.50 -8.96" stroke="#8e4ddf" stroke-width="2.6" stroke-linecap="round" fill="none" /></g></g>
<g class="fm-morph fm-m4"><g class="fm-spin fm-s4"><path d="M87.00 0.00L95.00 0.00M86.61 8.27L94.57 9.03M85.43 16.46L93.28 17.98M83.48 24.51L91.15 26.76M80.77 32.33L88.19 35.31M77.33 39.87L84.44 43.53M73.19 47.04L79.92 51.36M68.39 53.78L74.68 58.73M62.96 60.04L68.75 65.56M56.97 65.75L62.21 71.80M50.46 70.87L55.11 77.38M43.50 75.34L47.50 82.27M36.14 79.14L39.46 86.42M28.45 82.22L31.07 89.78M20.51 84.55L22.40 92.32M12.38 86.11L13.52 94.03M4.14 86.90L4.52 94.89M-4.14 86.90L-4.52 94.89M-12.38 86.11L-13.52 94.03M-20.51 84.55L-22.40 92.32M-28.45 82.22L-31.07 89.78M-36.14 79.14L-39.46 86.42M-43.50 75.34L-47.50 82.27M-50.46 70.87L-55.11 77.38M-56.97 65.75L-62.21 71.80M-62.96 60.04L-68.75 65.56M-68.39 53.78L-74.68 58.73M-73.19 47.04L-79.92 51.36M-77.33 39.87L-84.44 43.53M-80.77 32.33L-88.19 35.31M-83.48 24.51L-91.15 26.76M-85.43 16.46L-93.28 17.98M-86.61 8.27L-94.57 9.03M-87.00 0.00L-95.00 0.00M-86.61 -8.27L-94.57 -9.03M-85.43 -16.46L-93.28 -17.98M-83.48 -24.51L-91.15 -26.76M-80.77 -32.33L-88.19 -35.31M-77.33 -39.87L-84.44 -43.53M-73.19 -47.04L-79.92 -51.36M-68.39 -53.78L-74.68 -58.73M-62.96 -60.04L-68.75 -65.56M-56.97 -65.75L-62.21 -71.80M-50.46 -70.87L-55.11 -77.38M-43.50 -75.34L-47.50 -82.27M-36.14 -79.14L-39.46 -86.42M-28.45 -82.22L-31.07 -89.78M-20.51 -84.55L-22.40 -92.32M-12.38 -86.11L-13.52 -94.03M-4.14 -86.90L-4.52 -94.89M4.14 -86.90L4.52 -94.89M12.38 -86.11L13.52 -94.03M20.51 -84.55L22.40 -92.32M28.45 -82.22L31.07 -89.78M36.14 -79.14L39.46 -86.42M43.50 -75.34L47.50 -82.27M50.46 -70.87L55.11 -77.38M56.97 -65.75L62.21 -71.80M62.96 -60.04L68.75 -65.56M68.39 -53.78L74.68 -58.73M73.19 -47.04L79.92 -51.36M77.33 -39.87L84.44 -43.53M80.77 -32.33L88.19 -35.31M83.48 -24.51L91.15 -26.76M85.43 -16.46L93.28 -17.98M86.61 -8.27L94.57 -9.03" stroke="#6f7cf0" stroke-width="2.6" stroke-linecap="round" fill="none" /></g></g>
<g class="fm-morph fm-m5"><g class="fm-spin fm-s5"><path d="M103.00 0.00L111.00 0.00M102.68 8.08L110.66 8.71M101.73 16.11L109.63 17.36M100.15 24.04L107.93 25.91M97.96 31.83L105.57 34.30M95.16 39.42L102.55 42.48M91.77 46.76L98.90 50.39M87.82 53.82L94.64 58.00M83.33 60.54L89.80 65.24M78.32 66.89L84.41 72.09M72.83 72.83L78.49 78.49M66.89 78.32L72.09 84.41M60.54 83.33L65.24 89.80M53.82 87.82L58.00 94.64M46.76 91.77L50.39 98.90M39.42 95.16L42.48 102.55M31.83 97.96L34.30 105.57M24.04 100.15L25.91 107.93M16.11 101.73L17.36 109.63M8.08 102.68L8.71 110.66M0.00 103.00L0.00 111.00M-8.08 102.68L-8.71 110.66M-16.11 101.73L-17.36 109.63M-24.04 100.15L-25.91 107.93M-31.83 97.96L-34.30 105.57M-39.42 95.16L-42.48 102.55M-46.76 91.77L-50.39 98.90M-53.82 87.82L-58.00 94.64M-60.54 83.33L-65.24 89.80M-66.89 78.32L-72.09 84.41M-72.83 72.83L-78.49 78.49M-78.32 66.89L-84.41 72.09M-83.33 60.54L-89.80 65.24M-87.82 53.82L-94.64 58.00M-91.77 46.76L-98.90 50.39M-95.16 39.42L-102.55 42.48M-97.96 31.83L-105.57 34.30M-100.15 24.04L-107.93 25.91M-101.73 16.11L-109.63 17.36M-102.68 8.08L-110.66 8.71M-103.00 0.00L-111.00 0.00M-102.68 -8.08L-110.66 -8.71M-101.73 -16.11L-109.63 -17.36M-100.15 -24.04L-107.93 -25.91M-97.96 -31.83L-105.57 -34.30M-95.16 -39.42L-102.55 -42.48M-91.77 -46.76L-98.90 -50.39M-87.82 -53.82L-94.64 -58.00M-83.33 -60.54L-89.80 -65.24M-78.32 -66.89L-84.41 -72.09M-72.83 -72.83L-78.49 -78.49M-66.89 -78.32L-72.09 -84.41M-60.54 -83.33L-65.24 -89.80M-53.82 -87.82L-58.00 -94.64M-46.76 -91.77L-50.39 -98.90M-39.42 -95.16L-42.48 -102.55M-31.83 -97.96L-34.30 -105.57M-24.04 -100.15L-25.91 -107.93M-16.11 -101.73L-17.36 -109.63M-8.08 -102.68L-8.71 -110.66M-0.00 -103.00L-0.00 -111.00M8.08 -102.68L8.71 -110.66M16.11 -101.73L17.36 -109.63M24.04 -100.15L25.91 -107.93M31.83 -97.96L34.30 -105.57M39.42 -95.16L42.48 -102.55M46.76 -91.77L50.39 -98.90M53.82 -87.82L58.00 -94.64M60.54 -83.33L65.24 -89.80M66.89 -78.32L72.09 -84.41M72.83 -72.83L78.49 -78.49M78.32 -66.89L84.41 -72.09M83.33 -60.54L89.80 -65.24M87.82 -53.82L94.64 -58.00M91.77 -46.76L98.90 -50.39M95.16 -39.42L102.55 -42.48M97.96 -31.83L105.57 -34.30M100.15 -24.04L107.93 -25.91M101.73 -16.11L109.63 -17.36M102.68 -8.08L110.66 -8.71" stroke="#37cfe3" stroke-width="2.6" stroke-linecap="round" fill="none" /></g></g>
<circle class="fm-core" r="5" fill="#f8e24e" />
</svg>
</span>
<img class="brand-word" src="/assets/phosphene_wordtext.png" alt="Phosphene">
<span id="proMark" class="pro-mark" hidden title="Phosphene Pro is active on this Mac">Pro</span>
</a>
<!-- The standalone version badge is gone: #versionPill already carries the
version in EVERY state it can be in — "Up to date · 4.2.0",
"Update to 4.3.0", "Checking · 4.2.0", "4.2.0 · dev · <sha>",
"4.2.0 · offline". Printing it twice cost a header slot that the
health cluster needed, on the machines where the cluster was
already truncating. -->
__PROFILE_BADGE__
<span class="spacer"></span>
<!-- ============== ENGINE SWITCHER ==============
Which model renders the shot, as a first-class control in the top
right — engine is a CHOICE, everything to the right of the divider is
STATE the machine reports, and the hairline is there to say so. Empty
in the markup: renderEngineSwitch() fills it from BOOT.engines (the
server-side ENGINES table), so a third engine is one Python entry plus
one <symbol>, not a header rewrite. Hidden until then — a Mac that
can't run any optional engine has nothing to choose between, and the
switcher and its divider both disappear (the same gate the old inline
#engineRow had, preserved). -->
<!-- Hardware tier badge — clickable, opens a dialog explaining what
this Mac's RAM tier allows. Modes / qualities the tier doesn't
support are visibly disabled in the form below. -->
<!-- ONE HEALTH CLUSTER (v4.0.5) — every machine-state pill lives in a
single container: one visual unit to scan instead of six loose pills
bleeding across the header, and one SHRINKABLE region, so a narrow
window compresses the cluster instead of shoving the creator chip
into the header's overflow:hidden (the "avatar clipped" report).
Individual pill ids and their JS updaters are untouched. -->
<!-- ONE CHIP (v4.5.0). Six pills across the header truncated on a 14" window
and could not have taken a seventh. The pills are UNCHANGED — same ids,
same updaters, same colour classes — they simply live inside the popover
now, relocated at boot, so nothing downstream had to learn a new shape.
The chip SUMMARISES them: worst state wins the colour, and memory stays
on the face because it is the one number worth a glance.
PORTALED to <body>: <header> is overflow:hidden and would slice it —
the same clipping that once cut off the avatar.
NO `hidden` on this div (4.19.11). It carried a stray one from the
duplicate v4.5.0 build (989aaf1f kept this markup, not that build's
intent), and nothing ever cleared it: the cluster only showed because
`body > header #healthCluster { display: flex }` outranked the UA's
[hidden] rule. When the global `[hidden] { display: none !important }`
landed (VC-07, v4.17.0) it won, and the memory chip vanished from every
install for five releases. test_health_chip_visible.py pins it. -->
<div id="healthCluster" role="group" aria-label="System health">
<button type="button" id="healthChip" aria-haspopup="dialog"
aria-expanded="false" aria-controls="healthPop"
title="System health — click for detail">
<span class="hc-dot" id="hcDot"></span>
<span class="hc-face" id="hcFace">checking…</span>
<svg class="ph hc-caret" aria-hidden="true"><use href="#ph-caret-down-bold"/></svg>
</button>
<div id="healthPop" hidden role="dialog" aria-label="System health detail">
<div class="hc-row" data-pill="tierPill"><span class="hc-label">Tier</span></div>
<div class="hc-row" data-pill="memPill"><span class="hc-label">Memory</span></div>
<!-- SYS-19: "Helper" is the internal subprocess name (mlx_warm_helper.py);
from a creator's chair this row answers "can I render right now",
which "Engine" says plainly. -->
<div class="hc-row" data-pill="helperPill"><span class="hc-label">Engine</span></div>
<div class="hc-row" data-pill="modelsPill"><span class="hc-label">Models</span></div>
<div class="hc-row" data-pill="comfyPill"><span class="hc-label">ComfyUI</span></div>
<div class="hc-row" data-pill="queuePill"><span class="hc-label">Queue</span></div>
<div class="hc-row" data-pill="jobPill"><span class="hc-label">Render</span></div>
</div>
<span id="tierPill" class="pill" style="cursor:pointer" onclick="openTierModal()" title="Click to see what this Mac can do">click for system info</span>
<span id="memPill" class="pill">memory…</span>
<span id="comfyPill" class="pill" style="display:none">comfy…</span>
<span id="helperPill" class="pill">engine…</span>
<!-- Models pill: shows roll-up status (X / Y models ready) and click-opens
a modal with per-repo download buttons. Color reflects readiness:
pill-good = all models present, pill-warn = base ready but Q8 missing,
pill-bad = base incomplete (panel can't render). -->
<span id="modelsPill" class="pill" style="cursor:pointer" onclick="openModelsModal()" title="View / download model status">models…</span>
<span id="queuePill" class="pill">queue 0</span>
<span id="jobPill" class="pill">idle</span>
</div>
<!-- Update-available pill. Hidden by default; renders only when the
/version poller finds the install behind origin/main. Click → modal
listing the unseen commits. We do this because users keep telling
us "I clicked Update but I don't see anything" — by the time they
do, we've usually pushed three more fixes. -->
<!-- Version pill — the "magic button". Always visible so users learn
where to look. Clicking does the right thing for the state:
pill-current Y1.001 click → re-check GitHub now
pill-update ↑ Y1.002 click → git pull (then restart)
pill-restart ↻ restart click → just a reminder hint
pill-dev Y1.001 ⚙ click → toast with reason
pill-checking Y1.001 (idle, while first poll runs)
No modal — confirm() + small toast for everything. -->
<span id="versionPill" class="pill pill-checking" style="cursor:pointer"
onclick="versionPillClick()" title="Phosphene version">phosphene · …</span>
<!-- Bug-report button — neon-pulsing in the header pill row. Opens a
modal that pre-fills environment info + log tail and finishes with a
pre-filled GitHub issue (URL-built client-side, no auth). Sits before
the settings cog so it's where the user looks first when something
feels off. -->
<!-- SYS-25: icon-only buttons had `title` (hover/focus tooltip, set
lazily by tips.js) but no `aria-label`, so a screen reader announced
them as unlabeled until tips.js happened to fire. Static labels
here are read immediately, every time. -->
<button id="bugBtn" class="icon-btn bug-btn" onclick="openBugModal()" aria-label="Report a bug" title="Report a bug — opens GitHub issue with environment pre-filled">
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M8 2l1.88 1.88"></path>
<path d="M14.12 3.88L16 2"></path>
<path d="M9 7.13v-1a3.003 3.003 0 0 1 6 0v1"></path>
<path d="M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6z"></path>
<path d="M12 20v-9"></path>
<path d="M6.53 9C4.6 8.8 3 7.1 3 5"></path>
<path d="M6 13H2"></path>
<path d="M3 21c0-2.1 1.7-3.8 3.8-4"></path>
<path d="M20.97 5c0 2.1-1.6 3.8-3.5 4"></path>
<path d="M22 13h-4"></path>
<path d="M17.2 17c2.1.2 3.8 1.9 3.8 4"></path>
</svg>
</button>
<button id="proBtn" type="button" class="ghost-btn pro-entry" onclick="openProModal(this)" aria-haspopup="dialog" hidden>Pro</button>
<button id="stopComfyBtn" class="ghost-btn" style="display:none" onclick="api('/stop_comfy', 'POST').then(poll)">Stop Comfy</button>
<!-- Official Phosphene account on X (2026-05-18). Sits next to the
"by Bizarro" creator credit so the two brand links read as a
single right-corner cluster. Subtle pulsing glow uses the
Phosphene gradient (blue → violet) so it pulls the eye without
being loud. Tooltip on hover; the link itself opens a new tab. -->
<!-- The star has a PERMANENT home, not only the one-time row in the update
banner. That row is gated on being behind, so a user who keeps Phosphene
current — the people most likely to star it — could never see it, and
there was no way to find it on purpose. This is a static link, never a
prompt: no badge, no pulse, no counter. -->
<a class="icon-btn star-link" id="starLink"
href="https://github.com/mrbizarro/phosphene" target="_blank" rel="noopener"
aria-label="Star Phosphene on GitHub" title="Star Phosphene on GitHub">
<svg class="ph" aria-hidden="true"><use href="#ph-star"/></svg>
</a>
<a class="phosphene-x-link" href="https://x.com/PhospheneAI" target="_blank" rel="noopener"
aria-label="Follow @PhospheneAI on X" title="Follow @PhospheneAI on X — the official Phosphene account">
<svg class="ph" aria-hidden="true"><use href="#ph-x-brand"/></svg>
</a>
<a class="creator-link" href="https://x.com/AIBizarrothe" target="_blank" rel="noopener" title="Follow Mr. Bizarro on X (the panel's creator)">
<img src="/assets/bizarro-avatar.jpg" class="creator-avatar" alt="">
<span>by Bizarro</span>
<span class="x-icon"><svg class="ph" aria-hidden="true"><use href="#ph-arrow-square-out"/></svg>X</span>
</a>
</header>
<main class="layout">
<!-- THE TOOL RAIL (redesign v2.1). The studio's places, as an app holds
them: a column of icons with their names, down the left edge, the
current one marked. v2 put them in the title bar as the website's
word menu, and a word menu is a page's navigation, not a tool
switcher: it crowded the bar, lost the icons people scan by, and had
nowhere to grow. A rail takes a new place as one more row. Absolutely
positioned inside main.layout (which pads for it), so no grid column
rule anywhere has to learn about it. Docs and Settings sit at its
foot, where an app keeps them. -->
<aside class="tool-rail" id="toolRail" aria-label="Studio">
<!-- Workflow tabs: Manual (the unified generate form), Characters
(pick a trained character + scene + ship), Train (train new
character LoRAs). Default = manual; the choice persists in
localStorage so the user lands on the same tab next session. -->
<!-- SYS-25, accessibility: this was a plain row of <button>s — 0
role=tablist, 0 role=tab, 0 aria-selected anywhere on the page.
A screen reader had no way to know this was a tab strip, which
tab was active, or how many there were. workflowSwitch()
(editor.js) keeps aria-selected in sync with .active. -->
<nav class="workflow-tabs" id="workflowTabs" role="tablist" aria-label="Workflow">
<button data-workflow="manual" class="active" role="tab" aria-selected="true"><svg class="ph wf-icon" aria-hidden="true"><use href="#ph-film-strip"/></svg>Video</button>
<!-- One Shot is its own door (2026-09-08): one continuous shot of 30 s – 2 min,
with its own composer and its own API (POST /oneshot). It was a mode chip
on the video form; a shot that never cuts is a different thing to make
than a clip, and it gets the tab. -->
<button data-workflow="oneshot" role="tab" aria-selected="false"><svg class="ph wf-icon" aria-hidden="true"><use href="#ph-target"/></svg>One Shot</button>
<button data-workflow="studio" role="tab" aria-selected="false"><svg class="ph wf-icon" aria-hidden="true"><use href="#ph-image"/></svg>Images</button>
<!-- Storyboard sits next to the video surfaces; Audio and Train are the
two "go elsewhere and come back" tabs. No NEW badge on purpose —
with no film in progress the panel must look exactly as it did
yesterday, plus one calm word. The count span is filled only while
a storyboard render is actually in flight. -->
<button data-workflow="storyboard" role="tab" aria-selected="false"><svg class="ph wf-icon" aria-hidden="true"><use href="#ph-film-slate"/></svg>Storyboard<span class="new-badge sb-live" id="sbTabCount" hidden></span></button>
<!-- The Editor is a PLACE, not a room inside the Storyboard. It opens
with no board, on clips from any engine, and it stays open while
you go and look at something else. -->
<button data-workflow="editor" role="tab" aria-selected="false"><svg class="ph wf-icon" aria-hidden="true"><use href="#ph-scissors"/></svg>Editor</button>
<button data-workflow="audio" role="tab" aria-selected="false"><svg class="ph wf-icon" aria-hidden="true"><use href="#ph-music-notes"/></svg>Audio<span class="new-badge">NEW</span></button>
<button data-workflow="train" role="tab" aria-selected="false"><svg class="ph wf-icon" aria-hidden="true"><use href="#ph-user-plus"/></svg>Train Character</button>
<!-- Remote Control: drive this Mac from the iPhone app. The page is Studio UI; the
working parts are Pro-only and come from the Pro pack (see panel/routes_remote.py). -->
<button data-workflow="remote" role="tab" aria-selected="false"><svg class="ph wf-icon" aria-hidden="true"><use href="#ph-remote"/></svg>Remote Control<span class="new-badge">NEW</span><span class="rail-pro" title="Remote Control is part of Pro">Pro</span></button>
</nav>
<div class="rail-foot">
<!-- DOCS. The manual gets a door of its own beside the gear, with a WORD on
it: an icon alone is the discoverability problem the Docs exist to fix
(users asked for features that already shipped because nothing on
screen used their words). ? opens it too, on the shortcuts page. -->
<button id="docsBtn" type="button" class="icon-btn docs-btn" onclick="openDocs()"
data-shortcut="docs.open" title="Docs on phosphene.video — how every tool works, and every shortcut (opens in your browser)">
<svg class="ph" aria-hidden="true"><use href="#ph-book-open"/></svg><span class="docs-btn-word">Docs</span>
</button>
<!-- Settings cog: opens the modal that lets users pick output codec
presets (Standard / Video production / Web / Custom). Sits between the
runtime pills and Stop Comfy so it's findable but not loud. -->
<button id="settingsBtn" class="icon-btn" onclick="openSettingsModal()" aria-label="Settings" title="Settings — models, rendering, output, accounts">
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<circle cx="12" cy="12" r="3"></circle>
<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"></path>
</svg><span class="rail-label">Settings</span>
</button>
</div>
</aside>
<!-- ============== REMOTE CONTROL PAGE ============== -->
<section class="remote-page" id="remoteSection" aria-labelledby="rmTitle" hidden>
<div class="rm-wrap">
<header class="rm-head">
<div class="rm-mark" aria-hidden="true"><svg class="ph"><use href="#ph-remote"/></svg></div>
<div class="rm-head-text">
<h2 id="rmTitle">Remote Control</h2>
<p class="rm-lede">Control Phosphene from your iPhone: send prompts, watch progress, play and save finished clips. Your Mac does the rendering.</p>
</div>
<div class="rm-conn" id="rmConn" role="status" aria-live="polite">
<span class="rm-dot" id="rmConnDot"></span><span id="rmConnText">Checking…</span>
</div>
</header>
<div class="rm-pro" id="rmPro" hidden>
<div class="rm-pro-copy">
<span class="rm-pro-kicker">Phosphene Pro</span>
<strong>Remote Control comes with Phosphene Pro.</strong>
<p>The Phosphene Remote iPhone app is free on the <a href="https://apps.apple.com/app/id6827562294" target="_blank" rel="noopener">App Store</a>. It works with your Mac once Pro is on.</p>
<p>Use your iPhone to start renders, follow their progress and save finished clips. Your Mac does the rendering.</p>
<ul class="rm-pro-list">
<li>Write a prompt and pick settings on your phone</li>
<li>See progress and get the clip when it's done</li>
<li>Play it and save it to your Photos</li>
</ul>
<p class="rm-pro-note">Pro supports the open-source project.</p>
<div class="rm-pro-actions">
<a class="rm-btn primary" href="https://phosphene.video/pricing/" data-utm-campaign="get-pro" data-utm-content="remote-panel" target="_blank" rel="noopener">See Phosphene Pro</a>
<a class="rm-btn" href="https://apps.apple.com/app/id6827562294" target="_blank" rel="noopener">Get the iPhone app</a>
<a class="rm-btn" href="https://phosphene.video/remote/" data-utm-campaign="remote" data-utm-content="remote-panel" target="_blank" rel="noopener">How Remote Control works</a>
</div>
</div>
<div class="rm-pro-phone" aria-hidden="true">
<video src="/assets/remote/remote-film.mp4" poster="/assets/remote/remote-film.webp" muted loop autoplay playsinline preload="metadata"></video>
</div>
</div>
<!-- A Pro member whose studio has no Remote module yet (the Pro pack is still installing,
or this is the free build on a Pro Mac): status, never the upsell above. -->
<div class="rm-card rm-pro-wait" id="rmProWait" hidden>
<h3 id="rmWaitTitle">Remote Control is not set up yet</h3>
<p id="rmWaitBody">Your Pro licence is active. Checking for the Remote Control components.</p>
<p class="rm-wait-err" id="rmWaitErr" hidden></p>
<div class="rm-wait-actions">
<button type="button" class="rm-btn primary" id="rmWaitStart" hidden onclick="rmStartInApp()">Set up Remote</button>
<button type="button" class="btn" id="rmWaitRetry" hidden onclick="rmPartsRetry()">Try again</button>
<button type="button" class="btn" id="rmWaitSettings" hidden onclick="openProModal()">Open Pro settings</button>
</div>
</div>
<div class="rm-grid" id="rmMain" hidden>
<section class="rm-card rm-pair" aria-labelledby="rmPairTitle">
<h3 id="rmPairTitle">Pair your iPhone</h3>
<ol class="rm-steps">
<li><span class="rm-n">1</span><div><b>Get the iPhone app.</b> Install <a href="https://apps.apple.com/app/id6827562294" target="_blank" rel="noopener"><em>Phosphene Remote</em> from the App Store</a>.</div></li>
<li><span class="rm-n">2</span><div><b>Scan this code.</b> Open the app, tap <em>Pair with a Mac</em> and point it here. Same Wi-Fi is the easiest way.</div></li>
<li><span class="rm-n">3</span><div><b>Allow it on this Mac.</b> Check both screens show the same 6 digits, then press Allow.</div></li>
</ol>
<div class="rm-stage" id="rmStage">
<div class="rm-qr-idle" id="rmQrIdle">
<div class="rm-qr-ghost" aria-hidden="true"></div>
<button type="button" class="rm-btn primary" id="rmPairBtn">Show pairing code</button>
</div>
<div class="rm-qr-live" id="rmQrLive" hidden>
<div class="rm-qr-tile"><canvas id="rmQr" width="320" height="320" aria-label="Pairing code to scan with the Phosphene Remote app"></canvas></div>
<div class="rm-qr-meta">
<span id="rmCountdown" class="rm-mono">5:00</span>
<span class="rm-sep">·</span><span>one phone, one use</span>
<button type="button" class="rm-link" id="rmQrCancel">Cancel</button>
</div>
</div>
<div class="rm-allow" id="rmAllow" hidden>
<div class="rm-allow-head"><span class="rm-pulse"></span><span id="rmAllowName">A phone</span> wants to pair</div>
<div class="rm-code" id="rmAllowCode" aria-label="Pairing code">000 000</div>
<p class="rm-hint">Allow only if your iPhone shows the same 6 digits.</p>
<fieldset class="rm-scope">
<legend class="sr-only">Which clips this phone can see</legend>
<label><input type="radio" name="rmScope" value="all" checked> <span>All my clips</span></label>
<label><input type="radio" name="rmScope" value="own"> <span>Only clips made from that phone</span></label>
</fieldset>
<div class="rm-allow-actions">
<button type="button" class="rm-btn primary" id="rmAllowYes">Allow</button>
<button type="button" class="rm-btn" id="rmAllowNo">Don't allow</button>
</div>
</div>
</div>
<p class="rm-error" id="rmError" role="alert" hidden></p>
</section>
<div class="rm-col">
<section class="rm-card" aria-labelledby="rmPhonesTitle">
<div class="rm-card-head"><h3 id="rmPhonesTitle">Paired phones</h3><span class="rm-count" id="rmPhonesCount"></span></div>
<ul class="rm-phones" id="rmPhones"></ul>
<p class="rm-empty" id="rmPhonesEmpty">No phone is paired yet.</p>
</section>
<section class="rm-card" aria-labelledby="rmConnTitle">
<div class="rm-card-head"><h3 id="rmConnTitle">Connection</h3>
<label class="rm-switch" title="Turn Remote Control on or off"><input type="checkbox" id="rmEnable"><span class="rm-slider"></span><span class="sr-only">Remote Control on</span></label>
</div>
<dl class="rm-facts">
<div><dt>Same Wi-Fi</dt><dd id="rmFactLan">—</dd></div>
<div><dt>Away from home</dt><dd id="rmFactRelay">—</dd></div>
<div><dt>Name your phone sees</dt><dd><input type="text" id="rmName" maxlength="40" aria-label="Name your phone sees" spellcheck="false"></dd></div>
</dl>
<p class="rm-hint">Keep this Mac awake while you use the remote. Everything between your iPhone and this Mac is encrypted.</p>
<button type="button" class="rm-link danger" id="rmForgetAll" hidden>Remove all phones and reset</button>
</section>
</div>
</div>
</div>
</section>
<!-- ============== FORM PANE ============== -->
<aside class="form-pane">
<!-- THE MODEL COMES FIRST. Which engine you are in decides everything
under it (the modes it makes, its quality ladder, its settings), so
the picker heads the column, above the modes and the prompt. v2.1 put
it beside Generate, where it read as a last-minute option for one
shot rather than the world you are working in. Same element and ids,
filled by renderEngineSwitch() from the ENGINES registry and shown on
any surface with more than one engine (video, images, music); its
menu opens downward from here (toggleEngineMenu). The divider is the
header-era span the renderer still toggles; it draws nothing here.
FIRST CHILD OF THE COLUMN (owner, 5 Nov 2026): nothing sits above it,
not the models card (#modelsInline, now directly under it), not a
first-run notice. On rc.2 the "Ready to render · N add-ons" card sat
above this row and pushed "Model" down until it no longer read as the
first choice. The Images tab fills this same picker with its image
models (registry rows with surfaces=["image"]); the Images form keeps
only the picked model's versions. -->
<div class="engine-pick">
<span class="engine-pick-label">Model</span>
<div class="engine-switch" id="engineSwitch" role="group" aria-label="Render engine" hidden></div>
<span class="hdr-div" id="engineSwitchDivider" hidden></span>
</div>
<!-- The original manual form is unchanged; it sits below in the DOM
and is shown/hidden by JS as the workflow tab toggles. -->
<!-- Inline models card. Sits right under the Model picker and ABOVE the mode picker because for many
users the very first thing they need to do is download base
weights — burying that in a header modal hides the whole point
of the panel. Lives OUTSIDE #genForm so it persists across the
video-form ↔ Image-Studio swap. -->
<div id="modelsInline" class="models-inline" style="display:none">
<button type="button" class="models-inline-dismiss" id="modelsInlineDismiss"
title="Hide this card (won't show again until model state changes)"
onclick="dismissModelsCard()"><svg class="ph" aria-hidden="true"><use href="#ph-x-bold"/></svg></button>
<div class="models-inline-body">
<div class="models-inline-icon" id="modelsInlineIcon"><svg class="ph" aria-hidden="true"><use href="#ph-download-simple"/></svg></div>
<div class="models-inline-text">
<div class="ttl" id="modelsInlineTitle" role="status" aria-live="polite">Download required</div>
<div class="sub" id="modelsInlineSub" aria-live="polite">Click to start.</div>
<div class="models-inline-progress" id="modelsInlineProgress" style="display:none">
<div class="bar"><div class="fill" id="modelsInlineFill" style="width:0%"></div></div>
<div class="last" id="modelsInlineLast"></div>
</div>
</div>
<div class="models-inline-actions" id="modelsInlineActions"></div>
</div>
<button type="button" class="models-inline-link" onclick="openModelsModal()">Manage all models →</button>
</div>
<!-- SYS-16 (priority item): "no first-run path" -- a fresh 8 GB Mac and
a 64 GB Studio saw the same empty prompt and placeholder, no example,
no sample output. Shown when BOOT.first_run is true (server-computed
from the SAME flag render_completed's first_render prop uses — "has
this install ever finished a render"), hidden the moment poll() sees
the first done history entry (renderFirstRunCard, boot.js), or on
manual dismiss (persisted in panel_settings, same one-shot shape as
the models-card dismissal). Lives OUTSIDE #genForm for the same
reason modelsInline does: visible across the video-form <-> Studio
swap is irrelevant here (Studio isn't the first thing to try), so it
is hidden there in JS instead. -->
<!-- Mode bar — segmented chip strip. Lifted OUT of #genForm so it
stays visible when the user switches to Image Studio (which hides
#genForm). Without this, once a user clicks Studio they had no
way back to T2V/I2V short of refreshing. The hidden #mode input
stays inside #genForm (further below) so the video form's
FormData picks it up. The element keeps id=modeGroup and each
chip keeps data-mode + .pill-btn (alongside .mode-chip) so the
existing setMode() click wiring keeps working unchanged. -->
<!-- SYS-25: tab semantics finished here via a MutationObserver
(main.js, _wireModeGroupTabSemantics) rather than editing each of
the ~6 places that toggle .active on these chips (boot.js,
characters.js, engines.js, settings.js -- multiple packages'
territory in this same mega-ship pass) — role=tab +
aria-selected stay correct no matter which call site changes
.active, with zero changes to that shared toggle logic. -->
<div class="mode-bar pill-group" id="modeGroup" role="tablist" aria-label="Mode">
<button type="button" class="mode-chip pill-btn" data-mode="t2v">Text<span class="mc-sub sub">prompt → video</span></button>
<!-- Character intent — Codex C+ 2026-05-17. Promoted from a chip
strip inside T2V to a first-class mode pill so the cascade
(character selected → quality flips to Q8, LoRAs auto-stack,
audio LoRA fuses) is visible in the mode picker, not a hidden
toggle inside another mode. Q8-only — hidden on cap_tier="q4". -->
<button type="button" class="mode-chip pill-btn" data-mode="character">Character<span class="mc-sub sub">trained face + voice</span></button>
<button type="button" class="mode-chip pill-btn" data-mode="i2v">Image<span class="mc-sub sub">image + prompt</span></button>
<!-- VA-33: renamed from "FFLF" — creator words, and distinct from the
in-form "FFLF / Multi-Keyframe" toggle these chips duplicate
(that toggle stays: it's the only way to change the keyframe
COUNT once inside the section, not just enter it). -->
<button type="button" class="mode-chip pill-btn" data-mode="keyframe" title="First-frame / last-frame interpolation (FFLF)">Start & end frame<span class="mc-sub sub">first + last</span></button>
<!-- Multi-keyframe shares backend mode="keyframe"; the form dropdown
chooses any total anchor count from 3–8. -->
<button type="button" class="mode-chip pill-btn" data-mode="keyframe" data-kf-default="multi">Keyframes<span class="mc-sub sub">3–8 frames</span></button>
<button type="button" class="mode-chip pill-btn" data-mode="extend">Extend<span class="mc-sub sub">continue a clip</span></button>
<button type="button" class="mode-chip pill-btn" data-mode="v2a" data-h3-only title="Hailuo H3 — give a silent (or any) clip new sound made for its picture. The picture is kept exactly.">Add sound<span class="mc-sub sub">your clip → its sound</span></button>
<!-- VA-01: lip-sync's only entrance used to be Audio tab → Music video
→ a folded "One shot (audio → video)" row that shared its name
with the unrelated One Shot tab — nothing on the Video mode bar
ever said "lip-sync", "talking" or "dub". This chip does not set
a #genForm mode (data-mode intentionally absent); the click
delegate below special-cases data-lipsync and calls
openLipSyncEntry(), which jumps to the Audio tab's one-shot form
(its own submit path — audioStudioGenerate, mode=a2v). -->
<button type="button" class="mode-chip pill-btn" data-lipsync="1" title="Audio → Video — a picture (optional) and a stretch of audio become one clip whose mouth follows the track.">Lip-sync<span class="mc-sub sub">picture + your audio → it talks / sings</span></button>
<!-- Remix — the IC-LoRA reference tools (Ingredients / Control / Colorize)
grouped under ONE pill so the mode bar stays uncluttered. All three
run on Q4 distilled (unlike FFLF/Extend/Character, which are Q8-only
and hidden on the Q4 tier), so the parent is visible at every tier.
Clicking it reveals #remixSubGroup and resumes the last-used tool
(default Ingredients). The backend modes stay ingredients/control/
restore — this is PURE UI grouping (see REMIX_MODES + setMode + the
#remixSubGroup click wiring). -->
<!-- The sub-line NAMES THE TOOLS, and that is the whole point of it.
"your media → new video" described the group correctly and told
nobody what was inside, so Motion Control — shipped, official
weights, in this menu — was asked for twice as a missing feature
(@sohaibpp on Pinokio: "Motion control"; a long-time user on X:
"would love to see IC-LoRA support … exposed in the UI"). This is
the only Remix copy visible without a click, so it carries the
searchable words. -->
<button type="button" class="mode-chip pill-btn" data-mode="remix">Remix<span class="mc-sub sub">motion control · refs · color</span></button>
<!-- "Train" used to live here as a mode chip; promoted 2026-05-15 to
a workflow tier (top tab strip). "Studio" (image generation) also
lived here until 2026-05-17 — Mr Bizarro flagged that mixing image gen
into the video mode strip didn't make sense, so it's been
promoted to its own workflow tab as well. setMode('image') is
still the entry point; workflowSwitch('studio') just calls it
after hiding the other panes. -->
</div>
<!-- Remix sub-tools — second-level selector, visible ONLY when a Remix mode
is active (toggled in setMode via REMIX_MODES). Each sub-pill sets the
REAL backend mode (data-remix → setMode); the parent Remix pill above
stays lit. Inline styles use var(--x, fallback) so they're safe whether
or not the theme defines those vars. -->
<div id="remixSubGroup" style="display:none;margin:-2px 0 12px;padding:9px 11px;border:1px solid var(--line,#262a33);border-left:3px solid var(--accent,#8b7bff);border-radius:11px;background:var(--accent-wash,rgba(139,123,255,.06))">
<div style="font-size:11px;letter-spacing:.13em;text-transform:uppercase;color:var(--dim,#7a8194);margin-bottom:7px">Remix tool · bring your own media · IC-LoRA</div>
<div class="mode-bar pill-group">
<button type="button" class="mode-chip pill-btn" data-remix="ingredients" title="Ingredients IC-LoRA — 2–8 reference images (a face, a prop, a location) composed into one new clip.">Ingredients<span class="mc-sub sub">2–8 refs → one clip</span></button>
<!-- "Control" said nothing about what it controls. The name people
actually search for is Motion Control / Union Control, and the
title carries the adapter's real name so a user who read about
LTX IC-LoRAs elsewhere recognises it here. -->
<button type="button" class="mode-chip pill-btn" data-remix="control" title="Union Control IC-LoRA — the render copies the motion, camera move, composition and pose of a clip you supply, while the prompt repaints the subject and scene. Feed it an ordinary video, or a pose / depth / canny sequence you already have.">Motion Control<span class="mc-sub sub">its motion → your scene</span></button>
<button type="button" class="mode-chip pill-btn" data-remix="restore" title="Colorize IC-LoRA — adds natural color to a black-and-white or desaturated clip.">Colorize<span class="mc-sub sub">B&W clip → color</span></button>
<!-- Upscale & Face Fix (was "Upscale ×2" / "LTX Upscale"; mode stays
`upscale`) — the LTX-2.5 Pixel Spatial Upscaler IC-LoRA. A
generative 2× enlarge: the source clip rides the reference
channel and the 2.5 base re-renders every pixel at twice the
canvas (up to this Mac's i2v cap). The natural partner of an H3
draft: H3 does the story and the sound at a small canvas, LTX
2.5 does the pixels. Works on any clip in Outputs. -->
<button type="button" class="mode-chip pill-btn" data-remix="upscale" title="Upscale & Face Fix — LTX-2.5 Pixel Spatial Upscaler IC-LoRA. Re-renders a clip at twice its size with real generated detail (not a filter) and keeps the face and the sound. Made for H3 drafts, works on any clip. One click from any clip: the Upscale & Face Fix button under the player.">Upscale & Face Fix<span class="mc-sub sub">any clip → 2× sharper · face kept</span></button>
</div>
<!-- One LTX generation runs at a time (2.3 or 2.5). Filled by
renderLtxGenSwitch() ONLY when this install has both; empty and
hidden otherwise. Ingredients needs 2.3, so the switch sits with it. -->
<div id="ltxGenSwitch" class="eng-gen eng-gen-inline" hidden></div>
</div>
<form id="genForm">
<!-- SYS-16's first-run card lives INSIDE #genForm (4.17 integration):
the sticky Generate footer can only stick within its own form, so a
card above the form pushed the form's top down far enough that at
1366x768 / 1280x800 Generate sat under the Now pane on a first run. -->
<div id="firstRunCard" class="first-run-card" style="display:none">
<button type="button" class="first-run-dismiss" id="firstRunDismiss"
title="Hide this card" aria-label="Hide this card"
onclick="dismissFirstRunCard()"><svg class="ph" aria-hidden="true"><use href="#ph-x-bold"/></svg></button>
<div class="ttl">Make your first clip</div>
<div class="sub">One click renders a starter clip at Balanced, the size this Mac handles best<span id="firstRunEta"></span>.</div>
<div class="first-run-prompts" id="firstRunPrompts">
<button type="button" class="first-run-prompt-btn" onclick="useFirstRunPrompt(this)" data-first-run-prompt="A whale made of morning fog drifts slowly through an empty city street at dawn, brushing past streetlights that flicker as it passes. Camera follows at walking height. Sound: a deep distant whale song, soft wind, a streetlight buzzing.">A fog whale in an empty city</button>
<button type="button" class="first-run-prompt-btn" onclick="useFirstRunPrompt(this)" data-first-run-prompt="A grand piano sits alone on a frozen lake under a pink sky. Its keys press themselves and tiny snow avalanches fall from the lid with each note. Slow push-in. Sound: a slow, simple piano melody, ice creaking.">A piano on a frozen lake</button>
<button type="button" class="first-run-prompt-btn" onclick="useFirstRunPrompt(this)" data-first-run-prompt="An old lighthouse keeper opens his door and the ocean outside is perfectly still, like glass, reflecting a giant moon close to the horizon. He steps onto the water. Sound: his boots tapping on the surface, a low hum.">The lighthouse keeper and the moon</button>
</div>
<a href="#" class="first-run-sample-link" onclick="downloadSampleCharacter(); return false;">Or get the sample character (Bizarro) →</a>
</div>
<input type="hidden" name="preset_label" id="preset_label" value="">
<input type="hidden" name="mode" id="mode" value="t2v">
<input type="hidden" name="quality" id="quality" value="balanced">
<!-- UI token is separate from the pipeline quality: Pro and High share
1024×576 but must round-trip to different schedules. -->
<input type="hidden" name="quality_choice" id="quality_choice" value="">
<!-- The DURATION axis's own field. It is a LABEL for the shape, not the
shape itself: #duration and #frames remain what the render reads, and
_ltxApplyShape writes all three together. A cell key here means "the
user picked this rung"; empty means a custom duration, which lights
no chip and prints itself in #ltxLengthMeta. -->
<input type="hidden" name="ltx_length" id="ltx_length" value="5s">
<input type="hidden" name="accel" id="accel" value="off">
<input type="hidden" name="temporal_mode" id="temporal_mode" value="native">
<input type="hidden" name="upscale" id="upscale" value="fit_720p">
<!-- HQ skip-step optimization (Codex 2026-05-15 finding). Default 0
= upstream behavior. Set to 1 by _setCharacterQuality when a
character is selected — saves ~54 s (12.6%) on the locked 7 s
Q8 HQ recipe with no visible quality cost. See
lora-lab/outputs/overnight_2026-05-15/SPEED_RESULTS_CODEX.md
for the validation grid. Patches in samplers.py + helper line
1625-26 land the value at the HQ pipeline. -->
<!-- video_skip_step / audio_skip_step hidden inputs removed in v4.0.5:
the engine boundary dropped both, so they were provenance noise. -->
<!-- LTX-2.5 distilled schedule preset: "" = tuned default, "fast" = the
graded 5+2 draft schedule (a DIFFERENT take). make_job gates it to
the lane that defines it; the Speed pills in Customize write it. -->
<input type="hidden" name="schedule_preset" id="schedule_preset" value="">
<div id="warnBanner" class="warn-banner"></div>
<!-- ============== CHARACTERS PICKER · COMPACT AVATAR STRIP ==============
Redesigned 2026-05-18 (round 2) per Mr Bizarro's feedback: the flat
card from the morning was still too bulky and visually
disconnected from the prompt. New shape: a thin row of round
avatars right ABOVE the prompt, integrated into the composer
card itself. Selected avatar gets a colored ring; clicking
switches characters in one tap. Strength tucks into the
Customize accordion (it's an advanced control, not a top-
level decision). Hover an avatar to see the name + trigger.
Empty + applied-note remain in the DOM for the JS hooks but
render as inline thin strings (or hide entirely) so they
don't punch a hole through the composer layout.
IDs preserved: charsList / charsEmpty / charsStrengthRow /
charsAppliedNote / charsSummaryMeta — JS layer untouched. -->
<!-- data-ltx-only, added with the rest of the engine scoping: a trained
character is a pair of LTX LoRAs fused into an LTX checkpoint. H3
runs its own subprocess against its own weights and stacks nothing —
`character` is in its excluded_modes for exactly that reason. The
avatar strip sits in t2v, which H3 DOES serve, so without this tag it
was the loudest LTX-only surface still showing on an H3 render. -->
<div class="mode-only" id="manualCharactersPickerSlot" data-ltx-only>
<div class="chars-strip">
<div class="chars-avatar-row" id="charsList"><!-- avatars rendered by JS --></div>
<button type="button" class="chars-strip-action"
title="Manage characters — rename or delete"
onclick="openCharactersManageModal()"><svg class="ph" aria-hidden="true"><use href="#ph-pencil-simple"/></svg></button>
<button type="button" class="chars-strip-action"
title="Rescan mlx_models/characters/ for new bundles"
onclick="refreshManualCharacters()"><svg class="ph" aria-hidden="true"><use href="#ph-arrow-clockwise-bold"/></svg></button>
</div>
<div class="chars-q4-note">__Q8_CHARACTER_INSTALL_COPY__</div>
<!-- One-liner that surfaces under the strip when a character is
active. Shows trigger word + a tiny strength control inline.
charsSummaryMeta stays as a hidden carrier for legacy JS
callsites that still write to it. -->
<div class="chars-strip-active" id="charsAppliedNote" hidden></div>
<span class="chars-strip-meta-shadow" id="charsSummaryMeta" hidden></span>
<!-- Empty state — visible only when no bundles exist on disk. -->
<div class="chars-strip-empty" id="charsEmpty" hidden>
No trained characters yet —
<a href="#" onclick="workflowSwitch('train'); return false;">train one in the Train tab</a>,
or
<button type="button" class="ghost-btn js-get-sample-char" style="padding:2px 8px;font-size:12px"
onclick="downloadSampleCharacter()">get a sample character (Bizarro)</button>
to try it right now.
<div class="js-get-sample-char-status" style="font-size:12px;opacity:.9;margin-top:6px" hidden></div>
</div>
<!-- Strength row carrier (kept in DOM for JS toggles; hidden
from view — the slider lives inside charsAppliedNote when a
character is selected so it sits right next to the trigger
reminder rather than as its own bulky row). -->
<div class="chars-strength-row" id="charsStrengthRow" hidden></div>
</div>
<input type="hidden" name="character_id" id="characterIdInput" value="">
<input type="hidden" name="character_strength" id="characterStrength" value="1.0">
<!-- The VOICE half of a character's strength. A character is two trained
files and the face file's audio-branch deltas are noise that is
louder than the voice file's signal at equal strength — which is why
the voice gets its own number, not why it should be turned up. The
default is the graded pair, 1.0/1.0, and it beat a hotter arm on the
owner's ear. The split control below is still there if a particular
voice is being drowned.
MUST be in make_job's named reads or it silently no-ops. -->
<input type="hidden" name="character_voice_strength" id="characterVoiceStrength" value="1.0">
<!-- ============== COMPOSER CARD ==============
Hero element of the form. Carries the reference picker(s)
(mode-conditional), the prompt textarea, and an inline tools
strip (Enhance + HDR + No-music + Avoid disclosure). One
elevated surface so the prompt reads as the primary input. -->
<div class="composer-card">
<!-- Slot for the mode-conditional reference pickers. Each
.mode-only block is shown/hidden by setMode(); when none are
active (T2V), the slot collapses (CSS :empty/:not(.show)). -->
<div class="composer-refs">
<!-- Face to keep (4.20, Hailuo H3, Text and Image): an optional photo
of a face the runner packs as a reference image (MiniMax's
ref2va block on our model). Shown by updateDerived() only on H3,
in Text/Image, when the installed runner has --reference. The
hidden input is in the make_job allowlist (h3_reference). -->
<div class="mode-only h3-ref-section" id="h3RefSection">
<h2>Face to keep <span class="h2-hint">· optional · Hailuo H3</span></h2>
<div class="picker" data-key="h3_reference">
<div class="picker-drop" id="picker_drop_h3_reference">
<div class="picker-empty">
<div class="picker-icon"><svg class="ph"><use href="#ph-user-plus"/></svg></div>
<div class="picker-cta">Drop a <strong>clear photo of the face</strong>, or <strong>click to browse</strong></div>
<div class="hint">H3 keeps this face in the scene your prompt describes. Adds about a minute at Standard.</div>
</div>
<img class="picker-preview" id="picker_preview_h3_reference" alt="" style="display:none">
<button type="button" class="picker-clear" id="picker_clear_h3_reference" title="Clear" style="display:none"><svg class="ph" aria-hidden="true"><use href="#ph-x-bold"/></svg></button>
</div>
<input type="file" id="picker_file_h3_reference" accept="image/*" style="display:none">
<input type="hidden" name="h3_reference" id="h3_reference" value="">
<div class="picker-recent" id="picker_recent_h3_reference_wrap" style="display:none">
<div class="picker-recent-label">Recent uploads · click to use</div>
<div class="picker-recent-strip" id="picker_recent_h3_reference"></div>
</div>
</div>
</div>
<!-- I2V — single image ref. -->
<div class="mode-only" id="imageSection">
<h2>Reference image</h2>
<div class="picker" data-key="image">
<div class="picker-drop" id="picker_drop_image">
<div class="picker-empty">
<div class="picker-icon"><svg class="ph"><use href="#ph-image"/></svg></div>
<div class="picker-cta">Drop image here, or <strong>click to browse</strong></div>
<div class="hint">PNG / JPG / WEBP — auto cover-crop to model size</div>
</div>
<img class="picker-preview" id="picker_preview_image" alt="" style="display:none">
<!-- VC-29/H3-01: the crop overlay this Mac will actually
apply before the render — filled in by
refreshPickerCropOverlays() (queue.js). Empty/hidden
until an image is loaded AND a crop would actually
happen. -->
<div class="crop-overlay" id="picker_crop_image" hidden></div>
<button type="button" class="picker-clear" id="picker_clear_image" title="Clear" style="display:none"><svg class="ph" aria-hidden="true"><use href="#ph-x-bold"/></svg></button>
</div>
<input type="file" id="picker_file_image" accept="image/*" style="display:none">
<input type="hidden" name="image" id="image" value="">
<!-- Where the crop-preview overlay was set: 0..1 along
whichever axis the cover-crop cuts. 0.5 = centre (the old,
still default, behaviour). -->
<input type="hidden" name="image_crop_focus" id="image_crop_focus" value="0.5">
<div class="crop-overlay-controls" id="picker_crop_controls_image" hidden></div>
<div class="picker-recent" id="picker_recent_image_wrap" style="display:none">
<div class="picker-recent-label">Recent uploads · click to use</div>
<div class="picker-recent-strip" id="picker_recent_image"></div>
</div>
</div>
<!-- HOW the reference is used. Anchor = the image IS frame one
and gets animated (what i2v has always promised). Inspire =
the image guides subject, style and palette while the shot
re-composes — the behavior High/High·720p produced BY
ACCIDENT until v4.0.7 anchored them for real, kept as an
explicit choice because the owner graded the accident as
worth having. 2.5 only (server-owned flag); the row hides
itself on 2.3 and on H3. -->
<div class="cz-control" id="i2vRefModeRow" data-ltx-only hidden
style="margin-top:10px">
<div class="cz-label">Reference use
<span class="cz-label-hint">anchor the image, or take it as inspiration</span>
</div>
<input type="hidden" name="i2v_reference_mode" id="i2v_reference_mode" value="anchor">
<div class="pill-group cols-2" id="i2vRefModeGroup">
<button type="button" class="pill-btn active" data-i2v-ref="anchor"
title="Your image is frame one and the clip animates it. This is what Image mode has always promised — and on High tiers it is a v4.0.7 fix.">
<span>Anchor</span>
<span class="sub">animate this image</span>
</button>
<button type="button" class="pill-btn" data-i2v-ref="inspire"
title="The image guides subject, style and palette, but the shot composes itself — you will NOT see your picture as frame one. Good for 'this character, new scene'.">
<span>Inspire</span>
<span class="sub">new shot from it</span>
</button>
</div>
</div>
</div>
<!-- Keyframe interpolation — FFLF or a dynamic 3–8-anchor shot. -->
<div class="kf-toggle-row" id="kfToggleRow" style="display:none">
<span class="kf-toggle-label">Keyframe mode</span>
<div class="kf-toggle-group pill-group" role="group">
<button type="button" class="kf-toggle-chip pill-btn active" data-kf-mode="2" onclick="setKeyframeMode(2)">FFLF <span class="kf-sub">start → end</span></button>
<button type="button" class="kf-toggle-chip pill-btn" data-kf-mode="multi" onclick="setKeyframeMode(parseInt(document.getElementById('keyframe_count')?.value || '3', 10))">Multi-Keyframe <span class="kf-sub">3–8 frames</span></button>
</div>
</div>
<div class="mode-only" id="keyframeSection">
<h2>Start frame (frame 0)<span class="h2-hint" data-h3-only> · optional on Hailuo H3</span></h2>
<div class="picker" data-key="start_image">
<div class="picker-drop" id="picker_drop_start_image">
<div class="picker-empty">
<div class="picker-icon"><svg class="ph"><use href="#ph-film-strip"/></svg></div>
<div class="picker-cta">Drop the <strong>first frame</strong>, or <strong>click to browse</strong></div>
<div class="hint">This image opens the clip — its aspect picks the output dimensions.</div>
</div>
<img class="picker-preview" id="picker_preview_start_image" alt="" style="display:none">
<button type="button" class="picker-clear" id="picker_clear_start_image" title="Clear" style="display:none"><svg class="ph" aria-hidden="true"><use href="#ph-x-bold"/></svg></button>
</div>
<input type="file" id="picker_file_start_image" accept="image/*" style="display:none">
<input type="hidden" name="start_image" id="start_image" value="">
<div class="picker-recent" id="picker_recent_start_image_wrap" style="display:none">
<div class="picker-recent-label">Recent uploads · click to use</div>
<div class="picker-recent-strip" id="picker_recent_start_image"></div>
</div>
</div>
<div class="kf-count-row" id="kfCountRow" style="display:none">
<label class="lbl" for="keyframe_count">Keyframes</label>
<select id="keyframe_count" name="keyframe_count" onchange="setKeyframeMode(parseInt(this.value, 10))">
<option value="3" selected>3 keyframes</option>
<option value="4">4 keyframes</option>
<option value="5">5 keyframes</option>
<option value="6">6 keyframes</option>
<option value="7">7 keyframes</option>
<option value="8">8 keyframes</option>
</select>
<div class="hint" style="margin-top:6px">Start and End are fixed; the selected count creates the intermediate beats below.</div>
</div>
<div id="keyframeDynamicSlots"></div>
<div class="mini-fields" id="kfTimingRow" style="display:none;margin-top:10px">
<div class="mf-cell" style="grid-column:span 3">
<span class="mf-label">Segment timing</span>
<div class="hint" id="kfTimingHint" style="margin-top:8px">Intermediate beat timing is distributed evenly by default.</div>
</div>
</div>
<h2 style="margin-top:10px">End frame (last frame)</h2>
<div class="picker" data-key="end_image">
<div class="picker-drop" id="picker_drop_end_image">
<div class="picker-empty">
<div class="picker-icon"><svg class="ph"><use href="#ph-target"/></svg></div>
<div class="picker-cta">Drop the <strong>last frame</strong>, or <strong>click to browse</strong></div>
<div class="hint">A close-up here anchors face identity through the clip.</div>
</div>
<img class="picker-preview" id="picker_preview_end_image" alt="" style="display:none">
<button type="button" class="picker-clear" id="picker_clear_end_image" title="Clear" style="display:none"><svg class="ph" aria-hidden="true"><use href="#ph-x-bold"/></svg></button>
</div>
<input type="file" id="picker_file_end_image" accept="image/*" style="display:none">
<input type="hidden" name="end_image" id="end_image" value="">
<div class="picker-recent" id="picker_recent_end_image_wrap" style="display:none">
<div class="picker-recent-label">Recent uploads · click to use</div>
<div class="picker-recent-strip" id="picker_recent_end_image"></div>
</div>
</div>
<div class="hint" id="keyframeHint" style="margin-top:8px">Keyframe mode needs Q8 — it always renders the Q8 two-stage pass, whatever the Quality pill says. FFLF anchors the first and last frames; multi-keyframe mode locks every intermediate beat at its At(s) time.</div>
</div>
<!-- Extend — source-video select + extend-by + direction +
extend-mode preset. Lives inside the composer card so the
prompt sits below the source picker, mirroring the I2V flow. -->
<div class="mode-only" id="extendSection">
<h2><span class="extend-only">Source video</span><span class="v2a-only">Clip to add sound to</span></h2>
<!-- 4.19: Hailuo H3 versions of this panel. Extend continues the
clip from its last 17 frames AND their sound; Add sound keeps
the picture exactly and generates only its audio. Both read
the same source picker below. -->
<div class="hint h3-mode-hint extend-only" data-h3-only>Hailuo H3 continues this clip from its last 17 frames and their sound, so the motion and the voice carry on instead of restarting. Any clip works; an H3 clip continues on its own canvas. Describe what happens next in the prompt.</div>
<div class="hint h3-mode-hint v2a-only" data-h3-only>Hailuo H3 watches the clip and makes its sound — ambience, footsteps, impacts, voices — in sync with the picture. The picture is kept exactly as it is. Describe the sound you want in the prompt, or leave it short and H3 fills in what it sees.</div>
<!-- VA-13: the clamp used to be a log line nobody saw until the
6-16 min render finished softer than the clip it extended.
extendClampNote is filled by refreshExtendClampNote() (from
BOOT.tier.extend_max_dim) on boot and on every mode switch
into Extend, so it's said BEFORE Generate every time. -->
<div class="hint" id="extendClampNote" style="margin-bottom:6px" data-ltx-only></div>
<select id="extendSrcSelect" onchange="document.getElementById('video_path').value=this.value"></select>
<input name="video_path" id="video_path" placeholder="/path/to/source.mp4" style="margin-top:6px">
<div class="row extend-only" style="margin-top:8px">
<div>
<label class="lbl">Extend by (seconds)</label>
<!-- min must align to step from value=2: with min=0.4 step=0.5 the
valid sequence is 0.4, 0.9, 1.4, 1.9, 2.4… — `2` is OFF the
grid. Chrome blocks the entire form submission silently when
ANY input fails validation, even hidden ones in inactive
modes. Generate appeared dead until cocktailpeanut diagnosed
it. With min=0.5 the sequence is 0.5, 1.0, 1.5, 2.0… and
value=2 is valid. -->
<input id="extend_seconds" type="number" value="2" min="0.5" max="10" step="0.5">
<input type="hidden" name="extend_frames" id="extend_frames" value="6">
<div class="hint" id="extendDurationHint" style="margin-top:4px" title="6 latent frames × 8 video frames at 24 fps">Adds 2.0 s</div>
</div>
<div data-ltx-only>
<label class="lbl">Direction</label>
<select name="extend_direction" id="extend_direction">
<option value="after" selected>After</option>
<option value="before">Before</option>
</select>
</div>
</div>
<!-- Pass 7 (Codex C+ 2026-05-17): renamed from "Fast / Quality"
to "Q8 Draft / Q8 Pro" so the labels match the Character
mode's quality vocabulary. The underlying mechanism stays
the same — Extend uses its own sampler (extend_steps +
extend_cfg) that isn't compatible with the main HQ res_2s
sampler's stage_1/stage_2 step model. Same labels make it
visually clear both intents live in the Q8 family without
forcing the implementation onto the HQ sampler. -->
<label class="lbl" style="margin-top:10px" data-ltx-only>Quality</label>
<!-- VA-12: the "N steps · ~M min" text below is the pre-JS
fallback only — applyExtendPillPrices() (characters.js)
overwrites both spans from the server's real, clamped-canvas
price the moment BOOT is available, and again on every mode
switch. Static fallback values must still be the REAL
defaults (8 steps, not the old 12 this pill used to submit —
see setExtendMode). -->
<div class="pill-group cols-2 quality-strip" id="extendModeGroup" data-ltx-only>
<button type="button" class="pill-btn pill-quality active" data-extend-mode="fast">
<span class="ql-name">Q8 Draft</span>
<span class="q-spec ql-spec sub">8 steps · 64 GB safe</span>
<span class="ql-tier">Q8 extend · pricing…</span>
</button>
<button type="button" class="pill-btn pill-quality" data-extend-mode="quality" hidden>
<span class="ql-name">Q8 Pro</span>
<span class="q-spec ql-spec sub">30 steps · 96+ GB</span>
<span class="ql-tier">Q8 extend · pricing…</span>
</button>
</div>
<input type="hidden" name="extend_steps" id="extend_steps" value="8">
<input type="hidden" name="extend_cfg" id="extend_cfg" value="1.0">
<div class="hint" data-ltx-only>Each latent ≈ 8 frames (~0.33s). Q8 Pro runs the upstream Lightricks defaults but pushes 1280×704 into swap below the Roomy tier — it only appears there. Stick with Q8 Draft unless you've got more RAM.</div>
<!-- VA-13: Extend clamps to this Mac's tier cap and hands back
whatever it renders at, softer than the source it extended
into. This queues the fix behind it instead of leaving the
user to notice and do it by hand. -->
<label class="check extend-only" style="margin-top:8px" data-ltx-only>
<input type="checkbox" name="extend_face_fix_after" id="extendFaceFixAfter" value="1">
Also run Upscale & Face Fix after
</label>
</div>
<!-- Colorize (restore) — source-video picker, cloned from the
Extend block. The user picks a B&W / desaturated clip; the
Colorize IC-LoRA rides it on the reference channel and paints
in natural color. Q4 distilled (no Q8 needed). Shown/hidden by
updateDerived() when currentMode === 'restore'. -->
<div class="mode-only" id="restoreSection">
<h2>Source video to colorize</h2>
<select id="restoreSrcSelect" onchange="document.getElementById('restore_video_path').value=this.value"></select>
<input name="restore_video_path" id="restore_video_path" placeholder="/path/to/blackandwhite.mp4" style="margin-top:6px">
<div class="hint" style="margin-top:6px">Pick a black-and-white or washed-out clip. The prompt below describes the colors to paint in (e.g. "golden warm sunlight, blue sky, green grass"). Output matches the source's resolution + length. Runs on Q4 — no Q8 needed.</div>
</div>
<!-- Upscale & Face Fix (mode `upscale`) — source-video picker + presets. The
LTX-2.5 Pixel Spatial Upscaler IC-LoRA re-renders the clip at
2× (capped at this Mac's i2v canvas; frames + prompt come from
the source and its sidecar). The slider is the IC reference
strength: 1.0 keeps the shot exactly, lower lets LTX
re-imagine detail (faces, textures) more freely. Audio from the
source is carried over. Shown/hidden by updateDerived() when
currentMode === 'upscale'. -->
<div class="mode-only" id="upscaleSection">
<h2>Clip to fix</h2>
<select id="upscaleSrcSelect" onchange="document.getElementById('upscale_source_path').value=this.value"></select>
<input name="upscale_source_path" id="upscale_source_path" placeholder="/path/to/draft.mp4" style="margin-top:6px">
<!-- Presets, not a slider: the number (keep_shot) maps server-side
to how the render starts — Faithful/Balanced refine the clip's
own latent for 1/2 steps, Re-imagine is the adapter's full
re-render from noise. Times measured on an M4 Max for a 5 s
640×384 draft → 1280×768. -->
<!-- Face Fix = the one-click recipe (1 refine step from the
clip's latent, verified on character clips 2026-09-16). It
pins upscale_start/upscale_steps; the other three pills clear
them and keep their server-side mapping (Faithful = 3 steps). -->
<div class="pill-group cols-4" id="upscalePresetGroup" style="margin-top:10px">
<button type="button" class="pill-btn active" data-keep="1.0" data-start="source" data-steps="1" onclick="setUpscalePreset(this)"
title="The clip-action recipe: one refine step from the clip's own frames — 2× sharper and the face is not redrawn. About 2.5 min per 5 s 640×384 draft on an M4 Max.">
<span>Face Fix</span><span class="sub">face kept</span>
</button>
<button type="button" class="pill-btn" data-keep="1.0" onclick="setUpscalePreset(this)"
title="Three refine steps on the clip's own frames — sharper detail, the face can be re-sculpted a little. About 5.5 min per 5 s on an M4 Max.">
<span>Faithful</span><span class="sub">sharper</span>
</button>
<button type="button" class="pill-btn" data-keep="0.8" onclick="setUpscalePreset(this)"
title="Same recipe with one step less — a touch softer, noticeably faster. About 3.75 min per 5 s on an M4 Max.">
<span>Quick</span><span class="sub">a touch softer</span>
</button>
<button type="button" class="pill-btn" data-keep="0.4" onclick="setUpscalePreset(this)"
title="Full re-render at 2× from the clip as reference — the sharpest detail; faces drift from the draft. About 7 min per 5 s on an M4 Max.">
<span>Re-imagine</span><span class="sub">faces drift</span>
</button>
</div>
<input type="hidden" name="keep_shot" id="keep_shot" value="1.0">
<input type="hidden" name="upscale_start" id="upscale_start" value="source">
<input type="hidden" name="upscale_steps" id="upscale_steps" value="1">
<div class="hint" style="margin-top:6px">Doubles the clip's size with generated detail, not a filter, and keeps its sound — an H3 draft comes out with LTX-2.5 pixels. The fixed clip is a new file next to the original. Length, frame count and (if empty) the prompt come from the source. Output is capped at this Mac's Image-to-Video canvas. Times are for a 5 s 640×384 draft on an M4 Max (Face Fix ≈ 2.5 min, Faithful ≈ 5.5, Quick ≈ 3.75, Re-imagine ≈ 6.5); bigger sources and slower Macs take longer. Quicker: the <b>Upscale & Face Fix</b> button under the player queues Face Fix in one click.</div>
</div>
<!-- Ingredients (multi-reference) — the flagship IC-LoRA. Pick 2-8
subject images (a face + a prop + a location); they're tiled
into one reference sheet and the model composes them into a new
clip. The prompt below describes WHAT'S in the sheet; the Action
field describes the shot. Q4 distilled. Shown/hidden by
updateDerived() when currentMode === 'ingredients'. -->
<div class="mode-only" id="ingredientsSection">
<h2>Reference images <span class="hint" style="font-weight:400">· 2–8 (a face + a prop + a location)</span></h2>
<div class="ingredients-picker">
<div class="picker-drop ingredients-drop" id="ingredients_drop">
<div class="picker-empty">
<div class="picker-icon"><svg class="ph"><use href="#ph-image"/></svg></div>
<div class="picker-cta">Drop images here, or <strong>click to browse</strong></div>
<div class="hint">PNG / JPG / WEBP · pick 2–8 — they tile into one reference sheet</div>
</div>
</div>
<input type="file" id="ingredients_file" accept="image/*" multiple style="display:none">
<input type="hidden" name="ingredient_images_json" id="ingredient_images_json" value="[]">
<div class="ingredients-thumbs" id="ingredients_thumbs"></div>
<div class="picker-recent" id="ingredients_recent_wrap" style="display:none">
<div class="picker-recent-label">Recent uploads · click to add</div>
<div class="picker-recent-strip" id="ingredients_recent"></div>
</div>
</div>
<h2 style="margin-top:14px">Action / shot to generate</h2>
<textarea id="ingredient_action" name="ingredient_action" class="composer-prompt" style="min-height:64px"
placeholder="What happens in the clip — e.g. the hedgehog waddles up and waves, the rabbit hops past with a spray bottle; warm acoustic jingle, cheerful voice, soft footsteps."></textarea>
<div class="hint" style="margin-top:6px">The big prompt below describes WHAT'S in the reference sheet (each character, prop, and the location). This Action field describes the shot itself. Runs on Q4 — no Q8 needed.</div>
<!-- Ingredients × Character — OPTIONAL trained character LoRA stacked
on top of the Ingredients IC-LoRA so the SAME trained face lands
in every composed scene. Options are filled from _knownUserLoras
(kind=train_character) by populateIngredientCharLoras(). The
selected character's trigger rides a hidden field; the server
prepends it to the action if missing so the LoRA fires. -->
<div id="ingredientCharWrap" style="margin-top:16px">
<h2 style="margin-bottom:0">Character <span class="hint" style="font-weight:400">· optional — drop your trained face into every scene</span></h2>
<select id="ingredient_char_lora" name="ingredient_char_lora" onchange="onIngredientCharChange()" style="margin-top:6px"></select>
<input type="hidden" name="ingredient_char_strength" id="ingredient_char_strength" value="1.3">
<input type="hidden" name="ingredient_char_trigger" id="ingredient_char_trigger" value="">
<div id="ingredientCharEmpty" class="hint" style="margin-top:8px;display:none">No trained characters yet — train one in the <strong>Character</strong> tab and it appears here. Then your face composes into any scene you build.</div>
<div id="ingredientCharTune" style="margin-top:8px;display:none">
<div class="hint">Identity comes from the LoRA, not a face photo — so the same face holds across every scene (tighter than a reference image alone). The references still set the props, wardrobe, and location. <strong>Strength is a trade-off:</strong> higher = tighter face but stiffer motion; lower = freer, more natural motion. ~1.3 is the sweet spot.</div>
<div style="margin-top:8px;display:flex;align-items:center;gap:10px">
<span class="hint" style="white-space:nowrap">Identity strength <strong id="ingCharStrLabel">1.3</strong></span>
<input type="range" min="0.8" max="1.8" step="0.1" value="1.3" id="ingCharStrSlider" oninput="onIngredientCharStrength(this.value)" style="flex:1;max-width:280px">
</div>
<div id="ingredientCharTrigHint" class="hint" style="margin-top:6px"></div>
</div>
</div>
</div>
<!-- Control (Union) — control-video picker, cloned from the Colorize
(restore) source block. The user picks a RAW RGB clip; the Union
IC-LoRA rides it on the reference channel at follow-strength so
the render inherits its motion/structure/composition while the
prompt swaps the subject/scene. Q4 distilled (no Q8 needed).
Shown/hidden by updateDerived() when currentMode === 'control'. -->
<div class="mode-only" id="controlSection">
<h2>Motion Control <span class="hint" style="font-weight:400">· Union Control IC-LoRA · its motion, your subject</span></h2>
<select id="controlSrcSelect" onchange="document.getElementById('control_video_path').value=this.value"></select>
<input name="control_video_path" id="control_video_path" placeholder="/path/to/control.mp4" style="margin-top:6px">
<div class="hint" style="margin-top:6px">Pick the clip whose <strong>motion, camera move, composition and pose</strong> the render should copy. The prompt describes the <strong>new subject and scene</strong> painted onto that structure — drive a crane-up off a man's face in a suburban street and you get a crane-up off a monk's face on a salt flat. Output matches the control clip's resolution and length, on the Q4 distilled checkpoint — no Q8 needed.</div>
<!-- THE HONEST HALF, and the reason the X request was half right.
Union Control follows whatever control signal it is given, so
a pose or depth SEQUENCE works today. What Phosphene does not
have is a preprocessor to derive one from an ordinary clip.
Say that plainly rather than letting "pose · depth" in a
label imply a turnkey path that does not exist here. -->
<div class="hint" style="margin-top:6px"><strong>What you can feed it.</strong> An ordinary video is enough — the Union adapter reads raw RGB, so nothing has to be preprocessed, and it ships with the base install (public weights, no Hugging Face token). A <strong>pose, depth, canny or segmentation sequence</strong> works too and follows more tightly, but you have to bring your own: <strong>Phosphene ships no preprocessor</strong> that derives one from a normal clip.</div>
<!-- Shown only on a generation where the adapter is not native.
The sentence is LTX_CONTROL_GENERATION_NOTE, server-owned —
painted by _paintControlGenNote() at boot. -->
<div class="hint" id="controlGenNote" style="margin-top:6px;display:none;padding:7px 9px;border-left:2px solid var(--warn,#e0a94a);background:rgba(224,169,74,.07);border-radius:6px"></div>
</div>
</div>
<!-- Prompt — hero textarea. No h2 (the composer-card itself
announces "this is where you compose"). Audio-cue placeholder
is the only nudge users get to describe the soundscape;
documented in the LTX 2.3 paper but unobvious. -->
<!-- SYS-25: had no label at all (placeholder only) — a screen
reader announces a placeholder-only textarea as unlabeled. -->
<textarea name="prompt" id="prompt" class="composer-prompt"
oninput="updateLangHint()" aria-label="Describe your shot"
placeholder="Describe the scene and the sound. For example: a wizard in a forest clearing, fireflies spiraling up. Sound: low whispered chant, ember crackle, distant owl. Audio is made together with the video; without sound cues the model makes near-silent ambient."></textarea>
<!-- VC-13: a language hint — LTX itself was trained on English
prompts, and nothing told a non-English typist that. Hidden
until updateLangHint() sees a non-Latin script (CJK, Hangul,
Cyrillic, Arabic, Hebrew, Thai — see prompt_looks_non_latin()
server-side); European Latin-script languages don't trigger
it (unreliable to tell apart from English by character range
alone). The toggle feeds Enhance's `translate` form field. -->
<div class="lang-hint" id="langHint" hidden data-ltx-only>
<span>LTX generates from English prompts. Enhance can translate this one for you.</span>
<label class="lang-hint-toggle">
<input type="checkbox" id="translateToEnglish" checked>
Translate to English
</label>
</div>
<!-- H3-07: H3's dialogue-tag prompt format has no help in the Video
tab at all — a line written as prose quotes (`She says: "..."`)
leaves H3's voice switched off with no error, and the fix
(docs/H3_ENGINE.md "Dialogue on H3") is unobvious: the words go
in `<d>[English] …</d>` and nowhere else, at most ~8 words per
5 s window, and the sentence must stop the mouth in the same
breath ("his jaw ceases speaking motion and his mouth settles
closed"). Structure inserts the three-field skeleton the
Storyboard planner already writes; + Line inserts one dialogue
line with the tag, a speaker id and the mouth-stop clause place-
holder; the counter and the quote warning read the live prompt
text on every keystroke (h3SyncPromptHelper, queue.js). -->
<div class="h3-prompt-helper" id="h3PromptHelper" data-h3-only hidden>
<button type="button" class="ghost-btn" id="h3StructureBtn"
onclick="h3InsertPromptStructure()"
title="Insert the three-field skeleton H3 prompts are trained on: integrated_multimodal_description / overall_soundscape / non_diegetic_music.">
Structure
</button>
<button type="button" class="ghost-btn" id="h3AddLineBtn"
onclick="h3InsertDialogueLine()"
title="Insert one dialogue line: the <d>…</d> tag, a speaker id, and a mouth-stop clause so the model doesn't keep the mouth moving on nothing.">
+ Line
</button>
<select id="h3DialogueLang" title="Language the next inserted line is tagged with" style="max-width:120px">
<option value="English" selected>English</option>
<option value="Spanish">Spanish</option>
<option value="French">French</option>
<option value="German">German</option>
<option value="Japanese">Japanese</option>
<option value="Mandarin Chinese">Mandarin</option>
<option value="Korean">Korean</option>
<option value="Portuguese">Portuguese</option>
</select>
<span class="ct-spacer"></span>
<span class="h3-prompt-helper-words" id="h3DialogueWordCount" hidden></span>
<span class="h3-prompt-helper-warn" id="h3QuoteWarning" hidden
title="Prose quotes are not spoken — H3 only voices text inside a <d>…</d> tag.">
<svg class="ph" aria-hidden="true"><use href="#ph-warning-fill"/></svg>Quoted speech outside <d>…</d> won't be spoken
</span>
</div>
<!-- Tools strip — Enhance + HDR + No-music + Avoid disclosure.
All inline so they read as part of composing the prompt.
Avoid is now a toggle-disclosure (collapsed by default) — it's
optional and most users won't touch it. -->
<div class="composer-tools">
<!-- Enhance is data-ltx-only and its own tooltip says why: it asks
Gemma to rewrite the prompt "in the style LTX 2.3 was trained
on". Run on an H3 prompt it is actively destructive — H3's
trained control path is `<d>[English] …</d>`, `(S1)`, `[Shot N]`
and the three labelled fields, and a rewrite strips every one of
them (H3_PROMPTING_GUIDE §4.1, minimax-prompting SKILL.md). H3
prompts go to the encoder verbatim. -->
<!-- SYS-21: tooltip said "LTX 2.3" while the default/active engine
has been LTX 2.5 since v4.0. -->
<!-- VC-16: the title used to hardcode "LTX 2.3" — the panel has
served 2.5 as the default generation since v4.0.0. Left
generation-neutral here; main.js sets the precise "2.3" or
"2.5" from BOOT.ltx.generation at boot. -->
<button type="button" class="ghost-btn" id="enhanceBtn" data-ltx-only onclick="enhancePrompt()" title="Use Gemma to rewrite your prompt in the style LTX was trained on"><svg class="ph" aria-hidden="true" style="margin-right:6px"><use href="#ph-sparkle-fill"/></svg>Enhance</button>
<!-- Avoid is data-ltx-only because H3 HAS NO NEGATIVE PROMPT. It is
guidance-distilled: no CFG, no unconditional branch, one forward
per step, and every official ComfyUI template ships zero
negative-prompt nodes (H3_PROMPTING_GUIDE §7.4). A box wired to
a field the engine never reads is worse than no box. The
replacement hint below says what DOES work instead. -->
<button type="button" class="ct-link" id="avoidToggleBtn" data-ltx-only onclick="toggleAvoidRow()" title="Add 'avoid' / negative prompt — things the model should NOT generate">
<span id="avoidToggleLabel">Avoid +</span>
</button>
<!-- Stands in for Enhance + Avoid on the H3 surface: both of the
controls it replaces are LTX mechanisms, and this is the one
sentence a user needs in their place. -->
<span class="ct-hint" data-h3-only>No negative prompt on H3 — write refusals as plain sentences, and only for what it adds unasked: camera drift and on-screen text.</span>
<span class="ct-spacer"></span>
<!-- HDR toggle hidden again 2026-05-21 (Mr Bizarro request):
"remove the HDR LoRA from this release, you can leave the
plumb in there, but remove the button and put it on the
roadmap."
Why: the single-pass HDR + character combo (which I
unblocked at 495c04c) is architecturally unsound — the
character LoRA's deltas were trained against Q8 dev and
don't align cleanly against the distilled base HDR-IC
forces. Pure-text HDR works but isn't the killer feature.
The architecturally clean path is Phase 2: render normally
with character → re-grade output through HDR-IC as
SDR→HDR conversion (two-pass workflow). Until Phase 2
ships, the button would mislead users.
The HTML markup, helper action, panel routing, and helper
imports all stay in place. Re-exposing is a one-line
un-comment when Phase 2 lands. -->
<input type="hidden" id="hdr" name="hdr" value="off">
<!--
<label class="toggle-pill" id="hdrPill"
title="HDR via the official Lightricks LTX-2.3-22b IC-LoRA-HDR.">
<input type="checkbox" id="hdr" name="hdr">
<span class="toggle-dot"></span>
<span>HDR</span>
<span class="experimental-tag" style="margin-left:4px;font-size:9px;padding:1px 5px;border-radius:6px;background:rgba(255,180,80,0.18);color:#ffb450;letter-spacing:0.4px;text-transform:uppercase;">new</span>
</label>
-->
<!-- "No music" is the one composer tool that survives BOTH engines,
because both engines volunteer a score and neither lets you
remove one afterwards (music shares spectral space with
dialogue). What differs is the mechanism, and wiring LTX's
phrasing to H3 would be a control that looks live and does
nothing:
LTX → an audio directive appended to the prose prompt.
H3 → `non_diegetic_music: N/A`, the TRAINED field value for
"no score" (H3_PROMPTING_GUIDE §2.5 / §7.4 mechanism 2).
The augmentation and this tooltip both swap in
_syncEnginePromptTools(), called from setEngine. -->
<label class="toggle-pill" id="noMusicPill"
data-title-ltx="When on, the prompt is augmented with: 'Audio: voice and ambient sounds only, no music, no soundtrack, no score.' Useful for clips you'll score yourself in post — music can't be cleanly removed afterwards."
data-title-h3="When on, the prompt carries 'non_diegetic_music: N/A' — the trained way to tell H3 there is no score. Skipped if your prompt already sets that field itself."
title="When on, the prompt is augmented with: 'Audio: voice and ambient sounds only, no music, no soundtrack, no score.' Useful for clips you'll score yourself in post — music can't be cleanly removed afterwards.">
<input type="checkbox" id="noMusic" name="no_music">
<span class="toggle-dot"></span>
<span>No music</span>
</label>
<!-- No voice toggle (2026-05-18) — Mr Bizarro's request: when a
character with a voice LoRA is selected, audio generation
sometimes produces gibberish speech even when you only
want visuals. This toggle suppresses voice for THIS
render only by:
1) skipping the character's audio LoRA in make_job
2) augmenting the prompt with an ambient-only directive
Only meaningfully relevant when a character with voice is
active; the pill is hidden otherwise to avoid clutter
(toggleVoicePillVisibility wires this). -->
<!-- data-ltx-only: what this pill DOES is drop a trained character's
audio LoRA from the stack (make_job, character_id branch).
Characters are an LTX construct — `character` is in H3's
excluded_modes and no character LoRA loads on the H3 lane — so
on H3 the toggle could only ever be a no-op. -->
<label class="toggle-pill" id="noVoicePill" hidden data-ltx-only
title="Skip the character's voice LoRA for this render. The face still locks, but audio stays ambient — no speech, no gibberish.">
<input type="checkbox" id="noVoice" name="no_voice"
onchange="markNoVoiceTouched()">
<span class="toggle-dot"></span>
<span id="noVoiceLabel">No voice</span>
</label>
</div>
<!-- VC-16: Enhance's result, inline — replaces the old native
confirm() (no edit, no diff, no undo). Two states, one panel:
"review" (the fresh enhanced text, Accept / Keep mine) and
"applied" (Accept was clicked — Undo reverts the textarea to
the original, in case ⌘Z inside the textarea itself doesn't
reach back far enough). Filled/shown by enhancePrompt(). -->
<div class="enhance-panel" id="enhancePanel" hidden>
<div class="enhance-panel-body" id="enhancePanelReview">
<div class="enhance-panel-col">
<div class="enhance-panel-label">Original</div>
<div class="enhance-panel-text" id="enhanceOriginalText"></div>
</div>
<div class="enhance-panel-col">
<div class="enhance-panel-label">Enhanced</div>
<div class="enhance-panel-text" id="enhanceEnhancedText"></div>
</div>
</div>
<div class="enhance-panel-actions">
<button type="button" class="primary" id="enhanceAcceptBtn" onclick="acceptEnhance()">Accept</button>
<button type="button" class="ghost-btn" id="enhanceKeepBtn" onclick="keepMineEnhance()">Keep mine</button>
<button type="button" class="ghost-btn" id="enhanceUndoBtn" onclick="undoEnhance()" hidden>Undo</button>
<span class="enhance-panel-note" id="enhancePanelNote"></span>
</div>
</div>
</div>
<!-- Avoid (negative prompt) — collapsed by default; toggled by the
Avoid + button inside the composer-tools strip. Lives outside
the composer card so the textarea has its own framed surface
and the composer card stays focused on the positive prompt. -->
<div class="avoid-row" id="avoidRow" data-ltx-only>
<label class="avoid-label" for="negative_prompt">
<span>Avoid</span>
<span class="avoid-hint">things the model should NOT generate — applies on High, Extend, first-last-frame and audio-to-video; Quick, Balanced and Standard run without guidance and ignore it</span>
</label>
<!-- VC-15: the hint above SAYS Balanced ignores this box, but nothing
on the box itself showed it — a typed Avoid line just silently
did nothing on the default quality. updateIgnoredAvoidNote()
(queue.js, called from updateDerived) dims the textarea and
shows this note whenever the CURRENT mode+quality won't read
negative_prompt at all; "Use High" jumps straight to the
quality that will. -->
<div class="avoid-ignored-note" id="avoidIgnoredNote" hidden>
Ignored at <span id="avoidIgnoredQuality">this quality</span> —
<a href="#" onclick="setQuality('high'); return false;">Use High</a>
</div>
<textarea class="avoid-textarea" name="negative_prompt" id="negative_prompt" placeholder="blurry hands, distorted fingers, extra fingers, smeared face, warped text"></textarea>
</div>
<!-- ========== SHOT LIST · per-window prompts (chained lengths only) ====== -->
<!-- ========== PER-WINDOW PROMPTS (chained lengths only) ==========
The fix for the public report — @Wizard_1981, v3.6.0: "10s and
15s just repeat immediately after 5 seconds." The frames were
never duplicated (a 10 s render was checked frame by frame; the
background progresses continuously across the seam). What
repeated was the ACTION, because a 10 s clip is two chained 5 s
windows and BOTH were handed the same prompt. A continuous action
("he walks") carries on fine; a discrete one ("he raises his arm",
a line of dialogue) is performed once per window and reads as a
loop. Our own tier note has warned about this in words since
v3.4.1 — and the runner has taken `--chain-prompts` the whole
time. This is the control that reaches it.
DEFAULT IS UNCHANGED. Off (the default) posts nothing and every
window gets the main prompt, exactly as before. On reveals one
small textarea per window, seeded with the main prompt so the
user EDITS a shot list instead of facing blank boxes, and a box
left empty falls back to the main prompt server-side.
Visible only when the selected Length is chained, and it follows
the Length strip live — 10 s shows two boxes, 15 s shows three
(renderH3WindowPrompts, called from _h3ApplyShape). Hidden
entirely when the INSTALLED runner has no `--chain-prompts`: that
user keeps the honest warning on the cell instead of being sent
looking for a control they don't have.
Sits with the PROMPT, above the render controls (layout pass,
2026-09-18). It is prompt content — one line per 5 s window — not
a render setting, and inside the collapsed Shot setup section a
user who had just chosen a 15 s length would never have found it.
Still hidden entirely unless the chosen Length chains windows. -->
<div class="cz-control h3-winprompts" id="h3WindowPromptsRow" data-h3-only hidden>
<div class="cz-label">
<span>Per-window prompts</span>
<!-- The `?`. The panel had no help idiom of its own — every
explanation lived in a title= tooltip, which is invisible on
a trackpad and unreachable on a touch screen. One round
button, one sentence revealed in place, text owned by Python
(H3_CHAIN_PROMPT_HELP) so it can't drift from the mechanism. -->
<button type="button" class="help-dot" id="h3WinHelpBtn"
aria-expanded="false" aria-controls="h3WinHelpNote"
title="What are windows?"
onclick="toggleH3WindowHelp()">?</button>
<span class="cz-label-hint" id="h3WinPromptsHint"></span>
<span class="h3-winprompts-spacer"></span>
<label class="toggle-pill" id="h3WinPromptsPill"
title="Give each 5 s window its own line. Off = one prompt for the whole clip.">
<input type="checkbox" id="h3WinPromptsToggle">
<span class="toggle-dot"></span>
<span>One line per window</span>
</label>
</div>
<div class="h3-winhelp" id="h3WinHelpNote" hidden></div>
<div class="h3-winlist" id="h3WinPromptsList" hidden></div>
</div>
<!-- ============== SHOT SETUP ==============
Owner, 2026-09-18: "The H3 layout is kind of a bit too much … you have
a pill for speed, quality, length, and all that. That should be inside
one section that you can compress and decompress, like we have LoRAs
and Customize, because it is very messy like that … it should be
closed by default."
What used to be five stacked pill rows, each with its own label —
Speed, Quality, Length, Steps, Orientation — plus a Seed field, all of
it open on every render, is now ONE disclosure holding all of them,
closed until you want it. The summary line carries the whole shape
(#shotSetupSummary, written by updateShotSetupSummary), so the closed
section still says what will render.
Nothing left the form and nothing was renamed: every id, every data-*
hook, every hidden input and every handler is the one it was. The
order inside is deliberate and tested — Speed BEFORE the Quality label
(test_h3_tristep_draft), then the two axis strips, then the knobs that
modify them, then orientation and seed.
The selected cell's honest notes (#ltxTierNote / #h3TierNote) stay
OUTSIDE it, visible: a warning about the render you are about to queue
must not be foldable. -->
<div class="quick-settings">
<!-- ============== ENGINE STATE ==============
The PICKER heads the column now (#engineSwitch, rendered from
the server-side ENGINES table) — engine is a choice you make once,
not a form field you scroll past. What is left here is:
1. the hidden fields FormData(genForm) has to carry. EVERY ONE
of these is in the make_job allowlist; a field that isn't
listed there silently no-ops on /queue/add (the known trap).
2. #engineRowNote — the one-line reason a gate fired, shown
where the surface changed rather than in the header where
the click happened. Id preserved: the Draft→Finish path
reads its textContent for its failure toast.
3. #h3Hint — the engine's standing note, named by the H3 row's
`hint` key so setEngine swaps it generically. -->
<input type="hidden" name="engine" id="engine" value="ltx">
<!-- H3's render shape, posted as all three fields. `h3_tier` is the
canonical composite key ("high_10s") every sidecar has always
carried and is what make_job falls back to; `h3_quality` +
`h3_length` are the two axes the strips below actually set, and
they WIN server-side when both are valid. All three are in the
make_job allowlist — a field that isn't listed there silently
no-ops on /queue/add (the known trap). setH3Tier keeps the three
in sync, so there is exactly one state, spelled three ways. -->
<!-- ONE SHOT: a length past a single pass, and one beat per five
seconds. make_job turns it into parts that continue from each
other's last frame (15 s parts on H3, 10 s parts on LTX). The two
continuity toggles are read by make_job as on/off: light lock
appends the continuity sentence to every beat, retake allows one
re-render of a part whose light drifted. -->
<input type="hidden" name="h3_tier" id="h3_tier" value="draft_3s">
<input type="hidden" name="h3_quality" id="h3_quality" value="draft">
<input type="hidden" name="h3_length" id="h3_length" value="3s">
<input type="hidden" name="h3_upscale" id="h3_upscale" value="fit_720p">
<input type="hidden" name="h3_steps" id="h3_steps" value="auto">
<input type="hidden" name="h3_turbo" id="h3_turbo" value="0">
<!-- Fast · 3-step (TaoMate's 3-step adapter + its sigma ladder). "1"
when the Fast · 3-step Speed pill is lit, "0" otherwise; make_job
re-resolves it (Draft/Standard/High only, never with Turbo). In
the make_job allowlist. -->
<input type="hidden" name="h3_tristep" id="h3_tristep" value="0">
<!-- Clean up sound (5.0): "1" re-makes a Fast render's sound with the
speed adapter off (the picture is kept exactly). Written by
_h3SyncCleanSound(); in the make_job allowlist. Empty = default. -->
<input type="hidden" name="h3_clean_sound" id="h3_clean_sound" value="">
<!-- Pika H3 Flex (a Speed choice): "1" when the third pill renders. -->
<input type="hidden" name="h3_flex" id="h3_flex" value="0">
<!-- H3 Flex Turbo (5.0, Pro): "1" when the four-step Flex renders. -->
<input type="hidden" name="h3_flex_turbo" id="h3_flex_turbo" value="0">
<!-- Which of H3's ONE adapter slots this render spends. Its runner's
`--lora` takes a single path (default=None, not append), so Turbo
and a picked LoRA cannot both run and something has to choose.
"turbo" (default) keeps Turbo and makes a picked LoRA a hard,
named error; "user" is the explicit opt-out. In the make_job
allowlist — a field that isn't listed there silently no-ops on
/queue/add, which here would mean every render quietly coming back
on the Turbo branch with the control looking wired. -->
<input type="hidden" name="h3_lora_slot" id="h3_lora_slot" value="turbo">
<!-- Per-window prompts for a chained length, posted as ONE field: a
JSON array of strings, one entry per 5 s window, in render order.
One field rather than h3_chain_prompt_1..N because the window count
follows the Length strip — a fixed set of field names would either
cap the feature or drift from the table the moment a length is
added. Empty string = off = one prompt for every window, which is
exactly what shipped. In the make_job allowlist (a field that isn't
listed there silently no-ops on /queue/add — the known trap). -->
<input type="hidden" name="h3_chain_prompts" id="h3_chain_prompts" value="">
<div class="engine-note" id="engineRowNote" hidden></div>
<details id="shotSetupDetails" class="customize-section shot-setup">
<summary class="cz-summary">
<span class="cz-chevron" aria-hidden="true"><svg class="ph"><use href="#ph-caret-down-bold"/></svg></span>
<span class="cz-title">Shot setup</span>
<span class="cz-meta" id="shotSetupSummary">quality · length · speed</span>
</summary>
<div class="cz-body">
<!-- The engine's standing note. Second sentence added with the player
scoping (Part C): Extend is an LTX pipeline and is now hidden on
an H3 clip, so the surface has to say where length actually comes
from — the chained tiers, chosen BEFORE the render, not a post-hoc
action on the result. Said here, next to the tier strip where the
user can act on it, rather than as a tooltip on a button that no
longer exists. -->
<div class="engine-hint" id="h3Hint" hidden>
Dialogue + sound are generated jointly — write them into the prompt.
Length is chosen here, before the render: 10 s and 15 s chain 5 s
windows at render time, so there is no Extend afterwards.
<!-- MiniMax H3 licence s. IV.2 / V.5: "MiniMax H3" shown where H3
is used, the licence one click away, and a way to report
suspected misuse. Lives in the H3 hint, which shows exactly
while H3 is the selected engine. -->
<span class="engine-credit" id="h3Credit">
<b>MiniMax H3</b> ·
<a href="#" onclick="event.preventDefault(); openLicence('h3', {readOnly: true})">Licence</a>
·
<a href="https://github.com/mrbizarro/Phosphene/issues/new?title=Misuse%20report%3A%20" target="_blank" rel="noopener">Report misuse</a>
</span>
</div>
<!-- H3 SPEED — one switch above the Quality cards: ⚡ Fast (TaoMate's
3-step adapter, the default once installed) | ✦ Best (the shape's
full sampler). The cards below re-price live for it. Turbo is
folded in here (Fast replaces it). Rendered by renderH3Turbo();
writes #h3_tristep. -->
<div class="h3-speed" id="h3SpeedRow" data-h3-only hidden>
<!-- H3-40: this used to read "Fast = 3 steps · Best = full
steps" — the mechanism, not the trade-off a user is
actually choosing between. -->
<div class="qs-label">
<span class="qs-name">Speed</span>
<span class="qs-meta">Fast: ~4× quicker, a touch softer · Best: sharpest faces, much slower</span>
</div>
<div class="pill-group cols-3 h3-speed-group" id="h3SpeedGroup">
<button type="button" class="pill-btn" data-h3-speed="fast"
title="About 4× faster than Best, a touch softer on fine detail — great for drafts and most shots.">
<span>⚡ Fast</span><span class="sub" id="h3SpeedFastSub"></span>
</button>
<button type="button" class="pill-btn" data-h3-speed="best"
title="This shape's full sampler — sharpest faces and detail, the slower, most careful render.">
<span>✦ Best</span><span class="sub" id="h3SpeedBestSub"></span>
</button>
<!-- Pika H3 Flex running natively on Apple Silicon (MLX): Pika
Labs' six-step H3 student on our own MLX sampler. -->
<button type="button" class="pill-btn" data-h3-speed="flex"
title="Pika H3 Flex (preview): Pika Labs' six-step version of H3, running natively on your Mac. New - feedback welcome. Powered by MiniMax H3.">
<span>✧ Pika Flex (preview)</span><span class="sub" id="h3SpeedFlexSub"></span>
</button>
</div>
<div class="h3-turbo-note" id="h3SpeedNote" hidden></div>
<!-- Pika H3 Flex: credit + "Powered by MiniMax H3" while it is
the choice, the one click that gets it before then
(_h3RenderFlexNote). -->
<div class="h3-turbo-note h3-flex-note" id="h3FlexNote" hidden>
<span id="h3FlexNoteText"></span>
<button type="button" class="ghost-btn h3-flex-get" id="h3FlexGet" hidden></button>
</div>
<!-- lightx2v v1.3 on Best at High: credit once it is in, the
one click that gets it before then (_h3RenderV13Note). -->
<div class="h3-turbo-note h3-v13-note" id="h3V13Note" hidden>
<span id="h3V13NoteText"></span>
<button type="button" class="ghost-btn h3-v13-get" id="h3V13Get" hidden></button>
</div>
<!-- Clean up sound: only with Fast, only where the runner has it
and the store fits this Mac at this Quality. -->
<label class="check h3-clean-sound" id="h3CleanSoundRow" hidden
title="Fast's sound can come out harsh or thin. This keeps the picture exactly as rendered and makes the sound again with the full model. Your character's voice LoRA stays on.">
<input type="checkbox" id="h3CleanSound" onchange="setH3CleanSound(this.checked)">
<span><b>Clean up sound</b>
<span class="cz-label-hint" id="h3CleanSoundHint">clearer voices, same picture</span></span>
</label>
</div>
<!-- Speed — the LTX-2.5 distilled lane's REAL speed control
(v4.0.5), replacing the dead one above. "Fast draft" selects
the engine's named `fast` schedule preset: 5+2 forwards vs
the tuned 8+2, ~13% faster, and it renders a DIFFERENT take
(same prompt + seed land on a different shot) — which is why
it sits next to draft affordances and never on a quality
slider. Visibility is SERVER-OWNED: the row shows only when
the current tier cell carries `fast_eta`, which the registry
stamps only on 2.5 distilled cells — the UI never parses a
version string. -->
<div id="schedPresetRow" class="cz-control" data-ltx-only hidden>
<div class="cz-label">Speed
<span class="cz-label-hint">draft schedule · changes the take</span>
</div>
<div class="pill-group cols-2" id="schedPresetGroup">
<button type="button" class="pill-btn active" data-sched-preset=""
title="The tuned schedule every graded 2.5 clip runs (8+2 forwards).">
<span>Tuned</span>
<span class="sub" id="schedTunedSub">default schedule</span>
</button>
<button type="button" class="pill-btn" data-sched-preset="fast"
title="The engine's fast draft schedule (5+2 forwards). Renders a DIFFERENT take — the same prompt and seed land on a different shot than Tuned, so use it to explore, then re-render keepers on Tuned.">
<span>Fast draft</span>
<span class="sub" id="schedFastSub">different take</span>
</button>
</div>
</div>
<div>
<div class="qs-label">
<span style="display:flex;align-items:baseline;gap:8px;min-width:0">
<span class="qs-name" id="qualityLabelName">Quality</span>
<!-- VC-34: the Tier dialog ("What this Mac can do" — every
mode's size/eta ceiling on THIS Mac) used to have one
door: Health pill → the Tier row, which #tierPill's own
CSS keeps out of sight until that popover is opened.
Docs already send people with memory questions there;
this puts a second, obvious door right where the
decision actually happens — picking a quality chip. -->
<a href="#" class="tier-quick-link" id="qualityTierLink"
onclick="openTierModal(); return false;"
title="See what this Mac can do at every quality">On this Mac: <span id="qualityTierLinkLabel">—</span></a>
</span>
<span class="qs-meta" id="qualityMeta"></span>
</div>
<!-- Compact 4-col strip. Each chip carries name + a single spec
line. Same data-quality wiring as before so setQuality()
keeps working unchanged. The .pill-btn class is preserved
for the click handler that filters by it.
When a character is selected in the Characters chip strip,
selectManualCharacter() hides this strip and reveals the
character-only strip below. Its Draft/Pro rows use q8 distilled,
while its High rows use the real q8 HQ lane; no character chip
ever falls through to the ordinary q4 quality strip. -->
<!-- LTX's CANVAS axis. Rendered by renderTierAxes('ltx') from
BOOT.ltx.qualities / .lengths / .tiers, exactly as H3's two
strips are, so the server-side table is the single source of
truth for geometry and every estimate.
These four chips used to be static markup carrying hand-written
subtitles ("Q4 · 5 min", "Q8 Pro · 7 min") kept up to date by two
separate JS updaters — numbers no measurement on 2.5 supported.
The table fills the third slot now, the way H3's already did, and
both updaters are deleted.
`data-quality` is UNCHANGED: five surfaces read it (the click
handler, setQuality's active toggle, applyTierTimes, the
trained-LoRA compatibility gate, the character-strip swap). -->
<div class="quality-strip pill-group" id="qualityGroup" data-ltx-only></div>
<!-- LTX's DURATION axis — the same second row H3 grew, for the same
reason: a canvas and a length are independent choices and one
strip cannot express both. Duration used to be a free numeric
field whose value one lane silently rounded away. The field
itself is not deleted (power users have shipped work with it);
it lives in Customize and a value off the axis lights no chip. -->
<div class="ltx-axes" id="ltxAxes" data-ltx-only>
<div class="qs-label h3-axis-label">
<span class="qs-name">Length</span>
<span class="qs-meta" id="ltxLengthMeta"></span>
</div>
<div class="quality-strip pill-group" id="ltxLengthGroup"></div>
</div>
<!-- Character-only quality strip — revealed by selectManualCharacter.
Rendered entirely from BOOT.ltx.character so the Manual surface
and Characters tab expose the same generation-specific tokens. -->
<!-- data-ltx-only for a reason the `hidden` attribute can't cover:
its visibility is owned by _applyCharacterQualityStripVisibility,
which only ever asks "is a character selected?". With a character
active, switching to H3 left this strip lit BESIDE the H3 tier
strip — two primary strips, both claiming to set the render. The
fold rule settles it declaratively, whatever the JS believes. -->
<div class="quality-strip pill-group" id="qualityGroupCharacter" hidden data-ltx-only></div>
<!-- Hailuo H3 render shape — TWO INDEPENDENT AXES, not one fixed tier
menu. This shipped as six baked combinations (Draft 3s, HQ 3s,
HQ 5s, Wide 5s, Long 10s, Long 15s) and the owner's report was
exact: "somebody may want to run the HQ 5s version for 10s, and
it's now not possible from the UI." The matrix was mostly empty —
our best canvas, the only true 16:9, could only produce 5-second
clips — and nothing technical said so. Chained windows keep memory
flat per window, so every canvas reaches every length.
So: Quality picks the CANVAS (Draft 640×384 · Standard 768×448
· High 1024×576 · Native 1344×768, the model's own ceiling),
Length picks the DURATION (3s · 5s · 10s · 15s), and they don't
know about each other. Both strips reuse the LTX
.quality-strip visual language (separate elements, so neither
engine's chips can ever be half-lit) and both are rendered by
renderH3Axes() from BOOT.h3.qualities / .lengths / .tiers — the
server-side tables stay the single source of truth for geometry,
steps and every estimate, so a change is one Python edit.
The outer id is UNCHANGED (#h3TierGroup): the engine registry row
names it as H3's `strip` and setEngine's generic surface-swap
hides it by id. It is now a wrapper around the two strips rather
than a strip itself. -->
<div class="h3-axes" id="h3TierGroup" hidden>
<div class="quality-strip pill-group" id="h3QualityGroup"></div>
<div class="qs-label h3-axis-label" id="h3LengthLabel">
<span class="qs-name">Length</span>
<span class="qs-meta" id="h3LengthMeta"></span>
</div>
<div class="quality-strip pill-group" id="h3LengthGroup"></div>
</div>
</div>
<!-- ========== H3 PRIMARY CONTROLS — Speed + Steps ==========
These two shipped inside the Customize disclosure and the owner
could not find Steps at all: "I see you removed the step options
we had before, no?" He hadn't lost a control, he'd lost a
control's VISIBILITY, and the diagnosis matters — the rule that
put them there was "LTX keeps its secondary knobs in Customize,
so H3 should too", applied without checking whether they are
secondary on this engine. They are not. Quality picks the canvas
and Length picks the duration; Turbo (4-step distill adapter) and
Steps (9 → 20 sigma points) are what decide how long you wait,
each worth about a 2× swing, and neither is implied by either
axis. A control that changes wall clock by 2× does not belong
behind a disclosure triangle.
So they sit here, directly under the two strips they modify,
in the same chip grammar as the rest of the form. Nothing else
moved: same ids, same .cz-* classes, same handlers, same hidden
inputs (#h3_turbo / #h3_steps, both in the make_job allowlist).
.eng-primary is only a CSS hook — the active-pill accent rules
were scoped to .cz-body, so leaving Customize would otherwise
have cost these chips their engine colour. Order is deliberate:
Speed first because Turbo OVERRULES Steps. -->
<div class="eng-primary" id="h3PrimaryControls" data-h3-only>
<!-- The Standard | Turbo Speed row that lived here is folded into
the Speed switch above the Quality cards (#h3SpeedRow): Fast
replaces Turbo, Best is the shape's own sampler. -->
<!-- Adapter slot. Appears ONLY when the conflict is real — Turbo
selected AND a LoRA picked — because H3's runner has exactly
one `--lora` and there is nothing to decide until both want
it. Rendered by renderH3LoraSlot() from BOOT.h3.loras so the
sentence explaining the constraint comes from Python, next to
the constant that encodes it. The alternative (silently
preferring one) is the failure this control exists to
prevent: a render that quietly ignored the LoRA you picked,
or quietly dropped the Turbo you asked for. -->
<div class="cz-control" id="h3LoraSlotRow" data-h3-only hidden>
<div class="cz-label">Adapter
<span class="cz-label-hint">one slot · Turbo or your LoRA</span>
</div>
<div class="pill-group cols-2" id="h3LoraSlotGroup">
<button type="button" class="pill-btn active" data-h3-lora-slot="turbo"
title="Spend the slot on Turbo. Your picked LoRA won't render — the job stops and says so rather than silently dropping it.">
<span>Turbo</span>
</button>
<button type="button" class="pill-btn" data-h3-lora-slot="user" id="h3LoraSlotUserPill">
<span>My LoRA</span><span class="sub" id="h3LoraSlotUserSub"></span>
</button>
</div>
<div class="h3-turbo-note" id="h3LoraSlotNote"></div>
</div>
<!-- H3 sampler depth. Cells bake 9 steps (8 forwards per window),
except High and dense 10 s, which bake 16 (15 forwards) — High
since the 2026-09-16 gym A/B; the official
reference recipe runs 20. Four honest pills beat an unbounded
numeric box, and the chips above re-price live when one is
pinned, so the multiplier does not have to live in a tooltip. -->
<div class="cz-control" id="h3StepsRow" data-h3-only>
<div class="cz-label">Steps
<span class="cz-label-hint">Auto = this shape's tuned count</span>
</div>
<div class="pill-group cols-4" id="h3StepsGroup">
<button type="button" class="pill-btn active" data-h3-steps="auto"
title="This shape's tuned count — the validated speed/quality point.">Auto</button>
<button type="button" class="pill-btn" data-h3-steps="12"
title="More refinement — ~1.4× the render time. The Quality and Length chips re-price when you pin it.">12</button>
<button type="button" class="pill-btn" data-h3-steps="16"
title="~1.9× the render time. The Quality and Length chips re-price when you pin it.">16</button>
<button type="button" class="pill-btn" data-h3-steps="20"
title="The official reference recipe — ~2.4× the render time.">20</button>
</div>
</div>
</div>
<!-- ============== ORIENTATION (compact, top-level) ==============
Lifted out of the Customize accordion so users don't have to
dig for it. Compact 2-pill row reusing the same id="aspect"
hidden input + id="aspectGroup" click delegation + id="aspectRow"
container that setQuality() hides when quality=quick. -->
<div class="mode-only show" id="aspectRow" data-ltx-only style="display:flex;align-items:center;gap:10px;margin:6px 0 8px 0;padding:0 2px;">
<span style="font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.4px;font-weight:600;flex:0 0 auto;">Orientation</span>
<div class="pill-group" id="aspectGroup" style="display:flex;gap:4px;flex:0 0 auto;flex-wrap:wrap;">
<button type="button" class="pill-btn active" data-aspect="landscape" title="Landscape 16:9" style="padding:4px 10px;font-size:12px;display:inline-flex;gap:6px;align-items:center;">
<svg class="ph orient-icon" aria-hidden="true" style="width:14px;height:14px;transform:rotate(90deg);"><use href="#ph-device-mobile"/></svg><span>16:9</span>
</button>
<button type="button" class="pill-btn" data-aspect="vertical" title="Vertical 9:16" style="padding:4px 10px;font-size:12px;display:inline-flex;gap:6px;align-items:center;">
<svg class="ph orient-icon" aria-hidden="true" style="width:14px;height:14px;"><use href="#ph-device-mobile"/></svg><span>9:16</span>
</button>
<!-- VC-39: social creators need 1:1 and 4:5, not just the
two video-shaped presets above. Fixed 768×768 /
768×960 cells, exact under this Mac's cap (see aspect_presets_for_this_mac server-side) — same wiring
as the two pills above, no new JS needed. -->
<button type="button" class="pill-btn" data-aspect="square" title="Square 1:1" style="padding:4px 10px;font-size:12px;display:inline-flex;gap:6px;align-items:center;">
<svg class="ph orient-icon" aria-hidden="true" style="width:14px;height:14px;"><use href="#ph-device-mobile"/></svg><span>1:1</span>
</button>
<button type="button" class="pill-btn" data-aspect="portrait_4_5" title="Portrait 4:5" style="padding:4px 10px;font-size:12px;display:inline-flex;gap:6px;align-items:center;">
<svg class="ph orient-icon" aria-hidden="true" style="width:14px;height:14px;"><use href="#ph-device-mobile"/></svg><span>4:5</span>
</button>
<!-- No dedicated square/portrait glyph in the sprite (grepped
the whole sheet) — reusing ph-device-mobile like 16:9/9:16
do rather than adding a new SVG symbol for a P3 chip. -->
</div>
<input type="hidden" name="aspect" id="aspect" value="landscape">
</div>
<!-- H3 orientation. Every H3 canvas ships landscape, which made
vertical social formats unreachable on this engine. Portrait
is the SAME canvas rotated — identical pixel count, identical
packed rows, so the tier chip's measured estimate stays true
and no new cell is invented. Applied where make_job stamps the
cell's geometry; `h3_tier` (the wire format every sidecar
carries) is untouched. -->
<div class="cz-control" id="h3OrientationRow" data-h3-only>
<div class="cz-label">Orientation
<span class="cz-label-hint">portrait rotates the tier's canvas — same cost</span>
</div>
<input type="hidden" name="h3_orientation" id="h3_orientation" value="landscape">
<div class="pill-group cols-2" id="h3OrientationGroup">
<button type="button" class="pill-btn active" data-h3-orientation="landscape"
title="The tier's canvas as trained and measured — e.g. 1024×576.">
<span>Landscape</span><span class="sub" id="h3OrientLandSub">16:9-ish</span>
</button>
<button type="button" class="pill-btn" data-h3-orientation="portrait"
title="The same canvas rotated for vertical/social — e.g. 576×1024. Same pixel budget, same wall clock.">
<span>Portrait</span><span class="sub" id="h3OrientPortSub">vertical / social</span>
</button>
</div>
</div>
<div class="mode-only show" id="quickMetricsRow">
<div class="mini-fields">
<div class="mf-cell">
<span class="mf-label">Seed <span class="mf-hint">-1 = random</span></span>
<input name="seed" id="seed" value="-1" oninput="_syncSeedLockChip()" title="-1 picks a fresh random seed per render. Any integer locks the seed for repeatable output.">
</div>
</div>
</div>
</div>
</details>
<!-- The selected cell's honest notes, joined — the mirror of
#h3TierNote. Empty and hidden when the combination has nothing
to warn about, which is most of them. -->
<div class="engine-hint" id="ltxTierNote" hidden></div>
<!-- H3-14: the selected chip's own description (cell.blurb — the
SAME text the chip's hover tooltip already carries) used to be
hover-only, so a laptop trackpad or touch screen never saw it,
and a stale/contradictory blurb (Native naming a "Turbo" the UI
replaced; two "10s" chips each claiming to be "the safe one")
was hard to catch because nobody but a hover-happy reviewer
ever read it. Now shown as a visible line, written in user
terms — what THIS shape costs and trades, not a developer's
measurement note. -->
<div class="engine-hint" id="h3TierBlurb" data-h3-only hidden></div>
<!-- Honest artefact notes for the selected combination. Rendered from
the cell's `notes` list (server-side), so a Draft 10 s clip is
told BOTH that 0.25 MP doesn't resolve faces and that one prompt
is asked of every 5 s window. The chained warning now fires at any
quality, because chaining is now available at any quality. The
chained sentence now POINTS AT the control below instead of only
warning; h3_visible_tiers() swaps the old warning back in for a
pack whose runner has no --chain-prompts. -->
<div class="engine-hint" id="h3TierNote" data-h3-only hidden></div>
</div>
<!-- Characters picker MOVED to the top of the form (right after
warnBanner) on 2026-05-18 — see the block there for the full
spec. This comment is a tombstone so anyone grepping for the
old location knows it's not lost, just relocated. -->
<!-- LoRA picker — UNIFIED across video form + Image Studio.
Lives inside #genForm by default (so the video form's FormData
picks up the hidden #lorasJson on submit), but on
setMode('image') the JS portals the visible <details> over to
#loraPickerStudioSlot so the SAME picker renders inside the
Studio composer. One source of truth: _activeLoras + the same
hidden #lorasJson field. The picker's library list is
filtered by /loras?mode=<tag> based on the current (mode +
engine) selection — see refreshLoras() in JS for the mapping.
2026-05-17: also filtered by ?exclude_characters=1 (Manual tab)
so character face/audio/voice files don't double-appear in
both pickers. Image Studio still pulls the unfiltered list
since the Characters picker is Manual-T2V only.
Collapsible because most users won't touch it on a given
session, and inline because hiding it behind a modal makes
it easy to forget. CLOSED by default since the 2026-09-18 layout
pass — it shipped open, which meant an empty list and its
four-line "drop .safetensors files here" empty state were the
tallest thing on the form for every user who owns no LoRAs. The
summary still carries the state ("none active" / "2 active"), and
the paths that add one (Browse CivitAI, Import H3 LoRA) open the
section themselves. -->
<div class="form-divider"></div>
<!-- NOT `data-ltx-only` any more (2026-08-09): H3 takes LoRAs too, out
of its own library, so the picker is shared and its visibility is
decided by _syncLoraPickerForEngine() from the ENGINES table's
`lora_tag` plus the H3 runner probe. A CSS fold rule can express
"one engine" but not "any engine whose installed pack has --lora",
which is the actual condition. -->
<div id="loraPickerVideoSlot">
<details id="lorasDetails" class="loras-section">
<summary class="loras-summary">
<span class="loras-chevron" aria-hidden="true"><svg class="ph"><use href="#ph-caret-down-bold"/></svg></span>
<span class="loras-title">LoRAs</span>
<span class="loras-meta" id="lorasSummaryCount">none active</span>
<!-- Action buttons live in the header so they're visible
regardless of how far the user has scrolled inside the
LoRA list. Rescan is icon-only (the ↻ glyph reads as
refresh universally); Browse CivitAI is the primary CTA
for adding new LoRAs so it's a coloured button.
event.stopPropagation() keeps clicks from toggling the
<details> open/closed state. -->
<span class="loras-header-actions">
<button type="button" class="loras-icon-btn" id="lorasRescanBtn"
title="Rescan mlx_models/loras/ for new files"
onclick="event.stopPropagation(); event.preventDefault(); refreshLoras()"><svg class="ph" aria-hidden="true"><use href="#ph-arrow-clockwise-bold"/></svg></button>
<input type="file" id="h3LoraImportFile" accept=".safetensors,application/octet-stream" hidden
onchange="importH3Lora(this.files[0]); this.value = ''">
<button type="button" class="loras-browse-btn is-ghost" id="h3LoraImportBtn" hidden
title="Import H3 LoRA — a .safetensors file you already have"
onclick="event.stopPropagation(); event.preventDefault(); document.getElementById('h3LoraImportFile').click()"><svg class="ph" aria-hidden="true"><use href="#ph-folder-simple"/></svg>Import</button>
<button type="button" class="loras-browse-btn"
onclick="event.stopPropagation(); event.preventDefault(); openCivitaiModal()"><svg class="ph" aria-hidden="true"><use href="#ph-magnifying-glass"/></svg>Browse CivitAI</button>
<button type="button" class="loras-browse-btn is-ghost" id="loraUpdatesBtn" title="Check for updates — ask CivitAI whether any installed LoRA has a newer version"
onclick="event.stopPropagation(); event.preventDefault(); checkLoraUpdates()">Updates</button>
</span>
</summary>
<div class="loras-body" id="lorasBody">
<!-- Mode/engine context banner — shows the active filter so
the user understands why some library entries are
hidden when they switch engine in Image Studio. -->
<div class="lora-mode-banner hint" id="loraModeBanner"
style="margin: 0 0 6px 0; font-size: 11px;"></div>
<!-- H3-08: combined strength across every ACTIVE LoRA for the
current engine. Only shown with 2+ active — one LoRA has
nothing to stack against. Filled by renderLorasList(). -->
<div class="hint" id="lorasStrengthTotal" hidden
style="margin: 0 0 6px 0; font-size: 11px;"></div>
<!-- Filter/search box. Shows up only when 5+ LoRAs are
installed; below that it's just visual noise. Filters by
name AND trigger words (case-insensitive substring). -->
<div id="lorasFilterRow" style="display:none;">
<input type="text" id="lorasFilter" class="lora-filter"
placeholder="Filter LoRAs… (name or trigger word)"
oninput="renderLorasList()">
</div>
<div class="hint" id="lorasEmpty">
Drop <code>.safetensors</code> files into <code id="lorasDir">mlx_models/loras/</code>
to use them, or click <strong>Browse CivitAI</strong> above.
Each LoRA picks up an optional sidecar <code>.json</code> with
name + trigger words + recommended strength.
</div>
<div class="loras-list" id="lorasList"></div>
</div>
</details>
</div>
<div class="form-divider"></div>
<!-- Hidden field; updated by the LoRA picker JS to a JSON-encoded
array of {path, strength} that make_job parses. STAYS inside
#genForm even when the visible <details id="lorasDetails"> is
portaled over to the Studio slot — the video form's FormData
still needs to pick it up on submit. Image Studio submits go
through imgStudioGenerate() which reads _activeLoras directly
and attaches a `loras` field manually. -->
<input type="hidden" id="lorasJson" name="loras" value="">
<input type="hidden" name="steps" id="steps" value="8">
<!-- ============== AFTER THE RENDER · ADVANCED ==============
One "Customize" grab-bag used to hold H3 orientation, both engines'
export pills, the upscale method, width × height, duration/frames, the
schedule preset, STG, long clips, the I2V audio source and "open file
when done" — ten unrelated decisions behind one word. Split by what the
user is DECIDING, not by which engine owns the feature:
· After the render — what happens to the file once the model is
done: the export size on either engine, how the upscale is done,
the optional Upscale & Face Fix job, open when done. None of it
changes a pixel the model produced.
· Advanced — the overrides that DO change the render and that most
users should never touch: raw canvas, raw frames, detail guidance,
long-clip strategy, external I2V audio.
Orientation and the LTX schedule preset left for Shot setup (they are
part of the shape). Everything else kept its id, its field name, its
handler and its default. #sizingSection still wraps both, so the
mode-only show/hide that folds this away for Extend keeps working. -->
<div class="mode-only" id="sizingSection">
<details id="finishDetails" class="customize-section">
<summary class="cz-summary">
<span class="cz-chevron" aria-hidden="true"><svg class="ph"><use href="#ph-caret-down-bold"/></svg></span>
<span class="cz-title">After the render</span>
<span class="cz-meta" id="finishSummary">native export</span>
</summary>
<div class="cz-body">
<!-- ========== HAILUO H3 CONTROLS ==========
What is left of the H3 half of Customize is EXPORT, and only
export. Speed and Steps used to live here too, on the LTX-parity
argument that Customize holds the secondary knobs — but that
parity was misread. LTX can demote its sampler knobs because
LTX's primary decision is the Quality strip, which already
carries them. H3's tier strip does not: Turbo and Steps move
H3's wall clock by roughly 2× on their own, on top of whatever
tier is selected. They are primary, and they now render as
primary — see #h3PrimaryControls up beside the tier strip.
Export is genuinely secondary (a post-render ffmpeg pass that
changes no pixel the model produced), so it stays. Same
.cz-control / .cz-label / .pill-group grammar as every LTX
control below it, folded away on any other engine by
data-h3-only (rule emitted from the ENGINES table). -->
<!-- H3 export canvas. Most tiers render 12:7 (768×448), which is
neither 720p nor 1080p; this runs the SAME lanczos-fit + pad +
libx264 pass an LTX render gets, keeping the native file on
disk but hidden from the gallery. Since 4.16.1 near-16:9
content (12:7, 5:3) fills the frame with a small centre crop
instead of black bars (EXPORT_FILL_MAX_TRIM), and the High
tier (1024×576) is exactly 16:9, so it scales with neither.
Separate from the LTX Export control below so one pill never
means two things. -->
<div class="cz-control" id="h3ExportRow" data-h3-only>
<!-- Labelled "Upscale", not "Export" (owner: "export should be
upscale") — users think of this as making the clip bigger,
which is exactly what it does. The field name, the make_job
key and the sidecar all stay `h3_upscale`; only the human
label changed. -->
<div class="cz-label">Upscale
<span class="cz-label-hint">after the render · no bars</span>
</div>
<div class="pill-group cols-3" id="h3UpscaleGroup">
<button type="button" class="pill-btn" data-h3-upscale="off"
title="Ship the tier's native canvas with no post-process.">
<span>Native</span><span class="sub">as rendered</span>
</button>
<button type="button" class="pill-btn active" data-h3-upscale="fit_720p"
title="Scale to 1280×720 — no bars, no distortion. A 16:9 tier scales clean; 12:7 and 5:3 fill the frame with a few pixels trimmed at the edges.">
<span>720p fit</span><span class="sub">scale to fill</span>
</button>
<button type="button" class="pill-btn" data-h3-upscale="fit_1080p"
title="Scale to 1920×1080 — no bars, no distortion. A 16:9 tier scales clean; 12:7 and 5:3 fill the frame with a few pixels trimmed at the edges.">
<span>1080p fit</span><span class="sub">scale to fill</span>
</button>
</div>
<!-- What THIS tier + THIS export target will actually do: "pure
1.25× scale, no bars" or "12:7 fills 1280×720 — 13 px trimmed
top and bottom, no bars". The string is built server-side by
_h3_export_notes() from compute_upscale_plan itself, so the
sentence can never disagree with the ffmpeg command that
runs. Sits UNDER the control it describes now, instead of
floating between two unrelated rows. Hidden on Native. -->
<!-- "H3 mind, LTX pixels", OPTIONAL and OFF by default: the draft
ships native and an Upscale & Face Fix job is queued behind
it. Stored as h3_upscale = "ltx_x2" (sidecars, Load Params
and the API are unchanged); a checkbox because it is an
extra job, not a size. -->
<div class="cz-note" id="h3ExportNote" hidden></div>
<!-- H3-26: shown whenever H3.upscale_modes allows ltx_x2, which
is not Draft-only — the copy used to say "the draft"
unconditionally, wrong on Standard/High. -->
<label class="check h3-facefix-after" id="h3FaceFixAfterRow"
title="Queues a second job right after this one: the same clip at twice the size with LTX-2.5 detail, the face and the sound kept. This render itself stays as rendered, next to it. Needs the 0.3 GB Upscale adapter (Settings → Models).">
<input type="checkbox" id="h3FaceFixAfter" onchange="setH3FaceFixAfter(this.checked)">
<span>Also run <b>Upscale & Face Fix</b> after this render
<span class="cz-label-hint" id="h3FaceFixEta">optional · 2× · face and sound kept · about the same time again</span></span>
</label>
</div>
<!-- Export upscale — target dims after render. "720p fit"
preserves aspect ratio (no distortion; a near-16:9 canvas fills the frame with a few px trimmed, 4.16.1). 2× doubles
each side. Native skips the upscale entirely. The "Method"
row below picks how the upscaling is done. -->
<div class="cz-control" data-ltx-only>
<div class="cz-label">Export
<span class="cz-label-hint">post-render, no bars</span>
</div>
<div class="pill-group cols-3" id="upscaleGroup">
<button type="button" class="pill-btn active" data-upscale="off"><span>Native</span><span class="sub">as generated</span></button>
<button type="button" class="pill-btn" data-upscale="fit_720p"><span>720p fit</span><span class="sub">scale to fill</span></button>
<button type="button" class="pill-btn" data-upscale="x2"><span>2×</span><span class="sub">same ratio</span></button>
</div>
</div>
<!-- Upscale method. Hidden when Export = Native. Fast = ffmpeg
Lanczos resize, no detail recovery, near-instant. Sharp =
PiperSR/CoreML 2× post-upscale on Apple Neural Engine, then
ffmpeg fit/export. The old LTX latent upscaler path remains
hidden behind LTX_ENABLE_MODEL_UPSCALE for lab archaeology. -->
<div class="cz-control" id="upscaleMethodRow" data-ltx-only style="display:none;">
<div class="cz-label">Method
<span class="cz-label-hint">how the upscale is done</span>
</div>
<div class="pill-group cols-2" id="upscaleMethodGroup">
<button type="button" class="pill-btn active" data-method="lanczos"><span>Fast</span><span class="sub">ffmpeg Lanczos · instant</span></button>
<button type="button" class="pill-btn" data-method="pipersr"><span>Sharp</span><span class="sub">PiperSR ANE · +30-90 s</span></button>
</div>
<input type="hidden" name="upscale_method" id="upscale_method" value="lanczos">
</div>
<!-- Open file when done — minor convenience. Was its own row
in the old Advanced disclosure; now folded inline. -->
<div class="cz-control">
<label class="check" style="margin:0">
<input type="checkbox" name="open_when_done" id="open_when_done"> Open file when done
</label>
</div>
<!-- Export used to sit here too, as a third flat pill row with
hand-rolled inline styles and its note floating loose beneath
it. It is now a .cz-control inside the SAME Customize disclosure
LTX uses (grep h3ExportRow) — one information architecture, one
chip grammar, one summary line, so the two engines read as one
product. Export earns the demotion that Speed and Steps did not:
it is an ffmpeg scale-and-pad pass AFTER the render, so it costs
no wall clock and changes no pixel the model produced. The
hidden inputs for all three live up in the engine-state block;
every one is in the make_job allowlist, which is the only place
they could silently die. -->
<!-- The skip-step toggle (and its charSkipstepToggle legacy stub)
is gone as of v4.0.5 — the control was dead at the engine
boundary; see the HQ-speed removal note in Customize. -->
</div>
</details>
<!-- ============== BATCH ==============
Owner, 2026-09-18: "batch is kind of hidden, and it should probably
be re-taught in a way that is more user-friendly and also more
highlighted. It should be a section, actually, after the render and
setup."
It was a 60-px pill in the queue strip that opened a modal holding
one textarea and the sentence "split prompts with --- on its own
line" — a power feature behind a door nobody opens, with a
convention nobody guesses. Now it is a row of the same stack, it
says how many jobs it is about to queue BEFORE you press anything,
and it offers the two things people actually batch:
Many prompts — the --- paste, with a live count and the first
line of each prompt listed back, so a paste that
split wrong is visible instead of discovered in
the queue.
Same prompt — N takes of what is in the prompt box, each with
its own random seed. This is what judging a
prompt needs, and doing it by hand meant pasting
the same paragraph N times.
Queue-all is inside the section, next to the count. The old pill
stays in the queue strip and now opens THIS, not a modal — one
door, two handles. -->
<details id="batchDetails" class="customize-section batch-section">
<summary class="cz-summary">
<span class="cz-chevron" aria-hidden="true"><svg class="ph"><use href="#ph-caret-down-bold"/></svg></span>
<span class="cz-title">Batch</span>
<span class="cz-meta" id="batchSummary">one render at a time</span>
</summary>
<div class="cz-body">
<div class="cz-label">What varies
<span class="cz-label-hint">one job per prompt, or one prompt many times</span>
</div>
<div class="pill-group cols-2" id="batchModeGroup">
<button type="button" class="pill-btn active" data-batch-mode="prompts"
onclick="setBatchMode('prompts')">Many prompts
<span class="sub">one job per prompt</span></button>
<button type="button" class="pill-btn" data-batch-mode="seeds"
onclick="setBatchMode('seeds')">Same prompt
<span class="sub">N takes, new seed each</span></button>
</div>
<div id="batchPromptsWrap">
<textarea class="batch" id="batchPrompts" rows="7"
oninput="updateBatchSummary()"
placeholder="Paste your prompts here, with a line containing only three dashes between them:
A wizard lights a lantern in a dark forest. Audio: wind, a match striking.
---
The same wizard walks out of frame. Audio: footsteps on leaves."></textarea>
<div class="hint" id="batchCount">Nothing pasted yet.</div>
</div>
<div id="batchSeedsWrap" hidden>
<div class="cz-label">Takes
<span class="cz-label-hint" id="batchTakesNote"></span>
</div>
<div class="pill-group cols-5" id="batchTakesGroup">
<button type="button" class="pill-btn" data-batch-takes="2" onclick="setBatchTakes(2)">2</button>
<button type="button" class="pill-btn active" data-batch-takes="3" onclick="setBatchTakes(3)">3</button>
<button type="button" class="pill-btn" data-batch-takes="4" onclick="setBatchTakes(4)">4</button>
<button type="button" class="pill-btn" data-batch-takes="6" onclick="setBatchTakes(6)">6</button>
<button type="button" class="pill-btn" data-batch-takes="8" onclick="setBatchTakes(8)">8</button>
</div>
<div class="hint" id="batchSeedsHint">Every take uses the prompt above with a fresh random seed.</div>
</div>
<div class="batch-actions">
<span class="batch-total" id="batchTotal"></span>
<button type="button" class="batch-queue-btn" id="batchQueueBtn"
onclick="queueBatch()">Queue batch</button>
</div>
<div class="hint">Auto-open is forced off for a batch, and the queue
runs them one after another — you can keep working while it does.</div>
</div>
</details>
<details id="customizeDetails" class="customize-section">
<summary class="cz-summary">
<span class="cz-chevron" aria-hidden="true"><svg class="ph"><use href="#ph-caret-down-bold"/></svg></span>
<span class="cz-title">Advanced</span>
<span class="cz-meta" id="customizeSummary"></span>
</summary>
<div class="cz-body">
<!-- Width × height. Setting custom dimensions makes the form
leave the active preset (the Quality pill stays highlighted
but the Customize summary shows "custom" so the user knows
they've deviated). Aspect ratio (16:9 / 9:16) moved
OUT of this accordion 2026-05-17 — now lives as a compact
top-level row right under the Quality picker. Keeps the
same id="aspectRow" / id="aspectGroup" / id="aspect" so all
JS (setAspect, applyAspect, setQuality's quick-mode hide,
Load Params restoration) keeps working unchanged.
data-ltx-only: an H3 render's geometry is the TIER's, stamped
by setH3Tier — offering an editable box that setH3Tier
overwrites on the next click was the loudest thing wrong with
the old H3 Customize. -->
<div id="dimsRow" class="cz-control" data-ltx-only>
<div class="cz-label">Width × height
<span class="cz-label-hint">multiples of 64 — the two-stage engine floors anything else</span>
</div>
<div class="row">
<!-- step/min 64, not 32: every registered LTX lane is
two-stage (stage 1 at half resolution, itself /32), so
the engine floors the canvas to /64. A /32 step offered
sizes the render would silently shrink — the CUSTOMIZE
audit's "Width × Height LIES" row. make_job floors the
job to the same grid and says so. -->
<div><input name="width" id="width" value="1024" type="number" min="64" step="64" aria-label="Width"></div>
<div><input name="height" id="height" value="576" type="number" min="64" step="64" aria-label="Height"></div>
</div>
</div>
<!-- Duration / Frames — the power-user override, MOVED HERE in
v4.0 (spec §2.2). It used to sit in the primary form ~60 px
under the Length chips, which meant the panel showed a
5-second, ~2-minute shape while the form would render 337
frames: the release's own headline bug, two rows below the
control that fixed it.
NOT deleted — power users have shipped work with the raw
Frames box, and removing a control people use is not polish.
It lives with every other override, and a value off the axis
lights no chip and prints `custom · 337f · 14 s` in the Length
meta. -->
<div id="durationRow" class="cz-control" data-ltx-only>
<div class="cz-label">Duration <span class="cz-label-hint">seconds, and the frames it lands on</span></div>
<div class="row">
<div><input id="duration" value="5" type="number" min="1" max="20" step="any" aria-label="Duration in seconds"></div>
<div><input name="frames" id="frames" value="121" type="number" min="1" aria-label="Frames" title="Must be 8k+1 (e.g., 121, 161, 201). Duration auto-syncs."></div>
</div>
</div>
<!-- 2026-05-17 (Codex C+ pass 5): the Speed (Boost/Turbo)
acceleration row used to live here. Killed from the public
surface — it's a Q4-distilled-pipeline-only knob; the Q8
HQ pipeline ignores `accel` (and uses TeaCache + skip-step
for its speed wins instead). Keeping the row would mean
either a Q4-only-relevant control showing on Q8 (where it
does nothing) or a control that silently changes meaning
based on tier. The hidden #accel input below survives so
nothing in the queue/sidecar/restore paths breaks.
If a future Q4 lab tool needs the row back, restore it
behind `body[data-cap-tier="q4"]` and wire it explicitly
to the Q4 path. -->
<div id="accelRow" class="cz-control" data-ltx-only hidden style="display:none">
<div class="pill-group cols-3" id="accelGroup">
<button type="button" class="pill-btn active" data-accel="off">Exact</button>
<button type="button" class="pill-btn" data-accel="boost">Boost</button>
<button type="button" class="pill-btn" data-accel="turbo">Turbo</button>
</div>
</div>
<!-- HQ speed (Fast/Exact) REMOVED in v4.0.5. The 2026-05-15
skip-step patch it described belongs to the pre-vendored
engine era: the pinned port's `generate_and_save` accepts
neither `video_skip_step` nor `audio_skip_step`, and the
helper's `_filter_unsupported_kwargs` silently dropped both
before invocation — so Fast and Exact ran IDENTICAL settings
while the UI claimed "~12% faster" (CUSTOMIZE audit,
2026-08-14: DEAD on both generations). Low-level sampler
support exists (`MultiModalGuiderParams.skip_step`); if it is
ever wired for real, rebenchmark and bring the control back
with a measured number, not this one. -->
<!-- STG (Spatio-Temporal Guidance) — "detail guidance". The Q8 HQ
res_2s guider adds stg_scale·(cond - perturbed) to the
prediction (guiders.py MultiModalGuider.calculate), which
cleans up motion + fine detail at the cost of an extra forward
pass per outer step (slower). 0.0 = OFF (default — the guider
short-circuits at exactly 0.0). Only acts on the Q8 HQ path
(quality=high); the Q4 distilled paths ignore STG entirely, so
the row is revealed only when quality=high (same gating as the
HQ-speed row above — _applyStgRowVisibility). The range input
carries name="stg_scale" so FormData collects it; the submit
handler also fd.set()s it explicitly. -->
<div id="stgRow" class="cz-control" data-ltx-only hidden>
<div class="cz-label">STG — detail guidance
<span class="cz-label-hint">cleaner motion & detail, slower · 0 = off · try 1–1.5</span>
</div>
<div class="characters-strength-control" style="display:flex;align-items:center;gap:10px;">
<input type="range" name="stg_scale" id="stgScale"
min="0" max="4" step="0.5" value="0"
style="flex:1;width:auto"
oninput="document.getElementById('stgScaleValue').textContent = (this.value==='0' ? 'Off' : (+this.value).toFixed(1));"
title="0 = off (no quality/speed change). 1.0–1.5 is a sensible starting band for a visible detail/motion lift; higher = stronger but slower and can over-sharpen.">
<span class="characters-strength-value" id="stgScaleValue">Off</span>
</div>
</div>
<!-- Long Clip Boost — asks LTX 2.3 to generate fewer semantic
frames at 12fps, then exports a normal 24fps file with
motion interpolation. This is explicit because dialogue,
lip-sync, and fast motion need user judgment. -->
<!-- ONE SHOT used to live here, in Customize, then as a length
strip under Quality / Length. It is its own mode now — the
One Shot chip in the mode bar opens #takeAxes. -->
<div class="cz-control" id="temporalRow" data-ltx-only>
<div class="cz-label">Long clips
<span class="cz-label-hint">past 10 s: interpolate frames, or chain windows</span>
</div>
<div class="pill-group cols-3" id="temporalGroup">
<button type="button" class="pill-btn active" data-temporal="native"><span>Native</span><span class="sub">24fps from LTX</span></button>
<button type="button" class="pill-btn" data-temporal="fps12_interp24"><span>12 → 24fps</span><span class="sub">half frames · interpolated</span></button>
<button type="button" class="pill-btn" data-temporal="windows"><span>Windows</span><span class="sub">experimental · picture drifts across passes · needs Q8</span></button>
</div>
<!-- SLIDING WINDOWS: one prompt per window, the H3 chain's
contract brought to LTX. Window 1 is always the main
prompt above (ltx_windows.window_prompts: a blank line 0
means "use it") — VA-18: this used to be a free-text
textarea whose PLACEHOLDER read "(first window uses the
prompt above)⏎he turns to the window…", inviting a user
to type their first beat on the first real line, which
silently became line 0 and REPLACED the main prompt.
There is now no control that can set window 1's line at
all — one labelled, timed box per LATER window instead,
built by renderWindowsSlots() from the real schedule
(/ltx/windows_plan). Every later box is the next beat, led
by the movement; a blank box holds the previous moment.
The invariants are what must not change between passes
and are re-injected into every window. -->
<div class="cz-control" id="windowsRow" hidden>
<div class="cz-label">Per-window prompts
<span class="cz-label-hint" id="windowsHint">window 1 is the prompt above · one box per later window</span></div>
<div id="windowsDynamicSlots"></div>
<input type="hidden" name="window_prompts" id="window_prompts" value="">
<input type="text" name="window_invariants" id="window_invariants" class="sb-input"
placeholder="what must not change between windows — one man, a grey room, soft window light">
</div>
</div>
<!-- Audio source (I2V only) — folded in from the old separate
Advanced disclosure. Picker auto-hides when the current
mode isn't I2V (see updateDerived's mode-aware visibility). -->
<div class="cz-control mode-only" id="i2vAudioModeSection" data-ltx-only>
<div class="cz-label">I2V audio source
<span class="cz-label-hint">joint or external</span>
</div>
<select id="i2vMode">
<option value="i2v" selected>Joint audio (LTX generates audio synced with the visual)</option>
<option value="i2v_clean_audio">Use external audio file (mux it onto LTX video)</option>
</select>
<div class="mode-only" id="audioSection" style="margin-top:8px">
<label class="lbl">Audio file</label>
<!-- VA-20: was a raw path text box — the only non-picker file
input on the video form, and the one place a pasted
path could go stale silently. Same drop/click pattern as
the Lip-sync tab's audio slot; wired by i2vAudioInit()
in queue.js. -->
<div class="studio-ref-slot" id="i2vAudioSlot" data-slot="audio"
style="aspect-ratio:auto;min-height:72px;cursor:pointer;">
<span class="ref-tag">Audio</span>
<div class="hint" id="i2vAudioSlotHint" style="padding:16px 12px;text-align:center;color:var(--muted);font-size:12px;">
Drop a WAV / MP3 / M4A / FLAC here, or click to pick a file.
</div>
</div>
<input type="file" id="i2vAudioFileInput" accept=".wav,.mp3,.m4a,.flac,audio/*" style="display:none">
<input type="hidden" name="audio" id="audio" value="">
<!-- The mux warning: this audio replaces LTX's own generated
sound AFTER the video renders, so a mouth that happens
to move does not move to THIS file. Only lip-sync
(audio-conditioned generation) can make that true. -->
<div class="hint" style="margin-top:6px;color:var(--warn,#c98a2b)">
The mouth will not follow this file — the video is generated first, and this audio replaces its sound afterward. To make a face talk or sing to your audio, use
<a href="#" onclick="event.preventDefault();openLipSyncEntry();">Lip-sync</a> instead.
</div>
</div>
</div>
</div>
</details>
</div>
<!-- Comfy-kill toggle. Hidden in DOM by default; shown only when the
panel detects ComfyUI actually running on this Mac (see updateUI
in the poll handler). Default-off for public installs: killing a
neighboring Pinokio app should be an explicit choice, even when it
can free a lot of memory on 64 GB machines. -->
<div id="comfyKillRow" class="comfy-row" style="display:none">
<label class="lbl" style="display:flex; align-items:center; gap:8px; cursor:pointer">
<input type="checkbox" name="stop_comfy" id="stop_comfy" value="on">
<span>Stop ComfyUI before render <span style="color:var(--muted)">(optional · can free ~27 GB)</span></span>
</label>
</div>
<!-- ============== STICKY ACTION FOOTER ==============
Generate stays anchored at the bottom of the form-pane no
matter how far the user scrolls. The queue chip strip sits
above it (Batch / Pause / Clear) — compact pills, never the
primary touch target. -->
<div class="form-action-footer" id="formActionFooter">
<div class="queue-strip">
<button type="button" class="qchip" onclick="openBatch()" title="Queue many prompts, or several takes of this one"><svg class="ph" aria-hidden="true"><use href="#ph-film-strip"/></svg>Batch</button>
<button type="button" class="qchip" id="pauseBtn" onclick="togglePause()" title="Pause / resume the render queue"><svg class="ph" aria-hidden="true"><use href="#ph-pause-fill"/></svg>Pause queue</button>
<button type="button" class="qchip" data-role="clear-queue-btn" onclick="requestClearQueue()" title="Clear all queued jobs (running job continues)"><svg class="ph" aria-hidden="true"><use href="#ph-x"/></svg><span class="clear-queue-label">Clear</span></button>
<!-- VC-38: the prompt/settings draft autosaves to this browser as you
type (see draftAutosaveInstall in queue.js) and survives a reload
or the restart every Update asks for. This is the way back to a
blank form on purpose, distinct from Clear queue above. -->
<button type="button" class="qchip" id="clearFormBtn" onclick="clearDraftForm()" title="Reset the prompt, Avoid and seed, and forget the saved draft">Clear form</button>
<span class="qchip-spacer"></span>
<!-- SYS-22: at 1280-1440px (and worse below) the Shot Setup
chips (Quality/Length) render below the sticky footer,
reachable only by scrolling — "5.00s · 1024x576" here was
plain text with no way back up to change it without
scrolling past the footer first. Now a button that jumps
there directly; the derived summary text itself is
unchanged (queue.js's own comment on that design stands). -->
<button type="button" class="qchip-derived" id="derivedFooter" onclick="scrollToShotSetup()" title="Jump to Quality / Length"></button>
</div>
<!-- The after-render Upscale & Face Fix, beside Generate (same state as
the checkbox under Upscale: h3_upscale = "ltx_x2"). The footer line
to the right of the queue chips prices the pair. -->
<label class="check h3-facefix-after h3-facefix-footer" id="h3FaceFixFooterRow" data-h3-only hidden
title="Queues a second job right after this render: the clip at twice the size with LTX-2.5 detail, the face and the sound kept. The original stays as rendered, next to it. Needs the 0.3 GB Upscale adapter (Settings → Models).">
<input type="checkbox" id="h3FaceFixFooter" onchange="setH3FaceFixAfter(this.checked)">
<span>Also run <b>Upscale & Face Fix</b>
<span class="cz-label-hint" id="h3FaceFixFooterEta"></span></span>
</label>
<!-- SYS-32: the circuit breaker paused the queue and explained why
ONLY in a log line (Logs tab) -- the visible UI was "queue N ·
paused" plus a bare Resume button. This surfaces the same
reason where the person is actually looking. Populated by
poll() from /status.paused_reason. -->
<div class="breaker-notice" id="breakerNotice" hidden>
<svg class="ph" aria-hidden="true"><use href="#ph-warning-fill"/></svg>
<span id="breakerNoticeText"></span>
<!-- SYS-33: errors rarely linked to Docs even where a section
already existed for them. -->
<a href="#" class="phos-toast-action" onclick="openDocs('troubleshooting','queue-paused'); return false;">Learn more</a>
<button type="button" class="ghost-btn" onclick="requestClearQueue()">Clear queue</button>
<button type="button" class="primary-btn" onclick="api('/queue/resume','POST').then(poll)">Resume</button>
</div>
<!-- VC-03: Load Params restores the exact seed but used to say so
only in the collapsed Shot setup summary — Generate then quietly
reproduced the same clip. This chip appears whenever the seed
field holds a real (non-random) value, wherever it came from,
and ✕ is the one-click way back to a fresh roll. -->
<div class="seed-lock-chip" id="seedLockChip" hidden
title="This render will reuse this exact seed — click ✕ for a fresh one">
<span id="seedLockValue"></span>
<button type="button" class="seed-lock-clear" onclick="clearSeedLock()" aria-label="Use a new seed instead">✕</button>
</div>
<!-- VC-26: "click a row to load it into the form and Update job" —
editing a QUEUED job in place, its position unchanged. Shown by
editQueuedJob(); Update posts the current form back onto that
job's id (/queue/update), Cancel just hides the banner. -->
<div class="queue-edit-banner" id="queueEditBanner" hidden>
<span>Editing queued job — changes replace it in place, its position stays put.</span>
<div class="queue-edit-banner-actions">
<button type="button" class="primary" onclick="updateQueuedJob()">Update job</button>
<button type="button" class="ghost-btn" onclick="cancelEditingQueuedJob()">Cancel</button>
</div>
</div>
<div class="actions">
<button type="submit" class="primary" id="genBtn">Generate</button>
<button type="button" class="danger js-stop-btn" disabled data-role="stop-btn" onclick="requestStop()" title="Stop the current render">Stop</button>
</div>
</div>
</form>
<!-- ============== IMAGE STUDIO (inline, mode='image') ============== -->
<!-- Sibling of #genForm inside form-pane. Shown/hidden by setMode().
Lives outside the form so its prompt textarea doesn't submit the
video form on Enter. The right rail (queue · current · history)
to the right of form-pane stays visible during image gen. -->
<!-- Restyled to mirror the video form-pane: same h2 mono-uppercase
section labels, same hairline-bordered input chrome, same picker
idiom for ref slots, same dense 2-col field grid for engine /
aspect / n / seed, and a Generate row with an inline wall-time
estimate that updates as the user changes engine + n + aspect.
An engine-status pill on the engine row tells the user whether
the chosen engine's weights are cached locally or need a fresh
download — driven by /image/engine_status (server-side cache
probe via _repo_hf_cache_dir). -->
<div class="mode-only studio-pane" id="studioSection">
<!-- ============== STUDIO COMPOSER CARD ==============
Same composer-card chrome as the video form. Refs (3 multi-ref
slots) sit at the top, the prompt is the hero, and the engine /
aspect / n / seed live in the Quick Settings strip below.
Generate sticks at the bottom (sticky footer) so it's always
one click away regardless of how far the user scrolls. -->
<div class="composer-card">
<div class="composer-refs">
<div class="show">
<!-- SYS-14: this header claimed the Images tab was FOR
image-to-image only, in engine-jargon ("Reference Edit"),
which buries "make a still from words, then animate it" --
the standard creator workflow the Animate button (a
protected "delightful thing") exists to serve. The drop
zone itself still leads (that's the more common path
here), but the hint now says text-only is a real option
too, in plain words. -->
<h2>Make or change a picture
<span class="h2-hint">Drop a photo to edit it, or leave the slots empty and describe one in words below · FLUX 3 Klein and Ideogram 4 make pictures from text alone</span>
</h2>
<div class="studio-ref-grid" id="imgStudioRefs">
<div class="studio-ref-slot" data-slot="0">
<span class="ref-tag">Primary</span>
</div>
<div class="studio-ref-slot" data-slot="1">
<span class="ref-tag">Multi-ref</span>
</div>
<div class="studio-ref-slot" data-slot="2">
<span class="ref-tag">Multi-ref</span>
</div>
</div>
<!-- Runtime warning when the user has 2+ refs loaded but the
selected engine doesn't composite multiple subjects
reliably. Filled in by imgStudioUpdateRefWarning(). -->
<div class="studio-ref-warn" id="imgStudioRefWarn" hidden></div>
<!-- Mirrors the video I2V picker's "Recent uploads · click to use"
strip. Click a thumb → fills the next empty ref slot. Hidden
when /uploads is empty. -->
<div class="studio-ref-recent" id="imgStudioRecentWrap" style="display:none">
<div class="studio-ref-recent-label">Recent uploads · click to use</div>
<div class="studio-ref-recent-strip" id="imgStudioRecentStrip"></div>
</div>
</div>
</div>
<!-- Prompt textarea label — hidden for every engine except Ideogram
4, where the Simple/Layout toggle relabels it (in Layout the
textarea becomes the scene & background field, not the prompt). -->
<label id="imgStudioPromptLabel" class="ideo-prompt-label" for="imgStudioPrompt" hidden></label>
<textarea id="imgStudioPrompt" class="composer-prompt" rows="4"
placeholder="A cinematic medium close-up of a woman in a sunlit kitchen, soft morning light through blinds, shallow depth of field, photorealistic"></textarea>
</div>
<!-- ============== IDEOGRAM 4 — visual text-placement canvas ==============
Shown only when the engine is `ideogram4_inline`. ideoSyncVisibility()
toggles #ideoPanel.hidden off the engine value. A Simple/Layout
toggle switches between (a) plain-prompt mode (the textarea above is
a plain prompt, model accepts plain strings) and (b) Layout mode (the
textarea relabels to "Scene & background" → compositional_deconstruction.background
and this canvas drives the rest of the JSON caption). The serializer
ideoBuildCaption() emits the EXACT schema the mflux Ideogram4
caption verifier expects; imgStudioGenerate() posts it as `prompt`. -->
<div class="ideo-panel" id="ideoPanel" hidden>
<!-- One-time download heads-up: shown only while the Ideogram weights
aren't cached yet. NO token / license click — Phosphene pulls an
un-gated mirror. Toggled by ideoUpdateSetupNote() from engine_status. -->
<div class="ideo-setup-note" id="ideoSetupNote" hidden>
<svg class="ph" aria-hidden="true" style="flex:0 0 auto;width:18px;height:18px;margin-top:1px"><use href="#ph-info"/></svg>
<div class="ideo-setup-body">
<strong>First render downloads Ideogram 4 (<span id="ideoSetupDlGb">~28 GB</span>, one-time).</strong>
<span class="ideo-setup-hint">No account or token needed — Phosphene pulls an un-gated community mirror. Personal/research use is free; commercial use needs a license from Ideogram.</span>
</div>
</div>
<div class="ideo-head">
<div class="ideo-head-titles">
<span class="ideo-head-title">Ideogram 4 — text in image</span>
<span class="ideo-head-sub">Place words on the frame; the model renders the final typography.</span>
</div>
<div class="pill-group cols-2 ideo-mode-toggle" role="group" aria-label="Caption mode">
<button type="button" class="pill-btn active" id="ideoModeSimpleBtn" data-ideo-mode="simple" onclick="ideoSetMode('simple')" aria-pressed="true">
<span>Simple</span><span class="sub">plain prompt</span>
</button>
<button type="button" class="pill-btn" id="ideoModeLayoutBtn" data-ideo-mode="layout" onclick="ideoSetMode('layout')" aria-pressed="false">
<span>Layout</span><span class="sub">visual canvas</span>
</button>
</div>
</div>
<!-- Simple-mode hint: the textarea above IS the prompt. -->
<div class="ideo-simple-hint" id="ideoSimpleHint">
The prompt box above is sent as-is. Switch to <strong>Layout</strong> to place text and objects on the frame and ship a structured caption (Ideogram 4 is strongest with structured captions).
</div>
<!-- Layout-mode body — everything below shows only in Layout. -->
<div class="ideo-layout" id="ideoLayout" hidden>
<!-- Toolbar -->
<div class="ideo-toolbar">
<button type="button" class="qchip" id="ideoInsertTextBtn" onclick="ideoInsertBox('text')" title="Add a text box (or drag on an empty area of the frame)">
<svg class="ph" aria-hidden="true"><use href="#ph-pencil-simple"/></svg>Insert text
</button>
<button type="button" class="qchip" id="ideoInsertObjBtn" onclick="ideoInsertBox('obj')" title="Add an object region (something the model should draw)">
<svg class="ph" aria-hidden="true"><use href="#ph-image"/></svg>Insert object
</button>
<span class="qchip-spacer"></span>
<label class="ideo-toolbar-toggle" title="Snap boxes to thirds / center / other boxes">
<input type="checkbox" id="ideoSnapToggle" checked onchange="ideoState.snap=this.checked">
<span>Snap</span>
</label>
<button type="button" class="qchip" id="ideoUndoBtn" onclick="ideoUndo()" title="Undo (Cmd/Ctrl+Z)" disabled>
<svg class="ph" aria-hidden="true"><use href="#ph-arrow-clockwise" style="transform:scaleX(-1);transform-origin:center"/></svg>Undo
</button>
<select id="ideoExamplePicker" class="ideo-example-picker" onchange="ideoLoadExample(this.value); this.value='';" title="Load an example layout">
<option value="">Examples…</option>
<option value="poster">Poster — 16:9 event</option>
<option value="logo">Logo — 1:1 wordmark</option>
<option value="label">Product label — 9:16</option>
<option value="meme">Meme — 1:1 top/bottom</option>
</select>
</div>
<!-- The stage. aspect-ratio is driven from #imgStudioAspect via
ideoApplyAspect(); boxes store x,y,w,h as 0..1 fractions so a
ratio change just restyles the box, never moves coordinates.
role=application + keyboard handlers make it a11y-operable. -->
<div class="ideo-stage-wrap" id="ideoStageWrap">
<div class="ideo-stage" id="ideoStage" role="application"
aria-label="Text placement canvas. Click Insert text or drag to add a box; arrow keys nudge the selected box, Delete removes it."
tabindex="0"
onpointerdown="ideoStagePointerDown(event)">
<div class="ideo-stage-hint" id="ideoStageHint">Drag to draw a text box, or use <strong>+ Text</strong> above.</div>
<!-- guide lines + boxes are injected here by ideoRender() -->
</div>
</div>
<div class="ideo-stage-note" id="ideoStageNote">
<svg class="ph" aria-hidden="true"><use href="#ph-info"/></svg>
Placement preview — boxes show where words sit; Ideogram renders the final type, weight, and texture.
</div>
<!-- Inspector — appears when a box is selected. -->
<div class="ideo-inspector" id="ideoInspector" hidden>
<div class="ideo-insp-row ideo-insp-typeswitch" id="ideoInspTypeSwitch">
<span class="mf-label">Region</span>
<div class="pill-group cols-2" role="group" aria-label="Region type">
<button type="button" class="pill-btn" data-ideo-type="text" onclick="ideoSetSelType('text')">Text</button>
<button type="button" class="pill-btn" data-ideo-type="obj" onclick="ideoSetSelType('obj')">Object</button>
</div>
</div>
<div class="ideo-insp-row" id="ideoInspTextRow">
<span class="mf-label" id="ideoInspTextLabel">Text (literal words)</span>
<input type="text" id="ideoInspText" maxlength="160"
placeholder="THE WORDS TO RENDER"
oninput="ideoUpdateSel({text:this.value})"
onfocus="ideoState._editing=true" onblur="ideoState._editing=false">
</div>
<div class="ideo-insp-row" id="ideoInspDescRow">
<span class="mf-label">Describe it (optional — refines look)</span>
<input type="text" id="ideoInspDesc" maxlength="240"
placeholder="e.g. bold serif headline in bright white"
oninput="ideoUpdateSel({descManual:this.value})"
onfocus="ideoState._editing=true" onblur="ideoState._editing=false">
</div>
<div class="ideo-insp-grid">
<div class="ideo-insp-cell" id="ideoInspStyleCell">
<span class="mf-label">Style</span>
<select id="ideoInspStyle" onchange="ideoUpdateSel({style:this.value})">
<option value="headline">Headline</option>
<option value="subhead">Subhead</option>
<option value="body">Body</option>
<option value="caps">Small caps</option>
<option value="script">Script</option>
<option value="serif">Serif</option>
</select>
</div>
<div class="ideo-insp-cell" id="ideoInspAlignCell">
<span class="mf-label">Align</span>
<div class="pill-group cols-3" role="group" aria-label="Text alignment">
<button type="button" class="pill-btn" data-ideo-align="left" onclick="ideoUpdateSel({align:'left'})" title="Left">⌷◁</button>
<button type="button" class="pill-btn" data-ideo-align="center" onclick="ideoUpdateSel({align:'center'})" title="Center">▽</button>
<button type="button" class="pill-btn" data-ideo-align="right" onclick="ideoUpdateSel({align:'right'})" title="Right">▷⌷</button>
</div>
</div>
</div>
<div class="ideo-insp-row">
<span class="mf-label">Color</span>
<div class="ideo-swatches" id="ideoInspSwatches"></div>
</div>
<div class="ideo-insp-actions">
<span class="ideo-insp-bbox" id="ideoInspBbox" title="bbox [y_min, x_min, y_max, x_max], 0–1000 row-first">bbox …</span>
<span class="qchip-spacer"></span>
<button type="button" class="qchip ideo-danger" onclick="ideoDeleteSel()" title="Delete this box (Delete key)">
<svg class="ph" aria-hidden="true"><use href="#ph-trash-simple"/></svg>Delete
</button>
</div>
</div>
<!-- Render style + Quality + image-level palette -->
<div class="ideo-controls">
<div class="ideo-ctrl-cell">
<span class="mf-label">Render</span>
<div class="pill-group cols-2" role="group" aria-label="Render style">
<button type="button" class="pill-btn active" id="ideoRenderArtBtn" data-ideo-render="art" onclick="ideoSetRender('art')">
<span>Design</span><span class="sub">illustration / graphic</span>
</button>
<button type="button" class="pill-btn" id="ideoRenderPhotoBtn" data-ideo-render="photo" onclick="ideoSetRender('photo')">
<span>Photographic</span><span class="sub">camera realism</span>
</button>
</div>
</div>
<div class="ideo-ctrl-cell">
<span class="mf-label">Quality</span>
<select id="ideoQuality" onchange="ideoState.preset=this.value">
<option value="V4_DEFAULT_20" selected>Default — 20 steps</option>
<option value="V4_TURBO_12">Turbo — 12 steps (faster)</option>
<option value="V4_QUALITY_48">Quality — 48 steps (slower)</option>
</select>
</div>
</div>
<!-- Fast mode: opt-in 4-bit quantize. The fix for slower Apple GPUs
(M1/M2) where the full fp8 model trips the macOS Metal watchdog
(ml-explore/mlx#3267), and ~half the RAM. Sends ideo_quantize=4. -->
<label class="ideo-fastmode" title="Quantize the model to 4-bit on load — much faster on M1/M2 GPUs (clears the macOS Metal command-buffer watchdog) and roughly half the RAM. Slightly lower quality; leave off on M3/M4." style="display:flex;align-items:center;gap:8px;margin-top:10px;padding:8px 11px;border:1px solid var(--border);border-radius:var(--r-sm);background:var(--panel-2);font-size:12.5px;color:var(--muted,#9aa6bd);cursor:pointer">
<input type="checkbox" id="ideoFastMode" onchange="ideoState.fast=this.checked" style="accent-color:var(--accent);cursor:pointer;flex:0 0 auto;width:16px;height:16px;margin:0">
<span><strong style="color:var(--text)">⚡ Fast mode</strong> — 4-bit, for M1/M2 or low-RAM Macs <em>(slightly lower quality)</em></span>
</label>
<!-- Reference bridge: Ideogram is text-only and can't copy pixels.
When a reference image IS loaded, this opt-in vision-captions it
and folds the description into the prompt so Ideogram REDRAWS the
idea (a re-interpretation, not a pixel copy). Sends
ideo_reference_bridge=1. Hidden until a ref is present — see
ideoSyncRefBridge(). -->
<label class="ideo-refbridge" id="ideoRefBridgeRow" title="Ideogram is text-only — it cannot copy your reference pixel-for-pixel. With this on, the reference is described and that description is added to your prompt, so Ideogram redraws the idea in its own style. For a faithful copy, use a Reference Edit engine instead." style="display:none;align-items:center;gap:8px;margin-top:10px;padding:8px 11px;border:1px solid var(--border);border-radius:var(--r-sm);background:var(--panel-2);font-size:12.5px;color:var(--muted,#9aa6bd);cursor:pointer">
<input type="checkbox" id="ideoRefBridge" onchange="ideoState.refBridge=this.checked;if(typeof imgStudioUpdateValidity==='function')imgStudioUpdateValidity();if(typeof imgStudioUpdateRefWarning==='function')imgStudioUpdateRefWarning()" style="accent-color:var(--accent);cursor:pointer;flex:0 0 auto;width:16px;height:16px;margin:0">
<span><strong style="color:var(--text)">Use reference</strong> — Ideogram redraws it from a description <em>(not a pixel copy)</em></span>
</label>
<!-- Image-level palette (collapsible). ≤16 colors. -->
<details class="ideo-details" id="ideoPaletteDetails">
<summary>Image palette <span class="ideo-summary-meta" id="ideoPaletteCount"></span></summary>
<div class="ideo-palette-body">
<p class="ideo-help">Optional. Up to 16 colors steer the whole image. Click a chip to remove it.</p>
<div class="ideo-swatches" id="ideoImagePalette"></div>
<div class="ideo-palette-add">
<input type="color" id="ideoPaletteColor" value="#2F81F7" aria-label="Pick a palette color">
<button type="button" class="qchip" onclick="ideoAddImagePaletteColor()">Add color</button>
</div>
</div>
</details>
<!-- Raw JSON drawer — live serialized caption + validity chip. -->
<details class="ideo-details" id="ideoRawDetails">
<summary>Raw caption JSON <span class="ideo-validity-chip" id="ideoValidityChip">…</span></summary>
<div class="ideo-raw-body">
<p class="ideo-help">This is exactly what gets sent. Edit and click <strong>Apply edits</strong> to round-trip back into the canvas.</p>
<textarea id="ideoRawJson" class="ideo-raw-textarea" rows="10" spellcheck="false" oninput="ideoOnRawInput()"></textarea>
<div class="ideo-raw-actions">
<span class="ideo-raw-msg" id="ideoRawMsg"></span>
<span class="qchip-spacer"></span>
<button type="button" class="qchip" onclick="ideoApplyRaw()" title="Parse the JSON above back into the canvas">Apply edits</button>
</div>
</div>
</details>
</div>
</div>
<!-- Validation / status messages (e.g. "pick a ref image"). Lives
OUTSIDE the composer card so the card chrome stays focused on
composing. Empty by default. -->
<div class="studio-status-row" style="margin: 6px 0 -4px;">
<span id="imgStudioStatus" class="hint"></span>
</div>
<!-- Quick settings — the picked model's VERSION on its own row (long
labels), then a dense 3-up row for Aspect / Candidates / Seed.
The MODEL itself is chosen in the column's top picker (#engineSwitch,
same as Video and Compose, owner 5 Nov 2026); #imgStudioEngine keeps
only that model's versions (syncImageVersions, engines.js) and stays
the form value every Images function reads. A model with one version
shows it as plain text (#imgStudioVersionOnly) instead of a select. -->
<div class="quick-settings">
<div>
<div class="qs-label">
<span class="qs-name">Version</span>
<span class="qs-meta" id="imgStudioWallEstimate"></span>
</div>
<div class="studio-engine-row">
<select id="imgStudioEngine" onchange="if(typeof ideoSyncVisibility==='function')ideoSyncVisibility();imgStudioUpdateValidity();imgStudioRefreshEngineStatus();imgStudioUpdateEstimate();imgStudioUpdateRefWarning();if(typeof renderLorasList==='function')renderLorasList();if(typeof renderEngineSwitch==='function')renderEngineSwitch()">
<!-- SYS-13: "Auto (use Settings)" named nothing -- on a
Compact Mac where every other engine gets disabled (SYS-13),
this unnamed option was the ONLY one left, and a user had
no way to know what it actually was or how big the first
download would be. It resolves to image_engine.py's own
default (mflux_model = "Runpod/FLUX.2-klein-4B-mflux-4bit"),
named here directly. -->
<option value="auto" selected>FLUX.2 [klein] 4B (recommended first model · ~4.3 GB download)</option>
<option value="qwen_edit_lightning_inline">Reference Edit — Fast (image-to-image, Lightning 4-step, ~1:20, multi-ref)</option>
<option value="qwen_edit_inline">Reference Edit — Standard (image-to-image, 8-step Q6, ~2:05, no LoRA)</option>
<option value="qwen_edit_high_inline">Reference Edit — Quality (image-to-image, 40-step Q8 + CFG, ~3:50, final renders)</option>
<option value="flux3_distilled_q8">FLUX 3 Q8 / Standard</option>
<option value="flux3_distilled_q6">FLUX 3 Q6 / Standard</option>
<option value="flux3_distilled_q4">FLUX 3 Q4 / Standard</option>
<option value="flux3_base_q8">FLUX 3 Q8 / Base Quality</option>
<option value="flux3_base_q6">FLUX 3 Q6 / Base Quality</option>
<option value="flux3_base_q4">FLUX 3 Q4 / Base Quality</option>
<option value="ideogram4_inline">Ideogram 4 — typography & layout (text-in-image; optional reference bridge)</option>
<!-- HiDream-O1 hidden 2026-05-28 (issue #15): the engine expects a
standalone lab-repo clone at ~/HIDREAM-O1-MLX-LAB-active/.venv
which hasn't been made public yet, so selecting any of these
crashes for everyone outside the dev machine. Re-enable when
the lab repo is published + the install step pulls it. The
`hidden` attribute keeps the option-value parsing intact for
anyone whose existing config already names one of these. -->
<option value="hidream_fast_inline" hidden>HiDream Fast (3-step, ~3:45 / 4-img batch, slight bg softness)</option>
<option value="hidream_inline" hidden>HiDream Medium (6-step + FBCache, ~6 min / 4-img batch, character-preserving)</option>
<option value="hidream_quality_inline" hidden>HiDream Quality (12-step + light FBCache, ~9 min / 4-img batch, best detail)</option>
<!-- P-H3-Image (Pruna, on MiniMax H3), port L18. Times measured on an M4 Max 64 GB
(ports/p-h3-image-pruna/bench/RESULT.md). Free (owner, card 296). -->
<option value="ph3image_fast_inline">P-H3-Image — Fast (1.5 MP, ~1 min)</option>
<option value="ph3image_standard_inline">P-H3-Image — exact text in images (4 MP, ~2.5 min, on MiniMax H3)</option>
<option value="ph3image_draft_inline">P-H3-Image Draft (2 MP, ~1.3 min)</option>
<option value="ph3image_inline">P-H3-Image High (8 MP, ~5 min)</option>
<option value="mock_inline" id="imgStudioMockOption" hidden>Mock (testing — debug only)</option>
</select>
<span class="studio-version-only" id="imgStudioVersionOnly" hidden></span>
<span class="engine-status-pill" id="imgStudioEnginePill"
data-state="unknown" title="Checking engine weights…"
onclick="imgStudioOnPillClick()">…</span>
</div>
</div>
<p id="flux3Notice" class="hint" hidden>FLUX 3 Klein by Black Forest Labs. Free. Standard: 16 steps. Base Quality: 50 steps, separate download. Q8 recommended; Q6 uses less memory. 32 GB Mac recommended; 24 GB with small Q4 images and one reference. <button type="button" class="ghost-btn" onclick="openLicence('flux3', {readOnly:true})">FLUX Kommunity licence</button></p>
<div>
<div class="mini-fields">
<div class="mf-cell">
<span class="mf-label">Aspect</span>
<select id="imgStudioAspect" onchange="imgStudioUpdateValidity();imgStudioUpdateEstimate();if(typeof ideoApplyAspect==='function')ideoApplyAspect()" style="padding:7px 9px;font-size:13px;">
<option value="16:9" selected>16:9 — 1280×720</option>
<option value="4:3">4:3 — 1024×768</option>
<option value="1:1">1:1 — 1024×1024</option>
<option value="9:16">9:16 — 720×1280</option>
<option value="3:4">3:4 — 768×1024</option>
<option value="21:9">21:9 — 1280×544</option>
<optgroup label="Smaller — faster, lower RAM">
<option value="16:9s">16:9 — 768×432</option>
<option value="1:1s">1:1 — 512×512</option>
<option value="9:16s">9:16 — 432×768</option>
</optgroup>
</select>
</div>
<div class="mf-cell">
<span class="mf-label">Candidates (n)</span>
<input type="number" id="imgStudioN" min="1" max="8" value="1" oninput="imgStudioUpdateEstimate()">
</div>
<div class="mf-cell">
<span class="mf-label">Seed</span>
<input type="number" id="imgStudioSeed" value="-1" title="-1 = random">
</div>
</div>
</div>
</div>
<!-- Slot for the unified LoRA picker. Empty by default; setMode('image')
portals #lorasDetails into here so the SAME picker the video form
uses appears tightly integrated under the Image Studio composer.
When the user switches engine (e.g. Qwen-Edit → FLUX.2 Klein-Edit)
the library auto-refilters via /loras?mode=image:flux2. Active
chips that don't match the current engine get a warning badge. -->
<div id="loraPickerStudioSlot"></div>
<!-- Sticky action footer — same chrome as the video form's. Generate
stays anchored at the bottom of the form-pane no matter how far
the user has scrolled. Pause/Clear/Batch live above it as compact
pills, never the primary touch target. -->
<div class="form-action-footer" id="formActionFooterStudio">
<div class="queue-strip">
<button type="button" class="qchip" onclick="openBatch()" title="Queue many prompts, or several takes of this one"><svg class="ph" aria-hidden="true"><use href="#ph-film-strip"/></svg>Batch</button>
<button type="button" class="qchip" id="pauseBtnStudio" onclick="togglePause()" title="Pause / resume the render queue"><svg class="ph" aria-hidden="true"><use href="#ph-pause-fill"/></svg>Pause queue</button>
<button type="button" class="qchip" data-role="clear-queue-btn" onclick="requestClearQueue()" title="Clear all queued jobs (running job continues)"><svg class="ph" aria-hidden="true"><use href="#ph-x"/></svg><span class="clear-queue-label">Clear</span></button>
<span class="qchip-spacer"></span>
</div>
<div class="actions">
<button class="primary" id="imgStudioGenBtn" onclick="imgStudioGenerate()">
<span id="imgStudioGenBtnLabel">Generate</span>
</button>
<button type="button" class="danger js-stop-btn" disabled data-role="stop-btn" onclick="requestStop()" title="Stop the current render">Stop</button>
</div>
</div>
<!-- Submission status. Image jobs flow through the same queue as
video jobs now, so the actual results show up in the right-rail
Recent tab (with the Photos filter) along with everything else.
This pane is just a thin "submitted" confirmation. -->
<div id="imgStudioResults" class="studio-results"></div>
</div>
<!-- ============== TRAIN CHARACTER (inline, mode='train') ============== -->
<!-- Sibling of #genForm and #studioSection inside form-pane. Shown by
setMode('train'). Trains a character LoRA against 15-50 user
stills. Pipeline lives in the sibling lora-lab repo; this panel
shells out to it via /train/start. Job status surfaces through
the existing Now / Queue / Recent / Logs panes (training is just
another mode dispatch in run_job_inner). -->
<!-- ============== CHARACTERS SECTION ==============
The pick-a-character-and-ship surface. Two visual states:
grid — auto-discovered cards from mlx_models/loras/
compose — single character + prompt + framing/duration/quality
JS state machine lives in charactersInit / charactersOpenCompose /
charactersBackToGrid. Submits POST /characters/<id>/generate
which assembles the full prompt (trigger + recipe) server-side. -->
<div class="mode-only characters-pane" id="charactersSection">
<!-- GRID STATE — card per discovered character -->
<div class="characters-grid-state" id="charactersGridState">
<div class="characters-head">
<h1 class="characters-title">Characters</h1>
<p class="characters-sub">Pick a character, describe the scene, ship.<br/>
Trigger word and the validated production recipe are applied for you.</p>
</div>
<div class="characters-grid" id="charactersGrid">
<div class="characters-loading">Scanning <code>mlx_models/loras/</code>…</div>
</div>
<div class="characters-empty" id="charactersEmpty" hidden>
<div class="characters-empty-title">No characters yet</div>
<div class="characters-empty-body">
Train one in the <a href="#" onclick="workflowSwitch('train'); return false;">Train tab</a> —
once a <code><trigger>_v2.safetensors</code> LoRA lands in <code>mlx_models/loras/</code> it shows up here automatically.
Add a matching <code>.audio.safetensors</code> for voice; without it the character is silent.
</div>
<div style="margin-top:16px;display:flex;flex-direction:column;align-items:center;gap:8px">
<button type="button" class="primary-btn js-get-sample-char" onclick="downloadSampleCharacter()">Get a sample character (Bizarro)</button>
<div style="font-size:12px;opacity:.7;max-width:34rem;line-height:1.5">Don't want to train one yet? Grab a ready-made character (~817 MB, one-time) and try Character & Remix right now.</div>
<div class="js-get-sample-char-status" style="font-size:12px;opacity:.9" hidden></div>
</div>
</div>
</div>
<!-- COMPOSE STATE — selected character, scene description, framing,
duration, quality, real-time prompt preview, Generate button -->
<div class="characters-compose-state" id="charactersComposeState" hidden>
<button class="characters-back-link" type="button" onclick="charactersBackToGrid()" aria-label="Back to characters">
<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="15 18 9 12 15 6"/>
</svg>
<span>Characters</span>
</button>
<div class="characters-compose-head">
<div class="characters-compose-avatar" id="charactersComposeAvatar">
<div class="characters-avatar-placeholder" id="charactersComposeAvatarPlaceholder">A</div>
</div>
<div class="characters-compose-titles">
<h1 class="characters-compose-name" id="charactersComposeName">Character</h1>
<div class="characters-compose-meta">
<code class="characters-trigger-chip" id="charactersComposeTrigger">trigger</code>
<span class="characters-pronoun-chip" id="charactersComposePronoun">she · woman</span>
</div>
</div>
</div>
<div class="characters-compose-card">
<label class="characters-field-label" for="charactersPrompt">Prompt</label>
<textarea
id="charactersPrompt"
class="characters-prompt-input"
rows="6"
placeholder='Write your scene. The trigger word is pre-filled — keep it in the prompt.'
></textarea>
<div class="characters-chip-row">
<div class="characters-chip-group" data-group="duration">
<span class="characters-group-label">Duration</span>
<div class="characters-chips" id="charactersDurationChips" role="group"></div>
</div>
<div class="characters-chip-group" data-group="quality">
<span class="characters-group-label">Quality</span>
<div class="characters-chips" id="charactersQualityChips" role="group"></div>
</div>
</div>
<!-- Character LoRA strength. THE `value` BELOW IS A PLACEHOLDER: the
control is painted from window.CHARACTERS.charStrength by
charactersSyncStrengthControls() on init and on every compose
open. It used to be a hardcoded 0.8 — a 2.3-era correction for
mesh/sparkle artifacts in the BASE model — and when the state
default moved to 1.0 to match the server, the markup did not,
so an untouched form DISPLAYED 0.80 and SUBMITTED 1.0. Never
hardcode a value here again; change the state default. -->
<div class="characters-strength-row">
<label for="charactersStrength" class="characters-strength-label">
Character LoRA strength
<span class="characters-strength-hint">(lower = less identity lock-in but fewer baked-in artifacts)</span>
</label>
<div class="characters-strength-control">
<input type="range" id="charactersStrength"
min="0.4" max="1.2" step="0.05" value="0.8"
oninput="charactersUpdateStrengthDisplay(this.value)">
<span class="characters-strength-value" id="charactersStrengthValue">0.80</span>
</div>
</div>
<!-- VA-37: the "Reference audio — character lip-syncs to this
clip" row lived here, on the dead #charactersSection pane
(workflowSwitch maps 'characters' to 'manual' — this whole
section is unreachable; see the "dead HTML; hide defensively"
comment in editor.js's workflowSwitch). Even reachable, it
promised lip-sync it could not deliver: an audio file with no
image made mode t2v (the audio was silently dropped), and
with an image it became i2v_clean_audio — a mux, not
audio-conditioned generation. Removed rather than fixed in
place; the real path is Lip-sync on the Video tab (VA-01),
and /characters/<id>/generate now refuses an audio-only
request instead of silently ignoring it (routes_characters.py). -->
<!-- LoRA picker portal — the Manual tab's #lorasDetails picker
moves in here when the Characters tab is the active mode.
Same picker, same _activeLoras state, same library — just
reparented. The character's OWN face + audio LoRAs are
always auto-stacked on the backend; anything the user
adds here is extra (e.g. cinematronx style). -->
<div id="loraPickerCharactersSlot" class="characters-lora-slot"></div>
<button type="button" id="charactersGenerateBtn" class="characters-generate-btn"
onclick="charactersGenerate()">
<span class="characters-generate-label">Generate</span>
<span class="characters-generate-busy" hidden>Queueing…</span>
</button>
<div class="characters-toast" id="charactersToast" hidden></div>
</div>
</div>
</div>
<div class="mode-only train-pane" id="trainSection">
<!-- SYS-03: gate at the ENTRY, before a Mac under TRAIN_MIN_RAM_GB can
prepare a whole dataset and see the 41 GB download offer only to
be refused at Start. Populated by trainApplyRamGate() (characters.js),
called from trainInit() on every tab-open. Hidden by default;
when shown, every other direct child of #trainSection is hidden
by the same function (a general RAM banner is not enough — the
reviewer found the tab still walked users through captioning and
41 GB of downloads before the refusal). -->
<div class="train-gate-card" id="trainGateCard" hidden>
<svg class="ph" aria-hidden="true"><use href="#ph-warning-fill"/></svg>
<div class="train-gate-text">
<div class="train-gate-title" id="trainGateTitle">Training a character needs more memory</div>
<div class="train-gate-body" id="trainGateBody"></div>
<div class="train-gate-actions">
<button type="button" class="primary-btn" onclick="downloadSampleCharacter()">Get the sample character (Bizarro)</button>
<button type="button" class="ghost-btn" onclick="openCivitaiModal(); if (typeof civitaiSetKind === 'function') setTimeout(() => civitaiSetKind('character'), 0);">Browse community characters</button>
</div>
</div>
</div>
<!-- Preflight model check — hidden by default; populated by
trainCheckPreflight() if any required model file is missing
(today: transformer-dev.safetensors which isn't in default install). -->
<div id="trainPreflight" style="display:none"></div>
<!-- ============== TRAIN TYPE TOGGLE ==============
Character: identity (face + optional voice). Style: aesthetic
transfer (cinematic look, color grading, lighting). Both use the
same trainer + target_modules; what changes is the dataset, the
caption template, the output naming, and whether a voice phase
runs after the face phase. Selecting Style hides the Voice card
and rewrites the guidance + button label. -->
<div class="composer-card train-card train-type-card">
<h2>Train type
<span class="h2-hint">character identity, or a visual style</span>
</h2>
<div class="pill-group cols-2" id="trainTypeGroup">
<button type="button" class="pill-btn active" data-train-type="character"
onclick="setTrainType('character')">
<span>Character</span>
<span class="sub">face (+ voice) of one person</span>
</button>
<button type="button" class="pill-btn" data-train-type="style"
onclick="setTrainType('style')">
<span>Style <span class="experimental-tag" title="Lightly tested in v3.0 — please report issues">experimental</span></span>
<span class="sub">cinematic look · color · lighting</span>
</button>
</div>
</div>
<!-- ============== GUIDANCE PANEL ==============
Collapsible "How to train well" walk-through. CLOSED by
default — users who want it click the summary to expand;
power users aren't shown a wall of text every visit. Old
behavior was open-by-default + dismissible-via-localStorage,
but the dismiss CTA was easy to miss so the guide kept
greeting returning users. Concise, scannable, matches the
Linear design language. Two mutually-exclusive bodies
(character vs style); trainTypeApply flips them based on
the segmented toggle above. -->
<details class="train-guidance" id="trainGuidance">
<summary>
<span class="train-guidance-eyebrow">Guide</span>
<span class="train-guidance-title" id="trainGuidanceTitle">How to train a character well</span>
</summary>
<div class="train-guidance-body" id="trainGuidanceBodyCharacter">
<div class="train-guidance-section">
<h3>Image count</h3>
<p>30–80 photos is the practical sweet spot. <b>Variety beats quantity</b> — 50 well-chosen images across shot types beats 100 portraits-only. Below 25 the LoRA overfits to whatever pose dominates; above 100–150 you start hitting diminishing returns and risk contradictory signals (e.g. half-bearded vs half-not). Training time stays roughly the same regardless of dataset size — it's fixed by step count, not image count.</p>
</div>
<div class="train-guidance-section">
<h3>Shot type coverage — biggest single lever</h3>
<p>The LoRA can only generate <b>what it saw</b>. If your set is all torso-up portraits, long shots will look mushy because the model never learned what this person looks like at distance. Aim for this mix on a 50–80 image set:</p>
<ul>
<li><b>5–8 tight close-ups</b> · face fills frame, anchors identity</li>
<li><b>15–25 medium close-ups</b> · head + shoulders, the workhorse</li>
<li><b>8–12 medium shots</b> · waist up, teaches body proportions</li>
<li><b>10–15 wide / full-body shots</b> · the missing piece in most datasets — without these, long shots in T2V come out distorted or texture-mushy</li>
<li><b>2–3 extreme long shots</b> · figure at distance, environment dominates</li>
</ul>
</div>
<div class="train-guidance-section">
<h3>Image aspect ratio</h3>
<p>Use whatever native aspect ratio the photos came in — portrait, landscape, square, all fine. The trainer's letterbox crop preserves the original proportions (it adds black bars to fit the training canvas rather than chopping the sides off). The model learns the bars are a constant background factor across every sample and ignores them at inference.</p>
</div>
<div class="train-guidance-section">
<h3>Lighting variety</h3>
<p>Mix indoor and outdoor, warm and cool, day and night, key-light from different angles. If every photo shares studio lighting, the LoRA bakes that lighting into every generation.</p>
</div>
<div class="train-guidance-section">
<h3>Background variety</h3>
<p>Different rooms, streets, contexts. A single backdrop teaches the LoRA to refuse to put the character anywhere else.</p>
</div>
<div class="train-guidance-section">
<h3>Avoid</h3>
<ul>
<li>group photos (the LoRA can't tell which face is the subject)</li>
<li>obvious props that aren't part of the look</li>
<li>heavy makeup that varies wildly between shots</li>
<li>face partly obscured (hand over mouth, microphone in front of face)</li>
<li>blurry / out-of-focus shots — training amplifies blur</li>
</ul>
</div>
<div class="train-guidance-section">
<h3>Caption rule</h3>
<p>Describe what <b>varies</b> in each shot — outfit, setting, pose, lighting, framing. Don't describe invariant identity features (face shape, hair color, build); the LoRA absorbs those automatically. The auto-caption button uses Gemma 3 to generate <code>[VISUAL]:</code>-format captions following this rule.</p>
</div>
</div>
<!-- Style guidance — shown when train_type=style. Hand-picked movie
frames teach the model an aesthetic, not an identity. The rules
that drive a good character dataset and a good style dataset
are nearly inverted (e.g. "lighting variety" is desirable for a
face; "lighting consistency" is the whole point for a style). -->
<div class="train-guidance-body" id="trainGuidanceBodyStyle" hidden>
<div class="train-guidance-section">
<h3>Frame count</h3>
<p>20–100+ hand-picked movie frames. More variety inside the look (different scenes, different subjects) helps generalization. Skip duplicate-ish shots from the same scene — they teach less than fewer-but-more-varied frames.</p>
</div>
<div class="train-guidance-section">
<h3>What makes a frame "in the style"</h3>
<ul>
<li><b>Composition</b> · framing, headroom, negative space, geometry</li>
<li><b>Color grading</b> · palette, contrast, white point, saturation</li>
<li><b>Lighting</b> · key direction, hardness, motivation, falloff</li>
<li><b>Lens character</b> · focal length, depth of field, optical traits</li>
<li><b>Mood</b> · the atmospheric thumbprint the user is after</li>
</ul>
</div>
<div class="train-guidance-section">
<h3>Consistency beats variety</h3>
<p>Opposite of a character dataset. You want every frame to share the visual fingerprint you're training on. Mixed grades and lighting motivations dilute the style — the LoRA averages everything you show it.</p>
</div>
<div class="train-guidance-section">
<h3>Avoid</h3>
<ul>
<li>frames where the subject's identity dominates the frame</li>
<li>watermarks, subtitles, channel logos</li>
<li>heavily compressed or low-bitrate source frames</li>
<li>extreme aspect crops (letterboxed black bars hurt)</li>
</ul>
</div>
<div class="train-guidance-section">
<h3>Caption rule</h3>
<p>Describe the <b>shot itself</b>, not who's in it — composition, color grading, lighting, mood. The trigger anchors the look; the caption body teaches the model what to associate with that trigger.</p>
</div>
</div>
<div class="train-guidance-foot">
<button type="button" class="train-guidance-dismiss" onclick="trainGuidanceDismiss()">Got it — don't show again</button>
</div>
</details>
<!-- ============== DATASET CARD ============== -->
<div class="composer-card train-card">
<h2>Dataset
<!-- SYS-36: this said "15-50" while TRAIN_MAX_IMAGES has been 500
since the "friendly-default-misread-as-hard-rule" fix (see
that comment in mlx_ltx_panel.py) — a static header
contradicting the live counter the moment JS updates it
(trainUpdateCounter, characters.js). 20-50 is the genuine
sweet spot; 500 is a technical ceiling, not a target, so it
isn't asserted here either. -->
<span class="h2-hint" id="trainDatasetHint">15 minimum, 20–50 is the sweet spot · drop your character into the box</span>
</h2>
<div class="train-drop" id="trainDrop">
<div class="train-drop-empty" id="trainDropEmpty">
<div class="picker-icon"><svg class="ph"><use href="#ph-image"/></svg></div>
<div class="picker-cta">Drop images <em>+ optional matching <code>.txt</code> captions</em> here, or <strong>click to browse</strong> — 15 minimum, 20–50 is the sweet spot</div>
<div class="hint">PNG / JPG / WEBP for images, <code>.txt</code> for captions (same filename stem). Each preview shows the 1:1 center-crop the trainer will see.</div>
</div>
<div class="train-thumbs" id="trainThumbs" hidden></div>
<input type="file" id="trainFileInput" accept="image/png,image/jpeg,image/webp,text/plain,.png,.jpg,.jpeg,.webp,.txt" multiple style="display:none">
</div>
<div class="train-counter-row">
<span class="train-counter" id="trainCounter">0 images</span>
<span class="train-counter-hint" id="trainCounterHint">15 minimum · 20–50 is the sweet spot</span>
<span class="train-caption-counter" id="trainCaptionCounter" hidden>0 captioned</span>
<span class="qchip-spacer"></span>
<button type="button" class="qchip" id="trainClearAllBtn" onclick="trainClearAll()" hidden><svg class="ph" aria-hidden="true"><use href="#ph-x"/></svg>Clear all</button>
</div>
<!-- ============== BULK BUNDLE DROP ============== -->
<!-- Mr Bizarro's "Cinematron" workflow: a single ZIP containing paired
image_NNN.png + image_NNN.txt files. The server validates each
entry (no subdirs, no traversal), dedupes by stem, and stages
everything into one job_id. -->
<div class="train-bundle-row">
<div class="train-bundle-drop" id="trainBundleDrop">
<svg class="ph train-bundle-icon" aria-hidden="true"><use href="#ph-folder-simple"/></svg>
<span class="train-bundle-cta">Drop a <strong>ZIP</strong> of paired images + captions, or <strong>click</strong></span>
<span class="train-bundle-meta" id="trainBundleMeta">max 500 MB · stem-paired (image_001.png + image_001.txt)</span>
<input type="file" id="trainBundleInput" accept=".zip,application/zip" style="display:none">
</div>
</div>
<!-- ============== CAPTION FORMAT HINT ============== -->
<details class="train-caption-hint" id="trainCaptionHint">
<summary>
<svg class="ph" aria-hidden="true"><use href="#ph-info-fill"/></svg>
Caption format
<span class="train-caption-hint-eyebrow">LTX <code>[VISUAL]:</code> / <code>[TEXT]:</code></span>
</summary>
<div class="train-caption-hint-body">
<pre class="train-caption-hint-example">[VISUAL]: <trigger>, <50–80 word description of what varies in this shot — outfit, pose, framing, lighting, environment>
[TEXT]: None</pre>
<ul class="train-caption-hint-rules">
<li><b>Trigger token first</b> inside <code>[VISUAL]:</code> body.</li>
<li>Describe what <b>varies</b> — outfit, pose, framing, lighting. <b>Do not</b> describe invariant identity (face structure, hair color); the LoRA absorbs those.</li>
<li>50–80 words is the sweet spot. Less than 20 is too thin; more than 120 dilutes.</li>
<li><code>[TEXT]:</code> is required — write <code>None</code> if there is no on-screen text.</li>
<li>If you forget <code>[VISUAL]:</code> or <code>[TEXT]:</code> tags, the panel auto-prepends/appends them.</li>
</ul>
</div>
</details>
<!-- ============== AUTO-CAPTION (Gemma 3) ============== -->
<!-- One click + ~3 sec per image: local Gemma 3 12B reads each
image and writes a [VISUAL]: <trigger>, … caption that
describes what varies (pose / framing / clothing / lighting)
and SKIPS identity features. Same recipe Bizarro v2 was
hand-captioned with. Uses the Gemma weights the panel already
downloads for prompt enhancement — no extra model fetch.
Disabled until ≥1 image is uploaded AND a trigger is set. -->
<div class="train-autocaption-row">
<button type="button" id="trainAutoCaptionBtn"
class="train-autocaption-btn"
onclick="trainAutoCaption()" disabled>
<svg class="ph" aria-hidden="true"><use href="#ph-sparkle-fill"/></svg>
<span id="trainAutoCaptionLabel">Auto-caption with Gemma 3</span>
</button>
<span class="train-autocaption-hint" id="trainAutoCaptionHint">
Local Gemma 3 12B writes one <code>[VISUAL]:</code> caption per image (~2–3 sec each). Overwrites existing captions.
</span>
</div>
<div class="train-autocaption-progress" id="trainAutoCaptionProgress" hidden>
<div class="train-autocaption-bar">
<div class="train-autocaption-bar-fill" id="trainAutoCaptionBarFill" style="width:0%"></div>
</div>
<div class="train-autocaption-status" id="trainAutoCaptionStatus">Starting…</div>
</div>
</div>
<!-- ============== TRIGGER + PRESET ============== -->
<div class="composer-card train-card">
<h2>Trigger word
<span class="h2-hint" id="trainTriggerHint">a rare, letters-only token the model will associate with this character</span>
</h2>
<div class="train-trigger-row">
<input type="text" id="trainTrigger" maxlength="32" placeholder="auto-generated rare token" autocomplete="off">
<button type="button" class="qchip" onclick="trainSuggestTrigger()" title="Suggest a fresh rare token">↻ Suggest</button>
</div>
<div class="hint" id="trainTriggerExampleHint">Use the trigger word in your video prompts (e.g. <code><span id="trainTriggerExample">mrztrn</span> man walking on the beach</code>).</div>
<h2 style="margin-top:14px">Quality preset
<span class="h2-hint">trade time for fidelity</span>
</h2>
<!-- THE BADGE AND THE PRE-SELECTION MOVED OFF QUICK (#62).
Quick was `active` AND badged "Recommended" while training at
rank 8 — the one tier that has never carried an identity. A
first-time user read the label, spent the hours and measured
1.98e-04, under the 2.0e-04 floor. Both the badge and the
default now live on the preset that was actually graded, and
trainUpdatePresetButtons() places them from the server's
TRAIN_DEFAULT_PRESET so the pill cannot drift from make_job. -->
<div class="pill-group cols-3" id="trainPresetGroup">
<button type="button" class="pill-btn" data-train-preset="quick"><span>Quick <span class="rec-badge" data-rec-slot hidden>Recommended</span></span><span class="sub" id="trainPresetQuickSub">~30 epochs · rank 8 · 512px · a look, not a face · identity ungraded</span></button>
<button type="button" class="pill-btn" data-train-preset="medium"><span>Medium <span class="rec-badge" data-rec-slot hidden>Recommended</span></span><span class="sub" id="trainPresetMediumSub">~60 epochs · rank 16 · 576px · more capacity · identity ungraded</span></button>
<button type="button" class="pill-btn active" data-train-preset="high"><span>High <span class="rec-badge" data-rec-slot>Recommended</span></span><span class="sub" id="trainPresetHighSub">~100 epochs · rank 32 · 512px · validated for identity</span></button>
</div>
<!-- The one line that says what the pills cannot: what the numbers
mean, and (on a sub-64 GB Mac) that no choice here reaches the
graded recipe. Filled by trainUpdatePresetNote(). -->
<div class="hint train-preset-note" id="trainPresetNote" style="margin-top:8px"></div>
<!-- Crop strategy — primary control (not buried in Advanced) because
it has a big visible effect on what the model learns. Mr Bizarro 2026-05-17:
"we are using such a limited cropping of the images, all the images
are kind of close-up medium close-ups. That's the reason why the
medium long shots are so shit and blurry." Letterbox preserves
wide-shot proportions at the cost of pixel-budget waste on black
bars. The trainer sees a uniform square canvas either way, so
this doesn't change wall time or memory. -->
<h2 style="margin-top:14px">Crop strategy
<span class="h2-hint">how non-square images fit the training canvas</span>
</h2>
<div class="pill-group cols-2" id="trainCropStrategyGroup">
<button type="button" class="pill-btn active" data-train-crop="center">
<span>Center crop</span>
<span class="sub">scale + crop to square · best for tight portraits</span>
</button>
<button type="button" class="pill-btn" data-train-crop="letterbox">
<span>Letterbox <span class="rec-badge" style="background:rgba(94,234,255,0.18);color:var(--accent-bright)">Preserve aspect</span></span>
<span class="sub">pad with black · keeps wide-shot proportions</span>
</button>
</div>
<input type="hidden" name="crop_strategy" id="trainCropStrategy" value="center">
<details class="train-advanced">
<summary>Advanced</summary>
<div class="train-advanced-grid">
<div class="mf-cell">
<span class="mf-label">Rank</span>
<select id="trainRank">
<option value="">preset default</option>
<option value="4">4</option>
<option value="8">8</option>
<option value="16">16</option>
<option value="32">32</option>
<option value="64">64</option>
</select>
</div>
<div class="mf-cell">
<span class="mf-label">Steps</span>
<input type="number" id="trainSteps" min="100" max="10000" step="100" placeholder="preset default">
</div>
<div class="mf-cell">
<span class="mf-label">Learning rate</span>
<select id="trainLR">
<option value="">preset default</option>
<option value="0.00005">5e-5</option>
<option value="0.0001">1e-4</option>
<option value="0.0002">2e-4</option>
<option value="0.0005">5e-4</option>
</select>
</div>
<div class="mf-cell">
<span class="mf-label">Resolution</span>
<select id="trainResolution">
<option value="">preset default</option>
<option value="384">384²</option>
<option value="448">448²</option>
<option value="512">512²</option>
<option value="576">576²</option>
<option value="768">768²</option>
</select>
</div>
<div class="mf-cell" style="grid-column: 1 / -1">
<span class="mf-label">Caption strategy</span>
<select id="trainCaptionStrategy">
<option value="user_provided" selected>user-provided (<code>.txt</code> files alongside images) — recommended</option>
<option value="trigger_simple"><trigger> man — dumbest-strongest fallback</option>
<option value="trigger_only">trigger only — no role hint</option>
<option value="qwen_vl" disabled>auto-caption via Qwen-VL — coming soon</option>
</select>
</div>
</div>
<div class="hint" style="margin-top:8px">Best results come from per-image captions in LTX <code>[VISUAL]:</code> format. Open <em>Caption format</em> above the trigger row to see the spec. If a caption is missing for an image we auto-fill with the <code>trigger_simple</code> fallback so the run still completes.</div>
</details>
</div>
<!-- ============== VOICE (OPTIONAL) ==============
A second, optional dataset slot: one short voice clip used to
train a paired audio LoRA via lora_lab.train_audio. Skipping
this leaves the character "silent" — still usable for video
but won't speak/sing. The drop zone reuses the same border /
drop affordance as the image dataset so the two slots read
as siblings, not different surfaces. The whole card is
hidden when train_type=style (styles don't have voices). -->
<div class="composer-card train-card" id="trainVoiceCard">
<h2>Voice
<span class="h2-hint">optional · a short clean clip becomes the character's voice</span>
</h2>
<div class="train-voice-drop" id="trainVoiceDrop">
<div class="train-voice-empty" id="trainVoiceEmpty">
<div class="picker-icon"><svg class="ph"><use href="#ph-music-notes"/></svg></div>
<div class="picker-cta">Drop a voice clip here, or <strong>click to browse</strong></div>
<div class="hint"><strong>MP3, WAV, M4A or FLAC</strong> — any format, auto-decoded. One file, up to 50 MB.</div>
<div class="hint" style="margin-top:4px"><strong>Aim for 10–25 seconds</strong> of clean speech, single speaker, no music or background noise. Shorter than 5 s won't train well; longer than 30 s just adds repetition.</div>
</div>
<div class="train-voice-loaded" id="trainVoiceLoaded" hidden>
<div class="train-voice-fileline">
<svg class="ph train-voice-icon" aria-hidden="true"><use href="#ph-music-notes"/></svg>
<span class="train-voice-filename" id="trainVoiceFilename">voice.wav</span>
<span class="train-voice-meta" id="trainVoiceMeta">—</span>
<button type="button" class="qchip train-voice-remove" id="trainVoiceRemoveBtn" onclick="trainVoiceRemove(event)" title="Remove voice clip">
<svg class="ph" aria-hidden="true"><use href="#ph-x-bold"/></svg>
</button>
</div>
<audio id="trainVoiceAudio" controls preload="metadata" class="train-voice-audio"></audio>
</div>
<input type="file" id="trainVoiceFileInput" accept="audio/wav,audio/mpeg,audio/mp3,audio/mp4,audio/x-m4a,audio/flac,.wav,.mp3,.m4a,.flac" style="display:none">
</div>
<!-- SYS-10c: a voice dropped before any training image produced
"nothing on the voice card" — the only feedback was #trainStatus,
a status line that lives at the top of the tab, far from this
card, and carries no styling of its own. This puts the same
message right where the person just acted. -->
<div class="train-voice-inline-error" id="trainVoiceInlineError" hidden></div>
<div class="train-voice-controls">
<label class="train-voice-toggle" id="trainVoiceToggleWrap">
<input type="checkbox" id="trainVoiceToggle" checked disabled onchange="trainVoiceToggleChanged()">
<span class="train-voice-toggle-label">Train voice LoRA</span>
<span class="train-voice-toggle-hint" id="trainVoiceToggleHint">upload a clip to enable</span>
</label>
<div class="train-voice-steps" id="trainVoiceStepsRow" hidden>
<span class="mf-label">Audio steps</span>
<div class="pill-group cols-3" id="trainVoicePresetGroup">
<button type="button" class="pill-btn" data-voice-preset="smoke"><span>Smoke <span class="rec-badge">100</span></span><span class="sub">~7 min wall</span></button>
<button type="button" class="pill-btn active" data-voice-preset="standard"><span>Standard <span class="rec-badge">250</span></span><span class="sub">~17 min wall</span></button>
<button type="button" class="pill-btn" data-voice-preset="long"><span>Long <span class="rec-badge">500</span></span><span class="sub">~33 min wall</span></button>
</div>
<div class="hint" style="margin-top:6px">Estimates assume about 30 s per step on an M4 Max; slower Macs take longer.</div>
</div>
</div>
<p class="train-voice-help">
A 5–30 second voice clip (clean, single speaker) gives the character its own voice.
Skip this and the character will be silent — you can still use them for video but they won't speak/sing.
</p>
</div>
<!-- Estimate strip — wall time + RAM peak update as inputs
change. Hidden until at least one image is in the dataset:
before that, the estimate row is misleading ("— · —" reads
as "data missing" not "waiting on you"). Shown by
trainRenderImagesGrid() the moment count > 0. -->
<div class="train-estimate" id="trainEstimate" style="display:none">
<span class="train-est-line">
<span class="train-est-label">Estimated wall time</span>
<span class="train-est-value" id="trainEstimateTime">—</span>
</span>
<span class="train-est-line">
<span class="train-est-label">Peak RAM</span>
<span class="train-est-value" id="trainEstimateRam">—</span>
</span>
<span class="train-est-line">
<span class="train-est-label">Output</span>
<span class="train-est-value" id="trainEstimateOut">—</span>
</span>
</div>
<!-- Validation/status messages (e.g. "need 10 more images"). -->
<div class="studio-status-row" style="margin: 4px 0 0;">
<span id="trainStatus" class="hint"></span>
</div>
<!-- Sticky action footer — same chrome as the video/studio forms. -->
<div class="form-action-footer" id="formActionFooterTrain">
<div class="queue-strip">
<button type="button" class="qchip" id="pauseBtnTrain" onclick="togglePause()" title="Pause / resume the queue"><svg class="ph" aria-hidden="true"><use href="#ph-pause-fill"/></svg>Pause queue</button>
<button type="button" class="qchip" data-role="clear-queue-btn" onclick="requestClearQueue()" title="Clear all queued jobs (running job continues)"><svg class="ph" aria-hidden="true"><use href="#ph-x"/></svg><span class="clear-queue-label">Clear</span></button>
<span class="qchip-spacer"></span>
</div>
<div class="actions">
<button type="button" class="primary" id="trainStartBtn" onclick="trainStart()" disabled>Train Character</button>
<button type="button" class="danger js-stop-btn" disabled data-role="stop-btn" onclick="requestStop()" title="Stop the current render">Stop</button>
</div>
</div>
<!-- ============== TRAINED LORAs LIST ==============
One-liner pointing the user at the Video tab. The previous
card showed per-character "Use in T2V / Use in I2V / Copy
trigger / delete" rows but that duplicated the chip strip on
the Video tab itself — Mr Bizarro flagged it 2026-05-18 as
unnecessary. New version: a single sentence with each
character name as a link that switches workflow + selects
the character on the Video tab. -->
<div class="composer-card train-card">
<h2>Use your trained characters</h2>
<div class="hint" style="margin-top:2px">
Generate a video with your trained characters
<a href="#" class="train-go-video-link"
onclick="workflowSwitch('manual'); return false;">on the Video tab</a>
— the links below take you to each character's picker chip.
</div>
<!-- THE LOOP THE MEASUREMENT DID NOT CLOSE (#62). The panel has
measured every finished adapter since v4.6.0, but the verdict
lived in a log line and a sidecar field — a user with a weak
LoRA had to find a GitHub thread to learn what his own number
meant. This banner says it in the tab where he is standing,
and names the fix. Filled by trainRefreshLoraList(). -->
<div class="train-verdict-banner" id="trainVerdictBanner" hidden></div>
<div class="train-lora-link-row" id="trainLoraList" style="margin-top:8px;display:flex;flex-wrap:wrap;gap:8px;">
<div class="hint" style="padding:4px 0">No trained characters yet. Start your first run above.</div>
</div>
<div class="hint" style="margin-top:8px">Trained LoRAs land in <code id="trainLorasDir">mlx_models/loras/</code> alongside any LoRAs you've downloaded — they show up in the regular picker too.</div>
</div>
</div>
<!-- ============== STORYBOARD — the brief (own workflow tab) ========
One concept in, a film's worth of shots out. Every element here
mirrors one that already exists: the concept box is the Video tab's
composer, the shot chips are #h3LengthGroup's, the cast picker is
the Manual tab's character strip reading the same _manualCharacters
array, and the footer is the sticky Generate footer. Nothing new is
invented that could have been borrowed. -->
<div id="sbSectionTab" style="display:none">
<!-- Saved boards. Hidden while the list is empty — with no film in
progress this tab is a concept box and a button, nothing else. -->
<div class="sb-boards" id="sbBoards" hidden>
<div class="sb-boards-head">Your storyboards</div>
<ul class="row-list sb-boardlist" id="sbBoardListMini"></ul>
</div>
<div class="composer-card sb-brief" id="sbBrief">
<textarea class="composer-prompt sb-concept" id="sbConcept" rows="4"
oninput="sbConceptInput()"
placeholder="A retired boxer walks his old neighbourhood at dawn and remembers a fight he lost."></textarea>
</div>
<div class="cz-control" id="sbLengthRow">
<div class="cz-label">Shots <span class="cz-label-hint">how many, roughly</span></div>
<div class="quality-strip pill-group cols-5" id="sbLengthGroup">
<button type="button" class="q-chip pill-btn" data-sb-shots="6">
<span class="ql-name">6</span><span class="q-spec ql-spec sub">a scene</span></button>
<button type="button" class="q-chip pill-btn active" data-sb-shots="12">
<span class="ql-name">12</span><span class="q-spec ql-spec sub">a short</span></button>
<button type="button" class="q-chip pill-btn" data-sb-shots="24">
<span class="ql-name">24</span><span class="q-spec ql-spec sub">a film</span></button>
<button type="button" class="q-chip pill-btn" data-sb-shots="36">
<span class="ql-name">36</span><span class="q-spec ql-spec sub">long</span></button>
<!-- ONE SHOT: a film that is one shot. The planner writes beats
(one per 5 s) instead of shots; the render is the Video tab's
One Shot. -->
<button type="button" class="q-chip pill-btn" data-sb-shots="take" title="One continuous shot that never cuts — the planner writes one beat per five seconds and the world changes around the subject">
<span class="ql-name">1</span><span class="q-spec ql-spec sub">One Shot</span></button>
</div>
<div class="cz-control" id="sbTakeRow" hidden>
<div class="cz-label">One Shot length <span class="cz-label-hint">one beat per 5 seconds · the camera never cuts</span></div>
<div class="pill-group cols-5" id="sbTakeGroup">
<button type="button" class="pill-btn" data-sb-take="30"><span>30 s</span><span class="sub">6 beats</span></button>
<button type="button" class="pill-btn" data-sb-take="45"><span>45 s</span><span class="sub">9 beats</span></button>
<button type="button" class="pill-btn active" data-sb-take="60"><span>1 min</span><span class="sub">12 beats</span></button>
<button type="button" class="pill-btn" data-sb-take="90"><span>1½ min</span><span class="sub">18 beats</span></button>
<button type="button" class="pill-btn" data-sb-take="120"><span>2 min</span><span class="sub">24 beats</span></button>
</div>
</div>
</div>
<!-- The film-level engine. It is a PLANNING input, not a label: the two
engines want prompts written differently, so this is asked before the
plan exists and changing it means re-planning (the Re-plan modal
carries the same control). Per-shot override stays cut for v1. -->
<div class="cz-control" id="sbEngineRow">
<div class="cz-label">Engine <span class="cz-label-hint">who renders the shots</span></div>
<div class="pill-group cols-3" id="sbEngineGroup"></div>
<div class="sb-enginepick-note" id="sbEnginePickNote"></div>
</div>
<!-- THE DIRECTOR. A soundtrack on the brief makes this a music video:
the beat grid decides how many shots there are and how long each
is (the Shots chips stand down), the planner writes one movement
per slot, and the Editor opens the film already cut on the
downbeats under this track. The same path the Editor's soundtrack
takes — a file on this Mac. -->
<div class="cz-control" id="sbTrackRow">
<div class="cz-label">Soundtrack
<span class="cz-label-hint" id="sbTrackMeta">optional — a track makes it a music video cut to the beat</span></div>
<div class="sb-track-row">
<input type="text" id="sbTrack" class="sb-input" spellcheck="false"
oninput="sbTrackInput()"
placeholder="/path/to/the/track.wav">
<select class="sb-input sb-track-bars" id="sbTrackBars" title="How many bars each shot holds"
onchange="sbTrackInput()">
<option value="1">1 bar</option>
<option value="2" selected>2 bars</option>
<option value="4">4 bars</option>
</select>
</div>
<!-- FILM-44: this box writes a beat-synced shot list from a plain
concept. Casting a Singer against pictures — the common
"music video" ask — is the Audio tab's Music Video pane
(drop the song, drop pictures, tag who sings), which a
creator starting HERE would otherwise never find. -->
<div class="cz-label-hint sb-track-signpost">
Casting a singer with pictures? Try
<a href="#" onclick="event.preventDefault();sbGoToMusicVideo()">the Music Video planner</a>.
</div>
</div>
<div class="cz-control" id="sbStyleRow">
<div class="cz-label">Look <span class="cz-label-hint">goes on every shot</span></div>
<input type="text" id="sbStyle" class="sb-input"
placeholder="16mm, cold morning light, handheld, muted greens">
</div>
<div class="cz-control" id="sbCastRow">
<div class="cz-label">Who's in it <span class="cz-label-hint">optional</span></div>
<div class="chars-strip"><div class="chars-avatar-row" id="sbCharsList"></div></div>
<div class="chars-strip-empty" id="sbCharsEmpty" hidden>
No trained characters yet —
<a href="#" onclick="workflowSwitch('train'); return false;">train one in the Train tab</a>, or
<button type="button" class="ghost-btn js-get-sample-char" style="padding:2px 8px;font-size:12px"
onclick="downloadSampleCharacter()">get a sample character (Bizarro)</button>.
</div>
<div class="chars-q4-note">__Q8_CHARACTER_INSTALL_COPY__</div>
<!-- Wardrobe rides with the CHARACTER, not the shot. "A man in a dark
suit" is a different suit every time it is re-rolled — measured:
four shots of one man came back in two suits and two different
period collars. -->
<input type="text" id="sbWardrobe" class="sb-input" style="margin-top:8px"
placeholder="what they wear in this film — e.g. a loud floral Hawaiian shirt, collar open">
</div>
<!-- LOCATIONS. A model re-invents everything the prompt does not pin, so
four shots that each said "dim room" came back as four different
rooms — one of them a vintage parlour with no monitors in it. Writing
the room ONCE and injecting it into every shot that claims it is the
only thing that survives shots being re-rendered one at a time. -->
<div class="cz-control" id="sbLocRow">
<div class="cz-label">Where it happens
<span class="cz-label-hint">one line per place — shots reuse them</span></div>
<textarea id="sbLocations" class="sb-textarea" rows="3" oninput="sbLocInput()"
placeholder="the study: dark oak panelling, three curved monitors glowing cold blue, a brass desk lamp the driveway: bright suburban driveway, red convertible, late afternoon sun"></textarea>
<div class="cz-meta" id="sbLocMeta">no locations — every shot invents its own</div>
</div>
<!-- FILM-14 (item 4): the same fix as locations, one axis over — a cut
jumps visibly when each shot re-invents its own lighting. Written
ONCE and injected at render time into every shot not yet rendered,
this line survives a re-plan the same way a location does. -->
<div class="cz-control" id="sbLightRow">
<div class="cz-label">Light <span class="cz-label-hint">one line — goes on every shot not yet rendered</span></div>
<input type="text" id="sbLight" class="sb-input"
placeholder="warm practical lamps, single source, deep shadows">
</div>
<details class="customize-section" id="sbMustSection">
<summary class="cz-summary">
<span class="cz-chevron"><svg class="ph" aria-hidden="true"><use href="#ph-caret-down"/></svg></span>
<span class="cz-title">Shots it must include</span>
<span class="cz-meta" id="sbMustMeta">none</span>
</summary>
<div class="cz-body">
<div class="cz-control">
<div class="cz-label">One per line</div>
<textarea id="sbMust" class="sb-textarea" rows="4" oninput="sbMustInput()"
placeholder="close-up on his hands wrapping the empty gym at the end"></textarea>
</div>
</div>
</details>
<!-- AUTO. One press: plan, render every shot, cut to the beat, make
the film. Each step is the panel's existing one; only the
hand-over is new. -->
<label class="check sb-auto" title="After the plan lands, every shot renders on its own, the cut is made (on the beat when there is a track) and the film is assembled — no more buttons. You can still stop the render or re-cut afterwards.">
<input type="checkbox" id="sbAuto"> Auto — plan, render every shot, cut and make the film
</label>
<!-- ANCHOR STILLS. A still of each shot's first frame (from the
character's sheet when it has one) is made first, in seconds; the
clip then starts from it. -->
<label class="check sb-auto" title="Before each shot renders, an image of its first frame is made (from the character's sheet when the shot has one) and the clip starts from that still. LTX shots only; the still shows on the shot card with a New still button.">
<input type="checkbox" id="sbAnchorStills" onchange="sbStillsFirstSync()"> Start each shot from a still
</label>
<!-- FILM-46: STILLS FIRST. The still decides the composition, but the
render went straight from still to video with no way to look at
the still first — so the composition was only ever seen after
the (expensive) video minutes were spent. This holds the render
for approval once each still lands. Implies "start from a
still" — a still to approve has to exist. -->
<label class="check sb-auto" title="After a shot's still lands, the render stops there and waits for you to Approve it (or ask for a new one) before it spends the video minutes. Turns on "Start each shot from a still" too.">
<input type="checkbox" id="sbStillsFirst" onchange="sbStillsFirstSync()"> Stills first — approve each still before it renders
</label>
<!-- LONG WINDOWS. A shot longer than one LTX window renders as a chain
of windows instead of being cut to fit. -->
<label class="check sb-auto" title="A shot longer than 5 seconds renders as a chain of 5-second passes, each continuing from the last, instead of being shortened to fit one. Slower. LTX shots only.">
<input type="checkbox" id="sbLongWindows"> Long shots (over 5 s): chain 5-second passes · needs the Q8 pack
</label>
<div class="sb-ramline">
<span>These three decide how the film gets made.</span>
<button type="button" class="help-dot" id="sbSwitchHelpBtn" aria-expanded="false"
aria-controls="sbSwitchHelpNote" title="What do they do?" onclick="sbToggleSwitchHelp()">?</button>
</div>
<div class="h3-winhelp" id="sbSwitchHelpNote" hidden>
<b>Auto</b> — once the plan lands, every shot renders on its own, the cut is made (on the beat when there is a track) and the film is assembled. You can still stop it or re-cut afterwards.<br>
<b>Start each shot from a still</b> — an image of the first frame is made first (seconds), from the character's sheet when the shot has one, and the clip starts from it. The composition is decided on the image, not discovered after minutes of video. A still that fails is written on the card and the shot renders without one. LTX shots only.<br>
<b>Long shots</b> — a shot over 5 seconds is normally shortened to fit one pass. With this on, it renders as a chain of 5-second passes, each continuing the last. Slower, and it needs the Q8 pack. LTX shots only.<br>
The planner writes the beats by the rules in <a href="https://phosphene.video/docs/prompting/" data-utm-campaign="docs" data-utm-content="one-shot-planner" target="_blank" rel="noopener" onclick="openExternal(this.href); return false;">Writing for Phosphene</a>; the same page can be copied into your own assistant if you write by hand.
</div>
<div class="form-action-footer">
<div class="sb-ramline" id="sbRamLine">
<span>Planning borrows the memory for about a minute, then gives it back.</span>
<button type="button" class="help-dot" id="sbRamHelpBtn" aria-expanded="false"
aria-controls="sbRamHelpNote" title="Why?" onclick="sbToggleRamHelp()">?</button>
</div>
<div class="h3-winhelp" id="sbRamHelpNote" hidden></div>
<button type="button" class="primary" id="sbPlanBtn" onclick="sbPlan()">Plan film</button>
</div>
</div>
<!-- ============== AUDIO → VIDEO (own workflow tab) ==============
Routes to the helper's `generate_a2v` action which loads
A2VidPipelineTwoStage (Q8 dev + distilled LoRA stage 2). The
pipeline writes the original input audio onto the output MP4
itself — no panel-side mux. Reference image is optional; when
present the pipeline anchors frame 0 (same shape as I2V), so
the same surface covers both pure A2V (audio only) and
Image + Audio (audio + still). -->
<!-- ========== ONE SHOT — its own door (2026-09-08) ==========
One continuous shot of 30 s – 2 min that never cuts, rendered as parts
that continue from each other's last frame. Its own composer: the shot
(engine, one prompt, a start frame, who is in it), then length and
quality with the cost on this Mac, then direction (beats with a time
gutter, one camera line, three continuity switches), then Generate and
a part-by-part status. Nothing here rides the video form: webapp/js/
oneshot.js reads these fields, posts ONE document to POST /oneshot
(panel/routes_oneshot.py — the same document a script posts) and paints
the take from GET /oneshot/status. -->
<div id="oneshotSectionTab" style="display:none">
<div class="composer-card os-card">
<h2>One Shot <span class="h2-hint">30 s to 2 min · never cuts</span></h2>
<div class="hint os-lead">Write the whole shot once and it renders as parts that continue from each other's last frame. Everything below is optional: the beats direct five seconds each, one camera line holds the move, and a trained character speaks with its own face and voice.</div>
<!-- The engine is picked in the column's top Model picker (#engineSwitch,
same as Video; owner 5 Nov 2026), which calls osSetEngine(). This
line says what the picked one does with the shot. -->
<div class="hint os-engine-meta" id="osEngineMeta"></div>
<div class="os-block">
<div class="qs-label h3-axis-label"><span class="qs-name">The shot</span><span class="qs-meta">who, where, the time of day and the weather, the sound — once, for the whole shot</span></div>
<textarea id="osPrompt" class="sb-textarea os-prompt" rows="4" spellcheck="false" placeholder="A red vintage tram rolls through a rain-soaked Lisbon street at night, neon on the wet cobbles; a woman with a yellow umbrella waits at the stop. The tram bell rings twice; rain on the roof, distant fado from a bar."></textarea>
</div>
<div class="os-two">
<div class="os-block">
<div class="qs-label h3-axis-label"><span class="qs-name">Start frame</span><span class="qs-meta">optional · the shot opens on this picture</span></div>
<div class="os-anchor" id="osAnchor">
<img class="os-anchor-thumb" id="osAnchorThumb" alt="" hidden>
<button type="button" class="ghost-btn small" id="osAnchorPick">Choose an image</button>
<button type="button" class="ghost-btn small" id="osAnchorClear" hidden>Clear</button>
<span class="sub os-anchor-name" id="osAnchorName"></span>
<input type="file" id="osAnchorFile" accept="image/*" hidden>
</div>
</div>
<div class="os-block" id="osCharacterBlock">
<div class="qs-label h3-axis-label"><span class="qs-name">Who is in it</span><span class="qs-meta" id="osCharacterMeta">optional · a trained character, with its own face and voice</span></div>
<div class="pill-group os-characters" id="osCharacterGroup" role="group" aria-label="Who is in it"></div>
<div class="hint os-character-note" id="osCharacterNote" hidden></div>
</div>
</div>
</div>
<div class="composer-card os-card">
<div class="os-block">
<div class="qs-label h3-axis-label"><span class="qs-name">Length</span><span class="qs-meta" id="osLengthMeta"></span></div>
<div class="quality-strip pill-group cols-5" id="osLengthGroup"></div>
</div>
<div class="os-block">
<div class="qs-label h3-axis-label"><span class="qs-name">Quality</span><span class="qs-meta" id="osQualityMeta"></span></div>
<div class="quality-strip pill-group" id="osQualityGroup"></div>
</div>
<div class="os-estimate" id="osEstimate" aria-live="polite"></div>
</div>
<div class="composer-card os-card">
<div class="os-block">
<div class="qs-label h3-axis-label">
<span class="qs-name">Beats</span>
<span class="qs-meta" id="osBeatsHint">one line per five seconds · none written — the prompt carries the whole shot</span>
</div>
<div class="os-beats-tools">
<button type="button" class="ghost-btn small" id="osSplitBtn" title="Splits the shot above into one line per sentence — a start to edit, not the final word">Split my prompt into beats</button>
<button type="button" class="ghost-btn small" id="osPlanBtn" title="The planner writes one beat per five seconds from the shot above — about half a minute">Write the beats for me</button>
</div>
<!-- One row per five seconds, the stamp glued to its own field: a
beat that wraps or a box that scrolls can never put a stamp
beside the wrong line (the reviewer's first finding). -->
<div class="os-beat-rows" id="osBeats" role="group" aria-label="Beats, one per five seconds"></div>
<div class="hint os-beats-note">A blank row holds that moment. Enter moves to the next row; paste a whole list and it fills the rows. <a href="https://phosphene.video/docs/prompting/" data-utm-campaign="docs" data-utm-content="one-shot-beats" target="_blank" rel="noopener" onclick="openExternal(this.href); return false;">How to write the beats</a>.</div>
</div>
<div class="os-block">
<div class="qs-label h3-axis-label"><span class="qs-name">Camera</span><span class="qs-meta">optional · one move for the whole shot, its direction and speed — every part continues it</span></div>
<input type="text" id="osCamera" class="sb-input" maxlength="240" autocomplete="off" spellcheck="false" placeholder="a slow, steady clockwise arc around the table at eye level, wide to close">
</div>
<div class="os-toggles">
<div class="os-toggle">
<div class="qs-label h3-axis-label"><span class="qs-name">Lock the light</span><span class="qs-meta">the time of day and the weather stay the same in every part</span></div>
<div class="pill-group cols-2" data-os-toggle="light" role="group" aria-label="Lock the light"><button type="button" class="pill-btn active" data-os-value="on"><span>On</span><span class="sub">same light, every part</span></button><button type="button" class="pill-btn" data-os-value="off"><span>Off</span><span class="sub">beats as written</span></button></div>
</div>
<div class="os-toggle">
<div class="qs-label h3-axis-label"><span class="qs-name">Redo a part that drifts / doesn't sync</span><span class="qs-meta">light-change or lip-sync misses each get rendered again, fresh seed</span></div>
<div class="pill-group cols-2" data-os-toggle="retake" role="group" aria-label="Redo a part that drifts or doesn't sync"><button type="button" class="pill-btn active" data-os-value="on"><span>On</span><span class="sub">up to a few times, at most</span></button><button type="button" class="pill-btn" data-os-value="off"><span>Off</span><span class="sub">keep the first pass</span></button></div>
</div>
<div class="os-toggle">
<div class="qs-label h3-axis-label"><span class="qs-name">Hand off where the line ends</span><span class="qs-meta">for dialogue: the next part starts while the mouth still moves</span></div>
<div class="pill-group cols-2" data-os-toggle="handoff" role="group" aria-label="Hand off where the line ends"><button type="button" class="pill-btn" data-os-value="speech"><span>On</span><span class="sub">a talking character</span></button><button type="button" class="pill-btn active" data-os-value="last"><span>Off</span><span class="sub">on the last frame</span></button></div>
</div>
</div>
<details class="os-more" id="osMore">
<summary>More</summary>
<div class="os-more-grid">
<label class="os-field"><span class="sub">Seed</span><input type="text" id="osSeed" class="sb-input" inputmode="numeric" placeholder="random" autocomplete="off"></label>
<label class="os-field"><span class="sub">Label</span><input type="text" id="osLabel" class="sb-input" maxlength="120" placeholder="how it appears in the queue" autocomplete="off"></label>
<label class="os-field os-check"><input type="checkbox" id="osNoMusic"><span>No music</span><span class="sub">voice, sound and ambience only</span></label>
</div>
</details>
</div>
<div class="form-action-footer os-footer">
<div class="queue-strip"><span class="qchip-derived" id="osSummary"></span></div>
<div class="actions">
<button type="button" class="primary" id="osGenBtn">Generate</button>
<button type="button" class="danger js-stop-btn" disabled data-role="stop-btn" onclick="requestStop()" title="Stop the current render">Stop</button>
</div>
</div>
<div class="composer-card os-card os-status" id="osStatus" hidden>
<div class="qs-label h3-axis-label"><span class="qs-name" id="osStatusTitle">Rendering</span><span class="qs-meta" id="osStatusMeta"></span></div>
<div class="os-parts" id="osParts"></div>
<pre class="os-log" id="osLog"></pre>
</div>
</div>
<div id="audioSectionTab" style="display:none">
<div class="mode-bar pill-group cols-3" id="audioModeGroup" hidden>
<button type="button" class="mode-chip pill-btn" data-audio-mode="compose" onclick="audioModeSet('compose')">Compose<span class="mc-sub sub">write a song</span></button>
<button type="button" class="mode-chip pill-btn" data-audio-mode="speech" onclick="audioModeSet('speech')">Speech<span class="mc-sub sub">your script, spoken</span></button>
<button type="button" class="mode-chip pill-btn" data-audio-mode="drive" onclick="audioModeSet('drive')">Music video<span class="mc-sub sub">a song and your pictures</span></button>
</div>
<!-- ============== SPEECH ======================================
Text to speech (speech_engine.py, docs/SPEECH.md): a script in a
preset voice or a saved character's voice → one WAV in Outputs,
ready for "Use this audio for… → Lip-sync". Cloning asks the
voice-owner question every time (acceptable-use policy). -->
<div id="speechPane" hidden>
<div class="studio-head">
<div class="studio-head-text">
<div class="studio-title">Speech</div>
<div class="studio-sub">Write a script. Choose a voice. Make a WAV for lip-sync.</div>
</div>
</div>
<div class="composer-card speech-install-panel" id="speechInstallPanel" role="status" hidden></div>
<div class="composer-card">
<label for="speechText">Script</label>
<textarea id="speechText" class="composer-prompt" rows="4" maxlength="2000"
placeholder="The render is ready. You can stop watching the progress bar now. Let's see what we made."
oninput="speechFormChanged()"></textarea>
<div class="hint" id="speechFit" role="status"></div>
</div>
<div class="quick-settings">
<div class="mf-label">Voice</div>
<div class="studio-seg full" id="speechKindSeg" role="group" aria-label="Whose voice">
<button type="button" class="seg-btn active" data-value="preset" onclick="speechKindPick(this)">Preset voice</button>
<button type="button" class="seg-btn" data-value="character" onclick="speechKindPick(this)">A character</button>
<button type="button" class="seg-btn" data-value="clip" onclick="speechKindPick(this)">A clip you add</button>
</div>
<div id="speechPresetRow">
<select id="speechVoice" aria-label="Preset voice" onchange="speechFormChanged()"></select>
<div class="mf-label" style="margin-top:10px">Delivery</div>
<div class="pill-group cols-4 speech-styles" id="speechStylePills" role="group" aria-label="Delivery"></div>
<input type="hidden" id="speechStyle" value="natural">
<input type="text" id="speechInstruct" maxlength="300" placeholder="Or describe the delivery: tired, like it's 3 a.m. and the render just failed"
oninput="speechFormChanged()" aria-label="Delivery, in your words">
</div>
<div id="speechCharacterRow" hidden>
<select id="speechCharacter" aria-label="Character" onchange="speechCharacterChanged()"></select>
<div class="hint" id="speechCharacterHint"></div>
</div>
<div id="speechClipRow" hidden>
<div class="studio-ref-slot" id="speechClipSlot" style="aspect-ratio:auto;min-height:72px;" tabindex="0"
onclick="document.getElementById('speechClipInput').click()"></div>
<input type="file" id="speechClipInput" accept=".wav,.mp3,.m4a,.flac,audio/*" style="display:none" onchange="speechClipUpload(this.files)">
</div>
<!-- For both cloned kinds: the words heard in the reference clip let
the model continue the recording (measured: a closer copy). -->
<input type="text" id="speechClipText" maxlength="600" hidden placeholder="Optional: type the clip's words for a closer voice match"
oninput="speechClipTextChanged()" aria-label="Words spoken in the voice clip">
<label class="speech-consent" id="speechConsentRow" hidden>
<input type="checkbox" id="speechConsent" onchange="speechFormChanged()">
<span>This is my voice, or I have the speaker's permission to use it.
<a href="https://phosphene.video/acceptable-use/" data-utm-campaign="acceptable-use" data-utm-content="speech-consent" target="_blank" rel="noopener">No impersonation.</a></span>
</label>
<div class="hint" id="speechCloneHint" hidden>The voice follows the clip's mood and your punctuation. Try ! ? or … to shape the delivery.</div>
<div class="range-strip">
<label for="speechSpeed">Speed</label>
<input type="range" id="speechSpeed" min="0.7" max="1.4" step="0.05" value="1" oninput="speechFormChanged()">
<span id="speechSpeedVal">1.00×</span>
</div>
<details class="customize-section" id="speechAdvancedDetails">
<summary class="cz-summary"><span class="cz-chevron" aria-hidden="true"><svg class="ph"><use href="#ph-caret-down-bold"/></svg></span><span class="cz-title">Advanced</span><span class="cz-meta" id="speechAdvancedSummary">English · random seed</span></summary>
<div class="cz-body">
<div class="mini-fields"><div class="mf-cell">
<label class="mf-label" for="speechLanguage">Language</label>
<select id="speechLanguage" onchange="speechFormChanged()"></select>
</div><div class="mf-cell">
<label class="mf-label" for="speechSeed">Seed</label>
<input type="number" id="speechSeed" value="-1" min="-1" max="2147483647" step="1" placeholder="-1 = random" oninput="speechFormChanged()">
</div></div>
<div class="hint">The same seed, text and voice give the same take.</div>
</div>
</details>
</div>
<div class="form-action-footer">
<div class="queue-strip"><span class="qchip-derived" id="speechEstimate"></span></div>
<div class="actions">
<button type="button" class="primary" id="speechGenBtn" onclick="speechGenerate()">Generate</button>
<button type="button" class="danger js-stop-btn" disabled data-role="stop-btn" onclick="requestStop()" title="Stop the current render">Stop</button>
</div>
<div class="hint" id="speechStatus" role="status"></div>
<div class="speech-last" id="speechLast" hidden></div>
<div class="music-credit">Speech by Qwen3-TTS (Qwen team, Apache-2.0) · MLX via mlx-audio</div>
</div>
</div>
<div id="musicComposePane" hidden>
<div class="studio-head">
<div class="studio-head-text">
<div class="studio-title">Music Studio</div>
<div class="studio-sub">Write a song, cover one, or read the score off a recording.</div>
</div>
<!-- SIMPLE or CUSTOM. Simple is one box: say what the song is and
Gemma writes the style and the words for you to read. Custom is
the studio — the same two fields, yours to type. The choice is
remembered (phos_music_mode); Custom is the default because it
is what the fields on this page already are. -->
<div class="studio-seg" id="musicModeSeg" role="group" aria-label="How much you fill in">
<button type="button" class="seg-btn" data-value="simple" onclick="musicModePick(this)">Simple</button>
<button type="button" class="seg-btn active" data-value="custom" onclick="musicModePick(this)">Custom</button>
</div>
</div>
<!-- The engine's install lives above both modes: it is about YuE2
being here, not about which form you are filling in. -->
<div class="composer-card music-install-panel" id="musicInstallPanel" role="status" hidden></div>
<div id="musicSimplePane" hidden>
<div class="composer-card">
<label for="musicSimpleDescription">Describe the song</label>
<textarea id="musicSimpleDescription" class="composer-prompt" rows="4"
placeholder="Who sings it, what it is about, how it sounds — e.g. a slow piano ballad for a friend moving away, a woman with a low warm voice, brushed drums, a little sad but not bitter"></textarea>
<div class="hint">One breath is enough. Gemma turns it into a style and the words, and shows you both before anything renders.</div>
<div class="composer-tools">
<label class="toggle-pill" id="musicSimpleInstrumentalPill" title="When on, the model is asked for a track with no vocal line — Gemma writes the style only, no words.">
<input type="checkbox" id="musicSimpleInstrumental" onchange="musicSimpleChanged()"><span class="dot"></span><span>Instrumental</span>
</label>
</div>
</div>
<div class="quick-settings">
<div class="range-strip">
<label for="musicSimpleSeconds">Max length</label>
<input type="range" id="musicSimpleSeconds" min="30" max="360" step="15" value="240" oninput="musicSimpleChanged()">
<span id="musicSimpleSecondsVal">4:00</span>
</div>
<div class="hint">How long the words are written for, and the ceiling on the song. It never stretches a short one.</div>
</div>
</div>
<div id="musicCustomPane">
<div class="music-notice" id="musicSimpleNotice" role="status" hidden></div>
<!-- THREE TASKS, one form. Write is the composer as it was; Cover
opens the cover section; Score is transcription only — listen
to a recording and get its sheet music, no song rendered. -->
<div class="studio-tasks studio-seg full" id="musicTaskPills" role="group" aria-label="What to make">
<button type="button" class="seg-btn active" data-value="write" onclick="musicTaskPick(this)">Write a song</button>
<button type="button" class="seg-btn" data-value="cover" onclick="musicTaskPick(this)">Cover a song</button>
<button type="button" class="seg-btn" data-value="score" onclick="musicTaskPick(this)">Get the score</button>
</div>
<input type="hidden" id="musicTask" value="write">
<!-- COVER. The engine can read a score off a record: SheetSage2
transcribes the source into ABC, and that becomes the plan the
generator realises under YOUR style and YOUR lyrics. Closed by
default because most songs start from a prompt, and the two
transcription models are an opt-in 2.8 GB on top of the pack. -->
<details class="customize-section" id="musicCoverDetails">
<summary class="cz-summary">
<span class="cz-chevron" aria-hidden="true"><svg class="ph"><use href="#ph-caret-down-bold"/></svg></span>
<span class="cz-title">Cover a song</span>
<span class="cz-meta" id="musicCoverSummary">off</span>
</summary>
<div class="cz-body">
<div class="music-cover-install" id="musicCoverInstall" role="status" hidden></div>
<label class="mf-label" for="musicSourceAudio">Source song</label>
<input id="musicSourceAudio" placeholder="/path/to/the/song.mp3 — drag a file in"
oninput="musicFormChanged()">
<div class="hint">The tune comes off this recording. Everything else — style,
lyrics, voice — is still yours. Leave empty to write a song from your prompt.</div>
<div class="mf-label">Take from it</div>
<div class="pill-group cols-3" id="musicCoverTaskPills">
<button type="button" class="pill-btn active" data-value="melody-full"
onclick="musicPick('musicCoverTask',this)">Melody + chords</button>
<button type="button" class="pill-btn" data-value="melody-vocal"
onclick="musicPick('musicCoverTask',this)">The sung line</button>
<button type="button" class="pill-btn" data-value="full"
onclick="musicPick('musicCoverTask',this)">Everything</button>
</div>
<input type="hidden" id="musicCoverTask" value="melody-full">
<div class="hint" id="musicCoverTaskHint">Melody and the chords under it, read from the
whole mix. <b>The sung line</b> takes the vocal only, so the arrangement is new.
<b>Everything</b> keeps the accompaniment too and needs the longest read.</div>
</div>
</details>
<div class="composer-card">
<label for="musicTitle">Title <span class="sub">optional</span></label>
<input id="musicTitle" placeholder="What the song is called" maxlength="120" oninput="musicFormChanged()">
<label for="musicConcept">What is it about?</label>
<div class="concept-row">
<textarea id="musicConcept" class="composer-prompt" rows="2" placeholder="A concept, a story, a feeling — one or two sentences. Gemma writes the lyrics in the format YuE2 reads."></textarea>
<button type="button" class="ghost-btn" id="musicWriteLyricsBtn" onclick="musicWriteLyrics()" title="Gemma (local) writes section-tagged lyrics from the concept, in the style you gave below. Runs on this Mac.">Write lyrics</button>
</div>
<!-- THE LYRICS EDITOR. A song is sections, not a wall of text, so
the editor shows sections: a label you can change, the lines
under it, how many lines that is, and a Rewrite that asks Gemma
for THAT part only. The bracket text stays the truth underneath
— #musicLyrics is still the one field every caller reads — and
Text flips to it for anyone who would rather type brackets. -->
<div class="lyr-head">
<span class="lyr-title">Lyrics</span>
<div class="studio-seg" id="musicLyricsViewSeg" role="group" aria-label="How to edit the lyrics">
<button type="button" class="seg-btn active" data-value="sections" onclick="musicLyricsViewPick(this)">Sections</button>
<button type="button" class="seg-btn" data-value="text" onclick="musicLyricsViewPick(this)">Text</button>
</div>
</div>
<div class="lyr-editor" id="musicLyricsEditor">
<div class="lyr-sections" id="musicLyricsSections"></div>
<div class="lyr-add" id="musicLyricsAdd">
<span class="lyr-add-label">Add</span>
<button type="button" class="tag-chip" onclick="musicLyricsAdd('Intro')">Intro</button>
<button type="button" class="tag-chip" onclick="musicLyricsAdd('Verse')">Verse</button>
<button type="button" class="tag-chip" onclick="musicLyricsAdd('Pre-Chorus')">Pre-Chorus</button>
<button type="button" class="tag-chip" onclick="musicLyricsAdd('Chorus')">Chorus</button>
<button type="button" class="tag-chip" onclick="musicLyricsAdd('Bridge')">Bridge</button>
<button type="button" class="tag-chip" onclick="musicLyricsAdd('Instrumental')">Instrumental</button>
<button type="button" class="tag-chip" onclick="musicLyricsAdd('Outro')">Outro</button>
</div>
</div>
<textarea id="musicLyricsRaw" class="composer-prompt" rows="10" hidden
aria-label="Lyrics as text" onblur="musicLyricsRawSync()" placeholder="[Verse]
Write the words here, one line at a time
[Pre-Chorus]
Build toward the chorus
[Chorus]
The words you want to come back to
[Bridge]
A different turn
[Outro]
The last line"></textarea>
<!-- The source of truth. Hidden, never typed into: the editor above
writes it, musicFormParams reads it, and the restyle and score
verbs on a song read it too. -->
<textarea id="musicLyrics" hidden tabindex="-1" aria-hidden="true"></textarea>
<div class="hint">Square brackets mark the sections; everything else is sung. A section with no words is an instrumental passage.</div>
<label for="musicStyle">Style</label>
<textarea id="musicStyle" class="composer-prompt" rows="2" placeholder="Genre, instruments, vocal, language and tempo in plain words — e.g. English, warm piano pop, expressive female voice, acoustic piano, light drums, 88 BPM"></textarea>
<div class="hint">Prose, not fields. Put the tempo, the language and the singer in the sentence.</div>
<div class="composer-tools">
<label class="toggle-pill" id="musicInstrumentalPill" title="When on, the model is asked for a track with no vocal line. Your lyrics stay in the box and are not used.">
<input type="checkbox" id="musicInstrumental" onchange="musicFormChanged()"><span class="dot"></span><span>Instrumental</span>
</label>
</div>
<!-- Instrumental is two recipes, and which one runs depends on one
140 MB file. Said here, in place, rather than after a song comes
back with a voice on it. -->
<div class="music-pack-note" id="musicLoraInstall" role="status" hidden></div>
</div>
<div class="quick-settings">
<div class="mf-label">Score</div>
<div class="pill-group cols-3" id="musicModePills">
<button type="button" class="pill-btn active" data-value="full" onclick="musicPick('musicMode',this)">Melody + chords</button>
<button type="button" class="pill-btn" data-value="melody" onclick="musicPick('musicMode',this)">Melody only</button>
<button type="button" class="pill-btn" data-value="off" onclick="musicPick('musicMode',this)">No score</button>
</div>
<input type="hidden" id="musicMode" value="full">
<div class="hint">YuE2 writes a sheet-music plan first, then the song.</div>
<div class="mf-label">Quality</div>
<div class="pill-group cols-2" id="musicQualityPills">
<button type="button" class="pill-btn" data-value="draft" onclick="musicPick('musicQuality',this)">Draft<span class="sub">8 steps</span></button>
<button type="button" class="pill-btn active" data-value="final" onclick="musicPick('musicQuality',this)">Final<span class="sub">32 steps</span></button>
</div>
<input type="hidden" id="musicQuality" value="final">
<div class="hint">Draft is several times faster for auditioning ideas.</div>
<div class="range-strip">
<label for="musicMaxSeconds">Max length</label>
<input type="range" id="musicMaxSeconds" min="30" max="360" step="15" value="240" oninput="musicFormChanged()">
<span id="musicMaxSecondsVal">4:00</span>
</div>
<div class="hint">YuE2 writes as long as your lyrics need. This only cuts a longer song off; it never stretches a short one.</div>
<div class="mini-fields"><div class="mf-cell">
<label class="mf-label" for="musicSeed">Seed</label>
<input type="number" id="musicSeed" value="-1" min="-1" max="4294967295" step="1" placeholder="-1 = random" title="-1 = random">
</div><div class="mf-cell">
<label class="mf-label" for="musicTakes">Takes</label>
<input type="number" id="musicTakes" value="1" min="1" max="8" step="1" title="How many songs to queue from this form, each with its own seed">
</div></div>
<details class="customize-section" id="musicLoraDetails">
<summary class="cz-summary"><span class="cz-chevron" aria-hidden="true"><svg class="ph"><use href="#ph-caret-down-bold"/></svg></span><span class="cz-title">Voice & style LoRA</span><span class="cz-meta" id="musicLoraSummary">off</span></summary>
<div class="cz-body">
<div class="music-lora-list" id="musicLoraList"></div>
<div class="hint">Adapters change how the model writes and how it sounds. Drop your own
<code>.safetensors</code> into the LoRA folder's <code>user/</code> and it appears here.
Instrumental uses its own adapter and pauses these.</div>
</div>
</details>
<details class="customize-section" id="musicAdvancedDetails">
<summary class="cz-summary"><span class="cz-chevron" aria-hidden="true"><svg class="ph"><use href="#ph-caret-down-bold"/></svg></span><span class="cz-title">Advanced</span><span class="cz-meta" id="musicAdvancedSummary">defaults</span></summary>
<div class="cz-body">
<div class="mf-label">Guidance</div>
<div class="range-strip">
<label for="musicCfg">Text guidance</label>
<input type="range" id="musicCfg" min="0" max="3" step="0.1" value="1" oninput="musicFormChanged()">
<span id="musicCfgVal">1.0</span>
</div>
<div class="hint">How hard the song follows the style and the words. 1.0 is the model's own default; higher is more literal and can get stiff, lower is looser.</div>
<div class="mf-label">Precision</div>
<div class="pill-group cols-2" id="musicPrecisionPills">
<button type="button" class="pill-btn" data-value="bf16" onclick="musicPick('musicPrecision',this)">bf16<span class="sub">best, most memory</span></button>
<button type="button" class="pill-btn active" data-value="8bit" onclick="musicPick('musicPrecision',this)">8-bit<span class="sub">default</span></button>
</div>
<input type="hidden" id="musicPrecision" value="8bit">
<div class="hint">The composer model's weights. 8-bit is what every song so far was made with; bf16 needs roughly 8 GB more memory.</div>
</div>
</details>
</div>
</div><!-- /musicCustomPane -->
<div class="form-action-footer">
<div class="queue-strip"><span class="qchip-derived" id="musicEstimate" title="Estimated for a song that runs to Max length, from M4 Max timings (a 3-minute song took about 3 minutes on Final) scaled for this chip. Most songs end sooner; the first song after install also loads the models."></span></div>
<div class="actions">
<button type="button" class="primary" id="musicGenBtn" onclick="musicGenerate()">Compose</button>
<button type="button" class="danger js-stop-btn" disabled data-role="stop-btn" onclick="requestStop()" title="Stop the current render">Stop</button>
</div>
<div class="hint" id="musicStatus" role="status"></div>
<div class="music-credit" id="musicHint">Generated with YuE2 by Multimodal Art Projection · MLX port by vanch007</div>
</div>
</div>
<div id="audioDrivePane">
<!-- ============== MUSIC VIDEO ================================
"I give it all the images, and then it creates a compelling video
out of them." The pieces were all here and none of them knew about
each other: a2v sings from one picture and one stretch of a
waveform, i2v moves a still, the beat map knows where the bars are,
and the Storyboard renders and assembles a list of shots. This pane
is the brief that joins them — the song, the pictures, and one line
about how it should look — and it ends by opening an ORDINARY
storyboard, because the first thing anybody wants after seeing a
shot list is to change shot 7.
The single-clip Audio -> Video form is untouched at the bottom,
inside "One shot": it is still the right tool for one talking head
and it is still the only way to drive a clip from a spoken take. -->
<div class="composer-card">
<div class="composer-refs">
<div class="show">
<h2>The song
<span class="h2-hint">drop a file, or pick one you have written</span>
</h2>
<div class="studio-ref-grid" style="grid-template-columns:1fr;">
<div class="studio-ref-slot" id="mvSongSlot" data-slot="song" style="aspect-ratio:auto;min-height:96px;">
<span class="ref-tag">Song</span>
<div class="hint" style="padding:24px 12px;text-align:center;color:var(--muted);font-size:12px;">
Drop a WAV / MP3 / M4A / FLAC here, or click to pick a file.
</div>
</div>
</div>
<input type="file" id="mvSongInput" accept=".wav,.mp3,.m4a,.flac,audio/*" style="display:none">
<div class="mf-cell" style="margin-top:10px">
<label class="mf-label" for="mvSongLibrary">Use a song from the library</label>
<select id="mvSongLibrary" onchange="mvPickFromLibrary(this.value)">
<option value="">Nothing composed yet</option>
</select>
<div class="hint" style="margin-top:4px">A song this panel wrote brings its own words and its own score, so the verses land where they really are instead of where the beat map guesses.</div>
</div>
</div>
</div>
<div class="composer-refs">
<div class="show">
<h2>The pictures
<span class="h2-hint">Singer sings to camera · Instrument and Room are the B-roll</span>
</h2>
<div class="picker">
<div class="picker-drop" id="mvImagesDrop">
<div class="picker-empty">
<div class="picker-icon"><svg class="ph"><use href="#ph-image"/></svg></div>
<div class="picker-cta">Drop your pictures here, or <strong>click to browse</strong></div>
<div class="hint">PNG / JPG / WEBP — as many as you like</div>
</div>
</div>
<input type="file" id="mvImagesFile" accept="image/*" multiple style="display:none">
</div>
<div class="mv-cast" id="mvCast"></div>
</div>
</div>
<div class="mf-cell" style="margin-top:6px">
<label class="mf-label" for="mvStyle">Look</label>
<input type="text" id="mvStyle" value="handheld 16mm documentary, warm tungsten light, shallow depth of field, MTV Unplugged">
<div class="hint" style="margin-top:4px">One line, on every shot. A picture with its own note below overrides only its own direction, never this.</div>
</div>
</div>
<div class="studio-status-row" style="margin: 6px 0 -4px;">
<span id="mvStatus" class="hint" role="status"></span>
</div>
<!-- FILM-12: shown only when the beat/vocal reader found no singing at
all despite a Singer picture being cast — one chip per detected
phrase, Vocal/Instrumental toggle, so the user marks the sung
parts instead of the plan silently going all-B-roll. -->
<div class="mv-sections" id="mvSections" hidden></div>
<div class="form-action-footer" id="mvFooter">
<div class="queue-strip">
<span class="qchip-spacer"></span>
<span class="qchip-derived" id="mvSummary"></span>
</div>
<div class="actions">
<button type="button" class="primary" id="mvPlanBtn" onclick="mvPlan()">Plan the video</button>
</div>
<div class="hint">Planning is instant and costs nothing — it reads the beat, writes the shot list, and opens it in Storyboard. Render all, then Film with the song.</div>
</div>
<details class="cz-section" id="mvOneShotDetails">
<summary class="cz-summary">
<!-- VA-01: renamed from "One shot (audio → video)" — that name
collided with the top-level One Shot tab (a different,
unrelated multi-part composer). The Lip-sync chip in the
Video mode bar opens this same section. -->
<span class="cz-title">Lip-sync (one clip, one audio track)</span>
<span class="cz-sum">a picture and a stretch of audio → one clip whose mouth follows the track</span>
</summary>
<div class="cz-body">
<!-- 4.19: which engine performs the track. LTX (the built-in a2v
pipeline) or Hailuo H3, which holds the supplied soundtrack and
renders the picture to it — face, body and room, with the
runner's own lip-sync contract. Hidden until the installed H3
runner can take a soundtrack (BOOT/status.h3.audio_drive). -->
<div class="a2v-engine" id="a2vEngineRow" hidden>
<span class="mf-label">Engine</span>
<div class="pill-group cols-2" id="a2vEngineGroup" role="radiogroup" aria-label="Lip-sync engine">
<button type="button" class="pill-btn active" role="radio" aria-checked="true" data-a2v-engine="ltx" onclick="setA2vEngine('ltx')">LTX<span class="sub">your audio drives the picture</span></button>
<button type="button" class="pill-btn" role="radio" aria-checked="false" data-a2v-engine="h3" onclick="setA2vEngine('h3')">Hailuo H3<span class="sub">performs it — face, body and room</span></button>
</div>
<div class="pill-group cols-3 a2v-h3-only" id="a2vH3QualityGroup" role="radiogroup" aria-label="Hailuo H3 canvas"></div>
<div class="hint a2v-h3-only" id="a2vH3Note">H3 keeps your track exactly as it is and renders the picture to it. Start on a closed-mouth, face-forward picture and say what the performance looks like — never "still" or "static".</div>
</div>
<div class="composer-card">
<div class="composer-refs">
<div class="show">
<h2>Audio
<span class="h2-hint">drives the generation · WAV / MP3 / M4A / FLAC</span>
</h2>
<div class="studio-ref-grid" style="grid-template-columns:1fr;">
<div class="studio-ref-slot" id="audioStudioAudioSlot" data-slot="audio" style="aspect-ratio:auto;min-height:96px;">
<span class="ref-tag">Audio</span>
<div class="hint" style="padding:24px 12px;text-align:center;color:var(--muted);font-size:12px;">
Drop a WAV / MP3 / M4A / FLAC here, or click to pick a file.
</div>
</div>
</div>
<input type="file" id="audioStudioAudioInput" accept=".wav,.mp3,.m4a,.flac,audio/*" style="display:none">
</div>
</div>
<div class="composer-refs">
<div class="show">
<h2>Reference image
<span class="h2-hint">optional · anchors frame 0 like I2V</span>
</h2>
<!-- Y2.005 — use the shared .picker component (same as I2V /
FFLF) instead of the bespoke studio-ref-slot. Mr Bizarro
report: "image preview and managing kinda shit in audio
to video make it like the others." The picker brings the
drop tile, big centered preview, X-clear button, and
Recent-uploads strip, all consistent with the rest of
the panel. Wired via pickerWire('a2v_image'). -->
<div class="picker" data-key="a2v_image">
<div class="picker-drop" id="picker_drop_a2v_image">
<div class="picker-empty">
<div class="picker-icon"><svg class="ph"><use href="#ph-image"/></svg></div>
<div class="picker-cta">Drop an image here, or <strong>click to browse</strong></div>
<div class="hint">PNG / JPG / WEBP — anchors frame 0 of the audio-driven clip</div>
</div>
<img class="picker-preview" id="picker_preview_a2v_image" alt="" style="display:none">
<!-- VA-02: same crop-preview overlay as I2V/H3's picker —
A2V's free-form Width/Height mean a picked photo can
still get cover-cropped even after snapA2VSizeToImage
matches its aspect (e.g. the user edits the fields
afterward), so the overlay and its drag position
apply here too. -->
<div class="crop-overlay" id="picker_crop_a2v_image" hidden></div>
<button type="button" class="picker-clear" id="picker_clear_a2v_image" title="Clear" style="display:none"><svg class="ph" aria-hidden="true"><use href="#ph-x-bold"/></svg></button>
</div>
<input type="file" id="picker_file_a2v_image" accept="image/*" style="display:none">
<input type="hidden" name="a2v_image" id="a2v_image" value="">
<input type="hidden" id="a2v_image_crop_focus" value="0.5">
<div class="crop-overlay-controls" id="picker_crop_controls_a2v_image" hidden></div>
<div class="picker-recent" id="picker_recent_a2v_image_wrap" style="display:none">
<div class="picker-recent-label">Recent uploads · click to use</div>
<div class="picker-recent-strip" id="picker_recent_a2v_image"></div>
</div>
</div>
<div class="hint" style="margin-top:6px">
Leave empty for pure Audio → Video. Add an image to open the clip on that frame (e.g. a portrait for a talking-head shot).
</div>
<!-- Open-mouth anchor check (2026-09-22 anchor lesson): a
strength-1.0 frame-0 anchor with the mouth already open
freezes the performance open-mouthed for the whole clip.
Populated by audioStudioMouthCheck() on every a2v_image
pick (queue.js's pickerSetImage calls it). -->
<div class="hint" id="audioStudioMouthWarn" style="margin-top:6px;display:none;color:var(--warn,#c98a2b)"></div>
<!-- VA-04: LoRAs picked on the Video tab ride into this render
with nothing on screen to say so — a face LoRA left over
from a character render quietly changed identity on a
lip-sync shot. This is the visibility line; the real
picker still lives on the Video tab (workflowSwitch below
opens it). Populated by audioStudioRenderLoraNote(). -->
<div class="hint" id="audioStudioLorasNote" style="margin-top:6px;display:none"></div>
</div>
</div>
<!-- VA-05: placeholder rewritten from a stillness-friendly scene
description ("shallow depth of field, natural skin pores") to
a PERFORMANCE prompt — direction the mouth, not the set. -->
<textarea id="audioStudioPrompt" class="composer-prompt" rows="4"
oninput="audioStudioPromptCheck()"
placeholder="A woman sings to camera, eyebrows lifting on the high notes, breathing between lines, one hand drifting up"></textarea>
<div class="composer-tools">
<button type="button" class="ghost-btn" id="audioStudioEnhanceBtn" onclick="audioStudioEnhancePrompt()" title="Use Gemma to rewrite your prompt"><svg class="ph" aria-hidden="true" style="margin-right:6px"><use href="#ph-sparkle-fill"/></svg>Enhance</button>
<span class="ct-spacer"></span>
<span class="hint">Keep it under ~40 words and describe the performance — a sync sentence is appended automatically.</span>
</div>
<!-- VA-05 (client half): live stillness check. The server ALWAYS
strips these words and appends the sync contract before a
render (a2v_prompt in run_job_inner), so this is purely a
heads-up + one-click fix, not the safety net itself. -->
<div class="hint" id="audioStudioPromptWarn" style="margin-top:6px;display:none;color:var(--warn,#c98a2b)"></div>
</div>
<div class="studio-status-row" style="margin: 6px 0 -4px;">
<span id="audioStudioStatus" class="hint"></span>
</div>
<!-- Quick settings: width / height / duration / seed.
Width/height are free-form; the panel snaps to 32 px multiple.
Duration slider covers 1–30 s; JS rounds frames to 8k+1. -->
<div class="quick-settings">
<div>
<div class="mini-fields">
<div class="mf-cell a2v-ltx-only">
<span class="mf-label">Width</span>
<input type="number" id="audioStudioWidth" value="1024" min="256" max="1920" step="32"
oninput="audioStudioDurationChanged()">
</div>
<div class="mf-cell a2v-ltx-only">
<span class="mf-label">Height</span>
<input type="number" id="audioStudioHeight" value="576" min="256" max="1920" step="32"
oninput="audioStudioDurationChanged()">
</div>
<div class="mf-cell">
<span class="mf-label">Seed</span>
<input type="number" id="audioStudioSeed" value="-1" placeholder="-1 = random">
</div>
<!-- Start offset into the source file. The pipelines and the render
helper have always taken this; the panel had no control for it,
so every A2V render used the first N seconds of the file and the
only workaround was trimming the audio beforehand (#46). -->
<div class="mf-cell">
<span class="mf-label">Start at</span>
<input type="number" id="audioStudioStart" value="0" min="0" step="0.5"
oninput="audioStudioDurationChanged()"
title="Seconds into the audio file where the clip starts reading. 0 = from the beginning.">
</div>
</div>
<div class="hint" style="margin-top:4px">
Start at is an offset into the file you loaded — set it to 30 to drive the clip from 0:30 onward.
</div>
<!-- VA-21: the server has taken audio_stem_auto since the vocal
stem seam landed — drums/bass/guitar reach the mouth as
hedged, constant motion; a separated vocal doubled how much
a measured clip's mouth moved. The manual form never
exposed a control for it. Default ON: a song is the common
case this helps. Install and Update put the separator in
place; if it is missing the render is refused with an
install offer, never quietly run on the full mix. -->
<label class="mf-cell" style="margin-top:8px;display:flex;align-items:center;gap:8px;cursor:pointer;">
<input type="checkbox" id="audioStudioStemAuto" checked style="width:auto;margin:0;" onchange="audioStudioRenderSeparator()">
<span>Listen to the voice only <span class="hint" style="font-weight:normal">(separates the singer from the band before the model listens — the finished clip still plays the full mix; about 20 s once per song)</span></span>
</label>
<!-- Never a silent fallback: when vocal separation is missing the
form says so here and offers the install (/a2v/separator). -->
<div class="music-pack-note" id="audioStudioStemStatus" role="status" style="margin-top:6px;display:none"></div>
<div id="audioStudioSceneSoundPanel" class="mf-cell">
<label class="scene-sound-toggle"><input type="checkbox" id="audioStudioSceneSound" onchange="audioStudioDurationChanged()">
<span>Add scene sound <span class="hint">(ambience and effects from your scene; lowers under the voice)</span></span>
</label>
<p class="hint">Adds a sound-generation pass. Turn off for voice only. Describe what we hear below, or leave blank to use the scene prompt.</p>
<input type="text" id="audioStudioScenePrompt" aria-label="Scene sound description" placeholder="Wind in the sails, creaking wood, a distant waterfall">
</div>
<div class="mf-cell" style="margin-top:8px">
<span class="mf-label">Duration</span>
<div class="range-strip">
<input type="range" id="audioStudioDuration" min="1" max="30" step="1" value="7"
oninput="audioStudioDurationChanged(this.value)">
<span id="audioStudioDurationVal" class="range-val">7 s</span>
</div>
<!-- Length warning. Deliberately a warning and NOT a hard cap: the
evidence for where A2V gives out is two independent field
reports converging on ~257 frames (#46 — @blackest hit it here
and on a separate MLX pipeline), not a measurement made here,
and the diagnostic that would tell us whether it is a length
ceiling at all is still outstanding. Silently deleting 11-30 s
from the slider would be asserting a number nobody has measured.
Showing the frame count and the reported wall lets the user
decide with the same information the maintainer has. -->
<div class="hint" id="audioStudioDurationWarn" style="margin-top:4px; display:none"></div>
</div>
<div class="mf-cell a2v-ltx-only" style="margin-top:8px">
<span class="mf-label">Audio conditioning strength</span>
<!-- Starts on AUTO and stays there until the thumb is dragged:
the two A2V pipelines read this number differently and only
the panel knows which one this Mac will run, so an untouched
control must send NOTHING rather than a number that means
"audio off" on one lane and "audio on" on the other. -->
<div class="range-strip">
<input type="range" id="audioConditioningScale" min="0.5" max="5.0" step="0.1" value="3.0"
data-auto="1" oninput="audioConditioningScaleChanged(this)">
<span id="audioConditioningScaleVal" class="range-val">Auto</span>
</div>
<div class="hint" style="margin-top:2px" id="audioConditioningScaleHint">Higher = stronger audio adhesion, lower visual flexibility</div>
</div>
</div>
</div>
<div class="hint" style="margin-top:8px" id="audioStudioHint">
Audio → Video uses audio conditioning during generation (not post-hoc mux). If the mouth doesn't move: (1) start on a closed-mouth, face-forward picture — an open-mouth anchor tends to freeze open (the panel warns when it detects one); (2) remove "static" / "holds still" / "motionless" language from the prompt — a stillness word freezes the whole scene, mouth included; (3) for a song, try the vocal-only option so the model listens to the voice instead of the full mix.
</div>
<div class="form-action-footer" id="audioStudioFooter">
<div class="queue-strip">
<span class="qchip-spacer"></span>
<span class="qchip-derived" id="audioStudioEstimate"></span>
</div>
<div class="actions">
<!-- VA-07: Draft renders the first ~3s of the chosen window at
the SAME settings (seed resolved and locked into the Seed
field above) — about 3 min to answer "does this picture and
prompt move the mouth?" instead of the full 10-25.
Generate (Final) reuses that seed at the full duration the
slider still shows. -->
<button type="button" class="ghost-btn" id="audioStudioDraftBtn" onclick="audioStudioGenerate({draft:true})" title="Render the first ~3 seconds only, at the same settings — check the mouth before committing to the full clip.">Draft (~3s)</button>
<button type="button" class="primary" id="audioStudioGenBtn" onclick="audioStudioGenerate()">Generate</button>
<!-- VA-30: Stop also breaks the "Split into clips" loop before it
queues its next part — a plain /stop kills the current
render but the client-side loop would otherwise queue the
next one regardless. requestStop (VC-05) keeps its confirm and
calls onStop only when the user actually stops. -->
<button type="button" class="danger js-stop-btn" disabled data-role="stop-btn" onclick="requestStop({onStop: audioStudioSplitCancel})" title="Stop the current render">Stop</button>
</div>
</div>
</div>
</details>
</div>
</div>
<!-- ============== THE MEDIA POOL — the Editor's left column ==========
What replaced a window.prompt(). Until Wave 1 the only way to bring a
clip into a cut was a native text box asking the user to type the
NUMBER of a film from a numbered list — while the outputs gallery,
which holds every clip this panel has ever made, was display:none for
the whole surface. The owner's ask was one sentence: "pick from the
generations whatever you want."
Three sources, one verb. Clicking a row puts the clip on the END of
the track, builds its proxy, saves, and leaves you exactly where you
were. Drag is Wave 2; click is the floor. -->
<div id="edSectionTab" style="display:none">
<header class="carousel-head ed-pool-head">
<h3>Media pool</h3>
<span class="ch-spacer"></span>
<!-- BRING YOUR OWN. A title card, a logo, a phone clip — the pool
showed everything the panel MADE and nothing the user already
had. The input is hidden because a bare file input cannot be
styled to look like anything else in this panel; the button is
the control. Shown on the Images source, which is where what it
uploads appears. -->
<input type="file" id="edPoolFile" multiple hidden
accept=".png,.jpg,.jpeg,.webp,.mp4,.mov,.m4v,.webm"
onchange="edPoolUpload(this.files); this.value = '';">
<button type="button" class="ghost-btn" id="edPoolUploadBtn" hidden
onclick="document.getElementById('edPoolFile').click()"
title="Add a picture or a clip from this Mac. Pictures land as stills, clips land as clips.">Upload</button>
<button type="button" class="ghost-btn" id="edPoolRefreshBtn"
onclick="edPoolRefresh(true)" title="Re-read the clips on disk">Refresh</button>
</header>
<!-- 4.17: the five sources used to be five pill buttons in one
non-wrapping row (FILM-37); in the ~260 px pool they clipped into
each other at 1280-1440 px ("s Sequer ır sequer…"). One labelled
select fits every width and still names every source in full. -->
<div class="ed-pool-tabs" id="edPoolTabs">
<label class="ed-pool-src-label" for="edPoolSrcSelect">Show</label>
<select id="edPoolSrcSelect" class="ed-pool-src" onchange="edPoolSrc(this.value)"
aria-label="Which clips the media pool shows">
<option value="film" data-src="film" selected>This __SEQCAP__</option>
<option value="other" data-src="other">Other __SEQS__</option>
<option value="gallery" data-src="gallery">Generations</option>
<!-- IMAGES. The gallery has always held them — the image queue drops
every render into panel_uploads/library/manual — and until a clip
could be a STILL there was nothing a timeline could do with one. -->
<option value="images" data-src="images">Images</option>
<!-- SOUND. Laugh tracks, stings, beds: this film's audio/ folder and
every sound file in the outputs, for the audio tracks. -->
<option value="sound" data-src="sound">Sound</option>
</select>
</div>
<!-- BLACK IS NOT SOMETHING YOU PICK FROM A LIST. It has no file, so it
has no row; it is made, with a length, which is its only property. -->
<div class="ed-pool-make">
<input type="number" class="sb-input" id="edSlugSecs" value="2.0"
min="0.2" max="60" step="0.5" aria-label="Seconds of black">
<button type="button" class="ghost-btn" id="edAddSlugBtn"
onclick="edAddSlug()"
title="Black, for as long as you say. No file, no proxy — it is drawn by the render.">Add black</button>
<!-- A TITLE IS MADE THE SAME WAY BLACK IS: it has no file, so it has
no row. It lands on the overlay lane at the playhead, selected,
with its text ready to type in the inspector. -->
<button type="button" class="ghost-btn" id="edAddTitleBtn"
onclick="edAddTitle()"
title="Text over the picture, on the overlay lane at the playhead. Type it in the inspector; it is drawn by the render.">Add title</button>
</div>
<!-- ROOM TONE. "The cuts are very rough in terms of sound." A bed under
the whole film, made for this film (or from a preset), on its own
audio track. Shown on the Sound tab only; painted by edRtPaint. -->
<section class="ed-rt" id="edRoomTone" hidden aria-labelledby="edRtTitle">
<div class="ed-rt-head">
<span class="ed-rt-title" id="edRtTitle">Room tone</span>
<span class="ed-rt-status" id="edRtStatus"></span>
</div>
<p class="ed-rt-sub">Background noise under the whole __SEQ__, so cuts never drop to silence.</p>
<select class="sb-input ed-rt-pick" id="edRtVariant" aria-label="Which room tone"
onchange="edRtPick()"></select>
<label class="ed-rt-level" title="How loud the bed plays, in LUFS. Dialogue sits around −16; −38 is a bed you stop hearing, −27 is clearly there. The render applies exactly this.">
<span>Level</span>
<input type="range" id="edRtLevel" min="-60" max="-18" step="1" value="-38"
aria-label="Room tone level in LUFS"
oninput="edRtLevelSlide(this.value)" onchange="edRtLevelCommit(this.value)">
<output id="edRtLevelOut">−38 LUFS</output>
</label>
<div class="ed-rt-acts">
<button type="button" class="ghost-btn primary" id="edRtAdd" onclick="edRtApply('apply')">Add room tone</button>
<button type="button" class="ghost-btn" id="edRtTake" hidden onclick="edRtApply('take')"
title="Another version of the same sound — a new take every click">New take</button>
<button type="button" class="ghost-btn" id="edRtRemoveBtn" hidden onclick="edRtRemove()"
title="Take the room tone off this __SEQ__. Undo brings it back.">Remove</button>
</div>
<p class="ed-rt-note" id="edRtNote" hidden></p>
<label class="check ed-rt-auto" title="When the Editor cuts a __SEQ__ by itself (first open, Re-cut, Storyboard's automatic film) it lays a room tone made from the __SEQ__'s own clips.">
<input type="checkbox" id="edRtAutoBox" onchange="edRtAuto(this.checked)">
<span>Add room tone to automatic cuts</span>
</label>
</section>
<select class="sb-input ed-pool-film" id="edPoolFilm" hidden
onchange="edPoolPickFilm(this.value)"
aria-label="Which __SEQ__ to take clips from"></select>
<input type="text" class="sb-input ed-pool-search" id="edPoolSearch" data-shortcut="search.focus" title="Filter the media pool by name"
spellcheck="false" placeholder="Filter by name"
oninput="edPoolPaint()">
<div class="ed-pool-list" id="edPoolList"></div>
<div class="ed-pool-note" id="edPoolNote"></div>
</div>
</aside>
<!-- ============== STAGE PANE: PLAYER + CAROUSEL ============== -->
<!-- REDESIGN — Y2.001 stage-pane.
Replaces the legacy "video → meta strip → header → two filter rows
→ carousel" stack with a composer-grade layout that mirrors the
form-pane redesign: one elevated player surface with overlaid
chrome, a single combined filter row, and richer carousel cards
whose chrome lives on hover. All legacy IDs/handlers preserved
(#playerWrap, #playerMeta, #playerName, #loadParamsBtn,
#useAsExtendBtn, #animateBtn, #carousel, #carouselTitle,
#mainOutputsFilter*) so the JS layer keeps working unchanged.
(#filterAll/#filterHidden retired with the Visible/Hidden
segmented control — orphan textContent/setFilter calls removed.) -->
<section class="stage-pane">
<!-- ============== THE RAIL ==================================
Four steps, one place, every screen that has a board open —
ABOVE the player, first thing in the pane, because this is the
navigation and the video is the content. It lived inside
#sbStage (the slot BELOW the player) and the owner read that,
correctly, as the menu jumping underneath the example video.
Shown only while the storyboard workflow is active, so
"where am I / what is next / how do I get to the editor" has one
answer instead of none. Painted by sbRailPaint() from sbRailModel(),
which is pure and under test. -->
<nav class="sb-rail" id="sbRail" hidden aria-label="This film, step by step">
<button type="button" class="sb-rail-back" onclick="sbBackToList()"
title="Every storyboard on this Mac">All storyboards</button>
<button type="button" class="sb-rail-step" data-step="plan" onclick="sbGo('plan')">
<span class="sb-rail-n">1</span><span class="sb-rail-t">Plan</span>
<span class="sb-rail-sub" data-sub="plan"></span></button>
<span class="sb-rail-sep" aria-hidden="true"></span>
<button type="button" class="sb-rail-step" data-step="shots" onclick="sbGo('shots')">
<span class="sb-rail-n">2</span><span class="sb-rail-t">Shots</span>
<span class="sb-rail-sub" data-sub="shots"></span></button>
<span class="sb-rail-sep" aria-hidden="true"></span>
<button type="button" class="sb-rail-step" data-step="edit" onclick="sbGo('edit')">
<span class="sb-rail-n">3</span><span class="sb-rail-t">Edit</span>
<span class="sb-rail-sub" data-sub="edit"></span></button>
<span class="sb-rail-sep" aria-hidden="true"></span>
<button type="button" class="sb-rail-step" data-step="film" onclick="sbGo('film')">
<span class="sb-rail-n">4</span><span class="sb-rail-t">Film</span>
<span class="sb-rail-sub" data-sub="film"></span></button>
</nav>
<!-- Ideogram Layout editor: the placement canvas (#ideoStageWrap) portals
into #ideoCanvasHost here in the big right column, and the Edit/Result
toggle flips between the canvas and the rendered output. Both are
display:none until body gets .ideo-canvas-on (set by ideoSyncStage). -->
<div class="ideo-stage-bar" id="ideoStageBar">
<div class="isb-group" role="group" aria-label="Add to canvas">
<button type="button" class="isb-btn" onclick="ideoInsertBox('text')" title="Add a text box (or drag on an empty area of the frame)">+ Text</button>
<button type="button" class="isb-btn" onclick="ideoInsertBox('obj')" title="Add an object region (something the model should draw)">+ Object</button>
</div>
<label class="isb-toggle" title="Snap boxes to thirds / center / other boxes">
<input type="checkbox" id="ideoSnapToggleStage" checked onchange="ideoState.snap=this.checked">
<span>Snap</span>
</label>
<button type="button" class="isb-btn" id="ideoUndoBtnStage" onclick="ideoUndo()" title="Undo (Cmd/Ctrl+Z)" disabled>Undo</button>
<select id="ideoExamplePickerStage" class="isb-select" onchange="ideoLoadExample(this.value); this.value='';" title="Load an example layout">
<option value="">Examples…</option>
<option value="poster">Poster — 16:9 event</option>
<option value="logo">Logo — 1:1 wordmark</option>
<option value="label">Product label — 9:16</option>
<option value="meme">Meme — 1:1 top/bottom</option>
</select>
<span class="isb-spacer"></span>
<div class="stage-mode-toggle" id="stageModeToggle" role="group" aria-label="Stage view">
<button type="button" class="smt-btn active" data-stage-mode="edit" onclick="stageSetMode('edit')">Edit canvas</button>
<button type="button" class="smt-btn" data-stage-mode="result" onclick="stageSetMode('result')">Result</button>
</div>
</div>
<div class="ideo-canvas-host" id="ideoCanvasHost">
<div class="ideo-canvas-empty" id="ideoCanvasEmpty">
<svg width="40" height="40" viewBox="0 0 56 56" fill="none" aria-hidden="true">
<rect x="8" y="12" width="40" height="32" rx="3" stroke="currentColor" stroke-width="1.5" stroke-opacity="0.4"/>
<path d="M16 30 L24 22 L34 32 L40 26" stroke="currentColor" stroke-width="1.5" stroke-opacity="0.4" fill="none"/>
</svg>
<div>Pick <strong>Layout</strong> on the left to place words on the frame.</div>
</div>
</div>
<!-- Player surface — the hero. Holds the <video>/<img>, the filename
overlay (top), the action overlay (top-right), and an inline
job-progress overlay (bottom) when something is rendering. The
#playerMeta strip is preserved as a hidden a11y/data slot so
legacy callers that read its IDs (selectOutput updates them)
still find them — but it's never shown. -->
<div class="player-surface">
<div class="player-wrap empty" id="playerWrap">
<div class="ps-empty">
<div class="ps-empty-icon" aria-hidden="true">
<svg width="56" height="56" viewBox="0 0 56 56" fill="none">
<circle cx="28" cy="28" r="22" stroke="currentColor" stroke-width="1.5" stroke-opacity="0.35"/>
<path d="M23 19 L37 28 L23 37 Z" fill="currentColor" fill-opacity="0.45"/>
</svg>
</div>
<div class="ps-empty-title">No outputs yet</div>
<div class="ps-empty-sub">Generate something on the left and the result lands here.</div>
</div>
</div>
<!-- Top overlay: filename + relative time + size. Hidden until an
output is selected; shown by selectOutput(). -->
<div class="player-overlay-top" id="playerOverlayTop" style="display:none">
<div class="po-name" id="playerOverlayName"></div>
<div class="po-meta" id="playerOverlayMeta"></div>
</div>
<!-- Top-right action cluster. Icon buttons with tooltips replace
the old text-button row. Each carries a data-action attribute
that the old IDs alias to, so legacy code touching them keeps
working (loadParamsBtn.disabled, animateBtn.style.display,
useAsExtendBtn.style.display all still apply). -->
<div class="player-overlay-actions" id="playerOverlayActions" style="display:none">
<!-- Draft → Finish — "same length, HIGHER QUALITY". One slot, BOTH
engines (VC-18/37): _syncFinishAffordance() (queue.js) re-points
this button's onclick/select's onchange to the H3 or LTX
implementation depending on the selected clip's o.engine, and
hides the whole control for anything neither engine can finish.
Hidden for every clip that has no canvas above the one it was
rendered on. It used to be gated on a `draft` flag, which under
fixed tiers meant a Standard 10 s clip could never be committed
to High; with Quality and Length as independent axes the offer
is coherent on any rung but the top.
Leads the cluster because on a draft it IS the action.
Wired exactly like Params/Extend: read the clip's sidecar,
restore it into #genForm, submit through the one submit path —
the difference is that ONLY the quality is swapped on the way in
and the seed is pinned to the clip's ACTUAL seed_used, so the
finish render is the same shot, longer-lived, rather than a new
roll of the dice at a length nobody asked to change.
The label carries the target cell's own `eta`. -->
<div class="po-finish" id="h3FinishWrap" style="display:none">
<button id="h3FinishBtn" class="po-act po-act-finish" type="button"
onclick="h3FinishActive()">
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" aria-hidden="true">
<path d="M8 2 L9.6 6.4 L14 8 L9.6 9.6 L8 14 L6.4 9.6 L2 8 L6.4 6.4 Z"
stroke="currentColor" stroke-width="1.3" stroke-linejoin="round" fill="none"/>
</svg>
<span class="po-act-label" id="h3FinishLabel">Finish</span>
</button>
<select id="h3FinishTier" class="po-finish-select"
title="Pick the quality to finish at — the length stays this clip's"
onchange="h3FinishSetTier(this.value)"></select>
</div>
<!-- NEW TAKE (VC-03) — "I like this, give me another" in one click:
same recipe, fresh seed, queued at once. Leads Params because
it's the more common gesture; Params is for editing before a
re-roll, this is for not editing at all. Shortcut: R. -->
<button id="newTakeBtn" class="po-act" type="button"
onclick="newTakeActive()" title="Queue another take — same prompt, size, quality and LoRAs, a fresh seed" disabled>
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" aria-hidden="true">
<path d="M8 3 A5 5 0 1 1 3.5 5.5 M3.5 2 V5.5 H7" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" fill="none"/>
</svg>
<span class="po-act-label">New take</span>
</button>
<button id="loadParamsBtn" class="po-act" type="button"
onclick="loadParams()" title="Load this clip's render params back into the form" disabled>
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" aria-hidden="true">
<path d="M3 8 L8 13 L13 8 M8 3 L8 13" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
<span class="po-act-label">Params</span>
</button>
<button id="useAsExtendBtn" class="po-act" type="button"
onclick="useAsExtendSource()" title="Use this clip as the source for an Extend job">
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" aria-hidden="true">
<path d="M3 8 L13 8 M9 4 L13 8 L9 12" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
<span class="po-act-label">Extend</span>
</button>
<!-- 4.19: Add sound — Hailuo H3 scores the clip on screen (its
picture is kept exactly). Shown only when the installed H3 runner
can (queue.js toggles it with the other player actions). -->
<button id="addSoundBtn" class="po-act" type="button" style="display:none"
onclick="useAsAddSoundSource()" title="Give this clip new sound made for its picture, with Hailuo H3 — the picture is kept exactly as it is">
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" aria-hidden="true">
<path d="M2.5 6.5 H5 L8.5 3.5 V12.5 L5 9.5 H2.5 Z" stroke="currentColor" stroke-width="1.4" stroke-linejoin="round"/>
<path d="M11 6 Q12.5 8 11 10 M12.8 4.5 Q15.4 8 12.8 11.5" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/>
</svg>
<span class="po-act-label">Add sound</span>
</button>
<!-- VA-36 / "Continue the song": on a lip-sync (a2v) clip, Extend
regenerates LTX's own joint audio over the new frames — a
singing shot would "continue" with invented gibberish instead
of the next stretch of the actual song. This button replaces
Extend for a2v clips only (queue.js's player-render code
toggles which of the two shows). It opens the next lip-sync
job anchored on THIS clip's most-closed-mouth frame near its
end (see /a2v/continue_song), with Start at moved forward to
match — not a literal "continue the video", a new render. -->
<button id="continueSongBtn" class="po-act" type="button" style="display:none"
onclick="continueSongFromClip(activePath)" title="Start the next lip-sync clip where this one's song leaves off — anchored on this clip's most-closed-mouth frame near the end.">
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" aria-hidden="true">
<path d="M3 8 L13 8 M9 4 L13 8 L9 12" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<circle cx="4" cy="12.5" r="1" fill="currentColor"/>
</svg>
<span class="po-act-label">Continue the song</span>
</button>
<!-- VA-26: "Retake a moment" — regenerate one interior stretch of
this clip while the rest is preserved. The engine's own
RetakePipeline (Extend's backend) exposed as a player action
for the first time; opens a small form (retakeModal) rather
than a scrubber drag-select, which this session didn't build. -->
<!-- VA-38: a Windows chain that failed partway used to leave only
hidden working files behind. This clip IS the visible,
labelled partial join (see _publish_windows_partial); the
button hands it to Extend as the source for the rest —
reusing Extend's already-proven path rather than a byte-exact
re-entry into the original chain plan. -->
<button id="windowsContinueBtn" class="po-act" type="button" style="display:none"
onclick="windowsContinueFromPartial(activePath)" title="This clip is what finished before the Windows chain failed. Continue it as an Extend.">
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" aria-hidden="true">
<path d="M3 8 L13 8 M9 4 L13 8 L9 12" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
<span class="po-act-label" id="windowsContinueLabel">Continue from here</span>
</button>
<button id="retakeBtn" class="po-act" type="button" style="display:none"
onclick="openRetakeModal(activePath)" title="Regenerate one stretch of this clip; everything outside it is kept.">
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" aria-hidden="true">
<path d="M3 3 v4 h4 M13 13 v-4 h-4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M3.5 9.5 a5.5 5.5 0 0 0 9.5 3.3 M12.5 6.5 a5.5 5.5 0 0 0 -9.5 -3.3" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
</svg>
<span class="po-act-label">Retake a moment</span>
</button>
<!-- Upscale & Face Fix — ONE CLICK queues the face-safe 2× of this
clip (a new file lands next to it). The ⋯ half opens the full
lane (Remix → Upscale & Face Fix) for presets and the prompt.
Video-only; the natural next step after an H3 draft. -->
<div class="po-split" id="faceFixWrap">
<button id="faceFixBtn" class="po-act po-split-main" type="button"
onclick="faceFixActive()" title="Queue Upscale & Face Fix for this clip: twice the size with LTX-2.5 detail, the face and the sound kept. The fixed clip lands next to this one — nothing is overwritten.">
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" aria-hidden="true">
<path d="M3 13 L13 3 M8 3 L13 3 L13 8 M3 8 L3 13 L8 13" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
<span class="po-act-label">Upscale & Face Fix</span>
</button>
<button id="useAsUpscaleBtn" class="po-act po-split-more" type="button"
onclick="useAsUpscaleSource()" aria-label="Upscale & Face Fix settings"
title="Upscale & Face Fix settings — open this clip in Remix to pick a preset (Face Fix, Faithful, Quick, Re-imagine) or edit the prompt first.">
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" aria-hidden="true">
<path d="M3 5 H13 M3 11 H13" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
<circle cx="6" cy="5" r="1.6" fill="var(--panel, #111)" stroke="currentColor" stroke-width="1.3"/>
<circle cx="10.5" cy="11" r="1.6" fill="var(--panel, #111)" stroke="currentColor" stroke-width="1.3"/>
</svg>
</button>
</div>
<!-- VC-18/37: secondary clip actions that don't earn a permanent icon
slot — Sharp export (re-run the ANE upscaler on a clip already
liked, no re-render), Use last frame (seed a fresh i2v roll from
where this take ended), Open in Editor, Reveal in Finder, Share. One
popover, video-only (CSS/JS hide it for stills and audio). -->
<div class="kebab-wrap" id="playerMoreWrap">
<button id="playerMoreBtn" class="po-act" type="button"
onclick="kebabToggle('playerMorePop')" aria-haspopup="true"
title="More actions for this clip">
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" aria-hidden="true">
<circle cx="3" cy="8" r="1.4" fill="currentColor"/>
<circle cx="8" cy="8" r="1.4" fill="currentColor"/>
<circle cx="13" cy="8" r="1.4" fill="currentColor"/>
</svg>
<span class="po-act-label">More</span>
</button>
<div class="kebab-pop" id="playerMorePop" role="menu">
<button type="button" role="menuitem" onclick="kebabToggle('playerMorePop',false);sharpExportActive()"
title="Re-run the Neural-Engine sharpen (PiperSR) on this clip — a new, crisper file lands next to it">
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" aria-hidden="true"><path d="M8 2 L9.6 6.4 L14 8 L9.6 9.6 L8 14 L6.4 9.6 L2 8 L6.4 6.4 Z" stroke="currentColor" stroke-width="1.2" stroke-linejoin="round" fill="none"/></svg>
Sharp export
</button>
<button type="button" role="menuitem" onclick="kebabToggle('playerMorePop',false);useLastFrameActive()"
title="Extract this clip's last frame and start a fresh i2v render from there">
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" aria-hidden="true"><rect x="2.5" y="3" width="11" height="10" rx="1.3" stroke="currentColor" stroke-width="1.2"/><path d="M2.5 10 L6 7 L9 9.5 L13.5 5.5" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/></svg>
Use last frame
</button>
<button type="button" role="menuitem" onclick="kebabToggle('playerMorePop',false);openActiveInEditor()"
title="Add this clip to a film and open it in the Editor">
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" aria-hidden="true"><path d="M3 12 L4 9 L11 2 L14 5 L7 12 L4 13 Z" stroke="currentColor" stroke-width="1.2" stroke-linejoin="round"/></svg>
Open in Editor
</button>
<button type="button" role="menuitem" onclick="kebabToggle('playerMorePop',false);revealActive()"
title="Show this file in Finder">
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" aria-hidden="true"><path d="M2 5 a1 1 0 0 1 1-1 h3 l1.2 1.6 H13 a1 1 0 0 1 1 1 V12 a1 1 0 0 1-1 1 H3 a1 1 0 0 1-1-1 Z" stroke="currentColor" stroke-width="1.2" stroke-linejoin="round"/></svg>
Reveal in Finder
</button>
<button type="button" role="menuitem" onclick="kebabToggle('playerMorePop',false);shareActive()"
title="Copy a one-line caption with the Phosphene link and select this file in Finder, ready to post">
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" aria-hidden="true"><path d="M8 2 V10 M5 5 L8 2 L11 5" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/><path d="M3 8.5 V13 a1 1 0 0 0 1 1 H12 a1 1 0 0 0 1-1 V8.5" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/></svg>
Share
</button>
</div>
</div>
<!-- Pull a good accident from the Video tab into a film. Hidden until
at least one board exists on disk — nothing about Storyboard shows
up in the rest of the panel until there is a film to show it for. -->
<button id="sbAddBtn" class="po-act" type="button" onclick="sbAddActiveToBoard()"
style="display:none" title="Add this clip to a storyboard as a shot">
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" aria-hidden="true">
<path d="M2 4 H14 M2 8 H14 M2 12 H9" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
</svg>
<span class="po-act-label">To film</span>
</button>
<select id="sbAddSelect" class="po-finish-select" style="display:none"
title="Which film should this clip join?"
onchange="sbAddActiveToBoard(this.value)"></select>
<button id="animateBtn" class="po-act" type="button"
onclick="animateActive()" style="display:none" title="Animate this still as an i2v render">
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" aria-hidden="true">
<path d="M5 3 L13 8 L5 13 Z" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round" fill="none"/>
</svg>
<span class="po-act-label">Animate</span>
</button>
<!-- STORYBOARD ONLY. The shot list is the storyboard tab's primary surface and
the player is a guest on it, so the guest carries the way out — reported by
cocktailpeanut: "i can't seem to find a way to hide this preview video and
it's just blocking everything". The Shot list / Player toggle below the
player already did this, but nobody looks under the thing they want gone;
the control belongs ON it. CSS keeps this hidden everywhere else, because on
the Video and Images tabs the player IS the primary surface and a close there
would orphan the tab. -->
<button id="sbCollapsePlayerBtn" class="po-act po-act-sbclose" type="button"
onclick="sbSetStage('list')" title="Hide the preview and show the shot list (Esc)">
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" aria-hidden="true">
<path d="M4 4 L12 12 M12 4 L4 12" stroke="currentColor" stroke-width="1.5"
stroke-linecap="round"/>
</svg>
<span class="po-act-label">Hide preview</span>
</button>
<button id="expandBtn" class="po-act" type="button"
onclick="openExpandLightbox()" title="Expand to fullscreen — Esc closes it" data-shortcut="outputs.expand">
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" aria-hidden="true">
<path d="M3 6 V3 H6 M10 3 H13 V6 M13 10 V13 H10 M6 13 H3 V10"
stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
<span class="po-act-label">Expand</span>
</button>
<button class="po-act po-act-danger" type="button"
onclick="hideActive()" title="Hide this output from the gallery — it stays on disk, and there's an Undo right after, plus a Hidden view to bring it back later">
<svg width="14" height="14" viewBox="0 0 16 16" fill="none" aria-hidden="true">
<path d="M2 8 C 4 4, 12 4, 14 8 C 12 12, 4 12, 2 8 Z M5 5 L11 11" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
<span class="po-act-label">Hide</span>
</button>
</div>
<!-- This chip appears only when a clip is being watched while another
take is forming. It is the explicit way back; the poll never yanks a
playing clip out from under the viewer. -->
<button type="button" class="live-return-chip" id="liveReturnChip" hidden
onclick="returnToLiveRender()">LIVE · return to render</button>
<!-- VA-17 / H3-11: a One Shot that stopped or failed mid-chain keeps its
finished parts un-hidden and one of them (the last) carries the
resume manifest. Shown only for that specific card, over the player
so it's impossible to miss on the clip it applies to. -->
<div class="one-shot-recovery-bar" id="oneShotRecoveryBar" hidden>
<span id="oneShotRecoveryText"></span>
<button type="button" class="ghost-btn" data-action="take-join-partial">Join what's done</button>
<button type="button" class="primary" data-action="take-resume">Resume</button>
</div>
<!-- Full-size live state. It reads the same progress object as #nowCard
and adds no polling. Hidden whenever the finished-output player is
visible, so it cannot repeat the old overlay-over-playback mistake. -->
<div class="live-stage-overlay" id="liveStageOverlay" hidden>
<span class="live-stage-badge" id="liveStageBadge">LIVE</span>
<div class="live-stage-copy">
<div class="live-stage-title" id="liveStageTitle">forming take</div>
<div class="live-stage-eta" id="liveStageEta"></div>
</div>
<button type="button" class="live-stage-stop" id="liveStageStop"
onclick="stopEarly()" hidden>Stop early</button>
</div>
</div>
<!-- 4.18.0: "Use this audio for…" — one menu for every audio output
(the card's Use… chip and the player's button). Filled and placed by
openAudioUseMenu() in queue.js. -->
<div class="song-menu" id="audioUseMenu" hidden role="menu" aria-label="Use this audio for"></div>
<!-- Expand lightbox: full-viewport overlay shared by image + video.
Opens via the Expand button on the player overlay actions, or by
pressing F when an output is selected. Click outside the media or
press Esc to close. -->
<div class="expand-lightbox" id="expandLightbox" style="display:none"
onclick="if(event.target===this)closeExpandLightbox()">
<button class="expand-close" type="button" onclick="closeExpandLightbox()" title="Close (Esc)">
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" aria-hidden="true">
<path d="M5 5 L15 15 M15 5 L5 15" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
</svg>
</button>
<div class="expand-stage" id="expandStage"></div>
<div class="expand-meta" id="expandMeta"></div>
<!-- VC-18/37: the same clip actions as the toolbar's "More" menu,
rendered flat (no popover needed — there's already room) since
the lightbox is the expanded, full-attention view. Filled by
openExpandLightbox() for video only. -->
<div class="expand-actions" id="expandActions"></div>
<!-- 4.18.0 — Play all: the gallery plays by itself (each clip once, a
photo for the chosen time, a song to its end), in the gallery's
own order. Wired by lbTogglePlayAll() & co in queue.js; fades
while playing and the mouse rests (.is-idle). -->
<div class="expand-progress" id="expandProgress" hidden aria-hidden="true"></div>
<div class="expand-bar" id="expandBar" role="toolbar" aria-label="Play the gallery">
<button type="button" class="expand-bar-btn" onclick="lbStep(-1)" title="Previous (←)" aria-label="Previous output">
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><path d="M10 3 L5 8 L10 13" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/></svg>
</button>
<button type="button" class="expand-bar-btn expand-play" id="expandPlayBtn" onclick="lbTogglePlayAll()" aria-pressed="false"
title="Play all — each clip plays once, then the next (P)">
<svg class="ph" aria-hidden="true"><use href="#ph-play-fill"/></svg><span id="expandPlayLabel">Play all</span>
</button>
<button type="button" class="expand-bar-btn" onclick="lbStep(1)" title="Next (→)" aria-label="Next output">
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><path d="M6 3 L11 8 L6 13" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/></svg>
</button>
<span class="expand-count" id="expandCount" aria-live="polite"></span>
<label class="expand-dur" title="How long a photo stays on screen while the gallery plays">Photos stay
<select id="expandImageSec" onchange="lbSetImageSec(this.value)">
<option value="1">1 s</option><option value="2">2 s</option><option value="3" selected>3 s</option>
<option value="4">4 s</option><option value="5">5 s</option><option value="6">6 s</option>
<option value="7">7 s</option><option value="8">8 s</option><option value="9">9 s</option>
<option value="10">10 s</option>
</select>
</label>
<button type="button" class="expand-bar-btn" id="expandFsBtn" onclick="lbToggleFullscreen()" title="Full screen" aria-label="Full screen" aria-pressed="false">
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><path d="M3 6 V3 H6 M10 3 H13 V6 M13 10 V13 H10 M6 13 H3 V10" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>
</button>
</div>
</div>
<!-- ============== MUSIC STUDIO — the Song card =====================
Under the player, for songs only. The song is the unit: its words,
its sheet music (drawn by abcjs from the score YuE2 wrote), where it
came from, and the four ways to get another one from it. Filled by
songCardRender() whenever a music output is selected; hidden for
everything else. -->
<div class="song-card" id="songCard" hidden>
<div class="song-head">
<div>
<div class="song-title" id="songTitle"></div>
<div class="song-style" id="songStyle"></div>
</div>
<div class="song-badges" id="songBadges"></div>
</div>
<div class="song-actions" id="songActions">
<button type="button" class="ghost-btn" onclick="musicVariation('take')" title="Same score, same words, a new performance — the singing and the playing are done again from the plan.">New take<span class="sub">same song, performed again</span></button>
<button type="button" class="ghost-btn" onclick="musicVariation('sound')" title="Same performance, recorded again: the notes and the words stay, the sound of it changes. A fraction of the time of a full song.">Re-roll the sound<span class="sub">same performance, new recording</span></button>
<button type="button" class="ghost-btn" onclick="musicRestyleFromSong()" title="Keep this song's score and put the form's style and lyrics on it.">New style on this score<span class="sub">uses the composer's style + lyrics</span></button>
<button type="button" class="ghost-btn" onclick="musicCoverFromSong()" title="Load this song as the source in Cover a song.">Cover it<span class="sub">read the tune, write it fresh</span></button>
</div>
<div class="song-lineage" id="songLineage"></div>
<div class="song-status" id="songStatus" role="status"></div>
<details class="song-section" id="songScoreSection" open>
<summary>Sheet music <span class="sum" id="songScoreSum"></span></summary>
<div class="song-score" id="songScore"></div>
<div class="song-score-editor" id="songScoreEditor" hidden>
<textarea id="songScoreText" spellcheck="false"></textarea>
<div class="row">
<button type="button" class="primary" onclick="musicRenderEditedScore()">Render this score</button>
<button type="button" class="ghost-btn" onclick="musicScorePreview()">Preview</button>
<button type="button" class="ghost-btn" onclick="musicScoreEditToggle(false)">Cancel</button>
<div class="hint">ABC notation. Change notes, chords or bars; the words come from the composer's Lyrics box (or this song's if that is empty).</div>
</div>
</div>
<div class="song-actions">
<button type="button" class="ghost-btn" id="songScoreEditBtn" onclick="musicScoreEditToggle(true)">Edit the score<span class="sub">change it, render it again</span></button>
<button type="button" class="ghost-btn" onclick="musicScoreCopy()">Copy ABC</button>
</div>
</details>
<details class="song-section" id="songLyricsSection">
<summary>Lyrics <span class="sum" id="songLyricsSum"></span></summary>
<div class="song-lyrics" id="songLyrics"></div>
</details>
</div>
<!-- Hidden compatibility slot. selectOutput() writes #playerName here
and toggles display on #playerMeta — both kept so external code
and tests don't break. The visible name lives in playerOverlayName. -->
<div class="player-meta" id="playerMeta" style="display:none">
<div class="name" id="playerName"></div>
<div class="actions-bar"></div>
</div>
<!-- ============== STORYBOARD — the stage surface ===================
Takes the GALLERY's slot, not the player's. That is deliberate: the
player stays exactly where it is, so a shot's thumbnail can call the
existing selectOutput() and the whole Params / Extend / Expand /
lightbox apparatus keeps working with no storyboard-specific code.
Four states live here — board list, empty, planning, plan review —
and exactly one is visible at a time. -->
<div id="sbStage">
<!-- Empty: no board open, none on disk. -->
<div class="sb-empty" id="sbEmpty" hidden>
<div class="sb-empty-icon">
<svg width="56" height="56" viewBox="0 0 256 256" aria-hidden="true"><use href="#ph-film-slate"/></svg>
</div>
<div class="sb-empty-title">One idea in, a film's worth of shots out.</div>
<div class="sb-empty-sub">Describe the film on the left and Phosphene writes the shot list — every shot with its own prompt, length and cast. You read it, fix it, then render the lot as cheap drafts overnight.</div>
<ul class="sb-empty-steps">
<li><b>Plan</b> — a small language model writes the shot list. About a minute.</li>
<li><b>Read it</b> — change any prompt, drop a shot, add one. Nothing has rendered yet.</li>
<li><b>Draft</b> — every shot small and fast, so you can watch the whole thing before committing.</li>
<li><b>Finish</b> — only the shots you keep, at full size, on the same seeds.</li>
</ul>
</div>
<!-- Board list: boards exist, none open. -->
<div class="sb-plan" id="sbList" hidden>
<header class="carousel-head">
<h3>Storyboards</h3>
<span class="ch-spacer"></span>
<!-- FILM-43: search + Recent-first was the whole ask — the list
was title-only, sorted by when a board was FIRST created
(not touched since), with no way to find one on a Mac with
more than a screenful. -->
<input type="search" class="sb-board-search" id="sbBoardSearch"
placeholder="Find a film…" aria-label="Search storyboards"
oninput="sbFilterBoardList(this.value)">
</header>
<ul class="row-list sb-boardlist" id="sbBoardList"></ul>
</div>
<!-- Planning: 30-90 s, and it says what it costs. -->
<div class="sb-planning" id="sbPlanning" hidden>
<div class="sb-planning-mark" aria-hidden="true"><i></i><i></i><i></i></div>
<div class="sb-planning-title" id="sbPlanningTitle" aria-live="polite">Writing the plan…</div>
<div class="sb-planning-sub" id="sbPlanningSub">About a minute. Nothing renders yet.</div>
<div class="sb-planning-steps" id="sbPlanningSteps">
<div class="sb-step" data-step="load"><span class="sb-step-dot"></span>Loading the planner</div>
<div class="sb-step" data-step="write"><span class="sb-step-dot"></span>Writing the plan</div>
<div class="sb-step" data-step="check"><span class="sb-step-dot"></span>Checking it</div>
<div class="sb-step" data-step="repair" hidden><span class="sb-step-dot"></span>Fixing what didn't validate</div>
<div class="sb-step" data-step="unload"><span class="sb-step-dot"></span>Giving the memory back</div>
</div>
<button type="button" class="ghost-btn" id="sbPlanCancel" onclick="sbCancelPlan()">Cancel</button>
</div>
<!-- Planner failed. Does NOT discard the brief — it is still on the left. -->
<div class="sb-empty" id="sbPlanFail" hidden>
<div class="sb-empty-title">The planner couldn't write a usable plan.</div>
<div class="sb-empty-sub" id="sbPlanFailMsg"></div>
<div style="display:flex;gap:8px;margin-top:6px">
<button type="button" class="primary" style="width:auto;padding:8px 16px" onclick="sbTryAgain()">Try again</button>
<button type="button" class="ghost-btn" id="sbPlanFailRaw" onclick="sbShowRaw()" hidden>Show what it returned</button>
</div>
</div>
<!-- Plan review — the core screen. Becomes the grading screen once
clips exist; it is the same list, not a second one. -->
<div class="sb-plan" id="sbPlan" hidden>
<header class="carousel-head sb-plan-head">
<input class="sb-title" id="sbTitle" value="" spellcheck="false"
onblur="sbTitleSave()" aria-label="Film title">
<span class="sb-plan-status" id="sbPlanStatus">Draft plan · not rendered</span>
<div class="stage-mode-toggle" id="sbStageToggle" role="group" aria-label="Stage view" hidden>
<button type="button" class="smt-btn active" data-sb-stage="list" onclick="sbSetStage('list')">Shot list</button>
<button type="button" class="smt-btn" data-sb-stage="player" onclick="sbPlayBoard()">Player</button>
</div>
<!-- "All storyboards" used to sit here. It lives on the rail now,
with the rest of the navigation, so there is one place to look
rather than a different one on every stage state. -->
</header>
<div class="sb-runbar engine-hint" id="sbRunBar" hidden>
<div class="sb-runbar-slot" id="sbRunThumb"></div>
<div class="sb-runbar-text">
<b id="sbRunTitle">Shot 1</b>
<span id="sbRunSub"></span>
</div>
<div class="sb-runbar-dots" id="sbRunDots"></div>
<button type="button" class="qchip" id="sbPauseBtn" onclick="togglePause()"
title="The shot that's rendering finishes. The rest wait.">Pause</button>
<button type="button" class="qchip" id="sbStopShotBtn" onclick="sbStopShot()"
title="Stops the shot that's rendering. The rest of the film carries on.">Stop shot</button>
<button type="button" class="qchip sb-danger" id="sbStopBtn" onclick="sbStopFilm()">Stop film</button>
</div>
<div class="sb-summary" id="sbSummary">
<div class="sb-sum-cell"><b id="sbSumShots">—</b><span id="sbSumRuntime"></span></div>
<div class="sb-sum-cell"><b id="sbSumTime">—</b><span id="sbSumTimeSub">drafts, this Mac</span></div>
<div class="sb-sum-cell"><b id="sbSumLoads">—</b><span id="sbSumLoadsSub"></span></div>
<div class="sb-sum-cell" id="sbSumDiskCell"><b id="sbSumDisk">—</b><span id="sbSumDiskSub">clips land in mlx_outputs/</span></div>
<div class="sb-runstrip" id="sbRunStrip" hidden></div>
<div class="sb-enginenote" id="sbEngineNote">
<span id="sbEngineNoteText"></span>
<button type="button" class="help-dot" id="sbEngineHelpBtn" aria-expanded="false"
aria-controls="sbEngineHelpNote" title="Why?" onclick="sbToggleEngineHelp()">?</button>
</div>
<div class="h3-winhelp" id="sbEngineHelpNote" style="flex:1 1 100%" hidden></div>
</div>
<details class="customize-section" id="sbQualitySection">
<summary class="cz-summary">
<span class="cz-chevron"><svg class="ph" aria-hidden="true"><use href="#ph-caret-down"/></svg></span>
<span class="cz-title">Quality</span>
<span class="cz-meta" id="sbQualityMeta"></span>
</summary>
<div class="cz-body">
<div class="cz-control">
<div class="cz-label">Draft pass <span class="cz-label-hint">what you watch first</span></div>
<!-- Rendered from the registry by sbRenderDraftQualities(), for
the same reason the delivery row below is: hand-written sizes
cannot know this Mac's pixel cap, so on a 24 GB Mac all three
printed canvases it will never deliver. -->
<div class="pill-group cols-3" id="sbDraftQuality"></div>
</div>
<div class="cz-control">
<div class="cz-label">Delivery pass <span class="cz-label-hint">what you keep</span></div>
<!-- Rendered from the registry by sbRenderFinalQualities(): three
hand-written buttons meant two of them printed 1024×576 for
canvases that are not 1024×576 (Standard is 1280×704), and a
fifth tier could never appear here at all. -->
<div class="pill-group cols-3" id="sbFinalQuality"></div>
</div>
</div>
</details>
<div class="sb-errors" id="sbErrors" hidden></div>
<!-- FILM-46: "N stills ready — Approve all" when Stills first is on
and at least one still is waiting; painted by sbRenderPlan(). -->
<div class="sb-stills-banner" id="sbStillsBanner" hidden></div>
<!-- FILM-41: a 75-shot board is a 54,540px scroll of full cards with
no overview. Grid is a dense contact sheet (thumbnail, number,
length, status, K/R/C) for finding a shot fast; clicking one
switches back to List scrolled to it. -->
<div class="sb-shotview-toggle" id="sbShotViewToggle" role="group" aria-label="Shot list view" hidden>
<button type="button" class="smt-btn active" data-sb-view="list" onclick="sbSetShotView('list')">List</button>
<button type="button" class="smt-btn" data-sb-view="grid" onclick="sbSetShotView('grid')">Grid</button>
</div>
<ol class="sb-shots" id="sbShots"></ol>
<div class="sb-addrow"><button type="button" class="ghost-btn" onclick="sbAddShot()">+ Add a shot</button></div>
<div class="sb-actionbar" id="sbActionBar">
<button type="button" class="ghost-btn" onclick="sbOpenReplan()">Re-plan…</button>
<span class="sb-actionbar-spacer"></span>
<span class="sb-actionbar-note" id="sbActionNote"></span>
<button type="button" class="primary" id="sbRenderBtn" onclick="sbRenderDrafts()">Render all drafts</button>
</div>
<div class="sb-actionbar sb-tally" id="sbTally" hidden title="Focus a shot and press K, R or C">
<span id="sbTallyText">nothing graded yet</span>
<span class="sb-actionbar-spacer"></span>
<!-- The timeline used to be the fifth button in this row of five,
which is exactly why nobody found it. It is step 3 on the rail
now — always on screen, in the same place on every state — and
this bar is left to do its own job: grade, then finish. -->
<button type="button" class="ghost-btn" id="sbExportBtn" onclick="sbExport()" hidden>Export</button>
<button type="button" class="ghost-btn" id="sbRewriteBtn" onclick="sbRewrite()" hidden>Rewrite</button>
<button type="button" class="ghost-btn" id="sbResumeBtn" onclick="sbRenderRemaining()" hidden>Render remaining</button>
<!-- FILM-47: Finish needed KEEP pressed on every shot by hand — 52
presses for a 52-shot board. -->
<button type="button" class="ghost-btn" id="sbKeepAllBtn" onclick="sbKeepAllUngraded()" hidden
title="Marks every rendered, ungraded shot KEEP — the same as pressing K on each one.">Keep all ungraded</button>
<button type="button" class="primary" id="sbFinishBtn" onclick="sbFinish()">Finish keepers</button>
</div>
<!-- FILM-47: a finished film could silently mix draft- and
delivery-size clips — any shot never marked KEEP stays at draft
size forever. Painted by sbRenderTally() when that is true. -->
<div class="sb-mixed-res-warn" id="sbMixedResWarn" hidden></div>
<div class="sb-export-note" id="sbExportNote" hidden>Export writes a folder with every kept shot, a shot list, and <strong>one playable film</strong>. If you have cut this film in the Editor, that film IS your cut — same clips, same trims, same soundtrack, same filename the Editor's own Render writes. Otherwise it is the shots joined in order, mixed sizes normalised to the largest. The clips in the gallery are never touched.</div>
</div>
<!-- ============== THE FILM — the point of the other six ===========
A render or an export writes an mp4 into mlx_outputs/storyboards/
and, until this screen existed, told nobody. The gallery could not
help: it globs OUTPUT/*.mp4 and never descends. So the one thing the
feature makes was the one thing it could not show you.
Everything here is painted by sbFilmPaint() from /storyboard/films,
which reads the folder the assemblers already write into. No new
storage, no second source of truth. -->
<div class="sb-plan sb-film" id="sbFilm" hidden>
<header class="carousel-head">
<h3>The film</h3>
<span class="sb-plan-status" id="sbFilmStatus"></span>
<span class="ch-spacer"></span>
<!-- Only a board planned in Music video has a song to lay under it,
so this button appears only there. It is a second door onto the
same assembler Export uses — the difference is the bed: the
song replaces every clip's own audio and plays unbroken, which
the lip-sync survives because each singing shot was rendered
against its own seconds of this very file. -->
<button type="button" class="ghost-btn" id="sbMusicFilmBtn"
onclick="sbFilmWithTheSong()" hidden
title="Join the shots and lay the song under them, unbroken">Film with the song</button>
</header>
<div id="sbFilmBody"></div>
</div>
</div>
<!-- ============== THE EDITOR — its own window ======================
Wave 1 of the Editor restructure (2026-08-17). The timeline used to
be the sixth state of #sbStage, which made it a room inside the
storyboard rather than a place of its own: it could not open without
a board, it died on a tab switch, and its picture was whatever the
shot list left over. It is a top-level workflow now — engine-
agnostic, always reachable, one document at a time.
#edStage is the editor's scroller, the exact counterpart of
#sbStage. The media pool lives in the form pane (#edSectionTab), so
this column is the viewer and the track and nothing else. -->
<div id="edStage">
<!-- No document open. Not an error state: the Editor is reachable
from a cold boot with nothing on disk, and this is what it says
then. The film list is painted by edPaintEmpty(). -->
<div class="sb-empty" id="edEmpty" hidden>
<div class="sb-empty-icon">
<svg width="56" height="56" viewBox="0 0 256 256" aria-hidden="true"><use href="#ph-film-strip"/></svg>
</div>
<div class="sb-empty-title">Pick a __SEQ__ to cut.</div>
<div class="sb-empty-sub">The Editor opens one timeline at a time. Choose a __SEQ__ below, or add clips from the media pool on the left — anything in your generations can go straight onto the track.</div>
<div class="ed-pick" id="edPick"></div>
</div>
<!-- ============== THE TIMELINE — arrangement, not intent ==========
The sixth stage state. The shot list above says WHAT the film
contains; this says what plays, from which second of which file, at
which second of the film. Two documents, side by side on disk
(storyboard.json / edit.json), for the reason storyboard_editor.py
gives at length: the moment one shot is used twice they are
different shapes forever.
Everything here is proxy-driven. A source clip is a single GOP —
235 ms to seek in Chrome, measured — and a timeline is a machine
for seeking. The proxies are all-intra and seek in 3.5 ms. -->
<div class="sb-plan sbe" id="sbTimeline" hidden>
<!-- THE COMMAND BAR. Identity on the left — what am I cutting, which
draft, is it saved — and four verbs on the right. It was eleven
controls in one row, all drawn identically, so the safest thing on
the screen and the one that LEAVES looked alike. Navigation nests
under the ⋯; the only filled control on the screen is Render. -->
<header class="carousel-head sbe-head">
<!-- WHICH FILM, AND THE WAY TO ANOTHER ONE. The name looked like a
control and did nothing, and the list of films sat behind the
full-screen Editor with ⋯ → Close as the only way to it. The name
IS the switcher: it drops the films that have clips, and opening
one keeps the work here the way closing does (backed up, never
discarded). -->
<button type="button" class="ghost-btn sbe-titlebtn" id="sbeFilmsBtn"
onclick="sbeFilmsToggle()" aria-haspopup="menu"
title="Switch to another __SEQ__ — nothing here is lost"><span class="sbe-title" id="sbeTitle">Editor</span><span class="sbe-car">▾</span></button>
<!-- WHICH DOCUMENT AM I CUTTING, and which of its drafts. Identity, so
it sits beside the name rather than among the verbs. -->
<button type="button" class="ghost-btn sbe-draftchip" id="sbeKeepBtn"
onclick="sbeVersionsOpen(true)"
title="New draft, duplicate, rename — and every draft this __SEQ__ has">
<span id="sbeDraftDot" class="sbe-draft-dot" hidden></span><span id="sbeDraftName">Draft</span><span class="sbe-car">▾</span>
</button>
<span class="sbe-state" id="sbeState"><i class="sbe-dot"></i><span id="sbeStateText">loading…</span></span>
<!-- WHEN THE NET LAST CAUGHT THIS TAB. A dead snapshot lane used to be
invisible: the only way to find out was to list a history folder
AFTER losing something. This says it in the one place a person
already looks to find out whether their work is safe. -->
<span class="sbe-protected" id="sbeProtected" hidden></span>
<!-- THE SNAPSHOT, AS A CHIP. It used to be a whole row under the header
("Unsaved snapshot · open") for as long as a backup existed, which
was most of the time. Now it is a chip in the status area; click
it and the full offer drops in below the header. -->
<button type="button" class="sbe-chipbtn sbe-snapchip" id="sbeRecoverChip" hidden
onclick="sbeNoticeOpen('sbeRecover')"
title="A snapshot of unsaved work exists — click to see it and open it from Drafts">
<svg class="sbe-cbar-i"><use href="#ic-history"/></svg><b>snapshot</b></button>
<span class="ch-spacer" style="flex:1 1 auto"></span>
<!-- VIEW — WHAT IS ON THE SCREEN, in one place. "The on/off toggles for
the screen panels are a good idea but it's not clear." They were
four icons in three rows (under the picture, on the tool row, in
this header); now they are one labelled group, each a toggle that
is FILLED while its panel is showing, and a tooltip that names what
appears or disappears and the key. Full screen is the one action in
the group, so it has no label and no pressed state. -->
<span class="sbe-view" id="sbeView" role="group" aria-label="View">
<button type="button" class="sbe-vbtn" id="sbeSrcBtn" onclick="sbeSrcMonToggle()"
aria-label="Source monitor" aria-pressed="false"
title="Source monitor — the left screen, where a clip from the media pool plays before it goes on the timeline">
<svg class="sbe-cbar-i"><use href="#ic-source"/></svg><b>Source</b></button>
<button type="button" class="sbe-vbtn" id="sbeInspectBtn" onclick="sbeInspectToggle()"
aria-label="Inspector" aria-pressed="false" data-shortcut="editor.inspector"
title="Inspector — the right-hand panel: speed, fades, brightness, zoom, transitions and titles for what is selected">
<svg class="sbe-cbar-i"><use href="#ic-inspect"/></svg><b>Inspector</b></button>
<!-- SOUND MODE. The one control that changes the split: the timeline
takes the height, every sound lane is at full height, the picture
is small. Off again is picture mode: lanes thin, picture big. It
replaced the lanes that sized themselves — "the automatic changing
of the size of the timeline if you are going around with audio is
really bad. A button is warranted." -->
<button type="button" class="sbe-vbtn" id="sbeSoundBtn" onclick="sbeSoundModeToggle()"
aria-label="Sound mode" aria-pressed="false" data-shortcut="editor.soundMode"
title="Sound mode — the sound lanes at full height and the picture small">
<svg class="sbe-cbar-i"><use href="#ic-wave"/></svg><b>Sound</b></button>
<!-- PANELS. Photoshop's Tab: the app's left column (tabs, media pool,
queue) out of the way, and back. ` on the keyboard. -->
<button type="button" class="sbe-vbtn" id="sbePanelsBtn" onclick="sbePanelsToggle()"
aria-label="Side panels" aria-pressed="true" data-shortcut="editor.panels"
title="Side panels — the app's left column: the tabs, the media pool and the queue">
<svg class="sbe-cbar-i"><use href="#ic-panels"/></svg><b>Panels</b></button>
<span class="sbe-vsep" aria-hidden="true"></span>
<button type="button" class="sbe-vbtn sbe-vbtn-act" id="sbeFullBtn" onclick="sbeFullscreen()"
aria-label="Full screen" data-shortcut="editor.fullscreen"
title="Full screen — the Program monitor fills the whole screen. Esc brings it back">
<svg class="sbe-cbar-i"><use href="#ic-full"/></svg></button>
</span>
<!-- One gesture, two directions: a segmented pair rather than two
free-standing buttons that happen to sit next to each other. -->
<span class="sbe-undogroup">
<button type="button" class="ghost-btn" id="sbeUndoBtn" onclick="sbeUndo()" title="Undo" data-shortcut="editor.undo" disabled>Undo</button>
<button type="button" class="ghost-btn" id="sbeRedoBtn" onclick="sbeRedo()" title="Redo" data-shortcut="editor.redo" disabled>Redo</button>
</span>
<button type="button" class="ghost-btn" id="sbeSaveBtn" onclick="sbeSaveNow()"
data-shortcut="editor.save"
title="Save the draft. Save is the only thing that writes it — between saves your edits are kept as a backup you can restore from Drafts.">Save</button>
<!-- RENDER CAME UP, NOT OUT. It was the far corner of a sticky bar at
the bottom of the column, 54px of chrome under the timeline to
hold two buttons; it is the one thing this screen is FOR, so it is
the one filled control on it. Export nests under the caret, with
the render note, because it is the same verb pointed elsewhere. -->
<span class="sbe-split">
<button type="button" class="primary" id="sbeRenderBtn" onclick="sbeRenderFilm()"
data-shortcut="editor.render"
title="Render this timeline into one file">Render</button>
<button type="button" class="primary sbe-car-btn" id="sbeRenderMore"
onclick="sbePopToggle('sbeRenderMenu', 'sbeRenderMore')"
aria-haspopup="menu" title="Export, and what the render will do">▾</button>
</span>
<!-- FILM-24: the render used to end by throwing the user out of the
Editor onto the Film screen. It stays here now; this chip is
where "the last thing I rendered" lives instead — replaced by
the next render, gone (hidden) until the first one. -->
<span class="sbe-render-chip" id="sbeRenderChip" hidden></span>
<button type="button" class="ghost-btn sbe-kebab" id="sbeMoreBtn"
onclick="sbePopToggle('sbeMoreMenu', 'sbeMoreBtn')"
aria-haspopup="menu" title="Drafts, soundtrack, media pool, auto-edit, storyboard, close">⋯</button>
</header>
<!-- THE FOUR POPOVERS. Their contents are the REAL controls, moved
rather than rebuilt: every id the client already writes to is still
here, so nothing that pokes at a button has to learn a new home.
They are `position: fixed` and hidden, so an open menu cannot push
the workspace around — the same rule the notice surface follows. -->
<div class="sbe-pop" id="sbeRenderMenu" hidden>
<!-- DELIVER AS. Two rows, remembered: what the film is encoded as
and how big. H.264 is the panel's preset and plays everywhere;
HEVC is the Mac's hardware encoder at half the size; ProRes is a
.mov for the grade that nothing here previews. Size is up
only, never a crop. -->
<span class="sbe-pop-note">Deliver as</span>
<span class="pill-group cols-3 sbe-deliver" id="sbeDeliverFormat">
<button type="button" class="pill-btn active" data-format="h264" onclick="sbeDeliverPick('format', 'h264')"
title="The panel's own preset. Plays everywhere.">H.264</button>
<button type="button" class="pill-btn" data-format="hevc" onclick="sbeDeliverPick('format', 'hevc')"
title="Apple's hardware encoder — about half the size at the same look. Plays in Safari and Chrome on a Mac.">HEVC</button>
<button type="button" class="pill-btn" data-format="prores" onclick="sbeDeliverPick('format', 'prores')"
title="ProRes 422 HQ in a .mov, 10-bit 4:2:2 — for colour grading in an NLE. Not previewable here.">ProRes</button>
</span>
<span class="sbe-deliver-cap">H.264 plays everywhere · HEVC half the size · ProRes for the grade (.mov)</span>
<span class="pill-group cols-3 sbe-deliver" id="sbeDeliverSize">
<button type="button" class="pill-btn active" data-size="native" onclick="sbeDeliverPick('size', 'native')"
title="The largest picture in the cut, as it is.">As cut</button>
<button type="button" class="pill-btn" data-size="1080p" onclick="sbeDeliverPick('size', '1080p')"
title="Scaled to 1080 high, aspect kept, never cropped.">1080p</button>
<button type="button" class="pill-btn" data-size="2160p" onclick="sbeDeliverPick('size', '2160p')"
title="Scaled to 2160 high (4K), aspect kept. An upscale — it adds pixels, not detail.">4K</button>
</span>
<span class="sbe-deliver-cap">Size is up only, never a crop · 4K adds pixels, not detail</span>
<span class="pill-group cols-3 sbe-deliver" id="sbeDeliverFinish">
<button type="button" class="pill-btn active" data-finish="none" onclick="sbeDeliverPick('finish', 'none')"
title="The picture as rendered.">Clean</button>
<button type="button" class="pill-btn" data-finish="grain" onclick="sbeDeliverPick('finish', 'grain')"
title="Fine moving film grain over the delivered picture — takes the digital edge off.">Grain</button>
<button type="button" class="pill-btn" data-finish="heavy_grain" onclick="sbeDeliverPick('finish', 'heavy_grain')"
title="Coarse grain, 16 mm territory. Added after the size, so a 4K delivery gets 4K grain.">Heavy grain</button>
</span>
<span class="sbe-deliver-cap">Finish is on the delivery only — the preview and the export stay clean</span>
<span class="sbe-pop-note">Film look <span class="cz-label-hint">a whole-film grade, on top of any per-clip grade — saved with the __SEQ__</span></span>
<span class="pill-group cols-3 sbe-deliver" id="sbeFilmLook">
<button type="button" class="pill-btn active" data-look="none" onclick="sbeSetFilmLook('none')"
title="No whole-film grade — every clip keeps only its own colour.">None</button>
<button type="button" class="pill-btn" data-look="neutral" onclick="sbeSetFilmLook('neutral')"
title="A light, even correction across every shot.">Neutral</button>
<button type="button" class="pill-btn" data-look="warm_tungsten" onclick="sbeSetFilmLook('warm_tungsten')"
title="Warm and slightly saturated — one consistent tungsten-lit feel across the whole film.">Warm tungsten</button>
</span>
<span class="sbe-pop-note">Sequence aspect <span class="cz-label-hint">also saved with the __SEQ__ — crops to fit, never stretches</span></span>
<span class="pill-group cols-3 sbe-deliver" id="sbeSeqAspect">
<button type="button" class="pill-btn active" data-aspect="16:9" onclick="sbeSetSeqAspect('16:9')"
title="Widescreen — the film's native shape.">16:9</button>
<button type="button" class="pill-btn" data-aspect="9:16" onclick="sbeSetSeqAspect('9:16')"
title="Vertical — Reels, Shorts, Stories. Centre-cropped from the widescreen frame.">9:16</button>
<button type="button" class="pill-btn" data-aspect="1:1" onclick="sbeSetSeqAspect('1:1')"
title="Square — the classic feed post. Centre-cropped from the widescreen frame.">1:1</button>
</span>
<label class="check sbe-deliver-loudnorm"
title="Masters the finished mix: a peak limiter, then loudness to -15 LUFS with peaks held under -2 dB. On by default, so a film cut here sounds as loud as one an agent cut. Untick to keep the mix exactly as it is.">
<input type="checkbox" id="sbeDeliverLoudnorm" checked
onchange="sbeDeliverToggleLoudnorm(this.checked)">
<span>Master loudness (−15 LUFS)</span>
</label>
<span class="sbe-pop-sep"></span>
<button type="button" class="ghost-btn" id="sbeNleBtn" onclick="sbeExportNle()"
title="A folder with an FCP7 XML (Premiere + Resolve), an After Effects script, and hardlinked media. Audio comes out as stems, not the ducked mix.">Export for Premiere / Resolve / AE</button>
<span class="sbe-pop-note" id="sbeRenderNote"></span>
</div>
<div class="sbe-pop sbe-films" id="sbeFilmsMenu" role="menu" hidden>
<button type="button" class="ghost-btn" id="sbeFilmsNewBtn" onclick="sbeFilmsNew()"
title="Start an empty timeline. The one you are on is kept.">New __SEQ__</button>
<button type="button" class="ghost-btn" id="sbeFilmsRenameBtn" onclick="sbeRename()"
title="Change the name of this __SEQ__">Rename this __SEQ__</button>
<span class="sbe-pop-sep"></span>
<span class="sbe-pop-note" id="sbeFilmsNote">reading your __SEQS__…</span>
<div class="sbe-films-list" id="sbeFilmsList"></div>
</div>
<div class="sbe-pop" id="sbeMoreMenu" hidden>
<button type="button" class="ghost-btn" id="sbeVersBtn" onclick="sbeVersionsOpen(false)"
title="Every draft this __SEQ__ has, and every past save of this one">Drafts and versions…</button>
<button type="button" class="ghost-btn" id="sbeImportBtn" onclick="edPoolFocus()"
title="This __SEQ__'s shots, other __SEQS__' clips, and everything in your generations.">Media pool</button>
<button type="button" class="ghost-btn" id="sbeAutoBtn" onclick="sbeAuto()"
title="Re-cuts the __SEQ__ from scratch. Throws away this arrangement.">Auto-edit…</button>
<button type="button" class="ghost-btn" id="sbeAlignBtn" onclick="sbeAutoAlign()"
title="Checks every singing shot's mouth against the song, CPU only, no render. Proposes a slip per shot — nothing moves until you accept.">Auto-align lip-sync…</button>
<button type="button" class="ghost-btn" id="sbeMatchBtn" onclick="sbeMatchColourOpen()"
title="Samples one frame per clip and proposes a colour correction toward a hero clip (select one first) or the film's median. Nothing changes until you press Apply.">Match colour across the film…</button>
<span class="sbe-pop-sep"></span>
<button type="button" class="ghost-btn" id="sbeBoardBtn" onclick="sbeGoToBoard()"
title="Open this __SEQ__'s shot list in the Storyboard tab" hidden>Storyboard</button>
<button type="button" class="ghost-btn" id="sbeCloseBtn" onclick="sbeClose()"
title="Close this timeline (Esc). Nothing is deleted.">Close</button>
</div>
<div class="sbe-pop sbe-pop-wide" id="sbeKeysPop" hidden>
<span class="sbe-note sbe-keys" id="sbeKeys"></span>
<a class="sbe-keys-docs" href="#docs/shortcuts/keys-editor">Every shortcut, in the Docs →</a>
</div>
<!-- THE CLIP BAR'S OVERFLOW. Empty in the markup on purpose: the bar
MOVES its own buttons in here when the pane is too narrow for them
and moves them back out when it is not, so there is exactly one
copy of every control and no second set of ids to keep in step. -->
<div class="sbe-pop sbe-cbar-pop" id="sbeCbarMenu" hidden></div>
<!-- RIGHT-CLICK ON THE TRACK. The same verbs the clip bar carries, at
the pointer, because that is the second place every editor's hand
goes and this timeline answered a right-click with the browser's
own menu. Painted by sbeCtxOpen — a context menu whose items are
written for the thing under the pointer is the only kind worth
having, and a gap's only verb is "close it". -->
<div class="sbe-pop sbe-ctx" id="sbeCtxMenu" hidden></div>
<div class="sbe-pop sbe-bed-pop" id="sbeBedPop" hidden>
<label class="sbe-mix-lvl sbe-bed-pop-lvl">
<span>Music volume</span>
<input type="range" id="sbeBedGain2" min="0" max="100" step="1"
value="100" aria-label="Music volume"
oninput="sbeBedGainSlide(this.value)"
onchange="sbeBedGainCommit(this.value)">
<b id="sbeBedGainNum2">100%</b>
</label>
<span class="sbe-pop-note">The preview and the render both play it at this level.</span>
</div>
<div class="sbe-pop sbe-pop-wide" id="sbeMusicMenu" hidden>
<span class="sbe-pop-note" id="sbePrepText">The soundtrack drives the waveform and the beat grid.</span>
<input type="text" class="sb-input" id="sbeMusic" spellcheck="false"
onblur="sbeMusicEditPath(false)"
placeholder="/path/to/the/soundtrack.wav">
<span class="sbe-pop-row">
<button type="button" class="ghost-btn" id="sbeMusicChange"
onclick="sbeMusicEditPath(true)"
title="Point at a different audio file">Change…</button>
<button type="button" class="ghost-btn" id="sbePrepBtn" onclick="sbePrepare()">Prepare</button>
<button type="button" class="ghost-btn" id="sbePrepCancel" onclick="sbePrepareCancel()" hidden>Cancel</button>
</span>
<span class="sbe-bar" id="sbePrepBar" hidden><i style="width:0%"></i></span>
<span class="sbe-music-warn" id="sbeMusicWarn" hidden></span>
</div>
<!-- ADD SOUND FILE… — a sound from anywhere on this Mac onto an audio
track at the playhead, the way A2's Change… takes a path. A file
outside the outputs is brought into the film's own audio/ folder so
the preview can play it. -->
<div class="sbe-pop sbe-pop-wide" id="sbeSoundMenu" hidden>
<span class="sbe-pop-note">Add a sound file to an audio track, at the playhead.</span>
<input type="text" class="sb-input" id="sbeSoundPath" spellcheck="false"
placeholder="/path/to/the/sound.wav"
onkeydown="if (event.key === 'Enter') { event.preventDefault(); sbeAddSoundFile(); }">
<span class="sbe-pop-row">
<button type="button" class="ghost-btn" onclick="sbeAddSoundFile()"
title=".wav, .m4a, .mp3, .aac — or a video, for its sound only">Add sound file</button>
</span>
<span class="sbe-pop-note">Or lay an ambience bed under the whole __SEQ__.</span>
<span class="sbe-pop-row">
<button type="button" class="ghost-btn" onclick="edRtOpen()"
title="Room tone — generated background noise under every cut, on its own track">Room tone…</button>
</span>
</div>
<!-- ONE SURFACE, NOT FOUR. Conflict, save-alarm, recovery and the
validation list are four full-width blocks stacked in the same
column, and they are not mutually exclusive — the day the overlap
rule refused a J-cut the owner had three of them on screen at once,
the timeline pushed off the bottom, and the sentence that mattered
was the third one down. They still exist as themselves; the
container shows the most urgent OPEN and folds the rest to a chip
you click to read. -->
<div class="sbe-notices" id="sbeNotices"
onclick="sbeNoticeClick(event)" hidden>
<div class="sbe-conflict" id="sbeConflict" data-short="Version conflict" hidden>
<span id="sbeConflictText"></span>
<span style="flex:1 1 auto"></span>
<button type="button" class="ghost-btn" onclick="sbeTakeTheirs()">Load theirs</button>
<button type="button" class="ghost-btn" onclick="sbeForceSave()">Keep mine</button>
</div>
<!-- SAVING IS FAILING. Not a status — an emergency, and the loudest
thing this screen can say. The owner cut for twenty minutes against
a timeline that was not being written, and the only thing that knew
was a small grey chip reading "not saved". This says it in words
nobody can read past, names the reason, and does not go away until a
save actually lands. -->
<div class="sbe-alarm" id="sbeAlarm" data-short="Saving is failing" hidden>
<b>SAVING IS FAILING — your changes are not being stored.</b>
<span id="sbeAlarmWhy"></span>
<span style="flex:1 1 auto"></span>
<button type="button" class="ghost-btn" onclick="sbeSaveNow()">Try again</button>
</div>
<!-- THE RECOVERY OFFER. A backup newer than the saved draft is a
question, never an action: the autosave the owner asked us to
remove would be exactly this, applied without asking. It says what
is in the backup so the choice can be made on facts. -->
<!-- NO RECOVERY WALL. This was a full-width bar with a primary button,
asking a question that had to be answered before the film could be
worked on — and asking it over a document that had loaded correctly,
because the comparison behind it counted a rewritten `proxy`
pointer as a difference. It is now the quietest thing on the
screen: a chip that says a snapshot exists and offers to open the
place where snapshots live. Content-equal shows nothing at all.
See docs/EDITOR_SAVE_MODEL.md §4. -->
<div class="sbe-recover" id="sbeRecover" data-short="Unsaved snapshot"
data-quiet="1" hidden>
<b>Unsaved snapshot</b>
<span id="sbeRecoverWhat"></span>
<span style="flex:1 1 auto"></span>
<button type="button" class="ghost-btn" onclick="sbeVersionsOpen()">Open Versions</button>
<button type="button" class="ghost-btn" onclick="sbeRecover()">Restore it</button>
<button type="button" class="ghost-btn" onclick="sbeDiscardBackup()">Discard</button>
<!-- DISMISSIBLE WITHOUT ANSWERING. Discard DELETES the backup, so it
is not the button for "not now" — and with no third option the
bar sat across the top of the film for the rest of the session
over a question the user was not ready to answer. This one hides
it and touches nothing; it is back on the next read. -->
<button type="button" class="ghost-btn" onclick="sbeNoticeLater()">Later</button>
</div>
<div class="sbe-errs" id="sbeErrors" data-short="Not saved" hidden></div>
<!-- THE AUTO-KEY RECEIPT. "If the picture comes in a format that doesn't
work, automatically make it work" — and then say so. A card whose
alpha channel declared a black backdrop opaque was keyed on its way
to the overlay lane; the original file was NOT touched, and this is
the one click back to it. Quiet, because nothing here went wrong,
and because a receipt that took the width would push the timeline
down the screen for a change the user is going to keep. -->
<div class="sbe-recover" id="sbeKeyed" data-short="Black background removed"
data-quiet="1" hidden>
<b>Black background removed</b>
<span id="sbeKeyedWhat"></span>
<span style="flex:1 1 auto"></span>
<button type="button" class="ghost-btn" onclick="sbeKeyedKeepOriginal()">Keep original</button>
<button type="button" class="ghost-btn" onclick="sbeKeyedDismiss()">Dismiss</button>
</div>
</div>
<!-- THE DRAFTS PANEL. Declared here so it is real markup a gate can
read, and PORTALLED TO <body> the first time it opens: the editor
header and the stage column both carry overflow, and a panel
rendered inside either is sliced at its edge — the same clipping
that cut the avatar off the header and the drag ghost off the pool.
Positioned fixed, under the button that opened it. -->
<div class="sbe-vers" id="sbeVersions" hidden>
<header>
<b>Drafts</b>
<span style="flex:1 1 auto"></span>
<button type="button" class="ghost-btn" onclick="sbeVersionsClose()">Close</button>
</header>
<!-- NEW DRAFT. Two doors on purpose: an empty timeline to start an
idea from nothing, and a copy of what is on screen to try a
variation without risking the cut it came from. "He should be
able to start a new draft and work on it, as well as copy and
paste drafts." -->
<div class="sbe-vers-new">
<input type="text" class="sb-input" id="sbeVersName" maxlength="60"
spellcheck="false" placeholder="Name a draft, or this save…"
onkeydown="if (event.key === 'Enter') { event.preventDefault(); sbeNameEnter(); }">
<button type="button" class="primary" id="sbeVersKeep"
onclick="sbeNameEnter()"
title="A new draft holding a copy of the timeline on screen">Copy</button>
<button type="button" class="ghost-btn" id="sbeDraftEmpty"
onclick="sbeDraftNew(false)"
title="A new draft with an empty timeline (the soundtrack comes with it)">Empty</button>
<!-- NAMING A SAVE IS NOT SAVING ONE, and it is not making a draft
either — it marks the save already on disk so the fifty-save
prune can never take it. The route has been alive and
documented the whole time; the drafts rewrite left the panel
with no way to reach it, while the history went on rendering
named saves in their own accent because the owner's film
already contains one. -->
<button type="button" class="ghost-btn" id="sbeKeepSaveBtn"
onclick="sbeKeepVersion()"
title="Give the save on disk a name, so it is never pruned">Keep</button>
</div>
<div class="sbe-vers-list" id="sbeDraftList"></div>
<div class="sbe-vers-note" id="sbeVersNote"></div>
<div class="sbe-vers-list" id="sbeVersList"></div>
</div>
<!-- DRAFT → DELIVERY. "Finish keepers" renders full-size files, and
until Wave 1 the timeline went on pointing at the drafts it was cut
from — so the delivery pass produced files the film never used, and
the next Prepare pruned their proxies. Detected on the server (see
_sbe_relinks), never applied without this button: the arrangement is
the human's. -->
<div class="sbe-relink" id="sbeRelink" hidden>
<span id="sbeRelinkText"></span>
<span class="sbe-relink-why">Same cuts, same timings — only the files change.</span>
<span style="flex:1 1 auto"></span>
<button type="button" class="ghost-btn" id="sbeRelinkBtn"
onclick="sbeRelink()">Use the finished versions</button>
</div>
<!-- A RETAKE'S OFFER. One line per new take — "Use it" / "Keep the old
one" — painted by sbePaintRelink. It was written into this id from
the day Retake shipped and the element did not exist, so a finished
retake could never be put on the timeline. -->
<div class="sbe-relink sbe-retakes" id="sbeRetakes" hidden></div>
<!-- FILM-15: a moved or trashed file used to show a black preview with
no explanation and export a shorter, out-of-sync film with a
"Rendered N clips" success toast over the top of it. Painted by
sbePaintOffline from `SBE.offline` (server-computed, _sbe_payload).
Render is blocked while this is up — see sbeRenderFilm. -->
<div class="sbe-relink sbe-offline" id="sbeOffline" hidden>
<span id="sbeOfflineText"></span>
<span class="sbe-relink-why">Render is blocked until every clip is back online.</span>
</div>
<!-- ============== THE TWO MONITORS =========================
Source on the left, program on the right, which is the layout
every NLE has had since tape: one screen for the thing you are
considering, one for the thing you have built. Asked for in
those words — "a split screen with the left screen showing you
when you click on the clips … you can watch the clips before you
add them".
The source is a PLAYER, not a second editor. It has no timeline,
no trim, no scrub: clicking a pool row loads the clip and plays
it, and the only verb under it is the one that puts it on the
track. The + on the pool row still adds without previewing, so
nobody who already knows what a clip is has to watch it first.
Sound is the program's switch, for both: sbeSetMute owns the
mute state of every element on this row, and only one of the two
ever plays. -->
<div class="sbe-monitors" id="sbeMonitors">
<!-- SOURCE IS ON SCREEN BY DEFAULT again (round 2): "you have two empty
dark spaces on the sides [of the Program monitor], so probably you
can still add the preview clip for a place where you can drag the
clips and see them. I think that is actually necessary." It sits
in the width the Program monitor could not use — the row is
height-limited, so the Program monitor keeps its size. It is a DROP
TARGET: a pool row or a timeline clip dragged onto it loads there.
Source in the View group (or × on its bar) hides it, per browser
(phos_sbe_src). -->
<div class="sbe-mon sbe-mon-src" id="sbeSrcMon">
<div class="sbe-stage" id="sbeSrcStage">
<!-- Same opacity rule as the program monitor, for the same
WebKit reason: a display:none <video> is never loaded. -->
<video id="sbeSrcVideo" playsinline preload="auto"></video>
<img id="sbeSrcStill" class="sbe-still" alt="">
<div class="sbe-stage-badge" id="sbeSrcBadge" hidden></div>
<div class="sbe-stage-empty sbe-src-empty" id="sbeSrcEmpty">
<svg class="sbe-cbar-i" aria-hidden="true"><use href="#ic-source"/></svg>
<b>Drop a clip here to preview</b>
<span>Drag one from the media pool or the timeline, or click a clip in the pool.</span>
</div>
</div>
<div class="sbe-mon-bar">
<span class="sbe-mon-label">Source</span>
<button type="button" class="ghost-btn sbe-ibtn" id="sbeSrcPlayBtn"
onclick="sbeSrcToggle()" disabled aria-label="Play the source" title="Play / pause the source">
<svg class="sbe-cbar-i"><use href="#ic-play" id="sbeSrcPlayUse"/></svg></button>
<span class="sbe-mon-name" id="sbeSrcName">Nothing loaded</span>
<button type="button" class="ghost-btn" id="sbeSrcAddBtn"
onclick="sbeSrcAdd()" disabled
title="Puts this clip at the end of the __SEQ__ — exactly what the + on its row does.">Add to timeline</button>
<button type="button" class="ghost-btn sbe-ibtn" id="sbeSrcCloseBtn"
onclick="sbeSrcClose()" aria-label="Hide the Source monitor"
title="Hide the Source monitor — Source in the View group brings it back">
<svg class="sbe-cbar-i"><use href="#ic-close"/></svg></button>
</div>
</div>
<div class="sbe-mon sbe-mon-prog">
<div class="sbe-stage" id="sbeStage">
<!-- TWO videos, one on screen. Giving the visible element a new src
at a cut made WebKit paint black until the new file decoded, so
a new file only ever goes into the hidden one, and the two trade
places once it holds its frame (sbeStageVideo in editor.js).
Hidden with opacity, never display:none, or WebKit will not
load it. -->
<!-- No `muted` attribute. It was here as "belt and braces" for a
loader that hard-muted anyway, and it now contradicts the only
thing that owns this state: sbeSetMute. There is no `autoplay`
here, so nothing plays without sbePlay, and sbePlay sets muted
explicitly and falls back if the browser refuses. -->
<video id="sbeVideo" playsinline preload="auto"></video>
<video id="sbeVideoB" playsinline preload="auto"></video>
<!-- The still layer. A slug needs no element at all: hiding both of
these leaves the stage's own #000 background, which is exactly
what a slug renders. -->
<img id="sbeStill" class="sbe-still" alt="">
<!-- THE OVERLAY LANE ON THE STAGE. Over the picture and the still
both, carrying its own opacity so a card's fade is independent of
whatever is beneath it — which is what a second track means. -->
<img id="sbeOvLayer" class="sbe-ov-layer" alt="">
<!-- A VIDEO ON THE OVERLAY LANE plays here, from its preview copy
(HEVC with alpha for a transparent sting), never through the
<img> above: an <img> handed a .mov is a broken-image "?" over
every frame. Muted (the lane is picture only), hidden by
opacity like every stage video, and driven by the playhead. -->
<video id="sbeOvVideo" class="sbe-ov-video" muted playsinline preload="auto"></video>
<!-- What is said, quietly, when an overlay cannot be shown on the
stage. The render still carries it. -->
<div id="sbeOvNote" class="sbe-ov-note" hidden></div>
<!-- A TITLE ON THE STAGE. Drawn in the DOM at the same anchor and
the same 1080-relative size the render rasterises it at, so the
stage shows the card the file will carry. Same opacity rule as
the card layer: its fade is its own. -->
<div id="sbeOvText" class="sbe-ov-text"></div>
<div class="sbe-stage-badge" id="sbeBadge">idle</div>
<div class="sbe-stage-empty" id="sbeStageEmpty" hidden></div>
</div>
<!-- THE STRIP UNDER THE PICTURE — where Premiere and Resolve keep the
transport, and where the clip's name now lives instead of on the
picture: "the name of the clip in the full screen is hiding a
part of what is visible". Left to right: play, mute, the time,
what is under the playhead, then the three panel toggles. -->
<div class="sbe-mon-bar sbe-mon-bar-prog">
<button type="button" class="ghost-btn sbe-ibtn" id="sbePlayBtn" onclick="sbeTogglePlay()"
title="Play / pause" data-shortcut="editor.play" aria-label="Play">
<svg class="sbe-cbar-i"><use href="#ic-play" id="sbePlayUse"/></svg></button>
<button type="button" class="ghost-btn sbe-ibtn sbe-mute" id="sbeMuteBtn"
onclick="SBE.muted ? sbeUnmuteFromRefusal() : sbeSetMute(true)" title="Sound on — click to mute the preview" data-shortcut="editor.mute"
aria-label="Mute the preview">
<svg class="sbe-cbar-i"><use href="#ic-sound" id="sbeMuteUse"/></svg></button>
<span class="sbe-time" id="sbeTime" role="button" tabindex="0"
onclick="sbeToggleTimeMode()"
onkeydown="if(event.key==='Enter'||event.key===' '){event.preventDefault();sbeToggleTimeMode();}"
title="Minutes:seconds. Click for a frame timecode.">0:00.00 <span>/ 0:00.00</span></span>
<span class="sbe-mon-clip" id="sbeProgClip"></span>
<span class="sbe-mon-name" id="sbeProgName"></span>
<button type="button" class="sbe-chipbtn" id="sbeUnplacedBtn" hidden
onclick="sbeInspectSet(true)"
title="Shots that finished rendering but are not on the timeline — open the panel to place them"></button>
</div>
</div>
<!-- THE RAIL IS A PANEL, NOT A FIXTURE. Resolve and Premiere put the
inspector beside the monitors, and so does this — but they let
you close it, and until now this one was open for every minute
of every session: "It shouldn't be open like this all the time,
only when it's necessary." ☰ under the picture, ⌘I, or a double-
click on a clip opens it; the state is this browser's
(phos_sbe_inspect). Width is whatever the monitors leave — see
sbeMonitorFit — clamped so it is neither a slot nor a sidebar. -->
<div class="sbe-rail" id="sbeRail" hidden>
<div class="sbe-inspect" id="sbeInspect"></div>
<div class="sbe-unplaced" id="sbeUnplacedWrap" hidden>
<div class="sbe-unplaced-head">Rendered but not on the timeline</div>
<div class="sbe-chiprow" id="sbeUnplaced"></div>
</div>
</div>
</div>
<!-- ============== THE CLIP BAR ==============================
"It's really hard when you are using the editor of Phosphene to
use the basic tools you actually need to use all the time, for
instance, unlink and link audio… We have some, but they are hidden
inside that menu, the toggle menu on the right. That is not a good
use."
Every verb below already existed — inside the inspector, in the
rail, beside a brightness slider and a zoom range, which is where
an NLE keeps PROPERTIES and not where it keeps VERBS. A cutter
reaches for split / lift / ripple / unlink / resync hundreds of
times in a session and for "font size" twice, and the two were
drawn identically in the same 212px column. So the verbs came out
and the properties stayed: see docs/EDITOR_TOOLBAR.md.
It is the row directly above the tracks, which is where Resolve
and Final Cut both put it, and it is the empty half of a row that
already existed rather than a new band of chrome — the height
budget in sbeFitMonitors measures its children, so a row that
costs 30px costs the picture 30px, and the picture is the thing
this screen is for.
EVERY BUTTON IS ALWAYS HERE. They DISABLE rather than disappear,
and a disabled button's tooltip says what would have to be true
for it to work — a control that vanishes teaches nothing, and the
inspector's habit of dropping a button it could not offer is
exactly why "delete sound" read as a feature that did not exist. -->
<!-- THE ICON SPRITE. Phosphor's geometry (the set the rest of the panel
uses, 256-unit grid), one <symbol> per glyph WITH ITS viewBox — the
first version used bare <g>s, so a 15px <svg> showed the top-left
15 units of a 24-unit drawing: "the icons are … deformed". Stroked in
currentColor at a width set once in .sbe-cbar-i. -->
<svg class="sbe-icons" aria-hidden="true" focusable="false"><defs>
<symbol id="ic-split" viewBox="0 0 256 256"><circle cx="76" cy="68" r="28"/><circle cx="76" cy="188" r="28"/><path d="M96.9 86.6 200 200M96.9 169.4 200 56"/></symbol>
<symbol id="ic-lift" viewBox="0 0 256 256"><rect x="20" y="168" width="60" height="56" rx="8"/><rect x="176" y="168" width="60" height="56" rx="8"/><rect x="104" y="168" width="48" height="56" rx="6" stroke-dasharray="20 16"/><path d="M128 136V36M88 76l40-40 40 40"/></symbol>
<symbol id="ic-ripple" viewBox="0 0 256 256"><rect x="20" y="168" width="72" height="56" rx="8"/><rect x="112" y="168" width="124" height="56" rx="8"/><path d="M224 88H116M156 48l-40 40 40 40M80 44v88"/></symbol>
<symbol id="ic-dup" viewBox="0 0 256 256"><path d="M168 168h48V40H88v48"/><rect x="40" y="88" width="128" height="128" rx="8"/></symbol>
<symbol id="ic-link" viewBox="0 0 256 256"><path d="M108 84H76a44 44 0 0 0 0 88h32M148 84h32a44 44 0 0 1 0 88h-32M88 128h80"/></symbol>
<symbol id="ic-unlink" viewBox="0 0 256 256"><path d="M96 84H68a44 44 0 0 0 0 88h28M160 84h28a44 44 0 0 1 0 88h-28M128 32v36M128 188v36"/></symbol>
<symbol id="ic-resync" viewBox="0 0 256 256"><path d="M176 104h48V56M224 104l-28.3-28.3a96 96 0 0 0-135.4-.5M80 152H32v48M32 152l28.3 28.3a96 96 0 0 0 135.4.5"/></symbol>
<symbol id="ic-mute" viewBox="0 0 256 256"><path d="M48 40l160 176M80 168H32a8 8 0 0 1-8-8V96a8 8 0 0 1 8-8h48l72-56v115M152 179v45l-57.6-44.8"/></symbol>
<symbol id="ic-sound" viewBox="0 0 256 256"><path d="M80 168H32a8 8 0 0 1-8-8V96a8 8 0 0 1 8-8h48l72-56v192ZM80 88v80M192 106.9a32 32 0 0 1 0 42.3M221.7 80a72 72 0 0 1 0 96"/></symbol>
<symbol id="ic-delsound" viewBox="0 0 256 256"><path d="M216 56H40M168 56V40a16 16 0 0 0-16-16h-48a16 16 0 0 0-16 16v16M200 56v152a8 8 0 0 1-8 8H64a8 8 0 0 1-8-8V56M100 124v40M128 100v88M156 124v40"/></symbol>
<symbol id="ic-points" viewBox="0 0 256 256"><path d="M24 200l64-56 72 32 72-64M180 28l40 40M220 28l-40 40"/><circle cx="88" cy="144" r="20" fill="currentColor" stroke="none"/><circle cx="160" cy="176" r="20" fill="currentColor" stroke="none"/></symbol>
<symbol id="ic-lock" viewBox="0 0 256 256"><rect x="40" y="88" width="176" height="128" rx="10"/><path d="M92 88V56a36 36 0 0 1 72 0v32"/><circle cx="128" cy="152" r="16" fill="currentColor" stroke="none"/></symbol>
<symbol id="ic-unlock" viewBox="0 0 256 256"><rect x="40" y="88" width="176" height="128" rx="10"/><path d="M92 88V56a36 36 0 0 1 69.1-14"/><circle cx="128" cy="152" r="16" fill="currentColor" stroke="none"/></symbol>
<symbol id="ic-facefix" viewBox="0 0 256 256"><circle cx="112" cy="144" r="84"/><circle cx="84" cy="128" r="13" fill="currentColor" stroke="none"/><circle cx="140" cy="128" r="13" fill="currentColor" stroke="none"/><path d="M76 170a44 44 0 0 0 72 0"/><path d="M208 12l10 30 30 10-30 10-10 30-10-30-30-10 30-10z" fill="currentColor" stroke="none"/></symbol>
<symbol id="ic-play" viewBox="0 0 256 256"><path d="M240 128a15.7 15.7 0 0 1-7.6 13.5L88.3 229.7a16 16 0 0 1-16.2.3A15.9 15.9 0 0 1 64 216.1V39.9a15.9 15.9 0 0 1 8.1-13.8 16 16 0 0 1 16.2.3l144.1 88.1A15.7 15.7 0 0 1 240 128Z" fill="currentColor" stroke="none"/></symbol>
<symbol id="ic-pause" viewBox="0 0 256 256"><rect x="48" y="32" width="64" height="192" rx="16" fill="currentColor" stroke="none"/><rect x="144" y="32" width="64" height="192" rx="16" fill="currentColor" stroke="none"/></symbol>
<symbol id="ic-close" viewBox="0 0 256 256"><path d="M200 56 56 200M200 200 56 56"/></symbol>
<symbol id="ic-source" viewBox="0 0 256 256"><rect x="16" y="48" width="224" height="160" rx="14"/><path d="M128 48v160"/><path d="M60 100v56l44-28z" fill="currentColor" stroke="none"/></symbol>
<symbol id="ic-inspect" viewBox="0 0 256 256"><rect x="16" y="48" width="224" height="160" rx="14"/><path d="M160 48v160M186 92h28M186 128h28M186 164h28"/></symbol>
<symbol id="ic-panels" viewBox="0 0 256 256"><rect x="16" y="48" width="224" height="160" rx="14"/><path d="M96 48v160"/><path d="M30 48h66v160H30a14 14 0 0 1-14-14V62a14 14 0 0 1 14-14z" fill="currentColor" stroke="none" opacity=".4"/></symbol>
<symbol id="ic-full" viewBox="0 0 256 256"><path d="M168 40h48v48M88 216H40v-48M216 168v48h-48M40 88V40h48"/></symbol>
<symbol id="ic-wave" viewBox="0 0 256 256"><path d="M28 112v32M68 80v96M108 36v184M148 68v120M188 96v64M228 116v24"/></symbol>
<symbol id="ic-keys" viewBox="0 0 256 256"><rect x="20" y="56" width="216" height="144" rx="12"/><path d="M60 98h12M100 98h12M140 98h12M180 98h16M60 130h12M100 130h56M180 130h16M76 162h104"/></symbol>
<symbol id="ic-history" viewBox="0 0 256 256"><path d="M128 80v48l40 24M72 104H32V64M67.6 192a88 88 0 1 0-1.8-126.2L32 104"/></symbol>
</defs></svg>
<!-- ONE ROW: the verbs, then the timeline's own controls, then the grab.
The verbs are ICONS — "the menu doesn't need to have the words on
each one … just when you hover over it, you see an explanation" —
and every tooltip carries the name, the consequence and the key.
The words come back in the More menu and the right-click menu, where
a list reads better than a row. The transport (play, mute, time)
moved under the Program monitor, which is where Premiere and Resolve
keep it, so this row and the old transport row are one row: 42px
back to the picture. `.sbe-toolrow` exists so the grab can hang
below a bar that clips its own overflow. -->
<div class="sbe-toolrow" id="sbeToolRow">
<div class="sbe-cbar" id="sbeCbar">
<!-- WHAT AM I ABOUT TO ACT ON. The bar's buttons are worth nothing
without it: "Ripple delete" over an unnamed selection is the one
gesture nobody should have to guess at. -->
<span class="sbe-cbar-who" id="sbeCbarWho">Nothing selected</span>
<span class="sbe-cbar-sep"></span>
<button type="button" class="sbe-cbar-btn" id="sbeCbSplit" onclick="sbeSplitHere()" aria-label="Split">
<svg class="sbe-cbar-i"><use href="#ic-split"/></svg><b>Split</b></button>
<button type="button" class="sbe-cbar-btn" id="sbeCbLift" onclick="sbeLiftSelected()" aria-label="Lift">
<svg class="sbe-cbar-i"><use href="#ic-lift"/></svg><b>Lift</b></button>
<button type="button" class="sbe-cbar-btn" id="sbeCbRipple" onclick="sbeRippleSelected()" aria-label="Ripple delete">
<svg class="sbe-cbar-i"><use href="#ic-ripple"/></svg><b>Ripple delete</b></button>
<button type="button" class="sbe-cbar-btn" id="sbeCbDup" onclick="sbeDuplicateSel()" aria-label="Duplicate">
<svg class="sbe-cbar-i"><use href="#ic-dup"/></svg><b>Duplicate</b></button>
<span class="sbe-cbar-sep"></span>
<button type="button" class="sbe-cbar-btn" id="sbeCbLink" onclick="sbeToggleAudioLink()" aria-label="Unlink sound">
<svg class="sbe-cbar-i"><use href="#ic-unlink" id="sbeCbLinkUse"/></svg><b>Unlink sound</b></button>
<button type="button" class="sbe-cbar-btn" id="sbeCbResync" onclick="sbeResyncSel()" aria-label="Resync sound">
<svg class="sbe-cbar-i"><use href="#ic-resync"/></svg><b>Resync sound</b></button>
<button type="button" class="sbe-cbar-btn" id="sbeCbMute" onclick="sbeToggleClipMute()" aria-label="Mute sound">
<svg class="sbe-cbar-i"><use href="#ic-mute" id="sbeCbMuteUse"/></svg><b>Mute sound</b></button>
<button type="button" class="sbe-cbar-btn" id="sbeCbDelSound" onclick="sbeDeleteStripSel()" aria-label="Delete sound">
<svg class="sbe-cbar-i"><use href="#ic-delsound"/></svg><b>Delete sound</b></button>
<button type="button" class="sbe-cbar-btn" id="sbeCbPoints" onclick="sbeClearPoints()" aria-label="Clear points">
<svg class="sbe-cbar-i"><use href="#ic-points"/></svg><b>Clear points</b></button>
<span class="sbe-cbar-sep"></span>
<button type="button" class="sbe-cbar-btn" id="sbeCbLock" onclick="sbeToggleLock()" aria-label="Lock">
<svg class="sbe-cbar-i"><use href="#ic-lock" id="sbeCbLockUse"/></svg><b>Lock</b></button>
<span class="sbe-cbar-sep"></span>
<button type="button" class="sbe-cbar-btn" id="sbeCbFaceFix" onclick="sbeFaceFixSel()" aria-label="Face Fix ×2">
<svg class="sbe-cbar-i"><use href="#ic-facefix"/></svg><b>Face Fix ×2</b></button>
<button type="button" class="sbe-cbar-btn" id="sbeCbRetake" onclick="sbeRetakeSel()" aria-label="Retake">
<svg class="sbe-cbar-i"><use href="#ic-history"/></svg><b>Retake</b></button>
<!-- OVERFLOW, NOT A DRAWER. Whatever the row cannot fit at this width
moves into it, in reverse priority order, and moves back out when
the pane is widened. At the Editor's normal width it is not even
rendered. -->
<button type="button" class="sbe-cbar-btn sbe-cbar-more" id="sbeCbMoreBtn" hidden
onclick="sbePopToggle('sbeCbarMenu', 'sbeCbMoreBtn')"
aria-haspopup="menu" title="The verbs this pane is too narrow to show">More<span class="sbe-car">▾</span></button>
<span class="ch-spacer" style="flex:1 1 auto"></span>
<label class="check sbe-snap" data-shortcut="editor.snap"
title="Clips you drag snap to the beat grid. ⌥ while dragging ignores it">
<input type="checkbox" id="sbeSnapOn" checked onchange="sbePaint()"> Snap
</label>
<!-- The two sliders an editor expects: the scrollbar on the track
below moves the view, this one changes the scale. All the way
left is the whole film in the window, whatever the window is. -->
<span class="sbe-zoom">
<button type="button" class="ghost-btn" onclick="sbeZoom(-1)" title="Zoom out" data-shortcut="editor.zoom">−</button>
<input type="range" id="sbeZoomRange" min="0" max="1000" step="1" value="500"
aria-label="Timeline zoom"
title="Zoom. Fully left fits the whole __SEQ__ in the window. + and − on the keyboard. Over the track: shift + wheel pans, alt + wheel or a trackpad pinch zooms."
oninput="sbeZoomSlide(this.value)">
<button type="button" class="ghost-btn" onclick="sbeZoom(1)" title="Zoom in" data-shortcut="editor.zoom">+</button>
</span>
<span class="sbe-info" id="sbeApprox" tabindex="0"
title="The preview is approximate: the browser lands within a few frames of each cut, and a very short shot may hold the previous frame for a moment. The render is exact.">i</span>
<button type="button" class="sbe-tbtn" id="sbeKeysBtn"
onclick="sbePopToggle('sbeKeysPop', 'sbeKeysBtn')"
aria-haspopup="menu" aria-label="Keys" title="Every gesture this timeline answers to">
<svg class="sbe-cbar-i"><use href="#ic-keys"/></svg></button>
</div>
<!-- THE TIMELINE'S TOP EDGE, as a handle. Positioned over the 8px gap
below this row so it costs the column no height of its own. -->
<div class="sbe-tl-grab" id="sbeTlGrab" role="separator"
aria-orientation="horizontal"
aria-label="Resize the timeline — drag up for taller lanes"
tabindex="0"
title="Drag up to make the timeline taller — the sound strips take the biggest share. Double-click to reset. ↑ / ↓ when focused."
onpointerdown="sbeTlGrabDown(event)"
onpointermove="sbeTlGrabMove(event)"
onpointerup="sbeTlGrabUp(event)"
onpointercancel="sbeTlGrabUp(event)"
ondblclick="sbeTlReset()"
onkeydown="sbeTlGrabKey(event)"></div>
</div>
<div class="sbe-tlwrap" id="sbeTlWrap">
<div class="sbe-gutter" id="sbeGutter">
<div class="sbe-gh sbe-gh-top"></div>
<div class="sbe-gh sbe-gh-ov">
<span class="sbe-gh-tag"><i>V2</i><b>Overlay</b></span>
</div>
<div class="sbe-gh sbe-gh-pic">
<span class="sbe-gh-tag"><i>V1</i><b>Picture</b></span>
<span class="sbe-gh-sub" id="sbeHeadPic"></span>
</div>
<!-- THE SOUND AREA'S SIZE, on the head of the area it acts on. The
lanes do this by themselves — thin while nobody is on sound, full
height the moment anything is — and this pins one answer when the
owner wants one. Its glyph, its tooltip and aria-expanded are
painted by sbePaintHeads; the keys come from the one SHORTCUTS
table (editor.soundLanes). -->
<div class="sbe-gh sbe-gh-aud">
<span class="sbe-gh-tag"><i>A1a</i><b>Clip sound A</b>
<button type="button" class="sbe-gh-more sbe-asize" id="sbeAudioSize"
onclick="sbeSoundModeToggle()" aria-expanded="false"
title="Make the sound lanes small — A1, A2 and every audio track become thin strips so the picture gets the height. They come back the moment you touch a sound.">▾</button>
</span>
<span class="sbe-gh-sub" id="sbeHeadAud"></span>
</div>
<!-- CLIP SOUND LANE B. A1 is two strip lanes: a new timeline lays its
clips' sound A, B, A… so neighbours can overlap and crossfade, and
this head carries the one click that does the same to a timeline
cut before there were two. -->
<div class="sbe-gh sbe-gh-aud sbe-gh-audb">
<span class="sbe-gh-tag"><i>A1b</i><b>Clip sound B</b></span>
<button type="button" class="ghost-btn sbe-gh-alt" id="sbeAltLanes"
onclick="sbeAlternateSel()"
title="Alternate sound lanes — lays every clip's sound A, B, A, B… in film order, so neighbouring shots sit on different lanes and can overlap and crossfade. Nothing moves in time; one Undo puts it back.">Alternate A/B</button>
</div>
<div class="sbe-gh sbe-gh-mus">
<span class="sbe-gh-tag"><i>A2</i><b>Music</b>
<!-- THE MUSIC LEVEL, AT EVERY LANE HEIGHT. The Level slider below
lives in a head that picture mode shrinks to 20 px, so
"lower the music" had no visible control at all (2 Nov). This
chip shows the level and opens the slider. -->
<button type="button" class="sbe-bed-chip" id="sbeBedChip"
onclick="sbePopToggle('sbeBedPop', 'sbeBedChip')"
aria-haspopup="dialog"
title="Music volume — click to turn the music up or down">100%</button>
<button type="button" class="sbe-gh-more" id="sbeMusicMore"
onclick="sbePopToggle('sbeMusicMenu', 'sbeMusicMore')"
aria-haspopup="menu"
title="The file, Change…, Prepare — the soundtrack's own controls">▾</button>
</span>
<span class="sbe-music-name" id="sbeMusicPath" title="">no soundtrack</span>
<select class="sb-input sbe-gh-mode" id="sbeMusicMode"
onchange="sbeSetMusicMode(this.value)"
title="Under: the clips keep their sound and the track plays beneath it. Replace: the track is the only sound.">
<option value="under">under the clips</option>
<option value="replace">replaces clip sound</option>
</select>
<!-- THE TWO NUMBERS THE RENDERER USED TO KEEP TO ITSELF. Until
today the ffmpeg graph held every `under` bed at 0.20 and
ducked it against the dialogue; neither decision was in any
document, on any screen, or in the preview. They are controls
now, and they live HERE because this head is already where the
soundtrack's other controls are — the file, Change…, Prepare
and the mode. -->
<div class="sbe-mix-row">
<label class="sbe-mix-lvl"
title="How loud the soundtrack plays. 100% is the file's own level; the render applies exactly this and so does the preview.">
<span>Level</span>
<input type="range" id="sbeBedGain" min="0" max="100" step="1"
value="100" aria-label="Music bed level"
oninput="sbeBedGainSlide(this.value)"
onchange="sbeBedGainCommit(this.value)">
<b id="sbeBedGainNum">100%</b>
</label>
<label class="check sbe-mix-duck"
title="Steps the music back wherever a clip's own sound is playing, and lets it up again after. Off by default — an authored fade or level line on the bed switches it off, because two curves moving one level is nobody's mix.">
<input type="checkbox" id="sbeBedDuck"
onchange="sbeSetBedDuck(this.checked)">
<span>Duck under dialogue</span>
</label>
<span class="sbe-mix-note" id="sbeBedDuckNote" hidden></span>
</div>
</div>
<!-- A3, A4, …: THE AUDIO TRACKS' HEADS. Painted by sbePaintTracks —
name, mute, level, remove — each as tall as its lane. -->
<div class="sbe-trk-heads" id="sbeTrackHeads"></div>
<div class="sbe-gh sbe-gh-add">
<button type="button" class="ghost-btn" onclick="sbeTrackAdd()"
title="A new, empty audio track under the others. Sounds on different tracks play together; sounds on one track play one at a time.">+ Add audio track</button>
<button type="button" class="sbe-gh-more" id="sbeSoundMore"
onclick="sbePopToggle('sbeSoundMenu', 'sbeSoundMore')"
aria-haspopup="menu"
title="Add sound file… or Room tone… — a sound from this Mac, or an ambience bed under the whole film">♪</button>
</div>
<div class="sbe-gh sbe-gh-foot"></div>
</div>
<div class="sbe-tl" id="sbeScroll">
<!-- TOP TO BOTTOM: ruler, picture, sound. Every NLE ever made stacks
it that way and the owner read the old order — music ABOVE the
clips — as the app not knowing the convention: "it is unusual
that the music is above the clips; it's not normal." The order
here IS the order on screen (the inner is a flex column), so the
fix is the markup, not a transform. -->
<div class="sbe-tl-inner" id="sbeInner">
<div class="sbe-ruler" id="sbeRuler"></div>
<!-- THE OVERLAY LANE, ABOVE THE PICTURE, because that is where it
is in the film: a second video track whose items composite over
the track below. -->
<div class="sbe-ovlane" id="sbeOverlayLane"
onpointerdown="sbeOnOvDown(event)"
onpointermove="sbeOnOvMove(event)"
onpointerup="sbeOnOvUp(event)"
onpointercancel="sbeOnOvUp(event)"></div>
<div class="sbe-track" id="sbeTrack"></div>
<!-- THREE LAYERS, TOP TO BOTTOM: video blocks, each clip's own
sound, the music. The owner's list exactly. A clip's strip sits
directly under its block and moves with it — until it is
unlinked, which is the whole of the J-cut and the L-cut. -->
<!-- A1 IS TWO LANES IN ONE BOX: clip sound A on top, B below. Sounds
on one lane play one at a time; across the two they overlap and
mix — the A/B roll a sound dissolve is made of. -->
<div class="sbe-alane" id="sbeAudioLane"></div>
<!-- The soundtrack lane. The canvas is the picture of the track and
the block over it is the OBJECT: drag it to place the music,
pull either end to trim it. Two elements rather than one canvas
because a grip has to be hit-tested, and hit-testing a painted
rectangle is a job the DOM already does. -->
<div class="sbe-lane" id="sbeMusicLane">
<canvas class="sbe-wave" id="sbeWave" height="72"></canvas>
<div class="sbe-wave-none" id="sbeWaveNone" hidden></div>
<!-- THE BED IS A STRIP NOW, not a rectangle you can only slide.
"Fade the music out under the last shot" is the most ordinary
request in editing and was, until this, impossible: the model
read `audio.afx`, normalised it and could render it, and there
was no markup anywhere that could produce one. Same three
affordances the clip strips grew — two corner fade handles in
the band, a level line you can hit, and points on it — built
out of the SAME geometry (`.sbe-fade-band`, the grip skirt
derivation, the 22px square, SBE_LVL_PAD) rather than a fourth
set of numbers that could drift on its own. -->
<div class="sbe-music-clip" id="sbeMusicClip" hidden>
<div class="sbe-mc-name" id="sbeMusicName"></div>
<div class="sbe-mc-lvl" id="sbeMusicLevel"></div>
<div class="sbe-grip l"></div><div class="sbe-grip r"></div>
<div class="sbe-fade-band" id="sbeMusicFades">
<div class="sbe-fade-h in" data-bfade="in"></div>
<div class="sbe-fade-h out" data-bfade="out"></div>
</div>
</div>
</div>
<!-- A3, A4, …: THE AUDIO TRACKS, under the music, and the row that
makes a new one when a sound is dropped on it. Any number of
strips per track; tracks play together, a track plays one at a
time. Painted by sbePaintTracks. -->
<div class="sbe-tracks" id="sbeTracks"></div>
<div class="sbe-head-line" id="sbeHead" style="left:0"></div>
</div>
</div>
</div>
</div>
</div>
<!-- Combined filter + title row. One row, three regions: title +
count, kind chips (All/Videos/Photos), visible/hidden segmented
toggle on the right. Replaces the previous two-row stack. -->
<div class="carousel-wrap">
<div class="carousel-head">
<h3 id="carouselTitle">Outputs</h3>
<!-- Kind chips, ID + onclick names preserved. -->
<div class="stage-outputs-filter" id="mainOutputsFilter">
<button type="button" id="mainOutputsFilterAll" class="active"
onclick="setMainOutputsFilter('all')">All</button>
<button type="button" id="mainOutputsFilterVideos"
onclick="setMainOutputsFilter('videos')">Videos</button>
<button type="button" id="mainOutputsFilterPhotos"
onclick="setMainOutputsFilter('photos')">Photos</button>
<button type="button" id="mainOutputsFilterAudio"
onclick="setMainOutputsFilter('audio')">Audio</button>
</div>
<!-- SEARCH, over everything the sidecar knows: prompt words, mode,
quality, engine, size, seed, LoRA and character names. A
substring test on one lower-cased string per output, so it is
free per keystroke; the title says how many match. -->
<input type="search" class="sb-input outputs-search" id="outputsSearch" data-shortcut="search.focus" title="Search outputs"
placeholder="Search prompts, models, LoRAs, sizes…" aria-label="Search outputs"
spellcheck="false" oninput="setOutputsQuery(this.value)" onsearch="setOutputsQuery(this.value)">
<span class="ch-spacer"></span>
<!-- "Show all (N)" — surfaces older renders that /status's polling
fast path (newest 60) doesn't include. The button is hidden
when total == shown; poll() reveals it with the live count
whenever an older entry exists. Clicking fetches /outputs
(no polling on that endpoint) and re-renders the carousel
with the full unified list. -->
<!-- 4.18.0: the gallery plays by itself, full size (lbPlayAll). -->
<button type="button" class="ghost-btn outputs-playall-btn" id="outputsPlayAllBtn"
title="Play all — every clip once, each photo for a few seconds, full size (P pauses, Esc closes)"
onclick="lbPlayAll()"><svg class="ph" aria-hidden="true"><use href="#ph-play-fill"/></svg>Play all</button>
<button type="button" class="ghost-btn" id="outputsShowAllBtn"
style="display:none" title="Load every render in the gallery (not just the newest 60)"
onclick="outputsLoadAll()">Show all</button>
<button type="button" class="open-folder-btn" id="openOutputsFolderBtn"
title="Reveal the outputs folder in Finder"
aria-label="Reveal the outputs folder in Finder"
onclick="openOutputsFolder()">
<svg class="ph" aria-hidden="true"><use href="#ph-folder-simple"/></svg>
</button>
<!-- VC-04: the eye icon on the player still hides a clip with no way
back other than this. Shown only once something is hidden
(hidden_count > 0), so it costs nothing on the common path where
nobody has hidden anything. Toggling re-polls filterMode='hidden',
which /status and the carousel title already understood before
this control existed (they just had nothing pointed at them). -->
<button type="button" class="ghost-btn" id="hiddenFilterToggle"
style="display:none" onclick="toggleHiddenFilter()">Hidden</button>
</div>
<div class="carousel" id="carousel"></div>
<!-- MUSIC STUDIO — the player bar. Sticks to the bottom of the outputs
column while you browse; one <audio> for every song, a real
waveform (decoded once per song, cached), click to seek, prev/next
through the list. Shown the first time a song is selected. -->
<div class="music-bar" id="musicBar" hidden>
<div class="music-bar-cover" id="musicBarCover" aria-hidden="true"></div>
<div class="music-bar-text">
<div class="music-bar-title" id="musicBarTitle"></div>
<div class="music-bar-style" id="musicBarStyle"></div>
</div>
<div class="music-bar-controls">
<button type="button" class="music-bar-btn" title="Previous" aria-label="Previous song" onclick="musicBarStep(-1)"><svg width="14" height="14" viewBox="0 0 16 16" aria-hidden="true"><path d="M3 2.5v11M13 2.5 5 8l8 5.5z" fill="currentColor"/></svg></button>
<button type="button" class="music-bar-btn play" id="musicBarPlay" title="Play" aria-label="Play or pause" onclick="musicBarTogglePlay()"><svg width="14" height="14" viewBox="0 0 16 16" aria-hidden="true"><path d="M4 2.5 L13.5 8 L4 13.5 Z" fill="currentColor"/></svg></button>
<button type="button" class="music-bar-btn" title="Next" aria-label="Next song" onclick="musicBarStep(1)"><svg width="14" height="14" viewBox="0 0 16 16" aria-hidden="true"><path d="M13 2.5v11M3 2.5 11 8l-8 5.5z" fill="currentColor"/></svg></button>
</div>
<canvas class="music-bar-wave" id="musicBarWave" onclick="musicBarSeek(event)" title="Click to seek"></canvas>
<div class="music-bar-time" id="musicBarTime">0:00 / 0:00</div>
<audio id="musicBarAudio" preload="metadata"></audio>
</div>
<!-- The ⋯ menu, one for every song row; positioned by musicMenuOpen(). -->
<div class="song-menu" id="songMenu" hidden role="menu"></div>
</div>
</section>
<!-- Lightbox for stage outputs — plays a finished mp4 full-size on click.
Refine button references the playing clip in the composer so the
user can ask the agent for a variation while watching. -->
<!-- ============== MANAGE CHARACTERS MODAL (2026-05-18) ==============
Opened by the pencil icon in the avatar strip. Lists every trained
character with rename + delete actions. Rename only touches the
bundle.json display name (trigger word is baked into the weights);
delete removes the face + audio LoRAs + sidecars + voice clip +
avatar cache, but leaves state/train_character/<id>/ alone so the
user keeps their dataset for retraining. -->
<div id="charactersManageModal" class="models-modal" style="display:none"
role="dialog" aria-modal="true" aria-labelledby="charactersManageTitle"
onclick="if(event.target===this) closeCharactersManageModal()">
<div class="models-card" style="width: min(640px, 96vw)">
<div class="models-head">
<h2 id="charactersManageTitle">Manage characters</h2>
<button class="ghost-btn" onclick="closeCharactersManageModal()">Close</button>
</div>
<div class="models-hint">
Rename changes the display name only — the trigger word is locked
into the trained weights and can't be changed. Delete removes the
LoRA files; your training dataset under <code>state/train_character/</code>
stays intact so you can retrain.
</div>
<div class="chars-manage-list" id="charactersManageList">
<div class="hint">Loading…</div>
</div>
</div>
</div>
<!-- ============== CIVITAI MODAL ============== -->
<!-- LoRA discovery + install modal. Hits /civitai/search to populate
the grid and /civitai/download to fetch a selected LoRA into
mlx_models/loras/ with a sidecar JSON capturing the metadata. -->
<div id="civitaiModal" class="models-modal" style="display:none"
role="dialog" aria-modal="true" aria-labelledby="civitaiModalTitle"
onclick="if(event.target===this) closeCivitaiModal()">
<div class="models-card" style="width: min(960px, 96vw)">
<div class="models-head">
<h2 id="civitaiModalTitle">Browse CivitAI for LTX 2.3 LoRAs</h2>
<button class="ghost-btn" onclick="closeCivitaiModal()">Close</button>
</div>
<div class="models-hint">
Pick a source and an engine, search, Install. Installed LoRAs land in
<code id="civitaiTargetDir">mlx_models/loras/</code> with their notes and show up in the picker.
</div>
<!-- Inline API-key banner. CivitAI requires a token to download LoRAs
(even SFW ones). Three states, all rendered in the same slot by
renderCivitaiAuthBanner():
- missing: amber, has an input + Save button
- set: green checkmark with a "change" link that re-shows the input
- error: red, shown after a failed test, with re-input + retry
The actual key is POSTed to /settings (same endpoint the cog
menu uses) so there's a single source of truth on disk. -->
<div id="civitaiAuthBanner" class="civitai-auth" style="display:none"></div>
<!-- Family pill row (image context only). Click a pill to scope the
result set to a specific engine family (Qwen / HiDream / All).
Shown / hidden by civitaiRenderFamilyPills() on each open. -->
<div class="civitai-toolbar">
<div class="civitai-seg" id="civitaiSourceRow" style="display:none" aria-label="Source">
<button type="button" class="pill-btn active" data-civitai-source="civitai" onclick="civitaiSetSource('civitai')">CivitAI</button>
<button type="button" class="pill-btn" data-civitai-source="huggingface" onclick="civitaiSetSource('huggingface')" title="Search Hugging Face — a name, an author (author:someone) or an owner/repo">Hugging Face</button>
</div>
<div class="civitai-seg" id="civitaiFamilyRow" style="display:none" aria-label="Engine"></div>
<!--pinokio-only-->
<label class="toggle-pill" id="civitaiNsfwPill" data-spicy-only hidden>
<input type="checkbox" id="civitaiNsfw">
<span class="toggle-dot"></span>
<span>Show NSFW</span>
</label>
<!--/pinokio-only-->
</div>
<!-- WHAT KIND, for the Hugging Face source: read from each repo's name and
tags on the server; filtered here without another fetch. -->
<div class="civitai-chips" id="civitaiKindRow" style="display:none">
<button type="button" class="pill-btn active" data-civitai-kind="all" onclick="civitaiSetKind('all')">All</button>
<button type="button" class="pill-btn" data-civitai-kind="character" onclick="civitaiSetKind('character')">Characters</button>
<button type="button" class="pill-btn" data-civitai-kind="style" onclick="civitaiSetKind('style')">Styles</button>
<button type="button" class="pill-btn" data-civitai-kind="motion" onclick="civitaiSetKind('motion')">Motion</button>
<button type="button" class="pill-btn" data-civitai-kind="speed" onclick="civitaiSetKind('speed')">Speed</button>
<button type="button" class="pill-btn" data-civitai-kind="other" onclick="civitaiSetKind('other')">Other</button>
<label class="toggle-pill" title="Only repos that ship an example clip or image"><input type="checkbox" id="civitaiWithExample" onchange="civitaiSetKind()"><span class="toggle-dot"></span><span>With example</span></label>
</div>
<!-- A search bar that reads as one: magnifier, a placeholder that says
where it searches, and a compact Search button. The field wraps the
icon + input so the input can grow; Search must not use .pill-btn
(those are width:100% form chips and would swallow the row). -->
<div class="civitai-search-bar" role="search">
<div class="civitai-search-field">
<svg class="civitai-search-icon" width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true">
<circle cx="7" cy="7" r="4.5" stroke="currentColor" stroke-width="1.6"/>
<path d="M10.5 10.5 L14 14" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/>
</svg>
<input type="search" id="civitaiQuery" placeholder="Search CivitAI — a name, a style, a creator… then Enter"
aria-label="Search CivitAI"
oninput="if(this._t) clearTimeout(this._t); this._t = setTimeout(civitaiSearch, 350)"
onkeydown="if(event.key==='Enter'){ event.preventDefault(); civitaiSearch(); }">
</div>
<button type="button" class="ghost-btn civitai-search-go" onclick="civitaiSearch()" title="Search CivitAI">Search</button>
</div>
<div class="civitai-grid" id="civitaiGrid">
<div class="hint">Loading…</div>
</div>
<div class="civitai-status-line" id="civitaiStatus"></div>
<div style="display:flex; justify-content:center; margin-top:14px">
<button type="button" class="ghost-btn" id="civitaiLoadMore"
style="display:none" onclick="civitaiLoadMore()">Load more</button>
</div>
</div>
</div>
<!-- ============== SETTINGS MODAL ============== -->
<!-- Opened by the gear icon in the header. Lets users pick output codec
presets (Standard / Video production / Web) or set custom pix_fmt + crf.
Persisted to panel_settings.json; the helper subprocess restarts on
codec change so the new ffmpeg args take effect on next job. -->
<div id="settingsModal" class="models-modal" style="display:none"
role="dialog" aria-modal="true" aria-labelledby="settingsModalTitle"
onclick="if(event.target===this) closeSettingsModal()">
<div class="models-card">
<div class="models-head">
<h2 id="settingsModalTitle">Settings</h2>
<button class="ghost-btn" onclick="closeSettingsModal()">Close</button>
</div>
<div class="models-hint">
Models, rendering, output format, accounts and privacy. Saved to
<code>panel_settings.json</code> and applied to every new render.
Files already in the gallery are not re-encoded.
</div>
<!-- SYS-28: reordered 2026-09-29 to match how people actually reach
for these, not the order the code was written in. Was: Models,
Output format, Memory/speed, Model files, Storage, API tokens,
Spicy, Appearance, Completion alerts, Analytics, Custom — the
modal opened on codec presets (SYS-28's own complaint) and split
Storage from the Models section it exists to explain. Now:
Models & storage (what's on disk) -> Rendering (live preview,
H3 model, and Output format + its Custom detail, all about what
a render produces) -> Accounts (tokens) -> Privacy (Spicy +
Anonymous analytics, grouped — both are "what leaves/shows on
this machine") -> Appearance -> Completion alerts. -->
<!-- Models — a real destination for every "Settings → Models" pointer in
the app's own error and banner copy (SYS-08: 16 of those pointers led
nowhere, because this section didn't exist). Opens the existing
Models modal rather than duplicating its content here. -->
<div class="settings-section">
<h3>Models</h3>
<div class="hint" style="margin-bottom:8px">
What's downloaded, what else this Mac can run, and repairing a file
that downloaded incomplete.
</div>
<div class="settings-row">
<button type="button" class="primary-btn" onclick="openModelsModal();">Open Models</button>
</div>
</div>
<!-- Storage stays visible even when there is nothing to reclaim. -->
<div class="settings-section" id="settingsStorageSection" style="display:none">
<h3>Storage</h3>
<div class="hint" style="margin-bottom:8px">
Model folders on this Mac, including files left behind by older installs.
Cleanup removes only superseded files. Your outputs and LoRAs stay on disk.
</div>
<ul class="models-list" id="storageList"></ul>
<div class="models-foot" id="storageFoot" role="status" aria-live="polite"></div>
<button type="button" class="ghost" id="storageCleanup" onclick="cleanupSupersededModels()" disabled>Free up 0 GB</button>
</div>
<div class="settings-section">
<h3>Model files</h3>
<div class="hint" style="margin-bottom:8px">
Verify every installed model weight against the official checksums on
Hugging Face. A file that's the right size but the wrong content — an
interrupted, mirrored, or stale download — decodes to garbled / "mosaic"
video. This catches it and offers a one-click re-download. Takes 1–2
minutes (it hashes every file).
</div>
<div class="settings-row">
<button type="button" class="primary-btn" id="deepVerifyBtn"
onclick="startDeepVerify()">Verify model files (checksum)</button>
<span class="hint" id="deepVerifyStatus" style="margin-left:10px"></span>
</div>
</div>
<!-- Phosphene Bench (bench.py, panel/routes_bench.py, webapp/js/bench.js):
a fixed, versioned benchmark of this Mac. Its own window, because it
runs for minutes and ends in a result card. -->
<div class="settings-section" id="settingsBenchSection">
<h3>Phosphene Bench</h3>
<div class="hint" style="margin-bottom:8px">
Run a fixed set of video and image jobs on your Mac and see the times.
</div>
<div class="settings-row">
<button type="button" class="primary-btn" onclick="openBenchModal();">Open Phosphene Bench</button>
</div>
</div>
<div class="settings-section">
<h3>Memory / speed</h3>
<!-- The Memory-policy select that lived here was REMOVED (owner ruling
2026-09-01): the helper never read the value, so Safe/Auto/Fast
changed nothing about any render — the engine's own budget-aware
decoder has owned this since the v0.14.8 pin. A control that does
nothing teaches users not to trust the ones that do. -->
<div class="settings-row" style="margin-top:10px">
<label>Live preview</label>
<select id="settingsLivePreview" style="flex:1">
<option value="on">On — show the shot as it forms</option>
<option value="off">Off</option>
</select>
</div>
<!-- SYS-28: the select above used to read as "On" whenever the SAVED
preference was on, even when the 22 MB decoder (TAE) is missing
from disk and every render is silently preview-less — the same gap
the Now card's `preview_state.reason === 'missing_decoder'` branch
(preview.js) already covers on the main screen. Settings had no
equivalent, so a user who only ever opens Settings never learns
why the toggle "does nothing." BOOT.ltx.preview_state is server-
computed (mlx_ltx_panel.py, live_preview_state()) — this just
surfaces it here too, with the same one-click fix. -->
<div class="hint" id="settingsLivePreviewNote" style="margin-top:6px" hidden></div>
<!-- H3 DiT. The setting has been honoured by `h3_dit_choice()` and
validated by the settings handler since it was added, and its own
docstring says "`h3_dit` in Settings" — but no control was ever
built, so the only way to reach it was a hand-written POST. The
owner watched H3 sit at ~50 GB and asked why we could not reduce it;
the answer was a setting he could not see. Numbers here are measured,
not estimated (640x384/73f, seed 424242, same-seed A/B). -->
<div class="settings-row" style="margin-top:10px" id="settingsH3DitRow" hidden>
<label>Hailuo H3 model</label>
<select id="settingsH3Dit" style="flex:1">
<option value="auto">Automatic — best quality this Mac can hold</option>
<option value="bf16">Full (bf16) — 42 GiB peak</option>
<option value="q8">Compact (Q8) — 21 GiB peak, half the memory</option>
</select>
</div>
<div class="hint" id="settingsH3DitHint" style="margin-top:6px" hidden>
Measured on the same prompt and seed: <b>Full 38.9 GiB</b> peak in 196.9 s
versus <b>Compact 21.4 GiB</b> in 200.1 s — <b>45 % less memory for 1.6 %
more time</b>. Automatic prefers the Compact engine on every size of Mac;
Full runs only when you choose it here — or when the Compact engine is
not built on this install (re-run the H3 engine Install to build it).
The memory Compact gives back is memory H3 was holding, not memory it
needed.
</div>
<div class="hint" style="margin-top:6px">
Never changes the result — the clip is byte-for-byte the same either way.
Costs a fraction of the render: about 0.2 % on High, a few per cent on a
short draft, where the render is short enough for the decode to show.
Turning it off also removes the Stop-early button.
</div>
</div>
<div class="settings-section">
<h3>Output format</h3>
<div class="preset-grid" id="settingsPresets">
<!-- populated by openSettingsModal() from /settings -->
</div>
</div>
<div class="settings-section" id="settingsCustomSection" style="display:none">
<h3>Custom (advanced)</h3>
<div class="settings-row" style="margin-bottom:10px">
<label>pix_fmt</label>
<select id="settingsPixFmt" style="flex:1">
<option value="yuv420p">yuv420p — web standard, broad support</option>
<option value="yuv422p">yuv422p — pro, more chroma than 420p</option>
<option value="yuv444p">yuv444p — full chroma, no subsampling</option>
<option value="yuv420p10le">yuv420p10le — 10-bit, HDR-ready</option>
<option value="yuv422p10le">yuv422p10le — 10-bit pro</option>
<option value="yuv444p10le">yuv444p10le — 10-bit, full chroma</option>
</select>
</div>
<div class="settings-row">
<label>CRF</label>
<input type="range" id="settingsCrfRange" min="0" max="30" step="1"
style="flex:1; width:auto" oninput="document.getElementById('settingsCrfNum').value = this.value">
<input type="number" id="settingsCrfNum" min="0" max="30" step="1"
style="width:60px"
oninput="document.getElementById('settingsCrfRange').value = this.value">
</div>
<div class="hint" style="margin-top:6px">
0 = mathematically lossless · 18 = visually lossless ·
23 = web default · 28+ = lossy
</div>
</div>
<div class="settings-section">
<h3>API tokens</h3>
<div class="hint" style="margin-bottom:8px">
Saved locally in <code>panel_settings.json</code>. Never sent
anywhere except as auth headers to civitai.com / huggingface.co.
Power users can override with <code>CIVITAI_API_KEY</code> /
<code>HF_TOKEN</code> env vars; the saved value here wins when
both are set.
</div>
<!-- CivitAI token row -->
<div class="token-row">
<div class="token-label">
<span>CivitAI API key</span>
<span class="token-status" id="civitaiKeyStatus">—</span>
</div>
<div class="token-row-input">
<input type="password" id="civitaiKeyInput" autocomplete="off"
placeholder="paste key here…"
oninput="onTokenInput('civitai')">
<button type="button" class="ghost-btn" id="civitaiKeyToggle"
onclick="toggleTokenVisibility('civitaiKeyInput', this)">show</button>
<button type="button" class="primary-btn token-savetest"
onclick="testToken('civitai')" title="Save the pasted key and verify it with CivitAI">save & test</button>
<button type="button" class="ghost-btn" id="civitaiKeyClear"
onclick="clearToken('civitai')" style="display:none">clear</button>
</div>
<div class="hint" id="civitaiTestResult">
Required for installing CivitAI LoRAs.
Get one at <a href="https://civitai.com/user/account" target="_blank" rel="noopener">civitai.com/user/account</a>
(Account → API Keys → Add).
</div>
</div>
<!-- HF token row -->
<div class="token-row">
<div class="token-label">
<span>Hugging Face token</span>
<span class="token-status" id="hfTokenStatus">—</span>
</div>
<div class="token-row-input">
<input type="password" id="hfTokenInput" autocomplete="off"
placeholder="hf_…"
oninput="onTokenInput('hf')">
<button type="button" class="ghost-btn" id="hfTokenToggle"
onclick="toggleTokenVisibility('hfTokenInput', this)">show</button>
<button type="button" class="primary-btn token-savetest"
onclick="testToken('hf')" title="Save the pasted token and verify it with Hugging Face">save & test</button>
<button type="button" class="ghost-btn" id="hfTokenClear"
onclick="clearToken('hf')" style="display:none">clear</button>
</div>
<div class="hint" id="hfTestResult">
<!-- SYS-28: this used to say "HDR + Control LoRAs" needed a token,
which contradicted the Models modal — the Control mode's own
Union-Control IC-LoRA is Lightricks' one OFFICIAL UN-GATED
weight (see CURATED_LORAS["union-control"], mlx_ltx_panel.py:
"Un-gated official weight — no HF token needed"), downloaded
token-less at install time. Only HDR and Motion Track Control
are actually gated (CURATED_LORAS["hdr"|"motion-track"]). -->
Required for gated LoRAs (Lightricks HDR + Motion Track Control).
The Control mode's Union-Control weight is official and un-gated —
no token needed for that one.
Get one at <a href="https://huggingface.co/settings/tokens" target="_blank" rel="noopener">huggingface.co/settings/tokens</a>
— read access is enough.
</div>
</div>
</div>
<!--pinokio-only-->
<!-- Spicy mode — gates NSFW LoRA visibility in the CivitAI browser.
Default OFF. Turning ON requires an explicit confirm-click pattern
so a casual visitor / kid can't toggle it by a stray click. The
server enforces the gate independently in _civitai_search, so a
tampered client can't bypass this. -->
<div class="settings-section">
<h3>Spicy mode <span class="hint" style="font-weight:400">(adult content)</span></h3>
<div class="hint" style="margin-bottom:10px">
When OFF, the CivitAI LoRA browser hides NSFW models entirely —
the "Show NSFW" toggle disappears and any NSFW result the API
returns is filtered out. When ON, you can choose per-search whether
to include NSFW results. The server enforces this gate even if the
client is tampered with.
</div>
<div class="spicy-row">
<span class="spicy-state" id="spicyStateBadge">OFF</span>
<button type="button" class="ghost-btn" id="spicyToggleBtn"
onclick="toggleSpicyMode()" style="margin-left:auto">
Enable Spicy mode
</button>
</div>
<div class="hint" id="spicyHint" style="margin-top:8px; display:none"></div>
</div>
<!--/pinokio-only-->
<!-- Anonymous usage analytics. Default ON, one click to turn off, and
the copy below is the whole truth about what leaves the machine —
if this list and docs/ANALYTICS.md ever disagree, the code is the
bug. The maintainer key rows live behind a <details> because
ordinary users have no use for them; a fork that wants its own
receiver, or the project owner switching the fleet on, pastes
keys there. Reuses the spicy-row / token-row markup so this
section inherits the modal's existing styling with no new CSS. -->
<div class="settings-section">
<h3>Anonymous usage analytics</h3>
<div class="hint" style="margin-bottom:10px">
Sends anonymous counts so bugs in the field get noticed: panel
version, hardware class (e.g. <em>M4 Max, 64 GB</em>), which
model generation you render with, which optional packs are
installed, and for each render the engine,
tier, resolution, frame count and a coarse duration bucket —
plus the first line of the error when one fails.
<b>Never your prompts, filenames, paths, images or video.</b>
You are a random ID, generated on this Mac and tied to nothing.
The panel sends no location, but the address your computer
connects from resolves to a <b>country and city</b> at the
receiver, and those are kept next to the event; the address
itself is discarded. That is the one thing on this list the
panel doesn't send and can't stop — turning analytics off is
what stops it, because then no request is made at all.
<span data-hide-mac-app>Everything the panel would send is also written in plain text to
<code>state/usage-log.jsonl</code> so you can read it yourself;
the full schema is in <code>docs/ANALYTICS.md</code>.</span>
</div>
<div class="spicy-row">
<span class="spicy-state" id="analyticsStateBadge">ON</span>
<button type="button" class="ghost-btn" id="analyticsToggleBtn"
onclick="toggleAnalytics()" style="margin-left:auto">
Turn off
</button>
</div>
<div class="hint" id="analyticsHint" style="margin-top:8px"></div>
<details style="margin-top:12px">
<summary style="cursor:pointer; font-size:12px; color:var(--muted, #9aa)">
Maintainer / self-hosting keys
</summary>
<div class="hint" style="margin:8px 0">
This build ships Phosphene's own project key, which is why the
counts above are sent by default. It is a write-only
<code>phc_</code> key — it can send events, it can't read any
back. Pasting your own key here <b>overrides</b> it; clearing
this field falls back to the shipped key rather than switching
sending off, so use the <b>Turn off</b> button above for that.
<span data-hide-mac-app>Point <code>PHOSPHENE_ANALYTICS_HOST</code> at your own receiver
to self-host. Full schema: <code>docs/ANALYTICS.md</code>.</span>
</div>
<div class="token-row">
<div class="token-label">
<span>PostHog project key <span class="hint">(capture)</span></span>
<span class="token-status" id="analyticsKeyStatus">—</span>
</div>
<div class="token-row-input">
<input type="password" id="analyticsKeyInput" autocomplete="off"
placeholder="phc_…">
<button type="button" class="ghost-btn"
onclick="toggleTokenVisibility('analyticsKeyInput', this)">show</button>
<button type="button" class="primary-btn token-savetest"
onclick="saveAnalyticsKey('analytics_key')">save</button>
<button type="button" class="ghost-btn" id="analyticsKeyClear"
onclick="clearAnalyticsKey('analytics_key')" style="display:none">clear</button>
</div>
<div class="hint">
Write-only project key. Pasting one redirects the pings to your
own PostHog project.
</div>
</div>
<div class="token-row">
<div class="token-label">
<span>PostHog personal API key <span class="hint">(fleet view)</span></span>
<span class="token-status" id="analyticsQueryKeyStatus">—</span>
</div>
<div class="token-row-input">
<input type="password" id="analyticsQueryKeyInput" autocomplete="off"
placeholder="phx_…">
<button type="button" class="ghost-btn"
onclick="toggleTokenVisibility('analyticsQueryKeyInput', this)">show</button>
<button type="button" class="primary-btn token-savetest"
onclick="saveAnalyticsKey('analytics_query_key')">save</button>
<button type="button" class="ghost-btn" id="analyticsQueryKeyClear"
onclick="clearAnalyticsKey('analytics_query_key')" style="display:none">clear</button>
</div>
<div class="hint">
Read-only key that unlocks the fleet numbers in the Usage
section of the stats dashboard. Never used for sending.
</div>
</div>
</details>
</div>
<!-- Appearance. Three answers — dark, light, follow the system — kept
in this browser and applied before the first paint from main.js.
Same row shape as the switches below. -->
<div class="settings-section">
<h3>Appearance</h3>
<div class="hint" style="margin-bottom:10px">The panel's palette. "System" follows the Mac's own light or dark setting and switches live. Saved in this browser only.</div>
<div class="pill-group cols-3" id="appearanceGroup">
<button type="button" class="pill-btn active" data-appearance="dark" onclick="setAppearance('dark')">Dark</button>
<button type="button" class="pill-btn" data-appearance="light" onclick="setAppearance('light')">Light</button>
<button type="button" class="pill-btn" data-appearance="system" onclick="setAppearance('system')">System</button>
</div>
</div>
<!-- Completion alerts. A chime in the tab when a render finishes or
fails, and a browser notification when the tab is in the
background — once the person has allowed them. Same row shape as
the analytics switch below. -->
<div class="settings-section">
<h3>Completion alerts</h3>
<div class="hint" style="margin-bottom:10px" id="notifyHint"></div>
<div class="spicy-row">
<span class="spicy-state on" id="notifyStateBadge">ON</span>
<button type="button" class="ghost-btn" id="notifyAllowBtn" hidden
onclick="askNotifyPermission()">Allow browser alerts</button>
<button type="button" class="ghost-btn" id="notifyPushBtn" hidden
onclick="pushToggle()">Alert me here even when the tab is closed</button>
<button type="button" class="ghost-btn" id="notifyPushTestBtn" hidden
onclick="pushTest()">Send a test</button>
<button type="button" class="ghost-btn" id="notifyToggleBtn"
onclick="toggleNotify()" style="margin-left:auto">
Turn off
</button>
</div>
</div>
<div class="settings-foot">
<span class="settings-status" id="settingsStatus"></span>
<button class="ghost-btn" onclick="closeSettingsModal()">Cancel</button>
<button class="primary-btn" id="settingsApplyBtn" onclick="applySettings()">Apply</button>
</div>
</div>
</div>
<!-- ============== TIER MODAL ============== -->
<!-- Opened by the "tier" pill in the header. Renders the detected
hardware tier + what it allows. Helps users understand WHY some
options are disabled instead of just hitting a wall mid-flow. -->
<div id="tierModal" class="models-modal" style="display:none"
role="dialog" aria-modal="true" aria-labelledby="tierModalTitle"
onclick="if(event.target===this) closeTierModal()">
<div class="models-card">
<div class="models-head">
<h2 id="tierModalTitle">Hardware tier</h2>
<button class="ghost-btn" onclick="closeTierModal()">Close</button>
</div>
<div class="models-hint" id="tierModalBlurb"></div>
<ul class="models-list" id="tierCapsList"></ul>
<!-- VC-23: this footer used to tell every user to "Set
LTX_TIER_OVERRIDE=base|standard|high|pro in the env" — a
developer testing instruction with nothing to do with what this
dialog is for (showing what THIS Mac can render). That note
already lives where developers look for it: CLAUDE.md §19,
"Force a different hardware tier for testing". -->
</div>
</div>
<!-- ============== MUSIC ENGINE (YuE2) INSTALL CARD ============== -->
<!-- Opened by Compose before the engine exists, by the YuE2 row of the header
engine picker and by Settings → Models. The install runs from the panel
(the same steps as the Pinokio sidebar entry); see musicInstallRender. -->
<div id="musicInstallModal" class="models-modal" role="dialog" aria-modal="true" aria-labelledby="musicInstallTitle" hidden onclick="if(event.target===this)closeMusicInstallCard()">
<div class="models-card">
<div class="models-head"><h2 id="musicInstallTitle">YuE2 · music engine</h2><button type="button" class="ghost-btn" onclick="closeMusicInstallCard()">Close</button></div>
<div id="musicInstallBody" class="music-install-body"></div>
<p class="hint">YuE2 license (CC BY-NC 4.0 + creator permission): individual creators may monetize their songs; companies need a license for the weights.</p>
</div>
</div>
<!-- ============== HAILUO H3 INSTALL CARD ============== -->
<!-- Opened by clicking the H3 engine pill when the pack isn't installed, and
by the H3 row in the Models modal. H3 installs through Pinokio (clone +
venv + ~75 GB of weights), not through the panel's `hf download` path, so
this card explains the one sidebar click — the same shape the Sharp and
image-engine optional packs already use. -->
<div id="h3InstallModal" class="models-modal" style="display:none"
role="dialog" aria-modal="true" aria-labelledby="h3InstallTitle"
onclick="if(event.target===this) closeH3InstallCard()">
<div class="models-card">
<div class="models-head">
<!-- ENGINES ARE PEERS. This read "Hailuo H3 · optional engine", which
told a user that half the panel's video capability was a side dish.
A missing engine is an OFFER — the title names the engine and its
price, and the body says what it does. -->
<h2 id="h3InstallTitle">Hailuo H3 · 75 GB</h2>
<button class="ghost-btn" onclick="closeH3InstallCard()">Close</button>
</div>
<div class="models-hint" id="h3InstallBody"></div>
<div class="models-foot" data-hide-mac-app>
Already have a checkout? Launch the panel with
<code>LTX_H3_ROOT</code> + <code>LTX_H3_MODELS</code> pointing at it —
see <code>docs/H3_ENGINE.md</code>.
</div>
</div>
</div>
<div id="proModal" class="models-modal" style="display:none" role="dialog" aria-modal="true" aria-labelledby="lightsOnTitle" onclick="if(event.target===this)closeProModal()">
<div class="models-card pro-card">
<div class="pro-toolbar"><span>Phosphene Pro</span><button type="button" class="ghost-btn" onclick="closeProModal()">Close</button></div>
<!-- LIGHTS_ON_HEADER_START -->
<section class="lights-on-header" aria-labelledby="lightsOnTitle">
<div class="lights-on-wash" aria-hidden="true"></div>
<svg class="lights-on-lamp" viewBox="0 0 140 156" width="112" height="125" fill="none" aria-hidden="true">
<ellipse class="lamp-pool" cx="75" cy="141" rx="54" ry="8" fill="#ffd391"/>
<path d="M28 135h69M42 131c0-7 6-11 16-11h17c10 0 16 4 16 11" stroke="#8e8e96" stroke-width="2" stroke-linecap="round"/>
<path d="M63 120 36 82 66 43M70 120 43 82 72 46" stroke="#b14aff" stroke-opacity=".72" stroke-width="2" stroke-linejoin="round"/>
<path d="m44 87 10-3m-5 10 10-3m-5 10 10-3" stroke="#8e8e96" stroke-width="1.4" stroke-linecap="round"/>
<circle cx="39" cy="82" r="6" fill="#121214" stroke="#5eeaff" stroke-opacity=".75" stroke-width="2"/>
<circle cx="67" cy="123" r="4" fill="#121214" stroke="#8e8e96" stroke-width="2"/>
<path d="M91 134c20 0 6 14 26 14h9" stroke="#8e8e96" stroke-width="1.5" stroke-linecap="round"/>
<g class="lamp-head">
<path class="lamp-beam" d="m83 62-20 69 75-15-27-65Z" fill="#ffd391"/>
<path d="m68 43 14-7" stroke="#5eeaff" stroke-opacity=".75" stroke-width="2"/>
<path d="M78 28c8-5 17-3 22 5l14 20c-9 8-21 12-34 10l-3-25c-1-4-1-7 1-10Z" fill="#121214" stroke="#b4b4bb" stroke-width="2" stroke-linejoin="round"/>
<path d="M81 32c5-3 10-2 13 3" stroke="#5eeaff" stroke-opacity=".7" stroke-width="1.5" stroke-linecap="round"/>
<path class="lamp-rim" d="M80 63c12 1 25-3 34-10" stroke="#ffd391" stroke-width="2" stroke-linecap="round"/>
<path class="lamp-bulb" d="M91 63c1 7 12 5 12-3" fill="#ffe5b4" stroke="#ffe5b4" stroke-width="2"/>
<path class="lamp-chain" d="m108 59 3 19" stroke="#b4b4bb" stroke-width="1.4" stroke-linecap="round"/>
<circle class="lamp-chain" cx="111" cy="81" r="2.5" fill="#b4b4bb"/>
</g>
</svg>
<div class="lights-on-copy">
<p class="lights-on-eyebrow">PHOSPHENE PRO</p>
<h2 id="lightsOnTitle">Help us keep<br>the lights on</h2>
<p class="lights-on-lead">I'm Mr Bizarro, the one person behind this open-source app. Pro pays for compute and my time. The free app stays free.</p>
</div>
</section>
<!-- LIGHTS_ON_HEADER_END -->
<div class="pro-prices" aria-label="Pro pricing">
<section class="pro-price"><h3>Pro monthly</h3><p><strong>$15</strong> a month</p><span>Cancel any time.</span></section>
<section class="pro-price"><h3>Pro yearly</h3><p><strong>$120</strong> a year</p><span>Two months free.</span></section>
<section class="pro-price pro-founding"><h3>Founding (3 years)</h3><p><strong>$199</strong> one-time</p><span>First 200 seats. No renewal; access expires after 3 years (1,095 days). Existing Founding promises are preserved.</span></section>
</div>
<section class="pro-compare" id="proCompare" aria-label="Same clip, Free vs Pro">
<header><p class="lights-on-eyebrow">SAME CLIP · FREE VS PRO</p><h3 id="proCompareTitle">Hailuo H3 · High · i2v · 5 s</h3><p class="pro-compare-sub" id="proCompareSub">Measured on an M4 Max · 64 GB, seed 4101: Free 14 min 56 s, Pro 10 min 02 s · 1.49×. Faces, motion, speech and sync reviewed equal.</p></header>
<div class="pro-compare-player"><video id="proCompareVideo" src="/assets/pro/compare_h3_5s.mp4" poster="/assets/pro/compare_h3_5s.jpg" controls muted loop playsinline preload="metadata"></video></div>
</section>
<div class="pro-benefits">
<p><strong>Faster Flex Turbo</strong>A faster way to render Hailuo H3 Flex. Turns on as soon as your licence does.</p>
<p><strong>iPhone Remote</strong>Start and watch renders from your iPhone, at home or away.</p>
<p><strong>Priority support and feature requests</strong>Pro questions and feature requests go to the front of the queue.</p>
</div>
<section class="pro-licence" id="proLicence" aria-label="Your Pro licence">
<p class="lights-on-eyebrow">YOUR LICENCE</p>
<p class="pro-licence-state" id="proLicenceState" role="status"></p>
<form class="pro-licence-form" id="proLicenceForm" onsubmit="proLicenceActivate(event)">
<input type="password" id="proLicenceKey" autocomplete="off" spellcheck="false" placeholder="Paste your licence key" aria-label="Licence key">
<button type="submit" class="ghost-btn" id="proLicenceGo">Turn on Pro</button>
</form>
<div class="pro-licence-actions" id="proLicenceActions" hidden>
<button type="button" class="ghost-btn" onclick="proLicenceRefresh()">Check again</button>
<button type="button" class="ghost-btn" onclick="proLicenceDeactivate()">Deactivate this Mac</button>
</div>
<p class="pro-licence-note">One Mac per licence. Phosphene checks it once a day while you are online and keeps working for two weeks without internet.</p>
</section>
<div class="pro-bottom"><a class="pro-waitlist" href="https://phosphene.video/pricing/" data-utm-campaign="get-pro" data-utm-content="pro-modal" target="_blank" rel="noopener">Get Pro <span aria-hidden="true">↗</span></a><p>Hardship licences are available on request.<br><a href="mailto:[email protected]">Get in touch</a>.</p></div>
</div>
</div>
<!-- Per-model licence screen (4.19.8). Filled by webapp/js/licences.js from
GET /licences; opened when the server answers 451 licence_required, from
the H3 install card, and from the H3 credit line. -->
<!-- STAR_CARD_START: the one-time "star us on GitHub" card (owner, 2 Nov
2026; v2 4 Nov 2026). A sibling of the Pro lamp card: the same lamp,
header and palette. Not modal and never over the clip: it sits in the
corner after the fifth finished render, once the person has been idle
30 s with the page in front of them, once per Mac. One button; the quiet
close X (and Escape) is the only other way out. Where the Mac's GitHub
CLI is signed in, the button stars in place and the card says thank you;
otherwise it opens GitHub. Driven by starCardPoll (health.js). -->
<aside id="starCard" class="star-card" role="dialog" aria-modal="false" aria-labelledby="starCardTitle" aria-describedby="starCardBody" hidden>
<button type="button" class="star-card-close" aria-label="Close" title="Close" onclick="starCardAnswer('not_now')">×</button>
<section class="lights-on-header star-card-head">
<div class="lights-on-wash" aria-hidden="true"></div>
<svg class="lights-on-lamp star-card-lamp" viewBox="0 0 140 156" width="112" height="125" fill="none" aria-hidden="true">
<ellipse class="lamp-pool" cx="75" cy="141" rx="54" ry="8" fill="#ffd391"/>
<path d="M28 135h69M42 131c0-7 6-11 16-11h17c10 0 16 4 16 11" stroke="#8e8e96" stroke-width="2" stroke-linecap="round"/>
<path d="M63 120 36 82 66 43M70 120 43 82 72 46" stroke="#b14aff" stroke-opacity=".72" stroke-width="2" stroke-linejoin="round"/>
<path d="m44 87 10-3m-5 10 10-3m-5 10 10-3" stroke="#8e8e96" stroke-width="1.4" stroke-linecap="round"/>
<circle cx="39" cy="82" r="6" fill="#121214" stroke="#5eeaff" stroke-opacity=".75" stroke-width="2"/>
<circle cx="67" cy="123" r="4" fill="#121214" stroke="#8e8e96" stroke-width="2"/>
<path d="M91 134c20 0 6 14 26 14h9" stroke="#8e8e96" stroke-width="1.5" stroke-linecap="round"/>
<g class="lamp-head">
<path class="lamp-beam" d="m83 62-20 69 75-15-27-65Z" fill="#ffd391"/>
<path d="m68 43 14-7" stroke="#5eeaff" stroke-opacity=".75" stroke-width="2"/>
<path d="M78 28c8-5 17-3 22 5l14 20c-9 8-21 12-34 10l-3-25c-1-4-1-7 1-10Z" fill="#121214" stroke="#b4b4bb" stroke-width="2" stroke-linejoin="round"/>
<path d="M81 32c5-3 10-2 13 3" stroke="#5eeaff" stroke-opacity=".7" stroke-width="1.5" stroke-linecap="round"/>
<path class="lamp-rim" d="M80 63c12 1 25-3 34-10" stroke="#ffd391" stroke-width="2" stroke-linecap="round"/>
<path class="lamp-bulb" d="M91 63c1 7 12 5 12-3" fill="#ffe5b4" stroke="#ffe5b4" stroke-width="2"/>
<path class="lamp-chain" d="m108 59 3 19" stroke="#b4b4bb" stroke-width="1.4" stroke-linecap="round"/>
<circle class="lamp-chain" cx="111" cy="81" r="2.5" fill="#b4b4bb"/>
</g>
</svg>
<div class="lights-on-copy star-card-ask">
<h2 id="starCardTitle">Help keep<br>the lights on</h2>
<p id="starCardBody" class="lights-on-lead">Enjoying Phosphene? A star on GitHub would mean the world to us, and it helps other Mac users find us.</p>
</div>
<div class="lights-on-copy star-card-thanks" id="starCardThanks" role="status" aria-live="polite" hidden>
<h2>Thank you!</h2>
<p class="lights-on-lead">You just helped the next Mac user find Phosphene.</p>
</div>
</section>
<div class="star-card-actions">
<button type="button" id="starCardStar" class="star-card-primary" onclick="starCardStar()"><svg viewBox="0 0 16 16" width="15" height="15" aria-hidden="true"><path d="M8 1.2l2.1 4.3 4.7.7-3.4 3.3.8 4.7L8 12l-4.2 2.2.8-4.7L1.2 6.2l4.7-.7z" fill="currentColor"/></svg><span class="star-card-label">Star on GitHub</span><span class="star-card-count" id="starCardCount" hidden></span></button>
</div>
<a class="star-card-quiet" href="https://phosphene.video/pricing/" data-utm-campaign="get-pro" data-utm-content="star-card" onclick="starCardAnswer('waitlist'); return false;">Or join the Pro waitlist <span aria-hidden="true">↗</span></a>
<canvas class="star-card-burst" id="starCardBurst" aria-hidden="true"></canvas>
</aside>
<!-- STAR_CARD_END -->
<div id="licenceModal" class="models-modal" style="display:none"
role="dialog" aria-modal="true" aria-labelledby="licenceTitle">
<div class="models-card licence-card">
<div class="models-head">
<h2 id="licenceTitle">Model licence</h2>
<button class="ghost-btn" onclick="closeLicence()">Close</button>
</div>
<div class="models-hint licence-body" id="licenceBody"></div>
</div>
</div>
<!-- ============== MODELS MODAL ============== -->
<!-- Opened by the "models" pill in the header. Shows per-repo download
status from /models, with a Download button per row. Active downloads
stream into the existing log at the bottom of the page. -->
<div id="modelsModal" class="models-modal" style="display:none"
role="dialog" aria-modal="true" aria-labelledby="modelsModalTitle"
onclick="if(event.target===this) closeModelsModal()">
<div class="models-card">
<div class="models-head">
<h2 id="modelsModalTitle">Models</h2>
<button class="ghost-btn" onclick="closeModelsModal()">Close</button>
</div>
<div class="models-hint" id="modelsHint">Loading…</div>
<ul class="models-list" id="modelsList"></ul>
<div class="models-foot" id="modelsFoot"></div>
</div>
</div>
<!-- (Version modal removed in the magic-button rewrite. Pill itself is the
full UI now: click while behind → confirm + git pull; click while
current → live re-check. See versionPillClick() in the JS section.) -->
<!-- ============== OUTPUT INFO MODAL ============== -->
<!-- Opened by the ⓘ button on each gallery card. Shows everything we
wrote into the .mp4.json sidecar at render time: prompt, seed,
mode/quality, frames + dimensions, LoRAs used (with name + strength),
elapsed time, queue id, model. Plus copy-buttons for prompt + seed
so users can easily re-use them. -->
<!-- ============== RETAKE A MOMENT (VA-26) ==============
"Fix just the bad two seconds" instead of re-rendering the whole clip —
the engine's own RetakePipeline (Extend's backend) exposed as a player
action for the first time. Regenerates one interior stretch while the
rest of the clip is preserved untouched. NEEDS RENDER CHECK: see
ledger_lipsync.txt — this UI + its /queue/add mode=retake job spec are
wired and guarded, but the seconds-to-latent-frame math and the actual
pipeline call have not been proven against a real GPU render yet. -->
<div id="retakeModal" class="models-modal" style="display:none"
role="dialog" aria-modal="true" aria-labelledby="retakeModalTitle"
onclick="if(event.target===this) closeRetakeModal()">
<div class="models-card" style="width: min(560px, 96vw)">
<div class="models-head">
<h2 id="retakeModalTitle">Retake a moment</h2>
<button class="ghost-btn" onclick="closeRetakeModal()">Close</button>
</div>
<div class="models-hint">
Regenerates one stretch of this clip and keeps the picture outside it as it was. The new stretch uses the same Q8 dev transformer as Extend — a real render, at that lane's speed, not instant.
</div>
<div class="hint" id="retakeClampNote" hidden></div>
<div style="padding:12px 0; display:flex; flex-direction:column; gap:10px">
<div class="mini-fields">
<div class="mf-cell">
<span class="mf-label">From (s)</span>
<input type="number" id="retakeStart" value="0" min="0" step="0.5">
</div>
<div class="mf-cell">
<span class="mf-label">To (s)</span>
<input type="number" id="retakeEnd" value="1" min="0.5" step="0.5">
</div>
</div>
<label style="display:flex; flex-direction:column; gap:4px; font-size:12px; color:var(--muted)">
What should happen in that stretch (optional — leave blank to reuse this clip's own prompt)
<textarea id="retakePrompt" rows="3" style="padding:6px 9px; font-size:13px; background:rgba(140,160,220,0.04); border:1px solid var(--ph-border-soft); border-radius:6px; color:var(--text); font-family:inherit"></textarea>
</label>
<label style="display:flex;align-items:center;gap:8px;cursor:pointer;font-size:13px;">
<input type="checkbox" id="retakeKeepSound" checked style="width:auto;margin:0;">
<span>Keep the original sound in this stretch <span class="hint" style="font-weight:normal">(uncheck to let the audio regenerate too)</span></span>
</label>
<div class="hint" id="retakeStatus"></div>
</div>
<div class="actions" style="display:flex;gap:8px;justify-content:flex-end;">
<button type="button" class="ghost-btn" onclick="closeRetakeModal()">Cancel</button>
<button type="button" class="primary" id="retakeSubmitBtn" onclick="submitRetake()">Retake this stretch</button>
</div>
</div>
</div>
<div id="outputInfoModal" class="models-modal" style="display:none"
role="dialog" aria-modal="true" aria-labelledby="outputInfoTitle"
onclick="if(event.target===this) closeOutputInfoModal()">
<div class="models-card" style="width: min(720px, 96vw)">
<div class="models-head">
<h2 id="outputInfoTitle">Generation info</h2>
<button class="ghost-btn" onclick="closeOutputInfoModal()">Close</button>
</div>
<div id="outputInfoBody" class="output-info-body">
<div class="hint">Loading…</div>
</div>
</div>
</div>
<!-- ============== BUG REPORT MODAL ============== -->
<!-- Opened by the neon bug button in the header pill row. Pre-fills
environment info + log tail server-side via /panel/bug-context, then
opens a pre-filled GitHub issue when the user submits. NO server-side
issue creation — the client builds the URL, opens it in a new tab,
and we're done. Optional crash-report zip lives in /tmp for the user
to drag onto the issue. -->
<div id="bugModal" class="models-modal" style="display:none"
role="dialog" aria-modal="true" aria-labelledby="bugModalTitle"
onclick="if(event.target===this) closeBugModal()">
<div class="models-card" style="width: min(720px, 96vw)">
<div class="models-head">
<h2 id="bugModalTitle">Report a bug</h2>
<button class="ghost-btn" onclick="closeBugModal()">Close</button>
</div>
<div class="models-hint">
Opens a pre-filled GitHub issue in a new tab. Environment info, version,
and the recent log (errors first) are filled in for you.
</div>
<div id="bugModalBody" style="padding: 12px 0; display:flex; flex-direction:column; gap:10px">
<!-- 4.19.3 (#106): a report used to go out with "What happened" empty,
which left nothing to act on. This box is required (at least 10
characters); the copy under it says why, inline, never alert(). -->
<label class="bug-what" for="bugWhat">
<span>What happened? <span class="bug-what-req">required</span></span>
<textarea id="bugWhat" rows="3" aria-required="true" aria-describedby="bugWhatHint"
placeholder="e.g. I pressed Generate on Text to video and it stopped at 40% with "helper failed to start"."
oninput="bugWhatInput()"></textarea>
<span id="bugWhatHint" class="bug-what-hint" role="status" aria-live="polite">
A sentence or two in your own words. The log below is attached for
you, but it can't tell us what you saw.
</span>
</label>
<label style="display:flex; flex-direction:column; gap:4px; font-size:12px; color:var(--muted)">
Title
<input id="bugTitle" type="text" value="[bug] "
style="padding:6px 9px; font-size:13px; background:rgba(140,160,220,0.04); border:1px solid var(--ph-border-soft); border-radius:6px; color:var(--text); font-family:inherit">
</label>
<label style="display:flex; flex-direction:column; gap:4px; font-size:12px; color:var(--muted)">
Details (optional) and environment
<textarea id="bugBody" rows="14"
style="padding:8px 10px; font-size:12px; background:rgba(140,160,220,0.04); border:1px solid var(--ph-border-soft); border-radius:6px; color:var(--text); font-family:ui-monospace,SFMono-Regular,Menlo,monospace; line-height:1.45; resize:vertical">Loading environment…</textarea>
</label>
<label id="bugCrashRow" style="display:none; align-items:center; gap:8px; font-size:12px; color:var(--muted)">
<!-- SYS-12: off by default. This zips real crash logs into a public
GitHub issue; that should be an opt-in per report, not a
pre-ticked box next to a "Submit" the user might click fast. -->
<input id="bugCrashCheck" type="checkbox">
<span id="bugCrashLabel">Include latest crash reports (zips up to 5 .ips files)</span>
</label>
<!-- SYS-40: "Report a bug" assumed a GitHub account and English. Not
everyone has either — a Copy button lets someone paste the same
scrubbed diagnostics anywhere (a forum post, a DM, a translated
message), and the X link is somewhere non-English creators
already are. -->
<div id="bugSubmitRow" style="display:flex; gap:8px; justify-content:flex-end; align-items:center; flex-wrap:wrap">
<span id="bugStatus" style="flex:1; font-size:12px; color:var(--muted)"></span>
<a href="https://x.com/PhospheneAI" target="_blank" rel="noopener"
style="font-size:11.5px; color:var(--muted)">No GitHub? Reach out on X →</a>
<button class="ghost-btn" onclick="copyBugDiagnostics()">Copy diagnostics</button>
<button class="ghost-btn" onclick="closeBugModal()">Cancel</button>
<button id="bugSubmitBtn" class="primary-btn" onclick="submitBugReport()">Open GitHub issue</button>
</div>
</div>
</div>
</div>
<!-- ============== BOTTOM TABBED PANE ============== -->
<aside class="bottom-pane" id="bottomPane">
<!-- REDESIGN — Y2.001 bottom-pane. Tighter tab strip with leading
activity dot, denser Now card matching the composer-card visual
language, refined badges. All IDs preserved so poll() and the
click handlers downstream keep working. -->
<nav class="tabs">
<span class="bp-live-dot" id="bpLiveDot" title="Idle"></span>
<button data-tab="now" class="active">Now</button>
<button data-tab="queue">Queue <span class="badge" id="queueBadge" style="display:none">0</span></button>
<button data-tab="recent">Recent</button>
<button data-tab="logs">Logs</button>
<span class="spacer"></span>
<a class="model-credit" id="modelTag" href="https://github.com/dgrauet/ltx-2-mlx" target="_blank" rel="noopener" title="MLX port by @dgrauet"></a>
<!-- (Collapse-this-panel button removed 2026-05-12 — Mr Bizarro flagged
it hid important data (active job progress, queue) and the
"down arrow that goes up" affordance read as confusing. The
bottom pane is always visible at its natural height now.) -->
</nav>
<div class="bottom-body">
<div class="tab-content show" id="tab-now">
<!-- The live-preview slot is a FIXED 16:9 box that is present from the
moment a render starts, so the arrival of a thumbnail causes NO
layout shift — the storyboard spec's rule, carried over verbatim.
It is display:none while idle and reserves its own space otherwise. -->
<div class="now-card idle" id="nowCard">
<div class="now-thumb" id="nowThumb" hidden aria-hidden="true"></div>
<div class="now-body">
<output class="studio-progress-value" id="studioProgressValue" aria-hidden="true" hidden><span>0%</span></output>
<div class="ttl">Idle</div>
<div class="progress-bar" role="progressbar" aria-label="Render progress" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><div class="fill" id="progressFill" style="width:0%"></div></div>
<div class="meta" id="nowDetail">No job running</div>
<!-- Action row populated on the failed state with Retry + Close.
Lives outside .ttl so poll()'s innerHTML rewrites don't
clobber the buttons mid-click. Hidden when empty. -->
<div class="now-card-actions" id="nowCardActions"></div>
</div>
</div>
</div>
<div class="tab-content" id="tab-queue">
<ul class="row-list" id="queueList"></ul>
</div>
<div class="tab-content" id="tab-recent">
<!-- Type filter — image jobs and video jobs share this list now
that mode='image' goes through the same worker. -->
<div class="row-list-filter">
<button id="recentFilterAll" class="active" onclick="setRecentFilter('all')">All</button>
<button id="recentFilterVideos" onclick="setRecentFilter('videos')">Videos</button>
<button id="recentFilterPhotos" onclick="setRecentFilter('photos')">Photos</button>
<button id="recentFilterAudio" onclick="setRecentFilter('audio')">Audio</button>
</div>
<ul class="row-list" id="historyList"></ul>
</div>
<div class="tab-content" id="tab-logs">
<pre class="log" id="log">No log yet.</pre>
</div>
</div>
</aside>
<!-- ============== HF MODEL BROWSER MODAL ============== -->
<!-- Search + install MLX-format chat models from Hugging Face. Hits
huggingface.co/api/models with library=mlx + pipeline_tag=text-generation
filters. Click Install → backend spawns `hf download`, status streams
in the bottom strip until done. Newly-installed models appear in the
local-engine model picker on next refresh. -->
<!-- ============== BATCH MODAL ============== -->
<!-- THE DOCS VIEW (webapp/js/docs.js; pages in webapp/docs/*.md). A .modal-bg
so the Editor's keys stand down while it is open and health.js's Esc and
focus trap cover it; the Close button's onclick names close for Esc. -->
<!-- ====== PHOSPHENE BENCH ======
The window webapp/js/bench.js drives. Steps, notices, the result card and
past runs are painted from GET /bench/plan and /bench/status; nothing on
this screen computes a time of its own. -->
<div id="benchModal" class="models-modal bench-modal" style="display:none"
role="dialog" aria-modal="true" aria-labelledby="benchTitle"
onclick="if(event.target===this) closeBenchModal()">
<div class="models-card bench-card">
<div class="models-head">
<div class="bench-title-row">
<h2 id="benchTitle">Phosphene Bench</h2>
<span class="bench-suite" id="benchSuite" title="The frozen suite these times belong to">PB1</span>
</div>
<button type="button" class="ghost-btn" onclick="closeBenchModal()">Close</button>
</div>
<p class="models-hint bench-intro">Run Bench renders the PB1 suite on your Mac and records times and memory use. Expect several minutes, or much longer on smaller Macs.</p>
<div class="bench-notices" id="benchNotices" aria-live="polite"></div>
<ol class="bench-steps" id="benchSteps"></ol>
<div class="bench-actions">
<button type="button" class="primary-btn" id="benchRunBtn" onclick="benchRun()">Run Bench</button>
<button type="button" class="ghost-btn" id="benchStopBtn" onclick="benchStop()" hidden>Stop Bench</button>
<span class="bench-line" id="benchLine" role="status" aria-live="polite"></span>
</div>
<details class="bench-rules">
<summary>How Bench stays fair</summary>
<ul>
<li>Every Mac uses the same fixed prompts, seeds and settings, except Balanced uses 768×448 below 48 GB memory. The result records the canvas.</li>
<li>PB1 settings are frozen. A settings change gets a new suite name. Different suites are never mixed.</li>
<li>Bench never downloads models by itself. If a required model is missing, click Install to download it.</li>
<li>No best-of: submitting sends every complete PB1 run stored on this Mac. The leaderboard uses this Mac's median.</li>
</ul>
</details>
<section class="bench-result" id="benchResult" hidden>
<h3>Bench results</h3>
<p class="bench-warn" id="benchIncomplete" hidden>Incomplete: a core step did not finish. This run cannot go on the leaderboard.</p>
<img class="bench-card-img" id="benchCardImg" alt="Phosphene Bench result card">
<div class="bench-result-actions">
<button type="button" class="primary-btn" id="benchCopyBtn" onclick="benchCopy()">Copy results</button>
<a class="ghost-btn" id="benchSaveCard" href="#" download>Save card as PNG</a>
<a class="ghost-btn" id="benchSaveJson" href="#" download>Save results as JSON</a>
</div>
<div class="bench-submit" id="benchSubmit">
<button type="button" class="ghost-btn" id="benchSubmitBtn" onclick="benchSubmitOpen()">Submit to the leaderboard</button>
<div class="bench-consent" id="benchConsent" hidden>
<p>Submitting sends every complete PB1 run stored on this Mac, including the suite, step times, memory numbers, canvases, chip, GPU cores, memory size, model identifier, macOS version, power source, Low Power Mode, thermal state, app version, edition and random install ID. It never sends prompts, file names, paths, images or video. The leaderboard uses this Mac's median across those runs, then shows the median of Mac medians for each chip and memory size, keeping suites and editions separate.</p>
<button type="button" class="primary-btn" id="benchSubmitConfirm" onclick="benchSubmit()">Submit all complete PB1 runs</button>
</div>
<p class="bench-submit-note" id="benchSubmitNote" role="status" aria-live="polite"></p>
</div>
</section>
<section class="bench-history">
<h3>Past runs</h3>
<ul id="benchHistory"><li class="bench-empty">No Bench runs yet.</li></ul>
</section>
</div>
</div>
<div class="modal-bg docs-view" id="docsView" role="dialog" aria-modal="true"
aria-labelledby="docsViewTitle" onclick="if(event.target===this) closeDocs()">
<div class="docs-shell">
<aside class="docs-nav" id="docsNav" aria-label="Docs sections">
<div class="docs-brand">
<svg class="ph" aria-hidden="true"><use href="#ph-book-open"/></svg>
<span id="docsViewTitle">Phosphene Docs</span>
</div>
<label class="docs-search-wrap">
<svg class="ph" aria-hidden="true"><use href="#ph-magnifying-glass"/></svg>
<input type="search" class="docs-search" id="docsSearch" placeholder="Search the docs"
aria-label="Search the docs" spellcheck="false" autocomplete="off">
</label>
<nav class="docs-toc" id="docsToc"></nav>
<div class="docs-results" id="docsResults" hidden></div>
</aside>
<section class="docs-main">
<header class="docs-bar">
<button type="button" class="ghost-btn docs-nav-toggle" id="docsNavToggle"
aria-controls="docsNav" aria-expanded="false">Sections</button>
<span class="docs-crumb" id="docsCrumb"></span>
<span class="docs-bar-spacer"></span>
<button type="button" class="ghost-btn docs-close" onclick="closeDocs()" title="Close the Docs (⎋ Esc)">Close</button>
</header>
<div class="docs-scroll" id="docsScroll">
<article class="docs-article" id="docsArticle"></article>
<nav class="docs-pagenav" id="docsPageNav" aria-label="Previous and next page"></nav>
</div>
</section>
</div>
</div>
<!-- Re-plan. The one storyboard surface that needs a modal, because it needs a
text field. Written HERE, at column 0, as a direct child of <body> and
present at boot on purpose: the global _phosModalScaffold IIFE registers
its observers once at boot, so a modal injected later loses Esc-to-close,
the focus trap and the body.modal-open scroll lock. -->
<!-- Star ask (2026-10-27): the header star opens this short thank-you instead of jumping straight to GitHub. -->
<div class="modal-bg star-ask" id="starAsk" role="dialog" aria-modal="true" aria-labelledby="starAskTitle" onclick="if(event.target===this)starAskClose()">
<div class="modal star-ask-card">
<svg class="ph star-ask-icon" aria-hidden="true"><use href="#ph-star"/></svg>
<h3 id="starAskTitle">Thank you for supporting Phosphene</h3>
<p>Please take a minute to leave us a star on GitHub. It's how other people find Phosphene, and we really appreciate it.</p>
<div class="modal-actions">
<button type="button" class="btn ghost" onclick="starAskClose()">Maybe later</button>
<a class="btn primary" id="starAskGo" href="https://github.com/mrbizarro/phosphene" target="_blank" rel="noopener">Star on GitHub</a>
</div>
</div>
</div>
<div class="modal-bg" id="sbReplanModal" onclick="if(event.target===this)sbCloseReplan()">
<div class="modal">
<h3>Re-plan this film</h3>
<div class="hint">The concept and the look stay. Say what was wrong and the planner writes a new shot list. This replaces every shot — clips already rendered stay in your gallery.</div>
<textarea class="batch" id="sbReplanNotes" rows="4"
placeholder="Too much walking. Start inside the gym. Fewer wide shots."></textarea>
<!-- Same control as the brief. This is where changing the engine on an
EXISTING film belongs, because the change is a re-plan: an H3 shot and
an LTX shot are written in different dialects, so a flip has to rewrite
the prompts, not relabel them. -->
<div class="cz-control" style="margin-top:12px">
<div class="cz-label">Engine <span class="cz-label-hint">who renders the shots</span></div>
<div class="pill-group cols-3" id="sbReplanEngineGroup"></div>
<div class="sb-enginepick-note" id="sbReplanEngineNote"></div>
</div>
<div class="hint" style="margin-top:6px">Loads the planner again (~1 min). Nothing renders while it does.</div>
<div class="modal-actions">
<button class="small" onclick="sbCloseReplan()">Cancel</button>
<button class="small primary" style="padding:6px 14px" onclick="sbReplan()">Re-plan</button>
</div>
</div>
</div>
<!-- Generate a shot INTO a hole in the timeline. Same reason the re-plan modal
exists — it needs a text field — and written here at column 0 so the
global _phosModalScaffold IIFE picks it up at boot (Esc, focus trap,
scroll lock). The shot lands on the BOARD, because a shot to be rendered
is intent; the timeline only learns about it when the clip exists. -->
<div class="modal-bg" id="sbeGenModal" onclick="if(event.target===this)sbeGenClose()">
<div class="modal">
<h3 id="sbeGenTitle">Fill this hole</h3>
<div class="hint" id="sbeGenWhere"></div>
<textarea class="batch" id="sbeGenPrompt" rows="4"
placeholder="A slow push in on the empty gym, dust in the light."></textarea>
<div class="cz-control" style="margin-top:12px">
<div class="cz-label">Length <span class="cz-label-hint">seconds of film</span></div>
<input type="number" class="sb-input" id="sbeGenDuration" min="0.5" max="60" step="0.5" value="5">
</div>
<div class="cz-control" style="margin-top:10px">
<div class="cz-label">Pass <span class="cz-label-hint">draft is cheap, delivery is what you keep</span></div>
<div class="pill-group cols-2" id="sbeGenPass">
<button type="button" class="pill-btn active" data-pass="draft">Draft</button>
<button type="button" class="pill-btn" data-pass="final">Delivery</button>
</div>
</div>
<!-- make_job SILENTLY DROPS any form field it does not name, so a control
can look perfectly wired and do nothing. The server reads the params
back off the queued job and hands them here: this is what will
actually render, not what we asked for. -->
<div class="sbe-params" id="sbeGenParams" hidden></div>
<div class="hint" style="margin-top:6px" id="sbeGenAfter">The clip renders into the queue like any other shot. When it lands it appears under the timeline, and you place it — nothing moves your cuts on its own.</div>
<div class="modal-actions">
<button class="small" onclick="sbeGenClose()">Cancel</button>
<button class="small primary" style="padding:6px 14px" id="sbeGenGo" onclick="sbeGenSubmit()">Queue the shot</button>
</div>
</div>
</div>
<!-- FILM-14: "Match colour across the film". A server route samples one
mid-frame per clip and proposes a per-clip correction toward a hero
clip or the film's median — nothing on disk changes until Apply, and
the strength slider scales every proposal at once, previewed as a
count rather than a render. -->
<div class="modal-bg" id="sbeMatchModal" onclick="if(event.target===this)sbeMatchClose()">
<div class="modal">
<h3>Match colour across the film</h3>
<div class="hint" id="sbeMatchWhere">Reading one frame from every clip…</div>
<div class="cz-control" style="margin-top:12px">
<div class="cz-label">Strength <span class="cz-label-hint" id="sbeMatchStrengthHint">100%</span></div>
<input type="range" id="sbeMatchStrength" min="0" max="100" step="5" value="100"
oninput="sbeMatchStrengthPreview(this.value)">
</div>
<div class="hint" style="margin-top:6px">Exposure, warmth and tint only — reused from the same maths the film's own seam smoothing uses. Contrast and saturation stay whatever each clip's own grade already says.</div>
<div class="modal-actions">
<button class="small" onclick="sbeMatchClose()">Cancel</button>
<button class="small primary" style="padding:6px 14px" id="sbeMatchGo" onclick="sbeMatchApply()" disabled>Apply</button>
</div>
</div>
</div>
<!-- The raw planner reply, for a bug report. Never shown by default. -->
<div class="modal-bg" id="sbRawModal" onclick="if(event.target===this)document.getElementById('sbRawModal').classList.remove('show')">
<div class="modal">
<h3>What the planner returned</h3>
<pre id="sbRawText" style="max-height:50vh;overflow:auto;font-size:11px;white-space:pre-wrap"></pre>
<div class="modal-actions">
<button class="small" onclick="document.getElementById('sbRawModal').classList.remove('show')">Close</button>
</div>
</div>
</div>
<script>
const BOOT = __BOOTSTRAP__;</script>
<!-- abcjs draws the sheet music YuE2 writes for every song. Vendored (MIT,
webapp/vendor/abcjs/) so a score renders with the network off. Classic
script on purpose: it publishes `ABCJS` as a global for the studio module. -->
<script src="/webapp/vendor/abcjs/abcjs-basic-min.min.js"></script>
<script type="module" src="/webapp/js/licences.js"></script>
<script type="module" src="/webapp/js/boot.js"></script>
<script type="module" src="/webapp/js/music.js"></script>
<script type="module" src="/webapp/js/speech.js"></script>
<script type="module" src="/webapp/js/shortcuts.js"></script>
<script type="module" src="/webapp/js/tips.js"></script>
<script type="module" src="/webapp/js/docs.js"></script>
<script type="module" src="/webapp/js/stage.js"></script>
<script type="module" src="/webapp/js/characters.js"></script>
<script type="module" src="/webapp/js/capabilities.js"></script>
<script type="module" src="/webapp/js/engines.js"></script>
<script type="module" src="/webapp/js/queue.js"></script>
<script type="module" src="/webapp/js/settings.js"></script>
<script type="module" src="/webapp/js/loras.js"></script>
<script type="module" src="/webapp/js/preview.js"></script>
<script type="module" src="/webapp/js/health.js"></script>
<script type="module" src="/webapp/js/storyboard.js"></script>
<script type="module" src="/webapp/js/editor.js"></script>
<script type="module" src="/webapp/js/remote.js"></script>
<script type="module" src="/webapp/js/oneshot.js"></script>
<script type="module" src="/webapp/js/bench.js"></script>
<script type="module" src="/webapp/js/main.js"></script>
<div class="phos-toast-container" id="phosToast" aria-live="polite" aria-atomic="false"></div>
</body>
</html>