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
Originals O2: eval suites for Soul Cinema and Soul HEX, and the Original runs on the engine named
Claude5d20ae1b13b8
diff --git a/scripts/eval/README.md b/scripts/eval/README.mdindex 48a62530..79e0016d 100644--- a/scripts/eval/README.md+++ b/scripts/eval/README.md@@ -115,6 +115,8 @@ One JSON file per Original in `cases/`. Later Original packages add their own fi| --- | --- | --- | --- | --- || `selftest` | the harness itself | 5 small tools (trim, palette lock, join, frame, image) | — | temporal, clip || `soul` | Fuobe Soul, the 139 looks | 139 looks × 3 subjects, pinned seeds | `recipe`, `prompt-only`, `half-strength`, `plain`, `original` | clip, aesthetic, style |+| `soul-cinema` | Soul Cinema's one film look | 6 scenes, pinned seeds | `recipe`, `prompt-only`, `plain`, `original` | clip, aesthetic, style |+| `soul-hex` | Soul HEX palettes | 3 Fuobe palettes × 2 subjects | `words`, `lock` (open), `base`, `palette-model` (open), `plain` | palette, clip, aesthetic || `soul-id` | character training | your photos → train → 8 scenes | `trained`, `original` | identity, clip, aesthetic || `dop` | DoP motions and effects | the 70 the research gives a LoRA | `catalog`, `prompt-only`, `research` (the candidate), `partner` (cloud) | temporal, clip || `genjutsu` | Genjutsu move / swap / restyle | 3 (through `/api/genjutsu`) | `original`, `partner` (cloud: each mode's own partner on fal) | temporal, clip |@@ -123,9 +125,10 @@ One JSON file per Original in `cases/`. Later Original packages add their own fi| `speak` | talking portraits | 1 portrait + voice | `infinitetalk`, `s2v` | lipsync, temporal, identity || `cinema` | Cinema shot lists | 2 films of 3 shots | `original`, `partner` | clip, temporal, continuity |-`soul.json` and `dop.json` are **generated** from the research. They come from+`soul.json`, `soul-cinema.json`, `soul-hex.json` and `dop.json` are **generated** from the research. They come from`docs/research/higgsfield-image-studios.json` (the look ids) and-`docs/research/fuobe-originals-recipes-5.json` (recipes, LoRAs, the motion map). Run+`docs/research/fuobe-originals-recipes-5.json` (recipes, LoRAs, Soul Cinema's recipe, the motion map).+`soul-hex`'s palettes are Fuobe's own. Run`node scripts/eval/gen-cases.mjs` after the research changes, and don't edit the generated files byhand. `pnpm eval:validate` fails when they are out of date. The subject prompts are Fuobe's own. NoHiggsfield prompt or preview is used anywhere.@@ -136,9 +139,19 @@ Soul variants, all on the same subjects and seeds:- **prompt-only**: the same words without LoRAs. Does each LoRA earn its slot?- **half-strength**: every LoRA at half strength. This is the over-cooking check.- **plain**: the base model with the subject alone.-- **original**: the shipped `fuobe-soul` Original, which applies the look on the server. The look+- **original**: the shipped `fuobe-soul` Original (O2), which applies the look on the server. The lookgoes as its Fuobe id in `presetId` (`v1-general`, the slug `--looks` takes); a Higgsfield look id never- leaves the harness. O2's look ids should match these slugs. It is skipped until that Original exists.+ leaves the harness. A lettering look (Graffiti) runs on `fuobe-soul-hd`. Every request names the engine+ the run is on (`engine`), so an Original that runs on both takes that one. Its grade and overlay are+ applied in the browser after generation, so the scores are of the raw picture.++Soul Cinema's variants are the same idea for its one look: **recipe** (the research's LoRAs with their+triggers, then the `cine` tail), **prompt-only** (the tail alone), **plain** and **original**+(`fuobe-soul-cinema`). Soul HEX's: **words** (the palette sentence the Color signature adds, on Fuobe+Soul: the cloud's HEX), **lock** (the same, then `POST /api/palettes/lock`: the open engine's HEX),+**base** (the words on today's base), **palette-model** (Z-Image Turbo · Palette) and **plain** (no+palette words, the control). A variant can carry fixed `words` after the prompt and its own `submit`+route; `{{request}}` in a route body is the job's own request.DoP variants, on your start frame with two seeds:@@ -313,6 +326,7 @@ still has its timing and cost, and the report says why the scores are missing.| Lip-sync | `lipsync`, `lipsyncOffset` | higher | a proxy: mouth-region motion against the voice's loudness, with the best lag as the A/V offset | the identity metric's face detector for the face box when identity is installed, else a fixed lower-centre region || SyncNet (optional) | `syncnet` | higher | runs only when `FUOBE_EVAL_SYNCNET_CMD` points at your own SyncNet. It isn't bundled because its weights' licence isn't stated | yours || Shot continuity | `continuity` | higher | CLIP similarity between consecutive shots of a film | CLIP |+| Palette | `paletteFit`, `paletteCover` | lower, higher | the mean ΔE (CIE76, Lab) from each pixel to the nearest colour of the palette the request sent (`params.palette`, or the palette lock's colours), and the share of the palette's colours that are nearest for at least 3% of the pixels | none (numpy) || Time, cost, memory | `seconds`, `costUsd`, `vramGb` | lower | from the runner | — |Identity needs `pnpm eval:setup --identity`, which installs insightface and onnxruntime (MITdiff --git a/scripts/eval/cases/case.schema.json b/scripts/eval/cases/case.schema.jsonindex 70422af7..f3727568 100644--- a/scripts/eval/cases/case.schema.json+++ b/scripts/eval/cases/case.schema.json@@ -530,7 +530,8 @@"identity","temporal","lipsync",- "continuity"+ "continuity",+ "palette"]}},@@ -565,6 +566,10 @@"template": {"type": "boolean"},+ "words": {+ "type": "string",+ "maxLength": 2000+ },"loras": {"anyOf": [{@@ -615,6 +620,25 @@},"licence": {"type": "string"+ },+ "name": {+ "type": "string",+ "maxLength": 200+ },+ "base": {+ "type": "string",+ "maxLength": 60+ },+ "download": {+ "type": "string",+ "enum": [+ "direct",+ "civitai-token"+ ]+ },+ "hostedUrl": {+ "type": "string",+ "pattern": "^https:\\/\\/"}},"required": [@@ -767,6 +791,48 @@"type": "string"},"additionalProperties": {}+ },+ "submit": {+ "type": "object",+ "properties": {+ "route": {+ "type": "string",+ "pattern": "^\\/api\\/[\\w/-]+$"+ },+ "body": {+ "type": "object",+ "propertyNames": {+ "type": "string"+ },+ "additionalProperties": {}+ },+ "result": {+ "default": "final",+ "type": "string",+ "enum": [+ "final",+ "last",+ "all"+ ]+ },+ "estimate": {+ "anyOf": [+ {+ "type": "string",+ "pattern": "^\\/api\\/[\\w/-]+$"+ },+ {+ "type": "boolean",+ "const": false+ }+ ]+ }+ },+ "required": [+ "route",+ "body"+ ],+ "additionalProperties": false}},"additionalProperties": false@@ -797,6 +863,10 @@"presetId": {"type": "string"},+ "words": {+ "type": "string",+ "maxLength": 2000+ },"models": {"type": "object","properties": {@@ -1182,7 +1252,8 @@"identity","temporal","lipsync",- "continuity"+ "continuity",+ "palette"]}},diff --git a/scripts/eval/cases/soul-cinema.json b/scripts/eval/cases/soul-cinema.jsonnew file mode 100644index 00000000..705d325b--- /dev/null+++ b/scripts/eval/cases/soul-cinema.json@@ -0,0 +1,197 @@+{+ "$schema": "./case.schema.json",+ "suite": "soul-cinema",+ "title": "Fuobe Soul Cinema · one film look",+ "description": "Generated by scripts/eval/gen-cases.mjs from the research files; edit the generator, not this file. Soul Cinema has one fixed look (research soul.soulCinema): artificialguybr Cinematic Film Still Redmond at 0.7 + Movie Wide Angle Z-image at 0.5, the \"cine\" tail, a teal-orange or 16mm grade after generation (in the browser, so the Original's scores are of the raw picture) and 16:9 by default. The recipe on today's base against its words alone, the bare prompt, and the shipped Original (fuobe-soul-cinema). A civitai LoRA without a mirrored copy is left out on the cloud (the runner says so). Style references (your own or licensed film stills) go in local/references/soul-cinema/.",+ "original": "fuobe-soul-cinema",+ "kind": "image",+ "targets": {+ "open": {+ "models": [+ "oss-z-image-turbo"+ ],+ "extra": {+ "steps": 8,+ "shift": 3+ }+ },+ "cloud": {+ "models": [+ "z-image-turbo-cloud"+ ],+ "extra": {+ "num_inference_steps": 8,+ "enable_prompt_expansion": false,+ "output_format": "png"+ }+ },+ "demo": {+ "models": [+ "oss-z-image-turbo"+ ]+ }+ },+ "defaults": {+ "seeds": [+ 1001+ ],+ "params": {+ "aspectRatio": "16:9"+ },+ "metrics": [+ "clip",+ "aesthetic",+ "style"+ ],+ "variant": "recipe",+ "timeoutSeconds": 900+ },+ "variants": {+ "recipe": {+ "description": "Soul Cinema's research recipe on today's base: its LoRAs with their triggers, then the cine tail",+ "loras": [+ {+ "name": "artificialguybr Cinematic Film Still Redmond",+ "file": "[ZImage.Turbo]FilmStill_Redmond.safetensors",+ "url": "https://huggingface.co/artificialguybr/CINEMATIC-FILMSTILL-REDMOND-ZIMAGE/resolve/main/%5BZImage.Turbo%5DFilmStill_Redmond.safetensors",+ "strength": 0.7,+ "trigger": "CINEMATIC, FILM STILL",+ "base": "z-image-turbo",+ "licence": "Apache-2.0",+ "commercial": true,+ "hostedOk": true,+ "download": "direct"+ },+ {+ "name": "Movie Wide Angle Z-image",+ "file": "civitai-2462010-moviewide.safetensors",+ "url": "https://civitai.com/api/download/models/2462010",+ "strength": 0.5,+ "base": "z-image-turbo",+ "licence": "civitai permissions: Image, RentCivit, Rent, Sell, SellMerge",+ "commercial": true,+ "hostedOk": true,+ "download": "civitai-token"+ }+ ],+ "words": "Cinematic film still, motivated lighting, natural skin texture, fine film grain, shallow depth of field."+ },+ "prompt-only": {+ "description": "The cine tail without the LoRAs: do they earn their slots?",+ "loras": "none",+ "words": "Cinematic film still, motivated lighting, natural skin texture, fine film grain, shallow depth of field."+ },+ "plain": {+ "description": "The base model with the scene alone",+ "template": false,+ "loras": "none"+ },+ "original": {+ "description": "The shipped Original (fuobe-soul-cinema): the server adds its LoRAs, tail and grade",+ "models": {+ "open": [+ "fuobe-soul-cinema"+ ],+ "cloud": [+ "fuobe-soul-cinema"+ ],+ "demo": [+ "fuobe-soul-cinema"+ ]+ },+ "loras": "none"+ }+ },+ "cases": [+ {+ "id": "soul-cinema/diner",+ "title": "Soul Cinema · diner",+ "prompts": [+ {+ "id": "diner",+ "seed": 4101,+ "text": "a waitress refills a coffee cup for a tired trucker in an empty roadside diner at night"+ }+ ],+ "references": "local/references/soul-cinema",+ "tags": [+ "cinema"+ ]+ },+ {+ "id": "soul-cinema/platform",+ "title": "Soul Cinema · platform",+ "prompts": [+ {+ "id": "platform",+ "seed": 4102,+ "text": "a woman in a trench coat waits alone on a rain-soaked train platform, wide shot"+ }+ ],+ "references": "local/references/soul-cinema",+ "tags": [+ "cinema"+ ]+ },+ {+ "id": "soul-cinema/rooftop",+ "title": "Soul Cinema · rooftop",+ "prompts": [+ {+ "id": "rooftop",+ "seed": 4103,+ "text": "two detectives argue on a rooftop above a city at blue hour"+ }+ ],+ "references": "local/references/soul-cinema",+ "tags": [+ "cinema"+ ]+ },+ {+ "id": "soul-cinema/desert",+ "title": "Soul Cinema · desert",+ "prompts": [+ {+ "id": "desert",+ "seed": 4104,+ "text": "a lone rider crosses a desert ridge at sunset, long shadow, wide landscape"+ }+ ],+ "references": "local/references/soul-cinema",+ "tags": [+ "cinema"+ ]+ },+ {+ "id": "soul-cinema/kitchen",+ "title": "Soul Cinema · kitchen",+ "prompts": [+ {+ "id": "kitchen",+ "seed": 4105,+ "text": "a family eats breakfast in a sunlit farmhouse kitchen, the youngest spills milk"+ }+ ],+ "references": "local/references/soul-cinema",+ "tags": [+ "cinema"+ ]+ },+ {+ "id": "soul-cinema/corridor",+ "title": "Soul Cinema · corridor",+ "prompts": [+ {+ "id": "corridor",+ "seed": 4106,+ "text": "a nurse walks down a hospital corridor at 3am under flickering lights"+ }+ ],+ "references": "local/references/soul-cinema",+ "tags": [+ "cinema"+ ]+ }+ ]+}diff --git a/scripts/eval/cases/soul-hex.json b/scripts/eval/cases/soul-hex.jsonnew file mode 100644index 00000000..fc8ec351--- /dev/null+++ b/scripts/eval/cases/soul-hex.json@@ -0,0 +1,211 @@+{+ "$schema": "./case.schema.json",+ "suite": "soul-hex",+ "title": "Fuobe Soul HEX · palettes",+ "description": "Generated by scripts/eval/gen-cases.mjs from the research files; edit the generator, not this file. A palette on Fuobe Soul, as the composer's Color signature sends it: the colours in the prompt on both engines, and on the open engine the palette lock after it (oss-palette-image, POST /api/palettes/lock: on by default for Fuobe Soul). Against the same words on today's base, Z-Image Turbo · Palette (the open engine's palette model before the Originals) and Fuobe Soul without the palette. The palette metric scores how closely each picture keeps to the colours (mean ΔE to the nearest one, and how many of them it uses). The palettes are Fuobe's own.",+ "original": "fuobe-soul",+ "kind": "image",+ "targets": {+ "open": {+ "models": [+ "oss-z-image-turbo"+ ],+ "extra": {+ "steps": 8,+ "shift": 3+ }+ },+ "cloud": {+ "models": [+ "z-image-turbo-cloud"+ ],+ "extra": {+ "num_inference_steps": 8,+ "enable_prompt_expansion": false,+ "output_format": "png"+ }+ },+ "demo": {+ "models": [+ "oss-z-image-turbo"+ ]+ }+ },+ "defaults": {+ "seeds": [+ 1001+ ],+ "params": {+ "aspectRatio": "3:4"+ },+ "metrics": [+ "palette",+ "clip",+ "aesthetic"+ ],+ "variant": "words",+ "timeoutSeconds": 900+ },+ "variants": {+ "words": {+ "description": "Fuobe Soul (its General look) with the palette in the prompt: the cloud's Soul HEX",+ "models": {+ "open": [+ "fuobe-soul"+ ],+ "cloud": [+ "fuobe-soul"+ ],+ "demo": [+ "fuobe-soul"+ ]+ }+ },+ "lock": {+ "description": "Fuobe Soul with the palette in the prompt, then the palette lock (strength 0.8): the open engine's Soul HEX",+ "models": {+ "open": [+ "fuobe-soul"+ ],+ "demo": [+ "fuobe-soul"+ ]+ },+ "engines": [+ "demo",+ "open"+ ],+ "submit": {+ "route": "/api/palettes/lock",+ "body": {+ "request": "{{request}}",+ "colors": "{{request.params.palette}}"+ },+ "estimate": false+ }+ },+ "base": {+ "description": "The palette in the prompt on today's base, no look"+ },+ "palette-model": {+ "description": "Z-Image Turbo · Palette: the provider writes the colours into the prompt and locks them in one graph (open engine)",+ "models": {+ "open": [+ "oss-zimage-palette"+ ],+ "demo": [+ "oss-zimage-palette"+ ]+ },+ "engines": [+ "demo",+ "open"+ ],+ "template": false+ },+ "plain": {+ "description": "Fuobe Soul without the palette's words (the control)",+ "models": {+ "open": [+ "fuobe-soul"+ ],+ "cloud": [+ "fuobe-soul"+ ],+ "demo": [+ "fuobe-soul"+ ]+ },+ "template": false+ }+ },+ "cases": [+ {+ "id": "soul-hex/teal-dusk",+ "title": "Soul HEX · Teal dusk",+ "words": "Color palette: use only these colors, in roughly this balance: #0B1D2A, #1F4E5F, #2A9D8F, #E9C46A, #F4A261.",+ "params": {+ "palette": [+ "#0B1D2A",+ "#1F4E5F",+ "#2A9D8F",+ "#E9C46A",+ "#F4A261"+ ]+ },+ "prompts": [+ {+ "id": "portrait",+ "seed": 5101,+ "text": "a woman in a knitted sweater sits by a window with a cup of tea, half-length portrait"+ },+ {+ "id": "still-life",+ "seed": 5102,+ "text": "a still life of fruit, a ceramic jug and a folded cloth on a wooden table"+ }+ ],+ "tags": [+ "hex"+ ]+ },+ {+ "id": "soul-hex/candy-pop",+ "title": "Soul HEX · Candy pop",+ "words": "Color palette: use only these colors, in roughly this balance: #118AB2, #06D6A0, #FF5DA2, #FFD166, #FDF6EC.",+ "params": {+ "palette": [+ "#118AB2",+ "#06D6A0",+ "#FF5DA2",+ "#FFD166",+ "#FDF6EC"+ ]+ },+ "prompts": [+ {+ "id": "portrait",+ "seed": 5101,+ "text": "a woman in a knitted sweater sits by a window with a cup of tea, half-length portrait"+ },+ {+ "id": "still-life",+ "seed": 5102,+ "text": "a still life of fruit, a ceramic jug and a folded cloth on a wooden table"+ }+ ],+ "tags": [+ "hex"+ ]+ },+ {+ "id": "soul-hex/green-editorial",+ "title": "Soul HEX · Green editorial",+ "words": "Color palette: use only these colors, in roughly this balance: #1B1B1B, #0F3D2E, #2E7D4F, #A7C957, #F2E8CF.",+ "params": {+ "palette": [+ "#1B1B1B",+ "#0F3D2E",+ "#2E7D4F",+ "#A7C957",+ "#F2E8CF"+ ]+ },+ "prompts": [+ {+ "id": "portrait",+ "seed": 5101,+ "text": "a woman in a knitted sweater sits by a window with a cup of tea, half-length portrait"+ },+ {+ "id": "still-life",+ "seed": 5102,+ "text": "a still life of fruit, a ceramic jug and a folded cloth on a wooden table"+ }+ ],+ "tags": [+ "hex"+ ]+ }+ ]+}diff --git a/scripts/eval/cases/soul.json b/scripts/eval/cases/soul.jsonindex dd30f635..d8490415 100644--- a/scripts/eval/cases/soul.json+++ b/scripts/eval/cases/soul.json@@ -2,7 +2,7 @@"$schema": "./case.schema.json","suite": "soul","title": "Fuobe Soul · the 139 looks",- "description": "Generated by scripts/eval/gen-cases.mjs from the research files; edit the generator, not this file. Each look on three subjects with pinned seeds: the research recipe (look template, triggers, LoRAs at their listed strengths) against the same words without LoRAs, half-strength LoRAs, the bare prompt, and the shipped Original once it exists. Style references (your own or licensed images, never Higgsfield previews) go in local/references/soul/<look>/.",+ "description": "Generated by scripts/eval/gen-cases.mjs from the research files; edit the generator, not this file. Each look on three subjects with pinned seeds: the research recipe (look template, triggers, LoRAs at their listed strengths) against the same words without LoRAs, half-strength LoRAs, the bare prompt, and the shipped Original (fuobe-soul; Soul HD for a lettering look). The Original's grade and overlay are applied in the browser after generation, so its scores are of the raw picture. Style references (your own or licensed images, never Higgsfield previews) go in local/references/soul/<look>/.","original": ["fuobe-soul","fuobe-soul-hd"@@ -68,7 +68,7 @@"loras": "none"},"original": {- "description": "The shipped Original on the server (O2's fuobe-soul): the look's Fuobe id (v1-general) goes in presetId and the server applies its own recipe",+ "description": "The shipped Original on the server (O2's fuobe-soul, on the engine the run names): the look's Fuobe id (v1-general) goes in presetId and the server applies its own recipe","models": {"open": ["fuobe-soul"@@ -1910,6 +1910,19 @@"fuobe-soul-hd"]},+ "variantModels": {+ "original": {+ "open": [+ "fuobe-soul-hd"+ ],+ "cloud": [+ "fuobe-soul-hd"+ ],+ "demo": [+ "fuobe-soul-hd"+ ]+ }+ },"extra": {"steps": 20},diff --git a/scripts/eval/eval.mjs b/scripts/eval/eval.mjsindex c1404300..eae512d9 100644--- a/scripts/eval/eval.mjs+++ b/scripts/eval/eval.mjs@@ -34,7 +34,7 @@ const SCORE = { "no-metrics": { type: "boolean" }, metrics: { type: "string" },const HELP = {run: `pnpm eval:run --suite <name> --engine demo|open|cloud [options]- --suite <name|file> soul, soul-id, dop, genjutsu, mixed-media, shorts, speak, cinema, selftest (or a path)+ --suite <name|file> soul, soul-cinema, soul-hex, soul-id, dop, genjutsu, mixed-media, shorts, speak, cinema, selftest (or a path)--engine <e> demo (free self-test), open (your ComfyUI) or cloud (hosted open models)--looks <a,b> Soul looks by slug, name or id (v1-general, "Flash editorial")--cases <ids> case ids or prefixes with * (dop/motion-*)diff --git a/scripts/eval/gen-cases.mjs b/scripts/eval/gen-cases.mjsindex 21610edb..196a63af 100644--- a/scripts/eval/gen-cases.mjs+++ b/scripts/eval/gen-cases.mjs@@ -1,6 +1,8 @@#!/usr/bin/env node// Writes the generated suites from the research, so the case files can't drift from it:// cases/soul.json one case per Soul look (139, ids from docs/research/higgsfield-image-studios.json)+// cases/soul-cinema.json Soul Cinema's one look (research soul.soulCinema) on cinematic scenes+// cases/soul-hex.json Soul HEX: Fuobe's own palettes in the prompt, and the open engine's palette lock// cases/dop.json one case per DoP motion / effect that the research gives a LoRA and the catalog has// cases/case.schema.json the suite format as JSON Schema (for editors)// The prompts are Fuobe's own (never Higgsfield's). Run: node scripts/eval/gen-cases.mjs [--check]@@ -46,7 +48,7 @@ function soulSuite() {$schema: "./case.schema.json",suite: "soul",title: "Fuobe Soul · the 139 looks",- description: `${HEADER} Each look on three subjects with pinned seeds: the research recipe (look template, triggers, LoRAs at their listed strengths) against the same words without LoRAs, half-strength LoRAs, the bare prompt, and the shipped Original once it exists. Style references (your own or licensed images, never Higgsfield previews) go in local/references/soul/<look>/.`,+ description: `${HEADER} Each look on three subjects with pinned seeds: the research recipe (look template, triggers, LoRAs at their listed strengths) against the same words without LoRAs, half-strength LoRAs, the bare prompt, and the shipped Original (fuobe-soul; Soul HD for a lettering look). The Original's grade and overlay are applied in the browser after generation, so its scores are of the raw picture. Style references (your own or licensed images, never Higgsfield previews) go in local/references/soul/<look>/.`,original: ["fuobe-soul", "fuobe-soul-hd"],kind: "image",recipe: "soul-look",@@ -69,7 +71,7 @@ function soulSuite() {"half-strength": { description: "The recipe with every LoRA at half strength (over-cooking check)", loraScale: 0.5 },plain: { description: "The base model with the subject prompt alone", template: false, loras: "none" },original: {- description: "The shipped Original on the server (O2's fuobe-soul): the look's Fuobe id (v1-general) goes in presetId and the server applies its own recipe",+ description: "The shipped Original on the server (O2's fuobe-soul, on the engine the run names): the look's Fuobe id (v1-general) goes in presetId and the server applies its own recipe",models: { open: ["fuobe-soul"], cloud: ["fuobe-soul"], demo: ["fuobe-soul"] },lookParam: "presetId",},@@ -78,7 +80,8 @@ function soulSuite() {id: `soul/${l.slug}`,title: `Soul ${l.family === "v1" ? "v1" : "2.0"} · ${l.name}`,look: l.id,- ...(l.recipe.base === "qwen-image-2512" && { models: qwen, extra: { steps: 20 } }),+ // A lettering look is made for Qwen-Image 2512: the Original that runs it is Fuobe Soul HD.+ ...(l.recipe.base === "qwen-image-2512" && { models: qwen, variantModels: { original: { open: ["fuobe-soul-hd"], cloud: ["fuobe-soul-hd"], demo: ["fuobe-soul-hd"] } }, extra: { steps: 20 } }),prompts: [SOUL_PROMPTS[0], SOUL_PROMPTS[1], thirdPrompt(l.id)],references: `local/references/soul/${l.slug}`,tags: [l.family, slug(l.category) || "all", slug(l.recipe.coverage), ...(l.recipe.trainOwn ? ["train-own"] : []), ...(l.recipe.needsCivitaiToken ? ["civitai"] : [])],@@ -86,6 +89,139 @@ function soulSuite() {};}+/** Today's Z-Image Turbo bases with Soul's sampler settings (§4); the Originals apply their own. */+const SOUL_TARGETS = {+ open: { models: ["oss-z-image-turbo"], extra: { steps: 8, shift: 3 } },+ cloud: { models: ["z-image-turbo-cloud"], extra: { num_inference_steps: 8, enable_prompt_expansion: false, output_format: "png" } },+ demo: { models: ["oss-z-image-turbo"] },+};+const everywhere = (id) => ({ open: [id], cloud: [id], demo: [id] });++/** A research library LoRA (loraLibrary[key]) as a case's LoRA, at the recipe's strength. */+function libraryLora(key, strength) {+ const l = research().recipes.loraLibrary.find((x) => x.key === key);+ if (!l) throw new Error(`no LoRA ${key} in the research's loraLibrary`);+ return {+ name: l.name,+ file: l.file,+ url: l.url,+ ...(l.hostedUrl && { hostedUrl: l.hostedUrl }),+ strength,+ ...(l.trigger && { trigger: l.trigger }),+ base: l.base,+ licence: l.licence,+ commercial: l.commercial !== false,+ hostedOk: l.hostedOk !== false,+ download: l.download ?? (/civitai\.com/.test(l.url ?? "") ? "civitai-token" : "direct"),+ };+}++/** Cinematic scenes for Soul Cinema (Fuobe's own words), one pinned seed each. */+const CINEMA_SCENES = [+ { id: "diner", seed: 4101, text: "a waitress refills a coffee cup for a tired trucker in an empty roadside diner at night" },+ { id: "platform", seed: 4102, text: "a woman in a trench coat waits alone on a rain-soaked train platform, wide shot" },+ { id: "rooftop", seed: 4103, text: "two detectives argue on a rooftop above a city at blue hour" },+ { id: "desert", seed: 4104, text: "a lone rider crosses a desert ridge at sunset, long shadow, wide landscape" },+ { id: "kitchen", seed: 4105, text: "a family eats breakfast in a sunlit farmhouse kitchen, the youngest spills milk" },+ { id: "corridor", seed: 4106, text: "a nurse walks down a hospital corridor at 3am under flickering lights" },+];++function soulCinemaSuite() {+ const { soul } = research().recipes;+ const cinema = soul.soulCinema;+ const tail = soul.template.tails[cinema.tail];+ if (!tail) throw new Error(`no "${cinema.tail}" tail in the research's soul.template.tails`);+ const loras = cinema.loras.map((l) => libraryLora(l.key, l.strength));+ return {+ $schema: "./case.schema.json",+ suite: "soul-cinema",+ title: "Fuobe Soul Cinema · one film look",+ description: `${HEADER} Soul Cinema has one fixed look (research soul.soulCinema): ${loras.map((l) => `${l.name} at ${l.strength}`).join(" + ")}, the "${cinema.tail}" tail, a ${cinema.grades.join(" or ")} grade after generation (in the browser, so the Original's scores are of the raw picture) and ${cinema.defaultAspect} by default. The recipe on today's base against its words alone, the bare prompt, and the shipped Original (fuobe-soul-cinema). A civitai LoRA without a mirrored copy is left out on the cloud (the runner says so). Style references (your own or licensed film stills) go in local/references/soul-cinema/.`,+ original: "fuobe-soul-cinema",+ kind: "image",+ targets: SOUL_TARGETS,+ defaults: {+ seeds: [1001],+ params: { aspectRatio: cinema.defaultAspect },+ metrics: ["clip", "aesthetic", "style"],+ variant: "recipe",+ timeoutSeconds: 900,+ },+ variants: {+ recipe: { description: "Soul Cinema's research recipe on today's base: its LoRAs with their triggers, then the cine tail", loras, words: tail },+ "prompt-only": { description: "The cine tail without the LoRAs: do they earn their slots?", loras: "none", words: tail },+ plain: { description: "The base model with the scene alone", template: false, loras: "none" },+ original: { description: "The shipped Original (fuobe-soul-cinema): the server adds its LoRAs, tail and grade", models: everywhere("fuobe-soul-cinema"), loras: "none" },+ },+ cases: CINEMA_SCENES.map((p) => ({+ id: `soul-cinema/${p.id}`,+ title: `Soul Cinema · ${p.id}`,+ prompts: [p],+ references: "local/references/soul-cinema",+ tags: ["cinema"],+ })),+ };+}++/** Fuobe's own palettes for Soul HEX (never Higgsfield's), five colours each, dark to light. */+const HEX_PALETTES = [+ { id: "teal-dusk", name: "Teal dusk", colors: ["#0B1D2A", "#1F4E5F", "#2A9D8F", "#E9C46A", "#F4A261"] },+ { id: "candy-pop", name: "Candy pop", colors: ["#118AB2", "#06D6A0", "#FF5DA2", "#FFD166", "#FDF6EC"] },+ { id: "green-editorial", name: "Green editorial", colors: ["#1B1B1B", "#0F3D2E", "#2E7D4F", "#A7C957", "#F2E8CF"] },+];++const HEX_PROMPTS = [+ { id: "portrait", seed: 5101, text: "a woman in a knitted sweater sits by a window with a cup of tea, half-length portrait" },+ { id: "still-life", seed: 5102, text: "a still life of fruit, a ceramic jug and a folded cloth on a wooden table" },+];++/** The palette sentence the composer's Color signature adds (src/lib/catalog/palettes.ts palettePrompt, no background). */+export const hexWords = (colors) => `Color palette: use only these colors, in roughly this balance: ${colors.map((c) => c.toUpperCase()).join(", ")}.`;++function soulHexSuite() {+ return {+ $schema: "./case.schema.json",+ suite: "soul-hex",+ title: "Fuobe Soul HEX · palettes",+ description: `${HEADER} A palette on Fuobe Soul, as the composer's Color signature sends it: the colours in the prompt on both engines, and on the open engine the palette lock after it (oss-palette-image, POST /api/palettes/lock: on by default for Fuobe Soul). Against the same words on today's base, Z-Image Turbo · Palette (the open engine's palette model before the Originals) and Fuobe Soul without the palette. The palette metric scores how closely each picture keeps to the colours (mean ΔE to the nearest one, and how many of them it uses). The palettes are Fuobe's own.`,+ original: "fuobe-soul",+ kind: "image",+ targets: SOUL_TARGETS,+ defaults: {+ seeds: [1001],+ params: { aspectRatio: "3:4" },+ metrics: ["palette", "clip", "aesthetic"],+ variant: "words",+ timeoutSeconds: 900,+ },+ variants: {+ words: { description: "Fuobe Soul (its General look) with the palette in the prompt: the cloud's Soul HEX", models: everywhere("fuobe-soul") },+ lock: {+ description: "Fuobe Soul with the palette in the prompt, then the palette lock (strength 0.8): the open engine's Soul HEX",+ models: { open: ["fuobe-soul"], demo: ["fuobe-soul"] },+ engines: ["demo", "open"],+ submit: { route: "/api/palettes/lock", body: { request: "{{request}}", colors: "{{request.params.palette}}" }, estimate: false },+ },+ base: { description: "The palette in the prompt on today's base, no look" },+ "palette-model": {+ description: "Z-Image Turbo · Palette: the provider writes the colours into the prompt and locks them in one graph (open engine)",+ models: { open: ["oss-zimage-palette"], demo: ["oss-zimage-palette"] },+ engines: ["demo", "open"],+ template: false,+ },+ plain: { description: "Fuobe Soul without the palette's words (the control)", models: everywhere("fuobe-soul"), template: false },+ },+ cases: HEX_PALETTES.map((p) => ({+ id: `soul-hex/${p.id}`,+ title: `Soul HEX · ${p.name}`,+ words: hexWords(p.colors),+ params: { palette: p.colors },+ prompts: HEX_PROMPTS,+ tags: ["hex"],+ })),+ };+}+/** Preset names the catalog has (motions.ts specs), so every DoP case's presetId exists. */function catalogPresetNames() {const src = fs.readFileSync(path.join(REPO_DIR, "src/lib/catalog/motions.ts"), "utf8");@@ -171,12 +307,12 @@ const write = (name, data, check) => {export function generated() {const dop = dopSuite();- return { "soul.json": soulSuite(), "dop.json": dop.suite, "case.schema.json": schemaJson(), later: dop.later };+ return { "soul.json": soulSuite(), "soul-cinema.json": soulCinemaSuite(), "soul-hex.json": soulHexSuite(), "dop.json": dop.suite, "case.schema.json": schemaJson(), later: dop.later };}if (import.meta.url === `file://${process.argv[1]}`) {const check = process.argv.includes("--check");const out = generated();- for (const name of ["soul.json", "dop.json", "case.schema.json"]) write(name, out[name], check);+ for (const name of ["soul.json", "soul-cinema.json", "soul-hex.json", "dop.json", "case.schema.json"]) write(name, out[name], check);console.log(`soul: ${out["soul.json"].cases.length} looks · dop: ${out["dop.json"].cases.length} presets${out.later.length ? ` (${out.later.length} research names not in the catalog yet)` : ""}`);}diff --git a/scripts/eval/lib/metric-info.mjs b/scripts/eval/lib/metric-info.mjsindex 9b129df0..dfa2b320 100644--- a/scripts/eval/lib/metric-info.mjs+++ b/scripts/eval/lib/metric-info.mjs@@ -16,6 +16,8 @@ export const METRIC_INFO = {lipsyncOffset: { label: "A/V offset", better: "none", unit: "frames", tie: 0, digits: 0 },syncnet: { label: "SyncNet confidence", better: "higher", unit: "conf", tie: 0.1, digits: 2 },continuity: { label: "Shot continuity", better: "higher", unit: "cosine", tie: 0.005, digits: 3 },+ paletteFit: { label: "Palette distance", better: "lower", unit: "mean ΔE76", tie: 0.5, digits: 1 },+ paletteCover: { label: "Palette used", better: "higher", unit: "0–1", tie: 0.05, digits: 2 },seconds: { label: "Time", better: "lower", unit: "s (wall clock)", tie: 0.5, digits: 1 },costUsd: { label: "Cost", better: "lower", unit: "US$", tie: 0.0005, digits: 4 },vramGb: { label: "Peak memory", better: "lower", unit: "GB", tie: 0.1, digits: 2 },diff --git a/scripts/eval/lib/plan.mjs b/scripts/eval/lib/plan.mjsindex a784fb8a..7d22eb87 100644--- a/scripts/eval/lib/plan.mjs+++ b/scripts/eval/lib/plan.mjs@@ -113,8 +113,11 @@ export function expandJobs(suite, opts) {else if (missing.length) skip = `missing local input${missing.length > 1 ? "s" : ""} ${missing.join(", ")} (see scripts/eval/README.md → Your own inputs)`;if (usedFixtures && !demo) notes.push("ran on the synthetic fixtures (--allow-fixtures), not your own inputs");- // The request: the case's own words and settings, then the variant's recipe.- let prompt = p.text;+ // The request: the case's own words and settings, then the variant's recipe. Fixed words (a one-look+ // Original's tail, a HEX palette's sentence) follow the prompt as the server adds a signature's ("{prompt}. {words}").+ const fixed = variant.template === false ? "" : [variant.words, kase.words].filter(Boolean).join(" ");+ const text = p.text.trim().replace(/[.\s]+$/, "");+ let prompt = fixed ? (text ? `${text}. ${fixed}` : fixed) : p.text;let loras = [];let wanted = 0;const usesLook = recipe?.kind === "soul-look";@@ -134,9 +137,14 @@ export function expandJobs(suite, opts) {if (!skip && variant.loras === "recipe" && picked.wanted && !loras.length) skip = `none of the recipe's LoRAs can run on ${engine === "cloud" ? "the cloud" : modelId}: ${picked.notes.join("; ")}`;// Triggers lead, joined like a look's ("triggers, prompt": the research's template convention).const triggers = triggersOf(loras);- if (triggers) prompt = `${triggers}, ${p.text}`.trim();+ if (triggers) prompt = `${triggers}, ${prompt}`.trim();} else if (variant.loras && variant.loras !== "recipe" && variant.loras !== "none") {- loras = lorasFor(null, variant, engine).loras;+ const picked = lorasFor(null, variant, engine, "none", modelId);+ loras = picked.loras;+ wanted = picked.wanted ?? 0;+ notes.push(...picked.notes);+ const triggers = triggersOf(loras);+ if (triggers) prompt = `${triggers}, ${prompt}`.trim();}const presetId = variant.preset === false ? undefined : (p.shot?.presetId ?? kase.presetId);const params = {@@ -152,6 +160,8 @@ export function expandJobs(suite, opts) {const request = {feature: "eval",modelId: modelId ?? candidates[0] ?? "",+ // The engine it runs on: a Fuobe Original runs on both and takes this one (single-engine models ignore it).+ ...(engine !== "demo" && { engine }),...((kase.op ?? target?.op) && { op: kase.op ?? target?.op }),// A training case's "{character}" becomes the trained element's @handle in the runner....(prompt && { prompt }),@@ -185,7 +195,7 @@ export function expandJobs(suite, opts) {recipe: recipe && { ...recipe, variant: variantName, sent: { loras, wanted, complete: loras.length === wanted, template: usesLook && !lookOnServer && variant.template !== false, lookOnServer: !!lookOnServer, presetStrength: variant.presetStrength ?? null } },...(p.shot && { shot: p.shot }),...(kase.train && { train: { ...kase.train, photos: resolveInput(kase.train.photos, suiteDir), target: kase.train.targets[engine] ?? null } }),- ...(kase.submit && { submit: kase.submit }),+ ...((kase.submit ?? variant.submit) && { submit: kase.submit ?? variant.submit }),timeoutSeconds: suite.defaults.timeoutSeconds,notes,...(skip && { skip }),diff --git a/scripts/eval/lib/run.mjs b/scripts/eval/lib/run.mjsindex 6fd3eef5..72099f3f 100644--- a/scripts/eval/lib/run.mjs+++ b/scripts/eval/lib/run.mjs@@ -453,6 +453,8 @@ function routeVars(job, inputs, { engine, runId, attempt = 1 }) {engine: engine === "demo" ? "open" : engine,modelId: job.model.id,requestId: requestIdFor(runId, job.id, attempt),+ // The job's own request, for a route that wraps one (POST /api/palettes/lock).+ request: { ...job.request, ...(Object.keys(inputs ?? {}).length && { inputs }) },};}@@ -546,6 +548,7 @@ async function runJob(client, job, ctx) {if (job.submit) {const vars = routeVars(job, inputs, ctx);vars.prompt = mention(vars.prompt);+ vars.request.prompt = mention(vars.request.prompt);const body = fillTemplate(job.submit.body, vars);row.request = { route: job.submit.route, body };const answer = await client.request("POST", job.submit.route, { json: body });diff --git a/scripts/eval/lib/schema.mjs b/scripts/eval/lib/schema.mjsindex da78ee60..56d59638 100644--- a/scripts/eval/lib/schema.mjs+++ b/scripts/eval/lib/schema.mjs@@ -5,7 +5,7 @@import { z } from "zod";export const ENGINES = /** @type {const} */ (["demo", "open", "cloud"]);-export const METRICS = /** @type {const} */ (["clip", "aesthetic", "style", "identity", "temporal", "lipsync", "continuity"]);+export const METRICS = /** @type {const} */ (["clip", "aesthetic", "style", "identity", "temporal", "lipsync", "continuity", "palette"]);const Slug = z.string().regex(/^[a-z0-9][a-z0-9-]*$/, "lower-case letters, digits and dashes");const CaseId = z.string().max(120).regex(/^[a-z0-9][a-z0-9._-]*(\/[a-z0-9][a-z0-9._-]*)*$/, "lower-case words joined by - . _ and /");@@ -57,6 +57,12 @@ const LoraSpec = zcommercial: z.boolean().optional(),hostedOk: z.boolean().optional(),licence: z.string().optional(),+ name: z.string().max(200).optional(),+ /** The base it was trained for (a model that can't load it leaves it out). */+ base: z.string().max(60).optional(),+ /** "civitai-token": its link needs the user's civitai key, so the cloud leaves it out unless it has a hostedUrl. */+ download: z.enum(["direct", "civitai-token"]).optional(),+ hostedUrl: z.string().regex(/^https:\/\//).optional(),}).strict();@@ -95,11 +101,31 @@ const Target = z}).strict();+const Submit = z+ .object({+ /** A studio route that builds a pipeline (POST), e.g. /api/mixed-media. */+ route: z.string().regex(/^\/api\/[\w/-]+$/),+ /**+ * The body. Filled in: {{inputs.video}}, {{inputs.images.0}}… (uploaded URLs), {{source:inputs.video}} (the clip as+ * studios take it: url, name, duration, fps, width, height, hasAudio), {{prompt}}, {{seed}}, {{engine}} (open or+ * cloud; demo runs send open), {{requestId}} and {{request}} (the job's own /api/generations request, e.g. for+ * POST /api/palettes/lock; {{request.params.palette}} is its palette).+ */+ body: Json,+ /** Which generations of the answer are the result: the final step (default), the last listed, or all. */+ result: z.enum(["final", "last", "all"]).default("final"),+ /** Where the same body is priced (default: the route + /estimate; false when the route has none). */+ estimate: z.union([z.string().regex(/^\/api\/[\w/-]+$/), z.literal(false)]).optional(),+ })+ .strict();+const Variant = z.object({description: z.string().optional(),- /** Soul looks: put the look's template and LoRA triggers around the prompt (default true). */+ /** Soul looks: put the look's template and LoRA triggers around the prompt (default true). False also drops `words`. */template: z.boolean().optional(),+ /** Fixed words after the prompt ("{prompt}. {words}"): a one-look Original's tail (Soul Cinema). */+ words: z.string().max(2000).optional(),/** The recipe's LoRAs from the research ("recipe"), none, or your own list. */loras: z.union([z.literal("recipe"), z.literal("none"), z.array(LoraSpec).max(8)]).optional(),/** Multiplies every recipe LoRA's strength. */@@ -116,6 +142,8 @@ const Variant = zengines: z.array(z.enum(ENGINES)).min(1).optional(),params: Params.optional(),extra: Json.optional(),+ /** Send this variant through a studio route instead of /api/generations (the case's own submit wins). */+ submit: Submit.optional(),}).strict();@@ -134,22 +162,6 @@ const Train = z}).strict();-const Submit = z- .object({- /** A studio route that builds a pipeline (POST), e.g. /api/mixed-media. */- route: z.string().regex(/^\/api\/[\w/-]+$/),- /**- * The body. Filled in: {{inputs.video}}, {{inputs.images.0}}… (uploaded URLs), {{source:inputs.video}} (the clip as- * studios take it: url, name, duration, fps, width, height, hasAudio), {{prompt}}, {{seed}}, {{engine}} (open or- * cloud; demo runs send open) and {{requestId}}.- */- body: Json,- /** Which generations of the answer are the result: the final step (default), the last listed, or all. */- result: z.enum(["final", "last", "all"]).default("final"),- /** Where the same body is priced (default: the route + /estimate; false when the route has none). */- estimate: z.union([z.string().regex(/^\/api\/[\w/-]+$/), z.literal(false)]).optional(),- })- .strict();export const CaseSchema = z.object({@@ -160,6 +172,8 @@ export const CaseSchema = z/** A motion or effect name in the research's motionsEffects map (fuobe-originals-recipes-5.json). */motion: z.string().optional(),presetId: z.string().optional(),+ /** The case's fixed words after the prompt and the variant's words (a HEX palette's sentence); a variant with template: false leaves them out. */+ words: z.string().max(2000).optional(),/** Models for this case instead of the suite's targets (a look on another base, a mode with its own model). */models: PerEngine(z.array(z.string().min(1)).min(1)).optional(),/** A variant's models for this case, over the variant's own (each mode of a studio has its own partner model). */diff --git a/scripts/eval/metrics/fuobe_metrics/maths.py b/scripts/eval/metrics/fuobe_metrics/maths.pyindex f67ef345..d439de8e 100644--- a/scripts/eval/metrics/fuobe_metrics/maths.py+++ b/scripts/eval/metrics/fuobe_metrics/maths.py@@ -156,3 +156,37 @@ def yunet_face(row, scale: float = 1.0) -> dict:r = np.asarray(row, dtype=np.float64)x, y, w, h = r[:4] / scalereturn {"box": [float(x), float(y), float(x + w), float(y + h)], "kps": (r[4:14] / scale).reshape(5, 2), "score": float(r[14])}+++def hex_colors(colors) -> np.ndarray:+ """'#RRGGBB' strings as a K×3 uint8 array (anything else is left out)."""+ out = []+ for c in colors or []:+ h = str(c).strip().lstrip("#")+ if len(h) == 6 and all(ch in "0123456789abcdefABCDEF" for ch in h):+ out.append([int(h[i : i + 2], 16) for i in (0, 2, 4)])+ return np.array(out, dtype=np.uint8).reshape(-1, 3)+++def srgb_to_lab(rgb: np.ndarray) -> np.ndarray:+ """sRGB 0–255 (…×3) to CIE L*a*b* under D65."""+ c = np.asarray(rgb, dtype=np.float64) / 255.0+ lin = np.where(c <= 0.04045, c / 12.92, ((c + 0.055) / 1.055) ** 2.4)+ m = np.array([[0.4124564, 0.3575761, 0.1804375], [0.2126729, 0.7151522, 0.0721750], [0.0193339, 0.1191920, 0.9503041]])+ xyz = (lin @ m.T) / np.array([0.95047, 1.0, 1.08883])+ eps, kappa = 216 / 24389, 24389 / 27+ f = np.where(xyz > eps, np.cbrt(xyz), (kappa * xyz + 16) / 116)+ return np.stack([116 * f[..., 1] - 16, 500 * (f[..., 0] - f[..., 1]), 200 * (f[..., 1] - f[..., 2])], axis=-1)+++def palette_fit(pixels: np.ndarray, palette: np.ndarray, used: float = 0.03) -> dict:+ """How closely a picture keeps to a palette (Soul HEX): `fit`, the mean ΔE (CIE76) from each pixel to its nearest+ palette colour (lower is closer; about 2.3 is a just-noticeable difference), and `cover`, the share of the palette's+ colours that are the nearest one for at least `used` of the pixels (a picture in one of five colours covers 0.2)."""+ px = srgb_to_lab(np.asarray(pixels).reshape(-1, 3))+ pal = srgb_to_lab(np.asarray(palette).reshape(-1, 3))+ if not len(px) or not len(pal):+ return {"fit": float("nan"), "cover": float("nan")}+ d = np.linalg.norm(px[:, None, :] - pal[None, :, :], axis=-1)+ share = np.bincount(d.argmin(axis=1), minlength=len(pal)) / len(px)+ return {"fit": float(d.min(axis=1).mean()), "cover": float(np.mean(share >= used))}diff --git a/scripts/eval/metrics/fuobe_metrics/registry.py b/scripts/eval/metrics/fuobe_metrics/registry.pyindex b7c0bfd5..2e84cb6b 100644--- a/scripts/eval/metrics/fuobe_metrics/registry.py+++ b/scripts/eval/metrics/fuobe_metrics/registry.py@@ -10,6 +10,7 @@ FAMILIES = {"temporal": ["drift", "driftMax", "warp"],"lipsync": ["lipsync", "lipsyncOffset"],"continuity": ["continuity"],+ "palette": ["paletteFit", "paletteCover"],}METRICS = {@@ -26,6 +27,8 @@ METRICS = {"lipsyncOffset": {"label": "A/V offset", "better": "none", "unit": "frames"},"syncnet": {"label": "SyncNet confidence", "better": "higher", "unit": "SyncNet conf"},"continuity": {"label": "Shot continuity", "better": "higher", "unit": "cosine between consecutive shots"},+ "paletteFit": {"label": "Palette distance", "better": "lower", "unit": "mean ΔE76 to the nearest palette colour"},+ "paletteCover": {"label": "Palette used", "better": "higher", "unit": "share of the palette's colours"},}# Weights, each pinned to a Hugging Face revision. "commercial" says whether the model itself may be useddiff --git a/scripts/eval/metrics/fuobe_metrics/score.py b/scripts/eval/metrics/fuobe_metrics/score.pyindex 81d21b42..161f06f2 100644--- a/scripts/eval/metrics/fuobe_metrics/score.py+++ b/scripts/eval/metrics/fuobe_metrics/score.py@@ -42,6 +42,17 @@ def read_jobs(run_dir: pathlib.Path) -> list[dict]:return [r for r in rows.values() if r.get("status") == "succeeded" and r.get("outputs")]+def palette_of(job: dict) -> np.ndarray:+ """The palette a job asked for: its request's params.palette, or a palette-lock route's colours."""+ req = job.get("request") or {}+ body = req.get("body") or {}+ inner = body.get("request") if isinstance(body.get("request"), dict) else {}+ for c in ((req.get("params") or {}).get("palette"), body.get("colors"), (inner.get("params") or {}).get("palette")):+ if isinstance(c, list) and c:+ return maths.hex_colors(c)+ return maths.hex_colors([])++def media_outputs(run_dir: pathlib.Path, job: dict) -> list[pathlib.Path]:"""The job's picture or clip outputs (masks, first frames and other helpers left out)."""out = []@@ -135,6 +146,20 @@ class Scorer:return {"_note": "no picture to score"}return {"aesthetic": round(float(np.mean(self.aesthetic().scores(pics))), 3)}+ def m_palette(self, job, outs):+ colors = palette_of(job)+ if not len(colors):+ return {"_note": "no palette in the request"}+ pics = [p for o in outs for p in images_of(o, frames=4)]+ if not pics:+ return {"_note": "no picture to score"}+ fits = []+ for p in pics:+ small = p.convert("RGB")+ small.thumbnail((160, 160))+ fits.append(maths.palette_fit(np.asarray(small), colors))+ return {"paletteFit": round(float(np.mean([f["fit"] for f in fits])), 2), "paletteCover": round(float(np.mean([f["cover"] for f in fits])), 3)}+def reference_pictures(self, job) -> list:pics = []for r in job.get("references", []):diff --git a/scripts/eval/metrics/tests/test_maths.py b/scripts/eval/metrics/tests/test_maths.pyindex 16f63d3b..a0fd27f8 100644--- a/scripts/eval/metrics/tests/test_maths.py+++ b/scripts/eval/metrics/tests/test_maths.py@@ -108,3 +108,29 @@ def test_yunet_rows_come_back_in_the_pictures_pixels_with_the_eyes_left_to_rightassert f["kps"][0][0] < f["kps"][1][0] and f["kps"][3][0] < f["kps"][4][0]assert f["kps"][2].tolist() == [48.0, 80.0]assert f["score"] == 0.9+++def test_palette_fit_distance_and_cover():+ pal = maths.hex_colors(["#FF0000", "#00ff00", "0000FF", "nope"])+ assert pal.tolist() == [[255, 0, 0], [0, 255, 0], [0, 0, 255]]+ # White is L*=100, a*=b*=0.+ assert maths.srgb_to_lab(np.array([255, 255, 255])) == pytest.approx([100.0, 0.0, 0.0], abs=0.01)+ # A picture in the palette's own colours: no distance, and it uses two of three.+ pic = np.array([[255, 0, 0]] * 50 + [[0, 0, 255]] * 50, dtype=np.uint8)+ on = maths.palette_fit(pic, pal)+ assert on["fit"] == pytest.approx(0.0, abs=1e-6)+ assert on["cover"] == pytest.approx(2 / 3)+ # Grey is far from all three; a near-red is close to red.+ grey = maths.palette_fit(np.full((10, 3), 128, dtype=np.uint8), pal)+ near = maths.palette_fit(np.full((10, 3), [250, 10, 5], dtype=np.uint8), pal)+ assert near["fit"] < 5 < grey["fit"]+ assert grey["cover"] == pytest.approx(1 / 3)+ assert math.isnan(maths.palette_fit(pic, maths.hex_colors([]))["fit"])+++def test_palette_of_reads_the_request_or_the_lock_route():+ from fuobe_metrics.score import palette_of++ assert palette_of({"request": {"params": {"palette": ["#102030"]}}}).tolist() == [[16, 32, 48]]+ assert palette_of({"request": {"route": "/api/palettes/lock", "body": {"request": {"params": {}}, "colors": ["#FFFFFF"]}}}).tolist() == [[255, 255, 255]]+ assert len(palette_of({"request": {"prompt": "x"}})) == 0diff --git a/tests/eval-harness.test.ts b/tests/eval-harness.test.tsindex 81ebbed6..442bcc1e 100644--- a/tests/eval-harness.test.ts+++ b/tests/eval-harness.test.ts@@ -34,6 +34,7 @@ const element = await import("@/app/api/elements/[id]/route");const genjutsu = await import("@/app/api/genjutsu/route");const genjutsuEstimate = await import("@/app/api/genjutsu/estimate/route");const mixedEstimate = await import("@/app/api/mixed-media/estimate/route");+const paletteLock = await import("@/app/api/palettes/lock/route");// The harness is plain ESM JavaScript (it runs with node, no build step).const evalCli = (await import("../scripts/eval/eval.mjs")) as { main: (argv: string[], io?: object) => Promise<number> };@@ -69,6 +70,7 @@ const ROUTES: [string, RegExp, (req: Request, m: RegExpExecArray) => Promise<Res["POST", /^\/api\/genjutsu$/, (r) => genjutsu.POST(r)],["POST", /^\/api\/genjutsu\/estimate$/, (r) => genjutsuEstimate.POST(r)],["POST", /^\/api\/mixed-media\/estimate$/, (r) => mixedEstimate.POST(r)],+ ["POST", /^\/api\/palettes\/lock$/, (r) => paletteLock.POST(r)],];let server: http.Server;@@ -187,6 +189,20 @@ describe("the runner on the demo provider", () => {expect(r.stdout).toMatch(/Harness self-test · demo · 5\/5 done · Free/);});+ it("runs Soul HEX's palette lock end to end: Fuobe Soul, then the lock step, whose picture is the result", async () => {+ const r = await cli(["run", "--suite", "soul-hex", "--engine", "demo", "--cases", "soul-hex/candy-pop", "--variants", "words,lock", "--prompts", "1", "--no-metrics"]);+ expect(r.code, r.stderr).toBe(0);+ const rows = store.latestJobs(path.join(results, runIdFrom(r.stderr)));+ expect(rows.map((x) => [x.variant, x.status])).toEqual([["words", "succeeded"], ["lock", "succeeded"]]);+ const lock = rows.find((x) => x.variant === "lock")!;+ const body = (lock.request as { route: string; body: { request: { modelId: string; prompt: string }; colors: string[] } }).body;+ expect(lock.request).toMatchObject({ route: "/api/palettes/lock" });+ expect(body.request.modelId).toBe("fuobe-soul");+ expect(body.request.prompt).toMatch(/Color palette: use only these colors/);+ expect(body.colors).toEqual(["#118AB2", "#06D6A0", "#FF5DA2", "#FFD166", "#FDF6EC"]);+ expect((lock as { steps?: string[] }).steps).toHaveLength(2);+ });+it("records the recipe a Soul look ran with: the look's words, its LoRAs at each variant's strength, and what the route loads", async () => {const r = await cli(["run", "--suite", "soul", "--engine", "demo", "--looks", "v2-flash-editorial", "--variants", "recipe,prompt-only,half-strength", "--prompts", "1", "--no-metrics"]);expect(r.code, r.stderr).toBe(0);@@ -677,9 +693,56 @@ describe("runEval as a library", () => {it("sends the shipped Soul Original the look's Fuobe id, never a Higgsfield one", () => {const { expandJobs } = plan;const jobs = expandJobs(cases.loadSuite("soul"), { engine: "open", looks: ["v1-general"], variants: ["original"], prompts: 1 });- expect(jobs[0].request).toMatchObject({ modelId: "fuobe-soul", presetId: "v1-general" });+ expect(jobs[0].request).toMatchObject({ modelId: "fuobe-soul", presetId: "v1-general", engine: "open" });expect(jobs[0].request.loras).toBeUndefined();expect(JSON.stringify(jobs[0].request)).not.toContain("464ea177-8d40-4940-8d9d-b438bab269c7");+ // The Original runs on the engine the run names (a demo run lets the server pick); a lettering look runs on Soul HD.+ expect(expandJobs(cases.loadSuite("soul"), { engine: "cloud", looks: ["v1-general"], variants: ["original"], prompts: 1 })[0].request.engine).toBe("cloud");+ expect(expandJobs(cases.loadSuite("soul"), { engine: "demo", looks: ["v1-general"], variants: ["original"], prompts: 1 })[0].request.engine).toBeUndefined();+ const graffiti = expandJobs(cases.loadSuite("soul"), { engine: "cloud", looks: ["v1-graffiti"], variants: ["original", "recipe"], prompts: 1 });+ expect(graffiti.map((j) => j.request.modelId)).toEqual(["fuobe-soul-hd", "fuobe-soul-hd"]);+ });++ it("gives Soul Cinema's recipe its LoRAs, triggers and cine tail, and the Original the scene alone", async () => {+ const { expandJobs } = plan;+ const { SOUL_TAILS } = await import("@/lib/catalog/soul-originals.generated");+ const suite = cases.loadSuite("soul-cinema");+ const by = (engine: string) => Object.fromEntries(expandJobs(suite, { engine, cases: ["soul-cinema/diner"], variants: ["recipe", "prompt-only", "plain", "original"] }).map((j) => [(j as unknown as { variant: string }).variant, j as unknown as { request: { prompt: string; modelId: string; loras?: { file: string; strength: number }[]; params: { aspectRatio: string } }; notes: string[] }]));+ const open = by("open");+ const scene = "a waitress refills a coffee cup for a tired trucker in an empty roadside diner at night";+ expect(open.recipe.request.prompt).toBe(`CINEMATIC, FILM STILL, ${scene}. ${SOUL_TAILS.cine}`);+ expect(open.recipe.request.loras!.map((l) => [l.file, l.strength])).toEqual([["[ZImage.Turbo]FilmStill_Redmond.safetensors", 0.7], ["civitai-2462010-moviewide.safetensors", 0.5]]);+ expect(open.recipe.request.params.aspectRatio).toBe("16:9");+ expect(open["prompt-only"].request.prompt).toBe(`${scene}. ${SOUL_TAILS.cine}`);+ expect(open.plain.request.prompt).toBe(scene);+ expect(open.original.request).toMatchObject({ modelId: "fuobe-soul-cinema", prompt: scene });+ expect(open.original.request.loras).toBeUndefined();+ // The cloud can't fetch a civitai link without a mirrored copy: that LoRA is left out, and the runner says so.+ const cloud = by("cloud");+ expect(cloud.recipe.request.loras!.map((l) => l.file)).toEqual(["[ZImage.Turbo]FilmStill_Redmond.safetensors"]);+ expect(cloud.recipe.notes.join(" ")).toMatch(/Movie Wide Angle Z-image left out on the cloud: its civitai link needs a token/);+ });++ it("writes a HEX palette as the Color signature does, and sends the lock variant through the palette-lock route", async () => {+ const { expandJobs } = plan;+ const { palettePrompt } = await import("@/lib/catalog/palettes");+ const { fillTemplate } = (await import("../scripts/eval/lib/media.mjs")) as { fillTemplate: (v: unknown, vars: object) => Record<string, unknown> };+ const suite = cases.loadSuite("soul-hex");+ type HexJob = { variant: string; skip?: string; submit?: { route: string; body: object }; request: { prompt: string; modelId: string; engine?: string; params: { palette: string[] } } };+ const jobs = (engine: string) => expandJobs(suite, { engine, cases: ["soul-hex/teal-dusk"], prompts: 1, variants: ["words", "lock", "base", "palette-model", "plain"] }) as unknown as HexJob[];+ const open = Object.fromEntries(jobs("open").map((j) => [j.variant, j]));+ const colors = ["#0B1D2A", "#1F4E5F", "#2A9D8F", "#E9C46A", "#F4A261"];+ const subject = "a woman in a knitted sweater sits by a window with a cup of tea, half-length portrait";+ expect(open.words.request).toMatchObject({ modelId: "fuobe-soul", engine: "open", prompt: `${subject}. ${palettePrompt({ colors, background: null })}`, params: { palette: colors } });+ expect(open.base.request.modelId).toBe("oss-z-image-turbo");+ expect(open["palette-model"].request).toMatchObject({ modelId: "oss-zimage-palette", prompt: subject });+ expect(open.plain.request.prompt).toBe(subject);+ expect(open.lock.submit!.route).toBe("/api/palettes/lock");+ expect(fillTemplate(open.lock.submit!.body, { request: open.lock.request })).toEqual({ request: open.lock.request, colors });+ // The lock is the open engine's: on the cloud it is skipped, not run as something else.+ const cloud = Object.fromEntries(jobs("cloud").map((j) => [j.variant, j]));+ expect(cloud.lock.skip).toMatch(/runs on demo \/ open only/);+ expect(cloud.words.request.engine).toBe("cloud");});it("expands, prices and lists a dry run without uploading anything", async () => {