Skip to content

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.

release(v4.19.16): your AI agent makes the clip - Phosphene in Claude Code or Codex in one line (MCP server + phosphene command); renders wait for model downloads; fleet fixes

mrbizarro586f16e84f9a
diff --git a/README.md b/README.md
index 92f5182..d048c51 100644
--- a/README.md
+++ b/README.md
@@ -18,7 +18,7 @@ It runs **LTX-2.5** and **MiniMax H3 (Hailuo H3)** for text-to-video and image-t
and is built on Apple's MLX: no CUDA, no cloud GPU, no API key, no credits and no watermark.
Your prompts, pictures and videos never leave your Mac.
-**Current release: v4.19.15.** Made by Mr Bizarro.
+**Current release: v4.19.16.** Made by Mr Bizarro.
## Why Phosphene
@@ -112,7 +112,14 @@ Local Gemma writes the training captions for you. Browse and install LTX LoRAs f
### Scripts and AI agents
-Everything the app does is reachable over a local HTTP API (`docs/API.md`), so Claude Code, Codex or your own script can queue renders.
+Add Phosphene to Claude Code, Codex or any MCP client in one line (Phosphene running in Pinokio):
+
+```bash
+claude mcp add phosphene -- ~/pinokio/api/phosphene.git/ltx-2-mlx/env/bin/python ~/pinokio/api/phosphene.git/agents/phosphene_mcp.py
+```
+
+There is also a `phosphene` command (`agents/phosphene_cli.py`); both are in [`docs/AGENT_TOOLS.md`](docs/AGENT_TOOLS.md).
+Under them, everything the app does is reachable over a local HTTP API (`docs/API.md`), so your own script can queue renders too.
There is also an image layout API for agents (`docs/AGENT_API.md`).
Gemma runs locally for prompt **Enhance**, captions and the storyboard planner.
diff --git a/VERSION b/VERSION
index fc77e3b..5d79012 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-4.19.15
+4.19.16
diff --git a/agent_discovery.py b/agent_discovery.py
new file mode 100644
index 0000000..d2bd5a9
--- /dev/null
+++ b/agent_discovery.py
@@ -0,0 +1,110 @@
+"""Where a running Phosphene studio can be found by the tools that drive it.
+
+The studio listens on a different port in each place it runs: 8198 in a
+Pinokio install, 8199 in the dev profile, and a free port in 8930-8999 in the
+Mac app (PanelProcess.freePort). An agent tool (agents/phosphene_cli.py, the
+MCP server agents/phosphene_mcp.py, a script) must not have to know which.
+
+So the studio announces itself: once its listener is bound it writes
+``~/.phosphene/servers/<port>.json`` and removes it when it stops. HOME is the
+one location both wrappers share (Pinokio rewrites TMPDIR, the Mac app keeps its
+data in one folder of its own), and the file holds no secret: the URL, the pid,
+the version and where this install keeps its outputs and its agent tools.
+
+``PHOSPHENE_DISCOVERY_DIR`` moves the folder (tests, sandboxes).
+``PHOSPHENE_DISCOVERY=0`` turns announcing off.
+
+Readers must treat a file as a hint: they check the pid is alive and the URL
+answers before they trust it (agents/phosphene_client.py does).
+"""
+from __future__ import annotations
+
+import json
+import os
+import sys
+import time
+from pathlib import Path
+
+FORMAT = 1
+
+
+def discovery_dir(env=None) -> Path:
+ env = os.environ if env is None else env
+ override = (env.get("PHOSPHENE_DISCOVERY_DIR") or "").strip()
+ if override:
+ return Path(override).expanduser()
+ return Path.home() / ".phosphene" / "servers"
+
+
+def enabled(env=None) -> bool:
+ env = os.environ if env is None else env
+ return (env.get("PHOSPHENE_DISCOVERY") or "").strip().lower() not in ("0", "off", "false", "no")
+
+
+def record_path(port: int, env=None) -> Path:
+ return discovery_dir(env) / f"{int(port)}.json"
+
+
+def announce(port: int, info: dict, env=None) -> Path | None:
+ """Write this studio's record. Never raises: a read-only home must not stop a studio from starting."""
+ if not enabled(env):
+ return None
+ try:
+ target = record_path(port, env)
+ target.parent.mkdir(parents=True, exist_ok=True)
+ prune(env)
+ record = {"format": FORMAT, "app": "phosphene", "port": int(port),
+ "url": f"http://127.0.0.1:{int(port)}", "pid": os.getpid(),
+ "started_at": time.strftime("%Y-%m-%dT%H:%M:%S%z"), "python": sys.executable}
+ record.update({k: v for k, v in (info or {}).items() if k not in ("format", "app", "port", "url", "pid")})
+ tmp = target.with_name(f".{target.name}.{os.getpid()}.tmp")
+ tmp.write_text(json.dumps(record, indent=2), encoding="utf-8")
+ os.replace(tmp, target)
+ return target
+ except Exception: # noqa: BLE001 - discovery is optional; nothing here may stop a studio from starting
+ return None
+
+
+def _alive(pid) -> bool:
+ try:
+ if isinstance(pid, bool) or int(pid) <= 0:
+ return False
+ os.kill(int(pid), 0)
+ except (ProcessLookupError, ValueError, TypeError, OverflowError):
+ return False
+ except PermissionError:
+ return True
+ return int(pid) > 0
+
+
+def prune(env=None) -> int:
+ """Remove records whose process is gone. A studio stopped by a signal never reaches withdraw() (the
+ Mac app and Pinokio both stop it that way), so the next studio to start tidies up after it."""
+ removed = 0
+ try:
+ for f in discovery_dir(env).glob("*.json"):
+ try:
+ rec = json.loads(f.read_text(encoding="utf-8"))
+ if not isinstance(rec, dict) or rec.get("app") != "phosphene":
+ continue # not a studio record: leave it alone
+ if not _alive(rec.get("pid")):
+ f.unlink()
+ removed += 1
+ except (OSError, ValueError):
+ continue
+ except Exception: # noqa: BLE001
+ pass
+ return removed
+
+
+def withdraw(port: int, env=None) -> bool:
+ """Remove this studio's record, only if it is still ours (a newer studio on the same port keeps its own)."""
+ try:
+ target = record_path(port, env)
+ data = json.loads(target.read_text(encoding="utf-8"))
+ if not isinstance(data, dict) or data.get("pid") != os.getpid():
+ return False
+ target.unlink()
+ return True
+ except Exception: # noqa: BLE001 - runs on the way out; never in the way of the shutdown after it
+ return False
diff --git a/agents/phosphene_cli.py b/agents/phosphene_cli.py
new file mode 100644
index 0000000..99f9965
--- /dev/null
+++ b/agents/phosphene_cli.py
@@ -0,0 +1,244 @@
+#!/usr/bin/env python3
+"""phosphene: drive the Phosphene studio running on this Mac from a terminal or a script.
+
+ phosphene status is it running, where, Free or Pro, what it can make
+ phosphene video "a red tram in the rain" [--engine ltx|h3] [--image still.png] [--quality ..] [--seconds 5] [--wait] [--out DIR]
+ phosphene image "a poster of a red tram" [--n 2] [--aspect 1:1] [--wait] [--out DIR]
+ phosphene speech "Hello there." [--voice ryan] [--wait] [--out DIR]
+ phosphene music "warm lo-fi piano, rain" [--lyrics FILE] [--seconds 60] [--wait] [--out DIR]
+ phosphene jobs running, queued and recent jobs
+ phosphene wait JOB [--out DIR] wait until a job finishes (and copy its files)
+ phosphene fetch JOB --out DIR copy a finished job's files
+ phosphene stop [JOB] stop the running job
+ phosphene servers every Phosphene studio answering on this Mac
+ phosphene mcp-config the MCP entry to paste into Claude Code / Codex / any MCP client
+
+Add --json to any command for machine-readable output. Exit codes: 0 ok, 1 the studio refused
+or the job failed, 2 bad arguments, 3 Phosphene is not running.
+
+Works the same for a Pinokio install and for the Mac app: it finds the running studio by
+itself (agents/phosphene_client.py). The studio checks every request exactly as it checks
+its own page, including what Free and Pro include.
+"""
+from __future__ import annotations
+
+import argparse
+import json
+import shlex
+import sys
+from pathlib import Path
+
+# Never write __pycache__ beside these files: in the Mac app they sit inside a verified code
+# folder, and a file that is not in its manifest fails the next launch's tree check.
+sys.dont_write_bytecode = True
+sys.path.insert(0, str(Path(__file__).resolve().parent))
+
+from phosphene_client import NotRunning, Phosphene, PhospheneError, find_servers # noqa: E402
+
+HERE = Path(__file__).resolve().parent
+
+
+def _print(args, data, text: str | None = None) -> None:
+ if args.json or text is None:
+ print(json.dumps(data, indent=2, default=str))
+ else:
+ print(text)
+
+
+def _finish(args, ph: Phosphene, job_id: str) -> int:
+ if not args.wait and not args.out:
+ _print(args, {"ok": True, "id": job_id}, f"queued {job_id} (phosphene wait {job_id} --out DIR)")
+ return 0
+ progress = None if args.json else (lambda line, _row: print(f" {line}", file=sys.stderr, flush=True))
+ row = ph.wait(job_id, timeout=args.timeout, on_progress=progress)
+ if row.get("status") != "done":
+ _print(args, {"ok": False, "id": job_id, "status": row.get("status"), "error": row.get("error")},
+ f"{job_id} {row.get('status')}: {row.get('error') or ''}".strip())
+ return 1
+ files = ph.fetch(job_id, args.out) if args.out else ph.outputs_of(row)
+ _print(args, {"ok": True, "id": job_id, "status": "done", "elapsed_sec": row.get("elapsed_sec"), "files": files},
+ "\n".join([f"done {job_id} in {row.get('elapsed_sec')} s"] + files))
+ return 0
+
+
+def cmd_status(args, ph: Phosphene) -> int:
+ info = ph.info()
+ if args.json:
+ _print(args, info)
+ return 0
+ pro = info.get("pro") or {}
+ eng = info.get("engines") or {}
+ ready = ", ".join(k for k, v in eng.items() if (v or {}).get("available")) or "nothing yet"
+ j = ph.jobs()
+ lines = [f"Phosphene {info.get('version') or ''} at {ph.url} ({info.get('distribution', '?')})".replace(" ", " "),
+ f"Plan: {'Pro' if pro.get('active') else 'Free'}",
+ f"Can make: {ready}",
+ f"Jobs: {len(j['running'])} running, {len(j['queued'])} queued" + (" (queue paused)" if j["paused"] else "")]
+ print("\n".join(lines))
+ return 0
+
+
+def cmd_servers(args, _ph) -> int:
+ rows = find_servers()
+ if args.json:
+ _print(args, rows)
+ elif not rows:
+ print("No Phosphene studio is answering on this Mac.")
+ else:
+ for r in rows:
+ i = r.get("info") or {}
+ print(f"{r['url']} {i.get('distribution', '?')} {i.get('version') or ''} (found by {r['source']})")
+ return 0 if rows else 3
+
+
+def cmd_video(args, ph: Phosphene) -> int:
+ doc = ph.video(args.prompt, engine=args.engine, image=args.image, quality=args.quality,
+ seconds=args.seconds, length=args.length, seed=args.seed, label=args.label)
+ return _finish(args, ph, doc["id"])
+
+
+def cmd_image(args, ph: Phosphene) -> int:
+ doc = ph.image(args.prompt, n=args.n, aspect=args.aspect, engine=args.engine, seed=args.seed, label=args.label)
+ return _finish(args, ph, doc["id"])
+
+
+def cmd_speech(args, ph: Phosphene) -> int:
+ doc = ph.speech(args.text, voice=args.voice, speed=args.speed)
+ return _finish(args, ph, doc.get("job_id") or doc.get("id"))
+
+
+def cmd_music(args, ph: Phosphene) -> int:
+ lyrics = Path(args.lyrics).read_text(encoding="utf-8") if args.lyrics else ""
+ doc = ph.music(args.style, lyrics=lyrics, instrumental=args.instrumental, seconds=args.seconds,
+ title=args.title, seed=args.seed)
+ return _finish(args, ph, doc["id"])
+
+
+def cmd_jobs(args, ph: Phosphene) -> int:
+ j = ph.jobs()
+ if args.json:
+ _print(args, j)
+ return 0
+ def line(r, st=None):
+ p = r.get("params") or {}
+ return f"{r.get('id')} {st or r.get('status')} {p.get('mode', '')}/{p.get('engine', 'ltx')} {str(p.get('prompt', ''))[:60]}"
+ for r in j["running"]:
+ prog = r.get("progress") or {}
+ print(line(r, "running") + (f" {prog.get('pct')}%" if prog.get("pct") is not None else ""))
+ for r in j["queued"]:
+ print(line(r, "queued"))
+ for r in j["history"][: args.limit]:
+ print(line(r))
+ return 0
+
+
+def cmd_wait(args, ph: Phosphene) -> int:
+ args.wait = True
+ return _finish(args, ph, args.job)
+
+
+def cmd_fetch(args, ph: Phosphene) -> int:
+ files = ph.fetch(args.job, args.out)
+ _print(args, {"ok": True, "files": files}, "\n".join(files))
+ return 0
+
+
+def cmd_stop(args, ph: Phosphene) -> int:
+ _print(args, ph.stop(args.job), "stop requested")
+ return 0
+
+
+def mcp_entry() -> dict:
+ return {"mcpServers": {"phosphene": {"command": sys.executable, "args": [str(HERE / "phosphene_mcp.py")]}}}
+
+
+def cmd_mcp_config(args, _ph) -> int:
+ entry = mcp_entry()
+ if args.json:
+ _print(args, entry)
+ return 0
+ srv = entry["mcpServers"]["phosphene"]
+ print(json.dumps(entry, indent=2))
+ line = " ".join(shlex.quote(x) for x in [srv["command"], *srv["args"]])
+ print("\nClaude Code: claude mcp add phosphene -- " + line)
+ print("Codex: codex mcp add phosphene -- " + line)
+ return 0
+
+
+def build_parser() -> argparse.ArgumentParser:
+ ap = argparse.ArgumentParser(prog="phosphene", description="Drive the Phosphene studio running on this Mac.")
+ ap.add_argument("--url", help="a studio URL (default: find the running one)")
+ ap.add_argument("--json", action="store_true", help="machine-readable output")
+ sub = ap.add_subparsers(dest="cmd", required=True)
+
+ def make(name, fn, help_):
+ p = sub.add_parser(name, help=help_)
+ p.set_defaults(fn=fn)
+ p.add_argument("--json", action="store_true", default=argparse.SUPPRESS)
+ return p
+
+ def finishing(p):
+ p.add_argument("--wait", action="store_true", help="wait until it is finished")
+ p.add_argument("--out", help="copy the finished files here (implies --wait)")
+ p.add_argument("--timeout", type=float, default=3600, help="seconds to wait (default 3600)")
+ p.add_argument("--seed", type=int)
+ p.add_argument("--label")
+
+ make("status", cmd_status, "is Phosphene running, Free or Pro, what it can make")
+ make("servers", cmd_servers, "every studio answering on this Mac")
+ p = make("video", cmd_video, "make a video clip")
+ p.add_argument("prompt")
+ p.add_argument("--engine", default="ltx", choices=["ltx", "h3"])
+ p.add_argument("--image", help="start frame (a picture on this Mac)")
+ p.add_argument("--quality", help="LTX: quick|balanced|standard|high|high_720p; H3: draft|fast_hd|standard|high|...")
+ p.add_argument("--seconds", type=float, help="length in seconds (LTX any; H3 3, 5, 10 or 15)")
+ p.add_argument("--length", help="H3 length key, e.g. 5s, 10s, 10s_dense")
+ finishing(p)
+ p = make("image", cmd_image, "make still images")
+ p.add_argument("prompt")
+ p.add_argument("--n", type=int, default=1)
+ p.add_argument("--aspect", default="16:9")
+ p.add_argument("--engine", default="auto", help="image engine (default: the one set in Phosphene)")
+ finishing(p)
+ p = make("speech", cmd_speech, "text to speech")
+ p.add_argument("text")
+ p.add_argument("--voice")
+ p.add_argument("--speed", type=float)
+ finishing(p)
+ p = make("music", cmd_music, "make a song or an instrumental")
+ p.add_argument("style", help="the style: genre, instruments, mood")
+ p.add_argument("--lyrics", help="a text file with the lyrics (none = instrumental)")
+ p.add_argument("--instrumental", action="store_true")
+ p.add_argument("--seconds", type=int)
+ p.add_argument("--title")
+ finishing(p)
+ p = make("jobs", cmd_jobs, "running, queued and recent jobs")
+ p.add_argument("--limit", type=int, default=10)
+ p = make("wait", cmd_wait, "wait for a job to finish")
+ p.add_argument("job")
+ p.add_argument("--out")
+ p.add_argument("--timeout", type=float, default=3600)
+ p = make("fetch", cmd_fetch, "copy a finished job's files")
+ p.add_argument("job")
+ p.add_argument("--out", required=True)
+ p = make("stop", cmd_stop, "stop the running job")
+ p.add_argument("job", nargs="?")
+ make("mcp-config", cmd_mcp_config, "the MCP server entry for agent tools")
+ return ap
+
+
+def main(argv=None) -> int:
+ args = build_parser().parse_args(argv)
+ try:
+ ph = None if args.fn in (cmd_servers, cmd_mcp_config) else Phosphene(args.url)
+ return args.fn(args, ph)
+ except NotRunning as e:
+ _print(args, {"ok": False, "error": str(e), "code": "not_running"}, str(e))
+ return 3
+ except PhospheneError as e:
+ _print(args, {"ok": False, "error": str(e), "status": e.status, **({"detail": e.body} if e.body else {})}, str(e))
+ return 1
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/agents/phosphene_client.py b/agents/phosphene_client.py
new file mode 100644
index 0000000..cd7d846
--- /dev/null
+++ b/agents/phosphene_client.py
@@ -0,0 +1,414 @@
+"""A small client for a running Phosphene studio: find it, talk to it, wait for a job.
+
+Standard library only (Python 3.9+), so it runs on any Python on a Mac: the
+studio's own venv, the Mac app's runtime, /usr/bin/python3. The CLI
+(phosphene_cli.py) and the MCP server (phosphene_mcp.py) are both thin layers
+over this one module, so they find the studio the same way and say the same
+thing when it is not running.
+
+Finding the studio, in order:
+ 1. PHOSPHENE_URL (e.g. http://127.0.0.1:8198), when set: that and nothing else.
+ 2. The records running studios write to ~/.phosphene/servers/<port>.json
+ (agent_discovery.py in the studio), newest first, pid alive and answering.
+ 3. The ports the studio uses when nobody wrote a record (an older studio):
+ 8198 (Pinokio), 8199 (dev profile), 8930-8999 (the Mac app).
+
+Every request goes through the studio's own HTTP API, the same routes its page
+uses, so the studio applies the same checks to an agent as to a person: model
+licences, what this Mac can run, and what Free and Pro include. Nothing here
+decides any of that.
+"""
+from __future__ import annotations
+
+import json
+import mimetypes
+import os
+import re
+import shutil
+import socket
+import time
+import urllib.error
+import urllib.parse
+import urllib.request
+import uuid
+from pathlib import Path
+
+PINOKIO_PORT = 8198
+DEV_PORT = 8199
+MAC_APP_PORTS = range(8930, 9000)
+TERMINAL = ("done", "failed", "cancelled", "stopped", "error")
+
+NOT_RUNNING = (
+ "Phosphene is not running on this Mac. Start it first: open the Phosphene app, "
+ "or press Start on Phosphene in Pinokio. Then try again. "
+ "(If it runs somewhere unusual, set PHOSPHENE_URL, e.g. http://127.0.0.1:8198.)")
+
+
+class PhospheneError(Exception):
+ """A failure with a sentence a person can act on. `status` and `body` carry the studio's answer, if any."""
+
+ def __init__(self, message: str, status: int | None = None, body: dict | None = None):
+ super().__init__(message)
+ self.status = status
+ self.body = body or {}
+
+
+class NotRunning(PhospheneError):
+ pass
+
+
+def discovery_dir() -> Path:
+ override = (os.environ.get("PHOSPHENE_DISCOVERY_DIR") or "").strip()
+ return Path(override).expanduser() if override else Path.home() / ".phosphene" / "servers"
+
+
+def _pid_alive(pid) -> bool:
+ if isinstance(pid, bool):
+ return False
+ try:
+ pid = int(pid)
+ except (TypeError, ValueError, OverflowError):
+ return False
+ if pid <= 0:
+ return False
+ try:
+ os.kill(pid, 0)
+ except (ProcessLookupError, OverflowError):
+ return False
+ except PermissionError:
+ return True
+ return True
+
+
+def _port_open(port: int, timeout: float = 0.15) -> bool:
+ try:
+ with socket.create_connection(("127.0.0.1", port), timeout=timeout):
+ return True
+ except OSError:
+ return False
+
+
+def _get_json(url: str, timeout: float = 3.0):
+ with urllib.request.urlopen(url, timeout=timeout) as r:
+ return json.loads(r.read().decode("utf-8", "replace"))
+
+
+def probe(url: str, timeout: float = 3.0) -> dict | None:
+ """The studio's identity at `url`, or None when nothing (or something else) answers there."""
+ url = url.rstrip("/")
+ try:
+ info = _get_json(url + "/agents/info", timeout)
+ if isinstance(info, dict) and info.get("app") == "phosphene":
+ return info
+ except urllib.error.HTTPError as e:
+ if e.code != 404:
+ return None
+ except (OSError, ValueError):
+ return None
+ # A studio from before /agents/info: /pro/status is a Phosphene-only route.
+ try:
+ pro = _get_json(url + "/pro/status", timeout)
+ if isinstance(pro, dict) and "active" in pro:
+ return {"app": "phosphene", "url": url, "legacy": True, "pro": pro}
+ except (OSError, ValueError):
+ pass
+ return None
+
+
+def discovery_records() -> list[dict]:
+ out = []
+ d = discovery_dir()
+ try:
+ files = sorted(d.glob("*.json"), key=lambda p: p.stat().st_mtime, reverse=True)
+ except OSError:
+ files = []
+ for f in files:
+ try:
+ rec = json.loads(f.read_text(encoding="utf-8"))
+ except (OSError, ValueError):
+ continue
+ if isinstance(rec, dict) and rec.get("app") == "phosphene" and rec.get("url"):
+ rec["_file"] = str(f)
+ out.append(rec)
+ return out
+
+
+def find_servers(scan: bool = True) -> list[dict]:
+ """Every studio answering on this Mac: [{url, source, info}], best first."""
+ explicit = (os.environ.get("PHOSPHENE_URL") or "").strip().rstrip("/")
+ if explicit:
+ info = probe(explicit)
+ return [{"url": explicit, "source": "PHOSPHENE_URL", "info": info}] if info else []
+ found, seen = [], set()
+ for rec in discovery_records():
+ url = str(rec["url"]).rstrip("/")
+ if url in seen or not _pid_alive(rec.get("pid")):
+ continue
+ info = probe(url)
+ if info:
+ seen.add(url)
+ found.append({"url": url, "source": "discovery", "record": rec.get("_file"), "info": info})
+ if scan:
+ for port in [PINOKIO_PORT, DEV_PORT, *MAC_APP_PORTS]:
+ url = f"http://127.0.0.1:{port}"
+ if url in seen or not _port_open(port):
+ continue
+ info = probe(url)
+ if info:
+ seen.add(url)
+ found.append({"url": url, "source": "port scan", "info": info})
+ return found
+
+
+def find_server() -> str:
+ servers = find_servers()
+ if not servers:
+ raise NotRunning(NOT_RUNNING)
+ return servers[0]["url"]
+
+
+def _multipart(fields: dict, files: dict) -> tuple[bytes, str]:
+ boundary = "----phosphene" + uuid.uuid4().hex
+ parts = []
+ for k, v in fields.items():
+ parts.append(f'--{boundary}\r\nContent-Disposition: form-data; name="{k}"\r\n\r\n{v}\r\n'.encode())
+ for k, path in files.items():
+ p = Path(path)
+ ctype = mimetypes.guess_type(p.name)[0] or "application/octet-stream"
+ parts.append((f'--{boundary}\r\nContent-Disposition: form-data; name="{k}"; filename="{p.name}"\r\n'
+ f"Content-Type: {ctype}\r\n\r\n").encode() + p.read_bytes() + b"\r\n")
+ parts.append(f"--{boundary}--\r\n".encode())
+ return b"".join(parts), f"multipart/form-data; boundary={boundary}"
+
+
+def _loads_status(raw: bytes):
+ # /status can carry control characters from prompts with newlines (docs/API.md).
+ text = re.sub(r"[\x00-\x08\x0b\x0c\x0e-\x1f]", " ", raw.decode("utf-8", "replace"))
+ return json.loads(text, strict=False)
+
+
+def row_outputs(row: dict) -> list[str]:
+ """Every file a finished job made. An image batch keeps only its first picture in output_path;
+ the whole batch is params.candidate_paths."""
+ paths = []
+ params = row.get("params") if isinstance(row.get("params"), dict) else {}
+ for v in [row.get(k) for k in ("output_path", "output_paths", "outputs", "paths")] + [params.get("candidate_paths")]:
+ if isinstance(v, str) and v:
+ paths.append(v)
+ elif isinstance(v, list):
+ paths += [x if isinstance(x, str) else (x or {}).get("path") for x in v if isinstance(x, (str, dict))]
+ return [p for p in dict.fromkeys(paths) if p]
+
+
+class WaitCancelled(PhospheneError):
+ """The caller gave up waiting. The job itself keeps going in Phosphene."""
+
+
+class Phosphene:
+ """One studio. `Phosphene()` finds it; `Phosphene("http://127.0.0.1:8198")` uses that one."""
+
+ def __init__(self, url: str | None = None, timeout: float = 30.0):
+ self.url = (url or find_server()).rstrip("/")
+ self.timeout = timeout
+
+ # ---- transport
+ def request(self, method: str, path: str, *, form: dict | None = None, json_body=None,
+ files: dict | None = None, timeout: float | None = None, raw: bool = False):
+ data, headers = None, {}
+ if files:
+ data, headers["Content-Type"] = _multipart({k: str(v) for k, v in (form or {}).items()}, files)
+ elif json_body is not None:
+ data, headers["Content-Type"] = json.dumps(json_body).encode(), "application/json"
+ elif form is not None:
+ data = urllib.parse.urlencode({k: str(v) for k, v in form.items() if v is not None}).encode()
+ headers["Content-Type"] = "application/x-www-form-urlencoded"
+ req = urllib.request.Request(self.url + path, data=data, method=method, headers=headers)
+ try:
+ with urllib.request.urlopen(req, timeout=timeout or self.timeout) as r:
+ body = r.read()
+ except urllib.error.HTTPError as e:
+ body = e.read()
+ try:
+ doc = json.loads(body.decode("utf-8", "replace"))
+ except ValueError:
+ doc = {}
+ msg = (doc.get("error") if isinstance(doc, dict) else None) or f"HTTP {e.code} from Phosphene"
+ if e.code == 451 and isinstance(doc, dict) and doc.get("code") == "licence_required":
+ # Deliberately no way to accept from here: accepting on someone's behalf is accepting
+ # for them (docs/API.md, Model licences). The person reads the terms and ticks the box.
+ msg += (" The person using this Mac has to read and accept that model's licence once, "
+ "in Phosphene itself; an agent cannot accept it for them.")
+ raise PhospheneError(msg, e.code, doc if isinstance(doc, dict) else {}) from None
+ except (urllib.error.URLError, ConnectionError, socket.timeout) as e:
+ raise NotRunning(f"Lost the connection to Phosphene at {self.url} ({e}). " + NOT_RUNNING) from None
+ if raw:
+ return body
+ return _loads_status(body) if body else {}
+
+ def get(self, path: str, **kw):
+ return self.request("GET", path, **kw)
+
+ def post(self, path: str, **kw):
+ return self.request("POST", path, **kw)
+
+ # ---- what is here
+ def info(self) -> dict:
+ info = probe(self.url)
+ if not info:
+ raise NotRunning(NOT_RUNNING)
+ return info
+
+ def status(self) -> dict:
+ return self.get("/status")
+
+ # ---- inputs
+ def upload(self, path: str) -> str:
+ """Copy a picture into the studio's uploads and return the path it can use."""
+ p = Path(path).expanduser()
+ if not p.is_file():
+ raise PhospheneError(f"There is no file at {p}.")
+ doc = self.post("/upload", files={"image": str(p)}, timeout=120)
+ out = doc.get("path") if isinstance(doc, dict) else None
+ if not out:
+ raise PhospheneError(f"Phosphene did not accept {p.name}: {doc}")
+ return out
+
+ # ---- make things
+ def video(self, prompt: str, *, engine: str = "ltx", mode: str | None = None, image: str | None = None,
+ quality: str | None = None, seconds: float | None = None, length: str | None = None,
+ seed: int | None = None, label: str | None = None, extra: dict | None = None) -> dict:
+ form: dict = {"prompt": prompt, "engine": engine}
+ if image:
+ form["image"] = image if Path(image).is_absolute() and _under_studio(image) else self.upload(image)
+ form["mode"] = mode or ("i2v" if image else "t2v")
+ if engine == "h3":
+ if quality:
+ form["h3_quality"] = quality
+ form["h3_length"] = length or (f"{int(seconds)}s" if seconds else "5s")
+ else:
+ if quality:
+ form["quality"] = quality
+ if seconds:
+ form["duration"] = seconds
+ if seed is not None:
+ form["seed"] = seed
+ if label:
+ form["label"] = label
+ form["open_when_done"] = "off"
+ form.update(extra or {})
+ return self.post("/queue/add", form=form)
+
+ def image(self, prompt: str, *, n: int = 1, aspect: str = "16:9", engine: str = "auto",
+ seed: int | None = None, label: str | None = None) -> dict:
+ form = {"mode": "image", "prompt": prompt, "n": n, "aspect": aspect, "engine_override": engine}
+ if seed is not None:
+ form["seed"] = seed
+ if label:
+ form["label"] = label
+ return self.post("/queue/add", form=form)
+
+ def speech(self, text: str, *, voice: str | None = None, speed: float | None = None) -> dict:
+ spec: dict = {"text": text, "wait": False}
+ if voice:
+ spec["voice"] = voice
+ if speed:
+ spec["speed"] = speed
+ try:
+ return self.post("/speech/generate", json_body=spec)
+ except PhospheneError as e:
+ if e.status == 404: # a studio from before Audio > Speech (the 4.19 line)
+ raise PhospheneError("This Phosphene has no text to speech. It comes with a newer version "
+ "of Phosphene; video, images and music work here.", 404) from None
+ raise
+
+ def music(self, style: str, *, lyrics: str = "", instrumental: bool = False, seconds: int | None = None,
+ title: str | None = None, seed: int | None = None) -> dict:
+ form = {"mode": "music", "engine": "music", "music_style": style, "music_lyrics": lyrics,
+ "music_instrumental": "on" if instrumental or not lyrics else "off"}
+ if seconds:
+ form["music_max_seconds"] = seconds
+ if title:
+ form["music_title"] = title
+ if seed is not None:
+ form["seed"] = seed
+ return self.post("/queue/add", form=form)
+
+ # ---- jobs
+ def jobs(self) -> dict:
+ s = self.status()
+ cur = s.get("current")
+ return {"running": [cur] if cur else [], "queued": s.get("queue") or [],
+ "history": s.get("history") or [], "paused": bool(s.get("paused"))}
+
+ def job(self, job_id: str) -> dict | None:
+ j = self.jobs()
+ for group, rows in (("running", j["running"]), ("queued", j["queued"]), ("history", j["history"])):
+ for row in rows:
+ if row and row.get("id") == job_id:
+ row = dict(row)
+ row.setdefault("status", "running" if group == "running" else "queued" if group == "queued" else None)
+ if group == "running":
+ row["status"] = row.get("status") or "running"
+ return row
+ return None
+
+ def wait(self, job_id: str, timeout: float = 3600, every: float = 5.0, on_progress=None, cancelled=None) -> dict:
+ """Poll until the job ends. `cancelled` (a threading.Event) ends the wait early with WaitCancelled."""
+ deadline = time.time() + timeout
+ last = None
+ while True:
+ row = self.job(job_id)
+ if row is None:
+ raise PhospheneError(f"Phosphene has no job {job_id} (it may have been removed).")
+ st = row.get("status")
+ if st in TERMINAL:
+ return row
+ if on_progress:
+ prog = row.get("progress") or {}
+ line = f"{st} {prog.get('pct', '')}% {prog.get('phase_label', '')}".strip()
+ if line != last:
+ on_progress(line, row)
+ last = line
+ if time.time() > deadline:
+ raise PhospheneError(f"Job {job_id} is still {st} after {int(timeout)} s; it keeps going in Phosphene.")
+ if cancelled is not None:
+ if cancelled.wait(every):
+ raise WaitCancelled(f"Stopped waiting for {job_id}; it keeps going in Phosphene.")
+ else:
+ time.sleep(every)
+
+ def stop(self, job_id: str | None = None) -> dict:
+ return self.post("/stop" + (f"?id={urllib.parse.quote(job_id)}" if job_id else ""), form={})
+
+ def outputs_of(self, row: dict) -> list[str]:
+ return row_outputs(row)
+
+ def fetch(self, job_id: str, dest: str) -> list[str]:
+ """Copy a finished job's files into `dest`. Returns the new paths."""
+ row = self.job(job_id)
+ if row is None:
+ raise PhospheneError(f"Phosphene has no job {job_id}.")
+ if row.get("status") != "done":
+ raise PhospheneError(f"Job {job_id} is {row.get('status')}, not done: {row.get('error') or ''}".strip())
+ out_dir = Path(dest).expanduser()
+ out_dir.mkdir(parents=True, exist_ok=True)
+ saved = []
+ for src in self.outputs_of(row):
+ target = out_dir / Path(src).name
+ if Path(src).is_file():
+ shutil.copy2(src, target)
+ else:
+ target.write_bytes(self.get("/file?path=" + urllib.parse.quote(src), raw=True, timeout=600))
+ saved.append(str(target))
+ if not saved:
+ raise PhospheneError(f"Job {job_id} finished but names no output file.")
+ return saved
+
+ # ---- licences (the studio asks before some models run; a person accepts)
+ def licences(self) -> dict:
+ return self.get("/licences")
+
+
+def _under_studio(path: str) -> bool:
+ # A path inside the studio's uploads/outputs can be passed as is; anything else is uploaded.
+ return "/uploads/" in path or "/panel_uploads/" in path or "/outputs/" in path or "/mlx_outputs/" in path
diff --git a/agents/phosphene_mcp.py b/agents/phosphene_mcp.py
new file mode 100644
index 0000000..7bfff02
--- /dev/null
+++ b/agents/phosphene_mcp.py
@@ -0,0 +1,314 @@
+#!/usr/bin/env python3
+"""Phosphene as an MCP server (stdio): Claude Code, Codex or any MCP client makes clips on this Mac.
+
+ claude mcp add phosphene -- <python3> <studio>/agents/phosphene_mcp.py
+ codex mcp add phosphene -- <python3> <studio>/agents/phosphene_mcp.py
+
+`phosphene mcp-config` (or GET /agents/info on the running studio) prints the exact line
+for this install. Standard library only: newline-delimited JSON-RPC 2.0 on stdin/stdout,
+protocol 2025-06-18 (older clients get the version they ask for). Logs go to stderr.
+
+The tools are the same actions as the `phosphene` CLI, over the same client, so they find
+the studio the same way (Pinokio or the Mac app) and the studio checks every request as it
+checks its own page: model licences, what this Mac can run, what Free and Pro include.
+There is deliberately no tool that accepts a model licence on the person's behalf.
+"""
+from __future__ import annotations
+
+import json
+import sys
+import threading
+import traceback
+from pathlib import Path
+
+# Never write __pycache__ beside these files: in the Mac app they sit inside a verified code
+# folder, and a file that is not in its manifest fails the next launch's tree check.
+sys.dont_write_bytecode = True
+sys.path.insert(0, str(Path(__file__).resolve().parent))
+
+from phosphene_client import NotRunning, Phosphene, PhospheneError, WaitCancelled, find_servers, row_outputs # noqa: E402
+
+SERVER_NAME = "phosphene"
+SERVER_VERSION = "1.0.0"
+PROTOCOLS = ("2025-06-18", "2025-03-26", "2024-11-05")
+
+_WAIT = {"type": "boolean", "description": "Wait until it is finished and return the file paths "
+ "(a video can take 2-20 minutes). Default false: return the job id at once and use phosphene_wait."}
+_SEED = {"type": "integer", "description": "Fixed seed for a repeatable result; omit for random."}
+
+TOOLS = [
+ {"name": "phosphene_status",
+ "description": "Is Phosphene running on this Mac, where, Free or Pro, which engines are installed and "
+ "what each can do (qualities, lengths), and what is rendering now. Call this first.",
+ "inputSchema": {"type": "object", "properties": {}, "additionalProperties": False}},
+ {"name": "phosphene_make_video",
+ "description": "Queue a video clip (with its own sound) on this Mac's GPU. Engines: 'ltx' (default; faces, "
+ "voices, dialogue) or 'h3' (Hailuo H3; motion, landscapes, if installed). A prompt works best "
+ "as one paragraph: who, where, light, the action, the camera, and the sound. Optional start "
+ "frame: a picture path on this Mac.",
+ "inputSchema": {"type": "object", "required": ["prompt"], "additionalProperties": False, "properties": {
+ "prompt": {"type": "string"},
+ "engine": {"type": "string", "enum": ["ltx", "h3"], "default": "ltx"},
+ "image": {"type": "string", "description": "Absolute path of a start-frame picture (makes it image-to-video)."},
+ "quality": {"type": "string", "description": "LTX: quick | balanced (default) | standard | high | high_720p. "
+ "H3: draft | fast_hd | standard | high (see phosphene_status)."},
+ "seconds": {"type": "number", "description": "Length. LTX: about 2-10 s (default 5). H3: 3, 5, 10 or 15."},
+ "seed": _SEED, "label": {"type": "string"}, "wait": _WAIT}}},
+ {"name": "phosphene_make_image",
+ "description": "Queue still images with the image engine chosen in Phosphene's settings.",
+ "inputSchema": {"type": "object", "required": ["prompt"], "additionalProperties": False, "properties": {
+ "prompt": {"type": "string"},
+ "n": {"type": "integer", "minimum": 1, "maximum": 8, "default": 1},
+ "aspect": {"type": "string", "enum": ["16:9", "1:1", "9:16", "4:3", "3:4", "21:9"], "default": "16:9"},
+ "seed": _SEED, "wait": _WAIT}}},
+ {"name": "phosphene_make_speech",
+ "description": "Text to speech (if the Speech pack is installed). Returns a WAV.",
+ "inputSchema": {"type": "object", "required": ["text"], "additionalProperties": False, "properties": {
+ "text": {"type": "string"},
+ "voice": {"type": "string", "description": "A preset voice name (default ryan)."},
+ "speed": {"type": "number"}, "wait": _WAIT}}},
+ {"name": "phosphene_make_music",
+ "description": "Queue a song (style + lyrics) or an instrumental (style only), if the music pack is installed.",
+ "inputSchema": {"type": "object", "required": ["style"], "additionalProperties": False, "properties": {
+ "style": {"type": "string", "description": "Genre, instruments, mood, voice."},
+ "lyrics": {"type": "string", "description": "Omit for an instrumental."},
+ "seconds": {"type": "integer"}, "title": {"type": "string"}, "seed": _SEED, "wait": _WAIT}}},
+ {"name": "phosphene_list_jobs",
+ "description": "Running, queued and recent jobs, with status, progress and output paths.",
+ "inputSchema": {"type": "object", "additionalProperties": False, "properties": {
+ "limit": {"type": "integer", "default": 10}}}},
+ {"name": "phosphene_wait",
+ "description": "Wait for a job to finish (up to timeout_sec, default 1500) and return its status and file "
+ "paths. If it is still running at the timeout, call again.",
+ "inputSchema": {"type": "object", "required": ["job_id"], "additionalProperties": False, "properties": {
+ "job_id": {"type": "string"}, "timeout_sec": {"type": "number", "default": 1500}}}},
+ {"name": "phosphene_fetch",
+ "description": "Copy a finished job's files into a folder (for example the project you are working in).",
+ "inputSchema": {"type": "object", "required": ["job_id", "dest"], "additionalProperties": False, "properties": {
+ "job_id": {"type": "string"}, "dest": {"type": "string", "description": "Absolute folder path."}}}},
+ {"name": "phosphene_stop",
+ "description": "Stop the job that is rendering now (optionally only if it is job_id).",
+ "inputSchema": {"type": "object", "additionalProperties": False, "properties": {"job_id": {"type": "string"}}}},
+]
+
+
+def _slim(row: dict) -> dict:
+ p = row.get("params") or {}
+ out = {"id": row.get("id"), "status": row.get("status"), "mode": p.get("mode"), "engine": p.get("engine", "ltx"),
+ "prompt": str(p.get("prompt") or "")[:200], "elapsed_sec": row.get("elapsed_sec"),
+ "error": row.get("error"), "warning": row.get("warning")}
+ prog = row.get("progress") or {}
+ if prog:
+ out["progress"] = {k: prog.get(k) for k in ("pct", "phase_label", "remaining_sec") if k in prog}
+ files = row_outputs(row)
+ if files:
+ out["files"] = files
+ return {k: v for k, v in out.items() if v not in (None, "", [])}
+
+
+_CALL = threading.local() # per tools/call thread: .cancelled (its threading.Event), .ph (the studio it is bound to)
+
+
+class Tools:
+ def __init__(self, url: str | None = None):
+ self._url = url
+ self._ph = None
+ self._lock = threading.Lock() # calls run on their own threads: one studio is found, once
+
+ def ph(self) -> Phosphene:
+ # Found while it is not yet running, so starting Phosphene after the client fixes it. A call
+ # keeps the studio it first got (a make with wait polls the studio it queued on), however
+ # discovery changes meanwhile.
+ bound = getattr(_CALL, "ph", None)
+ if bound is not None:
+ return bound
+ with self._lock:
+ if self._ph is None:
+ self._ph = Phosphene(self._url)
+ _CALL.ph = self._ph
+ return self._ph
+
+ def invalidate(self) -> None:
+ """This call's studio stopped answering: forget it, unless another call already found a new one."""
+ failed = getattr(_CALL, "ph", None)
+ with self._lock:
+ if failed is None or self._ph is failed:
+ self._ph = None
+
+ def _queued(self, job_id: str, wait: bool, timeout: float = 1500) -> dict:
+ if not wait:
+ return {"ok": True, "job_id": job_id, "status": "queued",
+ "next": "call phosphene_wait with this job_id (renders take minutes)"}
+ return self.phosphene_wait(job_id, timeout)
+
+ def phosphene_status(self) -> dict:
+ ph = self.ph()
+ info = ph.info()
+ j = ph.jobs()
+ info["now"] = {"running": [_slim(r) for r in j["running"]], "queued": len(j["queued"]), "paused": j["paused"]}
+ others = [s["url"] for s in find_servers(scan=False) if s["url"] != ph.url]
+ if others:
+ info["other_studios"] = others
+ return info
+
+ def phosphene_make_video(self, prompt, engine="ltx", image=None, quality=None, seconds=None, seed=None,
+ label=None, wait=False) -> dict:
+ doc = self.ph().video(prompt, engine=engine, image=image, quality=quality, seconds=seconds, seed=seed, label=label)
+ return self._queued(doc["id"], wait)
+
+ def phosphene_make_image(self, prompt, n=1, aspect="16:9", seed=None, wait=False) -> dict:
+ doc = self.ph().image(prompt, n=n, aspect=aspect, seed=seed)
+ return self._queued(doc["id"], wait)
+
+ def phosphene_make_speech(self, text, voice=None, speed=None, wait=False) -> dict:
+ doc = self.ph().speech(text, voice=voice, speed=speed)
+ return self._queued(doc.get("job_id") or doc.get("id"), wait)
+
+ def phosphene_make_music(self, style, lyrics="", seconds=None, title=None, seed=None, wait=False) -> dict:
+ doc = self.ph().music(style, lyrics=lyrics or "", seconds=seconds, title=title, seed=seed)
+ return self._queued(doc["id"], wait)
+
+ def phosphene_list_jobs(self, limit=10) -> dict:
+ j = self.ph().jobs()
+ return {"running": [_slim(r) for r in j["running"]], "queued": [_slim(r) for r in j["queued"]],
+ "recent": [_slim(r) for r in j["history"][: max(0, int(limit))]], "paused": j["paused"]}
+
+ def phosphene_wait(self, job_id, timeout_sec=1500) -> dict:
+ ph = self.ph()
+ try:
+ row = ph.wait(job_id, timeout=float(timeout_sec), every=5, cancelled=getattr(_CALL, "cancelled", None))
+ except WaitCancelled:
+ raise
+ except PhospheneError as e:
+ if "still" in str(e):
+ cur = ph.job(job_id) or {}
+ return {"ok": True, "job_id": job_id, "finished": False, **_slim(cur),
+ "next": "still rendering; call phosphene_wait again"}
+ raise
+ out = {"ok": row.get("status") == "done", "job_id": job_id, "finished": True, **_slim(row)}
+ out["files"] = ph.outputs_of(row)
+ return out
+
+ def phosphene_fetch(self, job_id, dest) -> dict:
+ return {"ok": True, "files": self.ph().fetch(job_id, dest)}
+
+ def phosphene_stop(self, job_id=None) -> dict:
+ return {"ok": True, "result": self.ph().stop(job_id)}
+
+
+def call_tool(tools: Tools, name: str, arguments: dict) -> dict:
+ """MCP tools/call result. Failures are tool results with isError (the model reads the sentence), not protocol errors."""
+ _CALL.ph = None
+ fn = getattr(tools, name, None) if name.startswith("phosphene_") else None
+ if fn is None or name not in {t["name"] for t in TOOLS}:
+ return {"content": [{"type": "text", "text": f"Unknown tool {name}."}], "isError": True}
+ try:
+ result = fn(**(arguments or {}))
+ return {"content": [{"type": "text", "text": json.dumps(result, indent=2, default=str)}],
+ "structuredContent": result, "isError": False}
+ except NotRunning as e:
+ tools.invalidate()
+ return {"content": [{"type": "text", "text": str(e)}], "isError": True}
+ except PhospheneError as e:
+ detail = {"error": str(e), "status": e.status}
+ if e.body.get("code"):
+ detail["code"] = e.body["code"]
+ return {"content": [{"type": "text", "text": json.dumps(detail)}], "isError": True}
+ except TypeError as e:
+ return {"content": [{"type": "text", "text": f"Bad arguments for {name}: {e}"}], "isError": True}
+
+
+def handle(tools: Tools, msg: dict) -> dict | None:
+ mid = msg.get("id")
+ method = msg.get("method")
+ params = msg.get("params") or {}
+ if mid is None: # a notification (initialized, cancelled): nothing to answer
+ return None
+ def ok(result):
+ return {"jsonrpc": "2.0", "id": mid, "result": result}
+ if method == "initialize":
+ asked = params.get("protocolVersion")
+ return ok({"protocolVersion": asked if asked in PROTOCOLS else PROTOCOLS[0],
+ "capabilities": {"tools": {"listChanged": False}},
+ "serverInfo": {"name": SERVER_NAME, "version": SERVER_VERSION},
+ "instructions": "Phosphene renders video, images, speech and music locally on this Mac. "
+ "Call phosphene_status first. Renders take minutes: queue, then phosphene_wait."})
+ if method == "ping":
+ return ok({})
+ if method == "tools/list":
+ return ok({"tools": TOOLS})
+ if method == "tools/call":
+ return ok(call_tool(tools, str(params.get("name") or ""), params.get("arguments") or {}))
+ if method in ("resources/list", "prompts/list"):
+ return ok({method.split("/")[0]: []})
+ return {"jsonrpc": "2.0", "id": mid, "error": {"code": -32601, "message": f"Method not found: {method}"}}
+
+
+def serve(stdin=sys.stdin, stdout=sys.stdout, url: str | None = None) -> None:
+ """Newline JSON-RPC over stdio. A tools/call runs on its own thread, so while phosphene_wait blocks
+ for minutes the loop keeps reading: a ping or a phosphene_stop is answered at once, and
+ notifications/cancelled ends that wait (the render keeps going) with no reply, as MCP asks."""
+ tools = Tools(url)
+ lock = threading.Lock()
+ inflight: dict = {} # request id -> threading.Event, for tools/call still running
+ calls: list = [] # the tools/call threads this session started
+
+ def send(obj) -> None:
+ with lock:
+ stdout.write(json.dumps(obj) + "\n")
+ stdout.flush()
+
+ def run_call(m: dict, ev: threading.Event) -> None:
+ _CALL.cancelled = ev
+ try:
+ r = handle(tools, m)
+ except Exception as e: # noqa: BLE001
+ traceback.print_exc(file=sys.stderr)
+ r = {"jsonrpc": "2.0", "id": m.get("id"), "error": {"code": -32603, "message": str(e)}}
+ finally:
+ inflight.pop(m.get("id"), None)
+ if r is not None and not ev.is_set():
+ send(r)
+
+ for line in stdin:
+ line = line.strip()
+ if not line:
+ continue
+ try:
+ msg = json.loads(line)
+ except ValueError:
+ send({"jsonrpc": "2.0", "id": None, "error": {"code": -32700, "message": "Parse error"}})
+ continue
+ if isinstance(msg, dict) and msg.get("method") == "notifications/cancelled":
+ ev = inflight.get((msg.get("params") or {}).get("requestId"))
+ if ev is not None:
+ ev.set()
+ continue
+ if isinstance(msg, dict) and msg.get("method") == "tools/call" and msg.get("id") is not None:
+ ev = threading.Event()
+ inflight[msg["id"]] = ev
+ t = threading.Thread(target=run_call, args=(msg, ev), daemon=True)
+ calls.append(t)
+ t.start()
+ continue
+ batch = msg if isinstance(msg, list) else [msg]
+ replies = []
+ for m in batch:
+ try:
+ r = handle(tools, m) if isinstance(m, dict) else None
+ except Exception as e: # noqa: BLE001 - one bad request must not end the session
+ traceback.print_exc(file=sys.stderr)
+ r = {"jsonrpc": "2.0", "id": m.get("id") if isinstance(m, dict) else None,
+ "error": {"code": -32603, "message": str(e)}}
+ if r is not None:
+ replies.append(r)
+ if replies:
+ send(replies if isinstance(msg, list) else replies[0])
+ # stdin closed: give calls already running a moment to answer (a piped one-shot call still gets its
+ # reply); a long wait is abandoned with the process, and the render keeps going in Phosphene.
+ for t in calls:
+ t.join(timeout=10)
+
+
+if __name__ == "__main__":
+ serve()
diff --git a/docs/AGENT_TOOLS.md b/docs/AGENT_TOOLS.md
new file mode 100644
index 0000000..136c6ba
--- /dev/null
+++ b/docs/AGENT_TOOLS.md
@@ -0,0 +1,99 @@
+# Driving Phosphene from an agent: the CLI and the MCP server
+
+Phosphene is one local server (the studio) that the browser page, the Mac app and agent tools all
+talk to over the same HTTP API ([`API.md`](API.md)). Two small tools sit on top of it, in `agents/`:
+
+| | what | run it with |
+|---|---|---|
+| `agents/phosphene_cli.py` | the `phosphene` command: make video / images / speech / music, list jobs, wait, fetch files, status | any `python3` (3.9+, standard library only) |
+| `agents/phosphene_mcp.py` | an MCP server (stdio) with the same actions, for Claude Code, Codex or any MCP client | same |
+
+Both are thin layers over `agents/phosphene_client.py`, so they find the studio the same way and say
+the same thing when it is not running.
+
+## Connect an agent
+
+The running studio prints the exact line for this install (its own Python and path):
+
+```bash
+curl -s http://127.0.0.1:8198/agents/info | python3 -m json.tool # see "agents"
+python3 agents/phosphene_cli.py mcp-config # same, from the CLI
+```
+
+On a normal Pinokio install (the app folder is `~/pinokio/api/phosphene.git`) that line is:
+
+```bash
+claude mcp add phosphene -- ~/pinokio/api/phosphene.git/ltx-2-mlx/env/bin/python ~/pinokio/api/phosphene.git/agents/phosphene_mcp.py
+codex mcp add phosphene -- ~/pinokio/api/phosphene.git/ltx-2-mlx/env/bin/python ~/pinokio/api/phosphene.git/agents/phosphene_mcp.py
+```
+
+If you installed Phosphene under another folder name, use the line `/agents/info` prints. Any
+`python3` 3.9 or newer works too; the line uses the studio's own Python so nothing else is needed.
+Phosphene has to be running (press Start in Pinokio) when the agent uses it.
+
+In the Mac app the studio code lives under `~/Library/Application Support/Phosphene/app/<version>/`;
+`/agents/info` gives the quoted path (it has a space in it).
+
+MCP tools: `phosphene_status`, `phosphene_make_video`, `phosphene_make_image`, `phosphene_make_speech`,
+`phosphene_make_music`, `phosphene_list_jobs`, `phosphene_wait`, `phosphene_fetch`, `phosphene_stop`.
+Renders take minutes: a `make_*` tool queues and returns a job id; `phosphene_wait` blocks up to
+`timeout_sec` (default 1500 s) and can be called again.
+
+## The CLI
+
+```bash
+phosphene status
+phosphene video "A night ferry crosses a dark harbour in light rain ..." --seconds 5 --out ./clips
+phosphene video "..." --engine h3 --quality draft --seconds 10 --wait
+phosphene video "..." --image still.png # image to video (the picture is uploaded first)
+phosphene image "a travel poster of a red tram" --n 2 --aspect 3:4 --out ./stills
+phosphene jobs ; phosphene wait JOB --out DIR ; phosphene fetch JOB --out DIR ; phosphene stop
+phosphene servers # every studio answering on this Mac
+```
+
+`--json` on any command gives machine-readable output. Exit codes: `0` ok, `1` the studio refused
+or the job failed (its sentence is printed), `2` bad arguments, `3` Phosphene is not running.
+(`phosphene` here is `python3 agents/phosphene_cli.py`; alias it as you like.)
+
+## How a tool finds the studio
+
+The studio's port depends on where it runs: **8198** in Pinokio, **8199** for the dev profile, a free
+port in **8930–8999** in the Mac app (`PanelProcess.freePort`), anything with `LTX_PORT`. So:
+
+1. `PHOSPHENE_URL`, when set, is used and nothing else.
+2. Every studio writes `~/.phosphene/servers/<port>.json` once its listener is bound and removes it
+ when it stops (`agent_discovery.py`). A record is trusted only if its pid is alive and the URL
+ answers `GET /agents/info` with `"app": "phosphene"`. Newest first.
+ `PHOSPHENE_DISCOVERY_DIR` moves the folder; `PHOSPHENE_DISCOVERY=0` turns announcing off.
+3. With no record (an older studio): 8198, 8199, then 8930–8999.
+
+Nothing answering: *"Phosphene is not running on this Mac. Start it first: open the Phosphene app,
+or press Start on Phosphene in Pinokio."* (CLI exit 3; an MCP tool error, never a crash).
+
+## Free, Pro and licences
+
+The tools add no route and decide nothing. Every request is a request the page itself makes
+(`/queue/add`, `/speech/generate`, `/upload`, `/status`, `/file`), so the studio applies the same checks:
+what this Mac can run, model licences (HTTP 451 until the person accepts), and what Free and Pro
+include. A form cannot carry a Pro speed profile into a job (`make_job` builds `params` from an
+allow-list). There is deliberately **no tool that accepts a model
+licence**: accepting on someone's behalf is accepting for them, so the person does it once in
+Phosphene.
+
+## GET /agents/info
+
+```jsonc
+{"app": "phosphene", "api": 1, "url": "http://127.0.0.1:8198", "port": 8198, "pid": 123,
+ "version": "4.19.16", "distribution": "pinokio" | "mac-app", "edition": "free" | "pro", "profile": "production",
+ "pro": {"active": false, ...}, // GET /pro/status
+ "engines": {"ltx": {"available": true, "qualities": [...]},
+ "h3": {"available": false, "qualities": [...], "lengths": ["3s", "5s", "10s", "15s", ...]},
+ "speech": {...}, "music": {...}, "image": {...}},
+ "outputs_dir": "...",
+ "agents": {"cli": "...", "mcp": "...", "python": "...", "mcp_config": {...}, "claude_code": "...", "codex": "..."}}
+```
+
+Cheap (no disk walk), safe to poll.
+
+Speech (`phosphene_make_speech`, `phosphene speech`) needs a Phosphene with Audio > Speech; on a
+version without it the tool answers with a sentence saying so, and the other tools work as usual.
diff --git a/docs/ANALYTICS.md b/docs/ANALYTICS.md
index c1dcdea..124d746 100644
--- a/docs/ANALYTICS.md
+++ b/docs/ANALYTICS.md
@@ -199,7 +199,7 @@ including image and training jobs.
| Field | Type | Example | Notes |
|---|---|---|---|
-| `engine` | string | `"ltx"` | `ltx` or `h3` |
+| `engine` | string | `"ltx"` | `ltx`, `h3`, `music`, an image engine (`flux3`, `mflux/<family>`), or `image` for an image job that failed before its engine was chosen (before 4.19.16 failed image jobs said `ltx`) |
| `mode` | string | `"i2v"` | `t2v`, `i2v`, `extend`, `keyframe`, `a2v`, `restore`, `ingredients`, `control`, `upscale`, `image`, `train` |
| `tier` | string | `"standard"` | LTX quality (`quick`/`balanced`/`standard`/`high`) or the H3 composite cell (`standard_5s`, `high_10s`, …) |
| `duration_bucket` | string | `"5-15m"` | Legacy 5-value bucket, kept one more release for dashboard continuity, then removed in favour of `wall_sec_bucket` |
@@ -230,6 +230,8 @@ including image and training jobs.
| `watchdog_phase` | string | `"load"` | 4.17.5 — present only when macOS's GPU watchdog stopped this job (on `render_completed`, the run that was then re-run): which phase the GPU was in, from the helper's own step lines. **Closed vocabulary**: `encode` (Gemma prompt encoding), `load` (the transformer loading), `denoise`, `decode` |
| `gpu_abort_retry` | bool | `true` | 4.19.6 — present only when a GPU abort that was not the watchdog (crash_line `gpu_internal` / `gpu_victim` / `gpu_other`) stopped prompt encoding and the job was re-run once in a fresh engine process after a pause. On `render_completed` it means the re-run saved the render |
| `helper_warm` | bool | `false` | 4.19.6 — LTX renders that ran in the warm engine process: `true` when the (last) run started in a process that had already finished a render, `false` when it started fresh. Absent for engines that do not use it. Tells whether prompt-encoding GPU aborts follow a warm process |
+| `mem_pressure` | int | `1` | 4.19.16 — LTX renders: macOS's memory pressure level when the render started (`1` normal, `2` warning, `4` critical). Absent when unread. Tells memory pressure apart from the render itself in the 16 GB Metal-watchdog kills |
+| `mem_avail_gb` | int | `8` | 4.19.16 — LTX renders: the memory the kernel reported available when the render started, as the lower edge of `0, 2, 4, 6, 8, 12, 16, 24, 32, 64` GB. Absent when unread |
| `source` | string | `"storyboard"` | v4.9.7 — which surface queued the job. **Closed vocabulary**: `form`, `batch`, `storyboard`, `characters`, `image_studio`, `retry`, `api`, `chain` (an Upscale ×2 queued automatically behind an H3 draft), `unknown`. Makes "how much of the rendering is Storyboard" a one-click breakdown |
### `render_failed`
@@ -423,7 +425,7 @@ Once per job the panel **declined on purpose**. Same fields as
| Field | Type | Example | Notes |
|---|---|---|---|
-| `refusal` | string | `"ingredients_generation"` | **A closed vocabulary** — `ingredients_generation`, `hardware_tier`, `h3_ram`, `h3_mode`, `h3_lora_slots`, `stale_engine` (v4.9+: a 2.5 render refused because the vendored engine predates the Gemma 4 tower — remedy is a second Update click). `image_ram` (v4.9.3+: the Image Studio memory guard — the engine holds more weights than this Mac can hold, or too little is free right now). `pack_missing` (v4.9.3+: High / Keyframes / Extend chosen on a Mac that has not downloaded the Q8 add-on — remedy is Settings → Models). `vocal_separator` (4.17.x+: Lip-sync with "Listen to the voice only" on an install whose vocal separation is missing — remedy is the form's own Install button). `licence_required` (4.19.8+: a model whose licence asks for an "I accept" - Hailuo H3, Ideogram 4, YuE2, FLUX.1 Krea [dev], Bria FIBO - before it was accepted on this Mac; remedy is the licence screen, once). Which guard said no. No free text, no fingerprint: the message is our own copy, so there is nothing to scrub and nothing unknown to count |
+| `refusal` | string | `"ingredients_generation"` | **A closed vocabulary** — `ingredients_generation`, `hardware_tier`, `h3_ram`, `h3_mode`, `h3_lora_slots`, `stale_engine` (v4.9+: a 2.5 render refused because the vendored engine predates the Gemma 4 tower — remedy is a second Update click). `image_ram` (v4.9.3+: the Image Studio memory guard — the engine holds more weights than this Mac can hold, or too little is free right now). `pack_missing` (v4.9.3+: High / Keyframes / Extend chosen on a Mac that has not downloaded the Q8 add-on — remedy is Settings → Models). `vocal_separator` (4.17.x+: Lip-sync with "Listen to the voice only" on an install whose vocal separation is missing — remedy is the form's own Install button). `licence_required` (4.19.8+: a model whose licence asks for an "I accept" - Hailuo H3, Ideogram 4, YuE2, FLUX.1 Krea [dev], Bria FIBO - before it was accepted on this Mac; remedy is the licence screen, once). `pack_incomplete` (4.19.16+: an LTX render on a pack that is not completely on disk and is not downloading, named file by file; remedy is Repair. Before 4.19.16 these were `render_failed`; a pack that is still downloading now waits instead). `memory_low` (4.19.16+: a Mac with 24 GB or less whose prompt encoding macOS stopped in the last 30 minutes, still short of memory after a 90 s wait; remedy is quitting other apps). Which guard said no. No free text, no fingerprint: the message is our own copy, so there is nothing to scrub and nothing unknown to count |
#### The rule — a refusal is not a failure
diff --git a/docs/API.md b/docs/API.md
index 9e50bf0..c8a0907 100644
--- a/docs/API.md
+++ b/docs/API.md
@@ -2,6 +2,9 @@
External agents (Claude Code, Codex, OSS, or anything that speaks HTTP) drive Phosphene through this API. The in-panel chat was removed 2026-05-15 — there's no agent embedded inside the panel anymore. Everything that the chat used to do can be done by an external agent through these endpoints.
+**Ready-made tools on top of this API:** the `phosphene` CLI and an MCP server for Claude Code,
+Codex or any MCP client, in `agents/` — [`AGENT_TOOLS.md`](AGENT_TOOLS.md).
+
## Server
- **Base URL:** `http://127.0.0.1:8198` on a normal install. **`8199` is the DEV
@@ -10,6 +13,10 @@ External agents (Claude Code, Codex, OSS, or anything that speaks HTTP) drive Ph
(`mlx_ltx_panel.py:275`): `DEFAULT_PORT = 8199 if PROFILE == "dev" else 8198`,
overridable with `LTX_PORT`. If a request here returns nothing, you are
almost certainly talking to a port that has no panel on it — try the other one.
+ **The Mac app** runs the same studio on a free port in **8930–8999**. Every studio
+ writes `~/.phosphene/servers/<port>.json` while it runs and answers
+ `GET /agents/info` with `"app": "phosphene"`; the `phosphene` CLI and the MCP server
+ in `agents/` find it that way — see [`AGENT_TOOLS.md`](AGENT_TOOLS.md).
- **Process:** `mlx_ltx_panel.py` (in the repo root)
- **Wire format:** form-encoded `POST` bodies; JSON exceptions are noted
per-endpoint. Responses are **HTTP/1.0** — `BaseHTTPRequestHandler`'s
diff --git a/docs/CHANGELOG_4.19.16.md b/docs/CHANGELOG_4.19.16.md
new file mode 100644
index 0000000..a18dbb4
--- /dev/null
+++ b/docs/CHANGELOG_4.19.16.md
@@ -0,0 +1,17 @@
+# Phosphene 4.19.16
+
+**New, free for everyone: let Claude, Codex or any AI agent make clips with Phosphene.** Plus fixes for the top errors from the field.
+
+- **Agent tools (Free).** Phosphene now comes with a `phosphene` command and an MCP server, so an AI agent such as Claude Code or Codex can make video, images and music on your Mac, wait for them and pick up the files. Add it with one line, for example `claude mcp add phosphene -- ~/pinokio/api/phosphene.git/ltx-2-mlx/env/bin/python ~/pinokio/api/phosphene.git/agents/phosphene_mcp.py` (the exact line for your install is at `http://127.0.0.1:8198/agents/info`). The agent finds Phosphene by itself while it is running, uses the same checks as the page (what your Mac can run, model licences), and can never accept a model licence for you. Guide: docs/AGENT_TOOLS.md.
+- **Fixed: a render could start before its model files finished downloading.** Pressing Generate while the video model was still coming down made the clip fail with "model is incomplete". Now the Now card says "Waiting for the model download to finish" with the percentage, and the render starts by itself when the files land. Press Stop to cancel the wait.
+- **Fixed: "Expected shape ... initial_conv.weight" right after switching video generation.** A small upscaler settings file could be missing and the model still counted as complete. Phosphene now checks those files too, and Repair fetches whatever is missing.
+- **Fixed: on 16 GB Macs, a render stopped by macOS while it read the prompt.** After such a stop, the next render waits up to a minute and a half for memory to free up, and if it does not, tells you what to quit instead of failing again.
+- **Fixed: FLUX 3 "returned no complete image"** when the image had in fact finished. Phosphene now recovers it, and a real miss says how many images finished.
+- **H3 Flex (preview) greys out what it cannot do.** Keyframes, Extend, Lip-sync, Add sound, Fast HD and the 10 s single pass stay visible but greyed while H3 Flex is picked, with the reason, instead of quietly rendering on H3's own sampler.
+- **The dark look is black now**, the same as Phosphene 5.0. The neon accents stay; light mode is unchanged.
+
+Thanks to everyone whose error reports pointed at these.
+
+All of this is free for everyone, and it is also in Phosphene 5.0.
+
+In Pinokio, press Update, then restart Phosphene.
diff --git a/flux3_engine.py b/flux3_engine.py
index 6e660aa..48c8b7a 100644
--- a/flux3_engine.py
+++ b/flux3_engine.py
@@ -183,7 +183,7 @@ def _redact(line):
return re.sub(r"hf_[A-Za-z0-9]+", "[redacted]", line)
-def _run(cmd, env, on_log, request=None, timeout=7200, guard=()):
+def _run(cmd, env, on_log, request=None, timeout=7200, guard=(), tail_out=None):
"""Stream progress and share the studio's cancellation registry, including install."""
import image_engine
events = queue.Queue()
@@ -223,14 +223,23 @@ def _run(cmd, env, on_log, request=None, timeout=7200, guard=()):
continue
if line is None:
break
- if line.startswith("FLUX3_RESULT "):
- receipts.append(json.loads(line[len("FLUX3_RESULT "):]))
+ # Anywhere in the line, not only at its start: a progress bar
+ # left on the same line (stderr shares this pipe) must not hide a
+ # finished image's receipt (fleet #206).
+ mark = line.find("FLUX3_RESULT ")
+ if mark >= 0:
+ try:
+ receipts.append(json.loads(line[mark + len("FLUX3_RESULT "):]))
+ except ValueError:
+ tail = (tail + [_redact(line[:200])])[-15:]
else:
line = _redact(line)
tail = (tail + [line])[-15:]
if on_log:
on_log(line)
rc = proc.wait(timeout=10)
+ if tail_out is not None:
+ tail_out[:] = tail
if rc < 0:
raise image_engine.ImageJobCancelled("FLUX 3 stopped.")
if rc:
@@ -267,11 +276,44 @@ def generate(prompt, n, width, height, output_dir, base_seed, config, refs, on_l
request = dict(prompt=prompt, seeds=[first_seed + i for i in range(n)],
width=width, height=height, output_dir=str(output_dir), refs=refs,
variant=config.flux3_variant, quantize=config.mflux_quantize)
+ tail = []
result = _run([str(worker_python()), str(ROOT / "scripts/flux3_worker.py")], env, on_log, request,
timeout=1800 + 3600 * n,
# The worker guards its own downloads with RESERVE; here only
# the output volume matters, so a full disk still stops it.
- guard=[(output_dir, OUTPUT_HEADROOM)])
- if len(result) != n or any(not Path(r["png_path"]).is_file() for r in result):
- raise RuntimeError("FLUX 3 returned no complete image. Check the log and retry.")
- return result
+ guard=[(output_dir, OUTPUT_HEADROOM)], tail_out=tail)
+ return _complete_receipts(result, request, output_dir, tail)
+
+
+def _complete_receipts(result, request, output_dir, tail=()):
+ """The finished images, one per requested seed, or a precise error.
+
+ Fleet #206 (4.19.15, one M5 Max, 3 of 9): "FLUX 3 returned no complete
+ image" after full-length renders with the worker exiting cleanly. The
+ worker writes `<png>.flux3.json` (the same receipt) BEFORE it prints the
+ FLUX3_RESULT line, so a receipt the pipe lost is recovered from disk for
+ every requested seed whose verified image is there. Anything still missing
+ names how many images came back and the worker's last lines, so the next
+ report says why instead of "check the log"."""
+ seeds = list(request.get("seeds") or [])
+ got = {int(r.get("seed", -1)): r for r in result
+ if isinstance(r, dict) and Path(str(r.get("png_path") or "")).is_file()}
+ for seed in seeds:
+ if seed in got:
+ continue
+ for meta in sorted(Path(output_dir).glob(f"flux3_*_{seed}.flux3.json")):
+ try:
+ rec = json.loads(meta.read_text())
+ except (OSError, ValueError):
+ continue
+ if int(rec.get("seed", -1)) == seed and Path(str(rec.get("png_path") or "")).is_file():
+ got[seed] = rec
+ break
+ if seeds and all(s in got for s in seeds):
+ return [got[s] for s in seeds]
+ done = sum(1 for s in seeds if s in got)
+ last = "\n".join(str(x) for x in list(tail)[-6:])
+ raise RuntimeError(
+ f"FLUX 3 returned no complete image ({done} of {len(seeds)} finished; "
+ f"the worker exited without an error). Check the log and retry."
+ + (f" Last lines:\n{last}" if last else ""))
diff --git a/install_plan.py b/install_plan.py
index 4a2d79e..5460a45 100644
--- a/install_plan.py
+++ b/install_plan.py
@@ -93,14 +93,28 @@ def repo_missing(root: Path, repo: dict, min_b: int = 1024) -> list:
"""Declared files absent or under min_b bytes - the same rule pinokio.js's
repoComplete() and the panel's _repo_missing() apply."""
base = Path(root) / str(repo.get("local_dir") or "")
+ sizes = repo.get("file_sizes") or {}
+ sidecars = list(repo.get("sidecars") or [])
out = []
- for name in repo.get("files") or []:
+ for name in list(repo.get("files") or []) + sidecars:
+ if name in out:
+ continue
try:
st = (base / name).stat()
- if st.st_size < min_b:
- out.append(name)
except OSError:
out.append(name)
+ continue
+ want = sizes.get(name)
+ # Same rule as the panel's pack_file_ok (fleet #206): an exact size when
+ # the registry declares one, any bytes for a loader sidecar, else min_b.
+ if isinstance(want, (int, float)) and want > 0:
+ bad = st.st_size != int(want)
+ elif name in sidecars:
+ bad = st.st_size <= 0
+ else:
+ bad = st.st_size < min_b
+ if bad:
+ out.append(name)
return out
diff --git a/mlx_ltx_panel.py b/mlx_ltx_panel.py
index 7bb47e1..2b34d51 100644
--- a/mlx_ltx_panel.py
+++ b/mlx_ltx_panel.py
@@ -88,6 +88,7 @@ import model_licences
# user-facing sentence that names Pinokio picks its Mac-app variant through
# distribution.say(); unset (Pinokio) keeps every sentence as it was.
import distribution as _dist
+import agent_discovery
# Storyboard — the layer ABOVE the video modes: one concept in, a film's worth
# of shots out. `storyboard` is the spine (schema, validation, scheduling,
@@ -5891,14 +5892,47 @@ def _repo_missing(repo: dict) -> list[str]:
"""Files missing or zero-byte for one repo, expressed as bare filenames
(relative to the repo's local_dir). Bare names are friendlier in the UI
than full paths."""
- base = repo_dir(repo)
+ return pack_files_missing(repo_dir(repo), repo)
+
+
+def pack_file_ok(path: Path, fname: str, repo: dict) -> bool:
+ """THE per-file completeness rule, for every checker in this file.
+
+ A declared file counts as present when it exists and:
+ - its size EQUALS the registry's `file_sizes` entry, when one is declared
+ (the LTX-2.5 mirror packs: an immutable release manifest). A truncated
+ file, or another build's file left behind by a pack change, is missing;
+ - otherwise it holds at least `min_size_bytes` (the old rule).
+ A `sidecars` entry (the small loader configs, below min_size_bytes) counts
+ when it exists and is not empty.
+
+ Fleet #206 (30 Oct 2026): the size floor alone let a pack without its
+ upscaler config read complete, and the loader then built the upscaler at the
+ library default width and died on "Expected shape (512,...) but received
+ (1024,...) initial_conv.weight"."""
+ try:
+ st = path.stat()
+ except OSError:
+ return False
+ if not path.is_file():
+ return False
+ sizes = repo.get("file_sizes") or {}
+ want = sizes.get(fname)
+ if isinstance(want, (int, float)) and want > 0:
+ return st.st_size == int(want)
+ if fname in (repo.get("sidecars") or ()):
+ return st.st_size > 0
+ return st.st_size >= _MIN_FILE_BYTES
+
+
+def pack_files_missing(base: Path, repo: dict) -> list[str]:
+ """Declared files AND loader sidecars of `repo` that are not usable in
+ `base`, as bare names (pack_file_ok decides)."""
missing = []
- for fname in repo.get("files", []):
- p = base / fname
- try:
- if not p.exists() or p.stat().st_size < _MIN_FILE_BYTES:
- missing.append(fname)
- except OSError:
+ for fname in list(repo.get("files", [])) + list(repo.get("sidecars") or []):
+ if fname in missing:
+ continue
+ if not pack_file_ok(Path(base) / fname, fname, repo):
missing.append(fname)
return missing
@@ -5986,16 +6020,8 @@ def _repo_missing_in_cache(repo: dict) -> list[str] | None:
cache_dir = _repo_hf_cache_dir(repo["repo_id"])
if cache_dir is None:
return None
- missing = []
- for fname in repo.get("files", []):
- p = cache_dir / fname
- try:
- actual = p.resolve()
- if not actual.exists() or actual.stat().st_size < _MIN_FILE_BYTES:
- missing.append(fname)
- except OSError:
- missing.append(fname)
- return missing
+ # pack_file_ok follows the snapshot's ../blobs/<hash> symlinks itself.
+ return pack_files_missing(cache_dir, repo)
def base_missing() -> list[str]:
@@ -6166,15 +6192,7 @@ def pack_missing_files(quant: str, version_id: str | None = None) -> list[str]:
override = repo.copy()
override["local_dir"] = str(base.relative_to(ROOT))
return _repo_missing(override)
- missing = []
- for fname in repo.get("files", []):
- p = base / fname
- try:
- if not p.exists() or p.stat().st_size < _MIN_FILE_BYTES:
- missing.append(fname)
- except OSError:
- missing.append(fname)
- return missing
+ return pack_files_missing(base, repo)
def pack_available_anywhere(quant: str, version_id: str | None = None) -> bool:
@@ -6305,16 +6323,7 @@ def hq_addon_missing(version_id: str | None = None) -> list[str]:
repo = next((r for r in _repos() if r.get("key") == key), None)
if not repo:
return []
- base = pack_path("q8", version_id)
- missing = []
- for fname in repo.get("files", []):
- fpath = base / fname
- try:
- if not fpath.exists() or fpath.stat().st_size < _MIN_FILE_BYTES:
- missing.append(fname)
- except OSError:
- missing.append(fname)
- return missing
+ return pack_files_missing(pack_path("q8", version_id), repo)
def hq_surface_missing(version_id: str | None = None) -> list[str]:
@@ -6429,6 +6438,118 @@ def _canonical_layout() -> bool:
return any(mid == str(pack_path("q4", v["id"])) for v in MODEL_VERSIONS)
+#: How long a render waits for its own pack's download before it gives up and
+#: names the missing files (fleet #206). Generous: a 20 GB pack on a slow line.
+PACK_DOWNLOAD_WAIT_MAX_S = float(os.environ.get("LTX_PACK_DOWNLOAD_WAIT_S", str(4 * 3600)))
+PACK_DOWNLOAD_POLL_S = 2.0
+
+
+def _pack_fetcher_pid(folder) -> int | None:
+ """PID of a live scripts/fetch_pack_release.py writing `folder`, or None.
+
+ Read from the one-writer lock file (the fetcher writes its pid there) and
+ confirmed by the process's own command line, so a stale file or a recycled
+ pid never reads as a download. Never takes the lock itself: a probe that
+ held it for an instant could make a starting fetcher exit busy."""
+ try:
+ real = Path(os.path.realpath(str(folder)))
+ raw = (real.parent / f".{real.name}{PACK_LOCK_SUFFIX}").read_text(errors="replace")
+ pid = int(raw.strip().split()[0])
+ except (OSError, ValueError, IndexError):
+ return None
+ if pid <= 1 or pid == os.getpid():
+ return None
+ try:
+ os.kill(pid, 0)
+ except OSError:
+ return None
+ try:
+ cmd = subprocess.run(["ps", "-o", "command=", "-p", str(pid)],
+ capture_output=True, text=True, errors="replace",
+ timeout=5).stdout
+ except (OSError, subprocess.SubprocessError):
+ return None
+ return pid if "fetch_pack_release" in cmd else None
+
+
+def pack_download_activity(quant: str, version_id: str | None = None) -> dict | None:
+ """Is this pack being downloaded right now, and how far along?
+
+ None when nothing is writing it. Otherwise {by, pct, done_gb, total_gb}:
+ `by` is "panel" (the Models window or the post-install background fetcher,
+ both through the one DOWNLOAD slot), "app" (the Mac app's own download) or
+ "fetcher" (any other process running the release fetcher on this folder).
+ Bytes count finished files and the fetcher's half-assembled `.partial`."""
+ repo = pack_repo(quant, version_id)
+ if not repo:
+ return None
+ by = None
+ with DOWNLOAD_LOCK:
+ if DOWNLOAD.get("active") and DOWNLOAD.get("key") == repo.get("key"):
+ by = "panel"
+ if by is None:
+ try:
+ if app_models_owns(repo):
+ by = "app"
+ except Exception: # noqa: BLE001
+ pass
+ if by is None and _pack_fetcher_pid(pack_path(quant, version_id)) is not None:
+ by = "fetcher"
+ if by is None:
+ return None
+ plan = dict(repo)
+ plan["local_dir"] = str(pack_path(quant, version_id))
+ total = install_plan.expected_bytes(repo)
+ try:
+ left = install_plan.remaining_bytes(Path("/"), plan, _MIN_FILE_BYTES)
+ except Exception: # noqa: BLE001
+ left = total
+ done = max(0, total - left)
+ pct = int(min(99, max(0, round(100.0 * done / total)))) if total else 0
+ return {"by": by, "pct": pct, "done_gb": round(done / 1e9, 1),
+ "total_gb": round(total / 1e9, 1)}
+
+
+def _pack_wait_for_download(quant: str, feature: str, version_id: str | None = None,
+ job: dict | None = None) -> bool:
+ """Hold a render while its own pack is still downloading (fleet #206).
+
+ A fresh install that was rendered before its LTX download finished failed
+ every job with "model is incomplete" (4 failures in a minute on one Mac).
+ Now the job waits in the Now card - "Waiting for the LTX-2.5 base download
+ to finish (63%)" - and starts on its own when the files land. Stop ends
+ the wait. Returns True when it waited (the caller re-checks the pack),
+ False when no download is running (the caller refuses as before)."""
+ act = pack_download_activity(quant, version_id)
+ if act is None:
+ return False
+ if job is None:
+ job = getattr(_JOB_CTX, "job", None)
+ ver = model_version(version_id)
+ t0 = time.time()
+ push(f"[models] {feature} waits for the {ver['label']} {quant.upper()} download "
+ f"({act['pct']}%) - it starts by itself when the files are in.")
+ try:
+ while act is not None:
+ if not pack_missing_files(quant, version_id):
+ break
+ if job is not None and job.get("cancel_requested"):
+ raise JobCancelled("Stopped while the model was downloading.")
+ if time.time() - t0 > PACK_DOWNLOAD_WAIT_MAX_S:
+ break
+ if job is not None:
+ job["waiting_note"] = (
+ f"Waiting for the {ver['label']} model download to finish "
+ f"({act['pct']}%, {act['done_gb']} of {act['total_gb']} GB). "
+ f"This render starts by itself when it is done.")
+ time.sleep(PACK_DOWNLOAD_POLL_S)
+ act = pack_download_activity(quant, version_id)
+ finally:
+ if job is not None:
+ job.pop("waiting_note", None)
+ return True
+
+
def ltx_pack_preflight(quant: str, feature: str,
version_id: str | None = None) -> None:
"""Refuse a render whose weights are incomplete, and NAME the file.
@@ -6456,6 +6577,13 @@ def ltx_pack_preflight(quant: str, feature: str,
missing = pack_missing_files(quant, version_id)
if not missing:
return
+ # Still downloading? Wait for it instead of failing the render (#206).
+ if _pack_wait_for_download(quant, feature, version_id):
+ if pack_available_anywhere(quant, version_id):
+ return
+ missing = pack_missing_files(quant, version_id)
+ if not missing:
+ return
ver = model_version(version_id)
shown = ", ".join(missing[:3]) + (" …" if len(missing) > 3 else "")
raise RuntimeError(
@@ -9348,6 +9476,15 @@ H3_FLEX_RUNNER_FLAG = "--pika-flex"
# A forward with the runtime rank-128 adapter costs about what v1.3's does.
H3_FLEX_FORWARD_COST = 1.03
H3_FLEX_MODES = ("t2v", "i2v")
+
+
+def h3_cell_takes_flex(cell: dict) -> bool:
+ """Every chained/single 5 s-window cell. The dense single pass and Fast HD
+ keep their own recipes (never rendered on Flex). Defined here, before
+ _build_h3_tiers, because every cell carries the answer as `takes_flex`."""
+ return not bool(cell.get("dense")) and not bool(cell.get("fast_hd"))
+
+
H3_FLEX_DOWNLOAD_GB = 2.8
# Free disk the build needs: the 2.8 GB source plus the 2.0 GB result while
# both exist, plus a margin so a render's swap never meets a full disk.
@@ -10701,6 +10838,101 @@ def metal_watchdog_way(mode: str | None, phase: str | None = None) -> str:
return "Try a shorter extension or section, or a shorter source clip"
+# ---- small-Mac memory hold after a prompt-encoding watchdog kill (#206) -----
+# Fleet 28-30 Oct 2026: every Metal-watchdog kill on a 16 GB Mac (31 of 31
+# whose phase is known: one M3, one M2 Pro, one M6) was in PROMPT ENCODING,
+# already in short GPU steps - and most 16 GB Macs render fine (an M4 16 GB:
+# 626 done, 26 failed in 14 days). It is the state of that Mac, not the size:
+# the text encoder needs the memory other apps are holding. The per-setting
+# memory above pauses only the size that died, so the M3 tried four other
+# sizes and was killed in encoding each time, minutes apart. Now, on a Mac
+# with LOW_RAM_STREAM_RAM_GB or less, an encode-phase kill marks the WHOLE Mac
+# for ENCODE_HOLD_WINDOW_S: the next LTX render first checks memory and, while
+# macOS reports pressure above normal or less than ENCODE_HOLD_NEED_GB
+# available, waits (the Now card says what to close) and then refuses plainly
+# instead of starting a render that would be killed the same way.
+ENCODE_HOLD_WINDOW_S = 30 * 60
+ENCODE_HOLD_NEED_GB = float(os.environ.get("LTX_ENCODE_HOLD_NEED_GB") or 8.0)
+ENCODE_HOLD_WAIT_S = float(os.environ.get("LTX_ENCODE_HOLD_WAIT_S") or 90.0)
+_ENCODE_HOLD_KEY = "__mac_encode_kill__"
+
+
+def small_mac_for_encode_hold() -> bool:
+ try:
+ return 0 < float(SYSTEM_RAM_GB or 0) <= LOW_RAM_STREAM_RAM_GB
+ except (TypeError, ValueError):
+ return False
+
+
+def metal_watchdog_mark_mac_encode_kill(now: float | None = None) -> None:
+ """Remember that macOS stopped prompt encoding on this (small) Mac."""
+ with _METAL_WATCHDOG_LOCK:
+ data = _metal_watchdog_load()
+ data["settings"][_ENCODE_HOLD_KEY] = {
+ "last_ts": int(now if now is not None else time.time())}
+ _metal_watchdog_save(data)
+
+
+def metal_watchdog_recent_mac_encode_kill(now: float | None = None) -> bool:
+ with _METAL_WATCHDOG_LOCK:
+ ent = _metal_watchdog_load()["settings"].get(_ENCODE_HOLD_KEY) or {}
+ last = int(ent.get("last_ts") or 0)
+ return bool(last) and (now if now is not None else time.time()) - last <= ENCODE_HOLD_WINDOW_S
+
+
+def memory_snapshot() -> dict:
+ """{level, avail_gb}: macOS's pressure level (1 normal, 2 warning,
+ 4 critical) and the kernel's available memory. Cheap; never raises."""
+ try:
+ level = int(hostinfo.pressure_level())
+ except Exception: # noqa: BLE001
+ level = 1
+ try:
+ avail = hostinfo.available_bytes() / 1024**3
+ except Exception: # noqa: BLE001
+ avail = 0.0
+ return {"level": level, "avail_gb": round(avail, 1)}
+
+
+def _encode_hold_ok(snap: dict) -> bool:
+ return int(snap.get("level") or 1) <= 1 and (
+ not snap.get("avail_gb") or float(snap["avail_gb"]) >= ENCODE_HOLD_NEED_GB)
+
+
+def ltx_encode_memory_hold(job: dict | None) -> None:
+ """Before an LTX render on a small Mac whose prompt encoding macOS stopped
+ in the last ENCODE_HOLD_WINDOW_S: wait for memory, else refuse plainly."""
+ if not small_mac_for_encode_hold() or not metal_watchdog_recent_mac_encode_kill():
+ return
+ if HELPER.is_alive():
+ return # a warm engine already holds its encoder; nothing to load
+ snap = memory_snapshot()
+ t0 = time.time()
+ try:
+ while not _encode_hold_ok(snap):
+ if job is not None and job.get("cancel_requested"):
+ raise JobCancelled("Stopped while waiting for memory.")
+ if time.time() - t0 > ENCODE_HOLD_WAIT_S:
+ raise RenderRefused(
+ "memory_low",
+ f"Not enough free memory to read the prompt: this "
+ f"{SYSTEM_RAM_GB:.0f} GB Mac has {snap['avail_gb']:.1f} GB "
+ f"available and the last render was stopped by macOS while "
+ f"reading the prompt. Quit other apps (browsers with many "
+ f"tabs, games, other AI apps), then press Retry.")
+ if job is not None:
+ job["waiting_note"] = (
+ f"Waiting for memory - {snap['avail_gb']:.1f} GB available, "
+ f"about {ENCODE_HOLD_NEED_GB:.0f} GB needed to read the prompt "
+ f"on this {SYSTEM_RAM_GB:.0f} GB Mac. Quit other apps and it "
+ f"starts by itself.")
+ time.sleep(2.0)
+ snap = memory_snapshot()
+ finally:
+ if job is not None:
+ job.pop("waiting_note", None)
+
+
def metal_watchdog_refusal(key: str, now: float | None = None,
mode: str | None = None) -> str | None:
"""The refusal for a setting the watchdog killed even on short steps, for
@@ -11257,9 +11489,13 @@ def _build_h3_tiers() -> dict[str, dict]:
"v13_measured": v_meas, "v13_steps": H3_V13_STEPS,
"v13_forwards": windows * H3_V13_FORWARDS}
# Pika H3 Flex prices every cell it renders on (h3_cell_takes_flex):
- # 6 forwards at about v1.3's per-forward cost.
- flex = {}
- if not ln["dense"] and not q.get("fast_hd"):
+ # 6 forwards at about v1.3's per-forward cost. `takes_flex` is the
+ # same rule handed to the browser, which greys every cell Flex
+ # cannot render while Flex is the pick (never a JS copy of it).
+ takes_flex = h3_cell_takes_flex({"dense": ln["dense"],
+ "fast_hd": q.get("fast_hd")})
+ flex = {"takes_flex": takes_flex}
+ if takes_flex:
f_min = h3_estimate_minutes(
w, h, window_frames, windows, H3_FLEX_FORWARDS) * H3_FLEX_FORWARD_COST
f_eta, f_meas = _fmt_eta(f_min), False
@@ -11267,9 +11503,9 @@ def _build_h3_tiers() -> dict[str, dict]:
if hit:
f_min, f_meas = hit[0] * hw, True
f_eta = hit[1] if hw == 1.0 else _fmt_eta(f_min)
- flex = {"flex_min": round(f_min, 2), "flex_eta": f_eta,
- "flex_measured": f_meas, "flex_steps": H3_FLEX_STEPS,
- "flex_forwards": windows * H3_FLEX_FORWARDS}
+ flex.update({"flex_min": round(f_min, 2), "flex_eta": f_eta,
+ "flex_measured": f_meas, "flex_steps": H3_FLEX_STEPS,
+ "flex_forwards": windows * H3_FLEX_FORWARDS})
spec = f"{w}×{h} · {frames}f"
if windows > 1:
spec += f" · {windows}×5s"
@@ -14942,12 +15178,6 @@ def h3_supports_flex() -> bool:
and _h3_runner_has_flag("--lora-qkv-permute"))
-def h3_cell_takes_flex(cell: dict) -> bool:
- """Every chained/single 5 s-window cell. The dense single pass and Fast HD
- keep their own recipes (never rendered on Flex)."""
- return not bool(cell.get("dense")) and not bool(cell.get("fast_hd"))
-
-
def _h3_flex_dir() -> Path:
"""Beside the other weight components, like Turbo's folder."""
for root in _h3_model_roots():
@@ -19895,6 +20125,15 @@ _ANALYTICS_REFUSAL_REASONS = (
# before it is downloaded or first run - a one-time prompt, not a fault
# (4.19.8). Every message model_licences.refusal() builds carries it.
("licence_required", ("accept the licence once",)),
+ # A render on an LTX pack that is not completely on disk (ltx_pack_preflight):
+ # the install or a download is unfinished, and the message names the files
+ # and offers Repair. Counted as a failure until 4.19.16 (fleet #206: a fresh
+ # install that rendered before its download finished made 4 "failures").
+ # A pack that is still DOWNLOADING no longer refuses at all: the job waits.
+ ("pack_incomplete", ("model is incomplete. missing",)),
+ # #206: a small Mac whose prompt encoding macOS stopped minutes ago, still
+ # short of memory after a wait (ltx_encode_memory_hold).
+ ("memory_low", ("not enough free memory to read the prompt",)),
)
_ANALYTICS_REFUSAL_SLUGS = tuple(s for s, _ in _ANALYTICS_REFUSAL_REASONS)
@@ -20181,7 +20420,11 @@ def _analytics_render_event(job: dict) -> None:
if status not in ("done", "failed"):
return
p = (job or {}).get("params") or {}
- engine = str(p.get("engine") or "ltx").strip().lower()
+ # An image job that failed before its engine was known has no
+ # params["engine"]; defaulting it to "ltx" filed every failed image
+ # render (FLUX 3 included) under LTX and hid it from the image fail
+ # rate (fleet, 30 Oct 2026). Name it "image" instead.
+ engine = str(p.get("engine") or ("image" if p.get("mode") == "image" else "ltx")).strip().lower()
try:
width, height = int(p.get("width") or 0), int(p.get("height") or 0)
except (TypeError, ValueError):
@@ -20252,6 +20495,20 @@ def _analytics_render_event(job: dict) -> None:
props["gpu_abort_retry"] = True
if isinstance(job.get("helper_warm"), bool):
props["helper_warm"] = job["helper_warm"]
+ # #206: macOS memory pressure level (1/2/4) and available memory, in
+ # whole-GB buckets, when an LTX render started - the fact the 16 GB
+ # watchdog kills never carried.
+ _mem = job.get("mem_at_start")
+ if isinstance(_mem, dict):
+ if int(_mem.get("level") or 0) in (1, 2, 4):
+ props["mem_pressure"] = int(_mem["level"])
+ try:
+ _av = float(_mem.get("avail_gb") or 0)
+ if _av > 0:
+ props["mem_avail_gb"] = next(
+ b for b in (64, 32, 24, 16, 12, 8, 6, 4, 2, 0) if _av >= b)
+ except (TypeError, ValueError):
+ pass
# 4.19.2: a helper that died from a signal - what its last native
# line was (closed class) and how far it got. Failures only.
if status != "done":
@@ -23219,6 +23476,8 @@ class WarmHelper:
# fact the fleet has never had about this failure.
if job is not None and self._last_phase in WATCHDOG_PHASES:
job["watchdog_phase"] = self._last_phase
+ if self._last_phase == "encode" and small_mac_for_encode_hold():
+ metal_watchdog_mark_mac_encode_kill()
with LOCK:
cancelled = bool(job is not None
and job.get("cancel_requested"))
@@ -34722,6 +34981,9 @@ def run_image_job_inner(job: dict) -> None:
cfg = _build_image_engine_config(engine_override, form=p)
except ValueError as e:
raise RuntimeError(str(e))
+ # Record the engine now, not only when the job succeeds: a job that fails
+ # from here on must report the engine it ran on (render_failed.engine).
+ p["engine"] = cfg.kind + (f"/{cfg.mflux_family}" if cfg.kind == "mflux" else "")
if cfg.kind == "flux3":
width, height = agent_image_engine.ASPECT_DIMS.get(aspect, (1280, 720))
@@ -39230,6 +39492,10 @@ def run_job_inner(job: dict) -> None:
"the panel, click it once more: an update started by an old "
"version updates itself first.")
_apply_generation_profile_to_job(job)
+ # #206: memory at the start of every LTX render (closed values, for the
+ # fleet), and the small-Mac hold after a prompt-encoding watchdog kill.
+ job["mem_at_start"] = memory_snapshot()
+ ltx_encode_memory_hold(job)
for note in p.get("generation_clamp_notes") or []:
push(f"[generation] {p.get('generation_profile_label')}: {note}")
quality = p.get("quality", "standard")
@@ -43102,6 +43368,7 @@ def _unique_output_path(base: Path, stem: str, ext: str = ".mp4") -> Path:
# module would execute the whole file a second time, port bind and all).
# Handlers resolve P.<name> at request time, so wiring here — after most
# definitions, before the server starts — is safe for every name they use.
+from panel import routes_agents as _routes_agents
from panel import routes_characters as _routes_characters
from panel import routes_files as _routes_files
from panel import routes_image as _routes_image
@@ -43116,7 +43383,7 @@ from panel import routes_storyboard as _routes_storyboard
from panel import routes_stats as _routes_stats
from panel import routes_train as _routes_train
-for _routes_mod in (_routes_characters, _routes_files, _routes_image,
+for _routes_mod in (_routes_agents, _routes_characters, _routes_files, _routes_image,
_routes_licences, _routes_loras, _routes_meta, _routes_models, _routes_music,
_routes_oneshot, _routes_queue, _routes_stats, _routes_storyboard,
_routes_train, _civitai_client):
@@ -46940,6 +47207,12 @@ if __name__ == "__main__":
print("─" * 64, flush=True)
sys.exit(1)
raise
+ # Agent tools (agents/phosphene_cli.py, agents/phosphene_mcp.py) find this studio by the
+ # record it writes once its listener is bound: the port differs per wrapper (8198 Pinokio,
+ # 8199 dev, 8930-8999 Mac app), the HOME folder does not. Removed again on the way out.
+ agent_discovery.announce(PORT, {"version": running_version(), "distribution": _dist.distribution(),
+ "profile": PROFILE, "root": str(ROOT), "outputs_dir": str(OUTPUT),
+ "agents_dir": str(ROOT / "agents")})
print(f"LTX MLX Studio: http://127.0.0.1:{PORT}", flush=True)
print(f"queue: {len(STATE['queue'])} pending, hidden: {len(HIDDEN_PATHS)}", flush=True)
# Boot-time weight integrity scan. A truncated/corrupt safetensors decodes
@@ -46998,5 +47271,6 @@ if __name__ == "__main__":
try:
server.serve_forever()
finally:
+ agent_discovery.withdraw(PORT)
HELPER.kill()
caffeinate_off()
diff --git a/panel/routes_agents.py b/panel/routes_agents.py
new file mode 100644
index 0000000..c90e9a1
--- /dev/null
+++ b/panel/routes_agents.py
@@ -0,0 +1,88 @@
+"""/agents family routes - what an agent tool needs to drive this studio.
+
+GET /agents/info who answers on this port (always "app": "phosphene"), the version, where it runs
+ (pinokio / mac-app), Free or Pro, which engines are installed and their choices,
+ and the exact command lines that connect the CLI and the MCP server to it.
+
+It adds no way to make anything: agents/phosphene_cli.py and agents/phosphene_mcp.py render through
+the same /queue/add, /speech/generate and /status the page uses, so every check the studio applies
+to the page (licences, this Mac's limits, Free and Pro) applies to an agent unchanged.
+Cheap on purpose (no disk walk), because clients call it to find a studio.
+"""
+from __future__ import annotations
+
+import os
+import shlex
+import sys
+
+from panel.routes import get
+
+P = None # the running mlx_ltx_panel module; assigned at wiring time
+
+
+def _safe(fn, default=None):
+ try:
+ return fn()
+ except Exception: # noqa: BLE001 - one broken probe must not hide the studio from its tools
+ return default
+
+
+def _pro() -> dict:
+ # 5.0 studios answer pro_status(); a 4.19 studio has only the _pro_active() verdict, and the
+ # public Free tree has neither (always Free).
+ status = getattr(P, "pro_status", None)
+ if callable(status):
+ return _safe(status, {"active": False})
+ active = getattr(P, "_pro_active", None)
+ return {"active": bool(_safe(active, False)) if callable(active) else False}
+
+
+def _speech_available() -> bool:
+ status = getattr(P, "speech_status", None)
+ return bool(callable(status) and _safe(lambda: status()["available"], False))
+
+
+def agents_payload() -> dict:
+ agents_dir = P.ROOT / "agents"
+ py = sys.executable
+ mcp = str(agents_dir / "phosphene_mcp.py")
+ cli = str(agents_dir / "phosphene_cli.py")
+ h3_on = bool(_safe(P.h3_available, False))
+ return {
+ "app": "phosphene",
+ "api": 1,
+ "url": f"http://127.0.0.1:{P.PORT}",
+ "port": P.PORT,
+ "pid": os.getpid(),
+ "version": _safe(P.running_version),
+ "build": _safe(P.boot_build_stamp, {}),
+ "distribution": P._dist.distribution(),
+ "edition": _safe(P._dist.edition),
+ "profile": P.PROFILE,
+ "pro": _pro(),
+ "engines": {
+ "ltx": {"available": not _safe(lambda: P.capability_missing("render"), ["?"]),
+ "default": True,
+ "qualities": [q for q in ("quick", "balanced", "standard", "high", "high_720p")
+ if q in P.LTX_QUALITIES]},
+ "h3": {"available": h3_on,
+ "qualities": [k for k, q in P.H3_QUALITIES.items() if q.get("offered", True)],
+ "lengths": [k for k, l in P.H3_LENGTHS.items() if l.get("offered", True)]},
+ "speech": {"available": _speech_available()},
+ "music": {"available": bool(_safe(lambda: not P.music_paths()["missing"], False))},
+ "image": {"available": True, "note": "the engine chosen in Settings; it downloads on first use"},
+ },
+ "outputs_dir": str(P.OUTPUT),
+ "agents": {
+ "cli": cli, "mcp": mcp, "python": py,
+ "mcp_config": {"mcpServers": {"phosphene": {"command": py, "args": [mcp]}}},
+ "claude_code": f"claude mcp add phosphene -- {shlex.quote(py)} {shlex.quote(mcp)}",
+ "codex": f"codex mcp add phosphene -- {shlex.quote(py)} {shlex.quote(mcp)}",
+ "docs": "docs/AGENT_TOOLS.md",
+ },
+ }
+
+
+@get("/agents/info")
+def get_agents_info(h, parsed) -> None:
+ h._json(agents_payload())
diff --git a/panel_assets/stats.html b/panel_assets/stats.html
index 52544c2..45c77fc 100644
--- a/panel_assets/stats.html
+++ b/panel_assets/stats.html
@@ -43,17 +43,17 @@
the dashboard reads as the same product, not a sibling site.
============================================================ */
:root {
- --bg: #00061a;
- --bg-2: #0a1130;
- --panel: #131b3f;
- --panel-2: #1d2752;
- --panel-3: rgba(12, 19, 48, 0.35);
- --border: #2c3563;
+ --bg: #0a0a0b;
+ --bg-2: #0e0e10;
+ --panel: #121214;
+ --panel-2: #1f1f23;
+ --panel-3: rgba(16, 16, 17, 0.35);
+ --border: #2a2a2f;
--border-soft: rgba(140, 160, 220, 0.08);
- --border-strong: #3d477a;
- --text: #f0f4fb;
- --muted: #b6bfd1;
- --faint: #5b6478;
+ --border-strong: #3a3a40;
+ --text: #f4f4f5;
+ --muted: #b4b4bb;
+ --faint: #6b6b73;
--accent: #2f81f7;
--accent-bright: #58a6ff;
--accent-dim: rgba(47, 129, 247, 0.18);
@@ -91,9 +91,9 @@
background: var(--bg);
background-image:
radial-gradient(ellipse 1200px 600px at 50% -10%,
- rgba(47, 129, 247, 0.08), transparent 60%),
+ rgba(255, 255, 255, 0.040), transparent 60%),
radial-gradient(ellipse 900px 500px at 85% 10%,
- rgba(177, 74, 255, 0.04), transparent 65%);
+ rgba(255, 255, 255, 0.040), transparent 65%);
background-attachment: fixed;
color: var(--text);
font: 13px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text",
@@ -193,11 +193,11 @@
margin-top: 14px;
height: 1px;
background: linear-gradient(90deg,
- rgba(255, 46, 159, 0.0),
+ rgba(255, 255, 255, 0.000),
rgba(255, 46, 159, 0.45) 12%,
rgba(177, 74, 255, 0.55) 50%,
rgba(94, 234, 255, 0.45) 88%,
- rgba(94, 234, 255, 0.0));
+ rgba(255, 255, 255, 0.000));
}
/* ============================================================
@@ -417,13 +417,13 @@
width: var(--fill, 100%);
background: linear-gradient(90deg,
rgba(47, 129, 247, 0.14),
- rgba(47, 129, 247, 0.02) 90%);
+ rgba(255, 255, 255, 0.020) 90%);
z-index: 0;
}
.funnel-step.is-hero::before {
background: linear-gradient(90deg,
rgba(177, 74, 255, 0.16),
- rgba(94, 234, 255, 0.04) 90%);
+ rgba(255, 255, 255, 0.040) 90%);
}
.funnel-step > * { position: relative; z-index: 1; }
.funnel-stage {
@@ -1578,13 +1578,13 @@
green: '#3fb950',
amber: '#d29922',
red: '#f85149',
- text: '#f0f4fb',
- muted: '#b6bfd1',
- faint: '#5b6478',
- border: '#2c3563',
+ text: '#f4f4f5',
+ muted: '#b4b4bb',
+ faint: '#6b6b73',
+ border: '#2a2a2f',
grid: 'rgba(140, 160, 220, 0.06)',
gridStrong:'rgba(140, 160, 220, 0.12)',
- tooltipBg: 'rgba(10, 17, 48, 0.96)',
+ tooltipBg: 'rgba(14, 14, 15, 0.96)',
};
let allRows = [];
@@ -2094,7 +2094,7 @@
stroke = grad;
const fgrad = ctx.createLinearGradient(0, 0, 0, 38);
fgrad.addColorStop(0, 'rgba(177,74,255,0.30)');
- fgrad.addColorStop(1, 'rgba(177,74,255,0.00)');
+ fgrad.addColorStop(1, 'rgba(255, 255, 255, 0.000)');
fill = fgrad;
}
sparkCharts[canvasId] = new Chart(ctx, {
diff --git a/pinokio.js b/pinokio.js
index e74a91b..b0850cb 100644
--- a/pinokio.js
+++ b/pinokio.js
@@ -134,13 +134,25 @@ function readEnvironment(installRoot) {
}
function repoComplete(installRoot, repo, minBytes) {
- // A repo is "complete" iff every listed file exists at >= minBytes under
- // its local_dir. Mirrors the Python-side _repo_missing in mlx_ltx_panel.py.
- for (const fname of (repo.files || [])) {
+ // A repo is "complete" iff every listed file exists under its local_dir at
+ // its declared exact size (file_sizes) or else >= minBytes, and every loader
+ // sidecar (small upscaler configs) exists and is not empty. Mirrors the
+ // Python-side pack_file_ok in mlx_ltx_panel.py (fleet #206).
+ const sizes = repo.file_sizes || {}
+ const sidecars = repo.sidecars || []
+ for (const fname of (repo.files || []).concat(sidecars)) {
try {
const abs = path.join(installRoot, repo.local_dir, fname)
const st = fs.statSync(abs)
- if (!st.isFile() || st.size < minBytes) return false
+ if (!st.isFile()) return false
+ const want = sizes[fname]
+ if (typeof want === "number" && want > 0) {
+ if (st.size !== want) return false
+ } else if (sidecars.includes(fname)) {
+ if (st.size <= 0) return false
+ } else if (st.size < minBytes) {
+ return false
+ }
} catch (e) {
return false
}
diff --git a/required_files.json b/required_files.json
index 8e7016f..47491da 100644
--- a/required_files.json
+++ b/required_files.json
@@ -139,7 +139,11 @@
"audio_vae.safetensors",
"vocoder.safetensors",
"spatial_upscaler_x2_v1_1.safetensors"
- ]
+ ],
+ "sidecars": [
+ "spatial_upscaler_x2_v1_1_config.json"
+ ],
+ "_sidecars_comment": "Loader sidecars (2026-10-30, fleet #206): the latent upscalers are built from <stem>_config.json BEFORE their weights load, and a missing config builds the module with the library default (mid_channels 512) while the x2 weights are 1024 wide - the render dies with 'Expected shape (512,3,3,3,128) but received (1024,...) initial_conv.weight'. These small JSONs were fetched by the *.json include / the release manifest but never CHECKED, so a pack missing one read complete. Every completeness check now requires each sidecar present and non-empty (JSON files are below min_size_bytes, so they are checked here and not in files)."
},
{
"key": "gemma",
@@ -185,7 +189,11 @@
"audio_vae.safetensors",
"vocoder.safetensors",
"spatial_upscaler_x2_v1_1.safetensors"
- ]
+ ],
+ "sidecars": [
+ "spatial_upscaler_x2_v1_1_config.json"
+ ],
+ "_sidecars_comment": "Loader sidecars (2026-10-30, fleet #206): the latent upscalers are built from <stem>_config.json BEFORE their weights load, and a missing config builds the module with the library default (mid_channels 512) while the x2 weights are 1024 wide - the render dies with 'Expected shape (512,3,3,3,128) but received (1024,...) initial_conv.weight'. These small JSONs were fetched by the *.json include / the release manifest but never CHECKED, so a pack missing one read complete. Every completeness check now requires each sidecar present and non-empty (JSON files are below min_size_bytes, so they are checked here and not in files)."
},
{
"key": "ic_colorize",
@@ -310,7 +318,25 @@
"spatial_upscaler_x2_v1_1.safetensors",
"temporal_upscaler_x2_v1_0.safetensors",
"duration_head.safetensors"
- ]
+ ],
+ "sidecars": [
+ "spatial_upscaler_x2_v1_1_config.json",
+ "temporal_upscaler_x2_v1_0_config.json"
+ ],
+ "_sidecars_comment": "Loader sidecars (2026-10-30, fleet #206): the latent upscalers are built from <stem>_config.json BEFORE their weights load, and a missing config builds the module with the library default (mid_channels 512) while the x2 weights are 1024 wide - the render dies with 'Expected shape (512,3,3,3,128) but received (1024,...) initial_conv.weight'. These small JSONs were fetched by the *.json include / the release manifest but never CHECKED, so a pack missing one read complete. Every completeness check now requires each sidecar present and non-empty (JSON files are below min_size_bytes, so they are checked here and not in files).",
+ "file_sizes": {
+ "transformer-distilled.safetensors": 11320074467,
+ "connector.safetensors": 6344495432,
+ "vae_decoder.safetensors": 814349496,
+ "vae_encoder.safetensors": 637885234,
+ "audio_vae.safetensors": 106509004,
+ "vocoder.safetensors": 258313296,
+ "spatial_upscaler_x2_v1_1.safetensors": 995745088,
+ "temporal_upscaler_x2_v1_0.safetensors": 261945600,
+ "duration_head.safetensors": 3808330,
+ "phosphene_quant_manifest.json": 3628
+ },
+ "_file_sizes_comment": "Exact byte counts from this pack's release manifest (weights-ltx25-v1, immutable). A declared file whose size differs is reported missing, so a truncated or mixed-generation file (a pack change that left another build's file behind) reads incomplete and Repair refetches it, instead of loading and failing on a tensor shape."
},
{
"_comment": "LTX-2.5 Q8 - the HQ tier, same relationship to q4_25 that the 2.3 q8 pack has to the 2.3 q4 pack. Built 2026-08-12 by scripts/quantize_ltx.py --bits 8 from the same MLX-layout bf16 transformer the q4 pack came from; 20,595,260,317 B against the 2.3 q8 pack's 20,597,189,549 B, and every byte of the -1,929,232 B difference is 2.5's 96 absent FFN biases (-1,966,080), its one extra keyframe embedding (+8,192) and header growth (+28,656). The eight non-transformer components are sha256-identical to the q4 pack's copies - verified file by file - because quantisation touches only transformer.transformer_blocks.*, exactly as in 2.3. Same GitHub-release mirror lane as q4_25, so verify_source is 'manifest' and phosphene_quant_manifest.json is a required file. 2026-08-12 THIRD PASS, THE SPLIT: transformer-dev.safetensors and ltx-2.5-22b-distilled-lora-450.safetensors were briefly listed HERE (e870061) and now live in the hq_25 add-on entry below. They are not part of this pack - they are a separate, later build (the dev transformer is 42 GB upstream and was still downloading), and listing them here made a pack that is COMPLETE ON DISK both unpublishable and un-installable. The gate e870061 bought by listing them is NOT lost: the panel asks hq_surface_missing(), which unions this pack with the add-on, so High / Extend / Keyframe / A2V still refuse by name. Only the owning download unit changed.",
@@ -350,7 +376,25 @@
"release_repo": "mrbizarro/Phosphene",
"tag": "weights-ltx25-v1",
"manifest_asset": "q8_25__phosphene_release_manifest.json"
- }
+ },
+ "sidecars": [
+ "spatial_upscaler_x2_v1_1_config.json",
+ "temporal_upscaler_x2_v1_0_config.json"
+ ],
+ "_sidecars_comment": "Loader sidecars (2026-10-30, fleet #206): the latent upscalers are built from <stem>_config.json BEFORE their weights load, and a missing config builds the module with the library default (mid_channels 512) while the x2 weights are 1024 wide - the render dies with 'Expected shape (512,3,3,3,128) but received (1024,...) initial_conv.weight'. These small JSONs were fetched by the *.json include / the release manifest but never CHECKED, so a pack missing one read complete. Every completeness check now requires each sidecar present and non-empty (JSON files are below min_size_bytes, so they are checked here and not in files).",
+ "file_sizes": {
+ "transformer-distilled.safetensors": 20595260317,
+ "connector.safetensors": 6344495432,
+ "vae_decoder.safetensors": 814349496,
+ "vae_encoder.safetensors": 637885234,
+ "audio_vae.safetensors": 106509004,
+ "vocoder.safetensors": 258313296,
+ "spatial_upscaler_x2_v1_1.safetensors": 995745088,
+ "temporal_upscaler_x2_v1_0.safetensors": 261945600,
+ "duration_head.safetensors": 3808330,
+ "phosphene_quant_manifest.json": 4550
+ },
+ "_file_sizes_comment": "Exact byte counts from this pack's release manifest (weights-ltx25-v1, immutable). A declared file whose size differs is reported missing, so a truncated or mixed-generation file (a pack change that left another build's file behind) reads incomplete and Repair refetches it, instead of loading and failing on a tensor shape."
},
{
"_comment": "LTX-2.5 HQ add-on - the two-stage HQ FEATURE surface, not a model pack. High, Extend, Keyframe and A2V reach past model_dir and load these two files BY NAME; the panel names them per generation via MODEL_VERSIONS[...]['hq_weights'], because the number in the LoRA filename is its alpha/rank (2.3 ships 384, 2.5 ships 450) and the names are NOT interchangeable between generations. WHY A SEPARATE ENTRY AND NOT PART OF q8_25: it is a separate build that finishes later, and a download unit has to be publishable the moment its bytes exist. Folding these into q8_25 held a complete 20.6 GB pack hostage to a 42 GB download. WHY local_dir IS THE q8 DIRECTORY: these files are loaded out of the q8 pack BY NAME, so they must land beside it. Two entries, one directory, deliberately - the entry is a download unit, not a directory. MIRROR BLOCK LANDED 2026-08-12, in the same commit as the assets - the rule this entry was written to demonstrate. The dev transformer (20,595,256,595 B, ltx-dit q8) and the LoRA (8,899,889,568 B, verbatim bf16) are published to weights-ltx25-v1 and both carry sha256 rows in the in-pack phosphene_quant_manifest.json, so deep-verify (verify_source 'manifest') can check them. publish_scope 'files' keeps this add-on from claiming the q8 pack's sidecars.",
@@ -375,7 +419,12 @@
"download_include": [
"transformer-dev.safetensors",
"ltx-2.5-22b-distilled-lora-450.safetensors"
- ]
+ ],
+ "file_sizes": {
+ "transformer-dev.safetensors": 20595256595,
+ "ltx-2.5-22b-distilled-lora-450.safetensors": 8899889568
+ },
+ "_file_sizes_comment": "Exact byte counts from this pack's release manifest (weights-ltx25-v1, immutable). A declared file whose size differs is reported missing, so a truncated or mixed-generation file (a pack change that left another build's file behind) reads incomplete and Repair refetches it, instead of loading and failing on a tensor shape."
},
{
"_comment": "LTX-2.5's text encoder is NOT the stock Gemma 3 the 2.3 pack uses: it is a custom Gemma 4 12B fine-tune declaring model_type gemma4_unified, and the DiT's dual text projection was moved out of connector.safetensors and into it (we route that back into the connector at conversion time). Falling back to Gemma 3 would load, run, and quietly encode wrongly, so the loader refuses instead.",
diff --git a/scripts/assert_registry.py b/scripts/assert_registry.py
index 6bad749..6c670e8 100644
--- a/scripts/assert_registry.py
+++ b/scripts/assert_registry.py
@@ -451,6 +451,8 @@ try:
if f == "spatial_upscaler_x2_v1_1.safetensors":
continue # the actual June 2026 casualty
(fake / f).write_bytes(b"x" * 4096)
+ for f in repo.get("sidecars") or []: # loader configs (#206)
+ (fake / f).write_text('{"config": {}}')
pack = p.version_pack("q8", "ltx23")
saved = pack["path"]
pack["path"] = fake
diff --git a/scripts/fetch_pack_release.py b/scripts/fetch_pack_release.py
index a3d9969..e6703c4 100644
--- a/scripts/fetch_pack_release.py
+++ b/scripts/fetch_pack_release.py
@@ -419,12 +419,22 @@ def fetch_pack(repo_key: str, root: Path, dest: Path | None,
# The manifest is the mirror's word for what a pack is; required_files.json
# is the app's. They must not drift, and a drift found HERE (before 21 GB is
# pulled) is worth far more than one found by a loader at render time.
- missing = [f for f in repo.get("files", []) if f not in files]
+ declared = list(repo.get("files", [])) + list(repo.get("sidecars") or [])
+ missing = [f for f in declared if f not in files]
if missing:
raise SystemExit(
f"release manifest for {repo_key} is missing files that "
f"required_files.json declares mandatory: {', '.join(missing)}"
)
+ # The app checks a declared size EXACTLY (fleet #206), so a size that
+ # drifted from the manifest would leave a finished pack reading incomplete.
+ drift = [f for f, n in (repo.get("file_sizes") or {}).items()
+ if f in files and int(files[f].get("bytes", -1)) != int(n)]
+ if drift:
+ raise SystemExit(
+ f"release manifest for {repo_key} disagrees with required_files.json "
+ f"file_sizes for: {', '.join(drift)}"
+ )
dest_dir.mkdir(parents=True, exist_ok=True)
if check_only:
diff --git a/webapp/js/editor.js b/webapp/js/editor.js
index 06550ca..6897a23 100644
--- a/webapp/js/editor.js
+++ b/webapp/js/editor.js
@@ -6693,7 +6693,7 @@ function sbePaintWave(span, width) {
const p = SBE.peaks;
const win = sbeMusicWindow(SBE.audio, p.duration);
const w = Math.max(1, SBE.pps / p.rate);
- const strong = (css.getPropertyValue('--border-strong') || '#3d477a').trim();
+ const strong = (css.getPropertyValue('--border-strong') || '#3a3a40').trim();
// THE TRIMMED-AWAY PART IS STILL DRAWN, faintly. A trim you cannot see the
// other side of is a trim you cannot pull back — the seconds are not gone,
// they are outside the window, and the picture should say which.
diff --git a/webapp/js/engines.js b/webapp/js/engines.js
index 2a640f2..51cd987 100644
--- a/webapp/js/engines.js
+++ b/webapp/js/engines.js
@@ -345,7 +345,13 @@ function setH3Steps(v) {
if (typeof updateCustomizeSummary === 'function') { try { updateCustomizeSummary(); } catch (e) {} }
}
document.querySelectorAll('#h3StepsGroup [data-h3-steps]').forEach(b => {
- b.onclick = () => setH3Steps(b.dataset.h3Steps);
+ b.onclick = () => {
+ if (b.classList.contains('flex-locked')) {
+ if (typeof phosToast === 'function') phosToast(H3_FLEX_SPEED_TIP, { kind: 'info' });
+ return;
+ }
+ setH3Steps(b.dataset.h3Steps);
+ };
});
// ---- Speed: ⚡ Fast | ✦ Best ------------------------------------------------
@@ -390,9 +396,155 @@ function h3FlexState() {
}
function h3FlexOn(cell) {
cell = cell || h3CurrentCell();
- return !!(cell && cell.flex_min != null && _h3V13Mode()
+ return !!(cell && cell.flex_min != null && (typeof h3FlexServesMode !== 'function' || h3FlexServesMode(null, 'flex'))
&& h3FlexState().available && h3SpeedPref() === 'flex');
}
+
+// ---- What H3 Flex can render, from the server (owner, 31 Oct 2026) ---------
+// H3 Flex renders Text and Image only, and only on 5 s-window cells
+// (not the dense single pass, not Fast HD). Anywhere else make_job quietly
+// renders H3's own sampler and only says so after submit, so while Flex is the
+// pick every control it cannot honour is greyed and refuses the click: the
+// mode chips, the Quality/Length cells, Fast/Best and the Steps pills.
+// Both facts are the server's: `modes` on the Flex status block (H3_FLEX_MODES)
+// and `takes_flex` on every cell (h3_cell_takes_flex). No copy lives here, so a
+// new Flex mode or cell lights up with no JS change. make_job keeps its own
+// fallback as the safety net.
+const H3_FLEX_LOCK_TIP = 'H3 Flex makes videos from text or an image. Switch to H3 for this.';
+const H3_FLEX_CELL_TIP = 'H3 Flex runs on 5-second windows. Switch to H3 for this.';
+const H3_FLEX_SPEED_TIP = 'H3 Flex runs its own steps. Switch to H3 to pick Fast, Best or Steps.';
+// H3 Flex is what this form will ask for.
+function h3FlexPickedAny() {
+ const pref = h3SpeedPref();
+ return currentEngine() === 'h3' && pref === 'flex';
+}
+// The modes the picked Flex renders (null = the server did not say: no lock,
+// make_job decides).
+function h3FlexModes(which) {
+ const st = h3FlexState();
+ return Array.isArray(st.modes) ? st.modes : null;
+}
+function h3FlexServesMode(mode, which) {
+ if (mode == null) mode = (document.getElementById('mode') || {}).value || 't2v';
+ if (mode === 'oneshot') mode = 't2v';
+ const modes = h3FlexModes(which);
+ return !modes || modes.indexOf(mode) !== -1;
+}
+// Would Flex render THIS cell? The server's own answer; an older server that
+// predates `takes_flex` still prices exactly the cells it takes.
+function h3CellTakesFlex(cell) {
+ if (!cell) return false;
+ if (typeof cell.takes_flex === 'boolean') return cell.takes_flex;
+ return cell.flex_min != null;
+}
+// The supported cell nearest to one Flex cannot render: same canvas at the
+// closest duration first (10 s single pass -> 10 s in two windows), else, at
+// this length, the biggest picture that is not bigger than what the cell
+// delivers (Fast HD's 1280x768 -> High, never the far slower Native), like
+// _h3FallbackCell never goes longer than asked; else any cell Flex takes.
+function _h3FlexNearestCell(cell) {
+ const tiers = (H3.tiers || []).filter(t => h3CellTakesFlex(t) && t.available !== false);
+ if (!tiers.length) return null;
+ const secs = c => Number((h3LengthByKey(c.length) || {}).seconds || c.seconds || 0);
+ const qIdx = k => (H3.qualities || []).findIndex(q => q.key === k);
+ const want = secs(cell);
+ const sameQ = tiers.filter(t => t.quality === cell.quality);
+ if (sameQ.length) {
+ return sameQ.sort((a, b) => Math.abs(secs(a) - want) - Math.abs(secs(b) - want)
+ || secs(a) - secs(b))[0];
+ }
+ let pool = tiers.filter(t => t.length === cell.length);
+ if (!pool.length) {
+ const gap = Math.min(...tiers.map(t => Math.abs(secs(t) - want)));
+ pool = tiers.filter(t => Math.abs(secs(t) - want) === gap);
+ }
+ const px = c => (c.final_width || c.width || 0) * (c.final_height || c.height || 0);
+ const want_px = px(cell);
+ const fits = pool.filter(t => px(t) <= want_px);
+ if (fits.length) return fits.sort((a, b) => px(b) - px(a) || qIdx(a.quality) - qIdx(b.quality))[0];
+ return pool.sort((a, b) => px(a) - px(b) || qIdx(a.quality) - qIdx(b.quality))[0];
+}
+// The supported mode nearest to one Flex cannot render: a mode that starts
+// from a picture goes to Image, everything else to Text, whichever of the two
+// the server lists (else its first).
+function _h3FlexNearestMode(mode) {
+ const modes = h3FlexModes() || [];
+ // i2v_clean_audio is LTX's Image-with-your-audio, left in the Image select
+ // by an earlier LTX render: still a picture mode.
+ const fromPicture = mode === 'keyframe' || mode === 'a2v' || mode === 'i2v_clean_audio';
+ const order = fromPicture ? ['i2v', 't2v'] : ['t2v', 'i2v'];
+ return order.find(m => modes.indexOf(m) !== -1) || modes[0] || null;
+}
+// Picking Flex while the form points somewhere Flex cannot go moves the form to
+// the nearest place it can (and says so, once per move) rather than greying
+// Flex itself: the user asked for Flex, and the move is one visible step that
+// a click on H3 undoes. Runs after the click, and after any repaint that left a
+// picked Flex on an unsupported mode or cell (a restore, a status tick).
+// setMode('i2v') copies the Image select (#i2vMode) into #mode, and that select
+// may still hold LTX's 'i2v_clean_audio' from an earlier render: Image would
+// snap straight back. Pin it first, as Load Params does for an H3 i2v sidecar.
+function _h3FlexPinImageSelect(to) {
+ if (to !== 'i2v') return;
+ const sel = document.getElementById('i2vMode');
+ if (sel && sel.value !== 'i2v') sel.value = 'i2v';
+}
+let _h3FlexFitBusy = false;
+function h3FlexFit() {
+ if (_h3FlexFitBusy || !h3FlexPickedAny()) return;
+ _h3FlexFitBusy = true;
+ try {
+ const name = 'H3 Flex';
+ let movedMode = '', movedCell = null;
+ const mode = (document.getElementById('mode') || {}).value || 't2v';
+ if (!h3FlexServesMode(mode)) {
+ const to = _h3FlexNearestMode(mode);
+ if (to && typeof setMode === 'function') {
+ _h3FlexPinImageSelect(to);
+ setMode(to);
+ // A plain Image click that only lost a leftover LTX audio variant is
+ // not a move worth announcing.
+ if (mode !== 'i2v_clean_audio') movedMode = to === 'i2v' ? 'Image' : 'Text';
+ }
+ }
+ const cell = h3CurrentCell();
+ if (cell && !h3CellTakesFlex(cell)) {
+ const to = _h3FlexNearestCell(cell);
+ if (to) { _h3ApplyShape(to.quality, to.length); movedCell = to; }
+ }
+ const msg = movedMode && movedCell
+ ? name + ' makes videos from text or an image, on 5-second windows: you are on '
+ + movedMode + ' at ' + movedCell.label + ' now.'
+ : movedMode ? name + ' makes videos from text or an image: you are on ' + movedMode + ' now.'
+ : movedCell ? name + ' runs on 5-second windows: the shape is ' + movedCell.label + ' now.'
+ : '';
+ if (msg && typeof phosToast === 'function') {
+ phosToast(msg + ' Pick H3 to go back.', { kind: 'info', duration: 4200 });
+ }
+ } finally {
+ _h3FlexFitBusy = false;
+ }
+}
+// Generate while H3 Flex is the pick but not ready yet (still downloading, or
+// never fetched) used to post h3_flex=0 and render plain H3, the same "thought
+// it was Flex" trap. Returns the plain reason to refuse with, or ''.
+function h3FlexSubmitBlock() {
+ if (!h3FlexPickedAny()) return '';
+ const st = h3FlexState();
+ if (st.available) return '';
+ const name = 'H3 Flex';
+ if (st.installing) {
+ return name + ' is still downloading. It can render as soon as it is ready, or pick H3 to render now.';
+ }
+ return name + ' is not on this Mac yet. Pick it in the model menu to get it, or pick H3 to render now.';
+}
+let _h3FlexFitQueued = false;
+function _h3FlexFitSoon() {
+ if (_h3FlexFitQueued || _h3FlexFitBusy || !h3FlexPickedAny()) return;
+ const cell = h3CurrentCell();
+ if (h3FlexServesMode() && (!cell || h3CellTakesFlex(cell))) return;
+ _h3FlexFitQueued = true;
+ setTimeout(() => { _h3FlexFitQueued = false; h3FlexFit(); }, 0);
+}
// Would THIS cell's Best render on v1.3, as things stand?
function h3V13On(cell, opts) {
cell = cell || h3CurrentCell();
@@ -550,6 +702,9 @@ function h3TurboPillSub() { return h3SpeedSub('fast'); }
// The sampler depth Best runs is per CELL (High 16 sigma points, Draft/
// Standard/Native 9, dense 10 s 16), so the tooltips read it from the cell.
function _h3SyncSamplerTitles() {
+ // Under H3 Flex the Best / Steps pills carry the Flex reason, not their own
+ // description (renderH3Turbo / _h3ApplySpeed set it; never overwrite it).
+ if (typeof h3FlexPickedAny === 'function' && h3FlexPickedAny()) return;
const cell = h3CurrentCell();
const pts = (cell && cell.steps) || 9;
const fwd = Math.max(1, pts - 1);
@@ -627,10 +782,27 @@ function renderH3Turbo() {
group.classList.toggle('cols-3', !flexBtn.hidden);
group.classList.toggle('cols-2', flexBtn.hidden);
}
- // While H3 Flex is the engine, Fast / Best do not apply: the row shows the
- // Flex note (credit, download, progress) instead of two unlit pills.
+ // While H3 Flex is the engine, Fast / Best do not apply. 4.19.15 hid them;
+ // owner, 31 Oct 2026: show what Flex cannot do, greyed, so nobody believes a
+ // Fast or Best choice still counts. The Flex note (credit, download,
+ // progress) sits under them. _h3ApplySpeed greys the Steps pills the same way.
const flexPicked = h3SpeedPref() === 'flex';
- if (group) group.hidden = flexPicked;
+ if (group) {
+ group.hidden = false;
+ group.classList.toggle('flex-locked', flexPicked);
+ group.querySelectorAll('[data-h3-speed="fast"], [data-h3-speed="best"]').forEach(b => {
+ if (flexPicked) {
+ if (b.dataset.flexTitle == null) b.dataset.flexTitle = b.getAttribute('title') || '';
+ b.setAttribute('title', H3_FLEX_SPEED_TIP);
+ b.setAttribute('aria-disabled', 'true');
+ } else if (b.dataset.flexTitle != null) {
+ b.setAttribute('title', b.dataset.flexTitle);
+ delete b.dataset.flexTitle;
+ b.removeAttribute('aria-disabled');
+ }
+ b.classList.toggle('flex-locked', flexPicked);
+ });
+ }
const speedMeta = document.querySelector('#h3SpeedRow .qs-meta');
if (speedMeta) speedMeta.hidden = flexPicked;
const speedName = document.querySelector('#h3SpeedRow .qs-name');
@@ -641,6 +813,10 @@ function renderH3Turbo() {
_h3FlexPickerSync();
_h3RenderV13Note();
_h3SyncFaceFixEta();
+ // The mode chips grey / un-grey with the Flex pick, whatever changed it
+ // (the picker, Load Params, a status tick).
+ if (typeof currentEngine === 'function' && currentEngine() === 'h3') { try { syncModeStripToEngine(); } catch (e) {} }
+ if (typeof _h3FlexFitSoon === 'function') _h3FlexFitSoon();
}
// The line under the switch for Pika H3 Flex: the credit (and "Powered by
@@ -803,6 +979,7 @@ function _h3ApplySpeed() {
// the render that actually queued ran Best, 8-25x slower. fastOn already
// folds in per-cell availability (h3TriStepOn), so light whichever half
// is really about to render; the note below still explains why.
+ const flexPicked = pref === 'flex';
const lit = fastOn ? 'fast' : (flexOn ? 'flex' : 'best');
document.querySelectorAll('#h3SpeedGroup [data-h3-speed]').forEach(b =>
b.classList.toggle('active', b.dataset.h3Speed === lit));
@@ -846,9 +1023,35 @@ function _h3ApplySpeed() {
s.value = (ov !== 'auto' && /^\d+$/.test(ov)) ? parseInt(ov, 10)
: (h3V13On(cell, { fast: false }) ? cell.v13_steps : cell.steps);
}
- // Steps is a Best control: it only shows while Best is what renders.
+ // Steps is a Best control: hidden under Fast; under H3 Flex it shows
+ // greyed with the reason (Flex runs its own steps), like Fast / Best.
const stepsRow = document.getElementById('h3StepsRow');
- if (stepsRow) stepsRow.hidden = fastOn || flexOn;
+ if (stepsRow) {
+ stepsRow.hidden = fastOn && !flexPicked;
+ stepsRow.classList.toggle('flex-locked', flexPicked);
+ const stHint = stepsRow.querySelector('.cz-label-hint');
+ if (stHint && flexPicked) {
+ if (stHint.dataset.flexText == null) stHint.dataset.flexText = stHint.textContent;
+ stHint.textContent = 'H3 Flex runs its own steps';
+ } else if (stHint && stHint.dataset.flexText != null) {
+ stHint.textContent = stHint.dataset.flexText;
+ delete stHint.dataset.flexText;
+ }
+ stepsRow.querySelectorAll('[data-h3-steps]').forEach(b => {
+ if (flexPicked) {
+ if (b.dataset.flexTitle == null) b.dataset.flexTitle = b.getAttribute('title') || '';
+ b.setAttribute('title', H3_FLEX_SPEED_TIP);
+ b.setAttribute('aria-disabled', 'true');
+ b.classList.remove('active');
+ } else if (b.dataset.flexTitle != null) {
+ b.setAttribute('title', b.dataset.flexTitle);
+ delete b.dataset.flexTitle;
+ b.removeAttribute('aria-disabled');
+ b.classList.toggle('active', b.dataset.h3Steps === ((stIn || {}).value || 'auto'));
+ }
+ b.classList.toggle('flex-locked', flexPicked);
+ });
+ }
if (typeof renderH3LoraSlot === 'function') { try { renderH3LoraSlot(); } catch (e) {} }
} finally {
_h3SpeedBusy = false;
@@ -964,7 +1167,13 @@ async function h3SpeedClick(which) {
el.appendChild(a);
}
document.querySelectorAll('#h3SpeedGroup [data-h3-speed]').forEach(b => {
- b.onclick = () => h3SpeedClick(b.dataset.h3Speed);
+ b.onclick = () => {
+ if (b.classList.contains('flex-locked')) {
+ if (typeof phosToast === 'function') phosToast(H3_FLEX_SPEED_TIP, { kind: 'info' });
+ return;
+ }
+ h3SpeedClick(b.dataset.h3Speed);
+ };
});
// The Upscale & Face Fix pair, priced from the cell's own numbers: the
@@ -1071,8 +1280,13 @@ function _engineRowVisible() {
function syncModeStripToEngine() {
const e = engineById(currentEngine());
if (!e) return;
+ // H3 Flex picked: a mode H3 renders but Flex does not is greyed AND refuses
+ // the click (modeChipEngineClick), with the plain reason as its tooltip.
+ // It stays in place (not folded like another engine's mode) so the user
+ // sees what Flex cannot do.
+ const flexPicked = e.id === 'h3' && typeof h3FlexPickedAny === 'function' && h3FlexPickedAny();
document.querySelectorAll('#modeGroup .mode-chip').forEach(chip => {
- const mode = chip.dataset.mode;
+ const mode = chip.dataset.lipsync ? 'a2v' : chip.dataset.mode;
if (!mode) return;
let ok;
if (mode === 'remix') {
@@ -1082,9 +1296,36 @@ function syncModeStripToEngine() {
} else {
ok = engineServesMode(e, mode);
}
- chip.classList.toggle('eng-foreign', !ok);
+ const flexLocked = ok && flexPicked && !(mode === 'remix'
+ ? ((typeof REMIX_MODES !== 'undefined' && REMIX_MODES) ? REMIX_MODES : []).some(m => h3FlexServesMode(m))
+ : h3FlexServesMode(mode));
+ chip.classList.toggle('flex-locked', flexLocked);
+ if (flexLocked) {
+ if (chip.dataset.flexTitle == null) chip.dataset.flexTitle = chip.getAttribute('title') || '';
+ chip.setAttribute('title', H3_FLEX_LOCK_TIP);
+ chip.setAttribute('aria-disabled', 'true');
+ } else if (chip.dataset.flexTitle != null) {
+ if (chip.dataset.flexTitle) chip.setAttribute('title', chip.dataset.flexTitle);
+ else chip.removeAttribute('title');
+ delete chip.dataset.flexTitle;
+ chip.removeAttribute('aria-disabled');
+ }
+ // The lip-sync chip has no data-mode and was never folded; keep it so.
+ if (!chip.dataset.lipsync) chip.classList.toggle('eng-foreign', !ok);
});
}
+// Runs in the capture phase ahead of the chip's own handler (main.js), so a
+// mode greyed because H3 Flex is the pick never switches; the reason shows.
+function modeChipEngineClick(ev) {
+ const chip = ev.target.closest('#modeGroup .mode-chip.flex-locked');
+ if (!chip) return;
+ // Greyed because H3 Flex is the pick: nothing switches; the reason shows.
+ if (chip.classList.contains('flex-locked')) {
+ ev.stopImmediatePropagation(); ev.preventDefault();
+ if (typeof phosToast === 'function') phosToast(H3_FLEX_LOCK_TIP, { kind: 'info' });
+ return;
+ }
+}
// function has no idea which engines exist. Re-run on: boot, every setEngine,
// a workflow-tab change, and any /status tick that moves an install.
@@ -1236,6 +1477,21 @@ function _h3FlexTooltip(st, h3e) {
+ ' GB from Pika Labs, prepared on your Mac).' + credit;
return "H3 Flex (preview) — Pika Labs' six-step H3, about 2.2× faster than Best." + credit;
}
+// Flex picked from a mode H3 itself does not render (an LTX-only one): move
+// to the nearest mode Flex renders first, instead of a click that does nothing.
+// h3FlexFit says so once the engine has switched.
+function _h3FlexEnterMode(h3e) {
+ if (engineServesMode(h3e, currentMode)) return true;
+ const to = _h3FlexNearestMode(currentMode);
+ if (!to || !engineServesMode(h3e, to) || typeof setMode !== 'function') return false;
+ _h3FlexPinImageSelect(to);
+ setMode(to);
+ if (typeof phosToast === 'function') {
+ phosToast('H3 Flex makes videos from text or an image, so the form is on '
+ + (to === 'i2v' ? 'Image' : 'Text') + ' now.', { kind: 'info', duration: 4200 });
+ }
+ return engineServesMode(h3e, currentMode);
+}
// Picking it: H3 with the Flex sampler. Missing pieces download on the same
// click: H3 itself through its own install card (Flex follows on the first
// status tick that finds H3 ready), else the Flex adapter right here.
@@ -1246,9 +1502,10 @@ function h3FlexPickerClick() {
_h3SetSpeedPref('flex');
try { localStorage.setItem('phos_h3flex_wanted', '1'); } catch (e) {}
if (!st.h3_ready) { engineSegClick('h3'); return; }
- if (!engineServesMode(h3e, currentMode)) return;
+ if (typeof _h3FlexEnterMode === 'function' ? !_h3FlexEnterMode(h3e) : !engineServesMode(h3e, currentMode)) return;
setEngine('h3');
if (typeof setH3Speed === 'function') setH3Speed('flex');
+ if (typeof h3FlexFit === 'function') h3FlexFit();
if (!st.available && !st.installing) h3FlexInstall();
renderEngineSwitch();
}
@@ -1639,7 +1896,11 @@ const TIER_ENGINES = {
function _tierChipHtml(engine, kind, item, cell, active) {
const E = TIER_ENGINES[engine] || TIER_ENGINES.h3;
- const ok = !cell ? false : (cell.available !== false);
+ // While H3 Flex is the pick, a cell it cannot render is greyed like an
+ // unavailable one, with the plain reason (h3CellTakesFlex is the server's).
+ const flexLocked = engine === 'h3' && !!cell && cell.available !== false
+ && typeof h3FlexPickedAny === 'function' && h3FlexPickedAny() && !h3CellTakesFlex(cell);
+ const ok = !cell ? false : (cell.available !== false && !flexLocked);
// NEEDS-INSTALL is a third state, distinct from unavailable: the cell is
// renderable on this Mac, the weights just aren't here yet. It reads as a
// CTA (dashed + download glyph via .needs-install) and its third slot names
@@ -1647,10 +1908,12 @@ function _tierChipHtml(engine, kind, item, cell, active) {
const needsInstall = ok && E.needsInstall ? !!E.needsInstall(cell) : false;
const cls = 'q-chip pill-btn pill-quality'
+ (active ? ' active' : '') + (ok ? '' : ' unavailable')
+ + (flexLocked ? ' flex-locked' : '')
+ (needsInstall ? ' needs-install' : '');
const spec = (kind === 'quality') ? E.qualitySpec(item, cell)
: E.lengthSpec(item, cell);
- const foot = !ok ? 'unavailable'
+ const foot = flexLocked ? 'H3 only'
+ : !ok ? 'unavailable'
: needsInstall ? E.installLabel(cell)
: E.eta(cell);
// Owner ruling (2026-09-29): the tooltip says WHERE the time on the chip
@@ -1660,7 +1923,8 @@ function _tierChipHtml(engine, kind, item, cell, active) {
const basisFn = kind === 'quality' && !needsInstall
? (engine === 'h3' ? h3CellEtaBasis : ltxCellEtaBasis) : null;
const basis = (ok && basisFn) ? basisFn(cell) : '';
- const title = ok
+ const title = flexLocked ? H3_FLEX_CELL_TIP
+ : ok
? ([(cell && cell.blurb) || item.blurb || '', basis].filter(Boolean).join(' — '))
: (cell && cell.unavailable_reason) || 'Not available on this install.';
const attr = (kind === 'quality') ? (E.qAttr || `${engine}-quality`)
@@ -2027,6 +2291,14 @@ function _h3ApplyShape(qualityKey, lengthKey, opts) {
}
cell = fb;
}
+ // A cell H3 Flex cannot render, clicked while Flex is the pick: refused like
+ // an unavailable one (the chip is greyed with the reason). A restore lands
+ // and h3FlexFit (queued from renderH3Turbo) moves it to the nearest cell.
+ if (!opts.fallback && typeof h3FlexPickedAny === 'function' && h3FlexPickedAny() && !h3CellTakesFlex(cell)) {
+ if (typeof phosToast === 'function') phosToast(H3_FLEX_CELL_TIP, { kind: 'info' });
+ renderH3Axes();
+ return;
+ }
const set = (id, v) => { const el = document.getElementById(id); if (el) el.value = v; };
set('h3_quality', cell.quality);
set('h3_length', cell.length);
@@ -2419,7 +2691,7 @@ Object.assign(globalThis, {
h3ResolveTierKey, h3TierByKey, h3CellFor, h3CurrentCell,
setH3Upscale, setH3FaceFixAfter, setH3Orientation, setH3Steps, h3TurboPillSub,
h3V13State, h3V13On,
- renderH3Turbo, setH3Turbo, syncModeStripToEngine, renderEngineSwitch,
+ renderH3Turbo, setH3Turbo, syncModeStripToEngine, modeChipEngineClick, renderEngineSwitch, h3FlexSubmitBlock,
setH3Speed, h3SpeedOfParams, h3FlexOn, h3FlexState, h3EstimateLine, setH3TriStep, h3TriStepOn, h3TriStepState,
h3JobSpeedLabel, h3JobShapeLabel, ltxCellEtaBasis, h3CellEtaBasis,
// Published for the Shot setup summary (characters.js): a closed section has
diff --git a/webapp/js/main.js b/webapp/js/main.js
index 9d75a33..6cb9a45 100644
--- a/webapp/js/main.js
+++ b/webapp/js/main.js
@@ -34,6 +34,9 @@ function _wireModeGroupTabSemantics() {
installLicenceGate();
musicInit();
_wireModeGroupTabSemantics();
+// A mode greyed because H3 Flex is the pick refuses the click (capture phase,
+// ahead of the chip's own handler) and says why.
+document.getElementById('modeGroup')?.addEventListener('click', modeChipEngineClick, true);
// VC-34: the Tier quick-link next to the Quality label. Tier is fixed at
// boot (RAM doesn't change at runtime), so this is a one-time read of the
// bootstrap payload — no reason to wait for the first /status poll.
diff --git a/webapp/js/music.js b/webapp/js/music.js
index 4b89d66..9dcfb68 100644
--- a/webapp/js/music.js
+++ b/webapp/js/music.js
@@ -1032,7 +1032,7 @@ function _drawWave(o, frac) {
g.clearRect(0, 0, W, H);
const cs = getComputedStyle(document.documentElement);
const accent = cs.getPropertyValue('--accent-bright').trim() || '#58a6ff';
- const muted = cs.getPropertyValue('--border-strong').trim() || '#3d477a';
+ const muted = cs.getPropertyValue('--border-strong').trim() || '#3a3a40';
const n = 160, bw = W / n;
for (let i = 0; i < n; i++) {
let v = 0.15;
diff --git a/webapp/js/queue.js b/webapp/js/queue.js
index 8353a79..fb3e508 100644
--- a/webapp/js/queue.js
+++ b/webapp/js/queue.js
@@ -8525,6 +8525,16 @@ document.getElementById('genForm').addEventListener('submit', async e => {
return;
}
+ // H3 Flex picked but not ready: refuse rather than quietly render plain H3.
+ if ((fd.get('engine') || 'ltx') === 'h3' && typeof h3FlexSubmitBlock === 'function') {
+ const _flexMsg = h3FlexSubmitBlock();
+ if (_flexMsg) {
+ if (typeof phosToast === 'function') phosToast(_flexMsg, { kind: 'warn', duration: 6000 });
+ else alert(_flexMsg);
+ return;
+ }
+ }
+
// Disable the Generate button while we POST to /queue/add so a fast
// double-click doesn't queue the same job twice. The button is
// re-enabled after poll() returns (or on error). Keep this ABOVE the
diff --git a/webapp/prompting.html b/webapp/prompting.html
index 505ad91..7f7b6f5 100644
--- a/webapp/prompting.html
+++ b/webapp/prompting.html
@@ -5,7 +5,7 @@
body{max-width:760px;margin:40px auto;padding:0 20px;font:16px/1.55 -apple-system,Helvetica,Arial,sans-serif;color:#151a2e;background:#f7f8fc}
h1{font-size:26px}h2{font-size:19px;margin-top:28px}li{margin:6px 0}
button{font:inherit;padding:8px 14px;border-radius:8px;border:1px solid #b9c0d4;background:#fff;cursor:pointer}
- @media(prefers-color-scheme:dark){body{background:#0b0e1a;color:#e8ecf7}button{background:#1a2036;color:#e8ecf7;border-color:#3d477a}}
+ @media(prefers-color-scheme:dark){body{background:#0a0a0b;color:#f4f4f5}button{background:#17171a;color:#f4f4f5;border-color:#3a3a40}}
</style>
<button id="copy">Copy this guide for your assistant</button>
<div id="out"></div>
diff --git a/webapp/style/panel.css b/webapp/style/panel.css
index eff634f..0e1ab51 100644
--- a/webapp/style/panel.css
+++ b/webapp/style/panel.css
@@ -1,14 +1,14 @@
:root {
- /* Phosphene void = #00061a body. Mr Bizarro flagged the panel reads
+ /* Phosphene void = #0a0a0b body. Mr Bizarro flagged the panel reads
"too dark, hard to fathom" — every surface above body bg was
lifted noticeably so the eye actually catches the panel /
input boundaries instead of squinting through the navy. New
scale (light → dark): text > muted > border-strong > border >
panel-2 > panel > bg-2 > bg. Each step ~one Lstar unit clearer
than before. Muted text bumped from #8b949e (4.7:1 on bg) to
- #b6bfd1 (~7.4:1) so secondary copy stops disappearing. */
- --bg: #00061a; --bg-2: #0a1130; --panel: #131b3f; --panel-2: #1d2752;
- --border: #2c3563; --border-strong: #3d477a; --text: #f0f4fb; --muted: #b6bfd1;
+ #b4b4bb (~7.4:1) so secondary copy stops disappearing. */
+ --bg: #0a0a0b; --bg-2: #0e0e10; --panel: #121214; --panel-2: #1f1f23;
+ --border: #2a2a2f; --border-strong: #3a3a40; --text: #f4f4f5; --muted: #b4b4bb;
--accent: #2f81f7; --accent-bright: #58a6ff; --accent-dim: rgba(47,129,247,0.18);
--success: #3fb950; --warning: #d29922; --danger: #f85149;
--radius: 10px;
@@ -290,15 +290,15 @@
/* ---- The shared pop-up (update + broadcast) ------------------------ */
#phModalWrap {
position: fixed; inset: 0; z-index: 9500;
- background: rgba(8, 9, 12, .62);
+ background: rgba(9, 9, 10, .62);
display: flex; align-items: center; justify-content: center;
backdrop-filter: blur(2px);
}
#phModalWrap[hidden] { display: none; }
#phModal {
width: min(460px, calc(100vw - 48px));
- background: var(--panel, #14161c);
- border: 1px solid var(--line, #262a33);
+ background: var(--panel, #161617);
+ border: 1px solid var(--line, #212122);
border-radius: 16px; padding: 22px 24px 18px;
box-shadow: 0 28px 70px rgba(0,0,0,.6);
}
@@ -327,12 +327,12 @@
background: #f0b940; color: #1a1408; border: 0; border-radius: 9px;
font-weight: 650; cursor: pointer;
}
- #phModalPrimary.is-broadcast { background: #5eeaff; color: #06222a; }
+ #phModalPrimary.is-broadcast { background: #5eeaff; color: #171718; }
#phModalPrimary.is-danger { background: var(--danger, #f85149); color: #2a0a08; }
#phModalPrimary:hover { filter: brightness(1.08); }
#phModalSecondary {
background: transparent; color: var(--ink-500, #98a0b3);
- border: 1px solid var(--line, #262a33); border-radius: 9px; cursor: pointer;
+ border: 1px solid var(--line, #212122); border-radius: 9px; cursor: pointer;
}
#phModalSecondary:hover { color: var(--ink, #e8eaf0); }
#phModalSecondary[hidden] { display: none; }
@@ -360,7 +360,7 @@
.ub-go[disabled] { opacity: .6; cursor: default; }
.ub-dismiss, .ub-already {
background: transparent; color: var(--ink-500, #98a0b3);
- border: 1px solid var(--line, #262a33); border-radius: 8px;
+ border: 1px solid var(--line, #212122); border-radius: 8px;
padding: 5px 10px; font-size: 12px; cursor: pointer; flex: 0 0 auto;
width: auto; white-space: nowrap;
}
@@ -383,7 +383,7 @@
display: inline-flex; align-items: center; gap: 7px; width: auto;
padding: 4px 9px 4px 8px; cursor: pointer; white-space: nowrap;
background: rgba(255,255,255,.04);
- border: 1px solid var(--line, #262a33); border-radius: 99px;
+ border: 1px solid var(--line, #212122); border-radius: 99px;
color: var(--ink, #e8eaf0); font-size: 11.5px; font-weight: 500;
font-variant-numeric: tabular-nums;
}
@@ -441,8 +441,8 @@
.hc-caret { width: 10px; height: 10px; opacity: .5; }
#healthPop {
position: fixed; z-index: 9000; min-width: 250px;
- background: var(--panel, #14161c);
- border: 1px solid var(--line, #262a33);
+ background: var(--panel, #161617);
+ border: 1px solid var(--line, #212122);
border-radius: 12px; padding: 5px;
box-shadow: 0 18px 44px rgba(0,0,0,.55);
}
@@ -638,7 +638,7 @@
.creator-avatar {
width: 28px; height: 28px; border-radius: 50%;
object-fit: cover; display: block;
- box-shadow: 0 0 0 2px var(--accent, #5a7cff), 0 0 0 3px var(--bg, #0d1017);
+ box-shadow: 0 0 0 2px var(--accent, #5a7cff), 0 0 0 3px var(--bg, #101011);
}
.creator-link .x-icon {
font-size: 11px; opacity: 0.6; margin-left: -2px;
@@ -654,8 +654,8 @@
See updateModelsCard() in the JS. */
.models-inline {
border-radius: 10px; padding: 12px 14px; margin-bottom: 14px;
- border: 1.5px solid var(--border, #2a3140);
- background: var(--panel-2, #131724);
+ border: 1.5px solid var(--border, #272728);
+ background: var(--panel-2, #121213);
transition: border-color 150ms ease, background 150ms ease;
position: relative;
}
@@ -721,7 +721,7 @@
.models-inline-actions button.danger { background: rgba(220,80,80,0.7); }
.models-inline-actions button.ghost {
background: transparent; color: var(--muted);
- border: 1px solid var(--border, #2a3140); font-weight: 500;
+ border: 1px solid var(--border, #272728); font-weight: 500;
}
/* SYS-16: first-run card, same card language as .models-inline
(border-radius, padding, dismiss ×) so it reads as a sibling. */
@@ -729,7 +729,7 @@
border-radius: 10px; padding: 14px 16px;
margin-bottom: 14px; position: relative;
border: 1.5px solid var(--accent, #2f81f7);
- background: rgba(47, 129, 247, 0.06);
+ background: rgba(255, 255, 255, 0.040);
}
.first-run-card .ttl { font-weight: 600; font-size: 13px; color: var(--fg, #d8e0ee); margin-bottom: 4px; }
.first-run-card .sub { font-size: 11.5px; color: var(--muted); margin-bottom: 12px; }
@@ -751,7 +751,7 @@
pushed the prompt and Generate below the fold on a first run. */
width: auto; flex: 0 1 auto;
padding: 7px 12px; border-radius: 999px;
- background: var(--panel-2, #1d2752); border: 1px solid var(--border);
+ background: var(--panel-2, #1f1f23); border: 1px solid var(--border);
color: var(--text); font-size: 12px; cursor: pointer;
transition: border-color 120ms ease, background 120ms ease;
}
@@ -1106,7 +1106,7 @@
display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap;
padding: 10px 0 12px;
background: linear-gradient(180deg, var(--bg) 0%, var(--bg) 62%,
- rgba(0, 6, 26, 0) 100%);
+ rgba(5, 5, 6, 0) 100%);
}
.sb-sum-cell {
flex: 1 1 118px; min-width: 0;
@@ -1389,8 +1389,8 @@
display: flex; align-items: center; gap: 9px;
padding: 11px 0 12px;
border-top: 1px solid var(--border);
- background: linear-gradient(180deg, rgba(0,6,26,0) 0%,
- rgba(0,6,26,0.85) 22%, var(--bg) 50%, var(--bg) 100%);
+ background: linear-gradient(180deg, rgba(5, 5, 6,0) 0%,
+ rgba(5, 5, 6,0.85) 22%, var(--bg) 50%, var(--bg) 100%);
backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.sb-actionbar[hidden] { display: none !important; }
@@ -2077,7 +2077,7 @@
background: var(--panel); color: var(--muted); font-size: 11px; font-weight: 700;
cursor: pointer;
}
- .sbe-trk-mute.is-on { background: var(--warning); border-color: var(--warning); color: #14101c; }
+ .sbe-trk-mute.is-on { background: var(--warning); border-color: var(--warning); color: #121213; }
.sbe-gh-add {
flex: 0 0 26px; border-top: 1px solid var(--border); flex-direction: row;
align-items: center; justify-content: flex-start; gap: 4px; padding: 0 6px;
@@ -2997,7 +2997,7 @@
.sbe-ov-t {
display: inline-block; width: 16px; height: 16px; line-height: 16px;
margin-right: 5px; border-radius: 3px; text-align: center;
- background: #a970ff; color: #14101c; font-weight: 800; font-size: 11px;
+ background: #a970ff; color: #121213; font-weight: 800; font-size: 11px;
vertical-align: -3px;
}
.sbe-title-b { align-items: center; }
@@ -3120,7 +3120,7 @@
pointer-events: none;
}
.sbe-lvl-u {
- fill: none; stroke: rgba(6,10,26,0.85); stroke-width: 4.5;
+ fill: none; stroke: rgba(8, 8, 9,0.85); stroke-width: 4.5;
pointer-events: none;
}
/* `pointer-events: stroke` makes an invisible path hittable along its
@@ -3222,7 +3222,7 @@
width: min(100%, var(--sbe-fade-draw, 15px));
height: var(--sbe-fade-draw, 15px);
background: var(--accent-bright);
- filter: drop-shadow(0 0 1.5px rgba(6,10,26,0.95));
+ filter: drop-shadow(0 0 1.5px rgba(8, 8, 9,0.95));
transition: width var(--t-fast), height var(--t-fast);
}
.sbe-fade-h.in::before { left: 0; clip-path: polygon(0 0, 100% 0, 0 100%); }
@@ -3891,8 +3891,8 @@
position: sticky; bottom: 0; z-index: 4;
display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
padding: 10px 0 12px; border-top: 1px solid var(--border);
- background: linear-gradient(180deg, rgba(0,6,26,0) 0%,
- rgba(0,6,26,0.85) 22%, var(--bg) 50%, var(--bg) 100%);
+ background: linear-gradient(180deg, rgba(5, 5, 6,0) 0%,
+ rgba(5, 5, 6,0.85) 22%, var(--bg) 50%, var(--bg) 100%);
backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.sbe-actions .sbe-spacer { flex: 1 1 auto; }
@@ -4200,7 +4200,7 @@
font-family: var(--ph-font-mono);
letter-spacing: 0;
border: 1px solid var(--ph-border-soft);
- background: rgba(12, 19, 48, 0.5);
+ background: rgba(16, 16, 17, 0.5);
color: var(--muted);
white-space: nowrap;
cursor: default;
@@ -4315,13 +4315,13 @@
font-family: var(--ph-font-mono);
letter-spacing: 0.06em;
text-transform: uppercase;
- background: rgba(0, 6, 26, 0.65);
+ background: rgba(5, 5, 6, 0.65);
border: 1px solid var(--ph-border-soft);
color: var(--ph-text-faint);
pointer-events: none;
}
.studio-ref-slot.has-image .ref-tag {
- background: rgba(0, 6, 26, 0.78);
+ background: rgba(5, 5, 6, 0.78);
color: var(--accent-bright);
border-color: rgba(47, 129, 247, 0.35);
}
@@ -4499,7 +4499,7 @@
.ideo-stage {
position: relative; width: 100%; max-width: 540px;
aspect-ratio: 16 / 9;
- background: linear-gradient(160deg, #0d1430, #0a0f24);
+ background: linear-gradient(160deg, #101011, #0c0c0d);
border: 1px solid var(--border-strong); border-radius: var(--r-sm);
box-shadow: var(--shadow-1), 0 0 0 1px rgba(0,0,0,0.4) inset;
cursor: crosshair; user-select: none; touch-action: none;
@@ -4526,7 +4526,7 @@
.ideo-box {
position: absolute; box-sizing: border-box;
border: 1.5px solid var(--accent);
- background: rgba(47,129,247,0.08);
+ background: rgba(255, 255, 255, 0.040);
border-radius: 3px; cursor: move; overflow: visible;
transition: border-color var(--t-fast), background var(--t-fast);
}
@@ -4556,7 +4556,7 @@
.ideo-box-obj-label {
position: absolute; left: 0; top: 0; padding: 1px 5px;
font-size: 11px; font-family: var(--ph-font-mono); letter-spacing: .04em;
- color: var(--muted); background: rgba(10,15,36,0.7); border-bottom-right-radius: 3px;
+ color: var(--muted); background: rgba(12, 12, 13,0.7); border-bottom-right-radius: 3px;
pointer-events: none; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* object label in describe mode: fills the box as a centered caret target */
@@ -4564,7 +4564,7 @@
inset: 0; display: flex; align-items: center; justify-content: center; text-align: center;
font-size: 12px; padding: 6px 10px; pointer-events: auto; cursor: text;
user-select: text; -webkit-user-select: text; outline: none;
- background: rgba(8,12,28,0.30); box-shadow: inset 0 0 0 1.5px var(--accent-bright);
+ background: rgba(10, 10, 11,0.30); box-shadow: inset 0 0 0 1.5px var(--accent-bright);
white-space: normal; max-width: none; border-bottom-right-radius: 0;
}
.ideo-box-obj-label[data-ph]:empty::before {
@@ -4573,7 +4573,7 @@
/* resize handles — 8 around the box */
.ideo-handle {
position: absolute; width: 9px; height: 9px; box-sizing: border-box;
- background: var(--accent-bright); border: 1px solid #06122b; border-radius: 2px;
+ background: var(--accent-bright); border: 1px solid #0e0e0f; border-radius: 2px;
z-index: 6;
}
.ideo-handle.n { top: -5px; left: 50%; margin-left: -4.5px; cursor: ns-resize; }
@@ -4590,7 +4590,7 @@
.ideo-box-text.editing {
pointer-events: auto; cursor: text;
user-select: text; -webkit-user-select: text; outline: none;
- background: rgba(8,12,28,0.30);
+ background: rgba(10, 10, 11,0.30);
box-shadow: inset 0 0 0 1.5px var(--accent-bright);
}
.ideo-box-text[data-ph]:empty::before {
@@ -4601,7 +4601,7 @@
.ideo-box-del {
position: absolute; top: -9px; right: -9px; width: 19px; height: 19px;
display: flex; align-items: center; justify-content: center; padding: 0;
- border: 1.5px solid var(--bg, #0a0f24); border-radius: 50%;
+ border: 1.5px solid var(--bg, #0c0c0d); border-radius: 50%;
background: #e5484d; color: #fff; font-size: 14px; line-height: 1;
cursor: pointer; opacity: 0; transform: scale(.5);
transition: opacity var(--t-fast), transform var(--t-fast); z-index: 7;
@@ -4613,8 +4613,8 @@
.ideo-fab {
position: absolute; z-index: 8; display: inline-flex; align-items: center; gap: 3px;
padding: 4px 6px; white-space: nowrap;
- background: var(--panel, #11161f); color: var(--text, #e8eef6);
- border: 1px solid var(--border-strong, #2a3344); border-radius: 10px;
+ background: var(--panel, #111112); color: var(--text, #e8eef6);
+ border: 1px solid var(--border-strong, #282829); border-radius: 10px;
box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.ideo-fab.above { transform: translate(-50%, calc(-100% - 9px)); }
@@ -4632,14 +4632,14 @@
width: 25px; height: 22px; padding: 0; border-radius: 6px; cursor: pointer;
background: transparent; border: 1px solid transparent; color: var(--muted, #9aa6bd);
}
- .ideo-fab-btn:hover { background: var(--bg-2, #0c1226); color: var(--text, #e8eef6); }
+ .ideo-fab-btn:hover { background: var(--bg-2, #0f0f10); color: var(--text, #e8eef6); }
.ideo-fab-btn.on { background: var(--accent-dim); color: var(--accent-bright); }
.ideo-fab-btn.ideo-fab-del { color: #e07a80; }
.ideo-fab-btn.ideo-fab-del:hover { background: rgba(229,72,77,0.16); color: #ff6b6f; }
- .ideo-fab-sep { width: 1px; height: 16px; background: var(--border, #2a3344); margin: 0 1px; }
+ .ideo-fab-sep { width: 1px; height: 16px; background: var(--border, #282829); margin: 0 1px; }
.ideo-fab-style {
- height: 22px; font-size: 11.5px; background: var(--bg-2, #0c1226); color: var(--text, #e8eef6);
- border: 1px solid var(--border, #2a3344); border-radius: 6px; padding: 0 4px; max-width: 92px;
+ height: 22px; font-size: 11.5px; background: var(--bg-2, #0f0f10); color: var(--text, #e8eef6);
+ border: 1px solid var(--border, #282829); border-radius: 6px; padding: 0 4px; max-width: 92px;
}
.ideo-fab-btn:focus-visible, .ideo-fab-sw:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 1px; }
.ideo-fab-btn:focus:not(:focus-visible), .ideo-fab-sw:focus:not(:focus-visible) { outline: none; }
@@ -4953,7 +4953,7 @@
top: 8px; right: 8px;
width: 26px; height: 26px;
display: inline-flex; align-items: center; justify-content: center;
- background: rgba(15, 18, 32, 0.78);
+ background: rgba(15, 15, 16, 0.78);
border: 1px solid rgba(255, 168, 0, 0.45);
color: #ffb84a;
border-radius: 999px;
@@ -5094,7 +5094,7 @@
.characters-prompt-input:focus {
outline: none;
border-color: rgba(94, 234, 255, 0.4);
- box-shadow: 0 0 0 3px rgba(94, 234, 255, 0.10);
+ box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.040);
}
/* Chip rows are stacked top-to-bottom (Framing / Duration / Quality);
@@ -5143,7 +5143,7 @@
color: var(--text);
}
.characters-chip.active {
- background: rgba(94, 234, 255, 0.10);
+ background: rgba(255, 255, 255, 0.040);
border-color: rgba(94, 234, 255, 0.40);
color: var(--accent-bright, #5EEAFF);
}
@@ -5151,7 +5151,7 @@
border-style: dashed;
border-color: rgba(47, 129, 247, 0.55);
color: var(--accent-bright, #5EEAFF);
- background: rgba(47, 129, 247, 0.04);
+ background: rgba(255, 255, 255, 0.040);
}
.characters-chip.needs-install::before {
content: '↓ ';
@@ -5194,7 +5194,7 @@
.characters-turbo:has(input:checked) {
color: var(--accent-bright, #5EEAFF);
border-color: rgba(94, 234, 255, 0.30);
- background: rgba(94, 234, 255, 0.06);
+ background: rgba(255, 255, 255, 0.040);
}
.characters-turbo:has(input:checked) em {
opacity: 0.9;
@@ -5234,7 +5234,7 @@
font-size: 14.5px;
font-weight: 600;
letter-spacing: -0.005em;
- color: #001020;
+ color: #0b0b0c;
background: linear-gradient(92deg,
var(--ph-grad-pink, #FF2E9F) 0%,
var(--ph-grad-purple, #B14AFF) 50%,
@@ -5270,7 +5270,7 @@
padding: 10px 14px;
border-radius: 8px;
font-size: 12.5px;
- background: rgba(94, 234, 255, 0.06);
+ background: rgba(255, 255, 255, 0.040);
border: 1px solid rgba(94, 234, 255, 0.20);
color: var(--text);
}
@@ -5558,7 +5558,7 @@
aspect-ratio: 1 / 1;
border-radius: 8px;
overflow: hidden;
- background: rgba(12, 19, 48, 0.6);
+ background: rgba(16, 16, 17, 0.6);
border: 1px solid var(--ph-border-soft);
}
.train-thumb img {
@@ -5777,7 +5777,7 @@
.train-autocaption-progress {
margin-top: 10px;
padding: 8px 10px;
- background: rgba(177,74,255,0.06);
+ background: rgba(255, 255, 255, 0.040);
border: 1px solid rgba(177,74,255,0.25);
border-radius: 6px;
}
@@ -5873,7 +5873,7 @@
margin-bottom: 12px;
border: 1px solid var(--ph-border-soft);
border-radius: 10px;
- background: rgba(12, 19, 48, 0.35);
+ background: rgba(16, 16, 17, 0.35);
font-size: 12px;
}
.train-est-line {
@@ -6065,7 +6065,7 @@
padding: 8px 10px;
border: 1px solid var(--ph-border-soft);
border-radius: 8px;
- background: rgba(12, 19, 48, 0.35);
+ background: rgba(16, 16, 17, 0.35);
font-size: 12px;
}
.train-lora-row .tl-name {
@@ -6098,7 +6098,7 @@
padding: 4px 10px;
font-size: 12px;
color: var(--accent-bright);
- background: rgba(47, 129, 247, 0.08);
+ background: rgba(255, 255, 255, 0.040);
border: 1px solid rgba(47, 129, 247, 0.22);
border-radius: 5px;
text-decoration: none;
@@ -6842,7 +6842,7 @@
.char-skipstep-toggle:has(input:checked) {
color: var(--accent-bright, #5EEAFF);
border-color: rgba(94, 234, 255, 0.30);
- background: rgba(94, 234, 255, 0.06);
+ background: rgba(255, 255, 255, 0.040);
}
.char-skipstep-label { font-weight: 500; }
.char-skipstep-hint {
@@ -6884,7 +6884,7 @@
opacity: 1;
cursor: pointer;
border-color: rgba(47, 129, 247, 0.45);
- background: rgba(47, 129, 247, 0.04);
+ background: rgba(255, 255, 255, 0.040);
}
.quality-strip .q-chip.needs-install:hover {
background: rgba(47, 129, 247, 0.12);
@@ -6987,8 +6987,8 @@
scrolling content fades out as it passes under the footer. */
background: linear-gradient(
180deg,
- rgba(0, 6, 26, 0) 0%,
- rgba(0, 6, 26, 0.85) 22%,
+ rgba(5, 5, 6, 0) 0%,
+ rgba(5, 5, 6, 0.85) 22%,
var(--bg) 50%,
var(--bg) 100%
);
@@ -7065,7 +7065,7 @@
.form-action-footer .queue-strip .qchip:hover {
color: var(--text);
border-color: var(--accent);
- background: rgba(47,129,247,0.06);
+ background: rgba(255, 255, 255, 0.040);
}
.form-action-footer .queue-strip .qchip-spacer { flex: 1 1 auto; }
/* SYS-22: now a <button> (was a <span>) so it can jump to Shot Setup;
@@ -7104,7 +7104,7 @@
surface so the player visually dominates the pane. */
.stage-pane {
background:
- radial-gradient(circle at 70% -10%, rgba(47,129,247,0.08) 0%, transparent 45%),
+ radial-gradient(circle at 70% -10%, rgba(255, 255, 255, 0.040) 0%, transparent 45%),
linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
padding: 14px;
gap: 14px;
@@ -7135,25 +7135,25 @@
.ideo-stage-bar .isb-group {
display: inline-flex; align-items: stretch; overflow: hidden;
flex: 0 0 auto;
- background: var(--bg-2, #0c1226);
- border: 1px solid var(--border-strong, #2a3344); border-radius: 9px;
+ background: var(--bg-2, #0f0f10);
+ border: 1px solid var(--border-strong, #282829); border-radius: 9px;
}
.ideo-stage-bar .isb-group .isb-btn {
border: 0; border-radius: 0; background: transparent;
color: var(--text, #e8eef6); font-weight: 600;
}
- .ideo-stage-bar .isb-group .isb-btn + .isb-btn { border-left: 1px solid var(--border, #2a3344); }
+ .ideo-stage-bar .isb-group .isb-btn + .isb-btn { border-left: 1px solid var(--border, #282829); }
.ideo-stage-bar .isb-group .isb-btn:hover { background: var(--accent-dim); color: var(--accent-bright); }
.ideo-stage-bar .isb-btn {
appearance: none; display: inline-flex; align-items: center;
width: auto; /* the panel-wide reset makes every button width:100% */
height: 30px; padding: 0 14px; box-sizing: border-box;
- background: transparent; border: 1px solid var(--border, #2a3344);
+ background: transparent; border: 1px solid var(--border, #282829);
color: var(--text-dim, #9aa6bd); font: inherit; font-size: 12.5px;
border-radius: 9px; cursor: pointer;
transition: color .12s, border-color .12s, background .12s; white-space: nowrap;
}
- .ideo-stage-bar .isb-btn:hover { color: var(--text, #e8eef6); border-color: var(--border-strong, #2a3344); }
+ .ideo-stage-bar .isb-btn:hover { color: var(--text, #e8eef6); border-color: var(--border-strong, #282829); }
.ideo-stage-bar .isb-btn:disabled { opacity: .4; cursor: default; }
.ideo-stage-bar .isb-spacer { flex: 1; }
.ideo-stage-bar .isb-toggle {
@@ -7165,17 +7165,17 @@
.ideo-stage-bar .isb-select {
appearance: none; height: 30px; box-sizing: border-box;
width: 118px; /* size to the closed label, not the longest option */
- background: var(--bg-2, #0c1226); border: 1px solid var(--border, #2a3344);
+ background: var(--bg-2, #0f0f10); border: 1px solid var(--border, #282829);
color: var(--text-dim, #9aa6bd); font: inherit; font-size: 12.5px;
padding: 0 26px 0 12px; border-radius: 9px; cursor: pointer;
transition: color .12s, border-color .12s;
}
- .ideo-stage-bar .isb-select:hover { color: var(--text, #e8eef6); border-color: var(--border-strong, #2a3344); }
+ .ideo-stage-bar .isb-select:hover { color: var(--text, #e8eef6); border-color: var(--border-strong, #282829); }
/* The Edit/Result toggle keeps its pill-container look but is now a flex
child of the stage bar (the spacer pushes it to the right). */
body[data-workflow="studio"].ideo-canvas-on #stageModeToggle {
display: inline-flex; gap: 4px; padding: 3px;
- background: var(--bg-2, #11161f); border: 1px solid var(--border);
+ background: var(--bg-2, #111112); border: 1px solid var(--border);
border-radius: 10px; flex: 0 0 auto;
}
body[data-workflow="studio"].ideo-canvas-on #stageModeToggle .smt-btn {
@@ -7215,11 +7215,11 @@
gets a deeper shadow and a faint dot grid for design-tool orientation. */
#ideoCanvasHost #ideoStage {
width: 100%; height: auto; max-width: none; margin: 0;
- border-radius: 10px; border-color: var(--border-strong, #2a3344);
+ border-radius: 10px; border-color: var(--border-strong, #282829);
box-shadow: 0 18px 48px rgba(0,0,0,0.5), 0 0 0 1px rgba(0,0,0,0.35) inset;
background-image:
radial-gradient(rgba(122,140,180,0.10) 1px, transparent 1.2px),
- linear-gradient(160deg, #0d1430, #0a0f24);
+ linear-gradient(160deg, #101011, #0c0c0d);
background-size: 22px 22px, 100% 100%;
}
/* WIDTH COMES FROM THE HEIGHT IT MAY HAVE. `--player-max-h` is the
@@ -7284,7 +7284,7 @@
padding: 0;
background:
radial-gradient(circle at 50% 45%, rgba(47,129,247,0.12), transparent 58%),
- #030611;
+ #050506;
}
.player-wrap .live-stage-image {
position: absolute; inset: 0;
@@ -7301,7 +7301,7 @@
gap: 12px; color: rgba(218,229,255,.78);
background:
radial-gradient(circle at 50% 47%, rgba(88,166,255,.13), transparent 28%),
- linear-gradient(155deg, #060b19, #030611 72%);
+ linear-gradient(155deg, #09090a, #050506 72%);
}
.live-stage-warming-mark {
width: 66px; height: 44px;
@@ -7336,7 +7336,7 @@
.player-wrap .player-handoff-media.is-ready { opacity: 1; }
.player-wrap.empty {
background:
- radial-gradient(circle at 50% 35%, rgba(47,129,247,0.08), transparent 55%),
+ radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.040), transparent 55%),
linear-gradient(180deg, var(--panel) 0%, var(--bg-2) 100%);
color: var(--muted);
flex-direction: column;
@@ -7344,6 +7344,12 @@
text-align: center;
padding: 24px;
}
+ /* Black UI (5.0): the dark stage lost its blue glow; paper keeps it. */
+ html[data-theme="light"] .player-wrap.empty {
+ background:
+ radial-gradient(circle at 50% 35%, rgba(47, 129, 247, 0.08), transparent 55%),
+ linear-gradient(180deg, var(--panel) 0%, var(--bg-2) 100%);
+ }
/* Empty-state stack — composer-grade. Phosphene-tinted play glyph
above a clear title and a humanlike subtitle. */
.ps-empty {
@@ -7376,9 +7382,9 @@
padding: 10px 14px 18px;
background: linear-gradient(
180deg,
- rgba(0, 4, 18, 0.78) 0%,
- rgba(0, 4, 18, 0.45) 60%,
- rgba(0, 4, 18, 0) 100%
+ rgba(3, 3, 4, 0.78) 0%,
+ rgba(3, 3, 4, 0.45) 60%,
+ rgba(3, 3, 4, 0) 100%
);
color: var(--text);
pointer-events: none;
@@ -7423,7 +7429,7 @@
display: inline-flex;
gap: 4px;
padding: 4px;
- background: rgba(8, 14, 35, 0.55);
+ background: rgba(11, 11, 12, 0.55);
border: 1px solid rgba(255,255,255,0.08);
border-radius: var(--r-md);
backdrop-filter: blur(10px);
@@ -7498,7 +7504,7 @@
.kebab-pop {
position: absolute; top: 100%; right: 0; margin-top: 4px;
min-width: 190px; padding: 4px;
- background: var(--panel-2, #171a20);
+ background: var(--panel-2, #1a1a1b);
border: 1px solid rgba(255,255,255,0.12);
border-radius: var(--r-sm);
box-shadow: 0 10px 28px rgba(0,0,0,0.45);
@@ -7578,7 +7584,7 @@
.po-finish-select:hover { background-color: rgba(47,129,247,0.26); }
/* The options themselves DO need readable colours — `color: transparent`
above only hides the closed control's own (empty) label. */
- .po-finish-select option { color: var(--text, #e6edf3); background: var(--bg, #0d1017); }
+ .po-finish-select option { color: var(--text, #e6edf3); background: var(--bg, #101011); }
/* The cost is the whole point of this button ("~8 min" is the decision),
so it keeps its label in the compact breakpoint below where every other
.po-act drops to icon-only. */
@@ -7607,7 +7613,7 @@
flex-direction: column;
align-items: stretch;
gap: 2px;
- background: rgba(8, 14, 35, 0.42);
+ background: rgba(11, 11, 12, 0.42);
}
.player-surface[data-fit="narrow"] .po-act,
.player-surface[data-orient="vertical"] .po-act {
@@ -7661,7 +7667,7 @@
z-index: 4;
display: flex; align-items: flex-end; gap: 12px;
padding: 42px 16px 15px;
- background: linear-gradient(180deg, transparent, rgba(1,4,13,.88));
+ background: linear-gradient(180deg, transparent, rgba(3, 3, 4,.88));
color: #fff;
pointer-events: none;
}
@@ -7672,7 +7678,7 @@
height: 24px; padding: 0 9px;
border-radius: var(--r-pill);
border: 1px solid rgba(255,255,255,.24);
- background: rgba(8,14,35,.62);
+ background: rgba(11, 11, 12,.62);
font-size: 11px; font-weight: 750; letter-spacing: .1em;
box-shadow: 0 0 18px rgba(248,81,73,.14);
}
@@ -7699,7 +7705,7 @@
height: 29px; padding: 0 11px;
border-radius: var(--r-pill);
border: 1px solid rgba(255,255,255,.2);
- background: rgba(8,14,35,.68);
+ background: rgba(11, 11, 12,.68);
color: rgba(255,255,255,.9);
font: inherit; font-size: 11.5px; font-weight: 600;
cursor: pointer;
@@ -7722,7 +7728,7 @@
min-height: 29px; padding: 0 11px;
border-radius: var(--r-pill);
border: 1px solid rgba(88,166,255,.42);
- background: rgba(5,10,25,.78);
+ background: rgba(8, 8, 9,.78);
color: #dceaff;
font: inherit; font-size: 11.5px; font-weight: 650;
white-space: nowrap;
@@ -7762,7 +7768,7 @@
.one-shot-recovery-bar button { width: auto; flex: 0 0 auto; }
.live-return-chip:hover {
border-color: rgba(88,166,255,.78);
- background: rgba(10,20,46,.9);
+ background: rgba(16, 16, 17,.9);
}
/* Hidden compatibility slot — kept in the DOM for legacy callers but
@@ -7969,9 +7975,9 @@
padding: 6px 7px;
background: linear-gradient(
180deg,
- rgba(0, 4, 18, 0) 0%,
- rgba(0, 4, 18, 0.55) 50%,
- rgba(0, 4, 18, 0.80) 100%
+ rgba(3, 3, 4, 0) 0%,
+ rgba(3, 3, 4, 0.55) 50%,
+ rgba(3, 3, 4, 0.80) 100%
);
display: flex;
gap: 4px;
@@ -8051,7 +8057,7 @@
.carousel-head .open-folder-btn:hover {
color: var(--text);
border-color: var(--accent);
- background: rgba(47,129,247,0.08);
+ background: rgba(255, 255, 255, 0.040);
}
.carousel-head .open-folder-btn .ph {
width: 14px; height: 14px;
@@ -8160,7 +8166,7 @@
}
.oi-copy:hover {
color: var(--text); border-color: var(--accent);
- background: rgba(47,129,247,0.07);
+ background: rgba(255, 255, 255, 0.040);
}
/* LoRA list — flat rows, separated by hairlines instead of each
row being its own card. Reads as a list, not a stack of cards. */
@@ -8371,7 +8377,7 @@
flex: 1 1 auto; overflow-y: auto;
padding: 12px 14px; min-height: 0;
background:
- linear-gradient(180deg, var(--bg) 0%, rgba(0,6,26,0.92) 100%);
+ linear-gradient(180deg, var(--bg) 0%, rgba(5, 5, 6,0.92) 100%);
}
.tab-content { display: none; }
.tab-content.show { display: block; }
@@ -8765,7 +8771,7 @@
/* Logs — terminal feel with deeper bg and a tighter mono. */
pre.log {
white-space: pre-wrap; word-break: break-all;
- background: #04060e;
+ background: #060607;
border: 1px solid var(--border);
border-radius: var(--r-sm);
padding: 11px 13px;
@@ -8782,7 +8788,7 @@
agent settings card. */
.modal-bg {
position: fixed; inset: 0;
- background: rgba(0,2,12,0.70);
+ background: rgba(2, 2, 3,0.70);
backdrop-filter: blur(6px);
-webkit-backdrop-filter: blur(6px);
z-index: 100;
@@ -8813,7 +8819,7 @@
.picker { margin-bottom: 14px; }
.picker-drop {
position: relative;
- border: 1.5px dashed var(--border, #2a3140);
+ border: 1.5px dashed var(--border, #272728);
border-radius: 10px;
min-height: 130px;
display: flex; align-items: center; justify-content: center;
@@ -8845,7 +8851,7 @@
.picker-clear {
position: absolute; top: 6px; right: 6px;
width: 28px; height: 28px; border-radius: 50%;
- border: 1px solid var(--border, #2a3140);
+ border: 1px solid var(--border, #272728);
background: rgba(0,0,0,0.6); color: var(--fg, #d8e0ee);
cursor: pointer; font-size: 16px; line-height: 1;
display: flex; align-items: center; justify-content: center;
@@ -8900,7 +8906,7 @@
font-size: 11px;
padding: 4px 6px;
border-radius: 6px;
- border: 1px solid var(--border, #2a3140);
+ border: 1px solid var(--border, #272728);
background: rgba(255,255,255,0.03);
color: var(--muted);
cursor: pointer;
@@ -8920,7 +8926,7 @@
scrollbar-width: thin;
}
.picker-recent-strip::-webkit-scrollbar { height: 6px; }
- .picker-recent-strip::-webkit-scrollbar-thumb { background: var(--border, #2a3140); border-radius: 3px; }
+ .picker-recent-strip::-webkit-scrollbar-thumb { background: var(--border, #272728); border-radius: 3px; }
.picker-recent-thumb {
flex: 0 0 auto; width: 56px; height: 56px;
border-radius: 6px; border: 2px solid transparent;
@@ -8954,7 +8960,7 @@
.ingredients-thumbs:empty { margin-top: 0; }
.ingredient-thumb {
position: relative; aspect-ratio: 1 / 1; border-radius: 8px;
- overflow: hidden; border: 1px solid var(--border, #2a3140);
+ overflow: hidden; border: 1px solid var(--border, #272728);
background: rgba(255,255,255,0.04);
}
.ingredient-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
@@ -9124,7 +9130,7 @@
}
.lora-row:hover {
border-color: var(--accent);
- background: rgba(47,129,247,0.05);
+ background: rgba(255, 255, 255, 0.040);
}
.lora-row.active {
border-color: var(--accent-bright);
@@ -9146,7 +9152,7 @@
}
.lora-row.active .lora-toggle-dot {
background: var(--accent); border-color: var(--accent);
- box-shadow: inset 0 0 0 3px var(--bg, #0a0c14);
+ box-shadow: inset 0 0 0 3px var(--bg, #0c0c0d);
}
.lora-row .lora-name {
font-size: 12px; font-weight: 500; color: var(--text);
@@ -9204,7 +9210,7 @@
.lora-row .lora-name input.lora-name-edit {
font: inherit;
color: var(--text);
- background: rgba(47,129,247,0.08);
+ background: rgba(255, 255, 255, 0.040);
border: 1px solid var(--accent-bright, #58a6ff);
border-radius: 4px;
padding: 1px 6px;
@@ -9333,7 +9339,7 @@
}
.chars-strip-action:hover {
color: var(--accent-bright); border-color: var(--accent);
- background: rgba(47,129,247,0.10);
+ background: rgba(255, 255, 255, 0.040);
}
.chars-strip-action .ph { width: 14px; height: 14px; }
@@ -9362,7 +9368,7 @@
border-color: var(--border-strong);
}
.chars-avatar-chip.active {
- background: rgba(47,129,247,0.10);
+ background: rgba(255, 255, 255, 0.040);
border-color: var(--accent);
}
.chars-avatar-chip .chars-avatar-img,
@@ -9409,7 +9415,7 @@
background: var(--accent);
color: #fff;
display: inline-flex; align-items: center; justify-content: center;
- border: 2px solid var(--panel-2, #0f1320);
+ border: 2px solid var(--panel-2, #0f0f10);
box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.chars-avatar-chip .chars-avatar-voice .ph {
@@ -9424,7 +9430,7 @@
margin-top: 6px;
padding: 4px 8px;
font-size: 11px; color: var(--muted);
- background: rgba(47,129,247,0.06);
+ background: rgba(255, 255, 255, 0.040);
border: 1px solid rgba(47,129,247,0.18);
border-radius: 4px;
}
@@ -9682,7 +9688,7 @@
font-size: 11px; color: var(--muted);
padding: 6px 8px;
border-radius: 4px;
- background: rgba(47,129,247,0.06);
+ background: rgba(255, 255, 255, 0.040);
border: 1px dashed rgba(47,129,247,0.30);
}
.chars-applied-note strong { color: var(--accent-bright); font-weight: 600; }
@@ -9716,7 +9722,7 @@
}
.chars-chip:hover {
border-color: var(--accent);
- background: rgba(47,129,247,0.05);
+ background: rgba(255, 255, 255, 0.040);
}
.chars-chip:active { transform: translateY(1px); }
.chars-chip.active {
@@ -9913,7 +9919,7 @@
.civitai-auth input[type="text"] {
flex: 1; min-width: 180px;
padding: 6px 8px; border-radius: var(--r-xs);
- border: 1px solid var(--border); background: var(--bg-2, #0a0c14);
+ border: 1px solid var(--border); background: var(--bg-2, #0c0c0d);
color: var(--text); font-size: 12px;
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
@@ -10153,7 +10159,7 @@
display: flex; align-items: flex-start; gap: 10px;
min-width: 260px; max-width: 560px;
padding: 10px 12px 10px 16px;
- background: rgba(20, 26, 50, 0.94);
+ background: rgba(21, 21, 22, 0.94);
border: 1px solid var(--border-strong);
border-radius: 10px;
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
@@ -10211,8 +10217,8 @@
animation: phos-modal-bg-in 140ms ease-out;
}
.models-card {
- background: var(--bg-elevated, #1a1f29); color: var(--fg, #d8e0ee);
- border: 1px solid var(--border, #2a3140); border-radius: 12px;
+ background: var(--bg-elevated, #19191a); color: var(--fg, #d8e0ee);
+ border: 1px solid var(--border, #272728); border-radius: 12px;
width: min(640px, 92vw); max-height: 86vh; overflow-y: auto;
box-shadow: 0 20px 60px rgba(0,0,0,0.6);
padding: 22px 24px;
@@ -10228,7 +10234,7 @@
.models-list li {
display: grid; grid-template-columns: 24px 1fr auto; gap: 10px;
align-items: center;
- background: rgba(255,255,255,0.02); border: 1px solid var(--border, #2a3140);
+ background: rgba(255,255,255,0.02); border: 1px solid var(--border, #272728);
border-radius: 8px; padding: 10px 12px;
}
.models-list li .icon { font-size: 18px; line-height: 1; text-align: center; }
@@ -10262,7 +10268,7 @@
}
.models-list li button[disabled] { opacity: 0.55; cursor: not-allowed; }
.models-list li button.ghost {
- background: transparent; color: var(--muted); border: 1px solid var(--border, #2a3140);
+ background: transparent; color: var(--muted); border: 1px solid var(--border, #272728);
}
.models-foot { font-size: 11px; color: var(--muted); margin-top: 14px; line-height: 1.4; }
@@ -10315,7 +10321,7 @@
top: 16px; right: 16px;
width: 36px; height: 36px;
border-radius: 50%;
- background: rgba(20,26,58,0.85);
+ background: rgba(22, 22, 23,0.85);
border: 1px solid var(--ph-border-strong, rgba(140,160,220,0.16));
color: var(--text, #d8e0ee);
cursor: pointer;
@@ -10323,7 +10329,7 @@
transition: background 120ms ease, transform 120ms ease;
}
.expand-close:hover {
- background: rgba(40,50,90,0.95);
+ background: rgba(41, 41, 42,0.95);
transform: scale(1.05);
}
/* 4.18.0 — Play all. The bar under the picture: previous / play all /
@@ -10336,7 +10342,7 @@
display: flex; align-items: center; gap: 6px;
margin-top: 12px; padding: 6px 8px;
border-radius: 999px;
- background: rgba(20,26,58,0.85);
+ background: rgba(22, 22, 23,0.85);
border: 1px solid var(--ph-border-strong, rgba(140,160,220,0.16));
color: var(--text, #d8e0ee);
font-size: 12px;
@@ -10378,7 +10384,7 @@
.expand-audio {
display: flex; flex-direction: column; align-items: center; gap: 18px;
width: min(520px, 90vw); padding: 36px 28px;
- border-radius: 12px; background: rgba(20,26,58,0.85);
+ border-radius: 12px; background: rgba(22, 22, 23,0.85);
border: 1px solid var(--ph-border-strong, rgba(140,160,220,0.16));
}
.expand-audio-note { font-size: 44px; line-height: 1; color: var(--accent-bright, #58a6ff); }
@@ -10415,12 +10421,12 @@
which keeps the existing user habit but reads cleaner. */
:root {
- --ph-bg: #00061a;
- --ph-elev-1: #0c1330;
- --ph-elev-2: #141a3a;
+ --ph-bg: #0a0a0b;
+ --ph-elev-1: #121214;
+ --ph-elev-2: #17171a;
--ph-border-soft: rgba(140, 160, 220, 0.08);
--ph-border-strong: rgba(140, 160, 220, 0.16);
- --ph-text-faint: #5b6478;
+ --ph-text-faint: #6b6b73;
/* Wordmark gradient — sampled from the SVG logo's three concentric
rings (#FF2E9F inner, #B14AFF middle, #5EEAFF outer). The middle
purple stop bridges pink → cyan; the old "magenta" was another
@@ -10436,7 +10442,7 @@
top — matches the Linear artboard. */
body {
background: var(--ph-bg);
- background-image: radial-gradient(ellipse 1200px 600px at 50% -10%, rgba(47,129,247,0.06), transparent 60%);
+ background-image: radial-gradient(ellipse 1200px 600px at 50% -10%, rgba(255, 255, 255, 0.040), transparent 60%);
font-size: 13px;
}
@@ -10455,7 +10461,7 @@
flex-wrap: nowrap;
align-items: center;
border-bottom: 1px solid var(--ph-border-soft);
- background: rgba(0, 6, 26, 0.6);
+ background: rgba(5, 5, 6, 0.6);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
overflow: hidden;
@@ -10524,7 +10530,7 @@
display: inline-flex; align-items: center; gap: 7px;
width: auto; padding: 5px 9px; cursor: pointer;
background: var(--eng-dim, rgba(255,255,255,.06));
- border: 1px solid var(--eng-soft, var(--line, #262a33));
+ border: 1px solid var(--eng-soft, var(--line, #212122));
border-radius: 9px; color: var(--ink, #e8eaf0);
font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
@@ -10535,8 +10541,8 @@
/* Portaled to <body>: header is overflow:hidden and would slice this. */
#engineMenu {
position: fixed; z-index: 9000;
- background: var(--panel, #14161c);
- border: 1px solid var(--line, #262a33);
+ background: var(--panel, #161617);
+ border: 1px solid var(--line, #212122);
border-radius: 12px; padding: 5px;
box-shadow: 0 18px 44px rgba(0,0,0,.55);
max-height: 70vh; overflow-y: auto;
@@ -10559,23 +10565,23 @@
#engineMenu .eng-gen {
display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
margin-top: 4px; padding: 8px 10px 6px;
- border-top: 1px solid var(--line, #262a33);
+ border-top: 1px solid var(--line, #212122);
}
.eng-gen-label { font-size: 11.5px; font-weight: 600; color: var(--ink-500, #98a0b3); }
.eng-gen-btns { display: inline-flex; gap: 4px; }
.eng-gen-btn {
padding: 3px 10px; border-radius: 7px; cursor: pointer;
- border: 1px solid var(--line, #262a33); background: transparent;
+ border: 1px solid var(--line, #212122); background: transparent;
color: var(--ink, #e8eaf0); font-size: 12px; font-weight: 600;
}
.eng-gen-btn:hover { background: rgba(255,255,255,.05); }
.eng-gen-btn.active {
cursor: default; color: var(--eng-accent, currentColor);
background: var(--eng-dim, rgba(255,255,255,.07));
- border-color: var(--eng-soft, var(--line, #262a33));
+ border-color: var(--eng-soft, var(--line, #212122));
}
/* Same switch, placed under the Remix chips instead of in the menu. */
- #ltxGenSwitch.eng-gen-inline { margin-top: 9px; padding: 8px 0 0; border-top: 1px solid var(--line, #262a33); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
+ #ltxGenSwitch.eng-gen-inline { margin-top: 9px; padding: 8px 0 0; border-top: 1px solid var(--line, #212122); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
#ltxGenSwitch[hidden] { display: none; }
#ltxGenSwitch .eng-gen-note { flex: 1 1 auto; }
.eng-gen-note { flex: 1 0 100%; font-size: 11px; color: var(--ink-500, #98a0b3); line-height: 1.35; }
@@ -10676,7 +10682,7 @@
inset: -12px;
border-radius: 50%;
background: radial-gradient(circle closest-side,
- rgba(255, 95, 168, 0.13) 0%, rgba(177, 74, 255, 0.06) 55%,
+ rgba(255, 95, 168, 0.13) 0%, rgba(255, 255, 255, 0.040) 55%,
rgba(79, 214, 255, 0.035) 80%, rgba(79, 214, 255, 0) 100%);
}
.ph-mk-spin {
@@ -10813,7 +10819,7 @@
body > header > .pill-running, body > header #healthCluster > .pill-running {
color: var(--accent-bright);
border-color: rgba(47,129,247,0.30);
- background: rgba(47,129,247,0.06);
+ background: rgba(255, 255, 255, 0.040);
animation: pulse 1.6s ease-in-out infinite;
}
body > header > .pill-current, body > header #healthCluster > .pill-current { color: var(--success); border-color: rgba(63,185,80,0.25); }
@@ -11316,15 +11322,15 @@
align-items: flex-start !important;
text-align: left !important;
min-height: 76px;
- background: rgba(20, 26, 58, 0.4) !important;
+ background: rgba(22, 22, 23, 0.4) !important;
border: 1px solid var(--ph-border-soft) !important;
border-radius: 8px !important;
box-shadow: none !important;
position: relative;
}
- .pill-quality:hover { background: rgba(20, 26, 58, 0.6) !important; border-color: var(--ph-border-strong) !important; }
+ .pill-quality:hover { background: rgba(22, 22, 23, 0.6) !important; border-color: var(--ph-border-strong) !important; }
.pill-quality.active {
- background: rgba(47, 129, 247, 0.06) !important;
+ background: rgba(255, 255, 255, 0.040) !important;
border-color: rgba(47, 129, 247, 0.45) !important;
box-shadow: inset 0 0 0 1px rgba(47, 129, 247, 0.18) !important;
}
@@ -11370,7 +11376,7 @@
#genForm input[type="text"],
#genForm input[type="number"],
#genForm select {
- background: rgba(12, 19, 48, 0.5);
+ background: rgba(16, 16, 17, 0.5);
border: 1px solid var(--ph-border-soft);
border-radius: 8px;
padding: 10px 12px;
@@ -11380,7 +11386,7 @@
#genForm input:focus,
#genForm select:focus {
border-color: var(--accent);
- background: rgba(12, 19, 48, 0.7);
+ background: rgba(16, 16, 17, 0.7);
box-shadow: 0 0 0 3px rgba(47, 129, 247, 0.18);
}
@@ -11442,7 +11448,7 @@
/* === MODELS-INLINE CARD =================================== */
.models-inline {
- background: rgba(20, 26, 58, 0.4);
+ background: rgba(22, 22, 23, 0.4);
border: 1px solid var(--ph-border-soft);
border-radius: 10px;
}
@@ -11455,7 +11461,7 @@
.loras-section, .customize-section {
border: 1px solid var(--ph-border-soft);
border-radius: 8px;
- background: rgba(20, 26, 58, 0.25);
+ background: rgba(22, 22, 23, 0.25);
}
/* === Sub-header strip BELOW the workflow tabs (Manual mode)
@@ -11584,6 +11590,22 @@
#h3LengthGroup .q-chip.unavailable .ql-tier,
#ltxLengthGroup .q-chip.unavailable .ql-tier,
#qualityGroup .q-chip.unavailable .ql-tier { font-style: italic; }
+ /* H3 Flex picked (owner, 2026-10-31): what Flex cannot render is greyed
+ and refuses the click, with the plain reason as its tooltip. A Flex-locked
+ cell is not broken, so no strike-through: it reads "H3 only". The mode
+ chips, Fast / Best and the Steps pills take the same dim. engines.js
+ (syncModeStripToEngine, renderH3Turbo, _h3ApplySpeed) sets .flex-locked
+ from the server's own Flex rules. */
+ #h3LengthGroup .q-chip.flex-locked,
+ #h3QualityGroup .q-chip.flex-locked { text-decoration-line: none; }
+ .form-pane > #modeGroup .mode-chip.flex-locked,
+ #h3SpeedGroup .pill-btn.flex-locked,
+ #h3StepsGroup .pill-btn.flex-locked {
+ opacity: 0.42; cursor: not-allowed;
+ }
+ #modeGroup .mode-chip.flex-locked { opacity: 0.42; cursor: not-allowed; }
+ #h3SpeedGroup .pill-btn.flex-locked:hover,
+ #h3StepsGroup .pill-btn.flex-locked:hover { background: transparent; border-color: var(--border); }
/* Per-window prompts. Same .cz-control grammar as Speed / Steps / Export,
so the fourth H3 control reads as one of the family rather than as a
@@ -11805,7 +11827,7 @@ body[data-workflow="oneshot"] #audioSectionTab { display: none !important; }
.os-two { display: grid; grid-template-columns: 1fr; gap: 12px; }
.os-prompt { min-height: 96px; }
.os-anchor { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 32px; }
-.os-anchor-thumb { height: 44px; width: auto; border-radius: 6px; border: 1px solid var(--border, #2a2f3a); }
+.os-anchor-thumb { height: 44px; width: auto; border-radius: 6px; border: 1px solid var(--border, #252526); }
.os-anchor-thumb[hidden] { display: none !important; }
.os-anchor-name { color: var(--muted); }
.os-characters { display: flex; flex-wrap: wrap; gap: 6px; }
@@ -11840,7 +11862,7 @@ body[data-workflow="oneshot"] #audioSectionTab { display: none !important; }
.os-character-note[hidden] { display: none !important; }
.os-footer { margin-top: 2px; }
.os-status .os-parts { display: flex; flex-wrap: wrap; gap: 6px; }
-.os-part { font-size: 11px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--border, #2a2f3a); color: var(--muted); }
+.os-part { font-size: 11px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--border, #252526); color: var(--muted); }
.os-part.now { color: var(--accent-bright); border-color: var(--accent-bright); }
.os-part.ok { color: #3fb950; border-color: rgba(63, 185, 80, 0.5); }
.os-part.mid { color: #d29922; border-color: rgba(210, 153, 34, 0.5); }
@@ -11866,7 +11888,7 @@ body[data-workflow="oneshot"] #audioSectionTab { display: none !important; }
padding: 2px 8px 2px 6px;
border: 1px solid rgba(255,255,255,0.18);
border-radius: 999px;
- background: rgba(0, 4, 18, 0.72);
+ background: rgba(3, 3, 4, 0.72);
color: rgba(255,255,255,0.9);
font-size: 11px; font-weight: 500; line-height: 16px;
white-space: nowrap; cursor: pointer;
@@ -12139,7 +12161,7 @@ body[data-workflow="oneshot"] #audioSectionTab { display: none !important; }
.phos-tip {
position: fixed; left: 0; top: 0; z-index: 10050; pointer-events: none;
max-width: 300px; padding: 7px 10px 8px;
- background: rgba(10, 14, 32, 0.97); color: #eef2fb;
+ background: rgba(12, 12, 13, 0.97); color: #eef2fb;
border: 1px solid rgba(160, 175, 230, 0.20); border-radius: 8px;
box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45), 0 1px 0 rgba(255,255,255,0.04) inset;
font-size: 12px; line-height: 1.4; letter-spacing: 0;
@@ -12420,7 +12442,7 @@ body:not([data-engine="ltx"]) .cz-body > #aspectRow.mode-only.show { display: no
.form-action-footer .queue-strip .qchip:hover {
color: var(--text);
border-color: var(--eng-soft, var(--accent));
- background: rgba(47, 129, 247, 0.06);
+ background: rgba(255, 255, 255, 0.040);
}
/* Primary: filled, and the only filled thing in its row. */
#genForm .loras-summary .loras-browse-btn:not(.is-ghost),
@@ -12927,7 +12949,7 @@ body[data-engine="h3"][data-vmode="v2a"] #h3LengthLabel { display: none !importa
.licence-model { font-weight: 600; }
.licence-badge {
font-size: 11px; padding: 2px 8px; border-radius: 999px;
- border: 1px solid var(--border, #2a3140); color: var(--muted);
+ border: 1px solid var(--border, #272728); color: var(--muted);
}
.licence-badge.nc { border-color: rgba(210,153,34,0.55); color: #e3b341; }
.licence-summary { margin: 0 0 8px; }