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.

Image studios: studio model slices include the palette and style tools (work in progress from the verify pass)

Claude065157573d76
diff --git a/src/components/studio/catalog.tsx b/src/components/studio/catalog.tsx
index bb1a6a18..e9f803dd 100644
--- a/src/components/studio/catalog.tsx
+++ b/src/components/studio/catalog.tsx
@@ -73,7 +73,7 @@ export function CatalogProvider({ catalog, config, children }: { catalog?: Studi
const slice = catalog ?? lazy;
const value = useMemo<CatalogApi>(() => {
const models = slice?.models ?? [];
- const index = new Map(models.map((m) => [m.id, m]));
+ const index = new Map([...models, ...(slice?.lookup ?? [])].map((m) => [m.id, m]));
return {
ready: !!slice,
models,
diff --git a/src/lib/studio-catalog.ts b/src/lib/studio-catalog.ts
index b4b4eacc..6bd9c57a 100644
--- a/src/lib/studio-catalog.ts
+++ b/src/lib/studio-catalog.ts
@@ -11,6 +11,8 @@ import type { StudioConfig } from "@/components/studio/studio-context";
export interface StudioCatalog {
/** Models the composer can use or look up (picker list + defaults + the preset's own models). */
models: ModelDef[];
+ /** Models the composer only looks up, never lists (where a Color signature or Moodboard may route a request). */
+ lookup?: ModelDef[];
}
/** A model without its provider field maps (server-only detail). */
@@ -28,9 +30,15 @@ export function slimModel(m: ModelDef): ModelDef {
export function studioCatalog(config: Pick<StudioConfig, "kind" | "ops" | "pickerOps" | "defaultModels" | "preset" | "extraModels">): StudioCatalog {
const list = modelsFor({ kind: config.kind, ops: config.pickerOps ?? config.ops });
const ids = new Set(list.map((m) => m.id));
- const extra = [config.defaultModels.cloud, config.defaultModels.open, config.preset?.cloud?.modelId, config.preset?.open?.modelId, ...(config.extraModels ?? [])]
+ const extra = [config.defaultModels.cloud, config.defaultModels.open, config.preset?.cloud?.modelId, config.preset?.open?.modelId]
.filter((id): id is string => !!id && !ids.has(id))
.map((id) => getModel(id))
.filter((m): m is ModelDef => !!m);
- return { models: [...list, ...new Map(extra.map((m) => [m.id, m])).values()].map(slimModel) };
+ const models = [...list, ...new Map(extra.map((m) => [m.id, m])).values()];
+ const known = new Set(models.map((m) => m.id));
+ const lookup = [...new Set(config.extraModels ?? [])]
+ .filter((id) => !known.has(id))
+ .map((id) => getModel(id))
+ .filter((m): m is ModelDef => !!m);
+ return { models: models.map(slimModel), ...(lookup.length ? { lookup: lookup.map(slimModel) } : {}) };
}
diff --git a/tests/image-studios.test.ts b/tests/image-studios.test.ts
index d80cd07c..45f74c53 100644
--- a/tests/image-studios.test.ts
+++ b/tests/image-studios.test.ts
@@ -40,6 +40,7 @@ import {
randomPalettes,
rng,
samplePixels,
+ SIGNATURE_MODELS,
suggestName,
type MoodboardPick,
type PalettePick,
@@ -49,6 +50,8 @@ import {
import { buildPayload } from "@/lib/catalog/payload";
import { planGeneration } from "@/lib/catalog/plan";
import type { GenerationRequest } from "@/lib/catalog/types";
+import { studioCatalog } from "@/lib/studio-catalog";
+import { IMAGE_STUDIO } from "@/lib/studios";
import { collageGroups, colorFeature, coverCrop, imageProblem, moodboardError, moodboardStatus, representativeOrder } from "@/components/moodboards/logic";
// The caps GET /api/palettes sends (src/server/palettes.ts signatureCaps, checked against the catalog in image-studios-api.test.ts).
@@ -119,6 +122,16 @@ describe("palettes: k-means extraction", () => {
});
describe("palettes: routing per model", () => {
+ it("the Image studio can look up every model a signature routes to, without listing them in its picker", () => {
+ const slice = studioCatalog(IMAGE_STUDIO);
+ const listed = slice.models.map((m) => m.id);
+ const known = new Set([...listed, ...(slice.lookup ?? []).map((m) => m.id)]);
+ for (const id of Object.values(SIGNATURE_MODELS)) expect(known.has(id), id).toBe(true);
+ // Edit-only routing targets stay out of the picker list; their field maps stay on the server.
+ for (const id of ["recraft-4-style", "oss-style-qwen-edit", "recraft-4-style-saved"]) expect(listed, id).not.toContain(id);
+ expect((slice.lookup ?? []).every((m) => m.routes.every((r) => !r.map))).toBe(true);
+ });
+
const req = (modelId: string, extra: Partial<GenerationRequest> = {}): GenerationRequest => ({ feature: "image", modelId, prompt: "a lighthouse at dusk", params: { numOutputs: 1 }, ...extra });
it("sends the palette field to Recraft (≤10 colours, background in its own field) and Ideogram", () => {