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
Merge branch 'claude/fuobe-parity-4' into o/no-higgsfield
Claude1ba70445cc17
diff --cc README.mdindex e9aeae42,39c72d9a..dd2156a5--- a/README.md+++ b/README.md@@@ -1,29 -1,37 +1,37 @@@# Fuobe**An open-source AI image, video and audio 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, Gemini Omni, MiniMax, ElevenLabs…) 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. Higgsfield's in-house models (Soul, Cinema Studio, Genjutsu…) are rebuilt as **Fuobe Originals** from open-weight models and LoRAs, on both engines, and Higgsfield is never called.-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, Gemini Omni, MiniMax, ElevenLabs…, and Higgsfield's own Soul and Cinema Studio) with your own fal.ai / Replicate / Higgsfield key, **or** run the equivalent open-weight workflows on your own GPU through **ComfyUI**. Same studio, same apps, same camera motions — flip one switch. Fuobe's own rebuilds of Higgsfield's in-house models, the **Fuobe Originals** (Fuobe Soul, DoP, Cinema and Genjutsu so far, plus Soul ID training), run either way and never call Higgsfield. Licences are information, not gates: **Settings → Models & licences** shows the licence of every model, LoRA and node pack, everything starts switched on, and whoever runs the install switches off what doesn't fit.++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, Gemini Omni, MiniMax, ElevenLabs…) 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. Fuobe's own rebuilds of Higgsfield's in-house models, the **Fuobe Originals** (Fuobe Soul, DoP, Cinema and Genjutsu so far, plus Soul ID training), run either way. Higgsfield is never called: Soul, Cinema Studio and Genjutsu runs, saved setups and Assist plans from before open on the Original that replaced them. Licences are information, not gates: **Settings → Models & licences** shows the licence of every model, LoRA and node pack, everything starts switched on, and whoever runs the install switches off what doesn't fit.- - **Assist:** describe the whole job in a chat; the agent picks models, shows the plan and its cost, runs it when you approve, checks the results and chains the next step. Free / Smart / Manual modes, 20 built-in **skills** (SKILL.md playbooks, or upload your own), **projects** with instructions and up to 20 sources (links, files and PDFs, elements, notes), and **memory**. Runs on Claude, a local Ollama model, or an offline planner+ - **Assist:** describe the whole job in a chat; the agent picks models, shows the plan and its cost, runs it when you approve, checks the results and chains the next step. Free / Smart / Manual modes, 20 built-in **skills** (SKILL.md playbooks, or upload your own), **projects** with instructions and up to 20 sources (links, files and PDFs, elements, notes), and **memory**. **Scheduled tasks** run a request daily, weekly, every 1–168 hours or once, in your time zone; each run is a new chat that asks before it generates, or runs on its own within a cost cap ($2 a run by default). Your own **MCP connectors** (remote MCP servers, added in Settings → Assist · connectors) give Claude chats another app's tools: Anthropic's servers call them, so a local one needs a public tunnel, and their tools run without asking Fuobe, so each connector's Allowed tools list is the safeguard. Runs on Claude, a local Ollama model, or an offline planner (connectors need Claude)- **MCP:** other agents (Claude Code, Claude Desktop, any MCP client) can drive the studio through `/api/mcp`, including whole studio jobs that open in their studio (a Layers project, a Shorts session, a dub to review, a Faceless episode, an Ads Studio batch, the Captions editor, a Katana edit; Genjutsu, Remove object, Content Factory, the AI Influencer builder and Layers' Inpaint, Enhancer and Save as element aren't tools yet) and the skills as prompts. `npx skills add workingprototype/Fuobe` installs the skills in other agents- - **Command line:** `fuobe` lists models, prices a run, generates, waits and downloads from a terminal, a script or a coding agent; see [`docs/cli.md`](docs/cli.md)- - **Create:** Image · Video (text, image, start/end frame, **Frames**: up to 10 stills on a timeline, reference images and clips, multi-shot, draft mode) · Edit · **Layers** (split a flat image into editable layers, edit text with the lines found for you on either engine, Inpaint a painted area, an Enhancer (skin, soft glow, sharpen, detail), regional edits, save a layer as an element, cropped or positioned zips) · Inpaint & Draw to Edit · Color grading · Camera motions · Effects · Storyboard (and turn it into a film) · **Canvas** (wire prompts, files and models into node workflows; every template in a cloud and an open-source version) · Apps+ - **Command line:** `fuobe` lists models, prices a run, generates, waits and downloads from a terminal, a script or a coding agent; see [`docs/cli.md`](docs/cli.md). `--engine` also picks an Original's engine, and `--look` a Fuobe Soul look (`fuobe generate --help` lists it; cli.md doesn't yet)+ - **Fuobe Originals:** each is one model that runs on both engines, built on open-weight models and public LoRAs: free on your GPU through ComfyUI, or paid on fal or Replicate, with no Higgsfield call+ - **Fuobe Soul**, **Fuobe Soul HD** and **Fuobe Soul Cinema** (Image studio) — a Look picker with 139 looks in two sets named after Higgsfield's versions (Soul 2.0: 33, Soul: 106), with categories, search, drawn covers and a Strength slider. Attach a picture and Fuobe Soul restyles it with the look. Soul HD (Qwen-Image 2512) is for lettering; Soul Cinema has one film look and 21:9. Your browser finishes each result (crop, grade, overlays such as DigitalCam's date stamp) and keeps the raw picture. 87 looks use civitai LoRAs: without a civitai key, a run leaves those out and says so+ - **Fuobe DoP** (Wan 2.2) and **Fuobe DoP · LTX** (LTX-2.3) — the camera motions and effects as recipes: a move's LoRAs, a camera LoRA or (on your GPU) a Fun Camera pose, a colour grade or a relight where it has one, else its words. On the open engine, picking a move in the Video studio switches to the model it runs on (a few run on LTX-2.5). In the cloud, 152 of the 363 motions and effects use DoP's routes and switch the same way; the other 211 only add their words to the model you picked (their own route is Kling 2.5 Turbo). 15 colour-grade effects hand the clip to Color grading with the grade picked, 6 relight effects relight the start frame first, and Mix stacks both presets' LoRAs on either engine+ - **Fuobe Cinema** (Cinema Studio's video default) — Wan 2.2 14B Lightning free on your GPU (3 or 5 s, no sound), or LTX-2.3 on fal with sound and its built-in camera LoRAs (4–30 s: one call makes up to 20 s, and a longer take gets an automatic extend). In the cloud, 14 of Cinema's 33 camera moves use LTX-2.3's camera LoRA, start frame or not; with a start frame, a move with a Wan 2.2 LoRA switches the take to Fuobe DoP, and Rack Focus uses LTX-2.5 Fast's focus move. On your GPU, with a start frame, a move takes its Wan 2.2 LoRA or a Fun Camera pose. Otherwise the move goes into the prompt+ - **Fuobe Genjutsu** (Motion, Swap and Restyle; Motion and Swap also come in a cheaper, faster Standard quality) and **Fuobe Character swap** — Genjutsu's defaults: Wan Animate for motion transfer, SAM 3.1 and Wan VACE for object swap, Wan 2.2 Fun VACE for restyle, and MiniMax H3 with Akatz Labs' Character Swap LoRA for Character swap+ - **Fuobe Soul ID** — train a character or a look as a LoRA, free on your GPU through AI-Toolkit or on fal's trainers (see Elements below)+ - Built and checked in demo mode; no look, move, take, swap or training has run on a GPU or with a paid key yet, so their quality is unmeasured, and the three MiniMax H3 graphs have never loaded in a ComfyUI+ - **Create:** Image · Video (text, image, start/end frame, **Frames**: up to 10 stills on a timeline, reference images and clips, multi-shot, draft mode) · Edit · **Layers** (split a flat image into editable layers, edit text with the lines found for you on either engine, Inpaint a painted area, an Enhancer (skin, soft glow, sharpen, detail), regional edits, save a layer as an element, cropped or positioned zips) · Inpaint & Draw to Edit · Color grading · Camera motions and Effects (on Fuobe DoP) · Storyboard (and turn it into a film) · **Canvas** (wire prompts, files and models into node workflows; every template in a cloud and an open-source version; up to 20 pages per board, groups you can run as one, comment pins with replies, and drawing, shapes and text from a toolbar with keys; a Table node runs the node it feeds once per row; Change voice, Clone voice, Translate (text, or a dub of a video) and Video concatenator (cut, mute and join up to 50 clips) nodes) · Apps- **Studios:**- - **Cinema Studio** — projects and scenes, Director's Panel (camera, lens, 50 palettes, lighting rig, Emotion Wheel), 33 camera moves (# in the prompt bar), AI Director, image grids, Soul Cast and Soul Location, and **3D scenes**: turn a still into a scene you fly through, set the lens and frame, and Capture a re-rendered take from that view+ - **Cinema Studio** — projects and scenes, Director's Panel (camera, lens, 50 palettes, lighting rig, Emotion Wheel), 33 camera moves (# in the prompt bar), AI Director, image grids, Soul Cast and Soul Location, and **3D scenes**: turn a still into a scene you fly through, set the lens and frame, and Capture a re-rendered take from that view. Takes run on Fuobe Cinema by default on both engines (Seedance 2.5, Kling 3.0 and Veo 3.1 stay in the cloud menu, LTX-2.5 and Wan 2.2 14B on your GPU), stills on Fuobe Soul Cinema, Soul Cast on Fuobe Soul in the cloud (the Soul Cast sheet on your GPU) and Soul Location on Fuobe Soul. A project can be shared as a read-only link- **Shorts Studio** — restyle up to 2 minutes of your own footage with 44 looks (or your own references), in segments you can regenerate, stitched back under your sound; **Mixed Media** — 33 looks for 1–10 s clips with per-preset settings and a preview frame; on the cloud the clip's frames are sampled at the rate you pick (4–24 FPS) and each one is redrawn by default (Nano Banana 2 or Seedream 5.0 Flash, priced per frame), and **Fast** restyles in one video-to-video pass- - **Genjutsu** — keep a 4–30 s clip's motion, camera and framing and change what is in it: motion transfer, object swap, restyle or insert, with reference images, priced before it runs+ - **Genjutsu** — keep a 4–30 s clip's motion, camera and framing and change what is in it: motion transfer, **Character swap**, object swap, restyle (44 looks, Fuobe Soul's 139 or your own images) or insert, with reference images, priced before it runs. Every mode but Insert defaults to a Fuobe Original on both engines, and the picker shows each model's source (Original, open weights or partner) and licence. Character swap turns the person in a 5–15 s part of one shot (up to 30 s, in pieces or windows) into your character from one image, keeping the performance and the sound: pick who (largest, leftmost, rightmost, a number or, on your GPU, a click), 480p or 768p, and by default your character goes into the first frame first; "Describe my character" and "Use the clip's words" help write the prompt- **Marketing Studio** (84 templates), **Click to Ad** (with a logo end card), **Ads Studio** (brand kit from your website, up to 20 ads per product in 1:1 / 4:5 / 9:16) and **Ad Multiplier**- - **Moodboards**, **Color signature** (Soul HEX palettes), **Photodump / Instadump**, **Fashion Factory**, **Character Sheet**+ - **Moodboards** (the curated looks open on Fuobe Soul; **Train as a look…** trains a board into a look of its own for Fuobe Soul, on either engine), **Color signature** (Soul HEX palettes; with a Fuobe Soul model on the open engine, the colours are locked after generating by default), **Photodump / Instadump** and **Fashion Factory** (a character with a Soul ID runs on Fuobe Soul), **Character Sheet**- **AI Influencer** builder — build a character game-style: a character type (Average, Bold or Extreme human, or a creature: insect, frog, cat, dog, rodent or bird) and traits in 18 categories, with Shuffle, then save the sheet as a character- **Faceless Studio** and **Explainer** — channels, scripts, narrated and subtitled episodes with a timeline editor; "Frame by frame" moves the camera slowly over each still (a Ken Burns move), the music loops to cover long films, and Explainer reads PDF and Word sources- **Content Factory** — a faceless series in the style of a clip you like: upload it, paste a TikTok, Instagram or web-page link, or pick one of 8 preset styles. Fuobe reads it into a style brief you can edit, prices the whole series, then makes 1–10 Faceless episodes of 30 s to 5 min here, or gives you a prompt for Claude Code to make them through Fuobe's MCP server- - **Translate & dub** (your voice, lip-synced, over the original music and effects on both engines), **Captions** (transcribe, edit, burn in), **Trim**, **Katana** (recreate a reference edit with your subject), **Image to 3D**, Lipsync & avatars, Motion control, Edit / Extend / Reframe video, Video tools (**Remove object**: type it, paint it or, on the cloud, click it, and it's erased from the clip; matte, relight, depth, join clips, match colors), Upscale (images and video, **FPS Boost** and slow motion, **SDR to HDR**, and **Export** to ProRes, H.265 10-bit, FFV1 or EXR frames on the open engine), Audio (speech with voice picker and cloning, dialogue, voice change, sound effects, music, sound for video, transcribe, **loop / extend** and **join**), and a Virality predictor (a labelled heuristic)- - **Library:** all your results (images, videos, audio, text, 3D) with layouts, filters, nested folders, pins, a review status (In progress, Needs review, Approved, Rejected), Select all, bulk zip download and a Trash with 30-day restore. Helper steps stay hidden until you ask (Show steps), and an upload is deleted only when nothing uses it. Results arrive live, and a browser notification can tell you when a job finishes while Fuobe is in the background+ - **Translate & dub** (your voice, lip-synced, over the original music and effects on both engines), **Captions** (transcribe, edit, burn in), **Trim**, **Katana** (recreate a reference edit with your subject; Fuobe Genjutsu · Motion is one of its motion models, the default on your GPU), **Image to 3D** (from one photo, several photos of one object, words or an object picked in a photo, or one photo as a Gaussian splat to open in a splat viewer such as SuperSplat; Rig & animate a finished model; Pick an object and Rig & animate run on the cloud only), Lipsync & avatars, Motion control, Edit / Extend / Reframe video, Video tools (**Remove object**: type it, paint it or, on the cloud, click it, and it's erased from the clip; on your GPU, **H3 Person Removal** erases a person you name, with the opt-in H3 Relay pack; matte, relight, depth, join clips, match colors), Upscale (images and video, **FPS Boost** and slow motion, **SDR to HDR**, and **Export** to ProRes, H.265 10-bit, FFV1 or EXR frames on the open engine), Audio (speech with voice picker and cloning, dialogue, voice change, sound effects, music, sound for video, transcribe, **loop / extend** and **join**), and a Virality predictor (a labelled heuristic)+ - **Library:** all your results (images, videos, audio, text, 3D) with layouts, filters, nested folders, pins, a review status (In progress, Needs review, Approved, Rejected), Select all, bulk zip download and a Trash with 30-day restore. Helper steps stay hidden until you ask (Show steps), and an upload is deleted only when nothing uses it. Results arrive live, and a browser notification can tell you when a job finishes while Fuobe is in the background. **Share link…** on a result, a folder (with its subfolders) or a Cinema project makes a read-only page: choose a title, whether prompts show, and how long the link works (always, 1, 7 or 30 days). **Publish** turns selected results into a portfolio page (Feature, Series or Carousel, with a cover). The **Shared** tab lists your links with their views, to make a new link, hide prompts, re-date or revoke. A link opens without signing in, for anyone who can reach your Fuobe (Fuobe doesn't host these pages), and shared files have their embedded generation data blanked (ComfyUI workflows, video tags, EXIF). Canvas boards can't be shared yet- **Getting around:** a **Get started** card on Home and Settings (use paid models, use your GPU, or just try the demo); a **⌘K / Ctrl+K palette** that searches pages, settings, apps, motions, effects, models and recent creations; Start on Home runs the job and says first what it costs; **Settings → About & licences** lists every open model's licence- - **Elements:** save characters, locations, props, styles and voices once, then `@mention` them in any prompt; train a character (Soul ID, a fal LoRA, or AI-Toolkit on your GPU) for a consistent face; save one straight from a Layers layer or an AI Influencer sheet- - **LoRAs:** small add-on files that give an open model a look, a camera move or an effect. **Settings → LoRAs** lists a library of 114 researched LoRAs (67 looks, 23 motions, 24 effects) with each one's licence and source, and downloads them. On the open engine, a LoRA ComfyUI doesn't have is downloaded into your LoRA folder before the run and checked against its SHA-256 fingerprint. On the cloud, seven hosted open-weight models take LoRAs: Z-Image Turbo (hosted, now on fal and Replicate) and six new ones (Qwen-Image 2512, Qwen-Image-Edit 2511, FLUX.2 [klein] 4B, Wan 2.2 A14B image and video, LTX-2.3 22B), and a LoRA a run can't carry is left out with a warning. No preset takes its LoRAs from the new library yet- - **Catalog:** 200 cloud models + 85 open-source models (plus 45 hidden ones: chain steps and studio helpers, self-tests, browser tools, and Gemma 4 speech translate, which no studio uses yet), 124 apps, 108 camera motions (mix any two), 255 effects- - **Open-source engine:** 139 API-format ComfyUI workflows (official templates, community packs and hand-built graphs) validated against real ComfyUI node definitions, plus 43 researched LoRAs (camera moves, VFX) that 55 motion, effect and app presets use today (a separate set from the Settings → LoRAs library)- - **Evaluation harness (for developers):** `pnpm eval:run` (or `fuobe eval`) runs a suite of cases for each planned Fuobe Original (Fuobe's own open-weight versions of Higgsfield's in-house models, such as Soul and DoP) on the demo, open or cloud engine, scores the results with pinned open models, runs a blind A/B review and says whether a recipe may become a default. No Original is in the app yet: for now the suites measure their recipes on models already in the catalog (Z-Image Turbo for Soul, Wan 2.2 for DoP…), and cases that need the Original itself are skipped. Cloud runs are priced first and capped (default $5), and Higgsfield is never called. Nothing has been measured on a GPU or the cloud yet; see [`scripts/eval/README.md`](scripts/eval/README.md)+ - **Models & licences:** **Settings → Models & licences** (`/settings/models`, also from ⌘K, About & licences and the Models page) shows the licence of every model, LoRA and ComfyUI node pack, with switches per licence class, provider, node pack, LoRA and model. Everything is on by default, and LoRAs licensed for your GPU only go to fal or Replicate with a note unless you turn on **Keep them on your GPU**. A model you switch off leaves every picker and listing (studios, Canvas, Cinema, ⌘K, the API and CLI, Assist and Fuobe's MCP server); automatic picks move to the next model that is on, and a run that can't is refused, naming the switch. Anyone who can sign in can change it, and trainings and Assist's own Claude or Ollama calls aren't under the switches-- **Elements:** save characters, locations, props, styles and voices once, then `@mention` them in any prompt; save one straight from a Layers layer or an AI Influencer sheet. **Train** a character (with a consent tick) or a style as a **Fuobe Soul ID** from 5 to 80 photos (20 or more recommended): free on your GPU through AI-Toolkit, or on fal's trainers (about $1.50 to $6.40, priced first). It trains for one base: Z-Image Turbo (Fuobe Soul and Soul Cinema), Qwen-Image 2512 (Fuobe Soul HD), FLUX.1 [dev] and Krea [dev], FLUX.2 [dev], FLUX.2 [klein] 4B, and, on fal only, FLUX.2 [klein] 9B and Krea 2 (the klein and Krea 2 LoRAs run in the cloud only); the dialog shows each option's engine, price, time and licence. The LoRA then works on every model of that base, on both engines where the base has both, whenever you @mention the element. With no fal key and no AI-Toolkit (and Demo mode on "auto", the default), a training is an 8-second demo that trains nothing, and the dialog says so. Higgsfield Soul ID training is retired: an old Higgsfield Soul ID offers "Retrain for Fuobe Soul"++- **Elements:** save characters, locations, props, styles and voices once, then `@mention` them in any prompt; save one straight from a Layers layer or an AI Influencer sheet. **Train** a character (with a consent tick) or a style as a **Fuobe Soul ID** from 5 to 80 photos (20 or more recommended): free on your GPU through AI-Toolkit, or on fal's trainers (about $1.50 to $6.40, priced first). It trains for one base: Z-Image Turbo (Fuobe Soul and Soul Cinema), Qwen-Image 2512 (Fuobe Soul HD), FLUX.1 [dev] and Krea [dev], FLUX.2 [dev], FLUX.2 [klein] 4B, and, on fal only, FLUX.2 [klein] 9B and Krea 2 (the klein and Krea 2 LoRAs run in the cloud only); the dialog shows each option's engine, price, time and licence. The LoRA then works on every model of that base, on both engines where the base has both, whenever you @mention the element. With no fal key and no AI-Toolkit (and Demo mode on "auto", the default), a training is an 8-second demo that trains nothing, and the dialog says so. An old Soul ID from Higgsfield offers "Retrain for Fuobe Soul" (Higgsfield's Soul IDs can't be exported)+ - **LoRAs:** small add-on files that give an open model a look, a camera move or an effect. **Settings → LoRAs** lists a library of 114 researched LoRAs (67 looks, 23 motions, 24 effects) with each one's licence and source, and downloads them. On the open engine, a LoRA ComfyUI doesn't have is downloaded into your LoRA folder before the run and checked against its SHA-256 fingerprint. On the cloud, twelve hosted models take LoRAs: Z-Image Turbo (hosted, on fal and Replicate), Qwen-Image 2512, Qwen-Image-Edit 2511, FLUX.2 [klein] 4B, Wan 2.2 A14B image and video, LTX-2.3 22B, and, for Soul ID LoRAs, FLUX.1 [dev], FLUX.1 Krea [dev], FLUX.2 [dev], FLUX.2 [klein] 9B and Krea 2 Turbo. The Fuobe Originals' cloud routes send their looks' and moves' LoRAs too (Character swap sends Akatz Labs' swap LoRA), and a LoRA a run can't carry is left out with a warning. Fuobe Soul's looks take their LoRAs from the library, and a motion's or effect's LoRA that is in the library uses its pinned download and licence+ - **Catalog:** 209 cloud models + 90 open-source models + 12 Fuobe Originals that run on both (plus 48 hidden ones: chain steps and studio helpers, self-tests, browser tools, and Gemma 4 speech translate, which no studio uses yet), 124 apps, 108 camera motions (mix any two), 255 effects+ - **Open-source engine:** 148 API-format ComfyUI workflows (official templates, community packs and hand-built graphs), 145 of them validated against real ComfyUI node definitions (the three MiniMax H3 graphs need node packs the validation server doesn't have), plus 84 researched LoRAs (camera moves, VFX) that 122 motion, effect and app presets use today (43 of them are also in the Settings → LoRAs library, and 36 come from civitai)-- **Evaluation harness (for developers):** `pnpm eval:run` (or `fuobe eval`) runs a suite of cases for each Fuobe Original, built or planned (Fuobe's own open-weight versions of Higgsfield's in-house models, such as Soul and DoP) on the demo, open or cloud engine, scores the results with pinned open models, runs a blind A/B review and says whether a recipe may become a default. Fuobe Soul, DoP, Cinema, Genjutsu and Soul ID are in the app now, and their suites run the shipped models too (with `soul-cinema`, `soul-hex` and `dop-mix` suites and a palette metric; since PR #12 the `cinema` suite has Director scenes and LTX-2.3 camera moves, `genjutsu` has Character swap and the Lite tiers, and `soul-id` trains per base and as a look, and needs your own photos of a person who agreed); the other Originals' suites measure their recipes on models already in the catalog, and cases that need the Original itself are skipped. Cloud runs are priced first and capped (default $5), and nothing goes through Higgsfield. A recipe's licences are a note on its verdict, not a hold (`eval:promote --licence-hold` restores the hold, and `--commercial-only` keeps non-commercial metric models and covers out). Nothing has been measured on a GPU or the cloud yet; see [`scripts/eval/README.md`](scripts/eval/README.md)++- **Evaluation harness (for developers):** `pnpm eval:run` (or `fuobe eval`) runs a suite of cases for each Fuobe Original, built or planned (Fuobe's own open-weight versions of Higgsfield's in-house models, such as Soul and DoP) on the demo, open or cloud engine, scores the results with pinned open models, runs a blind A/B review and says whether a recipe may become a default. Fuobe Soul, DoP, Cinema, Genjutsu and Soul ID are in the app now, and their suites run the shipped models too (with `soul-cinema`, `soul-hex` and `dop-mix` suites and a palette metric; since PR #12 the `cinema` suite has Director scenes and LTX-2.3 camera moves, `genjutsu` has Character swap and the Lite tiers, and `soul-id` trains per base and as a look, and needs your own photos of a person who agreed); the other Originals' suites measure their recipes on models already in the catalog, and cases that need the Original itself are skipped. Cloud runs are priced first and capped (default $5), and Higgsfield is never called. A recipe's licences are a note on its verdict, not a hold (`eval:promote --licence-hold` restores the hold, and `--commercial-only` keeps non-commercial metric models and covers out). Nothing has been measured on a GPU or the cloud yet; see [`scripts/eval/README.md`](scripts/eval/README.md)- **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`).@@@ -49,13 -57,14 +57,13 @@@ The mode can also be set with `FUOBE_EN| 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 [fal.ai](https://fal.ai/dashboard/keys) key | `fal.ai API key` (or `FAL_KEY`) | Every cloud model and cloud app, and Soul ID training in the cloud |-| A Replicate token | `Replicate API token` (or `REPLICATE_API_TOKEN`) | Fallback route for models Replicate hosts; **Preferred provider** (or `FUOBE_CLOUD_PROVIDER`: `auto`, `fal`, `replicate` or `higgsfield`) picks which one goes first, unless only the other can carry the run's LoRAs or make the clip length asked |-| A [Higgsfield API](https://console.higgsfield.ai) key | `Higgsfield API key` as `KEY_ID:KEY_SECRET` (or `HIGGSFIELD_API_KEY`, `HF_KEY`, or `HF_API_KEY` + `HF_API_SECRET`) | Higgsfield's own models (Soul 2.0 / Soul Cinema / Soul v1 with live presets, Genjutsu and Genjutsu Lite, Cinema Studio 4.0, Marketing Studio, Ads Studio), plus extra routes for Seedance, Kling, Wan, MiniMax… (in Cinema too, for Seedance 2.5 or Kling). Since PR #12, Cinema's defaults (Fuobe Cinema, Fuobe Soul Cinema and Fuobe Soul), the Genjutsu studio and Soul ID training no longer use it; Higgsfield's Genjutsu models stay in Motion Control and Edit Video with a key until the provider is removed |+| A Replicate token | `Replicate API token` (or `REPLICATE_API_TOKEN`) | Fallback route for models Replicate hosts; **Preferred provider** (or `FUOBE_CLOUD_PROVIDER`: `auto`, `fal` or `replicate`) picks which one goes first, unless only the other can carry the run's LoRAs or make the clip length asked || A GPU running ComfyUI | `ComfyUI server URL` (or `COMFYUI_URL`, default `http://127.0.0.1:8188`; `COMFYUI_TOKEN` if it sits behind a proxy) | Every open-source model, app, motion, effect and studio route |- | An Anthropic key | `Anthropic API key` (or `ANTHROPIC_API_KEY`) | The full **Assist** agent (Smart and Manual modes), text steps (translate, write, scripts, ad copy, brand research), prompt **Enhance** and storyboard splitting with Claude |+ | An Anthropic key | `Anthropic API key` (or `ANTHROPIC_API_KEY`) | The full **Assist** agent (Smart and Manual modes, scheduled tasks that plan with Claude, and your MCP connectors), text steps (translate, write, scripts, ad copy, brand research), prompt **Enhance**, storyboard splitting and Genjutsu's "Describe my character" with Claude || Ollama | `Prompt enhancement` → Ollama (`OLLAMA_URL`, `OLLAMA_MODEL`, default `qwen3:8b`; `FUOBE_ENHANCE_PROVIDER`) | The same text steps and the Assist agent on a local model (tool calling) |- | A LoRA folder (and a civitai account) | **Settings → LoRAs**: `LoRA folder`, ComfyUI's `models/loras` (or `COMFYUI_LORAS_DIR`), and `civitai API key` (or `CIVITAI_API_KEY`) | Fuobe downloads a LoRA ComfyUI doesn't have before the run and checks its fingerprint. 72 of the 114 library LoRAs are on civitai and need the key, which is never sent to fal or Replicate |- | AI-Toolkit (ostris) on your GPU | `AI_TOOLKIT_URL` (+ `AI_TOOLKIT_AUTH`, `AI_TOOLKIT_DATASET_DIR`) and `COMFYUI_LORAS_DIR` | Train character and style LoRAs from an element's photos or a moodboard; the result is copied into ComfyUI and used whenever you @mention it |+ | A LoRA folder (and a civitai account) | **Settings → LoRAs**: `LoRA folder`, ComfyUI's `models/loras` (or `COMFYUI_LORAS_DIR`), and `civitai API key` (or `CIVITAI_API_KEY`) | Fuobe downloads a LoRA ComfyUI doesn't have before the run and checks its fingerprint. 72 of the 114 library LoRAs are on civitai and need the key, which is never sent to fal or Replicate. 87 of Fuobe Soul's looks use one, and 36 of the motions' and effects' LoRA files are among them |+ | AI-Toolkit (ostris) on your GPU | `AI_TOOLKIT_URL` (+ `AI_TOOLKIT_AUTH`, `AI_TOOLKIT_DATASET_DIR`; the Settings page has no field for them, so set the environment variables or `PUT /api/settings`) and `COMFYUI_LORAS_DIR` | Free Soul ID training of characters and styles from an element's photos or a moodboard, on Z-Image Turbo, Qwen-Image 2512, FLUX.1 [dev], FLUX.2 [dev] or FLUX.2 [klein] 4B (AI-Toolkit downloads the base weights itself; the FLUX [dev] repos need a Hugging Face token). Fuobe keeps the LoRA and copies it into ComfyUI (from an AI-Toolkit on another machine, copy it by hand). The training dialog can also download a training kit to run anywhere |Each connection field in Settings has **Save & test**: what you typed is tested before it is saved, and a failure says why. Until something is connected (or you hide it), Home and Settings show a **Get started** card with the three ways in.@@@ -92,7 -104,16 +103,17 @@@ Uploads up to 200 MB work with sign-in- **Topaz Video is priced by size:** $0.01/s at 720p, $0.02/s at 1080p and $0.06/s above, doubled at 60 fps (it was a flat $0.02/s at 2×). The default target is 1080p, and a size that wouldn't enlarge the clip moves up, so a 1080p clip now goes to 1440p at $0.06/s. Open-source video upscaling (SeedVR2, Real-ESRGAN) also asks for a size now, 720p to 2160p, instead of 2× or 4×.- **Cloud Mixed Media costs more by default.** It now redraws each sampled frame (**Per frame**): about $6 for 10 s at 1K, where the video-to-video pass was one call. Pick **Fast** under Restyle to keep the old behaviour. API calls with no `modelId` and no `mode` now get Per frame; a model sent for the wrong mode gets a 422.- **Click to Ad ends on a logo card by default** when the product kit has a logo: 2.5 s longer, included in the price. Switch **End card** off to keep the old ads. API calls without `endCard` are unchanged.- - **LoRAs on the open engine:** set the **LoRA folder** in Settings → LoRAs, plus a civitai key for 72 of the 114 library LoRAs. Fuobe writes the files itself, so the folder must be one the Fuobe machine can write to (ComfyUI on the same PC, or its `models/loras` shared); otherwise place the files by hand, as you must for the two gated Hugging Face LoRAs. With no folder set, a run that needs a LoRA ComfyUI doesn't have stops and says what to do. A LoRA sent to a workflow with no model loader to attach it to now fails the run instead of being dropped silently.+ - **Motion and effect links open on the move's model (PR #10).** Picking a camera motion or effect in the Video studio, or arriving from Motions or Effects, now switches to the model its move runs on: Fuobe DoP or Fuobe DoP · LTX, a few on LTX-2.5. In the cloud, 152 presets change model and price; the other 211 keep Kling 2.5 Turbo as their route and leave the model you picked alone. Moodboards' curated looks open on Fuobe Soul. Per-megapixel cloud prices (Z-Image Turbo, Qwen-Image 2512, FLUX.1 Fill [pro]…) now count every picture, so n pictures quote about n× the old estimate. On a Canvas board, dragging the empty board now draws a selection box; scroll, Space-drag, the middle button or H pans.+ - **Open-engine motions and effects no longer all run on Wan 2.2 (PR #10).** 17 open on Fuobe DoP · LTX (FPV Drone, Wind to Face, Earth Zoom Out, Flying Cam Transition and 13 transitions) and need the LTX-2.3 checkpoint (29.53 GB, plus the 9.45 GB Gemma 3 text encoder if LTX-2 isn't set up) and a 32 GB GPU. On 24 GB, pick Fuobe DoP: it runs their words. Slow Motion, Car Drive and Wild Ride open on LTX-2.5. Relight effects first run the existing Qwen-Image-Edit 2509 Relight workflow (about 31 GB of model files).+ - **Cloud keys for the Originals (PR #10).** The presets that moved to Fuobe DoP, Fuobe Soul HD, the relight step and Focus Change need a fal key; Fuobe DoP (start frame only) and Fuobe Soul's text to image also run on Replicate. None runs on Higgsfield: with only a Higgsfield key, motion links and curated looks open on a model that can't run. Pick Kling 2.5 Turbo or another model, or add a fal key.+ - **Licences are information, not gates (PR #12).** Everything is switched on by default: LoRAs licensed for your GPU only (civitai files without the "Rent" permission) now go to fal or Replicate with a note, Assist and automatic picks can choose non-commercial models, and re-running the install script adds the non-commercial ComfyUI-Whisper. Studio defaults don't change with it. To stay commercial-only, or keep GPU-only LoRAs at home, use **Settings → Models & licences**: switch off licence classes, providers, node packs, LoRAs or models, and turn on **Keep them on your GPU**. There is no admin role: anyone who can sign in (or anyone who can reach a password-less install) can change it.+ - **MiniMax H3 (PR #12)** is Character swap's default on both engines and runs H3 Person Removal. Its licence excludes the US, the EU, the UK and South Korea, needs MiniMax's written authorization above US$20M yearly revenue, and asks commercial products to show "MiniMax H3". If that doesn't fit, switch off "Fuobe Character swap", "H3 Character Swap · Relay 2.0" and "H3 Person Removal · Relay 2.0" in Settings → Models & licences. The Restricted regions switch covers only your GPU, because fal's H3 is classed as a paid API.+ - **Share links skip sign-in (PR #12).** Nothing is shared until you make a link. Set `FUOBE_PASSWORD` so the rest of the studio stays locked (the Share dialog warns when there is none), and behind a reverse proxy set `FUOBE_TRUST_PROXY=1` so a visitor who guesses wrong links is locked out alone. Copy a link when you make it: only the browser that made it can copy it again. Revoking a link deletes it at once, though a browser may keep files it already fetched for 5 minutes.+ - **Scheduled tasks (PR #12)** run only while Fuobe runs; a run missed while it was off happens once after the next start. A sweep every 30 s starts at boot, and every Fuobe server on the same database runs due tasks, so a dev server on your real data folder runs, and spends on, your schedules too. A task asks first by default; one that runs on its own counts Fuobe's generation jobs against its cap, not Claude's tokens. Connectors are offered in every Claude chat, the ones you already have included; a scheduled task uses them only when you tick "Let runs use my connectors".+ - **New defaults in Cinema, Genjutsu and Soul ID (PR #12).** Cinema's video default is Fuobe Cinema on both engines, so a cloud take costs LTX-2.3's price per megapixel of video on fal (about $0.18 for 5 s at 720p), and stills default to Fuobe Soul Cinema. Cinema Studio 4.0, Soul 2.0 and Higgsfield's Soul Cinema leave Cinema's menus, and a saved pick falls back to the Original. Genjutsu's modes (all but Insert) default to the Fuobe Originals instead of Higgsfield's Genjutsu; old setup codes open the replacing Original (without a Higgsfield look), and Katana's Genjutsu motion option takes 1 reference instead of Higgsfield's 8. In the cloud, Fuobe Cinema and the Genjutsu Originals need a fal key. Soul ID no longer trains on Higgsfield: a Higgsfield training still queued or running fails with a note to retrain for Fuobe Soul. fal's Z-Image training is now 2,000 steps for about $1.70 (it was 1,000 for $0.85), elements hold up to 80 photos (was 20), and Photodump, Fashion and trained moodboards run on Fuobe Soul.+ - **Scripts that call the API (PR #12):** training a character needs `consent: true` (`POST /api/elements/[id]/trainings` takes `{target, consent}`), `/lora` takes `family` instead of `modelId` and `/training-kit` a `family`; `POST /api/genjutsu` takes mode `character`, and look kind `soul` replaces `higgsfield`; Cinema's `GET /api/cinema/projects/[id]` returns `context` as `{cloudAllowed, civitai}` (no `higgsfield`); `GET /api/models` lists only models that are on, and `POST /api/generations` answers 422, naming the switch, for one that is off.++- **Higgsfield is no longer called (O7).** The saved Higgsfield key is deleted, and **Preferred provider** goes back to Auto if it was Higgsfield. Reuse, saved Canvas boards and Cinema projects, Genjutsu setup codes, Katana jobs, Assist plans, retries and API, CLI or MCP calls that name Soul, Soul 2.0, Soul Cinema, Cinema Studio 4.0 or a Genjutsu model run on the Fuobe Original that replaced it, on your engine (Marketing Studio Image runs on GPT Image 2.5, Ads Studio and the AI Influencer app on Nano Banana Pro, until their Originals land), and the API's notes say so. Cinema Studio's Director settings become words in the prompt, and its reference takes run on Seedance 2.5. Seedance 2.5's video edit and LTX 2.5's start/end-frame clip only ran there: they now run on Kling O3 and Fuobe Cinema. Past results stay in the Library under the name they ran as. A job still running there when you upgrade fails with a note to run it again, and an Ads Studio batch made there is remade the Fuobe way on retry.+ - **LoRAs on the open engine:** set the **LoRA folder** in Settings → LoRAs, plus a civitai key for 72 of the 114 library LoRAs. Fuobe writes the files itself, so the folder must be one the Fuobe machine can write to (ComfyUI on the same PC, or its `models/loras` shared); otherwise place the files by hand, as you must for the two gated Hugging Face LoRAs. With no folder set, a run that needs a LoRA ComfyUI doesn't have stops and says what to do. A LoRA sent to a workflow with no model loader to attach it to now fails the run instead of being dropped silently. Since PR #10 the presets use many more LoRAs on the open engine: 84 files (was 43), 36 of them from civitai (was none). Without the civitai key, a motion, an effect or one of six Cinema Studio moves (Handheld, POV, Robot Arm, Snorricam, Tracking and Side Tracking) that needs a civitai file ComfyUI doesn't have stops before the job; Fuobe Soul leaves those LoRAs out and says so.- **Cloud runs with LoRAs:** when a model runs on both fal and Replicate, Fuobe picks the one that can take every LoRA and the clip length asked, even over **Preferred provider**. LoRAs a run can't take are left out with a warning.- **Password-less installs reached by a domain name** (a reverse proxy, a tunnel, a Tailscale name) get 403 since round 3. Set a password, or add the name to `FUOBE_ALLOWED_ORIGINS`.- **Inputs from LAN addresses** (an image URL on your NAS, say) are refused unless `FUOBE_ALLOW_PRIVATE_URLS=1` (also since round 3).@@@ -120,9 -143,9 +143,9 @@@ node tests/e2e/comfyui-canvas-concat.mj## Development```bash- pnpm typecheck && pnpm lint && pnpm test # TypeScript, ESLint, Vitest (133 files, 2084 tests; with uv, also the harness's Python metric tests)+ pnpm typecheck && pnpm lint && pnpm test # TypeScript, ESLint, Vitest (155 files, 2524 tests; with uv, also the harness's Python metric tests)pnpm build # production build- pnpm gen:catalog # regenerate cloud models, studio packs, LoRA map, LoRA library, AI Influencer options, Fuobe Soul's looks, trainers and icon map from docs/research/*.json-pnpm gen:catalog # regenerate cloud models, Higgsfield models and presets, LoRA map, LoRA library, AI Influencer options, Fuobe Soul's looks, Soul ID's trainers and icon map from docs/research/*.json++pnpm gen:catalog # regenerate cloud models, studio packs, LoRA map, LoRA library, AI Influencer options, Fuobe Soul's looks, Soul ID's trainers and icon map from docs/research/*.jsonpnpm dev:clean # clear the Turbopack cache if the dev server gets stuck reloading or serves stale CSSnode scripts/gen-demo-3d.mjs # regenerate the demo GLB and turntable (needs ffmpeg)```diff --cc src/server/generations.tsindex 900a06f7,6ca27c56..63a5462a--- a/src/server/generations.ts+++ b/src/server/generations.ts@@@ -931,11 -920,11 +939,13 @@@ export const COMFY_WAIT = { ms: 60_000/** Launch dependent jobs whose inputs finished; fail the ones whose inputs failed. Never waits for an upload. */async function advanceDependents(): Promise<void> {const rows = db().prepare(READY_DEPENDENTS).all(50 + submitting().size) as Row[];+ // A forced look at ComfyUI, at most one a sweep, for the steps that found it not answering.+ let lookedAgain: Promise<boolean> | undefined;for (const r of rows) {if (submitting().has(r.id)) continue;- const stored = JSON.parse(r.request_json) as GenerationRequest;+ // A step queued before its model was retired runs on what replaced it (and its row says so).+ const moved = currentRequest(JSON.parse(r.request_json) as GenerationRequest);+ const stored = moved.request;const allIds = depIds(r.depends_on);const allSlots = slotsFor(stored, allIds.length);const allDeps = allIds.map(diff --cc tests/no-higgsfield.test.tsindex 2a0f910f,00000000..5d1a3f21mode 100644,000000..100644--- a/tests/no-higgsfield.test.ts+++ b/tests/no-higgsfield.test.ts@@@ -1,535 -1,0 +1,557 @@@+import fs from "node:fs";+import os from "node:os";+import path from "node:path";+import { afterAll, describe, expect, it } from "vitest";++/**+ * Build plan O7: Fuobe calls no Higgsfield API. This file fails when a code path names that provider again (its id,+ * key, endpoints, settings, env vars or copy that offers it), when a retired model comes back into the catalog, or+ * when an id stored before the switch no longer resolves to the model that replaced it. It scans whole folders, so a+ * branch merged later (an Originals package, a studio) is caught too. Research files under docs/research/ stay as+ * research and are not scanned; this file is the one test that names the provider.+ */++const dir = fs.mkdtempSync(path.join(os.tmpdir(), "fuobe-no-hf-"));+process.env.FUOBE_DATA_DIR = dir;+process.env.COMFYUI_URL = "http://127.0.0.1:9";++const { MODELS, getModel } = await import("@/lib/catalog");+const { enginesOf } = await import("@/lib/catalog/engines");+const { DIRECTOR_FIELDS, OPS_REPLACED_BY, REPLACED_BY, TRAINING_REPLACED_BY, currentModelId, migrateRequest, replacedBy, replacementOf } = await import("@/lib/catalog/replaced");+const { directorFieldWords } = await import("@/lib/catalog/cinema");+const { routesFor } = await import("@/lib/catalog/plan");+const { castSheetModel } = await import("@/lib/catalog/packs");+const { TRAINING_TARGETS } = await import("@/lib/catalog/training");+const { SOUL_LEGACY_IDS } = await import("@/lib/catalog/soul-looks.generated");+const { PROVIDER_SETTINGS } = await import("@/lib/connections");+const { PROVIDERS, provider, RETIRED_PROVIDER_ERROR } = await import("@/server/providers");+const { SETTINGS, getSetting, setSetting } = await import("@/server/settings");+const { db } = await import("@/server/db");+const { withCurrentModels } = await import("@/lib/catalog/canvas");+const generationsRoute = await import("@/app/api/generations/route");+const { currentRequest, ensureRunner, getGeneration, listGenerations, previewGeneration } = await import("@/server/generations");+const { planCaps, retryPhoto } = await import("@/server/photodump");+const assistTools = await import("@/server/assist/tools");+const { saveFile } = await import("@/server/storage");++afterAll(() => fs.rmSync(dir, { recursive: true, force: true }));++let rows = 0;+/** A generation row as one stored before the switch reads (the retired model and provider, as it was left). */+function storedRow(r: { feature: string; model: string; provider: string; op: string; kind?: string; status: string; request: object; externalId?: string; dependsOn?: string; outputs?: object[] }): string {+ const id = `old-${++rows}`;+ const now = Date.now();+ db()+ .prepare(+ `INSERT INTO generations (id, feature, model_id, engine, provider, op, kind, status, request_json, outputs_json, external_id, depends_on, created_at, updated_at)+ VALUES (?, ?, ?, 'cloud', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,+ )+ .run(id, r.feature, r.model, r.provider, r.op, r.kind ?? "image", r.status, JSON.stringify(r.request), JSON.stringify(r.outputs ?? []), r.externalId ?? null, r.dependsOn ?? null, now, now);+ return id;+}++/** Run the background runner until `done` holds (its own timer may be mid-tick). */+async function runUntil(done: () => boolean) {+ ensureRunner();+ for (let i = 0; i < 100 && !done(); i++) {+ await globalThis.__fuobeRunner!.tick();+ await new Promise((r) => setTimeout(r, 20));+ }+}++const ROOT = path.resolve(__dirname, "..");++// ---------------------------------------------------------------------------+// The guard: no code path names the provider++/**+ * Where code and shipped content live, and the README's setup steps (docs/ holds the research, which stays). The+ * unmerged round-4 docs branches (claude/fuobe-r4-batch-4, claude/fuobe-r4-docs-3, origin/main) still add README lines+ * offering a Higgsfield key and generating "Higgsfield models and presets": merging one fails here until they go.+ */+const SCANNED = ["src", "scripts", "bin", "skills", "workflows", "package.json", "README.md"];+const TEXT = /\.(ts|tsx|mts|js|mjs|cjs|py|json|md|sh|bat|ps1|css|html|txt|yml|yaml)$/;++/**+ * Files that must name it, and why. Nothing else may: add a line here only for history that has to read the old+ * name (a migration, the table of what replaced what), never for a route, a key or a model that runs.+ */+const ALLOWED: Record<string, string> = {+ "src/server/db.ts": "the O7 migration deletes the retired key and rewrites stored values that name the provider",+ "src/lib/catalog/replaced.ts": "what each retired model was called, for history",+};+++/**++ * The README's upgrade notes are dated history ("Soul ID no longer trains on Higgsfield (PR #12)"): only that section++ * may name it. Everything else in the README (setup, keys, env vars, the stack) is scanned like code.++ */++const HISTORY_SECTIONS: Record<string, string> = { "README.md": "### Upgrading from an earlier version" };++++/** A file's lines, with a history section blanked (HISTORY_SECTIONS): it ends at the next heading of its level or above. */++function scannedLines(f: string, text: string): string[] {++ const lines = text.split("\n");++ const heading = HISTORY_SECTIONS[f];++ const at = heading ? lines.indexOf(heading) : -1;++ if (at < 0) return lines;++ const level = heading.indexOf(" ");++ const next = lines.findIndex((l, i) => i > at && /^#{1,6} /.test(l) && l.indexOf(" ") <= level);++ const end = next < 0 ? lines.length : next;++ return lines.map((l, i) => (i > at && i < end ? "" : l));++}+++/** Research files and research record fields keep their names: reading research is not calling the provider. */+const RESEARCH_NAMES = /higgsfield-[a-z0-9-]+\.(md|json)|higgsfieldEquivalent/g;++const RULES: [string, RegExp][] = [+ // An id, key, endpoint, URL, import or settings key: always lowercase in code.+ ["names the provider in code (an id, key, endpoint, URL or import)", /higgsfield/],+ ["names a Higgsfield env var or constant", /HIGGSFIELD|\bHF_(API_)?(KEY|SECRET)\b/],+ // Copy that offers the provider: "Higgsfield key", "connect Higgsfield", "runs on Higgsfield", "Higgsfield Ads Studio"…+ [+ "offers the provider in copy",+ // ("as on Higgsfield" and "Higgsfield's old style ids" are comparisons and history, not an offer.)+ /higgsfield (api|key|account|balance|route|provider|credit|console)|(needs|with|connect|add|set) (a |an |your )?higgsfield(?!'s)\b|(?<!as )\b(on|via|through) higgsfield\b|higgsfield's (api|own models?|route|key)|higgsfield (soul|cinema studio|ads studio|marketing studio)|higgsfield (models and )?presets\b/i,+ ],+ // An identifier in any case: HiggsfieldProvider, viaHiggsfield, HIGGSFIELD_… (the env rule) — never history.+ ["names the provider in an identifier", /[A-Za-z0-9_$]Higgsfield|Higgsfield[A-Z0-9_$]/],+ // A choice, label or route named after it: { value: "Higgsfield" }, label: "Higgsfield first", provider: "Higgsfield".+ ["offers the provider as a value or label", /\b(label|value|provider|vendor|name|title|placeholder|engine|route)\s*:\s*["'`][^"'`]*\bhiggsfield\b/i],+ // Copy that says something runs on it: "Runs with Higgsfield's Soul", "rendered by Higgsfield", "Uses Higgsfield to render"+ // ("uses Higgsfield's labels" is a comparison).+ ["says something runs on the provider", /\b(runs? (with|on)|ran (with|on)|made (with|on|by)|rendered (with|on|by)|renders (with|on)|powered by|goes to|sent to|calls?)\s+higgsfield\b|\b(uses?|using)\s+higgsfield\b(?!'s)/i],+];++/** A retired model or training id in code (a stored one resolves through replaced.ts; nothing else names it). */+const RETIRED_IDS = new RegExp(`["'\`](${[...Object.keys(REPLACED_BY), ...Object.keys(TRAINING_REPLACED_BY)].join("|")})["'\`]`);+const RETIRED_ID_ALLOWED = new Set(["src/lib/catalog/replaced.ts", "src/server/db.ts"]);++function walk(p: string, out: string[]) {+ const full = path.join(ROOT, p);+ if (!fs.existsSync(full)) return;+ const st = fs.statSync(full);+ if (st.isFile()) {+ if (TEXT.test(p)) out.push(p);+ return;+ }+ for (const name of fs.readdirSync(full)) {+ if (name === "node_modules" || name.startsWith(".")) continue;+ walk(path.join(p, name), out);+ }+}++describe("no code path names the Higgsfield provider", () => {+ const files: string[] = [];+ for (const p of SCANNED) walk(p, files);++ it("scans every source, script, skill and workflow file", () => {+ expect(files.length).toBeGreaterThan(500);+ expect(files).toContain("src/server/providers/index.ts");+ });++ it("finds no provider id, key, endpoint, env var or copy that offers it outside the allowed history", () => {+ const hits: string[] = [];+ for (const f of files) {+ if (ALLOWED[f]) continue;- const lines = fs.readFileSync(path.join(ROOT, f), "utf8").split("\n");++ const lines = scannedLines(f, fs.readFileSync(path.join(ROOT, f), "utf8"));+ lines.forEach((line, i) => {+ const text = line.replace(RESEARCH_NAMES, "");+ for (const [why, re] of RULES) if (re.test(text)) hits.push(`${f}:${i + 1} ${why}: ${line.trim().slice(0, 140)}`);+ });+ }+ expect(hits).toEqual([]);+ });++ it("catches what a later branch could bring back: identifiers, labels, copy and README key rows", () => {+ const probes = [+ "export const HiggsfieldProvider = createAdapter();",+ "const viaHiggsfield = route.provider === x;",+ 'label: "Higgsfield",',+ '{ value: "Higgsfield", label: "Higgsfield first" }',+ `note: "Runs with Higgsfield's Soul model"`,+ "toast('Uses Higgsfield to render the ad')",+ "| A Higgsfield key | `HIGGSFIELD_API_KEY` | Soul 2.0 |",+ "pnpm gen:catalog # regenerate cloud models, Higgsfield models and presets, LoRA map",+ ];+ for (const p of probes) expect(RULES.some(([, re]) => re.test(p.replace(RESEARCH_NAMES, ""))), p).toBe(true);++ // The README's upgrade notes are history; the rest of it is scanned (a key row there is caught).++ const readme = ["## Quick start", "| A Higgsfield key | `HIGGSFIELD_API_KEY` |", "### Upgrading from an earlier version", "- Soul ID no longer trains on Higgsfield (PR #12).", "### Setting up", "Runs on Higgsfield"].join("\n");++ expect(scannedLines("README.md", readme)).toEqual(["## Quick start", "| A Higgsfield key | `HIGGSFIELD_API_KEY` |", "### Upgrading from an earlier version", "", "### Setting up", "Runs on Higgsfield"]);++ expect(fs.readFileSync(path.join(ROOT, "README.md"), "utf8").split("\n")).toContain(HISTORY_SECTIONS["README.md"]);+ // History and comparisons stay allowed.+ for (const ok of ["Higgsfield's pogo example names four things to remove", "the way Higgsfield names layer files", "a 1:1 alternative to Higgsfield", "Higgsfield is never called", "Progress uses Higgsfield's 14 labels"])+ expect(RULES.some(([, re]) => re.test(ok)), ok).toBe(false);+ });++ it("names no retired model or training id in code: stored ones resolve through replaced.ts", () => {+ const hits: string[] = [];+ for (const f of files.filter((x) => /^(src|bin)\//.test(x) && !RETIRED_ID_ALLOWED.has(x))) {+ fs.readFileSync(path.join(ROOT, f), "utf8")+ .split("\n")+ .forEach((line, i) => RETIRED_IDS.test(line) && hits.push(`${f}:${i + 1}: ${line.trim().slice(0, 140)}`));+ }+ expect(hits).toEqual([]);+ expect(RETIRED_IDS.test('if (draft.modelId !== "soul-2") return null;')).toBe(true);+ });++ it("has no file named after it", () => {+ expect(files.filter((f) => /higgsfield/i.test(path.basename(f)))).toEqual([]);+ });++ it("keeps the allowed history short and real", () => {+ for (const f of Object.keys(ALLOWED)) expect(fs.readFileSync(path.join(ROOT, f), "utf8"), f).toMatch(/higgsfield/i);+ });+});++// ---------------------------------------------------------------------------+// The catalog, the providers and the settings++describe("the catalog and the providers run without it", () => {+ const KNOWN = new Set(["fal", "replicate", "comfyui", "mock", "local", "llm", "openai", "google"]);++ it("routes every model to a provider Fuobe has", () => {+ const odd = MODELS.flatMap((m) => m.routes.filter((r) => !KNOWN.has(r.provider) || /higgsfield/i.test(r.endpoint)).map((r) => `${m.id}: ${r.provider} ${r.endpoint}`));+ expect(odd).toEqual([]);+ expect(Object.keys(PROVIDERS).sort()).toEqual([...KNOWN].sort());+ });++ it("has no setting, connection test or env var for it", () => {+ const named = Object.entries(SETTINGS).filter(([name, def]) => /higgsfield|^hf/i.test(`${name} ${def.key} ${"env" in def ? def.env : ""}`));+ expect(named).toEqual([]);+ expect(Object.keys(PROVIDER_SETTINGS)).not.toContain("higgsfield");+ expect(SETTINGS.cloudProvider.options).toEqual(["auto", "fal", "replicate"]);+ });++ it("fails a job stored under a provider Fuobe no longer has, with a way forward, instead of throwing", async () => {+ const gone = provider("higgsfield" as never);+ expect(gone.isConfigured()).toBe(false);+ const ctx = { externalId: "x", meta: {}, route: { op: "t2i" as const, provider: "fal" as const, endpoint: "x" }, model: getModel("nano-banana-pro")!, createdAt: 0 };+ await expect(gone.poll(ctx)).resolves.toEqual({ state: "failed", error: RETIRED_PROVIDER_ERROR });+ await expect(gone.cancel!(ctx)).resolves.toBeUndefined();+ expect(RETIRED_PROVIDER_ERROR).toMatch(/run it again/);+ });++ it("closes the partner gaps on fal: Happy Horse 1.1 runs there", () => {+ const hh = getModel("happy-horse-1-1")!;+ expect(hh.routes.map((r) => [r.op, r.provider, r.endpoint])).toEqual([+ ["t2v", "fal", "alibaba/happy-horse/v1.1/text-to-video"],+ ["i2v", "fal", "alibaba/happy-horse/v1.1/image-to-video"],+ ["ref2v", "fal", "alibaba/happy-horse/v1.1/reference-to-video"],+ ]);+ expect(hh.pricing).toMatchObject({ unit: "second", usd: 0.14, byResolution: { "720p": 0.14, "1080p": 0.18 } });+ });+});++// ---------------------------------------------------------------------------+// What replaced each retired item++describe("REPLACED_BY", () => {+ /** Every model the deleted catalog had, and the AI Influencer sheet defined beside it. */+ const RETIRED = [+ "soul-1",+ "soul-2",+ "soul-cinema",+ "cinema-studio-4",+ "genjutsu-motion-transfer",+ "genjutsu-lite-motion-transfer",+ "genjutsu-object-swap",+ "genjutsu-lite-object-swap",+ "genjutsu-restyle",+ "marketing-studio-image",+ "ads-studio",+ "ai-influencer",+ ];++ it("covers every retired model, none of which is in the catalog any more", () => {+ expect(Object.keys(REPLACED_BY).sort()).toEqual([...RETIRED].sort());+ for (const id of RETIRED) expect(getModel(id), id).toBeUndefined();+ });++ it("points each at a model that exists and isn't retired; an Original runs on both engines", () => {+ for (const [id, r] of Object.entries(REPLACED_BY)) {+ const m = getModel(r.id);+ expect(m, `${id} → ${r.id}`).toBeDefined();+ expect(replacedBy(r.id), r.id).toBeUndefined();+ if (r.original) expect(enginesOf(m!).sort(), r.id).toEqual(["cloud", "open"]);+ else expect(enginesOf(m!), r.id).toContain("cloud");+ expect(r.note.length, id).toBeGreaterThan(10);+ }+ expect(currentModelId("soul-2")).toBe("fuobe-soul");+ expect(currentModelId("nano-banana-pro")).toBe("nano-banana-pro");+ });++ it("points the old Soul ID targets at a trainer Fuobe has", () => {+ for (const [id, r] of Object.entries(TRAINING_REPLACED_BY)) {+ expect(TRAINING_TARGETS.some((t) => t.id === id), id).toBe(false);+ expect(TRAINING_TARGETS.some((t) => t.id === r.id), r.id).toBe(true);+ }+ });++ it("moves a stored request to its replacement: a Soul style becomes its look, the retired API's settings go", () => {+ const style = Object.entries(SOUL_LEGACY_IDS).find(([, look]) => look === "v2-general")![0];+ const old = { feature: "image", modelId: "soul-2", prompt: "a rooftop party", params: { aspectRatio: "3:4", extra: { style_id: style, custom_reference_id: "ref-1", custom_reference_strength: 0.8, seed: 7 } } };+ const { request, note } = migrateRequest(old);+ // No engine: the install runs the Original where its engine mode (else the first engine connected) says.+ expect(request).toEqual({ feature: "image", modelId: "fuobe-soul", presetId: "v2-general", prompt: "a rooftop party", params: { aspectRatio: "3:4", extra: { seed: 7 } } });+ expect(note).toMatch(/Fuobe Soul/);+ // An engine asked for stays.+ expect(migrateRequest({ ...old, engine: "open" as const }).request.engine).toBe("open");+ expect(migrateRequest({ modelId: "marketing-studio-image", params: { extra: { template_id: "t" } } }).request).toEqual({ modelId: "gpt-image-2-5", params: {} });+ // A current model's request comes back as it was.+ const current = { modelId: "nano-banana-pro", params: { extra: { style_id: "x" } } };+ expect(migrateRequest(current)).toEqual({ request: current });+ });+});++describe("operations the replacements do elsewhere", () => {+ /** What each retired model did (the deleted catalog's routes), and the partner ops only the retired provider ran. */+ const RETIRED_OPS: Record<string, string[]> = {+ "soul-1": ["t2i"],+ "soul-2": ["t2i", "edit"],+ "soul-cinema": ["t2i"],+ "cinema-studio-4": ["t2v", "ref2v"],+ "genjutsu-motion-transfer": ["motion-transfer"],+ "genjutsu-lite-motion-transfer": ["motion-transfer"],+ "genjutsu-object-swap": ["v2v", "video-swap"],+ "genjutsu-lite-object-swap": ["video-swap"],+ "genjutsu-restyle": ["v2v"],+ "marketing-studio-image": ["t2i", "edit"],+ "ads-studio": ["t2i", "edit"],+ "ai-influencer": ["t2i", "edit"],+ "seedance-2-5": ["v2v"],+ "ltx-2-5": ["flf2v"],+ };++ it("sends every operation a retired model (or a partner's retired route) ran to a model that does it", () => {+ for (const [id, ops] of Object.entries(RETIRED_OPS)) {+ for (const op of ops) {+ const to = replacementOf(id, op as never);+ const target = to?.id ?? id;+ const m = getModel(target);+ expect(m, `${id} ${op} → ${target}`).toBeDefined();+ expect(routesFor(m!, (to?.op ?? op) as never).length, `${id} ${op} → ${target} ${to?.op ?? op}`).toBeGreaterThan(0);+ }+ }+ expect(Object.keys(OPS_REPLACED_BY).sort()).toEqual(["ltx-2-5", "seedance-2-5"]);+ });++ it("moves a stored request's operation with it, and reads Cinema Studio's references as references", () => {+ expect(migrateRequest({ modelId: "genjutsu-object-swap", op: "v2v" as const }).request).toMatchObject({ modelId: "fuobe-genjutsu-swap", op: "video-swap" });+ expect(migrateRequest({ modelId: "seedance-2-5", op: "v2v" as const }).request).toEqual({ modelId: "kling-o3", op: "v2v" });+ expect(migrateRequest({ modelId: "ltx-2-5", op: "flf2v" as const }).request).toEqual({ modelId: "fuobe-cinema", op: "flf2v" });+ // A partner model's own operations are untouched.+ const seedance = { modelId: "seedance-2-5", op: "t2v" as const };+ expect(migrateRequest(seedance).request).toBe(seedance);+ // Cinema Studio had no start-frame route: its images were references, which Fuobe Cinema doesn't take yet.+ const refs = migrateRequest({ modelId: "cinema-studio-4", prompt: "x", inputs: { images: ["/api/files/a.png"] } });+ expect(refs.request).toMatchObject({ modelId: "seedance-2-5", op: "ref2v" });+ expect(refs.note).toMatch(/Seedance 2\.5/);+ expect(migrateRequest({ modelId: "cinema-studio-4", prompt: "x" }).request).toEqual({ modelId: "fuobe-cinema", prompt: "x" });+ });++ it("writes Cinema Studio's Director fields into the prompt on the server, and drops them in the browser", () => {+ const extra = { genre: "noir", era: "1980s", camera_model: "35mm-film", camera_lens: "anamorphic", camera_aperture: "f14-wide-open", light: "silhouette", pacing: "calm", camera_movement: "dolly-in", color_palette: "neon-rain-at-midnight", seed: 3 };+ expect(Object.keys(extra).filter((k) => k !== "seed").sort()).toEqual([...DIRECTOR_FIELDS].sort());+ const old = { modelId: "cinema-studio-4", prompt: "A chase through the market.", params: { duration: 8, extra } };+ const server = currentRequest(old as never).request;+ expect(server.modelId).toBe("fuobe-cinema");+ expect(server.params).toEqual({ duration: 8, extra: { seed: 3 } });+ expect(server.prompt).toMatch(/^A chase through the market\. /);+ for (const words of [/noir/i, /1980s/i, /35mm/i, /anamorphic/i, /silhouette/i, /calm/i, /dolly/i, /neon/i]) expect(server.prompt).toMatch(words);+ expect(directorFieldWords({ genre: "not-a-genre" })).toBe("");+ // The browser has no Director words to write: the fields go, the prompt stays the user's.+ expect(migrateRequest(old).request).toEqual({ modelId: "fuobe-cinema", prompt: "A chase through the market.", params: { duration: 8, extra: { seed: 3 } } });+ // And the cloud half's payload carries none of them.+ const p = previewGeneration({ feature: "video", ...old } as never);+ expect(p.model.id).toBe("fuobe-cinema");+ expect(p.prompt).toMatch(/noir/i);+ });+});++describe("stored ids resolve where they are read", () => {+ it("runs a retired Original's request on the install's engine: open source only takes it to the GPU", async () => {+ const preview = async (modelId: string) =>+ (await (+ await generationsRoute.POST(+ new Request("http://x/api/generations?preview=1", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ feature: "image", modelId, prompt: "a fox" }) }),+ )+ ).json()) as { modelId: string; engine: string; notes?: string[]; error?: string };+ setSetting("engineMode", "open");+ try {+ const old = await preview("soul-2");+ expect(old.error).toBeUndefined();+ expect(old).toMatchObject({ modelId: "fuobe-soul", engine: "open" });+ expect(old.notes?.[0]).toMatch(/Fuobe Soul/);+ } finally {+ setSetting("engineMode", "cloud");+ }+ try {+ expect(await preview("soul-2")).toMatchObject({ modelId: "fuobe-soul", engine: "cloud" });+ } finally {+ setSetting("engineMode", "both");+ }+ // Both on: the same engine the Original itself gets.+ const [old, now] = [await preview("soul-2"), await preview("fuobe-soul")];+ expect(old.engine).toBe(now.engine);+ });++ it("runs a generation asked for on a retired model on its replacement, and says so (Reuse, CLI, MCP)", async () => {+ const res = await generationsRoute.POST(+ new Request("http://x/api/generations?preview=1", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ feature: "image", modelId: "soul-2", prompt: "a fox" }) }),+ );+ const body = (await res.json()) as { modelId: string; engine: string; notes?: string[]; error?: string };+ expect(body.error).toBeUndefined();+ expect(body).toMatchObject({ modelId: "fuobe-soul" });+ expect(body.notes?.[0]).toMatch(/Fuobe Soul/);+ // Made, the run is stored on its replacement and its notes say so.+ const made = await generationsRoute.POST(+ new Request("http://x/api/generations", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ feature: "image", modelId: "cinema-studio-4", prompt: "a fox", params: { extra: { genre: "noir" } } }) }),+ );+ const created = (await made.json()) as { items: { id: string; modelId: string; request: { modelId: string; prompt: string } }[]; notes?: string[] };+ expect(created.items[0]).toMatchObject({ modelId: "fuobe-cinema", request: { modelId: "fuobe-cinema" } });+ expect(created.items[0].request.prompt).toMatch(/noir/i);+ expect(created.notes?.[0]).toMatch(/Fuobe Cinema/);+ });++ it("retries a Character Sheet or AI Influencer photo made on a retired model, on its replacement", () => {+ const sheet = storedRow({+ feature: "character-sheet",+ model: "soul-2",+ provider: "higgsfield",+ op: "t2i",+ status: "failed",+ request: { feature: "character-sheet", modelId: "soul-2", op: "t2i", prompt: "a sheet", params: { aspectRatio: "16:9", extra: { style_id: "x" } } },+ });+ const [again] = retryPhoto(sheet);+ expect(again).toMatchObject({ modelId: "fuobe-soul", feature: "character-sheet", request: { modelId: "fuobe-soul" } });+ const app = storedRow({ feature: "app:app-ai-influencer", model: "ai-influencer", provider: "higgsfield", op: "t2i", status: "canceled", request: { feature: "app:app-ai-influencer", modelId: "ai-influencer", op: "t2i", prompt: "a character" } });+ expect(retryPhoto(app)[0]).toMatchObject({ modelId: "nano-banana-pro" });+ });++ it("fails a job still running on a retired model with the way forward, not 'no longer exists'", async () => {+ const running = { feature: "image", op: "t2i", status: "running", externalId: "job-1", request: { feature: "image", modelId: "x", prompt: "an old run" } };+ const soul = storedRow({ ...running, model: "soul-2", provider: "higgsfield" });+ const partner = storedRow({ ...running, model: "nano-banana-pro", provider: "higgsfield" });+ const gone = storedRow({ ...running, model: "old-model", provider: "fal" });+ await runUntil(() => [soul, partner, gone].every((id) => getGeneration(id)?.status === "failed"));+ expect(getGeneration(soul)).toMatchObject({ status: "failed", error: RETIRED_PROVIDER_ERROR });+ expect(getGeneration(partner)).toMatchObject({ status: "failed", error: RETIRED_PROVIDER_ERROR });+ expect(getGeneration(gone)).toMatchObject({ status: "failed", error: "Model old-model no longer exists" });+ });++ it("starts a step that was waiting on a retired model on its replacement", async () => {+ const still = saveFile({ data: Buffer.concat([Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]), Buffer.alloc(2_000, 7)]), contentType: "image/png", name: "still.png", source: "upload" }).url;+ const first = storedRow({ feature: "image", model: "nano-banana-pro", provider: "mock", op: "t2i", status: "succeeded", externalId: "done", outputs: [{ url: still, kind: "image" }], request: { feature: "image", modelId: "nano-banana-pro", prompt: "a still" } });+ const step = storedRow({ feature: "image", model: "soul-2", provider: "higgsfield", op: "edit", status: "queued", dependsOn: first, request: { feature: "image", modelId: "soul-2", op: "edit", prompt: "restyle it", chainFrom: "first" } });+ await runUntil(() => getGeneration(step)?.status !== "queued");+ const g = getGeneration(step)!;+ expect(g.error ?? null).toBeNull();+ expect(g).toMatchObject({ modelId: "fuobe-soul", request: { modelId: "fuobe-soul" } });+ });++ it("casts a Soul Cast sheet in the cloud only when Fuobe Soul's cloud half is on", () => {+ expect(castSheetModel("cloud", planCaps())).toBe("fuobe-soul");+ expect(castSheetModel("cloud", { has: (id, engine) => !(id === "fuobe-soul" && engine === "cloud") })).toBe("nano-banana-pro");+ expect(castSheetModel("open", { has: (id, engine) => !(id === "fuobe-soul" && engine === "cloud") })).toBe("oss-zimage-soul-cast");+ });+++ it("keeps a past run on a retired model in the Library, named as it ran, with its outputs", async () => {+ const res = await generationsRoute.POST(+ new Request("http://x/api/generations", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ feature: "image", modelId: "fuobe-soul", prompt: "an old portrait" }) }),+ );+ const { items } = (await res.json()) as { items: { id: string }[] };+ const id = items[0].id;+ // As a row stored before the switch reads: the retired model and provider, a finished output.+ db()+ .prepare("UPDATE generations SET model_id = 'soul-2', provider = 'higgsfield', status = 'succeeded', outputs_json = ? WHERE id = ?")+ .run(JSON.stringify([{ url: "/api/files/old.png", kind: "image" }]), id);+ const g = getGeneration(id)!;+ expect(g).toMatchObject({ modelId: "soul-2", modelName: REPLACED_BY["soul-2"].was, status: "succeeded" });+ expect(g.outputs).toHaveLength(1);+ expect(listGenerations({ feature: "image" }).map((x) => x.id)).toContain(id);+ });++ it("moves a saved Canvas node on a retired model to its replacement, in the cloud", () => {+ const graph = {+ nodes: [+ { id: "a", type: "model" as const, position: { x: 0, y: 0 }, data: { modelId: "cinema-studio-4", mediaKind: "video" as const, params: { aspectRatio: "16:9", extra: { color_palette: "static-noon" } } } },+ { id: "b", type: "model" as const, position: { x: 0, y: 0 }, data: { modelId: "nano-banana-pro", mediaKind: "image" as const } },+ ],+ edges: [],+ };+ const moved = withCurrentModels(graph);+ expect(moved.nodes[0].data).toMatchObject({ modelId: "fuobe-cinema", engine: "cloud", params: { aspectRatio: "16:9" } });+ expect(moved.nodes[0].data.params?.extra).toBeUndefined();+ expect(moved.nodes[1]).toBe(graph.nodes[1]);+ // A board with nothing retired comes back as it was.+ expect(withCurrentModels(moved)).toBe(moved);+ });++ it("moves a saved Canvas node's operation too: Cinema Studio's connected images were references", () => {+ const node = (id: string, modelId: string, op?: "v2v") => ({ id, type: "model" as const, position: { x: 0, y: 0 }, data: { modelId, mediaKind: "video" as const, ...(op && { op }) } });+ const image = { id: "img", type: "image" as const, position: { x: 0, y: 0 }, data: { url: "/api/files/a.png" } };+ const graph = {+ nodes: [node("refs", "cinema-studio-4"), node("plain", "cinema-studio-4"), node("swap", "genjutsu-object-swap", "v2v"), node("edit", "seedance-2-5", "v2v"), node("own", "seedance-2-5"), image],+ edges: [{ id: "e1", source: "img", target: "refs", targetHandle: "images" }],+ } as Parameters<typeof withCurrentModels>[0];+ const by = Object.fromEntries(withCurrentModels(graph).nodes.map((n) => [n.id, n.data]));+ expect(by.refs).toMatchObject({ modelId: "seedance-2-5", op: "ref2v" });+ expect(by.plain).toMatchObject({ modelId: "fuobe-cinema" });+ expect(by.plain.op).toBeUndefined();+ expect(by.swap).toMatchObject({ modelId: "fuobe-genjutsu-swap", op: "video-swap" });+ expect(by.edit).toMatchObject({ modelId: "kling-o3", op: "v2v" });+ expect(by.own).toEqual(graph.nodes[4].data);+ });++ it("plans an Assist or MCP job on a retired model or operation where it runs now", () => {+ const video = "/api/files/ad.mp4";+ const plan = assistTools.planFor(+ "generate",+ {+ summary: "Old saved calls",+ jobs: [+ { model_id: "soul-2", prompt: "a fox" },+ { model_id: "seedance-2-5", op: "v2v", prompt: "Make it snow", video },+ { model_id: "genjutsu-object-swap", op: "v2v", prompt: "Swap the mug", video, images: ["/api/files/mug.png"] },+ ],+ },+ { engine: "cloud" },+ );+ expect(plan.jobs.map((j) => [j.modelId, j.op, j.error])).toEqual([+ ["fuobe-soul", "t2i", undefined],+ ["kling-o3", "v2v", undefined],+ ["fuobe-genjutsu-swap", "video-swap", undefined],+ ]);+ });+});++// ---------------------------------------------------------------------------+// The one migration++describe("the O7 migration", () => {+ it("deletes the retired key, resets the provider choice and marks the ads drawn whole as baked", () => {+ const d = db();+ const last = (d.prepare("SELECT MAX(id) AS id FROM _migrations").get() as { id: number }).id;+ // An install from before: rows the migration rewrites, then the migration runs again on the next open.+ d.prepare("INSERT OR REPLACE INTO settings (key, value) VALUES ('higgsfield.key', 'id:secret'), ('cloud.provider', 'higgsfield')").run();+ d.prepare("INSERT INTO ad_batches (id, brand_id, engine, route, model_id, created_at) VALUES ('b1', 'br', 'cloud', 'higgsfield', 'ads-studio', 1), ('b2', 'br', 'cloud', 'fuobe', 'nano-banana-pro', 2)").run();+ d.prepare(+ `INSERT INTO ad_creatives (id, batch_id, brand_id, position, status, meta_json, created_at, updated_at) VALUES+ ('c1', 'b1', 'br', 0, 'queued', '{"engine":"cloud","modelId":"ads-studio","route":"higgsfield","ratio":"9:16"}', 1, 1),+ ('c2', 'b2', 'br', 0, 'queued', '{"engine":"cloud","modelId":"nano-banana-pro","route":"fuobe"}', 2, 2),+ ('c3', 'b2', 'br', 1, 'failed', 'not json', 3, 3)`,+ ).run();+ d.prepare("DELETE FROM _migrations WHERE id = ?").run(last);+ d.close();+ globalThis.__fuobeDb = undefined;++ const again = db();+ expect(again.prepare("SELECT value FROM settings WHERE key = 'higgsfield.key'").get()).toBeUndefined();+ expect(getSetting("cloudProvider")).toBe("auto");+ expect(again.prepare("SELECT route FROM ad_batches ORDER BY id").all()).toEqual([{ route: "baked" }, { route: "fuobe" }]);+ const meta = (id: string) => (again.prepare("SELECT meta_json FROM ad_creatives WHERE id = ?").get(id) as { meta_json: string }).meta_json;+ expect(JSON.parse(meta("c1"))).toEqual({ engine: "cloud", modelId: "ads-studio", route: "baked", ratio: "9:16" });+ expect(JSON.parse(meta("c2")).route).toBe("fuobe");+ expect(meta("c3")).toBe("not json");+ });+});