The open creative studio on ComfyUI: images, video, 3D and audio on open weights, on your own GPU or the cloud. Camera motions, effects, apps, Cinema, Layers, Image to 3D and an AI agent.
TypeScript ai-videocomfyuicreative-toolsgenerative-aiideogramimage-generationimage-to-3dimage-to-videoltx-videominimax-h3nextjsopen-sourceopen-weightsqwen-imagetext-to-imagevideo-generationwan
Engine pages: fixes from the site check (batch 1)
Adarsh84194843f5c8
diff --git a/scripts/comfy/library.spec.mjs b/scripts/comfy/library.spec.mjsindex 449154c7..9920c46d 100644--- a/scripts/comfy/library.spec.mjs+++ b/scripts/comfy/library.spec.mjs@@ -486,7 +486,7 @@ export const SPEC = [outputs: [{ node: '9', kind: 'image' }],limits: { maxWidth: 2048, maxHeight: 2048, dimensionMultiple: 16 },vramGb: 32,- notes: 'Mistral-Small text encoder (18 GB bf16) + 32B fp8mixed transformer; needs ~64 GB system RAM for offloading on 24 GB cards. Width/height must be set on BOTH the latent and the Flux2Scheduler (both listed).',+ notes: 'Mistral-Small text encoder (36 GB bf16) + 32B fp8mixed transformer; needs ~64 GB system RAM for offloading on 24 GB cards. Width/height must be set on BOTH the latent and the Flux2Scheduler (both listed).',},{id: 'flux2-dev-t2i-turbo',diff --git a/src/app/(studio)/models/page.tsx b/src/app/(studio)/models/page.tsxindex 24c81803..a7a8a8ad 100644--- a/src/app/(studio)/models/page.tsx+++ b/src/app/(studio)/models/page.tsx@@ -1,20 +1,24 @@import type { Metadata } from "next";import { PageHeader, PageShell } from "@/components/page-shell";-import { ModelsTable } from "@/components/models-table";+import { ModelsIntro, ModelsTable } from "@/components/models-table";import { MODELS } from "@/lib/catalog";import { toModelRow } from "@/lib/model-rows";+import { modelHref } from "@/lib/palette-index";export const metadata: Metadata = { title: "Models" };+/** Each row opens where its model runs; a model no studio offers has nowhere else to go (its link is this page). */+const ROWS = MODELS.map((m) => {+ const href = modelHref(m);+ return { ...toModelRow(m), ...(!href.startsWith("/models") && { href }) };+});+export default function Page() {return (<PageShell wide>- <PageHeader- title="Models"- description="Every model Fuobe can drive. Cloud models run through your fal.ai or Replicate key; open-source models run as ComfyUI workflows on your own GPU."- />+ <PageHeader title="Models" description={<ModelsIntro />} />{/* Slim rows only: the catalog (field maps, options, LoRAs) stays on the server. */}- <ModelsTable models={MODELS.map(toModelRow)} />+ <ModelsTable models={ROWS} /></PageShell>);}diff --git a/src/app/(studio)/settings/about/page.tsx b/src/app/(studio)/settings/about/page.tsxindex 38dd3bdb..dbd5d656 100644--- a/src/app/(studio)/settings/about/page.tsx+++ b/src/app/(studio)/settings/about/page.tsx@@ -37,7 +37,7 @@ async function readAbout() {workflowCount: workflows.length,list: buildLicenceList(MODELS.map((m) => ({ id: m.id, name: m.name, vendor: m.vendor, kind: m.kind, hidden: m.hidden, routes: m.routes.map((r) => ({ provider: r.provider, endpoint: r.endpoint })) })),- workflows.map((w) => ({ id: w.id, title: w.title, capability: w.capability, license: w.license })),+ workflows.map((w) => ({ id: w.id, title: w.title, capability: w.capability, license: w.license, models: w.models.map((m) => ({ url: m.url, sizeGb: m.sizeGb })) })),),};}@@ -54,6 +54,7 @@ function Fact({ label, children }: { label: string; children: React.ReactNode })export default async function Page() {const about = await readAbout();const { list } = about;+ const inStudios = list.rows.filter((r) => r.inCatalog).length;return (<PageShell><Link href="/settings" className="mb-3 inline-flex items-center gap-1.5 rounded-md text-[13px] text-muted-foreground hover:text-foreground">@@ -61,10 +62,10 @@ export default async function Page() {</Link><PageHeadertitle="About & licences"- description="Fuobe's code is open source. The open models it runs on your GPU each have their own licence: most allow commercial use, some don't, and a few leave out some countries. Paid models follow the terms of the provider you connect."+ description="Fuobe's code is open source (MIT). The open models it runs on your GPU each have their own licence: most allow commercial use, some don't, and a few leave out some countries. Paid models follow the terms of the provider you connect."/>- <dl className="grid grid-cols-1 gap-4 rounded-2xl border p-5 sm:grid-cols-2 lg:grid-cols-4">+ <dl className="grid grid-cols-1 gap-4 rounded-2xl border p-5 sm:grid-cols-2 lg:grid-cols-5"><Fact label="Fuobe">Version {about.version}</Fact><Fact label="Source code"><a href={FUOBE_REPO} target="_blank" rel="noreferrer" className="inline-flex items-center gap-1 text-brand-text underline underline-offset-2">@@ -72,6 +73,12 @@ export default async function Page() {<span className="sr-only">(opens in a new tab)</span></a></Fact>+ <Fact label="Licence">+ <a href={`${FUOBE_REPO}/blob/main/LICENSE`} target="_blank" rel="noreferrer" className="inline-flex items-center gap-1 text-brand-text underline underline-offset-2">+ MIT <ExternalLink className="size-3" aria-hidden />+ <span className="sr-only">(opens in a new tab)</span>+ </a>+ </Fact><Fact label="Open engine">{about.workflowCount} ComfyUI workflows{about.comfyui ? `, built for ComfyUI ${about.comfyui}` : ""}{about.builtAt ? <span className="text-muted-foreground"> · {about.builtAt}</span> : null}@@ -128,13 +135,14 @@ export default async function Page() {Open model licences</h2><p className="mt-1 mb-5 max-w-2xl text-[13px] text-muted-foreground">- {list.counts.all} models and workflows: {list.counts.clear} allow commercial use, {list.counts.conditions} with conditions (revenue limits or use rules), {list.counts["non-commercial"]}{" "}- non-commercial and {list.counts.territory} not available everywhere. Read the licence itself before you sell what you make; this list is a guide, not legal advice. Which of them this- install offers is yours to decide in{" "}+ {list.counts.all} open models with weights of their own: {inStudios} in Fuobe's studios and {list.counts.all - inStudios} more workflows in the library (tools with no weights+ aren't counted). {list.counts.clear} allow commercial use, {list.counts.conditions} with conditions (revenue limits or use rules), {list.counts["non-commercial"]} non-commercial+ and {list.counts.territory} not available everywhere. Read the licence itself before you sell what you make; this list is a guide, not legal advice. Which models this install offers+ is set in{" "}<Link href="/settings/models" className="text-brand-text underline underline-offset-2">Models & licences</Link>- .+ , which counts every model in the catalog, paid ones included.</p><LicencesView list={list} /></section>diff --git a/src/app/(studio)/settings/models/page.tsx b/src/app/(studio)/settings/models/page.tsxindex 26058831..90b83251 100644--- a/src/app/(studio)/settings/models/page.tsx+++ b/src/app/(studio)/settings/models/page.tsx@@ -1,7 +1,7 @@import { ArrowLeft } from "lucide-react";import type { Metadata } from "next";import Link from "next/link";-import { ModelAccessView } from "@/components/model-access-view";+import { ModelAccessIntro, ModelAccessView } from "@/components/model-access-view";import { PageHeader, PageShell } from "@/components/page-shell";export const metadata: Metadata = { title: "Models & licences" };@@ -13,19 +13,7 @@ export default function Page() {<Link href="/settings" className="mb-3 inline-flex items-center gap-1.5 rounded-md text-[13px] text-muted-foreground hover:text-foreground"><ArrowLeft className="size-3.5" /> Settings</Link>- <PageHeader- title="Models & licences"- description={- <>- Every model, LoRA and node pack Fuobe can run, with its licence: paid and open, commercial or not. Licences are information here; you decide what this install offers. Everything is on until- you switch it off, and what is off leaves every picker and is refused on the server.{" "}- <Link href="/settings/about" className="text-brand-text underline-offset-2 hover:underline">- About & licences- </Link>{" "}- has the notices and the full licence texts of the open models.- </>- }- />+ <PageHeader title="Models & licences" description={<ModelAccessIntro />} /><ModelAccessView /></PageShell>);diff --git a/src/app/(studio)/settings/page.tsx b/src/app/(studio)/settings/page.tsxindex cc47de84..e9293779 100644--- a/src/app/(studio)/settings/page.tsx+++ b/src/app/(studio)/settings/page.tsx@@ -1,7 +1,7 @@import type { Metadata } from "next";import { AccountsAdmin } from "@/components/accounts-admin";import { AccountGpuSection } from "@/components/gpu/account-gpu-section";-import { OwnerSettings } from "@/components/owner-settings";+import { OwnerSettings, SettingsIntro } from "@/components/owner-settings";import { PageHeader, PageShell } from "@/components/page-shell";import { SettingsForm } from "@/components/settings-form";import { starterPriceLine } from "@/lib/starter-prices";@@ -11,7 +11,7 @@ export const metadata: Metadata = { title: "Settings" };export default function Page() {return (<PageShell>- <PageHeader title="Settings" description="Choose open source, paid APIs or both, connect providers, point Fuobe at your ComfyUI server, and choose how prompts get enhanced. Keys stay on this server." />+ <PageHeader title="Settings" description={<SettingsIntro />} /><AccountGpuSection /><OwnerSettings><SettingsForm prices={starterPriceLine()} />diff --git a/src/app/(studio)/status/page.tsx b/src/app/(studio)/status/page.tsxindex e461691d..9119121f 100644--- a/src/app/(studio)/status/page.tsx+++ b/src/app/(studio)/status/page.tsx@@ -1,9 +1,16 @@import fs from "node:fs/promises";import path from "node:path";+import { ExternalLink } from "lucide-react";import type { Metadata } from "next";-import ReactMarkdown from "react-markdown";+import Link from "next/link";+import ReactMarkdown, { type Components } from "react-markdown";import remarkGfm from "remark-gfm";-import { PageShell } from "@/components/page-shell";+import { PageHeader, PageShell } from "@/components/page-shell";+import { MODELS } from "@/lib/catalog";+import { enginesOf } from "@/lib/catalog/engines";+import type { Manifest } from "@/lib/comfy";+import { FUOBE_REPO } from "@/lib/connections";+import { headingId, STATUS_ON_GITHUB, statusBody, statusDate, statusLink, statusOutline } from "@/lib/status-page";export const metadata: Metadata = { title: "Project status" };@@ -16,12 +23,144 @@ async function readStatus(): Promise<string> {}}+/** The workflow library's size, from the manifest the Workflows page lists. */+async function readWorkflows(): Promise<{ all: number; validated: number }> {+ "use cache";+ try {+ const manifest = JSON.parse(await fs.readFile(path.join(process.cwd(), "workflows", "comfyui", "manifest.json"), "utf8")) as Manifest;+ return { all: manifest.workflows.length, validated: manifest.workflows.filter((w) => w.validated).length };+ } catch {+ return { all: 0, validated: 0 };+ }+}++type HastNode = { type: string; value?: string; children?: HastNode[] };+const textOf = (n?: HastNode): string => (n?.type === "text" ? (n.value ?? "") : (n?.children ?? []).map(textOf).join(""));++/** The log's headings get ids (the contents link to them); its links open the repo's docs on GitHub, in a new tab. */+const LOG: Components = {+ h2: ({ node, ...props }) => <h2 id={headingId(textOf(node as HastNode))} className="scroll-mt-20" {...props} />,+ h3: ({ node, ...props }) => <h3 id={headingId(textOf(node as HastNode))} className="scroll-mt-20" {...props} />,+ a: ({ href, title, children }) =>+ href?.startsWith("#") ? (+ <a href={href} title={title}>+ {children}+ </a>+ ) : (+ <a href={href} title={title} target="_blank" rel="noreferrer">+ {children}+ </a>+ ),+};++function Fact({ label, children }: { label: string; children: React.ReactNode }) {+ return (+ <div className="min-w-0">+ <dt className="text-[12px] text-muted-foreground">{label}</dt>+ <dd className="mt-0.5 text-[14px] [overflow-wrap:anywhere]">{children}</dd>+ </div>+ );+}++const link = "text-brand-text underline underline-offset-2";+export default async function Page() {- const md = await readStatus();+ const [md, workflows] = await Promise.all([readStatus(), readWorkflows()]);+ const open = MODELS.filter((m) => enginesOf(m).includes("open")).length;+ // Models with no open-source route: a self-hosted studio runs them with its own key.+ const cloudOnly = MODELS.filter((m) => !enginesOf(m).includes("open")).length;+ const updated = statusDate(md);+ const outline = statusOutline(md);return (<PageShell>- <article className="prose-fuobe max-w-3xl">- <ReactMarkdown remarkPlugins={[remarkGfm]}>{md}</ReactMarkdown>+ <PageHeader+ title="Project status"+ description="Fuobe is an open-source creative studio on ComfyUI. Here is what works today, and below it the engineering log its builders keep after every round of work."+ />++ <dl className="grid grid-cols-1 gap-4 rounded-2xl border p-5 sm:grid-cols-2 lg:grid-cols-4">+ <Fact label="ComfyUI workflows">+ <Link href="/workflows" className={link}>+ {workflows.all} workflows+ </Link>+ <span className="text-muted-foreground"> · {workflows.validated} validated on a real ComfyUI</span>+ </Fact>+ <Fact label="Models">+ <Link href="/models" className={link}>+ {open} open-source+ </Link>+ <span className="text-muted-foreground"> · {cloudOnly} more with a fal.ai or Replicate key</span>+ </Fact>+ <Fact label="Licence">+ <a href={`${FUOBE_REPO}/blob/main/LICENSE`} target="_blank" rel="noreferrer" className={link}>+ MIT+ </a>+ <span className="text-muted-foreground"> · open source</span>+ </Fact>+ <Fact label="Last updated">{updated ?? "—"}</Fact>+ </dl>++ <section aria-labelledby="today" className="mt-8 max-w-3xl">+ <h2 id="today" className="text-[15px] font-semibold">+ What works today+ </h2>+ <ul className="mt-2 list-disc space-y-1.5 pl-5 text-[14px] leading-relaxed">+ <li>+ <span className="font-medium">Browse everything.</span> Every studio, app, camera motion and effect, the{" "}+ <Link href="/models" className={link}>+ models+ </Link>{" "}+ and the{" "}+ <Link href="/workflows" className={link}>+ workflow library+ </Link>{" "}+ can be browsed without an account.+ </li>+ <li>+ <span className="font-medium">Free accounts.</span> Sign up with an email, then{" "}+ <Link href="/connect" className={link}>+ connect your own ComfyUI+ </Link>{" "}+ (Your GPU): your runs go to your GPU.+ </li>+ <li>+ <span className="font-medium">The open engine.</span> Each open-source model runs as a ComfyUI workflow; {workflows.validated} of the {workflows.all} graphs are+ accepted by a real ComfyUI. Every preview clip and still on this site was rendered locally on ComfyUI, on one RTX 5090.+ </li>+ <li>+ <span className="font-medium">Your own studio.</span> Fuobe is MIT-licensed. Run it yourself to add the cloud engine: frontier models with your own fal.ai or+ Replicate key, next to the open ones.+ </li>+ </ul>+ </section>++ <nav aria-labelledby="contents" className="mt-8 max-w-3xl rounded-2xl bg-muted/60 px-5 py-4">+ <h2 id="contents" className="text-[15px] font-semibold">+ In the engineering log+ </h2>+ <ol className="mt-2 space-y-1 text-[14px]">+ {outline.map((h) => (+ <li key={h.id} className={h.depth === 3 ? "pl-4 text-[13px]" : undefined}>+ <a href={`#${h.id}`} className="text-brand-text underline-offset-2 hover:underline">+ {h.text}+ </a>+ </li>+ ))}+ </ol>+ <p className="mt-3 text-[12px] leading-relaxed text-muted-foreground">+ The log is written by the coding agents that build Fuobe, on machines with no GPU and no paid keys, so “here” in it means those machines: what needs real+ weights or a paid key is marked built (🟢) rather than verified there.{" "}+ <a href={STATUS_ON_GITHUB} target="_blank" rel="noreferrer" className="inline-flex items-center gap-1 text-brand-text underline underline-offset-2">+ The log on GitHub <ExternalLink className="size-3" aria-hidden />+ <span className="sr-only">(opens in a new tab)</span>+ </a>+ </p>+ </nav>++ <article className="prose-fuobe mt-10 max-w-3xl border-t pt-6">+ <ReactMarkdown remarkPlugins={[remarkGfm]} urlTransform={statusLink} components={LOG}>+ {statusBody(md)}+ </ReactMarkdown></article></PageShell>);diff --git a/src/app/(studio)/workflows/page.tsx b/src/app/(studio)/workflows/page.tsxindex 82123b38..290db1d2 100644--- a/src/app/(studio)/workflows/page.tsx+++ b/src/app/(studio)/workflows/page.tsx@@ -2,6 +2,7 @@ import type { Metadata } from "next";import { PageHeader, PageShell } from "@/components/page-shell";import { WorkflowsView } from "@/components/workflows-view";import { MODELS } from "@/lib/catalog";+import { WORKFLOWS_ON_GITHUB } from "@/lib/comfy-install";export const metadata: Metadata = { title: "ComfyUI workflows" };@@ -13,7 +14,16 @@ export default function Page() {<PageShell wide><PageHeadertitle="ComfyUI workflows"- description="The open-source engine. Each workflow is an API-format ComfyUI graph exported from the official templates, with bindings Fuobe uses to inject prompts, images and settings."+ description={+ <>+ The open-source engine. Each workflow is an API-format ComfyUI graph exported from the official templates, with bindings Fuobe uses to inject prompts, images and+ settings. Download one below, or browse them all{" "}+ <a href={WORKFLOWS_ON_GITHUB} target="_blank" rel="noreferrer" className="text-brand-text underline underline-offset-2">+ on GitHub+ </a>+ .+ </>+ }/><WorkflowsView routes={ROUTES} /></PageShell>diff --git a/src/components/app-sidebar.tsx b/src/components/app-sidebar.tsxindex 17df4df7..043f7af3 100644--- a/src/components/app-sidebar.tsx+++ b/src/components/app-sidebar.tsx@@ -160,6 +160,46 @@ function SidebarStateScript() {);}+/**+ * Scrolls `el` into the scrolling `box` as little as it takes, its top first when it doesn't fit, clear of the box's+ * faded edges (24px above, 40px below).+ */+function reveal(box: HTMLElement | null, el: Element | null | undefined) {+ if (!box || !el) return;+ const b = box.getBoundingClientRect();+ const r = el.getBoundingClientRect();+ const below = r.bottom + 40 - b.bottom;+ if (below > 0) box.scrollTop += Math.min(below, Math.max(0, r.top - b.top - 24));+ else if (r.top - 24 < b.top) box.scrollTop -= b.top - r.top + 24;+}++/**+ * Brings the open page's row into view when the page changes: with Studios open, Engine's rows (Models, Settings…)+ * sit below the fold. Inside Suspense: the pathname is runtime data.+ */+function RevealActive({ box }: { box: React.RefObject<HTMLDivElement | null> }) {+ const pathname = usePathname();+ useEffect(() => {+ const el = box.current;+ if (!el) return;+ // Again whenever the list's box changes size (the guest's Sign up row arrives and pushes it down), until the+ // person scrolls or clicks in it themselves.+ let theirs = false;+ const show = () => theirs || reveal(el, el.querySelector('[data-active="true"]'));+ const mine = () => (theirs = true);+ const frame = requestAnimationFrame(show);+ const resized = new ResizeObserver(show);+ resized.observe(el);+ for (const e of ["wheel", "touchstart", "pointerdown", "keydown"]) el.addEventListener(e, mine, { passive: true });+ return () => {+ cancelAnimationFrame(frame);+ resized.disconnect();+ for (const e of ["wheel", "touchstart", "pointerdown", "keydown"]) el.removeEventListener(e, mine);+ };+ }, [pathname, box]);+ return null;+}+/** Tells the shell which page is open (the pathname is runtime data, so it's read inside Suspense). */function PathWatcher({ onPath }: { onPath: (pathname: string) => void }) {const pathname = usePathname();@@ -516,10 +556,21 @@ export function AppSidebar() {<Fragment key={id}>{/* Icon mode hides the group labels: a hairline keeps the groups apart. */}{i > 0 && <SidebarSeparator className="my-1 hidden group-data-[collapsible=icon]:block" />}- <NavGroup group={group} open={!group.collapsible || !closed.includes(id)} onToggle={() => toggle(id)} />+ <NavGroup+ group={group}+ open={!group.collapsible || !closed.includes(id)}+ onToggle={() => {+ toggle(id);+ // A group opened near the bottom scrolls up into view, once its rows are on the page.+ if (closed.includes(id)) requestAnimationFrame(() => reveal(content.current, content.current?.querySelector(`[data-nav-group="${id}"]`)));+ }}+ /></Fragment>);})}+ <Suspense fallback={null}>+ <RevealActive box={content} />+ </Suspense></SidebarContent><SidebarFooter className="gap-1 border-t border-sidebar-border" onClick={closeOnLink}>{status?.viewer ? (diff --git a/src/components/command-palette.tsx b/src/components/command-palette.tsxindex 2ff92174..98500493 100644--- a/src/components/command-palette.tsx+++ b/src/components/command-palette.tsx@@ -1,7 +1,7 @@"use client";import { useQuery } from "@tanstack/react-query";-import { Bell, Clapperboard, Cpu, Film, GraduationCap, KeyRound, Layers, LayoutGrid, Loader2, Play, Plug, Plus, Scale, Server, Settings2, ShieldCheck, Sparkles, Wand2, type LucideIcon } from "lucide-react";+import { Bell, Clapperboard, Cpu, Film, GraduationCap, KeyRound, Layers, LayoutGrid, Loader2, Play, Plug, Plus, Scale, Server, Settings2, ShieldCheck, Sparkles, UserRound, Wand2, type LucideIcon } from "lucide-react";import { useRouter } from "next/navigation";import { createContext, lazy, Suspense, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";import { useSkills } from "@/components/assist/hooks";@@ -10,7 +10,7 @@ import { MediaThumb } from "@/components/studio/result-media";import { CommandDialog, CommandEmpty, CommandGroup, CommandItem, CommandList } from "@/components/ui/command";import { Kbd } from "@/components/ui/kbd";import { Command as CommandPrimitive } from "cmdk";-import { useEngineMode, useGenerations, useModelAccess } from "@/lib/api";+import { useEngineMode, useGenerations, useModelAccess, useViewer, type ViewerInfo } from "@/lib/api";import type { Generation } from "@/lib/catalog/types";import { indexEntries, KIND_LABELS, rankPalette, skillEntries, type PaletteEntry, type PaletteIndex, type PaletteKind } from "@/lib/command-search";import { useModKey } from "@/lib/keys";@@ -80,9 +80,36 @@ const SETTING_ENTRIES: (PaletteEntry & { icon: LucideIcon })[] = SETTINGS.map((skeywords: s.keywords,icon: s.icon,}));+const visitorSetting = (key: string, label: string, href: string, icon: LucideIcon, keywords: string): PaletteEntry & { icon: LucideIcon } => ({+ key: `setting:${key}`,+ kind: "setting",+ label,+ hint: "Settings",+ href,+ keywords,+ icon,+});+const LICENCES = SETTING_ENTRIES.find((e) => e.key === "setting:models")!;+/**+ * The install's settings are its owner's: an account (public sign-up) gets its own GPU and account, a guest the way to+ * connect a GPU; both get the licences, which they may read.+ */+const ACCOUNT_SETTINGS = [+ visitorSetting("your-gpu", "Your GPU", "/settings#your-gpu", Cpu, "comfyui gpu connect own server open source"),+ visitorSetting("account", "Account", "/settings#account", UserRound, "email sign out delete account"),+ LICENCES,+];+const GUEST_SETTINGS = [visitorSetting("connect", "Connect your GPU", "/connect", Cpu, "comfyui gpu own server sign up account open source"), LICENCES];++/** The settings the palette offers this viewer (none of the install's to anyone but its owner). */+export function settingEntries(viewer: Pick<ViewerInfo, "owner" | "account"> | undefined): (PaletteEntry & { icon: LucideIcon })[] {+ if (viewer?.owner) return SETTING_ENTRIES;+ return viewer?.account ? ACCOUNT_SETTINGS : GUEST_SETTINGS;+}+// Icons as elements made once (a component picked during render would remount on every keystroke).const iconEl = (Icon: LucideIcon) => <Icon className="text-muted-foreground" />;-const ICONS = new Map<string, React.ReactNode>([...PAGES, ...SETTING_ENTRIES].map((e) => [e.key, iconEl(e.icon)]));+const ICONS = new Map<string, React.ReactNode>([...PAGES, ...SETTING_ENTRIES, ...ACCOUNT_SETTINGS, ...GUEST_SETTINGS].map((e) => [e.key, iconEl(e.icon)]));const KIND_ICONS: Partial<Record<PaletteKind, React.ReactNode>> = { app: iconEl(LayoutGrid), motion: iconEl(Film), effect: iconEl(Wand2), model: iconEl(Clapperboard), skill: iconEl(Play) };function useDebounced<T>(value: T, ms: number): T {@@ -146,6 +173,7 @@ function PaletteBody({ onPick, onOpenRecent, onClose }: { onPick: (e: PaletteEntconst dq = useDebounced(q.trim(), 200);const mode = useEngineMode();const access = useModelAccess();+ const settings = settingEntries(useViewer().data);// The apps, motions, effects and models load on first open (and stay for the session).const index = useQuery({queryKey: ["palette-index"],@@ -156,8 +184,8 @@ function PaletteBody({ onPick, onOpenRecent, onClose }: { onPick: (e: PaletteEnt// Skills that run by themselves: "Run <skill>…" opens its Run form.const skills = useSkills();const entries = useMemo(- () => [...PAGES, ...SETTING_ENTRIES, ...skillEntries(skills.data ?? []), ...(index.data ? indexEntries(index.data, mode, access) : [])],- [index.data, mode, access, skills.data],+ () => [...PAGES, ...settings, ...skillEntries(skills.data ?? []), ...(index.data ? indexEntries(index.data, mode, access) : [])],+ [index.data, mode, access, skills.data, settings],);const groups = useMemo(() => rankPalette(entries, query), [entries, query]);const recentItems = (recent.data ?? []).filter((g) => g.outputs[0]);@@ -233,7 +261,7 @@ function PaletteBody({ onPick, onOpenRecent, onClose }: { onPick: (e: PaletteEnt))}</CommandGroup><CommandGroup heading={KIND_LABELS.setting}>- {SETTING_ENTRIES.map((e) => (+ {settings.map((e) => (<Row key={e.key} entry={e} onPick={onPick} />))}</CommandGroup>diff --git a/src/components/licences-view.tsx b/src/components/licences-view.tsxindex 89953a3e..559ede9d 100644--- a/src/components/licences-view.tsx+++ b/src/components/licences-view.tsx@@ -1,6 +1,6 @@"use client";-import { Ban, CheckCircle2, Globe, Info, Search } from "lucide-react";+import { Ban, CheckCircle2, ExternalLink, Globe, Info, Search } from "lucide-react";import { useDeferredValue, useState } from "react";import { FLAG_LABEL, kindLabel, type LicenceFlag, type LicenceList, type LicenceRow } from "@/lib/licences";import { cn } from "@/lib/utils";@@ -59,9 +59,17 @@ function Row({ row }: { row: LicenceRow }) {{row.inCatalog ? `${row.by} · ` : ""}{kindLabel(row.kind)}</p>- {row.licences.map((l) => (+ {row.licences.map((l, i) => (<p key={l} className="mt-1 text-[12px] leading-relaxed text-muted-foreground [overflow-wrap:anywhere]">- {l}+ {row.links[i] ? (+ <a href={row.links[i] ?? undefined} target="_blank" rel="noreferrer" className="underline-offset-2 hover:text-foreground hover:underline">+ {l}+ <ExternalLink className="ml-1 inline size-3 align-[-1px]" aria-hidden />+ <span className="sr-only"> (the licence, in a new tab)</span>+ </a>+ ) : (+ l+ )}</p>))}</div>diff --git a/src/components/model-access-view.tsx b/src/components/model-access-view.tsxindex b7b158ad..07c8385d 100644--- a/src/components/model-access-view.tsx+++ b/src/components/model-access-view.tsx@@ -2,12 +2,14 @@import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";import { Ban, CheckCircle2, CircleHelp, CreditCard, ExternalLink, FlaskConical, Globe, Info, RotateCcw, Search } from "lucide-react";+import Link from "next/link";import { Fragment, useDeferredValue, useEffect, useMemo, useRef, useState } from "react";import { toast } from "sonner";import { Button } from "@/components/ui/button";import { Skeleton } from "@/components/ui/skeleton";import { Switch } from "@/components/ui/switch";import { useProgressive } from "@/components/use-progressive";+import { useHydrated, useViewer } from "@/lib/api";import { kindLabel, LICENCE_CLASSES, CLASS_LABEL, type LicenceClass, type LicenceInfo } from "@/lib/licences";import { allOn, applyChange, type AccessChange, type AccessList, type LoraInfo, type ModelAccess, type ModelEntry, type PackInfo } from "@/lib/model-access";import { cn } from "@/lib/utils";@@ -126,7 +128,7 @@ const chip = (active: boolean) =>const ENGINE_WORDS: Record<string, string> = { open: "Open source", cloud: "Cloud" };-function ModelRow({ m, on, onChange }: { m: ModelEntry; on: boolean; onChange: (on: boolean) => void }) {+function ModelRow({ m, on, onChange, disabled }: { m: ModelEntry; on: boolean; onChange: (on: boolean) => void; disabled?: boolean }) {const id = `model-${m.id}`;const runs = on && !m.offBy.length;return (@@ -145,7 +147,7 @@ function ModelRow({ m, on, onChange }: { m: ModelEntry; on: boolean; onChange: ({on && m.offBy.length > 0 && <p className="mt-1 text-[12px] font-medium text-warning">Not offered: {m.offBy.join(" and ")}</p>}{on && m.partly.length > 0 && <p className="mt-1 text-[12px] text-muted-foreground">Partly: {m.partly.join(" and ")}, so it runs on what is still on</p>}</div>- <Switch id={id} className="mt-1" checked={on} onCheckedChange={onChange} aria-describedby={runs ? undefined : `${id}-state`} />+ <Switch id={id} className="mt-1" checked={on} onCheckedChange={onChange} disabled={disabled} aria-describedby={runs ? undefined : `${id}-state`} />{!runs && (<span id={`${id}-state`} className="sr-only">{on ? "on, but not offered" : "off"}@@ -155,7 +157,7 @@ function ModelRow({ m, on, onChange }: { m: ModelEntry; on: boolean; onChange: ();}-function LoraRow({ l, on, onChange }: { l: LoraInfo; on: boolean; onChange: (on: boolean) => void }) {+function LoraRow({ l, on, onChange, disabled }: { l: LoraInfo; on: boolean; onChange: (on: boolean) => void; disabled?: boolean }) {const id = `lora-${l.file}`;return (<li className="flex items-start gap-3 py-3.5">@@ -168,12 +170,12 @@ function LoraRow({ l, on, onChange }: { l: LoraInfo; on: boolean; onChange: (on:</p><LicenceLine licence={l.licence} /></div>- <Switch id={id} className="mt-1" checked={on} onCheckedChange={onChange} />+ <Switch id={id} className="mt-1" checked={on} onCheckedChange={onChange} disabled={disabled} /></li>);}-function PackRow({ p, on, onChange }: { p: PackInfo; on: boolean; onChange: (on: boolean) => void }) {+function PackRow({ p, on, onChange, disabled }: { p: PackInfo; on: boolean; onChange: (on: boolean) => void; disabled?: boolean }) {const id = `pack-${p.name}`;return (<li className="flex items-start gap-3 py-3.5">@@ -187,13 +189,33 @@ function PackRow({ p, on, onChange }: { p: PackInfo; on: boolean; onChange: (on:</p><LicenceLine licence={p.licence} /></div>- <Switch id={id} className="mt-1" checked={on} onCheckedChange={onChange} />+ <Switch id={id} className="mt-1" checked={on} onCheckedChange={onChange} disabled={disabled} /></li>);}const matches = (q: string, ...texts: (string | undefined)[]) => !q || texts.some((t) => t?.toLowerCase().includes(q));+/** The page's line under its title. The owner decides what this install offers; anyone else reads what it does. */+export function ModelAccessIntro() {+ const hydrated = useHydrated();+ const v = useViewer().data;+ const known = hydrated && v;+ return (+ <>+ Every model, LoRA and node pack Fuobe can run, with its licence: paid and open, commercial or not.{" "}+ {known &&+ (v.owner+ ? "Licences are information here; you decide what this install offers. Everything is on until you switch it off, and what is off leaves every picker and is refused on the server. "+ : "What is switched off leaves every picker. ")}+ <Link href="/settings/about" className="text-brand-text underline-offset-2 hover:underline">+ About & licences+ </Link>{" "}+ has the notices and a link to each open model's licence.+ </>+ );+}+export function ModelAccessView() {const qc = useQueryClient();const list = useQuery({@@ -227,7 +249,11 @@ export function ModelAccessView() {// Pickers, ⌘K and the Models page read what is off from the status.onSettled: () => void qc.invalidateQueries({ queryKey: ["status"] }),});- const flip = (c: AccessChange) => change.mutate([c]);+ // The switches are the owner's: anyone else reads them (the server would refuse a change anyway).+ const owner = useViewer().data?.owner === true;+ const flip = (c: AccessChange) => {+ if (owner) change.mutate([c]);+ };const [tab, setTab] = useState<Tab>("models");const [show, setShow] = useState<Show>("all");@@ -274,7 +300,9 @@ export function ModelAccessView() {const offLoras = data.loras.filter((l) => access.loras.includes(l.file) || access.classes.includes(l.licence.class)).length;// What the switches do, each said once: models that no longer run, LoRAs left out, and the GPU-only LoRA rule.const summary = allOn(access)- ? "Everything is on. Switch off what this install shouldn't offer: it leaves the pickers and the server refuses it."+ ? owner+ ? "Everything is on. Switch off what this install shouldn't offer: it leaves the pickers and the server refuses it."+ : "Everything is on.": [offModels ? `${offModels} ${offModels === 1 ? "model is" : "models are"} turned off by the switches below` : "Every model still runs",offLoras > 0 && `${offLoras} ${offLoras === 1 ? "LoRA is" : "LoRAs are"} left out of runs`,@@ -304,8 +332,9 @@ export function ModelAccessView() {{data.models.length - offModels} of {data.models.length} models offered</p><p className="mt-0.5 text-[13px] text-muted-foreground">{summary}</p>+ {!owner && <p className="mt-0.5 text-[13px] text-muted-foreground">The studio's owner chooses what this install offers.</p>}</div>- {!allOn(access) && (+ {owner && !allOn(access) && (<Button variant="secondary" size="sm" className="h-9 shrink-0 self-start sm:self-center" onClick={() => flip({ kind: "reset" })} disabled={change.isPending}><RotateCcw /> Back to the defaults</Button>@@ -317,7 +346,8 @@ export function ModelAccessView() {By licence</h2><p className="mt-1 text-[13px] text-muted-foreground">- Switch off a whole kind of licence at once: the models and LoRAs under it. A model whose cloud and GPU halves differ keeps the half that is on. Node packs have their own switches below.+ {owner && "Switch off a whole kind of licence at once: the models and LoRAs under it. A model whose cloud and GPU halves differ keeps the half that is on. Node packs have their own switches below. "}+ The counts are the {data.models.length} models in Fuobe's catalog, open and paid: one that runs both on a GPU and in the cloud counts under each of its licences.</p><ul className="mt-1 divide-y">{data.classes.map((c) => (@@ -329,6 +359,7 @@ export function ModelAccessView() {hint={c.hint}checked={!access.classes.includes(c.id)}onChange={(on) => flip({ kind: "class", id: c.id, on })}+ disabled={!owner}/>))}</ul>@@ -348,6 +379,7 @@ export function ModelAccessView() {count={`· ${p.models} ${p.models === 1 ? "model" : "models"}`}checked={!access.providers.includes(p.id)}onChange={(on) => flip({ kind: "provider", id: p.id, on })}+ disabled={!owner}/>))}</ul>@@ -364,6 +396,7 @@ export function ModelAccessView() {hint="Some civitai LoRAs allow commercial use but not running them on another hosted service (no “Rent” permission). Off: they go to fal.ai or Replicate like any other LoRA, and the run says so. On: cloud runs leave them out."checked={access.keepGpuOnlyLoras}onChange={(on) => flip({ kind: "keepGpuOnlyLoras", on })}+ disabled={!owner}/></ul></section>@@ -412,7 +445,7 @@ export function ModelAccessView() {</h3><ul className="divide-y">{g.items.map((m) => (- <ModelRow key={m.id} m={m} on={modelOn(m)} onChange={(on) => flip({ kind: "model", id: m.id, on })} />+ <ModelRow key={m.id} m={m} on={modelOn(m)} onChange={(on) => flip({ kind: "model", id: m.id, on })} disabled={!owner} />))}</ul></Fragment>@@ -420,14 +453,14 @@ export function ModelAccessView() {{tab === "loras" && (<ul className="divide-y">{loras.slice(0, shown).map((l) => (- <LoraRow key={l.file} l={l} on={!access.loras.includes(l.file)} onChange={(on) => flip({ kind: "lora", id: l.file, on })} />+ <LoraRow key={l.file} l={l} on={!access.loras.includes(l.file)} onChange={(on) => flip({ kind: "lora", id: l.file, on })} disabled={!owner} />))}</ul>)}{tab === "packs" && (<ul className="divide-y">{packs.slice(0, shown).map((p) => (- <PackRow key={p.name} p={p} on={!access.packs.includes(p.name)} onChange={(on) => flip({ kind: "pack", id: p.name, on })} />+ <PackRow key={p.name} p={p} on={!access.packs.includes(p.name)} onChange={(on) => flip({ kind: "pack", id: p.name, on })} disabled={!owner} />))}</ul>)}diff --git a/src/components/models-table.tsx b/src/components/models-table.tsxindex a7f6fcf1..ad8f9381 100644--- a/src/components/models-table.tsx+++ b/src/components/models-table.tsx@@ -7,10 +7,13 @@ import { useProgressive } from "@/components/use-progressive";import { useToday } from "@/hooks/use-today";import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";import Link from "next/link";-import { useEngine, useModelAccess } from "@/lib/api";+import { IntentLink } from "@/components/intent-link";+import { useEngine, useHydrated, useModelAccess, useStatus } from "@/lib/api";+import { providerEngine } from "@/lib/catalog/engines";+import { PROVIDER_NAME } from "@/lib/licences";import { offered } from "@/lib/model-access";-import type { Engine, MediaKind } from "@/lib/catalog/types";-import { enginesLabel, modelSearchText, rowPrice, type ModelRow } from "@/lib/model-rows";+import type { Engine, MediaKind, ProviderId } from "@/lib/catalog/types";+import { enginesLabel, modelSearchText, rowPriceOn, type ModelRow } from "@/lib/model-rows";import { cn } from "@/lib/utils";const KIND_LABEL: Partial<Record<MediaKind, string>> = { image: "Image", video: "Video", audio: "Audio", text: "Text", model3d: "3D" };@@ -21,8 +24,13 @@ const chip = (active: boolean) =>active && "bg-secondary text-foreground",);-/** Where a model runs, behind a small button (the endpoint list is long and only some people need it). */-function RouteDetails({ row }: { row: ModelRow }) {+/**+ * Where a model runs, behind a small button: the providers by name, and the endpoints and id under "Technical details"+ * (long, and only some people need them). `only`: the install runs one engine, so only its routes count.+ */+function RouteDetails({ row, only }: { row: ModelRow; only?: Engine }) {+ const routes = only ? row.routes.filter((r) => providerEngine(r.slice(0, r.indexOf(":")) as ProviderId) === only) : row.routes;+ const providers = [...new Set(routes.map((r) => r.slice(0, r.indexOf(":"))))].map((p) => PROVIDER_NAME[p] ?? p);return (<Popover><PopoverTrigger asChild>@@ -33,36 +41,55 @@ function RouteDetails({ row }: { row: ModelRow }) {<Info className="size-3.5" />{/* The name starts with the visible text ("3 routes"), so speech users can say it. */}<span className="max-sm:sr-only">- {row.routes.length} route{row.routes.length === 1 ? "" : "s"}+ {routes.length} route{routes.length === 1 ? "" : "s"}</span><span className="sr-only">: where {row.name} runs</span></button></PopoverTrigger><PopoverContent align="end" collisionPadding={12} className="w-[min(92vw,420px)] p-3"><p className="text-[12px] font-medium">{row.name} runs on</p>- <ul className="mt-2 space-y-1">- {row.routes.map((r) => (- <li key={r} className="font-mono text-[11px] break-all text-muted-foreground">- {r}- </li>- ))}- </ul>- <p className="mt-2 font-mono text-[11px] text-muted-foreground">id {row.id}</p>+ <p className="mt-1 text-[13px]">{providers.join(" · ")}</p>+ {row.href && (+ <IntentLink href={row.href} className="mt-2 inline-block text-[13px] font-medium text-brand-text underline-offset-2 hover:underline">+ Open it+ </IntentLink>+ )}+ <details className="mt-2">+ <summary className="cursor-pointer text-[12px] text-muted-foreground hover:text-foreground">Technical details</summary>+ <ul className="mt-1.5 space-y-1">+ {routes.map((r) => (+ <li key={r} className="font-mono text-[11px] break-all text-muted-foreground">+ {r}+ </li>+ ))}+ </ul>+ <p className="mt-2 font-mono text-[11px] text-muted-foreground">id {row.id}</p>+ </details></PopoverContent></Popover>);}-/** One model; `today` (the browser's day, null while the page prerenders) picks a launch price or the list price. */-const Row = memo(function Row({ m, today }: { m: ModelRow; today: number | null }) {- const price = rowPrice(m, today);+/**+ * One model; `today` (the browser's day, null while the page prerenders) picks a launch price or the list price. `only`:+ * the install runs one engine (a visitor's is open), so a Fuobe Original shows that engine alone.+ */+const Row = memo(function Row({ m, today, only }: { m: ModelRow; today: number | null; only?: Engine }) {+ const price = rowPriceOn(m, today, only);+ const engines = only ? m.engines.filter((e) => e === only) : m.engines;return (<tr className="align-top hover:bg-accent/50"><td className="px-3 py-3 sm:px-4"><div className="flex flex-wrap items-center gap-1.5 font-medium">- {m.engines.includes("open") && <Cpu className="size-3.5 shrink-0 md:hidden" aria-label="Open source" />}- {m.engines.includes("cloud") && <Cloud className="size-3.5 shrink-0 md:hidden" aria-label="Cloud" />}- {m.name}+ {engines.includes("open") && <Cpu className="size-3.5 shrink-0 md:hidden" aria-label="Open source" />}+ {engines.includes("cloud") && <Cloud className="size-3.5 shrink-0 md:hidden" aria-label="Cloud" />}+ {m.href ? (+ <IntentLink href={m.href} className="underline-offset-2 hover:text-brand-text hover:underline">+ {m.name}+ </IntentLink>+ ) : (+ m.name+ )}{m.badges.map((b) => (<spankey={b}@@ -87,20 +114,42 @@ const Row = memo(function Row({ m, today }: { m: ModelRow; today: number | null</td><td className="hidden px-4 py-3 whitespace-nowrap md:table-cell"><span className="inline-flex items-center gap-1">- {m.engines.includes("open") && <Cpu className="size-3.5" />}- {m.engines.includes("cloud") && <Cloud className="size-3.5" />}- {enginesLabel(m.engines)}+ {engines.includes("open") && <Cpu className="size-3.5" />}+ {engines.includes("cloud") && <Cloud className="size-3.5" />}+ {enginesLabel(engines)}</span></td><td className="hidden px-4 py-3 text-[12px] text-muted-foreground md:table-cell">{m.ops.join(" · ")}</td><td className="hidden px-4 py-3 font-mono text-[12px] whitespace-nowrap sm:table-cell">{price}</td><td className="px-2 py-2.5 text-right">- <RouteDetails row={m} />+ <RouteDetails row={m} only={only} /></td></tr>);});+/**+ * The page's line under its title, by the install's engine mode once it is known (a visitor's is open source only:+ * the cloud runs on the owner's keys, which a visitor never uses).+ */+export function ModelsIntro() {+ const hydrated = useHydrated();+ const mode = useStatus().data?.engineMode;+ const known = hydrated ? mode : undefined;+ return (+ <>+ Every model Fuobe can drive.+ {known &&+ (known === "open"+ ? " On this studio, each runs as a ComfyUI workflow on your own GPU."+ : known === "cloud"+ ? " On this studio, each runs through your fal.ai or Replicate key."+ : " Cloud models run through your fal.ai or Replicate key; open-source models run as ComfyUI workflows on your own GPU.")}+ {known && " Click a name to open it where it runs."}+ </>+ );+}+/*** A link's ?q= (the ⌘K palette's "open this model" for models no studio offers) fills the search.* It reads the URL, so it sits under its own Suspense: the table itself stays in the static page.@@ -127,13 +176,10 @@ export function ModelsTable({ models }: { models: ModelRow[] }) {const switchedOff = models.length - on.length;const index = useMemo(() => on.map((m) => [m, modelSearchText(m)] as const), [on]);const kinds = useMemo(() => [...new Set(models.map((m) => m.kind))], [models]);- const list = useMemo(- () =>- index- .filter(([m, text]) => (engine === "all" || (m.engines.includes(engine) && offered(access, m.id, engine))) && (kind === "all" || m.kind === kind) && (!term || text.includes(term)))- .map(([m]) => m),- [index, engine, kind, term, access],- );+ // What the search can reach: the engine's models (a visitor's engine is open source only).+ const searchable = useMemo(() => index.filter(([m]) => engine === "all" || (m.engines.includes(engine) && offered(access, m.id, engine))), [index, engine, access]);+ const list = useMemo(() => searchable.filter(([m, text]) => (kind === "all" || m.kind === kind) && (!term || text.includes(term))).map(([m]) => m), [searchable, kind, term]);+ const only = mode === "both" ? undefined : mode;// 40 rows in the page's HTML, the rest as you scroll.const { shown, hasMore, moreFrom, sentinel, left } = useProgressive(list.length, `${engine}|${kind}|${term}`, 40, 60);const rows = useRef<HTMLTableSectionElement>(null);@@ -157,17 +203,25 @@ export function ModelsTable({ models }: { models: ModelRow[] }) {window.history.replaceState(null, "", url);}}}- placeholder={`Search ${models.length} models`}+ placeholder={`Search ${searchable.length} ${engine === "open" ? "open-source " : engine === "cloud" ? "cloud " : ""}models`}aria-label="Search models"className="h-9 w-full rounded-full border bg-background pr-3 pl-9 text-[14px] outline-none placeholder:text-subtle-foreground focus:border-primary focus:ring-4 focus:ring-brand-faint"/></div><div className="scrollbar-none -mx-1 flex min-w-0 items-center gap-1 overflow-x-auto px-1">- {(mode === "both" ? (["all", "cloud", "open"] as const) : [mode]).map((e) => (- <button key={e} type="button" aria-pressed={engine === e} className={chip(engine === e)} onClick={() => setEngine(e)}>- {e === "all" ? "All engines" : e === "cloud" ? "Cloud" : "Open source"}- </button>- ))}+ {only ? (+ // One engine: nothing to choose, so a label rather than a button that does nothing.+ <span className="inline-flex h-8 shrink-0 items-center gap-1.5 rounded-full bg-secondary px-3 text-[13px] font-medium whitespace-nowrap">+ {only === "open" ? <Cpu className="size-3.5" aria-hidden /> : <Cloud className="size-3.5" aria-hidden />}+ {only === "open" ? "Open source" : "Cloud"}+ </span>+ ) : (+ (["all", "cloud", "open"] as const).map((e) => (+ <button key={e} type="button" aria-pressed={engine === e} className={chip(engine === e)} onClick={() => setEngine(e)}>+ {e === "all" ? "All engines" : e === "cloud" ? "Cloud" : "Open source"}+ </button>+ ))+ )}<span className="mx-1 h-5 w-px shrink-0 bg-border" />{(["all", ...kinds] as const).map((k) => (<button key={k} type="button" aria-pressed={kind === k} className={chip(kind === k)} onClick={() => setKind(k)}>@@ -203,7 +257,7 @@ export function ModelsTable({ models }: { models: ModelRow[] }) {</thead><tbody ref={rows} className="divide-y">{list.slice(0, shown).map((m) => (- <Row key={m.id} m={m} today={today} />+ <Row key={m.id} m={m} today={today} only={only} />))}</tbody></table>diff --git a/src/components/nav-items.ts b/src/components/nav-items.tsindex 5b65e486..0adfd056 100644--- a/src/components/nav-items.ts+++ b/src/components/nav-items.ts@@ -26,6 +26,7 @@ import {Network,PersonStanding,Presentation,+ Scale,Scissors,Settings,Shapes,@@ -136,6 +137,7 @@ export const NAV: NavGroupDef[] = [{ href: "/workflows", label: "ComfyUI workflows", short: "Workflows", icon: Workflow, keywords: "open source graphs" },{ href: "/settings", label: "Settings", icon: Settings, keywords: "keys preferences" },{ href: "/status", label: "Project status", short: "Status", icon: ListChecks, keywords: "parity progress" },+ { href: "/settings/about", label: "About & licences", short: "Licences", icon: Scale, keywords: "licence license mit notices credits version open source" },],collapsible: true,compact: true,diff --git a/src/components/owner-settings.tsx b/src/components/owner-settings.tsxindex 4a35a7f0..a2715059 100644--- a/src/components/owner-settings.tsx+++ b/src/components/owner-settings.tsx@@ -1,12 +1,28 @@"use client";+import { Info, Loader2, Scale, Trash2 } from "lucide-react";import Link from "next/link";+import { useId, useState } from "react";import { Button } from "@/components/ui/button";+import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from "@/components/ui/dialog";+import { Input } from "@/components/ui/input";+import { Label } from "@/components/ui/label";import { signInHref, useHydrated, useViewer } from "@/lib/api";+/** Settings' line under its title: what this viewer finds on the page. Nothing until the viewer is known (as below). */+export function SettingsIntro() {+ const hydrated = useHydrated();+ const v = useViewer().data;+ if (!hydrated || !v) return null;+ if (v.owner)+ return "Choose open source, paid APIs or both, connect providers, point Fuobe at your ComfyUI server, and choose how prompts get enhanced. Keys stay on this server.";+ return v.account ? "Your account and your GPU. The studio's own settings, keys and tokens are its owner's." : "Create a free account and connect your own GPU.";+}+/*** The install's settings, for its owner only. A guest (public sign-up) is offered an account, which- * connects its own GPU here; an account sees Your GPU (AccountGpuSection) and nothing of the install's.+ * connects its own GPU here; an account sees Your GPU (AccountGpuSection) and its account, nothing of the install's.+ * Both can read the licences.*/export function OwnerSettings({ children }: { children: React.ReactNode }) {// The server renders nothing here (it doesn't know the viewer), so hydration must too, even when the browser's@@ -15,21 +31,145 @@ export function OwnerSettings({ children }: { children: React.ReactNode }) {const v = useViewer().data;if (!hydrated || !v) return null;if (v.owner) return <>{children}</>;- if (v.account) return <p className="py-8 text-[13px] text-muted-foreground">The studio's own settings, keys and tokens are its owner's.</p>;return (- <section className="space-y-3 py-8">- <h2 className="text-[15px] font-semibold">Run Fuobe on your own GPU</h2>- <p className="max-w-xl text-[13px] text-muted-foreground">- Create a free account, then connect your own ComfyUI: your runs go to your GPU. It must be reachable from the internet, for example through a Cloudflare Tunnel or ngrok.- </p>- <div className="flex gap-2">- <Button asChild size="sm">- <Link href={signInHref("signup", "/settings#your-gpu")}>Sign up free</Link>- </Button>- <Button asChild size="sm" variant="secondary">- <Link href={signInHref("login", "/settings#your-gpu")}>Log in</Link>+ <>+ {v.account ? (+ <AccountSection email={v.account.email} />+ ) : (+ <section className="space-y-3 border-b py-8">+ <h2 className="text-[15px] font-semibold">Run Fuobe on your own GPU</h2>+ <p className="max-w-xl text-[13px] text-muted-foreground">+ Create a free account, then connect your own ComfyUI: your runs go to your GPU. It must be reachable from the internet, for example through a Cloudflare Tunnel or ngrok.+ </p>+ <div className="flex gap-2">+ <Button asChild size="sm">+ <Link href={signInHref("signup", "/settings#your-gpu")}>Sign up free</Link>+ </Button>+ <Button asChild size="sm" variant="secondary">+ <Link href={signInHref("login", "/settings#your-gpu")}>Log in</Link>+ </Button>+ </div>+ </section>+ )}+ <Licences />+ </>+ );+}++const linkCard = "inline-flex items-center gap-2 rounded-xl border px-4 py-3 text-[13px] font-medium transition-colors hover:bg-accent";++/** The licence pages, which everyone may read (the owner finds them in the settings form). */+function Licences() {+ return (+ <section aria-labelledby="licences-title" className="grid grid-cols-[minmax(0,1fr)] gap-4 py-8 md:grid-cols-[260px_minmax(0,1fr)]">+ <div className="min-w-0">+ <h2 id="licences-title" className="text-[15px] font-semibold">+ Licences+ </h2>+ <p className="mt-1 text-[13px] text-muted-foreground">Every model's licence, Fuobe's own, and the notices the open models ask for.</p>+ </div>+ <div className="flex flex-wrap content-start gap-2">+ <Link href="/settings/models" className={linkCard}>+ <Scale className="size-4 text-muted-foreground" /> Models & licences+ </Link>+ <Link href="/settings/about" className={linkCard}>+ <Info className="size-4 text-muted-foreground" /> About & licences+ </Link>+ </div>+ </section>+ );+}++/** An account's own: deleting it (its password again, DELETE /api/auth/me) takes its runs, files and GPU with it. */+function AccountSection({ email }: { email: string }) {+ const id = useId();+ const [open, setOpen] = useState(false);+ const [password, setPassword] = useState("");+ const [busy, setBusy] = useState(false);+ const [error, setError] = useState("");+ const remove = async (e: React.FormEvent) => {+ e.preventDefault();+ setBusy(true);+ setError("");+ try {+ const res = await fetch("/api/auth/me", { method: "DELETE", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ password }) });+ if (res.status === 204) {+ // A full load: the page and every cached answer were the account's.+ window.location.replace(window.location.origin);+ return;+ }+ const body = (await res.json().catch(() => ({}))) as { error?: string };+ setError(body.error ?? `The account wasn't deleted (${res.status})`);+ } catch {+ setError("The account wasn't deleted: the studio didn't answer. Try again.");+ }+ setBusy(false);+ };+ return (+ <section id="account" aria-labelledby="account-title" className="grid scroll-mt-28 grid-cols-[minmax(0,1fr)] gap-4 border-b py-8 md:scroll-mt-20 md:grid-cols-[260px_minmax(0,1fr)]">+ <div className="min-w-0">+ <h2 id="account-title" className="text-[15px] font-semibold">+ Account+ </h2>+ <p className="mt-1 text-[13px] [overflow-wrap:anywhere] text-muted-foreground">{email}</p>+ </div>+ <div className="min-w-0 space-y-2">+ <p className="max-w-xl text-[13px] text-muted-foreground">Deleting your account removes your uploads, your runs and their files, and your GPU connection, and signs you out. It can't be undone.</p>+ <Button size="sm" variant="outline" className="text-destructive" onClick={() => setOpen(true)}>+ <Trash2 /> Delete account</Button></div>+ <Dialog+ open={open}+ onOpenChange={(o) => {+ if (busy) return;+ setOpen(o);+ setPassword("");+ setError("");+ }}+ >+ <DialogContent className="sm:max-w-md">+ <form onSubmit={remove} className="space-y-4">+ <DialogHeader>+ <DialogTitle>Delete your account?</DialogTitle>+ <DialogDescription>+ {email} and everything you made with it go for good. Enter your password to confirm.+ </DialogDescription>+ </DialogHeader>+ <div className="space-y-1.5">+ <Label htmlFor={`${id}-password`} className="text-[13px]">+ Password+ </Label>+ <Input+ id={`${id}-password`}+ type="password"+ autoComplete="current-password"+ value={password}+ onChange={(e) => setPassword(e.target.value)}+ aria-invalid={!!error}+ aria-describedby={error ? `${id}-error` : undefined}+ autoFocus+ />+ {error && (+ <p id={`${id}-error`} role="alert" className="text-[12px] text-destructive">+ {error}+ </p>+ )}+ </div>+ <DialogFooter>+ <DialogClose asChild>+ <Button type="button" variant="ghost" disabled={busy}>+ Cancel+ </Button>+ </DialogClose>+ <Button type="submit" variant="destructive" disabled={busy || !password}>+ {busy && <Loader2 className="animate-spin" />}+ Delete account+ </Button>+ </DialogFooter>+ </form>+ </DialogContent>+ </Dialog></section>);}diff --git a/src/components/preset-gallery.tsx b/src/components/preset-gallery.tsxindex 2417373d..d3cd7802 100644--- a/src/components/preset-gallery.tsx+++ b/src/components/preset-gallery.tsx@@ -101,7 +101,14 @@ const RUNS_ON: { value: RunsOn; label: string; icon?: typeof Cloud }[] = [];/** "Runs on: All · Cloud · Open source", as a radio group with arrow-key support. */-function RunsOnControl({ value, onChange, locked }: { value: RunsOn; onChange: (v: RunsOn) => void; locked?: "cloud" | "open" }) {+function RunsOnControl({ value, onChange, locked, owner }: { value: RunsOn; onChange: (v: RunsOn) => void; locked?: "cloud" | "open"; owner: boolean }) {+ // Only the owner has Settings → Engine mode; a visitor reads the lock and goes nowhere.+ if (locked && !owner)+ return (+ <span className="inline-flex h-9 shrink-0 items-center gap-1.5 rounded-full bg-muted px-3 text-[13px] text-muted-foreground" title="Set by the studio's owner">+ <Lock className="size-3.5" /> {locked === "open" ? "Open source only" : "Cloud only"}+ </span>+ );if (locked)return (<Link@@ -253,7 +260,7 @@ export function PresetGallery({<span className="order-last text-[12px] whitespace-nowrap text-muted-foreground tabular-nums sm:order-first sm:mr-2" aria-live="polite">{list.length === presets.length ? `${presets.length} ${noun}` : `${list.length} of ${presets.length}`}</span>- <RunsOnControl value={runsOn} onChange={setRunsOn} locked={locked} />+ <RunsOnControl value={runsOn} onChange={setRunsOn} locked={locked} owner={!!viewer?.owner} /></div></div>{visitor && badges && !badges.connected && !badges.off && (diff --git a/src/components/workflows-view.tsx b/src/components/workflows-view.tsxindex 0da43709..3eaadbfb 100644--- a/src/components/workflows-view.tsx+++ b/src/components/workflows-view.tsx@@ -1,7 +1,7 @@"use client";import { useQuery } from "@tanstack/react-query";-import { CheckCircle2, Circle, CircleAlert, Copy, ExternalLink, RotateCcw, Search, Workflow } from "lucide-react";+import { CheckCircle2, Circle, CircleAlert, Copy, Download, ExternalLink, RotateCcw, Search, Workflow } from "lucide-react";import Link from "next/link";import { useDeferredValue, useMemo, useRef, useState } from "react";import { toast } from "sonner";@@ -11,7 +11,8 @@ import { Skeleton } from "@/components/ui/skeleton";import { useProgressive } from "@/components/use-progressive";import { copyText } from "@/lib/clipboard";import type { ManifestWorkflow } from "@/lib/comfy";-import { installScript } from "@/lib/comfy-install";+import { installScript, workflowSource } from "@/lib/comfy-install";+import { modelCardOf } from "@/lib/licences";import { cn } from "@/lib/utils";import { capabilityGroup, usedByIndex, WORKFLOW_GROUPS, type ComfyRoute } from "@/lib/workflow-usage";@@ -32,9 +33,30 @@ async function fetchStatus(): Promise<ComfyStatus> {return { reachable: body.reachable === null ? null : !!body.reachable, generatedAt: body.generatedAt ?? "", comfyuiCommit: body.comfyuiCommit, workflows: body.workflows ?? [] };}+/**+ * Saves a workflow's graph as a file. GitHub serves it as text from another site, where a link's download attribute+ * doesn't count, so it's fetched and saved here; if that fails, the file opens in a new tab.+ */+async function downloadGraph(raw: string, name: string) {+ try {+ const res = await fetch(raw);+ if (!res.ok) throw new Error(String(res.status));+ const url = URL.createObjectURL(new Blob([await res.text()], { type: "application/json" }));+ const a = document.createElement("a");+ a.href = url;+ a.download = name;+ a.click();+ setTimeout(() => URL.revokeObjectURL(url), 1000);+ } catch {+ window.open(raw, "_blank", "noopener,noreferrer");+ }+}+function WorkflowCard({ wf, usedBy }: { wf: WF; usedBy: string[] }) {const missing = wf.models.filter((m) => m.present === false && !m.optional).length;const total = wf.models.reduce((a, m) => a + (m.optional ? 0 : (m.sizeGb ?? 0)), 0);+ const source = workflowSource(wf.file);+ const name = wf.file.slice(wf.file.lastIndexOf("/") + 1);return (<article className="flex min-w-0 flex-col gap-3 rounded-xl border bg-background p-4"><div className="flex flex-wrap items-start justify-between gap-2">@@ -61,16 +83,30 @@ function WorkflowCard({ wf, usedBy }: { wf: WF; usedBy: string[] }) {<ul className="space-y-1 text-[12px]">{wf.models.map((m) => (<li key={m.file} className="flex min-w-0 items-center gap-2">+ {/* A mark only once a GPU has said what it has (present is null for a visitor with none connected). */}{m.present === true ? (<CheckCircle2 className="size-3.5 shrink-0 text-success" aria-label="Installed" />- ) : m.present === false && !m.optional ? (- <CircleAlert className="size-3.5 shrink-0 text-warning" aria-label="Missing" />- ) : (- <Circle className="size-3.5 shrink-0 text-muted-foreground" aria-label="Unknown" />- )}+ ) : m.present === false ? (+ m.optional ? (+ <Circle className="size-3.5 shrink-0 text-muted-foreground" aria-label="Not installed (optional)" />+ ) : (+ <CircleAlert className="size-3.5 shrink-0 text-warning" aria-label="Missing" />+ )+ ) : null}<span className="min-w-0 truncate font-mono" title={m.file}>{m.file}</span>+ {m.gated && m.url && (+ <a+ href={modelCardOf(m.url) ?? m.url}+ target="_blank"+ rel="noreferrer"+ title="Accept the licence on Hugging Face, then download with your Hugging Face token"+ className="shrink-0 rounded-full bg-warning/15 px-1.5 text-[11px] whitespace-nowrap text-foreground hover:underline"+ >+ gated<span className="max-sm:hidden"> · accept licence</span>+ </a>+ )}<span className="hidden shrink-0 text-muted-foreground sm:inline">{m.folder}</span>{m.optional && <span className="shrink-0 text-muted-foreground">optional</span>}{m.sizeGb ? <span className="ml-auto shrink-0 font-mono text-muted-foreground">{m.sizeGb} GB</span> : null}@@ -95,7 +131,7 @@ function WorkflowCard({ wf, usedBy }: { wf: WF; usedBy: string[] }) {</p>)}{wf.notes && <p className="text-[12px] leading-relaxed break-words text-muted-foreground">{wf.notes}</p>}- <div className="mt-auto flex gap-2 pt-1">+ <div className="mt-auto flex flex-wrap gap-2 pt-1"><Buttonvariant="secondary"size="sm"@@ -107,6 +143,24 @@ function WorkflowCard({ wf, usedBy }: { wf: WF; usedBy: string[] }) {><Copy /> <span className="truncate">{missing ? `Copy install commands (${missing} missing)` : "Copy install commands"}</span></Button>+ <Button asChild variant="ghost" size="sm">+ <a+ href={source.raw}+ download={name}+ onClick={(e) => {+ e.preventDefault();+ void downloadGraph(source.raw, name);+ }}+ >+ <Download /> Download JSON+ </a>+ </Button>+ <Button asChild variant="ghost" size="sm">+ <a href={source.page} target="_blank" rel="noreferrer">+ <ExternalLink /> View on GitHub+ <span className="sr-only">(opens in a new tab)</span>+ </a>+ </Button></div></article>);diff --git a/src/lib/comfy-install.ts b/src/lib/comfy-install.tsindex 19621b8d..8efc2847 100644--- a/src/lib/comfy-install.ts+++ b/src/lib/comfy-install.ts@@ -3,9 +3,20 @@* the model files it still lacks. Pure (no I/O), so it can be tested and run in the browser.*/import type { ManifestModel, ManifestWorkflow } from "./comfy";+import { FUOBE_REPO } from "./connections";+import { modelCardOf } from "./licences";type Installable = Pick<ManifestWorkflow, "customNodes"> & { models: (ManifestModel & { present?: boolean | null })[] };+/** The workflow library's folder on GitHub. */+export const WORKFLOWS_ON_GITHUB = `${FUOBE_REPO}/tree/main/workflows/comfyui`;++/** A workflow's graph in Fuobe's repo: the file itself (to download), and its page on GitHub. */+export function workflowSource(file: string): { raw: string; page: string } {+ const at = `workflows/comfyui/${file}`;+ return { raw: `${FUOBE_REPO.replace("https://github.com/", "https://raw.githubusercontent.com/")}/main/${at}`, page: `${FUOBE_REPO}/blob/main/${at}` };+}+/*** A pinned GitHub address the manifest links to (…/tree/<commit>, or …/tree/<commit>/<folder> for a pack that lives* in a folder of a bigger repo): the repo to clone, the commit, and the folder. Undefined for a plain repo address.@@ -42,11 +53,14 @@ export function nodeInstall(node: { name: string; repo: string }): string {export function installScript(wf: Installable): string {// Optional alternatives (FILM for RIFE) are listed on the card, not installed by default. A file under a subfolder// (DBS: models/dbs/DBS-BSRNN-DnR/model.safetensors) gets that folder made first.- const lines = wf.models- .filter((m) => m.url && m.present !== true && !m.optional)- .map((m) => {- const sub = m.file.includes("/") ? `/${m.file.slice(0, m.file.lastIndexOf("/"))}` : "";- return `mkdir -p "$COMFYUI/models/${m.folder}${sub}" && wget -c -O "$COMFYUI/models/${m.folder}/${m.file}" "${m.url}"`;- });- return ["COMFYUI=${COMFYUI:-$HOME/ComfyUI}", ...wf.customNodes.map(nodeInstall), ...lines].join("\n");+ const missing = wf.models.filter((m) => m.url && m.present !== true && !m.optional);+ // A gated download (LTX-2.5) answers 401 until its licence is accepted on Hugging Face and a token comes with it.+ const gated = [...new Set(missing.filter((m) => m.gated).map((m) => modelCardOf(m.url) ?? m.url!))];+ const accept = gated.map((page) => `# Gated: accept the licence at ${page}, then export HF_TOKEN=<your Hugging Face token>`);+ const lines = missing.map((m) => {+ const sub = m.file.includes("/") ? `/${m.file.slice(0, m.file.lastIndexOf("/"))}` : "";+ const token = m.gated ? ` --header="Authorization: Bearer $HF_TOKEN"` : "";+ return `mkdir -p "$COMFYUI/models/${m.folder}${sub}" && wget -c${token} -O "$COMFYUI/models/${m.folder}/${m.file}" "${m.url}"`;+ });+ return ["COMFYUI=${COMFYUI:-$HOME/ComfyUI}", ...wf.customNodes.map(nodeInstall), ...accept, ...lines].join("\n");}diff --git a/src/lib/licences.ts b/src/lib/licences.tsindex dbbde853..628777ce 100644--- a/src/lib/licences.ts+++ b/src/lib/licences.ts@@ -28,6 +28,8 @@ export interface LicenceWorkflowInput {title: string;capability: string;license?: string;+ /** Its model downloads: a licence with no page of its own links to their Hugging Face page (licenceInfo). */+ models?: { url?: string; sizeGb?: number }[];}export interface LicenceRow {@@ -40,6 +42,8 @@ export interface LicenceRow {workflows: string[];/** Distinct licence texts of its workflows. */licences: string[];+ /** Where to read each of `licences` (same order; null when nothing is recorded), as Models & licences links it. */+ links: (string | null)[];flags: LicenceFlag[];/** Who a territory-restricted licence leaves out ("the EU, UK and South Korea"). */excludes?: string;@@ -120,12 +124,23 @@ function endpointIds(endpoint: string, workflows: LicenceWorkflowInput[]): strinreturn workflows.filter((w) => re.test(w.id)).map((w) => w.id);}-function rowFor(base: Omit<LicenceRow, "licences" | "flags" | "excludes" | "notices">, licences: string[]): LicenceRow & { noWeights: boolean } {+/** Where to read a licence its workflows state: its own page, else the largest download's model card (as licenceInfo). */+function licenceLink(text: string, workflows: LicenceWorkflowInput[]): string | null {+ const cards = workflows+ .filter((w) => workflowLicence(w) === text)+ .flatMap((w) => w.models ?? [])+ .sort((a, b) => (b.sizeGb ?? 0) - (a.sizeGb ?? 0))+ .flatMap((m) => (m.url ? [m.url] : []));+ return licenceInfo(text, cards).url ?? null;+}++function rowFor(base: Omit<LicenceRow, "licences" | "links" | "flags" | "excludes" | "notices">, licences: string[], workflows: LicenceWorkflowInput[]): LicenceRow & { noWeights: boolean } {const terms = licences.map(licenceTerms);const flags = (["non-commercial", "territory", "conditions"] as const).filter((f) => terms.some((t) => t.flags.includes(f)));return {...base,licences,+ links: licences.map((l) => licenceLink(l, workflows)),// A row with a stricter catch doesn't also say "conditions".flags: flags.includes("conditions") && flags.length > 1 ? flags.filter((f) => f !== "conditions") : flags,excludes: terms.find((t) => t.excludes)?.excludes,@@ -156,12 +171,13 @@ export function buildLicenceList(models: LicenceModelInput[], workflows: Licenceconst ids = [...new Set(m.routes.filter((r) => r.provider === "comfyui").flatMap((r) => endpointIds(r.endpoint, workflows)))];if (!ids.length || ids.every((id) => id.startsWith("selftest-"))) continue;ids.forEach((id) => used.add(id));- const licences = [...new Set(ids.map((id) => workflowLicence(byId.get(id) ?? { id })))];- add(rowFor({ id: m.id, name: m.name, by: m.vendor, kind: m.kind, workflows: ids, inCatalog: true }, licences));+ const wfs = ids.map((id) => byId.get(id) ?? { id, title: id, capability: m.kind });+ const licences = [...new Set(wfs.map(workflowLicence))];+ add(rowFor({ id: m.id, name: m.name, by: m.vendor, kind: m.kind, workflows: ids, inCatalog: true }, licences, wfs));}for (const w of workflows) {if (used.has(w.id) || w.id.startsWith("selftest-")) continue;- add(rowFor({ id: w.id, name: w.title, by: "Workflow library", kind: w.capability, workflows: [w.id], inCatalog: false }, [workflowLicence(w)]));+ add(rowFor({ id: w.id, name: w.title, by: "Workflow library", kind: w.capability, workflows: [w.id], inCatalog: false }, [workflowLicence(w)], [w]));}const notices = new Map<string, string[]>();diff --git a/src/lib/model-rows.ts b/src/lib/model-rows.tsindex ebb340f4..4fe91436 100644--- a/src/lib/model-rows.ts+++ b/src/lib/model-rows.ts@@ -29,6 +29,8 @@ export interface ModelRow {launch?: { until: string; price: string };/** Where it runs when that's not the obvious place ("Runs on the isolated ComfyUI worker"). */note?: string;+ /** Where it opens: a studio, app or tool with ?model= (the Models page adds it, from palette-index's modelHref). */+ href?: string;}/** The picker's and the Models page's note on models that run on the isolated ComfyUI worker. */@@ -80,6 +82,16 @@ export function rowPrice(r: Pick<ModelRow, "price" | "launch">, now: number | nureturn launchHolds(r.launch.until, now) ? r.launch.price : r.price;}+/**+ * The price a row shows when the install runs one engine only (`only`): a Fuobe Original is "Free" on the open engine,+ * and only its cloud price ("Free · $0.08 / second" without "Free · ") on the cloud. Otherwise rowPrice.+ */+export function rowPriceOn(r: Pick<ModelRow, "price" | "launch" | "engines">, now: number | null, only?: Engine): string {+ if (only === "open" && r.engines.includes("open")) return "Free";+ const price = rowPrice(r, now);+ return only === "cloud" && r.engines.length > 1 ? price.replace(/^Free · /, "") : price;+}+const PICKER_UNIT = { image: "/image", second: "/sec", video: "/video", request: "/run", megapixel: "/MP", minute: "/min" } as const;/**diff --git a/src/lib/nav.ts b/src/lib/nav.tsindex 557c2bcc..b3b53c14 100644--- a/src/lib/nav.ts+++ b/src/lib/nav.ts@@ -37,7 +37,8 @@ function queryMatches(query: string, search: URLSearchParams) {/*** Whether a nav link is the current page. A link with a query (`/library?tab=favorites`) is active* when the path and every one of its params match; a plain link is active on its path (and below it)- * unless a sibling query link to the same path matches better.+ * unless a sibling matches better: a query link to the same path, or a link to a page below it+ * (Settings yields to About & licences on /settings/about).*/export function navActive(href: string, pathname: string, search: URLSearchParams, siblings: string[] = []): boolean {if (!pathname) return false;@@ -46,6 +47,7 @@ export function navActive(href: string, pathname: string, search: URLSearchParamif (query) return queryMatches(query, search);return !siblings.some((s) => {const [p, q] = s.split("?");+ if (p !== path && p.startsWith(`${path === "/" ? "" : path}/`)) return pathMatches(p, pathname);return !!q && p === path && pathMatches(p, pathname) && queryMatches(q, search);});}diff --git a/src/lib/status-page.ts b/src/lib/status-page.tsnew file mode 100644index 00000000..b0cabfec--- /dev/null+++ b/src/lib/status-page.ts@@ -0,0 +1,44 @@+/**+ * The Project status page (/status): docs/STATUS.md rendered under a short public summary. Pure, so it can be tested:+ * where the log's links go, the ids of its headings and its outline, and the date it was last updated.+ */+import { defaultUrlTransform } from "react-markdown";+import { FUOBE_REPO } from "./connections";++/** The whole log on GitHub, and the folder its relative links point into. */+export const STATUS_ON_GITHUB = `${FUOBE_REPO}/blob/main/docs/STATUS.md`;+const DOCS = `${FUOBE_REPO}/blob/main/docs/`;++/**+ * A link in the log: a relative one (research/README.md, ../scripts/eval/README.md) is a file in the repo's docs/+ * folder, so it opens on GitHub; the site has no such page. Addresses, #anchors and site paths stay as they are.+ */+export function statusLink(url: string): string {+ if (/^([a-z][a-z0-9+.-]*:|#|\/)/i.test(url)) return defaultUrlTransform(url);+ return new URL(url, DOCS).href;+}++/** A heading's id: "2. Feature matrix vs Higgsfield" → "2-feature-matrix-vs-higgsfield". */+export const headingId = (text: string): string =>+ text+ .toLowerCase()+ .replace(/[^a-z0-9]+/g, "-")+ .replace(/^-|-$/g, "");++/** The log's sections (## and ###, outside code blocks), for the page's table of contents. */+export function statusOutline(md: string): { depth: 2 | 3; text: string; id: string }[] {+ let fenced = false;+ return md.split("\n").flatMap((line) => {+ if (line.startsWith("```")) fenced = !fenced;+ const m = !fenced && /^(##|###) (.+?)\s*$/.exec(line);+ if (!m) return [];+ const text = m[2].replace(/[`*_]/g, "");+ return [{ depth: m[1].length as 2 | 3, text, id: headingId(text) }];+ });+}++/** "Last updated: 2026-10-30 (round 5, part 2)" → "2026-10-30". */+export const statusDate = (md: string): string | undefined => /Last updated:\s*(\d{4}-\d{2}-\d{2})/.exec(md)?.[1];++/** The log without its own title: the page has one. */+export const statusBody = (md: string): string => md.replace(/^# .*\n+/, "");diff --git a/tests/comfy-install.test.ts b/tests/comfy-install.test.tsindex c569b254..337d815b 100644--- a/tests/comfy-install.test.ts+++ b/tests/comfy-install.test.ts@@ -4,7 +4,7 @@ import os from "node:os";import path from "node:path";import { describe, expect, it } from "vitest";import type { Manifest } from "@/lib/comfy";-import { installScript, nodeInstall } from "@/lib/comfy-install";+import { installScript, nodeInstall, workflowSource } from "@/lib/comfy-install";const manifest = JSON.parse(fs.readFileSync(path.join(__dirname, "../workflows/comfyui/manifest.json"), "utf8")) as Manifest;const workflow = (id: string) => manifest.workflows.find((w) => w.id === id)!;@@ -49,6 +49,26 @@ describe("Workflows → Copy install commands", () => {expect(s).toContain(`git -C "$COMFYUI/custom_nodes" clone ${plain.repo}`);expect(s.findIndex((l) => l.startsWith("mkdir -p"))).toBeGreaterThan(s.findIndex((l) => l.includes(plain.repo)));});++ it("a gated download (LTX-2.5) says to accept its licence first, and sends the Hugging Face token", () => {+ const s = script("ltx25-t2v").split("\n");+ const gated = workflow("ltx25-t2v").models.filter((m) => m.gated);+ expect(gated.length).toBeGreaterThan(0);+ expect(s.filter((l) => l.startsWith("#"))).toEqual(["# Gated: accept the licence at https://huggingface.co/Lightricks/LTX-2.5, then export HF_TOKEN=<your Hugging Face token>"]);+ for (const m of gated) expect(s.find((l) => l.includes(m.url!)), m.file).toContain(`wget -c --header="Authorization: Bearer $HF_TOKEN" -O`);+ // The comment comes before the downloads; an ungated download sends no token.+ expect(s.findIndex((l) => l.startsWith("#"))).toBeLessThan(s.findIndex((l) => l.startsWith("mkdir -p")));+ expect(script("flux1-dev-t2i")).not.toMatch(/HF_TOKEN|^#/m);+ });++ it("links each workflow's graph in the repo: the file to download and its GitHub page", () => {+ expect(workflowSource("flux1-dev-t2i.json")).toEqual({+ raw: "https://raw.githubusercontent.com/workingprototype/fuobe/main/workflows/comfyui/flux1-dev-t2i.json",+ page: "https://github.com/workingprototype/fuobe/blob/main/workflows/comfyui/flux1-dev-t2i.json",+ });+ for (const wf of manifest.workflows) expect(fs.existsSync(path.join(__dirname, "../workflows/comfyui", wf.file)), wf.file).toBe(true);+ });+it("the commands run, and run again, as install-comfyui.sh does: a pinned clone moves to its pin, a copied pack isn't copied twice", () => {const tmp = fs.mkdtempSync(path.join(os.tmpdir(), "fuobe-comfy-install-"));const git = (cwd: string, ...args: string[]) =>diff --git a/tests/command-palette.test.ts b/tests/command-palette.test.tsindex 12dac347..d05be489 100644--- a/tests/command-palette.test.ts+++ b/tests/command-palette.test.ts@@ -5,7 +5,7 @@ import { NAV } from "@/components/nav-items";import { APPS, EFFECTS, getModel, MODELS, MOTIONS } from "@/lib/catalog";import { entryScore, indexEntries, normalize, rankPalette, skillEntries, wordScore, type PaletteEntry } from "@/lib/command-search";import { modelHref, paletteIndex } from "@/lib/palette-index";-import { modelSearchText, toModelRow } from "@/lib/model-rows";+import { modelSearchText, rowPriceOn, toModelRow } from "@/lib/model-rows";import { hubModePaths, studioRoutes } from "./e2e/_routes.mjs";const page = (label: string, href: string, keywords?: string): PaletteEntry => ({ key: `page:${href}`, kind: "page", label, href, keywords });@@ -198,3 +198,27 @@ describe("palette index", () => {expect(entries.find((e) => e.kind === "effect")?.href).toMatch(/^\/video\?preset=/);});});++describe("palette settings by viewer", () => {+ it("offers the install's settings to its owner only; a visitor gets its own GPU, its account and the licences", async () => {+ const { settingEntries } = await import("@/components/command-palette");+ const hrefs = (v: Parameters<typeof settingEntries>[0]) => settingEntries(v).map((e) => e.href);+ expect(hrefs({ owner: true })).toEqual(expect.arrayContaining(["/settings#engine", "/settings#cloud", "/settings#security", "/settings/models"]));+ expect(hrefs({ owner: false, account: { email: "[email protected]" } })).toEqual(["/settings#your-gpu", "/settings#account", "/settings/models"]);+ expect(hrefs({ owner: false })).toEqual(["/connect", "/settings/models"]);+ // Not known yet: nothing of the owner's.+ expect(hrefs(undefined)).toEqual(["/connect", "/settings/models"]);+ });+});++describe("Models page rows", () => {+ it("open a model where it runs, and show one engine's price when the install runs one", () => {+ const soul = getModel("fuobe-soul")!;+ const row = toModelRow(soul);+ expect(row.engines).toEqual(["open", "cloud"]);+ expect(modelHref(soul)).toMatch(/\?model=fuobe-soul$/);+ expect(rowPriceOn(row, Date.UTC(2026, 9, 31), "open")).toBe("Free");+ expect(rowPriceOn(row, Date.UTC(2026, 9, 31), "cloud")).not.toMatch(/^Free/);+ expect(rowPriceOn(row, Date.UTC(2026, 9, 31))).toMatch(/^Free · /);+ });+});diff --git a/tests/licences.test.ts b/tests/licences.test.tsindex a13c351c..0b5b7b4f 100644--- a/tests/licences.test.ts+++ b/tests/licences.test.ts@@ -83,4 +83,17 @@ describe("licences", () => {const without = buildLicenceList(MODELS, manifest.workflows.filter((w) => !/triposplat|trellis2|pixal3d/.test(w.id)));expect(without.notices.some((n) => n.text === "Built with DINOv3")).toBe(false);});++ it("links each licence to where it can be read, as Models & licences does", () => {+ const list = buildLicenceList(MODELS, manifest.workflows);+ for (const r of list.rows) expect(r.links.length, r.id).toBe(r.licences.length);+ const linked = list.rows.flatMap((r) => r.links).filter(Boolean).length;+ // Every licence the KNOWN table names has its own page; the rest link to the model card of their largest download.+ expect(linked / list.rows.flatMap((r) => r.links).length).toBeGreaterThan(0.9);+ expect(list.rows.find((r) => r.id === "oss-flux2-dev")?.links).toEqual(["https://huggingface.co/black-forest-labs/FLUX.2-dev"]);+ expect(list.rows.find((r) => r.workflows.includes("bg-remove-birefnet"))?.links[0]).toBe("https://spdx.org/licenses/MIT.html");+ // Without the downloads, a licence with no page of its own has no link.+ const bare = buildLicenceList(MODELS, manifest.workflows.map((w) => ({ ...w, models: undefined })));+ expect(bare.rows.flatMap((r) => r.links).filter(Boolean).length).toBeLessThanOrEqual(linked);+ });});diff --git a/tests/nav.test.ts b/tests/nav.test.tsindex 03ff0664..9e31e88c 100644--- a/tests/nav.test.ts+++ b/tests/nav.test.ts@@ -27,6 +27,17 @@ describe("sidebar active state", () => {// Other tabs have no link of their own, so "All creations" stays lit.expect(navActive("/library", "/library", q("tab=trash"), LIBRARY)).toBe(true);});++ it("hands it to a sibling link below the plain one: Settings and About & licences", () => {+ const engine = NAV.find((g) => g.label === "Engine")!.items.map((i) => i.href);+ expect(engine).toContain("/settings/about");+ const lit = (pathname: string) => engine.filter((h) => navActive(h, pathname, q(), engine));+ expect(lit("/settings/about")).toEqual(["/settings/about"]);+ expect(lit("/settings")).toEqual(["/settings"]);+ // Pages below Settings with no link of their own keep Settings lit.+ expect(lit("/settings/models")).toEqual(["/settings"]);+ expect(lit("/models")).toEqual(["/models"]);+ });});describe("remembered sidebar state", () => {diff --git a/tests/settings-links.test.ts b/tests/settings-links.test.tsindex f5b47fa1..f65e1f22 100644--- a/tests/settings-links.test.ts+++ b/tests/settings-links.test.ts@@ -8,7 +8,7 @@ const root = path.join(__dirname, "../src");const files = (d: string): string[] => fs.readdirSync(d, { withFileTypes: true }).flatMap((e) => (e.isDirectory() ? files(path.join(d, e.name)) : /\.tsx?$/.test(e.name) ? [path.join(d, e.name)] : []));const form = fs.readFileSync(path.join(root, "components/settings-form.tsx"), "utf8");/** The anchors Settings has: its sections' and fields' ids (id="…", or a Section's id prop on its own line), the form's and the sections around it. */-const page = [form, ...["components/gpu/account-gpu-section.tsx", "components/accounts-admin.tsx"].map((f) => fs.readFileSync(path.join(root, f), "utf8"))].join("\n");+const page = [form, ...["components/gpu/account-gpu-section.tsx", "components/owner-settings.tsx", "components/accounts-admin.tsx"].map((f) => fs.readFileSync(path.join(root, f), "utf8"))].join("\n");const anchors = new Set([...page.matchAll(/\bid="([a-z0-9-]+)"/g)].map((m) => m[1]));describe("Settings deep links", () => {diff --git a/tests/status-page.test.ts b/tests/status-page.test.tsnew file mode 100644index 00000000..e9be9f5d--- /dev/null+++ b/tests/status-page.test.ts@@ -0,0 +1,51 @@+import fs from "node:fs";+import path from "node:path";+import { describe, expect, it } from "vitest";+import { headingId, STATUS_ON_GITHUB, statusBody, statusDate, statusLink, statusOutline } from "@/lib/status-page";++/** Project status (/status): docs/STATUS.md under a public summary, with working links and a table of contents. */++const md = fs.readFileSync(path.join(__dirname, "../docs/STATUS.md"), "utf8");++describe("the Project status page", () => {+ it("opens the log's relative links on GitHub, where the files are (the site has no such pages)", () => {+ const repo = "https://github.com/workingprototype/fuobe/blob/main";+ expect(statusLink("research/README.md")).toBe(`${repo}/docs/research/README.md`);+ expect(statusLink("cli.md")).toBe(`${repo}/docs/cli.md`);+ expect(statusLink("../scripts/eval/README.md")).toBe(`${repo}/scripts/eval/README.md`);+ expect(statusLink("workers/tribe-v2.md")).toBe(`${repo}/docs/workers/tribe-v2.md`);+ // Addresses, anchors and the site's own pages are left alone; unsafe schemes are dropped as before.+ expect(statusLink("https://fal.ai/models")).toBe("https://fal.ai/models");+ expect(statusLink("#known-issues")).toBe("#known-issues");+ expect(statusLink("/workflows")).toBe("/workflows");+ expect(statusLink("javascript:alert(1)")).toBe("");+ expect(STATUS_ON_GITHUB).toBe(`${repo}/docs/STATUS.md`);+ });++ it("every relative link in the log names a file in the repo", () => {+ const links = [...md.matchAll(/\]\(([^)\s]+)\)/g)].map((m) => m[1]).filter((u) => !/^([a-z]+:|#|\/)/i.test(u));+ expect(links.length).toBeGreaterThan(10);+ for (const l of links) {+ const file = path.join(__dirname, "../docs", decodeURIComponent(l.split("#")[0]));+ expect(fs.existsSync(file), l).toBe(true);+ }+ });++ it("lists the log's sections for the table of contents, with the ids its headings get", () => {+ const outline = statusOutline(md);+ expect(outline.filter((h) => h.depth === 2).length).toBeGreaterThanOrEqual(4);+ expect(outline[0]).toEqual({ depth: 2, text: "1. What has been verified", id: "1-what-has-been-verified" });+ expect(headingId("Edit & apps")).toBe("edit-apps");+ expect(new Set(outline.map((h) => h.id)).size).toBe(outline.length);+ expect(statusOutline("## A\n```\n## not a heading\n```\n### B")).toEqual([+ { depth: 2, text: "A", id: "a" },+ { depth: 3, text: "B", id: "b" },+ ]);+ });++ it("reads the log's date and drops its own title (the page has one)", () => {+ expect(statusDate(md)).toMatch(/^\d{4}-\d{2}-\d{2}$/);+ expect(statusDate("_Last updated: 2026-10-30 (round 5, part 2)._")).toBe("2026-10-30");+ expect(statusBody("# Fuobe — project status\n\n_Last updated_")).toBe("_Last updated_");+ });+});diff --git a/workflows/comfyui/manifest.json b/workflows/comfyui/manifest.jsonindex 4b90f2ff..6be1ca0e 100644--- a/workflows/comfyui/manifest.json+++ b/workflows/comfyui/manifest.json@@ -395,7 +395,7 @@"customNodes": [],"vramGb": 32,"validated": true,- "notes": "Mistral-Small text encoder (18 GB bf16) + 32B fp8mixed transformer; needs ~64 GB system RAM for offloading on 24 GB cards. Width/height must be set on BOTH the latent and the Flux2Scheduler (both listed)."+ "notes": "Mistral-Small text encoder (36 GB bf16) + 32B fp8mixed transformer; needs ~64 GB system RAM for offloading on 24 GB cards. Width/height must be set on BOTH the latent and the Flux2Scheduler (both listed)."},{"id": "flux2-dev-t2i-turbo",