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.

No Higgsfield (O7): a past run on a retired model keeps its name in the Library

Claude9310960138ad
diff --git a/src/server/generations.ts b/src/server/generations.ts
index b9b287c0..be07b970 100644
--- a/src/server/generations.ts
+++ b/src/server/generations.ts
@@ -4,6 +4,7 @@ import path from "node:path";
import { nanoid } from "nanoid";
import { getModel, getPreset } from "@/lib/catalog";
import { applyMentions } from "@/lib/catalog/elements";
+import { replacedBy } from "@/lib/catalog/replaced";
import { withSignatureWords } from "@/lib/catalog/palettes";
import { applySketch, stripMotionPaths } from "@/lib/catalog/sketch";
import { cueText, type Cue } from "@/lib/cues";
@@ -127,7 +128,8 @@ export function toGeneration(r: Row): Generation {
createdAt: r.created_at,
updatedAt: r.updated_at,
completedAt: r.completed_at,
- modelName: model?.name ?? r.model_id,
+ // A run on a model Fuobe retired keeps the name it ran under (replaced.ts `was`); Reuse moves it to the replacement.
+ modelName: model?.name ?? replacedBy(r.model_id)?.was ?? r.model_id,
// A Fuobe Soul look is named like a preset ("Look · Y2K" in the viewer).
presetName: r.preset_id ? (getPreset(r.preset_id)?.name ?? (soulKind(r.model_id) ? (soulLook(r.preset_id)?.name ?? null) : null)) : null,
aspectRatio: ar && ar !== "auto" ? ar : null,
diff --git a/tests/no-higgsfield.test.ts b/tests/no-higgsfield.test.ts
index 914a28e1..6bd83b1e 100644
--- a/tests/no-higgsfield.test.ts
+++ b/tests/no-higgsfield.test.ts
@@ -26,6 +26,7 @@ const { SETTINGS, getSetting } = await import("@/server/settings");
const { db } = await import("@/server/db");
const { withCurrentModels } = await import("@/lib/catalog/canvas");
const generationsRoute = await import("@/app/api/generations/route");
+const { getGeneration, listGenerations } = await import("@/server/generations");
afterAll(() => fs.rmSync(dir, { recursive: true, force: true }));
@@ -217,6 +218,22 @@ describe("stored ids resolve where they are read", () => {
expect(body.notes?.[0]).toMatch(/Fuobe Soul/);
});
+ it("keeps a past run on a retired model in the Library, named as it ran, with its outputs", async () => {
+ const res = await generationsRoute.POST(
+ new Request("http://x/api/generations", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ feature: "image", modelId: "fuobe-soul", prompt: "an old portrait" }) }),
+ );
+ const { items } = (await res.json()) as { items: { id: string }[] };
+ const id = items[0].id;
+ // As a row stored before the switch reads: the retired model and provider, a finished output.
+ db()
+ .prepare("UPDATE generations SET model_id = 'soul-2', provider = 'higgsfield', status = 'succeeded', outputs_json = ? WHERE id = ?")
+ .run(JSON.stringify([{ url: "/api/files/old.png", kind: "image" }]), id);
+ const g = getGeneration(id)!;
+ expect(g).toMatchObject({ modelId: "soul-2", modelName: REPLACED_BY["soul-2"].was, status: "succeeded" });
+ expect(g.outputs).toHaveLength(1);
+ expect(listGenerations({ feature: "image" }).map((x) => x.id)).toContain(id);
+ });
+
it("moves a saved Canvas node on a retired model to its replacement, in the cloud", () => {
const graph = {
nodes: [