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.

Evaluation harness: its renders stay out of your Library, trash cleans up a run, and the Soul Original gets Fuobe look ids

Claudecff4f4f5b202
diff --git a/bin/lib/commands.mjs b/bin/lib/commands.mjs
index 535d6bd0..bedd2fbd 100644
--- a/bin/lib/commands.mjs
+++ b/bin/lib/commands.mjs
@@ -889,7 +889,7 @@ export const COMMANDS = {
},
eval: {
summary: "Measure Fuobe Originals: run a suite, score, review blind, compare runs",
- usage: "fuobe eval <run|report|review|compare|promote|history|validate|setup> [options] (from a Fuobe checkout)",
+ usage: "fuobe eval <run|report|review|compare|promote|history|validate|setup|trash> [options] (from a Fuobe checkout)",
examples: ["fuobe eval run --suite selftest --engine demo", "fuobe eval run --suite soul --engine open --looks v1-general --variants recipe,prompt-only", "fuobe eval compare latest~1 latest --fail-on clip --threshold 1"],
passthrough: true,
run: evalHarness,
diff --git a/docs/cli.md b/docs/cli.md
index 0fff1a23..14beaa96 100644
--- a/docs/cli.md
+++ b/docs/cli.md
@@ -229,13 +229,15 @@ tools and Fuobe's skills as prompts.
### `fuobe eval` — measure the Fuobe Originals
-From a Fuobe checkout, `fuobe eval <command>` is the evaluation harness (`pnpm eval:<command>`), run
-against the same server and token as the other commands:
+From a Fuobe checkout, `fuobe eval <command>` is the evaluation harness (`pnpm eval:<command>`). It
+finds the server and token as the other commands do, so the saved token goes only to the server it was
+saved for, even when `--url` names another:
```bash
fuobe eval run --suite selftest --engine demo # a free self-test of the harness
fuobe eval run --suite soul --engine open --looks v1-general --variants recipe,prompt-only
fuobe eval compare latest~1 latest --fail-on clip --threshold 1 # exit 1 on a regression
+fuobe eval trash latest # the run's generations to that Fuobe's Trash
```
See [`scripts/eval/README.md`](../scripts/eval/README.md) for the suites, metrics, blind review and
diff --git a/package.json b/package.json
index 80e7dab6..a1774b11 100644
--- a/package.json
+++ b/package.json
@@ -25,7 +25,8 @@
"eval:promote": "node scripts/eval/eval.mjs promote",
"eval:history": "node scripts/eval/eval.mjs history",
"eval:validate": "node scripts/eval/eval.mjs validate",
- "eval:setup": "node scripts/eval/eval.mjs setup"
+ "eval:setup": "node scripts/eval/eval.mjs setup",
+ "eval:trash": "node scripts/eval/eval.mjs trash"
},
"dependencies": {
"@anthropic-ai/sdk": "^0.135.0",
diff --git a/scripts/eval/README.md b/scripts/eval/README.md
index 515defb3..ae488e94 100644
--- a/scripts/eval/README.md
+++ b/scripts/eval/README.md
@@ -59,6 +59,10 @@ harness measures what a user gets.
fal or Replicate.
- **The model it names.** A job the server would run on another model than the one the case names
(a studio's default maker, say) is skipped, since it wouldn't measure that model.
+- **Your Library stays yours.** Every generation the harness starts has the feature `eval`, a helper
+ like a studio's steps: the Library and Home feeds leave it out unless **Show steps** is on. A studio
+ route's steps (Genjutsu, Mixed Media) carry that studio's feature instead. `pnpm eval:trash <runId>`
+ moves a run's generations, studio steps included, to that Fuobe's Trash.
- On the open engine the harness also reads ComfyUI directly (`--comfy-url`, default `COMFYUI_URL`
or `http://127.0.0.1:8188`). It uses three read-only endpoints: `/system_stats` for memory,
`/history` for ComfyUI's own timings, and `/object_info/LoraLoader` to name the LoRAs ComfyUI
@@ -76,6 +80,7 @@ harness measures what a user gets.
| `pnpm eval:history` | Lists runs, newest first, and the per-case scores of one case (`--case soul/v1-general`) |
| `pnpm eval:validate` | Checks every case file, and that the generated suites match the research |
| `pnpm eval:setup` | Creates the metrics venv with uv (`--identity`, `--download`, `--dinov2`, `--torch-backend`) |
+| `pnpm eval:trash <runId>` | Moves the run's generations to the Trash of the Fuobe it ran on (`--dry-run` counts them). The run's folder here keeps its outputs and scores |
Every command takes `--json`. Runs are named by id, by path, or as `latest`, `latest~1` (the run
before) and so on. `pnpm eval:<command> --help` lists each command's options.
@@ -130,8 +135,9 @@ 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. It is
- skipped until that Original exists.
+- **original**: the shipped `fuobe-soul` Original, which applies the look on the server. The look
+ goes 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.
DoP variants, on your start frame with two seeds:
diff --git a/scripts/eval/cases/case.schema.json b/scripts/eval/cases/case.schema.json
index 11778139..70422af7 100644
--- a/scripts/eval/cases/case.schema.json
+++ b/scripts/eval/cases/case.schema.json
@@ -640,10 +640,7 @@
},
"lookParam": {
"type": "string",
- "enum": [
- "presetId",
- "styleId"
- ]
+ "const": "presetId"
},
"models": {
"type": "object",
diff --git a/scripts/eval/cases/soul.json b/scripts/eval/cases/soul.json
index 214e3dfd..dd30f635 100644
--- a/scripts/eval/cases/soul.json
+++ b/scripts/eval/cases/soul.json
@@ -68,7 +68,7 @@
"loras": "none"
},
"original": {
- "description": "The shipped Original on the server (O2's fuobe-soul): the look id goes in presetId and the server applies its own recipe",
+ "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",
"models": {
"open": [
"fuobe-soul"
diff --git a/scripts/eval/eval.mjs b/scripts/eval/eval.mjs
index 5ce2ecab..9c2a596f 100644
--- a/scripts/eval/eval.mjs
+++ b/scripts/eval/eval.mjs
@@ -57,6 +57,7 @@ const HELP = {
promote: "pnpm eval:promote <runId> [--candidate recipe] [--against prompt-only,half-strength,plain] [--record [--research file]] --record writes the verdicts into the research JSON",
history: "pnpm eval:history [--suite soul] [--case soul/v1-general] [--limit 20]",
validate: "pnpm eval:validate [suite files…] checks every case file and that the generated suites match the research",
+ trash: "pnpm eval:trash <runId> [--dry-run] moves the run's generations to that Fuobe's Trash (its results here stay)",
setup: "pnpm eval:setup [--identity] [--download [--dinov2]] [--torch-backend cpu|auto|cu128…] the metrics venv (needs uv)",
};
@@ -86,7 +87,7 @@ export async function main(argv, io = {}) {
print(rest[0] && HELP[rest[0]] ? HELP[rest[0]] : usage());
return 0;
}
- const commands = { run, report, review, compare, promote: promoteCmd, history, validate, setup };
+ const commands = { run, report, review, compare, promote: promoteCmd, history, validate, setup, trash };
if (!commands[command]) {
note(`Unknown command “${command}”.\n${usage()}`);
return 2;
@@ -354,6 +355,37 @@ async function validate(args, ctx) {
return bad ? 1 : 0;
}
+/**
+ * A run's generations to the Trash of the Fuobe it ran on: the harness's renders stay out of the Library
+ * anyway (feature "eval" is a helper), but a studio route's steps carry the studio's own feature. The run's
+ * folder here keeps its outputs and scores. The token rides only to that server, as with every command.
+ */
+async function trash(args, ctx) {
+ const { values: v, positionals } = parse(args, { "dry-run": { type: "boolean" } }, { positionals: true });
+ if (v.help) return ctx.print(HELP.trash), 0;
+ const { dir, runId } = resolveRun(root(v, ctx.env), positionals[0] ?? "latest");
+ const run = JSON.parse(fs.readFileSync(path.join(dir, "run.json"), "utf8"));
+ if (!run.server?.url && !v.url) throw new Error(`${runId} doesn't say which Fuobe it ran on: name it with --url`);
+ // Every attempt's generations, and a studio route's steps.
+ const ids = [...new Set(readJsonl(path.join(dir, "jobs.jsonl")).flatMap((r) => [...(r.generations ?? []), ...(r.steps ?? [])]))];
+ const { client, target } = connect({ url: v.url ?? run.server?.url, token: v.token }, { env: ctx.env, home: ctx.io.home, fetch: ctx.io.fetch });
+ if (v["dry-run"]) return ctx.print(`${ids.length} generation${ids.length === 1 ? "" : "s"} of ${runId} would go to the Trash on ${target.url}`), 0;
+ let moved = 0;
+ let gone = 0;
+ for (const id of ids) {
+ try {
+ await client.request("DELETE", `/api/generations/${encodeURIComponent(id)}`);
+ moved++;
+ } catch (e) {
+ if (e.status === 404) gone++;
+ else throw e;
+ }
+ }
+ if (v.json) return ctx.print(JSON.stringify({ runId, server: target.url, moved, gone }, null, 2)), 0;
+ ctx.print(`Moved ${moved} generation${moved === 1 ? "" : "s"} of ${runId} to the Trash on ${target.url}${gone ? ` (${gone} were gone already)` : ""}. The run's results here stay; empty the Trash in Fuobe to delete them for good.`);
+ return 0;
+}
+
async function setup(args, ctx) {
const { values: v } = parse(args, { identity: { type: "boolean" }, dinov2: { type: "boolean" }, download: { type: "boolean" }, "torch-backend": { type: "string" } });
if (v.help) return ctx.print(HELP.setup), 0;
diff --git a/scripts/eval/gen-cases.mjs b/scripts/eval/gen-cases.mjs
index a908a60c..21610edb 100644
--- a/scripts/eval/gen-cases.mjs
+++ b/scripts/eval/gen-cases.mjs
@@ -69,7 +69,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 id goes in presetId and the server applies its own recipe",
+ 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",
models: { open: ["fuobe-soul"], cloud: ["fuobe-soul"], demo: ["fuobe-soul"] },
lookParam: "presetId",
},
diff --git a/scripts/eval/lib/plan.mjs b/scripts/eval/lib/plan.mjs
index 20d6b6e2..a784fb8a 100644
--- a/scripts/eval/lib/plan.mjs
+++ b/scripts/eval/lib/plan.mjs
@@ -148,7 +148,6 @@ export function expandJobs(suite, opts) {
seed,
};
const extra = { ...target?.extra, ...suite.defaults.extra, ...kase.extra, ...variant.extra };
- if (lookOnServer && variant.lookParam === "styleId") params.styleId = recipe.look.id;
if (Object.keys(extra).length) params.extra = extra;
const request = {
feature: "eval",
@@ -157,7 +156,8 @@ export function expandJobs(suite, opts) {
// A training case's "{character}" becomes the trained element's @handle in the runner.
...(prompt && { prompt }),
...(p.negative && { negativePrompt: p.negative }),
- ...(lookOnServer && variant.lookParam === "presetId" ? { presetId: recipe.look.id } : presetId ? { presetId } : {}),
+ // The Original applies the look on the server, named by its Fuobe id ("v1-general"): a Higgsfield look id never leaves the harness.
+ ...(lookOnServer ? { presetId: recipe.look.slug } : presetId ? { presetId } : {}),
...(variant.presetStrength !== undefined && presetId && { presetStrength: variant.presetStrength }),
...(loras.length && { loras }),
params,
diff --git a/scripts/eval/lib/schema.mjs b/scripts/eval/lib/schema.mjs
index 2d9f2cda..da78ee60 100644
--- a/scripts/eval/lib/schema.mjs
+++ b/scripts/eval/lib/schema.mjs
@@ -108,8 +108,8 @@ const Variant = z
preset: z.boolean().optional(),
/** Motions / effects: 0 runs the preset's prompt without its catalog LoRAs. */
presetStrength: z.number().min(0).max(1).optional(),
- /** The server's own Original applies the look: send the case's look id in this field and no client recipe. */
- lookParam: z.enum(["presetId", "styleId"]).optional(),
+ /** The server's own Original applies the look: send the look's Fuobe id ("v1-general") as presetId and no client recipe. */
+ lookParam: z.literal("presetId").optional(),
/** Other models for this variant (A/B a model against the recipe). A case can name its own (variantModels). */
models: PerEngine(z.array(z.string().min(1)).min(1)).optional(),
/** The engines this variant runs on (a partner model is a cloud model: on the others it would repeat another variant). */
diff --git a/src/lib/library.ts b/src/lib/library.ts
index 5e637bc0..ad46b555 100644
--- a/src/lib/library.ts
+++ b/src/lib/library.ts
@@ -124,11 +124,12 @@ export function listOrder(f: Pick<FeedFilter, "trashed" | "pinned">): (a: Genera
* Jobs nobody asked to see on their own: the steps a chain runs before its result (a Shorts cut, a
* Click to Ad voiceover, an Ad Multiplier hook: every "<studio>-step" feature), and helper jobs a
* studio starts by itself (a Mixed Media preview frame, a Faceless channel avatar or narrator sample,
- * a moodboard's cover). The Library and the home feed leave them out unless "Show steps" is on; a
- * list that names its features (a studio reading its own steps) gets what it asks for.
+ * a moodboard's cover), and the evaluation harness's runs (scripts/eval: hundreds of test renders). The
+ * Library and the home feed leave them out unless "Show steps" is on; a list that names its features
+ * (a studio reading its own steps) gets what it asks for.
*/
export const HELPER_SUFFIX = "-step";
-export const HELPER_FEATURES = ["mixed-media-preview", "faceless-avatar", "faceless-voice", "moodboard"] as const;
+export const HELPER_FEATURES = ["mixed-media-preview", "faceless-avatar", "faceless-voice", "moodboard", "eval"] as const;
export function isHelperFeature(feature: string): boolean {
return feature.endsWith(HELPER_SUFFIX) || (HELPER_FEATURES as readonly string[]).includes(feature);
diff --git a/tests/eval-harness.test.ts b/tests/eval-harness.test.ts
index cdfd3132..b0d5e4a2 100644
--- a/tests/eval-harness.test.ts
+++ b/tests/eval-harness.test.ts
@@ -43,6 +43,7 @@ const runner = (await import("../scripts/eval/lib/run.mjs")) as {
lorasMissing: (jobs: object[], installed: string[] | null) => { file: string; url?: string; jobs: number }[] | null;
trainingPrice: (target: { price?: string } | null) => number | null;
};
+const plan = (await import("../scripts/eval/lib/plan.mjs")) as { expandJobs: (suite: object, opts: object) => { request: Record<string, unknown> & { loras?: unknown[] } }[] };
const report = (await import("../scripts/eval/lib/report.mjs")) as { writeReport: (dir: string, root: string) => Record<string, unknown> };
const review = (await import("../scripts/eval/lib/review.mjs")) as {
writeReview: (run: object, opts?: object) => { pairs: number };
@@ -60,6 +61,7 @@ const ROUTES: [string, RegExp, (req: Request, m: RegExpExecArray) => Promise<Res
["GET", /^\/api\/models$/, (r) => models.GET(r)],
["POST", /^\/api\/generations$/, (r) => generations.POST(r)],
["GET", /^\/api\/generations\/([^/]+)$/, (r, m) => generation.GET(r, ctx({ id: m[1] }))],
+ ["DELETE", /^\/api\/generations\/([^/]+)$/, (r, m) => generation.DELETE(r, ctx({ id: m[1] }))],
["POST", /^\/api\/uploads$/, (r) => uploads.POST(r)],
["GET", /^\/api\/files\/(.+)$/, (r, m) => files.GET(r, ctx({ path: m[1].split("/").map(decodeURIComponent) }))],
["POST", /^\/api\/elements$/, (r) => elements.POST(r)],
@@ -308,6 +310,24 @@ describe("the runner on the demo provider", () => {
}
});
+ it("keeps its renders out of the Library, and trash moves a run's generations to the Trash", async () => {
+ const { listGenerations } = await import("@/server/generations");
+ const runDir = path.join(results, selftestRun);
+ const ids = [...new Set(store.readJsonl(path.join(runDir, "jobs.jsonl")).flatMap((r) => (r.generations as string[] | undefined) ?? []))];
+ expect(ids.length).toBeGreaterThanOrEqual(5);
+ // feature "eval" is a helper: the Library and Home feeds leave it out unless they ask for steps.
+ const listed = (o: object) => new Set(listGenerations({ limit: 1000, ...o }).map((g) => g.id));
+ expect(ids.filter((id) => listed({}).has(id))).toEqual([]);
+ expect(ids.filter((id) => listed({ steps: true }).has(id))).toEqual(ids);
+ const dry = await cli(["trash", selftestRun, "--dry-run"]);
+ expect(dry.stdout).toMatch(new RegExp(`${ids.length} generations of ${selftestRun} would go to the Trash on ${base.replace(/[.]/g, "\\.")}`));
+ const before = seen.filter((x) => x.startsWith("DELETE /api/generations/")).length;
+ const r = await cli(["trash", selftestRun]);
+ expect(r.code, r.stderr).toBe(0);
+ expect(r.stdout).toMatch(new RegExp(`Moved ${ids.length} generations of ${selftestRun} to the Trash`));
+ expect(seen.filter((x) => x.startsWith("DELETE /api/generations/")).length - before).toBe(ids.length);
+ });
+
it("resume runs only what isn't done", async () => {
const runDir = path.join(results, selftestRun);
const lines = fs.readFileSync(path.join(runDir, "jobs.jsonl"), "utf8").trim().split("\n");
@@ -607,6 +627,14 @@ describe("runEval as a library", () => {
expect(runner.lorasMissing(jobs, null)).toBeNull();
});
+ 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.loras).toBeUndefined();
+ expect(JSON.stringify(jobs[0].request)).not.toContain("464ea177-8d40-4940-8d9d-b438bab269c7");
+ });
+
it("expands, prices and lists a dry run without uploading anything", async () => {
const before = seen.filter((s) => s === "POST /api/uploads").length;
const suite = cases.loadSuite("dop");
diff --git a/tests/library-pure.test.ts b/tests/library-pure.test.ts
index c6494309..3a63bfb3 100644
--- a/tests/library-pure.test.ts
+++ b/tests/library-pure.test.ts
@@ -383,7 +383,7 @@ describe("round 4: helper steps, pins, review, nested folders, where a file is u
const ev = (g: Generation) => ({ type: "generation" as const, generation: g });
it("knows every helper feature the studios create, and nothing else", () => {
- for (const f of ["shorts-step", "mixed-media-step", "marketing-step", "click-to-ad-step", "ad-multiplier-step", "mixed-media-preview", "faceless-avatar", "faceless-voice", "moodboard"]) {
+ for (const f of ["shorts-step", "mixed-media-step", "marketing-step", "click-to-ad-step", "ad-multiplier-step", "mixed-media-preview", "faceless-avatar", "faceless-voice", "moodboard", "eval"]) {
expect(isHelperFeature(f), f).toBe(true);
}
for (const f of ["image", "shorts", "mixed-media", "marketing", "click-to-ad", "ad-multiplier", "dub", "katana", "faceless", "explainer", "storyboard", "storyboard-film", "upload", "app:app-step-up"]) {