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.19): P-H3-Image by Pruna AI, 8-megapixel pictures with exact text, free

mrbizarroe8351f545e54
diff --git a/README.md b/README.md
index 7d27193..bbdd40c 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.18.** Made by Mr Bizarro.
+**Current release: v4.19.19.** Made by Mr Bizarro.
## Why Phosphene
diff --git a/VERSION b/VERSION
index 6fa8004..41d1a1b 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-4.19.18
+4.19.19
diff --git a/docs/CHANGELOG_4.19.19.md b/docs/CHANGELOG_4.19.19.md
new file mode 100644
index 0000000..ce60741
--- /dev/null
+++ b/docs/CHANGELOG_4.19.19.md
@@ -0,0 +1,16 @@
+# Phosphene 4.19.19
+
+**P-H3-Image by Pruna AI: big photographs, film frames and posters from a sentence, made on your Mac.** Free for everyone, on a Mac with 48 GB of memory or more that has Hailuo H3 installed.
+
+- **P-H3-Image is in the Images tab.** Pick it in **Engine**, click the *download ~18 GB* chip once, then Generate. It is built on MiniMax H3 (the same model behind our Hailuo video) and fetched straight from Pruna, never re-hosted.
+- **Words come out spelled exactly.** Put short text in double quotes and the picture carries it as typed.
+- **Real sizes, not upscales.** Standard is 4 megapixels (about 2.5 minutes on an M4 Max), High is 8 megapixels (about 5 minutes), Draft is 2 megapixels (about 1.3 minutes). Each is one image straight out of the model.
+- **Honest limits.** Hands and tiny background faces can still go wrong, and it does not take reference images yet.
+
+Examples and how-to: https://phosphene.video/docs/images/#p-h3-image
+
+It uses the Hailuo H3 files you already have, so after you press Update the picker shows up once the Hailuo H3 runner has updated too (Update does this on its own). Credit: P-H3-Image by Pruna AI, based on MiniMax-H3 by MiniMax (MiniMax H3 Community License); text encoder based on Qwen3-VL-4B (Apache-2.0). Powered by MiniMax H3.
+
+Free for everyone, and it will also be in Phosphene 5.0.
+
+In Pinokio, press Update, then restart Phosphene.
diff --git a/docs/H3_ENGINE.md b/docs/H3_ENGINE.md
index 375de97..24e2afc 100644
--- a/docs/H3_ENGINE.md
+++ b/docs/H3_ENGINE.md
@@ -869,6 +869,28 @@ is hidden entirely on a pack that predates it.
---
+## P-H3-Image (Pruna) — the image lane on the H3 runner
+
+Pruna AI's P-H3-Image (`PrunaAI/P-H3-Image` @ 7f98acef, adapter from `PrunaAI/P-H3-Image-Comfy` @ 44a0fb73) is MiniMax-H3 FL2VA
+plus a rank-128 adapter (208 modules, scale 1.0: proven tensor by tensor against our pruned base), run as ONE latent frame
+(two throw-away audio latents) over 8 forwards, no guidance. It reuses the H3 Q8 DiT already on disk; its own parts are a
+five-tap Qwen3-VL-4B text encoder + connector and a new single-frame ViT image decoder.
+
+- Runner: `scripts/generate_image.py PROMPT -o OUT --root <models>/p-h3-image --dit <q8> --aspect A --mp 2|4|8 --seed N --metrics M`
+ (engine ref `phosphene/v4.19.19-image`, pin 4df59c7: the 4.19.15 engine plus only the image commits). Staged: text encoder out, then DiT + adapter,
+ then the decoder (tiled, 16x16 tokens).
+- Adapter layout: qkv rows permuted to our per-head layout, fc1 as published (NOT `--lora-fc1-swap`, unlike Flex). The load logs
+ `208 applied, 0 skipped`.
+- Fetch: `scripts/fetch_ph3_image.py --dir D --accepted`: pinned files (bytes + sha256), upstream LICENSE / LICENSE-APACHE / NOTICE
+ beside them, the decoder converted locally (renames + re-fused tensors, values unchanged, MODIFICATION_NOTICE in its metadata)
+ and checked against `DECODER_SHA256` 0415dda9; the 5.6 GB original is deleted after and never fetched again.
+- Studio: `image_engine.kind = "ph3image"`, engines `ph3image_draft_inline` / `ph3image_standard_inline` / `ph3image_inline`
+ (2 / 4 / 8 MP), `POST /image/ph3image/install` (H3 licence gate), `/status` block `ph3image`.
+- Measured, M4 Max 64 GB: 2 MP 75 s, 4 MP 146 s (15.4 s/step),
+ 8 MP 312 s; peak 24.2 / 24.7 / 25.5 GB. Real-weight parity vs Pruna's code: text taps cos >= 0.99994, connector 1.000,
+ decoder fp32 126.8 dB.
+- Not ported: edit mode (1-8 reference images; needs the VAE encoder mapping and the vision tower), the 19 GB prompt rewriter.
+
## What H3 does *not* do
- **Modes**: Remix and Character are LTX-pipeline-specific; the picker snaps
diff --git a/image_engine.py b/image_engine.py
index 99c6ae3..9b2801c 100644
--- a/image_engine.py
+++ b/image_engine.py
@@ -505,6 +505,15 @@ class ImageEngineConfig:
hidream_fb_threshold: float = 0.15
hidream_fb_keep_last: int = 8
+ # P-H3-Image (Pruna, on MiniMax H3), run by the H3 engine's own runner as a subprocess.
+ # The panel fills the paths (it owns the H3 install); `ph3image_mp` is the quality tier:
+ # 2 / 4 / 8 megapixels (the model is trained for 8).
+ ph3image_python_path: str = ""
+ ph3image_script_path: str = ""
+ ph3image_root: str = "" # folder made by fetch_ph3_image.py
+ ph3image_dit: str = "" # MiniMax-H3 FL2VA transformer (our Q8 pack)
+ ph3image_mp: float = 8.0
+
def to_public_dict(self) -> dict:
d = asdict(self)
if d.get("bfl_api_key"):
@@ -602,6 +611,8 @@ def generate(*, prompt: str, n: int, output_dir: Path,
return _generate_bfl(prompt, n, width, height, output_dir, base_seed, config)
if config.kind == "hidream":
return _generate_hidream(prompt, n, width, height, output_dir, base_seed, config, refs=refs, on_log=on_log)
+ if config.kind == "ph3image":
+ return _generate_ph3image(prompt, n, aspect, output_dir, base_seed, config, refs=refs, on_log=on_log)
raise ValueError(f"unknown image engine kind: {config.kind!r}")
@@ -637,6 +648,11 @@ def health_check(config: ImageEngineConfig) -> tuple[bool, str]:
return False, (f"HiDream model not found at {config.hidream_model_path or HIDREAM_DEFAULT_MODEL}. "
"Run the lab's converter or override hidream_model_path.")
return True, f"HiDream ready: model={Path(model).name}, steps={config.hidream_steps}"
+ if config.kind == "ph3image":
+ missing = ph3image_missing(config)
+ if missing:
+ return False, "P-H3-Image is not installed: " + "; ".join(missing)
+ return True, f"P-H3-Image ready ({config.ph3image_mp:g} MP, 8 steps)"
return False, f"unknown engine kind: {config.kind!r}"
@@ -2395,3 +2411,116 @@ def _generate_hidream(prompt: str, n: int, width: int, height: int,
})
return results
+
+
+# ---------------------------------------------------------------------------------------------
+# P-H3-Image (Pruna), on MiniMax H3. One subprocess per image: the H3 engine's generate_image.py
+# runs staged (text encoder, then the DiT with the adapter, then the decoder) so a 64 GB Mac
+# never holds all three. Text-to-image only for now; refs fall back to a warning, like the other
+# backends without multi-ref support.
+# ---------------------------------------------------------------------------------------------
+
+# Aspect keys of the Image Studio -> the seven ratios the model was trained at.
+PH3IMAGE_RATIOS = {"1:1": "1:1", "4:3": "4:3", "3:4": "3:4", "3:2": "3:2", "2:3": "2:3",
+ "16:9": "16:9", "9:16": "9:16"}
+PH3IMAGE_ADAPTER = "loras/p-h3-image_lora_bf16.safetensors"
+# Megapixel tiers: Draft (2), Standard (4), High (8). Below 8 the author warns of more artifacts.
+PH3IMAGE_TIERS = (2.0, 4.0, 8.0)
+
+
+def ph3image_missing(config: ImageEngineConfig) -> list[str]:
+ """What is not on disk yet, in plain words ([] = ready)."""
+ out: list[str] = []
+ py, script = config.ph3image_python_path, config.ph3image_script_path
+ if not py or not Path(py).exists():
+ out.append("the H3 engine is not installed")
+ if not script or not Path(script).is_file():
+ out.append("this H3 engine build has no image runner")
+ root = Path(config.ph3image_root) if config.ph3image_root else None
+ if root is None or not (root / PH3IMAGE_ADAPTER).is_file():
+ out.append("the P-H3-Image adapter is not downloaded")
+ if root is None or not (root / "vae" / "decoder.safetensors").is_file():
+ out.append("the image decoder is not downloaded")
+ if root is None or not (root / "text_encoder").is_dir():
+ out.append("the text encoder is not downloaded")
+ if not config.ph3image_dit or not Path(config.ph3image_dit).exists():
+ out.append("the H3 video engine weights are missing")
+ return out
+
+
+def _ph3image_aspect(aspect: str) -> str:
+ return PH3IMAGE_RATIOS.get(aspect, "16:9")
+
+
+def _generate_ph3image(prompt: str, n: int, aspect: str, output_dir: Path, base_seed: int | None,
+ config: ImageEngineConfig, refs: list[str] | None = None,
+ on_log: "callable | None" = None) -> list[dict]:
+ import json as _json
+ import os
+ import random
+ import subprocess
+
+ missing = ph3image_missing(config)
+ if missing:
+ raise FileNotFoundError("P-H3-Image is not ready: " + "; ".join(missing))
+ if refs and on_log:
+ on_log("[p-h3-image] reference images are not used yet (text-to-image only); rendering from the prompt")
+ mp = float(config.ph3image_mp or 8.0)
+ ratio = _ph3image_aspect(aspect)
+ results: list[dict] = []
+ ts = int(time.time() * 1000)
+ for i in range(n):
+ seed = (base_seed + i) if base_seed is not None else random.randint(0, 2**31 - 1)
+ png = output_dir / f"cand_{i:02d}_ph3image_{ts}.png"
+ metrics = output_dir / f"cand_{i:02d}_ph3image_{ts}.json"
+ cmd = [config.ph3image_python_path, config.ph3image_script_path, prompt,
+ "-o", str(png), "--root", config.ph3image_root, "--dit", config.ph3image_dit,
+ "--aspect", ratio, "--mp", f"{mp:g}", "--seed", str(seed), "--metrics", str(metrics)]
+ if on_log:
+ on_log(f"[p-h3-image] image {i + 1}/{n}: {ratio} at {mp:g} MP, seed {seed}")
+ proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True,
+ errors="replace", env=_clean_subprocess_env(), start_new_session=True)
+ _register_active_proc(proc)
+ deadline = float(os.environ.get("PHOSPHENE_PH3IMAGE_TIMEOUT_S", "3600"))
+ timed_out = {"v": False}
+
+ def _kill():
+ timed_out["v"] = True
+ try:
+ os.killpg(os.getpgid(proc.pid), 9)
+ except Exception:
+ try:
+ proc.kill()
+ except Exception:
+ pass
+
+ wd = threading.Timer(deadline, _kill)
+ wd.daemon = True
+ wd.start()
+ try:
+ if proc.stdout is not None:
+ for line in proc.stdout:
+ line = line.rstrip()
+ if line and on_log:
+ on_log(f"[p-h3-image] {line}")
+ rc = proc.wait()
+ finally:
+ wd.cancel()
+ _unregister_active_proc(proc)
+ if timed_out["v"]:
+ raise RuntimeError(f"P-H3-Image exceeded its {deadline:.0f}s deadline and was stopped")
+ if rc in (-15, 143, -9, 137):
+ raise ImageJobCancelled(f"P-H3-Image cancelled by /stop (rc={rc})")
+ if rc != 0:
+ raise RuntimeError(f"P-H3-Image failed with rc={rc}")
+ if not png.exists():
+ raise RuntimeError(f"P-H3-Image finished but no PNG at {png}")
+ info: dict = {}
+ try:
+ info = _json.loads(metrics.read_text())
+ except Exception:
+ pass
+ results.append({"png_path": str(png), "seed": seed, "engine": "p-h3-image",
+ "width": int(info.get("width") or 0), "height": int(info.get("height") or 0),
+ "seconds": float(info.get("total_seconds") or 0.0)})
+ return results
diff --git a/mlx_ltx_panel.py b/mlx_ltx_panel.py
index 2f0f061..18f0b60 100644
--- a/mlx_ltx_panel.py
+++ b/mlx_ltx_panel.py
@@ -15345,6 +15345,268 @@ def _h3_install_flex(push_log, fetch_fn=None) -> dict:
"credit": H3_FLEX_CREDIT}
+# ---- P-H3-Image (Pruna, on MiniMax H3) - Images lane -------------------------
+# An image model that is MiniMax-H3's FL2VA transformer plus a 2 GB adapter, run as one latent
+# frame over eight forwards. The weights are fetched from PrunaAI at pinned revisions (never
+# re-hosted) by the H3 engine's own scripts/fetch_ph3_image.py; the engine renders it as a
+# subprocess (image_engine.kind == "ph3image"). R&D L18, port folder ports/p-h3-image-pruna.
+PH3IMAGE_DIRNAME = "p-h3-image"
+PH3IMAGE_REPO = "PrunaAI/P-H3-Image"
+PH3IMAGE_REVISION = "7f98acef503cf2bcfba821a78cb1cf1a9928b2df"
+PH3IMAGE_COMFY_REPO = "PrunaAI/P-H3-Image-Comfy"
+PH3IMAGE_COMFY_REVISION = "44a0fb73f299da1bb715bdb5ff59ce3fd3c6f543"
+PH3IMAGE_ADAPTER_FILE = "loras/p-h3-image_lora_bf16.safetensors"
+PH3IMAGE_ADAPTER_BYTES = 1_956_195_360
+PH3IMAGE_ADAPTER_SHA256 = "0e9013ae2873e3415dcb7bb59a9677293bdbdb6f663e138a79bb9bdced00ea61"
+PH3IMAGE_ENCODER_LAST_SHARD = "text_encoder/model-00002-of-00002.safetensors"
+PH3IMAGE_ENCODER_LAST_BYTES = 3_884_897_208
+PH3IMAGE_DECODER_FILE = "vae/decoder.safetensors"
+PH3IMAGE_STEPS = 9 # sigma points; `--steps` counts points
+PH3IMAGE_FORWARDS = 8
+PH3IMAGE_DOWNLOAD_GB = 17.5 # adapter 2.0 + text encoder 8.9 + image decoder 5.6 (+1 for the original VAE while converting)
+# Peak disk while preparing: adapter 1.96 + text encoder 8.9 + the publisher's decoder 5.56 + our converted
+# decoder 4.5 = 20.9 GB (the 5.56 GB original is deleted right after); plus ~3 GB headroom.
+PH3IMAGE_DISK_NEED_GB = 24.0
+PH3IMAGE_LICENSE = "MiniMax H3 Community License"
+PH3IMAGE_NAME = "P-H3-Image"
+PH3IMAGE_LABEL = "P-H3-Image (Pruna, on MiniMax H3)"
+PH3IMAGE_CREDIT = ("P-H3-Image by Pruna AI, based on MiniMax-H3 by MiniMax "
+ "(MiniMax H3 Community License; the text encoder is based on Qwen3-VL-4B, Apache-2.0). "
+ "Powered by MiniMax H3. Fetched from Pruna's repository, never re-hosted.")
+PH3IMAGE_NOTICE = ("MiniMax H3 is licensed under the MiniMax H3 Community License Agreement, "
+ "Copyright (c) 2026 MiniMax. All Rights Reserved.")
+PH3IMAGE_TIERS = {"draft": 2.0, "standard": 4.0, "high": 8.0}
+# Peak Metal residency the pre-flight gate prices a render at. MEASURED (port bench, 4-5 Nov 2026,
+# M4 Max 64 GB, Q8 DiT + runtime adapter): 24.2 GB at 2 MP, 24.7 at 4 MP, 25.5 at 8 MP; rounded up.
+PH3IMAGE_PEAK_GB = 26.0
+# Whole-image wall seconds per tier on that Mac (model load + text + 8 forwards + decode), from the
+# same bench (ports/p-h3-image-pruna/bench/RESULT.md). The engine table starts from these and then
+# follows the user's own renders.
+PH3IMAGE_SEC_PER_IMAGE = {"draft": 75.0, "standard": 146.0, "high": 312.0}
+_ph3image_dl_lock = threading.Lock()
+_ph3image_dl_state: dict = {}
+
+
+def _ph3image_dir() -> Path:
+ """Beside the other H3 weight components."""
+ for root in _h3_model_roots():
+ if _h3_holds_dit(root):
+ return root / PH3IMAGE_DIRNAME
+ return H3_MODELS / PH3IMAGE_DIRNAME
+
+
+def _ph3image_script() -> Path:
+ return H3_ROOT / "scripts" / "generate_image.py"
+
+
+def _ph3image_fetch_script() -> Path:
+ return H3_ROOT / "scripts" / "fetch_ph3_image.py"
+
+
+def ph3image_supported() -> bool:
+ """Whether the INSTALLED H3 engine carries the image runner (feature-detected by file, so the
+ lane stays hidden until the engine pin moves)."""
+ return _ph3image_script().is_file() and _ph3image_fetch_script().is_file() \
+ and (H3_ROOT / "minimax_h3_mlx" / "ph3_image.py").is_file()
+
+
+def ph3image_paths() -> dict:
+ """What is on disk at its exact size. No glob."""
+ root = _ph3image_dir()
+
+ def _size_ok(rel: str, size: int) -> bool:
+ try:
+ return (root / rel).is_file() and (root / rel).stat().st_size == size
+ except OSError:
+ return False
+
+ missing = []
+ if not _size_ok(PH3IMAGE_ADAPTER_FILE, PH3IMAGE_ADAPTER_BYTES):
+ missing.append("the adapter")
+ if not _size_ok(PH3IMAGE_ENCODER_LAST_SHARD, PH3IMAGE_ENCODER_LAST_BYTES):
+ missing.append("the text encoder")
+ if not (root / PH3IMAGE_DECODER_FILE).is_file():
+ missing.append("the image decoder")
+ return {"dir": root, "files_ok": not missing, "missing": missing}
+
+
+def ph3image_dit_path() -> Path | None:
+ """The H3 video engine weights the adapter is applied to: the Q8 pack where it exists."""
+ choice, q8 = h3_dit_choice()
+ if q8 is not None:
+ return q8
+ return h3_paths().get("dit")
+
+
+def ph3image_status() -> dict:
+ """/status block: can the engine run it, are the files here, what does it cost."""
+ supported = ph3image_supported()
+ paths = ph3image_paths()
+ downloaded = bool(paths["files_ok"])
+ h3_ready = not h3_paths()["missing"]
+ return {
+ "available": bool(supported and downloaded and h3_ready),
+ "supported": supported,
+ "downloaded": downloaded,
+ "h3_ready": h3_ready,
+ "reason": ("h3_missing" if not h3_ready else "engine_too_old" if not supported
+ else "not_downloaded" if not downloaded else "ok"),
+ "steps": PH3IMAGE_STEPS, "forwards": PH3IMAGE_FORWARDS,
+ "tiers": dict(PH3IMAGE_TIERS),
+ "download_gb": PH3IMAGE_DOWNLOAD_GB, "disk_need_gb": PH3IMAGE_DISK_NEED_GB,
+ "repo": PH3IMAGE_REPO, "license": PH3IMAGE_LICENSE,
+ "name": PH3IMAGE_NAME, "label": PH3IMAGE_LABEL,
+ "credit": PH3IMAGE_CREDIT, "notice": PH3IMAGE_NOTICE,
+ "missing": list(paths["missing"]),
+ "install_available": bool(supported and h3_ready),
+ "installing": _ph3image_dl_state.get("status") in ("downloading", "building"),
+ "download": dict(_ph3image_dl_state),
+ }
+
+
+def ph3image_engine_config(tier: str = "high"):
+ """The image-engine config for a quality tier (draft 2 MP, standard 4 MP, high 8 MP)."""
+ py = _h3_python()
+ dit = ph3image_dit_path()
+ return agent_image_engine.ImageEngineConfig(
+ kind="ph3image",
+ ph3image_python_path=str(py) if py else "",
+ ph3image_script_path=str(_ph3image_script()),
+ ph3image_root=str(_ph3image_dir()),
+ ph3image_dit=str(dit) if dit else "",
+ ph3image_mp=float(PH3IMAGE_TIERS.get(str(tier).lower(), 8.0)),
+ )
+
+
+def ph3image_engine_rows() -> list[dict]:
+ """The three quality tiers as /image/engines rows (the Image Studio's engine table).
+
+ `sec_per_image` is the bench's measured time per tier (M4 Max 64 GB) until the user has two
+ renders of their own on a tier; then it is the mean of those, like every other image engine."""
+ status = ph3image_status()
+ need = PH3IMAGE_PEAK_GB
+ try:
+ fits, mac_gb = _image_engine_fit(need)
+ except Exception: # noqa: BLE001
+ fits, mac_gb = True, 0
+ rows = []
+ for engine, tier in (("ph3image_draft_inline", "draft"), ("ph3image_standard_inline", "standard"),
+ ("ph3image_inline", "high")):
+ sec, samples = PH3IMAGE_SEC_PER_IMAGE[tier], "bench-m4max-64gb"
+ observed = _IMG_ENGINE_TIMING.get(engine) or []
+ if len(observed) >= 2:
+ sec = round(sum(max(1.0, el / max(1, n)) for (n, el) in observed) / len(observed), 1)
+ samples = f"observed-{len(observed)}"
+ rows.append({
+ "engine": engine, "max_refs": 0, "repo_id": PH3IMAGE_REPO,
+ "cached": bool(status["downloaded"]), "ram_need_gb": round(float(need), 1),
+ "mac_gb_needed": int(mac_gb), "fits_mac": bool(fits), "partial": False, "partial_gb": 0,
+ "family_installed": bool(status["supported"] and status["h3_ready"]),
+ "download_gb": PH3IMAGE_DOWNLOAD_GB, "sec_per_image": sec, "cold_start_sec": 0.0,
+ "samples_source": samples, "gated": False, "megapixels": PH3IMAGE_TIERS[tier],
+ "license": PH3IMAGE_LICENSE, "label": PH3IMAGE_LABEL, "credit": PH3IMAGE_CREDIT,
+ # The Image Studio's chip reads these: why it cannot run yet, and the one-time download.
+ "ph3image_reason": status["reason"], "installing": bool(status["installing"]),
+ "install_error": (status["download"] or {}).get("error"),
+ "install_step": (status["download"] or {}).get("step"),
+ })
+ return rows
+
+
+def _ph3image_sidecar_credit() -> dict:
+ """What a P-H3-Image picture's sidecar records: the pinned model, adapter and credits."""
+ return {"model": f"{PH3IMAGE_REPO}@{PH3IMAGE_REVISION[:7]}",
+ "p_h3_image": {"repo": PH3IMAGE_REPO, "revision": PH3IMAGE_REVISION,
+ "adapter": f"{PH3IMAGE_COMFY_REPO}@{PH3IMAGE_COMFY_REVISION[:7]}/{PH3IMAGE_ADAPTER_FILE}",
+ "adapter_sha256": PH3IMAGE_ADAPTER_SHA256, "license": PH3IMAGE_LICENSE,
+ "credit": PH3IMAGE_CREDIT, "notice": PH3IMAGE_NOTICE}}
+
+
+def _ph3image_available() -> bool:
+ try:
+ return bool(ph3image_status()["available"])
+ except Exception: # noqa: BLE001
+ return False
+
+
+def _ph3image_fetch_bg(target_dir, push_log, runner=None) -> None:
+ """Run the engine's scripts/fetch_ph3_image.py in the H3 interpreter: pinned downloads,
+ upstream LICENSE + NOTICE beside them, decoder conversion. Resumable; it owns every digest."""
+ py = _h3_python()
+ cmd = [str(py), str(_ph3image_fetch_script()), "--dir", str(target_dir), "--accepted"]
+ try:
+ push_log(f"[image:p-h3-image] fetching {PH3IMAGE_REPO} @ {PH3IMAGE_REVISION[:7]} "
+ f"(~{PH3IMAGE_DOWNLOAD_GB:g} GB, {PH3IMAGE_LICENSE})")
+ proc = (runner or subprocess.Popen)(
+ cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True,
+ errors="replace", env=_h3_v13_fetch_env())
+ tail: list[str] = []
+ for line in proc.stdout:
+ line = line.rstrip()
+ if line:
+ tail = (tail + [line])[-6:]
+ _ph3image_dl_state.update(step=line[:160])
+ if line.startswith("decoder converting"):
+ _ph3image_dl_state.update(status="building")
+ rc = proc.wait()
+ if rc != 0:
+ raise RuntimeError(" | ".join(tail) or f"fetch exited with {rc}")
+ _ph3image_dl_state.clear()
+ _ph3image_dl_state.update(status="done", error=None)
+ push_log("[image:p-h3-image] downloaded and ready")
+ except Exception as exc: # noqa: BLE001
+ _ph3image_dl_state.clear()
+ _ph3image_dl_state.update(status="error", error=str(exc)[:400])
+ push_log(f"[image:p-h3-image] download failed: {exc}")
+ finally:
+ h3_status_invalidate()
+
+
+def _ph3image_install(push_log, fetch_fn=None) -> dict:
+ """On-demand fetch of P-H3-Image (one at a time). The route has already checked the licence."""
+ paths = h3_paths()
+ if paths["missing"]:
+ return {"ok": False,
+ "error": "P-H3-Image runs on the Hailuo H3 pack, and H3 isn't fully installed yet: "
+ + "; ".join(paths["missing"])}
+ if not ph3image_supported():
+ return {"ok": False,
+ "error": _dist.say(
+ "This Hailuo H3 runner predates P-H3-Image. Run 'Update Hailuo H3 runner' from the "
+ "Phosphene sidebar in Pinokio - your weights stay.",
+ "This Hailuo H3 runner predates P-H3-Image. Updating the runner isn't available "
+ "in the Mac app yet.")}
+ resolved = ph3image_paths()
+ target = resolved["dir"]
+ if resolved["files_ok"]:
+ return {"ok": True, "started": False, "already_installed": True, "dir": str(target)}
+ with _ph3image_dl_lock:
+ if _ph3image_dl_state.get("status") in ("downloading", "building"):
+ return {"ok": False, "error": "a P-H3-Image download is already active"}
+ try:
+ target.mkdir(parents=True, exist_ok=True)
+ free_gb = shutil.disk_usage(target).free / 1e9
+ except OSError:
+ free_gb = None
+ # What is already in the folder (a resumed or partial download) counts against the need.
+ try:
+ have_gb = sum(f.stat().st_size for f in target.rglob("*") if f.is_file()) / 1e9
+ except OSError:
+ have_gb = 0.0
+ need_gb = max(4.0, PH3IMAGE_DISK_NEED_GB - have_gb)
+ if free_gb is not None and free_gb < need_gb:
+ return {"ok": False,
+ "error": f"P-H3-Image needs about {need_gb:.0f} GB free to finish preparing "
+ f"({PH3IMAGE_DOWNLOAD_GB:g} GB download in all). This disk has {free_gb:.1f} GB free."}
+ _ph3image_dl_state.clear()
+ _ph3image_dl_state.update(status="downloading", error=None)
+ fn = fetch_fn or _ph3image_fetch_bg
+ threading.Thread(target=fn, args=(target, push_log), daemon=True, name="ph3image-fetch").start()
+ return {"ok": True, "started": True, "dir": str(target), "repo": PH3IMAGE_REPO,
+ "revision": PH3IMAGE_REVISION, "license": PH3IMAGE_LICENSE, "credit": PH3IMAGE_CREDIT,
+ "download_gb": PH3IMAGE_DOWNLOAD_GB}
+
+
# ---- lightx2v v1.3 (Best at High) — resolver, argv, status, fetch ------------
def h3_supports_video_shift() -> bool:
"""Whether the INSTALLED runner takes `--video-shift` (v1.3's own shift 6;
@@ -17432,6 +17694,8 @@ def h3_status() -> dict:
"name": H3_V13_NAME, "label": H3_V13_LABEL, "credit": H3_V13_CREDIT,
"adapter": None, "install_available": False, "installing": False,
"download": {}, "dir": str(_h3_turbo_dir()), "missing": []}),
+ # P-H3-Image (Images lane). Its own block: the lane needs the H3 pack but is not a video choice.
+ "ph3image": ph3image_status(),
# Pika H3 Flex — a Speed choice of its own. Same three-cause shape.
"flex": (h3_flex_status() if available else
{"available": False, "supported": False, "downloaded": False,
@@ -33821,6 +34085,10 @@ def make_job(form: dict[str, list[str]] | dict[str, str], *,
if engine_override.startswith("hidream") and not _hidream_available():
push(f"[image] {engine_override} is not installed on this Mac — rendering with Auto instead.")
engine_override = "auto"
+ if engine_override.startswith("ph3image") and not _ph3image_available():
+ push(f"[image] {engine_override} is not ready on this Mac (it needs the Hailuo H3 pack and its "
+ "own download) - rendering with Auto instead.")
+ engine_override = "auto"
aspect = f("aspect", "16:9") or "16:9"
# refs comes as a JSON-encoded list (e.g. '["panel_uploads/foo.png"]').
# Plain form fields can't carry a list cleanly; the panel JS already
@@ -35149,6 +35417,8 @@ def _preflight_estimate_ram_gb(cfg) -> float:
if cfg.kind == "flux3":
import flux3_engine
return flux3_engine.ram_need(cfg)
+ if cfg.kind == "ph3image":
+ return PH3IMAGE_PEAK_GB
if cfg.kind == "hidream":
# 2026-05-31 review fix: HiDream-O1 BF16 was exempt from the RAM gate
# (fell through to the 1.0 GB `!= mflux` branch). Its Metal residency
@@ -35284,6 +35554,9 @@ _IMAGE_ENGINE_LABELS = {
"hidream_fast_inline": "HiDream Fast",
"hidream_inline": "HiDream Medium",
"hidream_quality_inline": "HiDream Quality",
+ "ph3image_inline": "P-H3-Image (High, 8 MP)",
+ "ph3image_standard_inline": "P-H3-Image (Standard, 4 MP)",
+ "ph3image_draft_inline": "P-H3-Image (Draft, 2 MP)",
}
# Fleet Mac sizes, for "needs a 32 GB Mac" copy. The pre-flight compares
@@ -35349,6 +35622,12 @@ def _preflight_image_job(cfg, *, engine_override: str = "auto") -> None:
# with "HiDream venv python not found", counted as a failed render: 81
# times from 12 installs in the week to 2026-09-09. Say no at the door,
# as a refusal, with the engine that does the same job.
+ if str(engine_override or "").lower().startswith("ph3image") and not _ph3image_available():
+ raise RenderRefused(
+ "pack_missing",
+ "P-H3-Image isn't ready on this Mac: it runs on the Hailuo H3 pack and needs its own "
+ "download. Pick it in Image Studio and click its download chip, or use FLUX 3 Klein "
+ "to make a picture from text now.")
if str(engine_override or "").lower().startswith("hidream") and not _hidream_available():
raise RenderRefused(
"pack_missing",
@@ -35689,6 +35968,7 @@ def run_image_job_inner(job: dict) -> None:
"refs_ignored": c.get("refs_ignored", False),
"source": "panel.queue.image",
**({"flux3": c} if cfg.kind == "flux3" else {}),
+ **(_ph3image_sidecar_credit() if cfg.kind == "ph3image" else {}),
}
try:
sidecar_path.write_text(json.dumps(sidecar, indent=2), encoding="utf-8")
@@ -35704,7 +35984,8 @@ def run_image_job_inner(job: dict) -> None:
p["candidate_paths"] = candidate_paths
p["elapsed_seconds"] = elapsed
p["engine"] = cfg.kind + (f"/{cfg.mflux_family}" if cfg.kind == "mflux" else "")
- p["model"] = getattr(cfg, "mflux_model", None) or cfg.kind
+ p["model"] = (f"{PH3IMAGE_REPO}@{PH3IMAGE_REVISION[:7]}" if cfg.kind == "ph3image"
+ else getattr(cfg, "mflux_model", None) or cfg.kind)
p["output_dir"] = str(out_dir)
push(f"Image job done: {len(candidate_paths)} candidate(s) in {elapsed}s "
f"→ {out_dir}")
@@ -43397,6 +43678,11 @@ def _build_image_engine_config(
hidream_fb_threshold=0.10,
hidream_fb_keep_last=12,
)
+ if engine_override in ("ph3image_inline", "ph3image_draft_inline", "ph3image_standard_inline"):
+ # P-H3-Image: High = 8 MP (what it was trained for), Standard 4 MP, Draft 2 MP.
+ return ph3image_engine_config(
+ "draft" if engine_override == "ph3image_draft_inline"
+ else "standard" if engine_override == "ph3image_standard_inline" else "high")
if engine_override == "mock_inline":
return agent_image_engine.ImageEngineConfig(kind="mock")
raise ValueError(f"unknown engine_override: {engine_override!r}")
diff --git a/model_licences.py b/model_licences.py
index d696518..0fb21a9 100644
--- a/model_licences.py
+++ b/model_licences.py
@@ -322,6 +322,8 @@ def licence_for_image_cfg(cfg) -> str | None:
"""The licence an image-engine config needs, from its mflux family/model."""
if cfg is not None and getattr(cfg, "kind", "") == "flux3":
return "flux3"
+ if cfg is not None and getattr(cfg, "kind", "") == "ph3image":
+ return "h3" # a MiniMax H3 Model Derivative: the same screen as H3 itself
if cfg is None or getattr(cfg, "kind", "") != "mflux":
return None
family = str(getattr(cfg, "mflux_family", "") or "").lower()
diff --git a/panel/routes_image.py b/panel/routes_image.py
index 35dccff..d4969d3 100644
--- a/panel/routes_image.py
+++ b/panel/routes_image.py
@@ -395,6 +395,7 @@ def get_image_engine_status(h, parsed) -> None:
out.extend({**flux3_engine.status(key, float(P.SYSTEM_RAM_GB or 0)),
"max_refs": P.image_max_refs(key)}
for key in flux3_engine.PRESETS)
+ out.extend(P.ph3image_engine_rows())
h._json({"engines": out,
"host_ram_gb": int(round(float(P.SYSTEM_RAM_GB or 0)))})
except Exception as exc: # noqa: BLE001
@@ -489,6 +490,22 @@ def post_h3_flex_install(h, path, qs, ctype) -> None:
return
h._json(result, 202)
+# ====== Images lane · P-H3-Image (Pruna, on MiniMax H3) - fetch Pruna's adapter, text encoder and
+# image decoder at pinned revisions (never re-hosted) and build the decoder layout locally.
+@post("/image/ph3image/install")
+def post_image_ph3image_install(h, path, qs, ctype) -> None:
+ P.h3_status_invalidate()
+ # A MiniMax H3 Model Derivative: the same licence screen as H3 itself.
+ _lic = P.licence_refusal_for("h3")
+ if _lic:
+ h._json(_lic, 451); return
+ result = P._ph3image_install(P.push)
+ if not result.get("ok"):
+ h._json(result, 409 if "active" in result.get("error", "") else 400)
+ return
+ h._json(result, 202)
+
+
# Image-engine config (pluggable: mock | bfl).
@post("/agent/image/config")
def post_agent_image_config(h, path, qs, ctype) -> None:
@@ -935,6 +952,7 @@ def post_image_generate(h, path, qs, ctype) -> None:
"candidates": candidates,
"elapsed_seconds": elapsed,
"engine": cfg.kind + (f"/{cfg.mflux_family}" if cfg.kind == "mflux" else ""),
- "model": getattr(cfg, "mflux_model", None) or cfg.kind,
+ "model": (f"{P.PH3IMAGE_REPO}@{P.PH3IMAGE_REVISION[:7]}" if cfg.kind == "ph3image"
+ else getattr(cfg, "mflux_model", None) or cfg.kind),
"output_dir": str(out_dir),
})
diff --git a/scripts/pinokio/h3_checkout.sh b/scripts/pinokio/h3_checkout.sh
index 123250e..96379c8 100755
--- a/scripts/pinokio/h3_checkout.sh
+++ b/scripts/pinokio/h3_checkout.sh
@@ -36,8 +36,8 @@
# keeps its H3 step optional: scripts/post_update.sh runs this file through
# `defang`, which turns the FATAL line into a WARN and never ends the Update.
set -u
-H3_PIN_SHA="bef6d03c5545fe9dc38400ad2c52edd958e3b2d4"
-H3_PIN_REF="phosphene/v4.19.15"
+H3_PIN_SHA="4df59c71629d6c65a6473fee822ae498f66922d0"
+H3_PIN_REF="phosphene/v4.19.19-image"
H3_LOCAL_BRANCH="phosphene-pinned"
H3_URL="https://github.com/mrbizarro/minimax-h3-mlx.git"
H3_DIR="${1:-}"
diff --git a/webapp/docs/images.md b/webapp/docs/images.md
index 0bda9dd..277e218 100644
--- a/webapp/docs/images.md
+++ b/webapp/docs/images.md
@@ -1,6 +1,6 @@
# Images
-The Images tab makes stills. Two kinds of engine live here: **Reference Edit**, which reworks an image you give it, and **Ideogram 4**, which puts words on a picture.
+The Images tab makes stills. Engines here: **Reference Edit**, which reworks an image you give it, **Ideogram 4**, which puts words on a picture, **FLUX 3 Klein**, and **P-H3-Image**, which makes large photographs and posters from words alone.
## Choosing the engine {#engines}
@@ -11,6 +11,7 @@ The Images tab makes stills. Two kinds of engine live here: **Reference Edit**,
| **Reference Edit — Standard** | 8 steps, about 2:05, no LoRA |
| **Reference Edit — Quality** | 40 steps, about 3:50 — for final renders |
| **Ideogram 4 — typography & layout** | text in the image, with an optional reference |
+| **P-H3-Image** (Draft / Standard / High) | big photographs, film frames and posters from text, words spelled right; about 2.5 min at 4 MP |
The pill next to the menu says whether that engine is downloaded. An engine that needs more memory than this Mac has is greyed out and labelled *needs a N GB Mac*.
@@ -53,3 +54,21 @@ Q8 is the recommended quality. Q6 uses less memory; Q4 supports 24 GB Macs with
The model uses the FLUX Kommunity License, separate from the app's MIT licence. Read and accept it on first use. Commercial output generation is permitted for users below USD 5 million gross annualized revenue including affiliates, subject to the full terms. Review images before sharing them and make any legally required AI disclosures.
Your images appear in the gallery. Choose **Animate** to send one to image-to-video. FLUX.1 and Qwen LoRAs cannot be used with this model.
+
+## P-H3-Image — large images from text, on MiniMax H3 {#p-h3-image}
+
+P-H3-Image is Pruna AI's image model, built on MiniMax H3, the same model behind Hailuo H3 video. It makes one picture from a text prompt in 8 steps, with nothing to tune. It is strongest at photographs, film frames, crowds and posters whose quoted words must be spelled exactly. Hands and very small faces in the background can still go wrong. It does not use reference images yet: anything in the slots is ignored.
+
+Pick a size in **Engine**:
+
+| Choice | Size | Time on an M4 Max, 64 GB |
+|---|---|---|
+| **P-H3-Image** (Standard) | 4 megapixels, e.g. 2368×1760 | about 2.5 min |
+| **P-H3-Image Draft** | 2 megapixels | about 1.3 min |
+| **P-H3-Image High** | 8 megapixels, e.g. 3360×2496 | about 5 min |
+
+**Aspect** sets the shape; the size comes from the choice. It needs about 26 GB of free memory, so a Mac with 48 GB or more.
+
+**First use.** It runs on the Hailuo H3 video pack, so install Hailuo H3 first. Then the chip next to **Engine** reads *download ~18 GB*: click it. Phosphene shows the MiniMax H3 licence, then downloads P-H3-Image's own parts (adapter, text encoder, image decoder) once, from Pruna's repository at a pinned version, and checks every file. It needs about 24 GB free on the disk while it prepares, and keeps about 15 GB. The chip says *ready* when it is done. If it reads *update the H3 runner*, update Hailuo H3 first (your weights stay).
+
+*P-H3-Image by Pruna AI, based on MiniMax-H3 by MiniMax, under the MiniMax H3 Community License; its text encoder is based on Qwen3-VL-4B (Apache-2.0). Powered by MiniMax H3. Fetched from Pruna's repository, never re-hosted; the only change made on your Mac is re-arranging the image decoder's tensors for the MLX runner (renamed and re-fused, values unchanged), noted inside the file. MiniMax H3 is licensed under the MiniMax H3 Community License Agreement, Copyright (c) 2026 MiniMax. All Rights Reserved.*
diff --git a/webapp/index.html b/webapp/index.html
index 35e820e..7887990 100644
--- a/webapp/index.html
+++ b/webapp/index.html
@@ -2631,6 +2631,11 @@ The same wizard walks out of frame. Audio: footsteps on leaves."></textarea>
<option value="hidream_fast_inline" hidden>HiDream Fast (3-step, ~3:45 / 4-img batch, slight bg softness)</option>
<option value="hidream_inline" hidden>HiDream Medium (6-step + FBCache, ~6 min / 4-img batch, character-preserving)</option>
<option value="hidream_quality_inline" hidden>HiDream Quality (12-step + light FBCache, ~9 min / 4-img batch, best detail)</option>
+ <!-- P-H3-Image (Pruna, on MiniMax H3), port L18. Times measured on an M4 Max 64 GB
+ (ports/p-h3-image-pruna/bench/RESULT.md). Free (owner, card 296). -->
+ <option value="ph3image_standard_inline">P-H3-Image &mdash; exact text in images (4 MP, ~2.5 min, on MiniMax H3)</option>
+ <option value="ph3image_draft_inline">P-H3-Image Draft (2 MP, ~1.3 min)</option>
+ <option value="ph3image_inline">P-H3-Image High (8 MP, ~5 min)</option>
<option value="mock_inline" id="imgStudioMockOption" hidden>Mock (testing — debug only)</option>
</select>
<span class="engine-status-pill" id="imgStudioEnginePill"
diff --git a/webapp/js/stage.js b/webapp/js/stage.js
index b0d6c5b..d043140 100644
--- a/webapp/js/stage.js
+++ b/webapp/js/stage.js
@@ -36,7 +36,10 @@ function imgStudioUpdateValidity() {
// the job die deep in the helper with a buried error.
const engInfo = (typeof _IMG_ENGINE_STATUS === 'object' && _IMG_ENGINE_STATUS)
? _IMG_ENGINE_STATUS[eng.value] : null;
- if (engInfo && engInfo.family_installed === false) {
+ const ph3Why = (eng.value.startsWith('ph3image') && engInfo) ? ph3imageNotReady(engInfo) : '';
+ if (ph3Why) {
+ invalidReason = ph3Why;
+ } else if (engInfo && engInfo.family_installed === false) {
// The install-gate is generic across mflux engines; the human-readable
// add-on name differs per family. Ideogram 4 ships as part of mflux
// 0.18+, so its "missing" case is really "update mflux", not a Qwen hint.
@@ -388,6 +391,12 @@ function imgStudioRenderEnginePill() {
if (!pill || !eng) return;
try { ideoUpdateSetupNote(); } catch (_) {}
const v = eng.value;
+ if (!v.startsWith('ph3image')) {
+ // A P-H3-Image chip state must never leak to another engine's chip (a stale "download"
+ // flag would start an 18 GB download from someone else's chip).
+ pill.dataset.ph3 = '';
+ if (_PH3IMAGE_POLL) { clearInterval(_PH3IMAGE_POLL); _PH3IMAGE_POLL = null; }
+ }
// 'auto' resolves to whatever the user saved in Settings — we don't try
// to second-guess that here, just show a neutral pill.
if (v === 'auto') {
@@ -403,6 +412,9 @@ function imgStudioRenderEnginePill() {
pill.title = 'Checking weights…';
return;
}
+ if (v.startsWith('ph3image') && info.ph3image_reason) {
+ if (ph3imageRenderPill(pill, info)) return;
+ }
// Family-install gate (issue #12): the mflux family binary itself
// needs to be installed BEFORE the user can submit. Distinct from
// the weights-cached check below, which is about HF model downloads.
@@ -555,8 +567,76 @@ function imgStudioMarkRecentInUse() {
// pre-emptive `hf download` here: the queue worker already triggers one
// on first render, and a separate code path would risk drift between the
// prefetch + render configs.)
+// ---- P-H3-Image (Pruna, on MiniMax H3): its own one-time download -------------
+// The weights are fetched from Pruna's repository at pinned revisions by the H3 engine
+// (POST /image/ph3image/install, licence-gated: the fetch wrapper shows the MiniMax H3
+// licence on a 451). The chip says what is missing in plain words and starts the download.
+function ph3imageNotReady(info) {
+ const r = info.ph3image_reason;
+ if (info.installing) return 'P-H3-Image is downloading (about 18 GB, once). Generate unlocks when it is done.';
+ if (r === 'h3_missing') return 'P-H3-Image runs on the Hailuo H3 video pack. Install Hailuo H3 first, then come back.';
+ if (r === 'engine_too_old') return distText('P-H3-Image needs the newer Hailuo H3 runner: click "Update Hailuo H3 runner" in Pinokio\'s Phosphene sidebar (your weights stay).',
+ 'P-H3-Image needs a newer Hailuo H3 runner than this Mac app has.');
+ if (r === 'not_downloaded') return 'P-H3-Image needs its one-time download (about 18 GB from Pruna). Click the download chip next to Engine.';
+ return '';
+}
+
+let _PH3IMAGE_POLL = null;
+function ph3imageRenderPill(pill, info) {
+ const warn = '<svg class="ph" aria-hidden="true" style="margin-right:4px;vertical-align:-2px"><use href="#ph-warning-bold"/></svg>';
+ const dl = '<svg class="ph" aria-hidden="true" style="margin-right:4px;vertical-align:-2px"><use href="#ph-download-simple"/></svg>';
+ const r = info.ph3image_reason;
+ pill.dataset.ph3 = '';
+ if (info.installing) {
+ pill.dataset.state = 'missing';
+ pill.dataset.ph3 = 'downloading';
+ pill.innerHTML = dl + 'downloading…';
+ pill.title = (info.install_step ? 'Now: ' + info.install_step + '\n' : '') + (info.credit || '');
+ if (!_PH3IMAGE_POLL) _PH3IMAGE_POLL = setInterval(() => { imgStudioRefreshEngineStatus(); }, 5000);
+ return true;
+ }
+ if (_PH3IMAGE_POLL) { clearInterval(_PH3IMAGE_POLL); _PH3IMAGE_POLL = null; }
+ if (r === 'h3_missing' || r === 'engine_too_old') {
+ pill.dataset.state = 'missing-engine';
+ pill.innerHTML = warn + (r === 'h3_missing' ? 'needs Hailuo H3' : 'update the H3 runner');
+ pill.title = ph3imageNotReady(info);
+ return true;
+ }
+ if (r === 'not_downloaded') {
+ pill.dataset.state = 'missing';
+ pill.dataset.ph3 = 'download';
+ pill.innerHTML = dl + (info.install_error ? 'download failed: try again' : 'download ~' + Math.round(info.download_gb || 18) + ' GB');
+ pill.title = (info.install_error ? 'Last try: ' + info.install_error + '\n' : '')
+ + 'Click to download P-H3-Image once from Pruna (pinned and checked, never re-hosted).\n' + (info.credit || '');
+ return true;
+ }
+ return false; // ready: the generic "ready" chip below
+}
+
+async function ph3imageInstall() {
+ const s = document.getElementById('imgStudioStatus');
+ try {
+ const r = await fetch('/image/ph3image/install', { method: 'POST' });
+ const j = await r.json().catch(() => ({}));
+ if (!r.ok || j.ok === false) {
+ if (s) s.textContent = (j && (j.error || j.message)) || ('Download did not start (HTTP ' + r.status + ').');
+ } else if (s) {
+ s.textContent = j.already_installed ? 'P-H3-Image is already downloaded.' : 'Downloading P-H3-Image from Pruna (about 18 GB, once)…';
+ }
+ } catch (e) {
+ if (s) s.textContent = 'Download did not start: ' + e.message;
+ }
+ imgStudioRefreshEngineStatus();
+}
+
function imgStudioOnPillClick() {
const pill = document.getElementById('imgStudioEnginePill');
+ if (pill && pill.dataset.ph3 === 'download') { ph3imageInstall(); return; }
+ if (pill && pill.dataset.ph3 === 'downloading') {
+ const st = document.getElementById('imgStudioStatus');
+ if (st) st.textContent = 'P-H3-Image is still downloading (about 18 GB, once). Generate unlocks when it is done.';
+ return;
+ }
if (!pill || pill.dataset.state !== 'missing') return;
const btn = document.getElementById('imgStudioGenBtn');
if (!btn) return;