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.

feat(panel): finish agent UI rip-out + larger OKLCh wordmark gradient

mrbizarro702986ec3632
diff --git a/mlx_ltx_panel.py b/mlx_ltx_panel.py
index add0cb7..221ebd6 100644
--- a/mlx_ltx_panel.py
+++ b/mlx_ltx_panel.py
@@ -15145,9 +15145,14 @@ HTML = r"""<!doctype html>
--ph-border-soft: rgba(140, 160, 220, 0.08);
--ph-border-strong: rgba(140, 160, 220, 0.16);
--ph-text-faint: #5b6478;
- --ph-grad-pink: #ff3d8a;
- --ph-grad-magenta: #ff5fa8;
- --ph-grad-cyan: #4fd6ff;
+ /* 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
+ pink which made the gradient look muddy when scaled up. */
+ --ph-grad-pink: #FF2E9F;
+ --ph-grad-purple: #B14AFF;
+ --ph-grad-magenta: #B14AFF; /* alias for backward compat */
+ --ph-grad-cyan: #5EEAFF;
--ph-font-mono: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, monospace;
}
@@ -15204,20 +15209,29 @@ HTML = r"""<!doctype html>
}
body > header .brand::after {
content: 'Phosphene';
- background: linear-gradient(92deg, var(--ph-grad-pink) 0%, var(--ph-grad-magenta) 45%, var(--ph-grad-cyan) 100%);
+ /* Perceptual gradient: pink → cyan through OKLCh color space. RGB
+ interpolation produces muddy brown/grey mid-tones at large sizes;
+ OKLCh stays on the saturated hue ring (pink → magenta → purple →
+ blue-purple → cyan), which is what reads as a "real" gradient.
+ 5-stop fallback for older browsers; modern ones (Safari 16.4+,
+ Chrome 111+) use the in-oklch override below. */
+ background: linear-gradient(92deg,
+ #FF2E9F 0%,
+ #E135C2 25%,
+ #B14AFF 50%,
+ #7777FF 75%,
+ #5EEAFF 100%);
+ background: linear-gradient(in oklch 92deg, #FF2E9F, #5EEAFF);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
font-weight: 700;
- font-size: 28px;
- letter-spacing: -0.015em;
- /* Subtle text shadow to give the wordmark the same lifted feel
- as the icon. Sits behind the gradient via the painted text
- color being transparent — the shadow shows through the
- transparent glyphs as a faint halo. */
+ font-size: 44px;
+ letter-spacing: -0.02em;
+ /* Halo glow matching the gradient endpoints. */
text-shadow:
- 0 0 18px rgba(255, 95, 168, 0.28),
- 0 0 6px rgba(79, 214, 255, 0.18);
+ 0 0 24px rgba(255, 46, 159, 0.32),
+ 0 0 10px rgba(94, 234, 255, 0.22);
}
/* Hide the existing version-badge styling and re-render it Linear-style
(mono "v2.0" in a chip). Keep the element so the JS doesn't break. */
@@ -17602,276 +17616,8 @@ HTML = r"""<!doctype html>
localStorage so the user lands on the same tab next session. -->
<nav class="workflow-tabs" id="workflowTabs">
<button data-workflow="manual" class="active">Manual</button>
- <button data-workflow="agent">Agentic Flows<span class="new-badge">NEW</span></button>
<button data-workflow="train">Train<span class="new-badge">NEW</span></button>
</nav>
-
- <!-- ============== AGENT SESSIONS SIDEBAR ============== -->
- <!-- Slides in from the left. Overlay by default (dims chat); pin
- button turns it inline (chat reflows, padding-left: 280px).
- Cmd/Ctrl+K toggles, Esc closes (when not pinned). All
- interaction goes through aspToggle / aspOpen / aspClose / aspLoad.
- Lives outside .agent-pane so its transform can't smear chat. -->
- <aside class="agent-sessions-panel" id="agentSessionsPanel"
- data-state="closed" aria-hidden="true">
- <header class="asp-head">
- <div class="asp-title">Sessions</div>
- <button class="asp-icon" id="aspPinBtn" onclick="aspTogglePin()" title="Pin sidebar (keeps it open)">
- <svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
- <line x1="12" y1="2" x2="12" y2="9"/>
- <line x1="12" y1="20" x2="12" y2="22"/>
- <path d="M7 9h10v3a5 5 0 0 1-5 5 5 5 0 0 1-5-5z"/>
- </svg>
- </button>
- <button class="asp-icon" onclick="aspClose()" title="Close (Esc)">
- <svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
- <line x1="18" y1="6" x2="6" y2="18"/>
- <line x1="6" y1="6" x2="18" y2="18"/>
- </svg>
- </button>
- </header>
- <div class="asp-search">
- <svg class="asp-search-icon" viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
- <circle cx="11" cy="11" r="7"/>
- <line x1="21" y1="21" x2="16.65" y2="16.65"/>
- </svg>
- <input id="aspSearchInput" placeholder="Search sessions…" autocomplete="off" />
- <kbd class="asp-kbd">/</kbd>
- </div>
- <div class="asp-list" id="aspList" tabindex="0"></div>
- <div class="asp-empty" id="aspEmpty" hidden>
- <div class="asp-empty-title">No sessions yet</div>
- <div class="asp-empty-hint">Type a prompt to start your first one.</div>
- </div>
- </aside>
- <div class="asp-backdrop" id="aspBackdrop" hidden onclick="aspClose()"></div>
-
- <!-- ============== AGENTIC FLOWS PANE ============== -->
- <!-- Chat-driven shot planner. The agent loop lives in the panel's
- Python backend (agent/runtime.py); this UI just sends user
- messages, renders the message log with markdown + expandable
- tool cards, and exposes engine settings via a drawer. -->
- <section class="agent-pane" id="agentPane" hidden>
- <header class="agent-header" style="position:relative">
- <!-- Sessions trigger — explicit, labelled, with a count chip.
- Replaces the old "click-the-title-to-open-popover" pattern
- which was undiscoverable. Also bound to Cmd+K / Ctrl+K
- from anywhere on the page. -->
- <button type="button" class="asp-trigger" id="aspTriggerBtn"
- onclick="aspToggle()"
- title="Sessions (Cmd+K)">
- <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
- <line x1="3" y1="6" x2="21" y2="6"/>
- <line x1="3" y1="12" x2="21" y2="12"/>
- <line x1="3" y1="18" x2="14" y2="18"/>
- </svg>
- <span>Sessions</span>
- <span class="asp-trigger-count" id="aspTriggerCount" hidden>0</span>
- </button>
- <button type="button" class="engine-pill" id="agentEnginePill"
- onclick="openAgentSettings()" title="Click to configure the agent engine">
- <span class="dot" id="agentEngineDot"></span>
- <span id="agentEngineLabel">engine…</span>
- </button>
- <!-- Mode toggle: Plan-and-sleep (default) vs Interactive. In Plan
- & sleep, the local engine auto-stops the moment the agent
- finishes its plan, freeing 20+ GB so the LTX renderer can
- use the full memory budget overnight. -->
- <button type="button" class="agent-mode-pill" id="agentModePill"
- onclick="agentToggleMode()"
- title="Plan & sleep: auto-stop the chat model after the agent finishes (frees RAM for renders).&#10;Click to switch to Interactive mode.">
- <span class="agent-mode-icon" id="agentModeIcon"></span>
- <span id="agentModeLabel">Plan & sleep</span>
- </button>
- <!-- Quick "stop engine" — only shown when the local engine is
- running. One-click way to free RAM mid-batch without going
- through the Settings drawer. -->
- <button type="button" class="agent-engine-stop" id="agentEngineStopBtn"
- onclick="agentEngineStopNow()"
- title="Stop the local chat model now to free RAM"
- hidden>
- <svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
- <rect x="6" y="6" width="12" height="12" rx="1.5"/>
- </svg>
- <span>Stop engine</span>
- </button>
- <!-- Headroom chip — shows how much RAM is left right now AND
- whether the configured chat model would fit. The single
- clearest signal "can I run the agent right now?" — so the
- user doesn't have to do mental math while a render is on. -->
- <span class="agent-ram-chip" id="agentRamChip"
- title="Free RAM right now and whether the chat model fits.">
- <span class="agent-ram-dot"></span>
- <span id="agentRamLabel">RAM …</span>
- </span>
- <div class="session-title" id="agentSessionTitle"
- title="Current session">
- New chat
- </div>
- <button type="button" class="icon-btn" onclick="agentNewSession()"
- title="Start a fresh session">
- <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
- <line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/>
- </svg>
- </button>
- <a class="icon-btn" id="agentPopOutBtn"
- href="/" target="_blank" rel="noopener"
- onclick="agentPopOutFlagsBeforeNavigate()"
- title="Open in your default browser (true OS fullscreen — escapes Pinokio's sidebar)">
- <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
- <path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/>
- <polyline points="15 3 21 3 21 9"/>
- <line x1="10" y1="14" x2="21" y2="3"/>
- </svg>
- </a>
- <button type="button" class="icon-btn" id="agentFullscreenBtn"
- onclick="agentToggleFullscreen()" title="Expand to fullscreen (Esc to exit)">
- <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" id="agentFullscreenIconExpand">
- <polyline points="15 3 21 3 21 9"/>
- <polyline points="9 21 3 21 3 15"/>
- <line x1="21" y1="3" x2="14" y2="10"/>
- <line x1="3" y1="21" x2="10" y2="14"/>
- </svg>
- <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" id="agentFullscreenIconCollapse" style="display:none">
- <polyline points="4 14 10 14 10 20"/>
- <polyline points="20 10 14 10 14 4"/>
- <line x1="14" y1="10" x2="21" y2="3"/>
- <line x1="3" y1="21" x2="10" y2="14"/>
- </svg>
- </button>
- <button type="button" class="icon-btn" onclick="openAgentCaps()" title="What can the agent do? · type /help in chat" aria-label="Show agent capabilities">
- <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
- <circle cx="12" cy="12" r="10"></circle>
- <path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"></path>
- <line x1="12" y1="17" x2="12.01" y2="17"></line>
- </svg>
- </button>
- <button type="button" class="icon-btn" onclick="openProjectNotes()" title="Project notes — persistent memory across sessions">
- <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
- <path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"/>
- <polyline points="14 2 14 8 20 8"/>
- <line x1="9" y1="13" x2="15" y2="13"/>
- <line x1="9" y1="17" x2="15" y2="17"/>
- </svg>
- </button>
- <button type="button" class="icon-btn" onclick="openAgentSettings()" title="Settings">
- <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
- <circle cx="12" cy="12" r="3"></circle>
- <path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"></path>
- </svg>
- </button>
- </header>
-
- <!-- Phase 0 #0.11 — engine readiness banner. Filled in by
- agentCheckEngine() on init + after settings save. Sticky on
- warn/err; auto-dismisses on green ok. -->
- <div id="agentEngineBanner" class="agent-engine-banner" hidden role="status" aria-live="polite">
- <div class="agent-engine-banner-text">
- <span class="agent-engine-banner-icon" id="agentEngineBannerIcon"><svg class="ph" aria-hidden="true"><use href="#ph-check-bold"/></svg></span>
- <span class="agent-engine-banner-title" id="agentEngineBannerTitle">Engine</span>
- <span class="agent-engine-banner-detail" id="agentEngineBannerDetail">…</span>
- </div>
- <div class="agent-engine-banner-actions">
- <button type="button" class="agent-engine-banner-btn" id="agentEngineBannerAction"
- onclick="openAgentSettings()">Open Settings</button>
- <button type="button" class="agent-engine-banner-close" onclick="agentEngineBannerHide(true)" aria-label="Dismiss">
- <svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round">
- <line x1="18" y1="6" x2="6" y2="18"/>
- <line x1="6" y1="6" x2="18" y2="18"/>
- </svg>
- </button>
- </div>
- </div>
-
- <div class="agent-chat-wrap">
- <div class="agent-chat" id="agentChat" role="log" aria-live="polite" aria-relevant="additions" aria-label="Agent chat thread"></div>
- <!-- "↓ new messages" pill — appears when content lands while the
- user has scrolled up to read something. Clicking jumps to
- bottom and re-arms auto-scroll. -->
- <button type="button" class="agent-newmsgs-pill" id="agentNewMsgsPill"
- onclick="agentScrollChatToBottom()" hidden>
- <svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round">
- <line x1="12" y1="5" x2="12" y2="19"/>
- <polyline points="19 12 12 19 5 12"/>
- </svg>
- <span>New messages</span>
- </button>
- </div>
-
- <div class="agent-composer">
- <!-- Batch-now bar: surfaces when the user has picked anchors that
- haven't yet been queued. One click injects a structured message
- telling the agent to submit each pick as i2v with the durations
- it already proposed. The agent's existing prompt covers the
- phrasing; we just trigger it. -->
- <div class="agent-batch-bar" id="agentBatchBar" hidden>
- <div class="agent-batch-bar-text">
- <span class="agent-batch-bar-icon"><svg class="ph" aria-hidden="true"><use href="#ph-sparkle-fill"/></svg></span>
- <span id="agentBatchBarSummary">…</span>
- </div>
- <button type="button" class="agent-batch-bar-btn"
- onclick="agentBatchQueue()">
- <span>Queue them</span>
- <svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
- <line x1="5" y1="12" x2="19" y2="12"/>
- <polyline points="12 5 19 12 12 19"/>
- </svg>
- </button>
- </div>
- <!-- Reference chip: appears when the user clicks Refine on an
- existing clip. Carries the clip's job_id; on Send, we
- prepend "Refine <job_id>: " to the user's message so the
- agent calls inspect_clip and treats the request as a
- variation. Clear with the × button. -->
- <div class="agent-ref-chip" id="agentRefChip" style="margin-left:auto;margin-right:auto;max-width:720px">
- <span class="ref-icon"><svg class="ph" aria-hidden="true"><use href="#ph-arrow-clockwise"/></svg></span>
- <span style="color:var(--muted);font-size:11px">refine</span>
- <span class="ref-label" id="agentRefChipLabel">…</span>
- <button type="button" class="clear" onclick="agentClearRefine()" title="Cancel refine"><svg class="ph" aria-hidden="true"><use href="#ph-x-bold"/></svg></button>
- </div>
- <!-- Pending-attachment chip row. Filled by agentAddAttachment() as the
- user picks files (paperclip / drag-drop / paste). Survives between
- messages until cleared. -->
- <div class="agent-attach-row" id="agentAttachRow" style="display:none"></div>
- <div class="agent-composer-wrap">
- <input type="file" id="agentFileInput" multiple
- accept="image/png,image/jpeg,image/webp,image/gif,application/pdf,text/plain,text/markdown,.md,.txt,.pdf"
- style="display:none" onchange="agentOnFilesPicked(event)">
- <button type="button" id="agentAttachBtn" class="attach-btn"
- onclick="document.getElementById('agentFileInput').click()"
- title="Attach images or documents (drag-drop or ⌘V also work)">
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
- <path d="M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48"/>
- </svg>
- <span class="count" id="agentAttachCount">0</span>
- </button>
- <textarea id="agentInput"
- placeholder="Paste a script, or describe a piece. The agent will plan, estimate the wall time, and queue overnight."
- rows="1"
- autocomplete="off"></textarea>
- <button type="button" id="agentSendBtn" class="send-btn" onclick="agentSend()" title="Send (Cmd/Ctrl+Enter)" disabled>
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
- <line x1="12" y1="19" x2="12" y2="5"/>
- <polyline points="5 12 12 5 19 12"/>
- </svg>
- </button>
- </div>
- <div class="hint"><kbd>⌘</kbd><kbd>Enter</kbd> to send · <kbd>⌘V</kbd> to paste · drag files to attach · <kbd>/help</kbd> to see what the agent can do</div>
- <!-- Drag-drop overlay shown only while a drag is over the chat surface. -->
- <div class="agent-drop-overlay" id="agentDropOverlay">
- <div class="drop-card">
- <svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">
- <path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"/>
- <polyline points="17 8 12 3 7 8"/>
- <line x1="12" y1="3" x2="12" y2="15"/>
- </svg>
- <div style="font-weight:600">Drop to attach</div>
- <div style="color:var(--muted); font-size:12px">images, PDFs, and text files</div>
- </div>
- </div>
- </div>
- </section>
-
<!-- The original manual form is unchanged; it sits below in the DOM
and is shown/hidden by JS as the workflow tab toggles. -->
<!-- Inline models card. Sits ABOVE the mode picker because for many
@@ -18821,64 +18567,10 @@ HTML = r"""<!doctype html>
</div>
</section>
- <!-- ============== AGENT STAGE PANE ============== -->
- <!-- Right-side live canvas for the agent: code-interpreter feel.
- Hidden by default; shown via CSS when body[data-workflow="agent"]
- OR body.agent-fullscreen. Polls /status every ~1.5 s and re-renders
- the current job, queue depth, and recent session outputs. Click an
- output to play it inline (lightbox). -->
- <aside class="agent-stage-pane">
- <header class="agent-stage-head">
- <span class="live-dot" id="agentStageDot"></span>
- <span class="label">Stage</span>
- <span class="session-pill" id="agentStageSession">no session</span>
- <span class="spacer"></span>
- </header>
- <div class="agent-stage-body" id="agentStageBody">
- <!-- Now Rendering section -->
- <div class="agent-stage-section">
- <h4>Now rendering</h4>
- <div class="stage-now-card idle" id="agentStageNow">
- <div>Idle — submit a shot to see it render here.</div>
- </div>
- </div>
- <!-- Activity feed -->
- <div class="agent-stage-section">
- <h4>Recent activity <span class="count" id="agentStageActivityCount">0</span></h4>
- <div class="stage-activity" id="agentStageActivity">
- <div class="stage-empty">No tool calls yet.</div>
- </div>
- </div>
- <!-- Session outputs -->
- <div class="agent-stage-section">
- <h4>Session outputs <span class="count" id="agentStageOutputsCount">0</span></h4>
- <!-- All / Videos / Photos chip filter — same shape and behaviour
- as the bottom-pane Recent tab (commit 0d9c6eb). Choice is
- persisted to localStorage so it survives panel reloads. -->
- <div class="stage-outputs-filter" id="stageOutputsFilter">
- <button type="button" id="outputsFilterAll" class="active"
- onclick="setOutputsFilter('all')">All</button>
- <button type="button" id="outputsFilterVideos"
- onclick="setOutputsFilter('videos')">Videos</button>
- <button type="button" id="outputsFilterPhotos"
- onclick="setOutputsFilter('photos')">Photos</button>
- </div>
- <div class="stage-outputs" id="agentStageOutputs">
- <div class="stage-empty">No mp4s rendered yet.</div>
- </div>
- </div>
- </div>
- </aside>
<!-- Lightbox for stage outputs — plays a finished mp4 full-size on click.
Refine button references the playing clip in the composer so the
user can ask the agent for a variation while watching. -->
- <div class="stage-lightbox" id="agentStageLightbox" onclick="if(event.target===this)agentStageLightboxClose()">
- <button class="close-btn" onclick="agentStageLightboxClose()">Close · Esc</button>
- <button class="refine-btn-large" id="agentStageLightboxRefine" onclick="agentStageLightboxRefine()">↻ Refine this clip</button>
- <video id="agentStageLightboxVideo" controls preload="metadata"></video>
- </div>
-</main>
<!-- ============== CIVITAI MODAL ============== -->
<!-- LoRA discovery + install modal. Hits /civitai/search to populate
@@ -19271,273 +18963,6 @@ HTML = r"""<!doctype html>
</div>
</div>
-<!-- ============== CAPABILITIES SHEET ==============
- Triggered by typing /help in the composer or clicking the ? button.
- Driven by /agent/capabilities (server-side enumeration of all
- registered tools + engine kinds + image kinds + modes). Lets users
- discover what the agent can do without grepping the system prompt. -->
-<div class="agent-settings-modal" id="agentCapsModal"
- role="dialog" aria-modal="true" aria-labelledby="agentCapsTitle"
- onclick="if(event.target===this)closeAgentCaps()">
- <div class="agent-settings-card" style="max-width:780px">
- <h2 id="agentCapsTitle">What the agent can do
- <button type="button" onclick="closeAgentCaps()">Close</button>
- </h2>
- <div class="hint">
- Phosphene's agent is a director's assistant. It plans shots,
- generates anchor stills, queues LTX renders, writes a manifest.
- Below: every tool it has, plus the engine and image-backend
- options. Use this as a reference; you don't need to memorize it.
- </div>
- <div id="agentCapsBody" style="padding-top:8px"></div>
- </div>
-</div>
-
-<!-- ============== PROJECT NOTES MODAL ============== -->
-<!-- Persistent memory across sessions — the agent reads the tail of
- this file every turn. Editable here too. -->
-<div class="agent-settings-modal" id="agentNotesModal" onclick="if(event.target===this)closeProjectNotes()">
- <div class="agent-settings-card" style="max-width:780px">
- <h2>Project notes
- <button type="button" onclick="closeProjectNotes()">Close</button>
- </h2>
- <div class="hint">
- The agent's persistent memory across sessions. It reads the tail
- every turn, and can append new entries via
- <code>append_project_notes</code>. Edit freely; one Markdown file at
- <code>state/agent_project_notes.md</code>.
- </div>
- <div class="field">
- <label>Notes (Markdown)</label>
- <textarea id="agentNotesTextarea" rows="20" style="width:100%; min-height:380px; font-family: ui-monospace, Menlo, monospace; font-size:12px; line-height:1.55"></textarea>
- </div>
- <div style="display:flex; gap:8px; align-items:center; margin-top:8px">
- <span id="agentNotesStatus" style="flex:1; color:var(--muted); font-size:11px"></span>
- <button type="button" onclick="closeProjectNotes()"
- style="padding:7px 14px;border-radius:8px;border:1px solid var(--border);background:transparent;color:var(--text);cursor:pointer">Cancel</button>
- <button type="button" onclick="saveProjectNotes()"
- style="padding:7px 14px;border-radius:8px;border:none;background:var(--accent);color:white;cursor:pointer;font-weight:600">Save</button>
- </div>
- </div>
-</div>
-
-<!-- ============== AGENT SETTINGS MODAL ============== -->
-<div class="agent-settings-modal" id="agentSettingsModal" onclick="if(event.target===this)closeAgentSettings()">
- <div class="agent-settings-card">
- <h2>Agent engine
- <button type="button" onclick="closeAgentSettings()">Close</button>
- </h2>
-
- <div class="hint">
- The agent uses any OpenAI-compatible chat endpoint. Default is
- <strong>Phosphene Local</strong> — a small mlx-lm.server pointed at the
- bundled Gemma 3 12B IT (the same weights LTX uses as its text encoder,
- doubling as a chat model). Stronger options: drop a Qwen 3 Coder 30B
- MLX model into <code>mlx_models/</code> and pick it below; or point at
- a cloud endpoint (Anthropic compat, OpenAI, OpenRouter, your LM Studio
- box on the LAN).
- </div>
-
- <div class="agent-engine-row" id="agentLocalRow" style="display:none">
- <span class="pill" id="agentLocalPill">stopped</span>
- <span style="flex:1; font-size:12px; color:var(--muted)" id="agentLocalDetail">mlx-lm.server</span>
- <button type="button" onclick="agentLocalToggle()" id="agentLocalToggleBtn"
- style="padding:5px 10px;border-radius:6px;border:1px solid var(--border);background:transparent;color:var(--text);font-size:11px;cursor:pointer">Start</button>
- </div>
-
- <div class="field">
- <label>Engine kind</label>
- <select id="agentKind" onchange="agentKindChanged()">
- <option value="phosphene_local">Phosphene Local — bundled mlx-lm.server</option>
- <option value="anthropic">Claude (Anthropic) — claude.ai API key, billed per token</option>
- <option value="ollama">Ollama bridge — talks to your `ollama serve` on port 11434</option>
- <option value="custom">Custom — any OpenAI-compatible URL (OpenRouter, LM Studio…)</option>
- </select>
- </div>
-
- <div class="field" id="agentLocalModelField">
- <label>
- Local model (chat-capable, MLX 4-bit recommended)
- <button type="button" onclick="openModelBrowser()" style="margin-left:8px;font-size:10px;padding:3px 9px;background:transparent;color:var(--accent-bright);border:1px solid var(--accent);border-radius:6px;cursor:pointer;width:auto">Browse + install…</button>
- </label>
- <select id="agentLocalModel"></select>
- </div>
-
- <!-- Ollama: shown only when engine kind == 'ollama'. Status is fetched
- live from /agent/ollama/status; if Ollama isn't running we surface
- a clear hint instead of a useless empty dropdown. -->
- <div class="field" id="agentOllamaField" style="display:none">
- <label>
- Ollama installed model
- <button type="button" onclick="agentOllamaRefresh()" style="margin-left:8px;font-size:10px;padding:3px 9px;background:transparent;color:var(--muted);border:1px solid var(--border);border-radius:6px;cursor:pointer;width:auto">Refresh</button>
- </label>
- <select id="agentOllamaModel"></select>
- <div id="agentOllamaHint" style="margin-top:6px;font-size:11px;color:var(--muted)">
- Manage Ollama models from the terminal: <code>ollama pull qwen2.5-coder:32b</code>, <code>ollama pull huihui_ai/llama3.3-abliterated:70b</code>, etc. Phosphene only talks to Ollama's <code>/v1/chat/completions</code> endpoint — the model has to already be installed in Ollama.
- </div>
- </div>
-
- <!-- Anthropic: shown only when engine kind == 'anthropic'. Curated
- model dropdown (covers the common picks) plus a free-form
- override field for whatever Anthropic ships next. The base URL
- is implicit (https://api.anthropic.com/v1) so we don't expose
- it in the UI. The api_key field below this is shared with the
- custom-OpenAI branch — same input, different transport. -->
- <div class="field" id="agentAnthropicModelField" style="display:none">
- <label>Claude model</label>
- <select id="agentAnthropicModel" onchange="agentAnthropicModelChanged()">
- <option value="claude-sonnet-4-5">Sonnet 4.5 — balanced reasoning, recommended</option>
- <option value="claude-opus-4-5">Opus 4.5 — strongest reasoning, slower + pricier</option>
- <option value="claude-haiku-4-5">Haiku 4.5 — fastest, cheapest, lighter reasoning</option>
- <option value="__custom__">Custom model id…</option>
- </select>
- <input type="text" id="agentAnthropicCustomModel"
- placeholder="claude-…-YYYYMMDD"
- style="margin-top:8px; display:none">
- <div style="margin-top:6px;font-size:11px;color:var(--muted)">
- API charges per token. Get a key at <code>console.anthropic.com</code>. Phosphene
- sends your key directly to <code>api.anthropic.com</code> — never to a third party.
- </div>
- </div>
-
- <div class="field" id="agentBaseUrlField" style="display:none">
- <label>Base URL</label>
- <input type="text" id="agentBaseUrl" placeholder="https://api.openai.com/v1">
- </div>
-
- <div class="field" id="agentApiKeyField" style="display:none">
- <label>API key (saved locally; sent only to the configured endpoint)</label>
- <input type="password" id="agentApiKey" placeholder="(leave blank to keep saved key)">
- </div>
-
- <div class="field" id="agentRemoteModelField" style="display:none">
- <label>Model identifier</label>
- <input type="text" id="agentRemoteModel" placeholder="e.g. gpt-5 or qwen2.5-coder:32b">
- </div>
-
- <div class="row">
- <div class="field">
- <label>Temperature</label>
- <input type="number" id="agentTemp" min="0" max="2" step="0.05" value="0.4">
- </div>
- <div class="field">
- <label>Max tokens</label>
- <input type="number" id="agentMaxTokens" min="256" max="32768" step="256" value="8192">
- </div>
- </div>
-
- <hr style="border:none;border-top:1px solid var(--border);margin:18px 0 12px">
-
- <h2 style="font-size:14px">Image generation
- <span class="pill" id="agentImagePill" style="font-size:10px;padding:3px 8px;border-radius:999px;background:var(--bg-2);color:var(--muted);border:1px solid var(--border)">…</span>
- </h2>
- <div class="subtitle" style="margin-bottom:12px">
- For the director-collaboration workflow: agent generates 4 candidate stills per
- shot, you pick the best one, then i2v anchors lock the look before each render.
- </div>
-
- <div class="field">
- <label>Backend</label>
- <select id="agentImageKind" onchange="agentImageKindChanged()">
- <option value="mock">Mock — PIL placeholders, free, instant (for testing the flow)</option>
- <option value="mflux">Phosphene Local Flux (mflux + Flux Krea Dev) — fully on-Mac, free, ~25–60 s/img</option>
- <option value="bfl">Black Forest Labs API — cloud Flux, ~$0.025/img on flux-dev, ~10–15 s/img</option>
- </select>
- </div>
-
- <!-- mflux fields. Grouped by family — mflux 0.17.x ships per-family
- CLIs (mflux-generate-flux2, mflux-generate-z-image-turbo, etc.)
- and the panel auto-dispatches based on model name. Apache-2.0
- options pinned to the top — non-commercial / gated below. -->
- <div class="field" id="agentMfluxModelField" style="display:none">
- <label>mflux model</label>
- <select id="agentMfluxModel" onchange="agentMfluxModelChanged()">
- <optgroup label="Qwen-Image-Edit-2511 (Apache 2.0 · multi-reference) — character + place composition">
- <!-- 2511 supersedes 2509: stronger character consistency, mitigated multi-ref drift, built-in popular LoRAs. Same ~54 GB on disk; matches the inline presets used by Image Studio's engine dropdown. (Code-review P2-3.) -->
- <option value="Qwen/Qwen-Image-Edit-2511">Qwen-Image-Edit-2511 — 1-3 ref images + prompt → composed still · ~22-34 GB lazy download (Q4 / Q8 picked via the quant slider below)</option>
- <option value="Qwen/Qwen-Image-Edit-2509">Qwen-Image-Edit-2509 (legacy — prefer 2511)</option>
- </optgroup>
- <optgroup label="FLUX.2 (Apache 2.0 · 4-step) — fast text-to-image default">
- <option value="Runpod/FLUX.2-klein-4B-mflux-4bit" selected>FLUX.2 [klein] 4B — 4-bit, 4 steps · ~4.3 GB · recommended for plain T2I anchors</option>
- </optgroup>
- <optgroup label="Z-Image (Apache 2.0 · Tongyi/Alibaba)">
- <option value="filipstrand/Z-Image-Turbo-mflux-4bit">Z-Image-Turbo — 4-bit, 9 steps · ~5.9 GB · Compact-tier default</option>
- </optgroup>
- <optgroup label="FLUX.1 (legacy, non-commercial except Schnell)">
- <option value="krea-dev">Flux Krea Dev — best FLUX.1 photorealism (gated, ~9.6 GB)</option>
- <option value="dev">Flux.1 Dev — vanilla 25-step (gated)</option>
- <option value="schnell">Flux.1 Schnell — Apache 2.0, 4-step</option>
- </optgroup>
- <option value="__custom__">Custom HF id / local path…</option>
- </select>
- <div id="agentQwenInstallHint" class="field-help" style="display:none;margin-top:6px;padding:8px;background:rgba(207,150,34,0.08);border:1px solid rgba(207,150,34,0.4);border-radius:6px;color:var(--text);font-size:12px;line-height:1.4">
- <b>Qwen-Image-Edit-2511 needs a one-click install</b> — open Pinokio's launcher menu and click <b>"Install Qwen-Image-Edit (multi-ref keyframes)"</b>. ~30 s for the package; weights (~22-34 GB) download lazily on first use.
- </div>
- </div>
- <div class="field" id="agentMfluxCustomField" style="display:none">
- <label>Custom model (HF repo id or local path)</label>
- <input type="text" id="agentMfluxCustomPath" placeholder="filipstrand/FLUX.1-Krea-dev-mflux-4bit">
- <div style="margin-top:4px;font-size:11px;color:var(--muted)">
- Required when using a non-named model. mflux will download to <code>~/.cache/huggingface</code> on first use (~6 GB for Krea Dev 4-bit).
- </div>
- </div>
- <div class="field" id="agentMfluxBaseField" style="display:none">
- <label>Base model (when using custom path)</label>
- <select id="agentMfluxBaseModel">
- <option value="krea-dev">krea-dev</option>
- <option value="dev">dev</option>
- <option value="schnell">schnell</option>
- </select>
- </div>
- <div class="row" id="agentMfluxParamsField" style="display:none">
- <div class="field">
- <label>Steps</label>
- <input type="number" id="agentMfluxSteps" min="1" max="50" value="25">
- </div>
- <div class="field">
- <label>Quantize (bits)</label>
- <select id="agentMfluxQuantize">
- <!-- Q6 is the Apple-Silicon community sweet spot (~4-6% quality
- loss vs full precision; Q4 is 8-12%). Matches
- ImageEngineConfig.mflux_quantize default + every inline
- preset. (Code-review P2-3.) -->
- <option value="4">4-bit (~6 GB, smallest)</option>
- <option value="6" selected>6-bit (~9 GB, recommended)</option>
- <option value="8">8-bit (~12 GB, sharper)</option>
- </select>
- </div>
- </div>
- <div class="hint" id="agentMfluxInstallHint" style="display:none">
- <strong>First-time setup:</strong> install mflux into the panel's venv with
- <code>ltx-2-mlx/env/bin/pip install mflux</code> (one-time, ~50 MB of code; weights download separately on first generate).
- Verify the install with <code>ltx-2-mlx/env/bin/mflux-generate --help</code>.
- </div>
-
- <!-- BFL fields -->
- <div class="field" id="agentBflModelField" style="display:none">
- <label>BFL model</label>
- <select id="agentBflModel">
- <option value="flux-dev">flux-dev — 25 steps, ~$0.025 per image (recommended)</option>
- <option value="flux-pro">flux-pro — premium quality, ~$0.05 per image</option>
- <option value="flux-pro-1.1">flux-pro-1.1 — newer pro, ~$0.04 per image</option>
- <option value="flux-schnell">flux-schnell — 4 steps, ~$0.003 per image (fastest)</option>
- </select>
- </div>
-
- <div class="field" id="agentBflKeyField" style="display:none">
- <label>BFL API key</label>
- <input type="password" id="agentBflKey" placeholder="(leave blank to keep saved)">
- <div style="margin-top:6px;font-size:11px;color:var(--muted)">
- Get one at <code>https://api.bfl.ml</code> · stored in <code>state/agent_image_config.json</code>, only sent as the <code>X-Key</code> header.
- </div>
- </div>
-
- <div class="actions">
- <button type="button" class="ghost" onclick="closeAgentSettings()">Cancel</button>
- <button type="button" class="save" onclick="agentSaveSettings()">Save settings</button>
- </div>
- </div>
-</div>
<!-- ============== BATCH MODAL ============== -->
<div class="modal-bg" id="batchModal" onclick="if(event.target===this)closeBatch()">