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
Add motion-control and video-edit studios, docs, and UI polish
Claude72da4cbf85a6
diff --git a/README.md b/README.mdindex 1ea0915d..b58804a7 100644--- a/README.md+++ b/README.md@@ -1 +1,62 @@-# Fuobe\ No newline at end of file+# Fuobe++**An open-source AI image & video studio — a 1:1 alternative to Higgsfield.**+Use the same frontier paid models Higgsfield uses (Nano Banana Pro, Seedance 2.5, Kling 3.0, Veo 3.1, Seedream 5, GPT Image 2.5, FLUX.3, MiniMax, Wan…) with your own fal.ai / Replicate key, **or** run the equivalent open-weight workflows on your own GPU through **ComfyUI**. Same studio, same apps, same camera motions — flip one switch.++- **Studios:** Image · Video (text, image, start/end frame, references) · Edit · Camera motions · Effects · Apps · Lipsync & avatars · Motion control · Edit video · Characters · Upscale · Audio (voice, SFX, music, sound-for-video) · Library+- **Catalog:** 67 cloud models + 34 open-source models, 118 apps, 108 camera motions, 255 effects+- **Open-source engine:** 53 API-format ComfyUI workflows exported from the official templates and validated against real ComfyUI node definitions, plus 170 researched LoRAs (camera moves, VFX) wired into the presets+- **No keys? No GPU?** Demo mode lets you click through everything with clearly-labelled placeholder outputs.++> Project status, what works, what's verified and what's left: **[docs/STATUS.md](docs/STATUS.md)** (also in-app at `/status`).++## Quick start++```bash+pnpm install+pnpm dev # http://localhost:3000+```++Open **Settings** and connect what you have:++| You have | What to set | You get |+|---|---|---|+| A [fal.ai](https://fal.ai/dashboard/keys) key | `fal.ai API key` (or `FAL_KEY`) | Every cloud model and cloud app |+| A Replicate token | `Replicate API token` (or `REPLICATE_API_TOKEN`) | Fallback route for models Replicate hosts |+| A GPU running ComfyUI | `ComfyUI server URL` (or `COMFYUI_URL`, default `http://127.0.0.1:8188`) | Every open-source model, app, motion and effect |+| An Anthropic key or Ollama | `Prompt enhancement` | The **Enhance** toggle rewrites prompts with Claude or a local LLM (offline rewriter otherwise) |++Keys are stored in a local SQLite database (`data/fuobe.db`) and never sent to the browser. Generated media is saved under `data/files/`.++### Setting up the open-source engine++1. Install ComfyUI on a machine with a GPU (24 GB VRAM covers almost every workflow; Z-Image Turbo, Wan 2.2 5B and SDXL run in 8–16 GB).+2. Open **ComfyUI workflows** in Fuobe. Each workflow lists the model files it needs, which are already installed (✓) and a **Copy install commands** button that produces the exact `wget` / `git clone` lines.+3. Switch the engine toggle (top-right of every studio) to **Open source**.++To check a ComfyUI connection end to end without downloading any models:++```bash+pnpm dev &+pnpm test:e2e:comfyui http://localhost:3000 # runs two weight-free workflows through the full pipeline+```++## Development++```bash+pnpm typecheck && pnpm lint && pnpm test # TypeScript, ESLint, Vitest+pnpm build # production build+pnpm gen:catalog # regenerate cloud models, LoRA map and icon map from docs/research/*.json+```++- `docs/ARCHITECTURE.md` — how requests flow from the composer to providers and back+- `docs/research/` — the research this is built on (Higgsfield inventory, paid model APIs, ComfyUI equivalents, workflow library, Liner UI language)+- `scripts/comfy/` — the pipeline that exports and validates the ComfyUI workflow library++## Tech++Next.js 16 (App Router, Cache Components) · React 19 · Tailwind CSS v4 · shadcn/ui (Radix) · TanStack Query · SQLite (better-sqlite3) · fal.ai queue API · Replicate predictions API · ComfyUI HTTP + WebSocket API · Vitest · Playwright.++## License notes++Fuobe's code is open source. Model weights have their own licenses: several open models used here are **non-commercial** (FLUX.1/FLUX.2 [dev], inswapper, MMAudio weights, some LoRAs) — the Workflows page and `docs/research/comfyui-oss.md` list each license. Cloud models are billed by your provider.diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.mdnew file mode 100644index 00000000..9f9dd7a7--- /dev/null+++ b/docs/ARCHITECTURE.md@@ -0,0 +1,63 @@+# Architecture++Fuobe is a single Next.js 16 app. The browser talks only to Fuobe's own API; the server talks to providers (fal.ai, Replicate, ComfyUI) and stores every input and output locally so the library never depends on a provider's expiring URLs.++```+Composer (React) ──POST /api/generations──▶ planGeneration() src/lib/catalog/plan.ts+ │ model + preset + attachments+ │ → operation (t2v / i2v / flf2v / edit / avatar …)+ │ → prompt (preset template, LoRA trigger)+ │ → params, LoRAs, number of jobs+ ▼+ chooseRoute() src/server/generations.ts+ │ first configured provider for that operation,+ │ else the demo provider (Settings → Demo mode)+ ▼+ SQLite row (queued) ─ submit() in the background:+ │ upload inputs to the provider (prepareFile)+ │ optional prompt enhancement (src/server/enhance.ts)+ │ adapter.submit() → external job id+ ▼+ poller (every 1.5 s) ── adapter.poll() → queued / running (progress) / succeeded / failed+ │ on success: download every output → data/files → assets table+ ▼+Feed (React Query, polls while jobs are active) ◀── GET /api/generations+```++## Catalog (`src/lib/catalog/`)++| file | what |+|---|---|+| `types.ts` | `ModelDef`, `ModelRoute`, `FieldMap`, `Preset`, `GenerationRequest`, `Generation` |+| `cloud-models.generated.ts` | 67 cloud models. **Generated** by `scripts/gen-cloud-models.py` from the verified API schemas in `docs/research/paid-model-apis.json` — field names, enums, defaults and prices are never typed by hand |+| `models.ts` | Open-source models (ComfyUI workflow ids) + the generated cloud list |+| `apps.ts`, `motions.ts` | 118 apps, 108 camera motions, 255 effects: prompt templates, input slots, option pickers, cloud and open routes |+| `oss-loras.generated.ts` | Higgsfield preset name → researched Wan LoRAs + trigger words (`scripts/gen-oss-loras.py`) |+| `index.ts` | Lookup helpers; attaches LoRAs / Wan Fun Camera poses / ReActor to open routes |+| `plan.ts` | Pure planning logic (operation inference, prompt composition, batching, input validation, cost estimate) |+| `payload.ts` | `buildPayload(FieldMap, GenInput)` and `extractMedia(response)` |++A **model** has one **route** per (operation, provider). A route's `FieldMap` translates Fuobe's canonical input (`prompt`, `images`, `endImage`, `aspectRatio`, `duration`…) to the provider's field names (`start_image_url`, `tail_image_url`, `"8s"`, `image_size: "landscape_16_9"`…).++A **preset** (app / motion / effect) has a `cloud` and an `open` route, each naming a model and operation, optional fixed params and LoRAs. Apps pin their model; motions and effects add their camera/effect prompt to whichever video model the user picks (LoRAs only apply to the preset's own open model).++## Providers (`src/server/providers/`)++All adapters implement `prepareFile`, `submit`, `poll`, `cancel`, `test`.++- **fal** — queue API (`queue.fal.run/<endpoint>`); always uses the `status_url` / `response_url` returned at submit (nested endpoint ids poll under the app root). Files go to fal storage via `@fal-ai/client`.+- **replicate** — predictions API; small files as data URIs, larger via the Files API. Outputs are copied immediately (Replicate deletes them after an hour).+- **comfyui** — loads `workflows/comfyui/manifest.json`, writes values into bound node inputs (`src/lib/comfy.ts`), injects `LoraLoaderModelOnly` nodes after each diffusion-model loader (per Wan 2.2 expert), computes width/height from aspect ratio + resolution tier within the workflow's limits, frame counts as `n·step+1`, uploads inputs with `/upload/image`, submits to `/prompt`, tracks progress over the websocket and reads results from `/history`. Validation errors are turned into "missing model X → put it in models/<folder> (download URL)" messages.+- **mock** — demo outputs (SVG art, bundled sample clips, a tone) so the product works with zero setup.++## ComfyUI workflow library (`workflows/comfyui/`, `scripts/comfy/`)++`manifest.json` lists each workflow with its **bindings** (canonical key → node id + input), outputs, defaults (`width`, `height`, `fps`, `frameStep`…), limits (`dimensionMultiple`, `maxFrames`…), required model files with download URLs and sizes, custom node packs, VRAM and a `validated` flag. The pipeline in `scripts/comfy/` exports the official templates through the real ComfyUI frontend (`app.graphToPrompt()`), applies documented transforms, and validates every graph with `POST /prompt` against a live ComfyUI using zero-byte placeholder models.++## Storage (`src/server/db.ts`, `storage.ts`, `settings.ts`)++SQLite (WAL) with tables `generations`, `assets`, `settings`, `characters`. Files live in `data/files/{uploads,outputs}/<date>/<id>.<ext>` and are served by `/api/files/...` with HTTP range support for video. `FUOBE_DATA_DIR` moves everything.++## UI (`src/components/`, `src/app/(studio)/`)++Liner-inspired shell (pale frame, rounded inset sheet, 13px sidebar rows, serif headlines, pill composer). Every creation page is a `StudioPage` driven by a `StudioConfig` (`src/lib/studios.ts`): hero → composer when empty, prompt-echo groups + docked composer once there are results. The composer holds attachments (click, drop, paste, pick from library), model picker (Cloud/Open switch), aspect ratio, quality, duration, count, audio, enhance, advanced (seed, negative prompt), live cost estimate and Generate (↵).diff --git a/docs/STATUS.md b/docs/STATUS.mdnew file mode 100644index 00000000..06cc9808--- /dev/null+++ b/docs/STATUS.md@@ -0,0 +1,113 @@+# Fuobe — project status++_Last updated: 2026-10-16. The research behind this is in [`docs/research/`](research/README.md); the Higgsfield inventory it is measured against is [`higgsfield-inventory.md`](research/higgsfield-inventory.md)._++**Legend**++| | meaning |+|---|---|+| ✅ | **Verified** — exercised end to end here (unit tests, a live ComfyUI, the browser) |+| 🟢 | **Built** — implemented against verified API schemas or validated workflows, but not yet run with real paid keys or real GPU weights |+| 🟡 | **Partial** — works, but approximates Higgsfield or misses part of the feature |+| ⬜ | **Not started** |++## 1. What has been verified++| check | result |+|---|---|+| `pnpm typecheck`, `pnpm lint` | clean |+| `pnpm test` (Vitest, 28 tests) | pass — payload mapping, durations/enums, response parsing, operation inference, prompt composition, batching, input validation, cost estimates, ComfyUI bindings, LoRA injection on Wan 2.2 experts, size/frame math, error hints, catalog integrity (every preset → existing model with that operation, every ComfyUI route → a workflow in the manifest, icons exist, defaults valid) |+| `pnpm build` | passes (150 prerendered pages) |+| Demo mode, browser | ✅ image and video generations queue, show live progress, land in the feed, open in the viewer; no console errors (headless Chromium, desktop + 390px mobile, light + dark) |+| ComfyUI engine, live server | ✅ `pnpm test:e2e:comfyui` against ComfyUI 0.41 (CPU): upload → bindings → `/prompt` → websocket/`/history` → download → library, for an image and a video workflow |+| ComfyUI workflow library | ✅ 51/51 workflows accepted by `POST /prompt` with no `node_errors` against real node definitions (placeholder weights — graph structure, input names, types and file references verified, **not output quality**) |+| ComfyUI error UX | ✅ a LoRA motion preset with missing files fails fast with "Missing model X — put it in ComfyUI/models/<folder> (download: URL)" for every missing file |+| Cloud providers (fal / Replicate) | 🟢 adapters and 67 model routes built from fal's per-endpoint OpenAPI schemas (499/517 researched endpoints verified); **no live paid run yet** — needs a key |+| Prompt enhancement | 🟢 Claude (Anthropic SDK) and Ollama paths built; offline rewriter ✅ |++## 2. Feature matrix vs Higgsfield++### Create++| Higgsfield feature | Fuobe | Cloud route | Open-source route | Notes |+|---|---|---|---|---|+| Create Image (multi-model) | 🟢 | 24 image models: Nano Banana Pro/2/2.1/1, Seedream 5 Pro/Lite & 4.5, GPT Image 2.5 Flare/Sunburst/2/1.5, FLUX.3, FLUX.2 Pro, Kontext Max, Ideogram 4.5, Recraft 4.1, Qwen Image 3, Wan 2.7, Z-Image, Imagen 4 | Z-Image Turbo, Qwen-Image 2512 (+Lightning), FLUX.2 dev (+Turbo), FLUX.1 Krea/dev/schnell, HiDream, SDXL | Batch ×1–4, aspect ratios, quality tiers, seeds, negative prompts, reference images |+| Higgsfield Soul / Soul 2.0 / Soul Cinema | ⬜ cloud · 🟡 open | Soul is Higgsfield's own model — only on Higgsfield's API (`api.higgsfield.ai`), no adapter yet | FLUX.1 Krea is the closest open "un-plastic" look | Add a Higgsfield provider adapter to offer Soul itself |+| Soul ID (character training) | 🟡 | Characters = named reference sets on multi-reference models (Nano Banana Pro, Seedream) | Qwen-Image-Edit 2511 / FLUX.2 dev multi-ref | No LoRA training yet (planned: ai-toolkit job for Z-Image / FLUX / Qwen LoRAs) |+| Create Video (multi-model) | 🟢 | 40 video models: Seedance 2.5/2.0/Fast/1.0 Pro, Kling 3.0/Turbo/4K/O3/O1/2.6/2.5 Turbo, Veo 3.1/Fast/Lite, Gemini Omni Flash, Wan 3.0/Prime/2.7/2.6/2.5, MiniMax H3/H3 Max/Hailuo 2.3/02, FLUX.3 Video, LTX 2.5, PixVerse V6, Vidu Q3, Luma Ray 3.2 | Wan 2.2 14B (+Lightning), Wan 2.2 5B, LTX-2.5, LTX-2, HunyuanVideo 1.5, Wan VACE | Text, image, start+end frame, references, native audio toggle, durations, resolutions |+| Start & end frame | 🟢 | Kling, Veo, Seedance, Wan, MiniMax, PixVerse, FLUX.3 | Wan 2.2 FLF2V | |+| Reference-to-video / Elements | 🟡 | Seedance, Kling O3/O1, Veo, Wan, MiniMax, Vidu | Wan VACE | References via "Add ref"; no `@name` element syntax in the prompt yet |+| Camera motions (DoP presets) | 🟢 | 108 presets on any video model (Kling 2.5 Turbo default) | Wan 2.2 + 18 dedicated camera LoRAs, 11 moves via Wan Fun Camera poses, the rest prompt-only | "Mix" (combining two motions) ⬜ |+| Effects / Viral presets | 🟢 | 255 effects | 35 with dedicated effect LoRAs (Remade-AI etc.), rest prompt-only | Most open effect LoRAs target Wan 2.1 I2V; applied to Wan 2.2 — **quality needs GPU validation** |+| Multi-shot generation | ⬜ | Kling 3 `multi_prompt` and Seedance multi-shot exist in the schemas but aren't wired | — | |+| Seedance Draft mode | ⬜ | `draft` field exists on Seedance 2.5 | — | |+| Motion Control | 🟢 | Kling 3.0 Motion Control | Wan Animate 2, Wan 2.2 Fun Control | `/motion-control` |+| Edit Video | 🟢 | Kling O3/O1 edit, Gemini Omni edit, Wan 2.7 edit, Luma Ray 3.2 | Wan 2.2 Fun Control (approximation) | `/video-edit` |+| Extend video, Reframe, Relight/Recolor video | ⬜ | Endpoints exist (MiniMax extend, Luma reframe, PixVerse extend, LTX extend) | — | |+| Draw to Video, Cinema Studio, Genjutsu, Shorts Studio | ⬜ | | | Higgsfield-specific multi-step products |++### Edit & apps++| Higgsfield feature | Fuobe | Notes |+|---|---|---|+| Edit image (instruction edit) | 🟢 | Any edit model, up to 14 references (cloud) / 3 (open) |+| Inpaint / Draw to Edit | 🟡 | FLUX Fill inpaint workflow exists (open); **no mask-drawing canvas yet** |+| Expand (outpaint) | 🟢 | Expand Image app; open route = FLUX Fill outpaint |+| Upscale image / video | 🟢 | Topaz, SeedVR2, Recraft Crisp (cloud); ESRGAN, SeedVR2 (open) |+| Relight, Angles, Skin Enhancer, Color Grading, Headshots, Try-On, Packshot, Product Placement, Face/Character Swap… | 🟢 | 118 apps total: 116 have both engines, 2 are open-only (Recast, Video Face Swap). Most are instruction edits on Nano Banana Pro / Qwen-Image-Edit, exactly how Higgsfield builds them. Face Swap's open route uses ReActor |+| Approximated apps | 🟡 | 17 apps carry an explicit `parity` note (shown on the app page), e.g. Virality Predictor, Click to Ad (needs a product photo instead of a URL), multi-cut templates done in one pass |+| Layers, Photodump, Popcorn storyboards, Moodboards, Soul HEX | ⬜ | |++### Characters, lipsync, audio++| Higgsfield feature | Fuobe | Notes |+|---|---|---|+| Lipsync Studio / talking avatars | 🟢 | Kling Avatar 2.0/1, OmniHuman 2/1.5, InfiniteTalk, Sync Lipsync 3/2 Pro (cloud); InfiniteTalk native (~6 s) and long (WanVideoWrapper), Wan 2.2 S2V (open) |+| AI Influencer / characters | 🟡 | Characters page (reference sets); no persona generator |+| Text to speech | 🟡 | ElevenLabs v3 with a fixed voice — **voice picker ⬜**; open TTS (Chatterbox/IndexTTS2) ⬜ (needs custom nodes) |+| Sound effects, music | 🟢 | ElevenLabs SFX/Music (cloud), ACE-Step 1.5 (open) |+| Sound for video (foley) | 🟢 | MMAudio cloud + open |+| Voice cloning, voice change, dubbing/translate | ⬜ | |++### Platform++| Higgsfield feature | Fuobe | Notes |+|---|---|---|+| Assets library, favorites, search, reuse/remix, "animate this image" hand-offs, download | ✅ | Library page, tile actions (Animate, Edit, Upscale, Use as reference, Lipsync, Add sound), viewer with keyboard shortcuts |+| Live progress, cancel, retry, failure messages | ✅ | Shimmer status, percent, elapsed time, cancel; retries re-submit the same request |+| Credits / pricing | 🟡 | Bring-your-own-key: live cost estimate per run from provider prices; "Free" for open source; no billing |+| Accounts, teams, sharing, community feed, contests | ⬜ | Single-user, self-hosted today |+| Supercomputer / Assist agent, MCP, plugins | ⬜ | |+| Canvas (node workflows) | 🟡 | ComfyUI itself is the node canvas for the open engine; no in-app canvas |+| Public API | 🟡 | The app's REST API (`/api/generations`, `/api/uploads`…) works but is unauthenticated — **don't expose Fuobe to the internet without a reverse-proxy auth layer** |++## 3. Known issues and caveats++- **Paid providers are untested with real keys.** Field names come from fal's OpenAPI files, so they should be right, but the first live runs may surface model-specific quirks (e.g. size enums, safety flags). The model picker marks models whose provider isn't connected as "demo".+- **Open-source quality is unverified.** Workflows are structurally validated, not run with real weights (this machine has no GPU). Expect to tune steps/CFG per model once run on a GPU.+- **Wan 2.1 LoRAs on Wan 2.2:** most viral-effect LoRAs were trained for Wan 2.1 I2V 480p; they are injected on both Wan 2.2 experts. Some may need a lower strength or only the low-noise expert.+- **Licenses:** FLUX.1/FLUX.2 [dev], inswapper (ReActor), MMAudio weights and some LoRAs are non-commercial; MiniMax H3 open weights exclude some regions. See `research/comfyui-oss.md`.+- **Sunsets:** Sora 2's API was retired (2026-09-24) so it is not offered; Veo 3.1 on fal ends 2026-11-17 (Replicate route already present); Luma Ray 2 is replaced by Ray 3.2.+- **Dev-mode hot reload:** background polling survives hot reloads; after editing provider code, already-queued jobs use the new code.++## 4. What's next (prioritized)++1. **Live-key smoke test** of the top cloud models (Nano Banana Pro, Seedream 5, Kling 3.0, Seedance 2.5, Veo 3.1) and fix any schema surprises.+2. **GPU run** of the starter open set (Z-Image Turbo, Qwen-Image-Edit 2511, Wan 2.2 Lightning I2V, InfiniteTalk, ESRGAN), tune defaults, record real timings/VRAM in the manifest.+3. **Mask canvas** for inpaint / Draw to Edit, and **voice picker** + open TTS for audio.+4. **Character LoRA training** (Soul ID parity) via an ai-toolkit job, then use the LoRA in open image workflows.+5. **Higgsfield provider adapter** (Soul, Soul ID, DoP) for users who want Higgsfield's own models.+6. Multi-shot, draft mode, extend/reframe video, motion "Mix".+7. Auth + multi-user, shareable links, community feed.+8. Real preview media for apps/motions/effects (currently gradient cards).++## 5. How to reproduce the checks++```bash+pnpm typecheck && pnpm lint && pnpm test && pnpm build+# open-source engine against a live ComfyUI (no model weights needed):+bash scripts/comfy/start-comfyui.sh # or point COMFYUI_URL at your own server+pnpm dev & pnpm test:e2e:comfyui http://localhost:3000+# re-export + re-validate the workflow library:+cd scripts/comfy && npm install && npm run all+```diff --git a/docs/research/README.md b/docs/research/README.mdnew file mode 100644index 00000000..553c6274--- /dev/null+++ b/docs/research/README.md@@ -0,0 +1,13 @@+# Research++Everything Fuobe's catalog is built from. JSON files are machine-readable and feed the generators in `scripts/`.++| file | what it covers | used by |+|---|---|---|+| [`higgsfield-inventory.md`](higgsfield-inventory.md) / [`.json`](higgsfield-inventory.json) | Higgsfield as of 2026-10: navigation, 67 features with UX flows, 32 image + 43 video models, 94 apps, 113 camera motions, 274 effects, pricing, API | Preset catalog (`src/lib/catalog/apps.ts`, `motions.ts`), STATUS feature matrix |+| [`paid-model-apis.md`](paid-model-apis.md) / [`.json`](paid-model-apis.json) | 517 fal.ai / Replicate / vendor endpoints with exact input fields, enums, defaults, outputs and prices (499 verified from fal's OpenAPI files); fal and Replicate protocol notes; sunsets | `scripts/gen-cloud-models.py` → `cloud-models.generated.ts` |+| [`comfyui-oss.md`](comfyui-oss.md) / [`.json`](comfyui-oss.json) | Best open-weight model per capability (23 capabilities, 122 ranked options) with files, URLs, settings, VRAM, licenses; 170 LoRAs (camera, VFX, style, speed) with triggers; ComfyUI API notes | Open model choices, `scripts/gen-oss-loras.py` → `oss-loras.generated.ts` |+| [`comfyui-workflow-library.md`](comfyui-workflow-library.md) | The 53-workflow ComfyUI library: sources, validation results, bindings, models and sizes, custom nodes, quirks | `workflows/comfyui/manifest.json`, the ComfyUI provider |+| [`liner-ui.md`](liner-ui.md) | Liner's (liner.com — liner.app itself is a parked domain) design language: tokens, layout, composer, microcopy; the Fuobe theme derived from it | `src/app/globals.css`, studio components |++To refresh: re-run the research, then `pnpm gen:catalog` and `pnpm test` (catalog integrity tests catch broken references).diff --git a/scripts/comfy/hand-built/selftest-image.json b/scripts/comfy/hand-built/selftest-image.jsonnew file mode 100644index 00000000..a7f67e0f--- /dev/null+++ b/scripts/comfy/hand-built/selftest-image.json@@ -0,0 +1,5 @@+{+ "1": { "class_type": "LoadImage", "inputs": { "image": "example.png" }, "_meta": { "title": "Input" } },+ "2": { "class_type": "ImageInvert", "inputs": { "image": ["1", 0] } },+ "3": { "class_type": "SaveImage", "inputs": { "images": ["2", 0], "filename_prefix": "fuobe/selftest" } }+}diff --git a/scripts/comfy/hand-built/selftest-video.json b/scripts/comfy/hand-built/selftest-video.jsonnew file mode 100644index 00000000..29cace5e--- /dev/null+++ b/scripts/comfy/hand-built/selftest-video.json@@ -0,0 +1,8 @@+{+ "1": { "class_type": "LoadImage", "inputs": { "image": "example.png" }, "_meta": { "title": "Input" } },+ "2": { "class_type": "ImageInvert", "inputs": { "image": ["1", 0] } },+ "3": { "class_type": "ImageBatch", "inputs": { "image1": ["1", 0], "image2": ["2", 0] } },+ "4": { "class_type": "RepeatImageBatch", "inputs": { "image": ["3", 0], "amount": 12 } },+ "5": { "class_type": "CreateVideo", "inputs": { "images": ["4", 0], "fps": 8, "bit_depth": 8, "color_space": "sRGB", "codec": "none" } },+ "6": { "class_type": "SaveVideo", "inputs": { "video": ["5", 0], "filename_prefix": "fuobe/selftest", "format": "auto", "format.codec": "auto", "codec": "auto" } }+}diff --git a/scripts/comfy/library.spec.mjs b/scripts/comfy/library.spec.mjsindex 46f89812..734ec574 100644--- a/scripts/comfy/library.spec.mjs+++ b/scripts/comfy/library.spec.mjs@@ -1181,4 +1181,24 @@ export const SPEC = [vramGb: 8,notes: 'kijai ComfyUI-MMAudio example. Audio duration = loaded video duration (VHS_VideoInfo). Two outputs: the input video muxed with generated audio (VHS_VideoCombine -> history .gifs[]) and the FLAC track (SaveAudio -> history .audio[]). MMAudio is trained on 8 s clips; quality drops on long inputs.',},+ {+ id: 'selftest-image',+ title: 'Self-test: invert image',+ capability: 'edit',+ handBuilt: 'hand-built/selftest-image.json',+ bindings: { image: [b('1', 'image')], filenamePrefix: [b('3', 'filename_prefix')] },+ outputs: [{ node: '3', kind: 'image' }],+ vramGb: 0,+ notes: 'Runs on any ComfyUI (CPU is fine), needs no model files. Used by the Fuobe end-to-end self-test (tests/e2e/comfyui-selftest.mjs).',+ },+ {+ id: 'selftest-video',+ title: 'Self-test: image to flicker video',+ capability: 'i2v',+ handBuilt: 'hand-built/selftest-video.json',+ bindings: { image: [b('1', 'image')], filenamePrefix: [b('6', 'filename_prefix')] },+ outputs: [{ node: '6', kind: 'video' }],+ vramGb: 0,+ notes: 'Runs on any ComfyUI (CPU is fine), needs no model files. Exercises the SaveVideo output path.',+ },];diff --git a/src/app/(studio)/apps/[id]/page.tsx b/src/app/(studio)/apps/[id]/page.tsxindex a4d47dbb..5e12eeaf 100644--- a/src/app/(studio)/apps/[id]/page.tsx+++ b/src/app/(studio)/apps/[id]/page.tsx@@ -1,5 +1,6 @@import type { Metadata } from "next";import { notFound } from "next/navigation";+import { Suspense } from "react";import { StudioPage } from "@/components/studio/studio-page";import { APPS, getPreset } from "@/lib/catalog";import { appStudio } from "@/lib/studios";@@ -13,9 +14,17 @@ export async function generateMetadata({ params }: PageProps<"/apps/[id]">): Proreturn { title: getPreset(id)?.name ?? "App" };}-export default async function Page({ params }: PageProps<"/apps/[id]">) {+async function AppStudio({ params }: { params: PageProps<"/apps/[id]">["params"] }) {const { id } = await params;const preset = getPreset(id);if (!preset || preset.type !== "app") notFound();return <StudioPage config={appStudio(preset)} />;}++export default function Page({ params }: PageProps<"/apps/[id]">) {+ return (+ <Suspense fallback={null}>+ <AppStudio params={params} />+ </Suspense>+ );+}diff --git a/src/app/(studio)/motion-control/page.tsx b/src/app/(studio)/motion-control/page.tsxnew file mode 100644index 00000000..10ce67cc--- /dev/null+++ b/src/app/(studio)/motion-control/page.tsx@@ -0,0 +1,9 @@+import type { Metadata } from "next";+import { StudioPage } from "@/components/studio/studio-page";+import { MOTION_CONTROL_STUDIO } from "@/lib/studios";++export const metadata: Metadata = { title: "Motion control" };++export default function Page() {+ return <StudioPage config={MOTION_CONTROL_STUDIO} />;+}diff --git a/src/app/(studio)/video-edit/page.tsx b/src/app/(studio)/video-edit/page.tsxnew file mode 100644index 00000000..040f9542--- /dev/null+++ b/src/app/(studio)/video-edit/page.tsx@@ -0,0 +1,9 @@+import type { Metadata } from "next";+import { StudioPage } from "@/components/studio/studio-page";+import { VIDEO_EDIT_STUDIO } from "@/lib/studios";++export const metadata: Metadata = { title: "Edit video" };++export default function Page() {+ return <StudioPage config={VIDEO_EDIT_STUDIO} />;+}diff --git a/src/components/app-sidebar.tsx b/src/components/app-sidebar.tsxindex 39ca2c09..69351ca7 100644--- a/src/components/app-sidebar.tsx+++ b/src/components/app-sidebar.tsx@@ -27,6 +27,8 @@ import {Workflow,ZoomIn,Library,+ PersonStanding,+ Scissors,} from "lucide-react";import {Sidebar,@@ -62,6 +64,8 @@ const NAV = [label: "Studios",items: [{ href: "/lipsync", label: "Lipsync & avatars", icon: Mic2 },+ { href: "/motion-control", label: "Motion control", icon: PersonStanding },+ { href: "/video-edit", label: "Edit video", icon: Scissors },{ href: "/characters", label: "Characters", icon: ScanFace },{ href: "/upscale", label: "Upscale", icon: ZoomIn },{ href: "/audio", label: "Audio", icon: AudioLines },diff --git a/src/components/studio/composer.tsx b/src/components/studio/composer.tsxindex f7d64d5d..05e1c05b 100644--- a/src/components/studio/composer.tsx+++ b/src/components/studio/composer.tsx@@ -25,7 +25,7 @@ import { Kbd } from "@/components/ui/kbd";import { EFFECTS, getModel, getPreset, modelsFor, MOTIONS } from "@/lib/catalog";import { estimateCost, planGeneration, routesFor } from "@/lib/catalog/plan";import { OPERATION_LABELS, type GenerationRequest, type ModelDef, type Operation, type Preset } from "@/lib/catalog/types";-import { enhance, useCreateGeneration, useEngine } from "@/lib/api";+import { enhance, useCreateGeneration, useEngine, useStatus } from "@/lib/api";import { formatCost, ratioValue } from "@/lib/format";import { cn } from "@/lib/utils";import { PRESET_ICONS } from "@/components/preset-icons";@@ -73,7 +73,7 @@ function AspectChip({ options, value, onChange }: { options: string[]; value?: s<PopoverTrigger asChild><Chip icon={Ratio}>{value ?? options[0]}</Chip></PopoverTrigger>- <PopoverContent className="w-72 p-2" align="start">+ <PopoverContent className="w-72 p-2" align="start" side="top"><p className="px-1 pb-2 text-[13px] font-medium">Aspect ratio</p><div className="grid grid-cols-4 gap-1">{options.map((o) => (@@ -121,7 +121,7 @@ function SegmentChip<T extends string | number>({<PopoverTrigger asChild><Chip icon={icon}>{value !== undefined ? format(value) : format(options[0])}</Chip></PopoverTrigger>- <PopoverContent className="w-auto min-w-44 p-2" align="start">+ <PopoverContent className="w-auto min-w-44 p-2" align="start" side="top"><p className="px-1 pb-2 text-[13px] font-medium">{label}</p><div className="flex flex-wrap gap-1 rounded-full bg-muted p-0.5">{options.map((o) => (@@ -168,7 +168,7 @@ function PresetChip({ type, value, onChange }: { type: "motion" | "effect"; valu)}</Chip></PopoverTrigger>- <PopoverContent className="w-[min(92vw,460px)] p-2" align="start">+ <PopoverContent className="w-[min(92vw,460px)] p-2" align="start" side="top" collisionPadding={12}><div className="scrollbar-none mb-2 flex gap-1 overflow-x-auto">{cats.map((c) => (<button@@ -251,6 +251,7 @@ export function Composer({ docked }: { docked: boolean }) {const create = useCreateGeneration();const [enhancing, setEnhancing] = useState(false);const textarea = useRef<HTMLTextAreaElement>(null);+ const status = useStatus().data;const preset: Preset | undefined = draft.presetId ? getPreset(draft.presetId) : config.preset;const lockedModel = preset?.type === "app";@@ -510,7 +511,7 @@ export function Composer({ docked }: { docked: boolean }) {<Settings2 className="size-4" /></button></PopoverTrigger>- <PopoverContent className="w-80 space-y-3" align="start">+ <PopoverContent className="w-80 space-y-3" align="start" side="top"><p className="text-[13px] font-medium">Advanced</p><div className="space-y-1.5"><div className="flex items-center justify-between text-[12px] text-muted-foreground">@@ -557,7 +558,13 @@ export function Composer({ docked }: { docked: boolean }) {</Popover></div><span className="hidden shrink-0 font-mono text-[12px] text-muted-foreground sm:inline">- {cost === 0 ? "Free" : cost != null ? `≈ ${formatCost(cost)}` : ""}+ {model && status && status.demoMode !== "off" && !model.routes.some((r) => status.providers[r.provider]?.configured)+ ? "Demo · free"+ : cost === 0+ ? "Free"+ : cost != null+ ? `≈ ${formatCost(cost)}`+ : ""}</span><Tooltip><TooltipTrigger asChild>diff --git a/src/components/studio/feed.tsx b/src/components/studio/feed.tsxindex 056f7a01..80c9ea89 100644--- a/src/components/studio/feed.tsx+++ b/src/components/studio/feed.tsx@@ -185,7 +185,9 @@ export function GenerationGroup({<section className="group/gen animate-fade-up space-y-2.5"><header className="flex items-start gap-3"><div className="min-w-0 flex-1">- <h3 className="line-clamp-2 font-heading text-[19px] leading-snug">{g.prompt || preset?.name || "Untitled"}</h3>+ <h3 className="line-clamp-2 font-heading text-[19px] leading-snug" title={g.prompt ?? undefined}>+ {(preset ? g.request.prompt?.trim() : g.prompt) || preset?.name || "Untitled"}+ </h3><p className="mt-0.5 flex flex-wrap items-center gap-x-1.5 text-[12px] text-muted-foreground"><span className="inline-flex items-center gap-1">{g.engine === "open" ? <Cpu className="size-3" /> : <Cloud className="size-3" />}diff --git a/src/components/studio/media-slot.tsx b/src/components/studio/media-slot.tsxindex 680da617..3c66e339 100644--- a/src/components/studio/media-slot.tsx+++ b/src/components/studio/media-slot.tsx@@ -173,7 +173,7 @@ export function MediaSlot({)}>{over ? <Upload className="size-4" /> : <KindIcon kind={kind} className="size-4" />}- <span className="max-w-full truncate px-1 text-[10px] leading-tight font-medium">{label}</span>+ <span className="line-clamp-2 max-w-full px-1 text-center text-[10px] leading-[1.1] font-medium">{label}</span></button>)}{!value && <LibraryPicker kind={kind} onPick={onChange} />}diff --git a/src/components/studio/model-picker.tsx b/src/components/studio/model-picker.tsxindex c3641d30..376b4049 100644--- a/src/components/studio/model-picker.tsx+++ b/src/components/studio/model-picker.tsx@@ -91,7 +91,7 @@ export function ModelPicker({<ChevronDown className="size-3.5 opacity-60" /></Button></PopoverTrigger>- <PopoverContent align="start" className="w-[min(92vw,420px)] p-0 shadow-strong">+ <PopoverContent align="start" side="top" collisionPadding={12} className="w-[min(92vw,420px)] p-0 shadow-strong"><div className="flex items-center gap-2 border-b p-2"><div className="relative flex-1"><Search className="pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-muted-foreground" />@@ -105,7 +105,7 @@ export function ModelPicker({</div><EngineSwitch value={engine} onChange={onEngineChange} size="sm" /></div>- <ScrollArea className="max-h-[min(60vh,440px)]">+ <ScrollArea className="h-[min(56vh,440px)]"><div className="p-1">{visible.length === 0 && (<p className="px-3 py-8 text-center text-sm text-muted-foreground">diff --git a/src/components/studio/studio-context.tsx b/src/components/studio/studio-context.tsxindex 7ba64158..c7d5bf99 100644--- a/src/components/studio/studio-context.tsx+++ b/src/components/studio/studio-context.tsx@@ -12,6 +12,8 @@ export interface StudioConfig {feature: string;title: string;hero: string;+ /** Small line under the hero (e.g. which models an app runs on). */+ subtitle?: string;placeholder: string;kind: MediaKind;/** Operations whose models appear in the picker. */diff --git a/src/components/studio/studio-page.tsx b/src/components/studio/studio-page.tsxindex cafa12c6..c3901e5c 100644--- a/src/components/studio/studio-page.tsx+++ b/src/components/studio/studio-page.tsx@@ -150,6 +150,7 @@ function StudioBody({ header }: { header?: React.ReactNode }) {) : (<div className="flex flex-col items-center pt-[16vh] text-center"><h2 className="font-heading text-display text-balance">{config.hero}</h2>+ {config.subtitle && <p className="mt-2 max-w-xl text-[13px] text-muted-foreground">{config.subtitle}</p>}<div className="mt-10 w-full">{composer(false)}</div>{config.suggestions && (<div className="mt-4 flex max-w-[760px] flex-wrap justify-center gap-2">diff --git a/src/components/studio/viewer.tsx b/src/components/studio/viewer.tsxindex f67f1ba9..1f4fcee7 100644--- a/src/components/studio/viewer.tsx+++ b/src/components/studio/viewer.tsx@@ -103,7 +103,8 @@ export function Viewer({</div><div className="flex-1 space-y-4 overflow-y-auto px-4 pb-4"><div>- <p className="font-heading text-[20px] leading-snug">{g.prompt || preset?.name}</p>+ <p className="font-heading text-[20px] leading-snug">{(preset ? g.request.prompt?.trim() : g.prompt) || preset?.name}</p>+ {preset && g.prompt && <p className="mt-1 text-[12px] leading-relaxed text-muted-foreground">Sent to the model: {g.prompt}</p>}{g.prompt && (<buttononClick={() => {diff --git a/src/lib/studios.ts b/src/lib/studios.tsindex 38c1b432..99cc18d8 100644--- a/src/lib/studios.ts+++ b/src/lib/studios.ts@@ -46,12 +46,13 @@ export const VIDEO_STUDIO: StudioConfig = {hero: "What’s the shot?",placeholder: "Describe a shot… e.g. “slow dolly-in on a rainy street, neon reflections”",kind: "video",- ops: ["t2v", "i2v", "flf2v"],+ ops: ["t2v", "i2v", "flf2v", "ref2v"],feed: { kind: "video", features: ["video", "motion:*", "effect:*"] },slots: [{ key: "image", label: "Start frame", accept: "image" },{ key: "endImage", label: "End frame", accept: "image" },],+ multiRef: { label: "Add ref", max: 3 },presetPicker: "motion",defaultModels: { cloud: "seedance-2-5", open: "oss-wan22-14b-fast" },suggestions: [@@ -136,6 +137,13 @@ export function appStudio(preset: Preset): StudioConfig {feature: `app:${preset.id}`,title: preset.name,hero: preset.description,+ subtitle: [+ preset.cloud ? `Cloud: ${getModel(preset.cloud.modelId)?.name}` : "No cloud version yet",+ preset.open ? `Open source: ${getModel(preset.open.modelId)?.name}` : "No open-source version yet",+ preset.parity,+ ]+ .filter(Boolean)+ .join(" · "),placeholder: preset.promptPlaceholder ?? "Add details (optional)",kind,ops,@@ -147,3 +155,32 @@ export function appStudio(preset: Preset): StudioConfig {hidePrompt: preset.userPrompt === "none",};}++export const MOTION_CONTROL_STUDIO: StudioConfig = {+ feature: "motion-control",+ title: "Motion control",+ hero: "Make your character copy any move",+ placeholder: "Optional: describe the character or scene",+ kind: "video",+ ops: ["motion-transfer"],+ feed: { features: ["motion-control"] },+ slots: [+ { key: "image", label: "Character", accept: "image", required: true },+ { key: "video", label: "Driving video", accept: "video", required: true },+ ],+ defaultModels: { cloud: "kling-motion-control", open: "oss-wan22-animate" },+ promptOptional: true,+};++export const VIDEO_EDIT_STUDIO: StudioConfig = {+ feature: "video-edit",+ title: "Edit video",+ hero: "Change anything in a clip",+ placeholder: "Describe the edit… e.g. “make it snow”, “replace the car with a horse”",+ kind: "video",+ ops: ["v2v"],+ feed: { features: ["video-edit"] },+ slots: [{ key: "video", label: "Video", accept: "video", required: true }],+ multiRef: { label: "Add ref", max: 4 },+ defaultModels: { cloud: "kling-o3", open: "oss-wan22-fun-control" },+};diff --git a/workflows/comfyui/manifest.json b/workflows/comfyui/manifest.jsonindex 5a30ba02..882a04d1 100644--- a/workflows/comfyui/manifest.json+++ b/workflows/comfyui/manifest.json@@ -5449,11 +5449,11 @@"kind": "image"}],- "notes": "Runs on any ComfyUI (CPU is fine). Used by Settings \u2192 Run self-test and the e2e test.",+ "notes": "Runs on any ComfyUI (CPU is fine). Used by Settings \u2192 Run self-test and the e2e test. Validated by actually running it end to end through Fuobe on ComfyUI 0.41 (CPU).","customNodes": [],"models": [],"vramGb": 0,- "validated": false,+ "validated": true,"defaults": {},"source": "hand-built (Fuobe self-test, no model weights)"},@@ -5482,11 +5482,11 @@"kind": "video"}],- "notes": "Runs on any ComfyUI (CPU is fine). Exercises the SaveVideo output path.",+ "notes": "Runs on any ComfyUI (CPU is fine). Exercises the SaveVideo output path. Validated by actually running it end to end through Fuobe on ComfyUI 0.41 (CPU).","customNodes": [],"models": [],"vramGb": 0,- "validated": false,+ "validated": true,"defaults": {},"source": "hand-built (Fuobe self-test, no model weights)"}