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
Home: the before/after's larger stills wait for the page to load
Adarshd9cdc560260c
diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.mdindex c4e233a9..c2cc930e 100644--- a/docs/ARCHITECTURE.md+++ b/docs/ARCHITECTURE.md@@ -520,7 +520,7 @@ Liner-inspired shell (pale frame, rounded inset sheet, 13px sidebar rows, serif- **Shell (round 4).** "Skip to content" is the first Tab stop, the sidebar is a `<nav aria-label="Main">`, and each page has one `<main>`. Full-screen studios (`fullScreenStudio()` in `nav.ts`: a Cinema, Canvas or Layers project, and every Assist page) fold the sidebar to its icon rail without touching the remembered choice: only `SidebarShell` writes the sidebar cookie, and only when that choice changes (`persistOpen` on `SidebarProvider`). Phones get a header with the menu and Search on gallery and settings pages (`phone-bar.tsx`). `intent-link.tsx` prefetches a link on hover or focus instead of when it appears on screen (rows marked `eager` still prefetch on view). Shortcut labels show ⌘ on Apple devices and Ctrl elsewhere (`src/lib/keys.ts`). Every Copy button goes through `copyText` (`src/lib/clipboard.ts`), so copying works on plain-http LAN addresses. Since round 5 part 1 `StudioChrome` (`app-sidebar.tsx`) wraps the shell in `SkillBuilderProvider` (see Skills that run by themselves).- **Command palette** (`command-palette.tsx`, ⌘K / Ctrl+K, also the sidebar's Search row and the phone header's Search): pages, Settings sections, apps, camera motions, effects, models (filtered by engine mode, and since round 4 part 4 by Settings → Models & licences through the access summary) and recent creations, ranked with typo tolerance in `src/lib/command-search.ts`. The catalog part is `GET /api/search-index`, a static, prerendered slim index built by `paletteIndex()` in `src/lib/palette-index.ts` and fetched the first time the palette opens. `modelHref()` opens a model where it runs (a studio with `?model=`, a Video tools mode, Image to 3D, an app, Layers, Captions / Trim / Translate), else the Models page filtered by `?q=`; the round-4 tools (Remove object, Genjutsu, FPS Boost, SDR to HDR, Export, the 3D scene) aren't in its lists yet, so their models open the Models page. Since round 4 part 3 every Image to 3D model and Meshy Rigging open `/image-to-3d`, and a Fuobe Original is listed once with both engines. Since round 4 part 4 it also lists "Models & licences" (`/settings/models`) and "Assist connectors". Since round 5 part 1 a "Run a skill" group lists "Run <skill>…" for every enabled recipe skill (`skillEntries`), and Settings lists "Training (AI-Toolkit)". It replaces `global-shortcuts.tsx` (⌘K used to go Home).-- **Home** (`src/app/(studio)/page.tsx`): `homeShowcase()` in `src/lib/home-showcase.ts` (server only, `"use cache"`) names the presets, studios, models and skills Home shows and computes every number it quotes from the catalog, the ComfyUI manifest (About & licences' count), the skills folder and `LLM_PROVIDERS`; `tests/home-showcase.test.ts` checks each id has its cover and clip, shows once, and each number is the catalog's. `HomeView` keeps the composer and renders the wall right under it; the sections below (`components/home/home-sections.tsx`) are server components passed as children, with small client islands (`showcase-tile.tsx`, `before-after.tsx`, `home-islands.tsx`). Effect and app cards rest on their clip's peak frame (`public/previews/presets/peak/`, `preset-peaks.generated.ts`, cut by `scripts/gen-preset-peaks.mjs` from the published clips) and their clip starts from that frame (`PresetPreview`'s `rest`). The before/after under Apps shows each app's HD stills (`public/previews/presets/ba/1280/`, `ba/960/` and `ba/512/`, `preset-before-after.generated.ts`, made by `scripts/gen-before-after.mjs` from the reveal clips' masters for every app whose cover is one): each picture starts as its 512 px still, and the browser then picks the 960 or 1280 px copy the screen needs (`srcset`; a 1x desktop or 2x phone the 960, a 2x desktop or 3x phone the 1280), added only once the slider comes within a screen of view, so it never competes with the page's first paint. The playback store gained `auto: "touch"` (studio cards wait for a hover where one is possible) and `paused` (Pause previews, kept in localStorage under `fuobe:previews`). Assist reads `?prompt=` into a new chat without sending it (`assistDraft`).+- **Home** (`src/app/(studio)/page.tsx`): `homeShowcase()` in `src/lib/home-showcase.ts` (server only, `"use cache"`) names the presets, studios, models and skills Home shows and computes every number it quotes from the catalog, the ComfyUI manifest (About & licences' count), the skills folder and `LLM_PROVIDERS`; `tests/home-showcase.test.ts` checks each id has its cover and clip, shows once, and each number is the catalog's. `HomeView` keeps the composer and renders the wall right under it; the sections below (`components/home/home-sections.tsx`) are server components passed as children, with small client islands (`showcase-tile.tsx`, `before-after.tsx`, `home-islands.tsx`). Effect and app cards rest on their clip's peak frame (`public/previews/presets/peak/`, `preset-peaks.generated.ts`, cut by `scripts/gen-preset-peaks.mjs` from the published clips) and their clip starts from that frame (`PresetPreview`'s `rest`). The before/after under Apps shows each app's HD stills (`public/previews/presets/ba/1280/`, `ba/960/` and `ba/512/`, `preset-before-after.generated.ts`, made by `scripts/gen-before-after.mjs` from the reveal clips' masters for every app whose cover is one): each picture starts as its 512 px still, and the browser then picks the 960 or 1280 px copy the screen needs (`srcset`; a 1x desktop or 2x phone the 960, a 2x desktop or 3x phone the 1280), added only once the slider comes within a screen of view and the page has loaded, so it never competes with the page's first paint. The playback store gained `auto: "touch"` (studio cards wait for a hover where one is possible) and `paused` (Pause previews, kept in localStorage under `fuobe:previews`). Assist reads `?prompt=` into a new chat without sending it (`assistDraft`).- **Getting started and connections.** `get-started.tsx` is the first-run guide under Home's composer and at the top of Settings (Use paid models, Use your GPU, Just try it), shown until `onboarded` is set (`showFirstRun`, `FIRST_RUN_SCRIPT` in `src/lib/connections.ts`). Every connection field in Settings is a `ConnectField` (`connect-field.tsx`): Save & test sends the typed value to `POST /api/providers/test` (`{provider, value | values, field}`; the old `{provider}` body still works) and saves it only when the test passes, with a "Save anyway" link. `settings-form.tsx` has a status strip with one chip per connection (`connectionSummary`); since round 4 part 2 it has a LoRAs section (`#loras`, `lora-settings.tsx`: the LoRA folder, the civitai key with Save & test, and the library with licences and Download buttons), which the command palette also lists. `/settings/about` (`licences-view.tsx`, `src/lib/licences.ts`) lists each open model's licence from the catalog and the workflow manifest, read at build time, and since round 4 part 4 links to Settings → Models & licences (`/settings/models`, `model-access-view.tsx`: the switches; see Models & licences). Round 4 part 4 also adds a Models & licences section and Assist · connectors (`#assist-connectors`, `components/assist/connectors-settings.tsx`) to `settings-form.tsx`. Round 4 part 5 drops the Higgsfield key field and chip and the "Higgsfield first" Preferred provider (`PROVIDER_SETTINGS`, `CLOUD_PROVIDERS` and `connectionSummary` in `src/lib/connections.ts`). Round 5 part 1 adds Training · AI-Toolkit (`#training`: three `ConnectField`s tested as provider `ai-toolkit`), retitles the LoRAs section "LoRAs · looks, motions, effects and adapters" with an Adapters tab, and (fixes-5) makes every "Settings → …" message and `/settings#…` link name a section that exists, which `tests/settings-links.test.ts` enforces.- **Studio pages** render `<Studio config>` (`src/components/studio/studio.tsx`), a server component that passes `studioCatalog(config)` from `src/lib/studio-catalog.ts`: the studio's models without provider field maps. Inside, `CatalogProvider` / `useCatalog()` resolve models; `loadFullCatalog()` imports `@/lib/catalog` lazily for motions, effects, `?preset=` and unknown ids. Client components under `studio/` must not import `@/lib/catalog` or `@/lib/studios`. `StudioPage` renders the same tree in the static shell and after hydration; hand-off params merge into the draft with `mergeHandoff`. `StudioConfig` (`studio-context.tsx`) gained `pickerOps`, `anyOf`, `signature` and `extraModels`, and in round 4 `frames` (Frames mode), `comfyOnly` (a tool that runs only on ComfyUI, with a note and an alternative) and `related` (a link under the hero). `HandoffSync` in `studio-page.tsx` also runs Home's Start: Home issues a one-time token (`issueStartToken` in `src/lib/composer.ts`, kept in sessionStorage) and opens the studio with `?prompt=…&go=<token>`; the studio submits once if `claimStartToken` accepts it, so a link from elsewhere can't start a run. A `?model=` that names the other engine's model switches the remembered engine; since round 4 part 3 it also survives the composer's swap of an untouched draft's default model when the engine is read after hydration (`followEngineDefault`: before, a link on the open engine landed on the studio's default model). Since round 4 part 5 a `?model=` naming a retired model opens on its replacement (`currentModelId`), and Reuse of a run on one migrates its request in the browser (`migrateRequest` without Director words) and toasts what changed; the composer's provider style chip (`ProviderPresetChip`, Higgsfield's live styles) is gone. The line under Home's composer prices what Start will run from the catalog (`startQuotes` in `src/lib/starter-prices.ts`, worded by `startLine` in `src/lib/connections.ts`).- **Hubs** (Audio, Video tools, Upscale) have one prerendered path per mode (`src/lib/hubs.ts`, `ModeSwitchStudio` in `mode-switch-studio.tsx`, `[mode]/page.tsx`); old `?mode=` links redirect in `next.config.ts`, and an unknown mode is a real 404. Round 4 adds `/upscale/fps`, `/upscale/hdr`, `/upscale/export`, `/audio/transcribe`, `/audio/loop`, `/audio/join` and `/video-tools/remove-object`; round 5 part 1 adds `/video-tools/evolution`, and round 5 part 2 `/audio/split` (`SplitSoundtrackTool` in `TOOLS`).diff --git a/src/components/home/before-after.tsx b/src/components/home/before-after.tsxindex 630c7510..2624692e 100644--- a/src/components/home/before-after.tsx+++ b/src/components/home/before-after.tsx@@ -73,8 +73,9 @@ export function BeforeAfterPicture({ still, zoom, hd, onLoad }: { still: BeforeA* it taps, so a scroll that starts on the picture leaves the handle where it was. Stills only: it plays no clip.** It sits screens below the fold, so its pictures load lazily, each its 512 px still at first. Then the screen gets the- * 960 or 1280 px copy it needs (srcset), asked for only once the picture comes within a screen of view: a- * browser fetches lazy images well ahead, and on a slow line those would hold up the page's largest paint.+ * 960 or 1280 px copy it needs (srcset), asked for only once the picture comes within a screen of view and the page+ * has loaded: a browser fetches lazy images well ahead, and on a slow line those would hold up the page's largest+ * paint.** From lg to xl (beside the sidebar) the tabs stand in a column next to the picture, in the room it leaves.*/@@ -84,7 +85,7 @@ export function BeforeAfter({ pairs }: { pairs: BeforeAfterPair[] }) {/** Bumped as each picture comes in, to look again whether the peek can start. */const [loaded, setLoaded] = useState(0);const [inView, setInView] = useState(false);- /** Set once the picture comes within a screen of view: only then may it take its larger copies. */+ /** Set once the picture comes within a screen of view and the page has loaded: only then may it take its larger copies. */const [near, setNear] = useState(false);const box = useRef<HTMLDivElement>(null);const dragging = useRef(false);@@ -106,15 +107,20 @@ export function BeforeAfter({ pairs }: { pairs: BeforeAfterPair[] }) {io.disconnect();}, { threshold: 0.6 });io.observe(el);+ // Near, and the page loaded: on a phone the slider can start within a screen, and its copies must not share the+ // line with the page's first pictures.+ const ready = () => setNear(true);const soon = new IntersectionObserver(([e]) => {if (!e.isIntersecting) return;- setNear(true);soon.disconnect();+ if (document.readyState === "complete") ready();+ else window.addEventListener("load", ready, { once: true });}, { rootMargin: "100% 0px" });soon.observe(el);return () => {io.disconnect();soon.disconnect();+ window.removeEventListener("load", ready);};}, []);