Skip to content

armgit / fuobe

Public Imported from GitHub
0

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.

Originals O3: Soul ID eval suite per family, a look case, consent from the runner

Claude244bfd2d5d04
diff --git a/scripts/eval/README.md b/scripts/eval/README.md
index b96b7019..83f72825 100644
--- a/scripts/eval/README.md
+++ b/scripts/eval/README.md
@@ -117,7 +117,7 @@ One JSON file per Original in `cases/`. Later Original packages add their own fi
| `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 |
+| `soul-id` | character and look training | your photos → train per family (Fuobe Soul, Soul Cinema, Soul HD, FLUX.1 [dev]) → scenes; a moodboard → a look | `trained`, `half-strength`, `references` | identity (style for the look), clip, aesthetic |
| `dop` | Fuobe DoP motions and effects | the 69 the research gives a LoRA, and the 20 camera moves it gives a Fun Camera pose or an LTX camera LoRA | `catalog`, `prompt-only`, `research` (the candidate), `partner` (cloud) | temporal, clip |
| `dop-mix` | Fuobe DoP's Mix | 5 move + effect pairs | `mix` (the candidate), `first` (the move alone) | temporal, clip |
| `genjutsu` | Genjutsu move / swap / restyle | 3 (through `/api/genjutsu`) | `original`, `partner` (cloud: each mode's own partner on fal) | temporal, clip |
@@ -194,7 +194,8 @@ small synthetic files in `fixtures/` instead.
scripts/eval/local/
references/soul/<look-slug>/*.jpg # style references per look (your own or licensed images; never Higgsfield previews)
references/mixed-media/<look>/* # what each Mixed Media look should look like
- characters/default/*.jpg # 10–30 photos of ONE consenting person (soul-id)
+ characters/default/*.jpg # 20+ photos (80 at most) of ONE consenting person (soul-id)
+ styles/default/*.jpg # 20+ images in one style, a moodboard (soul-id/look)
dop/start.png, dop/end.png # a start frame (a person on a bridge fits the prompts), an end frame for transitions
genjutsu/dance.mp4, character.png, style.png
genjutsu/street.mp4, object.png # street.mp4 at least 720 px on each side (Kling O3's edit, the cloud partner)
@@ -203,10 +204,14 @@ scripts/eval/local/
speak/portrait.png, speak/voice.wav
```
-**Training needs consent.** `soul-id.json` ships with `"consent": false`, so training refuses to
-start. Copy the file to `local/soul-id.json`. In your copy, set `"consent": true` only when the
-person in the photos agreed. Then run it with `--suite scripts/eval/local/soul-id.json`. To reuse a
-character you already trained, put its element id in `"element"` instead of training again.
+**Training needs consent.** `soul-id.json` ships with `"consent": false`, so a character's training
+refuses to start. Copy the file to `local/soul-id.json`. In your copy, set `"consent": true` only
+when the person in the photos agreed: the runner then sends Fuobe the consent line with the training,
+as the Train dialog does. A look (`"kind": "style"`) needs no consent. Then run it with
+`--suite scripts/eval/local/soul-id.json`. To reuse a character you already trained, put its element
+id in `"element"` instead of training again. Each case trains its own family (a Soul ID runs on the
+models of the base it was trained on), so a full cloud run trains four times: about $1.70 + $1.70 +
+$1.50 + $6.00 for the characters and $3.39 for the look, priced before anything starts.
## The case format
@@ -257,7 +262,7 @@ Other case fields:
- `variantModels`: a variant's models for this case (`{"partner": {"cloud": ["kling-o3"]}}`), over
the variant's own. Each Genjutsu mode names its own partner this way.
- `shots`: a film's shots. Continuity is measured across them.
-- `train`: photos, a target per engine, `consent`, and `minPhotos`.
+- `train`: photos, a target per engine, `kind` (`character` or `style`), `consent`, and `minPhotos`.
- `submit`: a studio route and its body, with `{{inputs.video}}`, `{{source:inputs.video}}`,
`{{prompt}}`, `{{seed}}`, `{{engine}}` and `{{requestId}}` filled in.
- `engines`: the engines the case runs on.
diff --git a/scripts/eval/cases/case.schema.json b/scripts/eval/cases/case.schema.json
index ef5df066..01c69ced 100644
--- a/scripts/eval/cases/case.schema.json
+++ b/scripts/eval/cases/case.schema.json
@@ -1310,6 +1310,14 @@
"minLength": 1,
"maxLength": 60
},
+ "kind": {
+ "default": "character",
+ "type": "string",
+ "enum": [
+ "character",
+ "style"
+ ]
+ },
"minPhotos": {
"default": 5,
"type": "integer",
diff --git a/scripts/eval/cases/soul-id.json b/scripts/eval/cases/soul-id.json
index 79302d06..b44a426f 100644
--- a/scripts/eval/cases/soul-id.json
+++ b/scripts/eval/cases/soul-id.json
@@ -1,32 +1,37 @@
{
"$schema": "./case.schema.json",
"suite": "soul-id",
- "title": "Fuobe Soul ID · character training",
- "description": "Train a character from a folder of photos you supply (local/characters/<name>/, 10–30 photos of one consenting person: no sunglasses, groups, filters or cropped faces, one full-body shot), then make N images of them. Identity is measured against the same photos. Set \"consent\": true in your copy only when the person agreed; demo runs don't train (they use reference images on drawn faces).",
+ "title": "Fuobe Soul ID · character and look training",
+ "description": "Train a character from a folder of photos you supply (local/characters/<name>/, 20+ photos of one consenting person: no sunglasses, groups, filters or cropped faces, one full-body shot), then make N images of them on each family's model. Identity is measured against the same photos, and A/B'd against the same element used as reference photos on an edit model. Set \"consent\": true in your copy only when the person agreed. The look case trains a moodboard's style (local/styles/<name>/, 20+ images in one style) and measures style against those images. Demo runs don't train (they use reference images on drawn faces). Use Fuobe-owned or licensed photos only, never Higgsfield outputs.",
"original": "fuobe-soul-id",
"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 } },
- "demo": { "models": ["oss-z-image-turbo"] }
+ "open": { "models": ["fuobe-soul"] },
+ "cloud": { "models": ["fuobe-soul"] },
+ "demo": { "models": ["fuobe-soul"] }
},
"defaults": {
"seeds": [1001],
"params": { "aspectRatio": "3:4" },
"metrics": ["identity", "clip", "aesthetic"],
+ "candidate": "trained",
"timeoutSeconds": 900
},
"variants": {
- "trained": { "description": "The trained character LoRA, @mentioned in every prompt" },
- "original": {
- "description": "The same element on the shipped Original (O3 retargets training to fuobe-soul)",
- "models": { "open": ["fuobe-soul"], "cloud": ["fuobe-soul"], "demo": ["fuobe-soul"] }
+ "trained": { "description": "The trained LoRA, @mentioned in every prompt, at full character strength" },
+ "half-strength": {
+ "description": "The same LoRA at half character strength (scale 0.8): does the likeness hold while the scene follows the prompt better?",
+ "extra": { "characterStrength": 0.5 }
+ },
+ "references": {
+ "description": "No training: the same element's photos as references on an edit model (open) or a partner model (cloud), the bar Soul ID has to clear",
+ "models": { "open": ["oss-qwen-edit"], "cloud": ["nano-banana-pro"], "demo": ["oss-qwen-edit"] }
}
},
"cases": [
{
"id": "soul-id/character",
- "title": "Your character, eight scenes",
+ "title": "Fuobe Soul · your character, eight scenes",
"train": {
"photos": "local/characters/default",
"name": "Eval character",
@@ -45,7 +50,92 @@
{ "id": "cafe", "seed": 1106, "text": "{character} reading a book by the window of a small cafe" },
{ "id": "stage", "seed": 1107, "text": "{character} singing into a microphone on a stage under coloured lights" },
{ "id": "profile", "seed": 1108, "text": "a side profile portrait of {character}, soft studio light, plain grey backdrop" }
- ]
+ ],
+ "tags": ["z-image-turbo"]
+ },
+ {
+ "id": "soul-id/cinema",
+ "title": "Soul Cinema · the same family's LoRA in film stills",
+ "note": "Trains again unless train.element names the character case's element (its id is in an earlier run's elements.json).",
+ "models": { "open": ["fuobe-soul-cinema"], "cloud": ["fuobe-soul-cinema"], "demo": ["fuobe-soul-cinema"] },
+ "params": { "aspectRatio": "16:9" },
+ "train": {
+ "photos": "local/characters/default",
+ "name": "Eval character",
+ "targets": { "open": "aitk-z-image", "cloud": "fal-z-image" },
+ "minPhotos": 5,
+ "consent": false
+ },
+ "references": "local/characters/default",
+ "demoInputs": { "images": ["fixtures/character/drawn-face-1.png", "fixtures/character/drawn-face-2.png"] },
+ "prompts": [
+ { "id": "diner", "seed": 1201, "text": "{character} in a booth of an empty diner at 3am, neon through the window" },
+ { "id": "platform", "seed": 1202, "text": "{character} waiting alone on a rain-soaked train platform, wide shot" },
+ { "id": "rooftop", "seed": 1203, "text": "{character} on a rooftop at golden hour, the city behind, medium shot" }
+ ],
+ "tags": ["z-image-turbo"]
+ },
+ {
+ "id": "soul-id/hd",
+ "title": "Fuobe Soul HD · retrained on Qwen-Image 2512, with lettering",
+ "models": { "open": ["fuobe-soul-hd"], "cloud": ["fuobe-soul-hd"], "demo": ["fuobe-soul-hd"] },
+ "train": {
+ "photos": "local/characters/default",
+ "name": "Eval character HD",
+ "targets": { "open": "aitk-qwen-2512", "cloud": "fal-qwen-2512" },
+ "minPhotos": 5,
+ "consent": false
+ },
+ "references": "local/characters/default",
+ "demoInputs": { "images": ["fixtures/character/drawn-face-1.png", "fixtures/character/drawn-face-2.png"] },
+ "prompts": [
+ { "id": "poster", "seed": 1301, "text": "a concert poster of {character} on stage, the words \"LIVE TONIGHT\" in bold letters across the top" },
+ { "id": "magazine", "seed": 1302, "text": "a magazine cover with {character}, the title \"BLOOM\" at the top, studio portrait" },
+ { "id": "street", "seed": 1303, "text": "{character} in front of a shop sign that reads \"OPEN\", morning light" }
+ ],
+ "tags": ["qwen-image-2512"]
+ },
+ {
+ "id": "soul-id/flux",
+ "title": "FLUX.1 [dev] · retrained for FLUX (non-commercial weights)",
+ "note": "Licences are information: FLUX.1 [dev]'s weights are non-commercial, for the report's reader to weigh, not the harness.",
+ "models": { "open": ["oss-flux1-dev"], "cloud": ["flux-1-dev-lora-cloud"], "demo": ["oss-flux1-dev"] },
+ "train": {
+ "photos": "local/characters/default",
+ "name": "Eval character FLUX",
+ "targets": { "open": "aitk-flux1-dev", "cloud": "fal-flux1-portrait" },
+ "minPhotos": 5,
+ "consent": false
+ },
+ "references": "local/characters/default",
+ "demoInputs": { "images": ["fixtures/character/drawn-face-1.png", "fixtures/character/drawn-face-2.png"] },
+ "prompts": [
+ { "id": "chef", "seed": 1401, "text": "{character} as a chef plating a dish in a busy restaurant kitchen" },
+ { "id": "beach", "seed": 1403, "text": "{character} walking barefoot on a beach at sunrise, full body" },
+ { "id": "profile", "seed": 1408, "text": "a side profile portrait of {character}, soft studio light, plain grey backdrop" }
+ ],
+ "tags": ["flux1-dev"]
+ },
+ {
+ "id": "soul-id/look",
+ "title": "A moodboard trained as a look on Fuobe Soul",
+ "models": { "open": ["fuobe-soul"], "cloud": ["fuobe-soul"], "demo": ["fuobe-soul"] },
+ "metrics": ["style", "clip", "aesthetic"],
+ "train": {
+ "photos": "local/styles/default",
+ "name": "Eval look",
+ "kind": "style",
+ "targets": { "open": "aitk-z-image", "cloud": "fal-z-image-style" },
+ "minPhotos": 5
+ },
+ "references": "local/styles/default",
+ "demoInputs": { "images": ["fixtures/references/warm-1.png", "fixtures/references/warm-2.png"] },
+ "prompts": [
+ { "id": "lighthouse", "seed": 1501, "text": "{character} a lighthouse on a cliff at dusk" },
+ { "id": "fisherman", "seed": 1502, "text": "{character} a portrait of an old fisherman mending a net" },
+ { "id": "lemons", "seed": 1503, "text": "{character} a bowl of lemons on a kitchen table" }
+ ],
+ "tags": ["z-image-turbo", "style"]
}
]
}
diff --git a/scripts/eval/lib/run.mjs b/scripts/eval/lib/run.mjs
index 4e13bb12..ce8b546e 100644
--- a/scripts/eval/lib/run.mjs
+++ b/scripts/eval/lib/run.mjs
@@ -432,7 +432,7 @@ function trainingProblem(job, engine) {
const t = job.train;
if (engine === "demo" || t.element) return null;
if (!t.target) return `no training target for ${engine} in this case`;
- if (!t.consent) return 'training needs "consent": true in the case (only when the person in the photos agreed)';
+ if (t.kind !== "style" && !t.consent) return 'training a character needs "consent": true in the case (only when the person in the photos agreed)';
const photos = listMedia(t.photos).filter((f) => /\.(png|jpe?g|webp)$/i.test(f));
if (photos.length < t.minPhotos) return `add at least ${t.minPhotos} photos to ${path.relative(REPO_DIR, t.photos)} (there ${photos.length === 1 ? "is" : "are"} ${photos.length})`;
return null;
@@ -493,14 +493,16 @@ async function prepareElement(client, job, ctx) {
const refs = [];
for (const f of photos.slice(0, MAX_ELEMENT_PHOTOS)) refs.push(await ctx.up.url(f));
const name = `${t.name ?? "Eval character"} ${ctx.runId.slice(-4)}`.slice(0, 60);
- const el = await client.request("POST", "/api/elements", { json: { name, kind: "character", references: refs } });
+ const kind = t.kind ?? "character";
+ const el = await client.request("POST", "/api/elements", { json: { name, kind, references: refs } });
const record = { id: el.id, handle: el.handle, photos: refs.length, ...(photos.length > MAX_ELEMENT_PHOTOS && { note: `the first ${MAX_ELEMENT_PHOTOS} of ${photos.length} photos (an element holds ${MAX_ELEMENT_PHOTOS})` }) };
if (ctx.engine === "demo") {
writeJson(file, { ...saved, [job.caseId]: { ...record, status: "demo" } });
return record;
}
ctx.log(`Training ${name} on ${t.target} with ${refs.length} photos`);
- const tr = await client.request("POST", `/api/elements/${encodeURIComponent(el.id)}/trainings`, { json: { target: t.target } });
+ // A character trains only with the person's consent (Soul ID's consent line): the case said so (trainingProblem checked).
+ const tr = await client.request("POST", `/api/elements/${encodeURIComponent(el.id)}/trainings`, { json: { target: t.target, ...(kind === "character" && { consent: t.consent === true }) } });
// An earlier training of this case that failed was paid for too: its cost stays in the run's spend.
const earlierUsd = prev?.training ? (prev.costUsd ?? prev.estimateUsd ?? 0) + (prev.earlierUsd ?? 0) : prev?.earlierUsd;
const started = { ...record, training: tr.id, target: t.target, status: "training", startedAt: ctx.now(), estimateUsd: ctx.estimateUsd ?? null, ...(earlierUsd && { earlierUsd }) };
diff --git a/scripts/eval/lib/schema.mjs b/scripts/eval/lib/schema.mjs
index f97f918a..73d7bc8d 100644
--- a/scripts/eval/lib/schema.mjs
+++ b/scripts/eval/lib/schema.mjs
@@ -156,8 +156,10 @@ const Train = z
/** Training target ids per engine (GET /api/elements/<id>/trainings lists them). */
targets: PerEngine(z.string().min(1)),
name: z.string().min(1).max(60).optional(),
+ /** A person (a Soul ID, trained as a subject, consent first) or a look (a moodboard's style, trained as a style). */
+ kind: z.enum(["character", "style"]).default("character"),
minPhotos: z.number().int().min(1).default(5),
- /** The people in the photos agreed to being trained on. Training refuses to start without it. */
+ /** The people in the photos agreed to being trained on. A character's training refuses to start without it. */
consent: z.boolean().default(false),
/** An element that is already trained (its id): the run uses it instead of training again. */
element: z.string().min(1).max(64).optional(),
diff --git a/tests/eval-harness.test.ts b/tests/eval-harness.test.ts
index 31396b71..aeaccdb0 100644
--- a/tests/eval-harness.test.ts
+++ b/tests/eval-harness.test.ts
@@ -23,6 +23,7 @@ process.env.COMFYUI_URL = "http://127.0.0.1:9";
process.env.OLLAMA_URL = "http://127.0.0.1:9";
const { setSetting } = await import("@/server/settings");
+const { getElement } = await import("@/server/elements");
const status = await import("@/app/api/status/route");
const models = await import("@/app/api/models/route");
const generations = await import("@/app/api/generations/route");
@@ -237,12 +238,19 @@ describe("the runner on the demo provider", () => {
});
it("a training case in a demo run makes an element from the fixtures and @mentions it (no training)", async () => {
- const r = await cli(["run", "--suite", "soul-id", "--engine", "demo", "--prompts", "1", "--variants", "trained", "--no-metrics"]);
+ const r = await cli(["run", "--suite", "soul-id", "--engine", "demo", "--cases", "soul-id/character,soul-id/look", "--prompts", "1", "--variants", "trained", "--no-metrics"]);
const runDir = path.join(results, runIdFrom(r.stderr));
- const el = JSON.parse(fs.readFileSync(path.join(runDir, "elements.json"), "utf8"))["soul-id/character"];
+ const elements = JSON.parse(fs.readFileSync(path.join(runDir, "elements.json"), "utf8"));
+ const el = elements["soul-id/character"];
expect(el).toMatchObject({ status: "demo", photos: 3 });
- const [row] = store.latestJobs(runDir);
- expect(String((row.request as { prompt: string }).prompt)).toContain(`@${el.handle} as a chef`);
+ const rows = store.latestJobs(runDir);
+ const prompt = (caseId: string) => String((rows.find((x) => x.caseId === caseId)!.request as { prompt: string }).prompt);
+ expect(prompt("soul-id/character")).toContain(`@${el.handle} as a chef`);
+ // The look case makes a style element (no consent line), @mentioned on Fuobe Soul.
+ expect(elements["soul-id/look"]).toMatchObject({ status: "demo", photos: 2 });
+ expect(prompt("soul-id/look")).toContain(`@${elements["soul-id/look"].handle} a lighthouse`);
+ const look = getElement(elements["soul-id/look"].id);
+ expect(look?.kind).toBe("style");
});
it("never runs a job through Higgsfield's API, and runs each Genjutsu mode's own partner model", async () => {
@@ -934,6 +942,56 @@ describe("the cloud spend cap", () => {
expect(runner.trainingPrice({ price: "Free" })).toBe(0);
expect(runner.trainingPrice({ price: "Higgsfield balance" })).toBeNull();
});
+ it("trains a character with the consent line the case confirms, and a look without one", async () => {
+ const suiteFile = path.join(dir, "train-consent.json");
+ const photos = path.join(process.cwd(), "scripts/eval/fixtures/character");
+ fs.writeFileSync(
+ suiteFile,
+ JSON.stringify({
+ suite: "train-consent",
+ title: "Consent",
+ description: "x",
+ original: "fuobe-soul-id",
+ kind: "image",
+ targets: { cloud: { models: ["fuobe-soul"] } },
+ cases: [
+ { id: "t/person", title: "person", train: { photos, targets: { cloud: "fal-z-image" }, minPhotos: 3, consent: true }, prompts: [{ id: "p", text: "{character} in a cafe", seed: 1 }] },
+ { id: "t/look", title: "look", train: { photos, kind: "style", targets: { cloud: "fal-z-image-style" }, minPhotos: 3 }, prompts: [{ id: "p", text: "{character} a cafe", seed: 1 }] },
+ { id: "t/noconsent", title: "no consent", train: { photos, targets: { cloud: "fal-z-image" }, minPhotos: 3 }, prompts: [{ id: "p", text: "{character}", seed: 1 }] },
+ ],
+ }),
+ );
+ const stub = cloudStub({ previewUsd: 0.01, actualUsd: 0.01, models: ["fuobe-soul"], trainingTargets: [{ id: "fal-z-image", provider: "fal", price: "≈ $1.70 (2,000 steps)" }, { id: "fal-z-image-style", provider: "fal", price: "≈ $3.39 (1,500 steps)" }] });
+ const made: { kind: string }[] = [];
+ const trainings: Record<string, unknown>[] = [];
+ const base = stub.client.request.bind(stub.client);
+ const client = {
+ ...stub.client,
+ async request(method: string, p: string, opts: { json?: Record<string, unknown>; query?: Record<string, unknown> } = {}) {
+ if (p === "/api/elements" && method === "POST") {
+ made.push(opts.json as { kind: string });
+ return { id: `el${made.length}`, handle: `Eval_${made.length}` };
+ }
+ const t = /^\/api\/elements\/(el\d+)\/trainings$/.exec(p);
+ if (t && method === "POST") {
+ trainings.push(opts.json!);
+ return { id: `tr-${t[1]}` };
+ }
+ if (t) return { targets: [], items: [{ id: `tr-${t[1]}`, status: "succeeded", costUsd: 1.7 }] };
+ return base(method, p, opts);
+ },
+ };
+ const suite = cases.loadSuite(suiteFile);
+ const r = (await runner.runEval({ suite, engine: "cloud", maxUsd: 10, root }, { client, sleep: async () => {} })) as { run: { jobs?: unknown } };
+ expect(r).toBeDefined();
+ expect(made.map((m) => m.kind)).toEqual(["character", "style"]);
+ expect(trainings).toEqual([
+ { target: "fal-z-image", consent: true },
+ { target: "fal-z-image-style" },
+ ]);
+ const dry = (await runner.runEval({ suite, engine: "cloud", dryRun: true, root }, { client })) as { jobs: { case: string; skip?: string }[] };
+ expect(dry.jobs.find((j) => j.case === "t/noconsent")?.skip).toMatch(/training a character needs "consent": true/);
+ });
});
describe("what a job measures", () => {