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: fixes from a live dry run of the 139 Soul looks

Claudefe271bf5eece
diff --git a/scripts/eval/lib/run.mjs b/scripts/eval/lib/run.mjs
index cb1c6a4d..c68855d9 100644
--- a/scripts/eval/lib/run.mjs
+++ b/scripts/eval/lib/run.mjs
@@ -135,7 +135,12 @@ export async function runEval(opts, io) {
const p = await price(client, job, inputs, { engine, runId: runId ?? "dry-run" });
job.preview = p;
if (engine === "demo" && !p.demo) job.skip = `would run for real on ${p.providerId}: turn on Settings → Demo mode for a free self-test`;
- else if (engine !== "demo" && p.demo) job.skip = `would run as a demo: ${p.modelName ?? job.model.id} has no ${engine === "open" ? "ComfyUI" : "cloud provider"} connected on that Fuobe`;
+ else if (engine !== "demo" && p.demo) {
+ job.skip =
+ facts.demoMode === "on"
+ ? "would run as a demo: Demo mode is On on that Fuobe (set Settings → Demo mode to Auto or Off to measure real models)"
+ : `would run as a demo: ${p.modelName ?? job.model.id} has no ${engine === "open" ? "ComfyUI" : "cloud provider"} connected on that Fuobe`;
+ }
else if (engine !== "demo" && p.engine && p.engine !== engine) job.skip = `${p.modelName ?? job.model.id} is ${p.engine === "open" ? "an open-source" : "a cloud"} model, not ${engine}`;
else priced.push(job);
} catch (e) {
diff --git a/scripts/eval/metrics/fuobe_metrics/score.py b/scripts/eval/metrics/fuobe_metrics/score.py
index 43f178eb..11b8ee7a 100644
--- a/scripts/eval/metrics/fuobe_metrics/score.py
+++ b/scripts/eval/metrics/fuobe_metrics/score.py
@@ -307,6 +307,10 @@ def main(argv=None) -> int:
continue
outs = media_outputs(run_dir, job)
row: dict = {"_fp": fp}
+ if wanted and old:
+ # --metrics re-scores those families only: the job's other scores stay.
+ redo = {k for f in wanted for k in FAMILIES.get(f, [])} | {f"_{f}Refs" for f in wanted}
+ row.update({k: v for k, v in old.items() if k not in redo and k not in {"_fp", "_notes"}})
notes = []
for fam in fams:
if fam in scorer.skipped:
diff --git a/scripts/eval/metrics/tests/test_media_and_models.py b/scripts/eval/metrics/tests/test_media_and_models.py
index 0544dacb..8ce9ae2c 100644
--- a/scripts/eval/metrics/tests/test_media_and_models.py
+++ b/scripts/eval/metrics/tests/test_media_and_models.py
@@ -78,6 +78,12 @@ def test_score_cli_on_a_run_without_models(tmp_path):
doc = json.loads((run / "metrics.json").read_text())
assert doc["version"] == 1 and "j1" in doc["jobs"] and doc["groups"] == {}
assert main([str(run), "--metrics", "smell"]) == 2
+ # Re-scoring some families keeps the job's other scores.
+ doc["jobs"]["j1"].update({"_fp": "older", "clip": 30.5, "drift": 0.01})
+ (run / "metrics.json").write_text(json.dumps(doc))
+ assert main([str(run), "--metrics", "continuity"]) == 0
+ kept = json.loads((run / "metrics.json").read_text())["jobs"]["j1"]
+ assert kept["clip"] == 30.5 and kept["drift"] == 0.01 and kept["_fp"] != "older"
def _weights_cached(key):
diff --git a/src/app/api/generations/route.ts b/src/app/api/generations/route.ts
index 5ad9e4c2..8b64ad8b 100644
--- a/src/app/api/generations/route.ts
+++ b/src/app/api/generations/route.ts
@@ -92,7 +92,8 @@ const RequestSchema = z.object({
.string()
.min(1)
.max(200)
- .regex(/^[\w ()+,.@-]+(\/[\w ()+,.@-]+)*$/, "a file name in ComfyUI's models/loras")
+ // Brackets too: Redmond's Z-Image LoRAs are called "[ZImage.Turbo]FilmStill_Redmond.safetensors".
+ .regex(/^[\w ()[\]+,.@-]+(\/[\w ()[\]+,.@-]+)*$/, "a file name in ComfyUI's models/loras")
.refine((f) => !f.split("/").includes(".."), "a file name in ComfyUI's models/loras"),
url: z.string().max(2000).regex(/^https:\/\//, "an https:// link").optional(),
strength: z.number().min(-4).max(4).optional(),
diff --git a/tests/eval-api.test.ts b/tests/eval-api.test.ts
index 53a92250..57c14d0a 100644
--- a/tests/eval-api.test.ts
+++ b/tests/eval-api.test.ts
@@ -29,6 +29,9 @@ describe("POST /api/generations with a recipe's LoRAs", () => {
{ file: "AWPortrait-Z.safetensors", url: "https://huggingface.co/Shakker-Labs/AWPortrait-Z/resolve/main/AWPortrait-Z.safetensors", strength: 0.6 },
{ file: "civitai-2463391-hardflash.safetensors", strength: 0.7, trigger: "hardflashy" },
{ file: "wan/camera-overhead-high.safetensors", strength: 1, target: "high" },
+ // Every file name the research uses (brackets, spaces, parentheses).
+ { file: "[ZImage.Turbo]FilmStill_Redmond.safetensors", strength: 0.8 },
+ { file: "zimageturbo_Sunbleach_Photograph_Style_Lora_TAV2_000002500_(recommended).safetensors", strength: 0.7 },
];
expect((await post({ ...soul, loras })).status).toBe(200);
const made = await post({ ...soul, loras }, false);
@@ -53,6 +56,17 @@ describe("POST /api/generations with a recipe's LoRAs", () => {
}
expect((await post({ ...soul, loras: Array.from({ length: 9 }, (_, i) => ({ file: `l${i}.safetensors` })) })).status).toBe(400);
});
+
+ it("takes every LoRA file name in the research (the harness sends them as they are)", async () => {
+ const research = JSON.parse(fs.readFileSync(path.join(process.cwd(), "docs/research/fuobe-originals-recipes-5.json"), "utf8"));
+ type L = { file?: string };
+ const files = [...new Set<string>([...research.presets, ...research.motionsEffects].flatMap((e: { loras?: L[] }) => (e.loras ?? []).map((l) => l.file ?? "")).filter(Boolean))];
+ expect(files.length).toBeGreaterThan(50);
+ for (let i = 0; i < files.length; i += 8) {
+ const r = await post({ ...soul, loras: files.slice(i, i + 8).map((file) => ({ file })) });
+ expect(r.status, `${r.body.error} (${files.slice(i, i + 8).join(", ")})`).toBe(200);
+ }
+ });
});
describe("planGeneration with request LoRAs", () => {
diff --git a/tests/eval-harness.test.ts b/tests/eval-harness.test.ts
index 3b0d0f44..f7525214 100644
--- a/tests/eval-harness.test.ts
+++ b/tests/eval-harness.test.ts
@@ -224,7 +224,14 @@ describe("the runner on the demo provider", () => {
it("refuses an engine the server can't run, and skips jobs that would run as a demo on a real engine", async () => {
const dry = await cli(["run", "--suite", "soul", "--engine", "cloud", "--looks", "v1-general", "--dry-run"]);
expect(dry.code, dry.stderr).toBe(0);
- expect(dry.stdout).toMatch(/would run as a demo/);
+ expect(dry.stdout).toMatch(/would run as a demo: Z-Image Turbo \(hosted\) has no cloud provider connected/);
+ // With Demo mode On, that is the reason given (a connected engine wouldn't help).
+ setSetting("demoMode", "on");
+ try {
+ expect((await cli(["run", "--suite", "soul", "--engine", "open", "--looks", "v1-general", "--dry-run"])).stdout).toMatch(/Demo mode is On on that Fuobe/);
+ } finally {
+ setSetting("demoMode", "auto");
+ }
setSetting("engineMode", "open");
try {
const r = await cli(["run", "--suite", "soul", "--engine", "cloud", "--looks", "v1-general"]);