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.

⌘K: a switched-off model opens Models & licences instead of disappearing

Claude296bd3ed5740
diff --git a/src/lib/command-search.ts b/src/lib/command-search.ts
index 23fde64a..876f012d 100644
--- a/src/lib/command-search.ts
+++ b/src/lib/command-search.ts
@@ -191,9 +191,12 @@ export function indexEntries(index: PaletteIndex, mode: "both" | "cloud" | "open
...presets(index.motions, "motion", (id) => `/video?preset=${id}`),
...presets(index.effects, "effect", (id) => `/video?preset=${id}`),
...index.models
- // Settings → Models & licences: a model switched off isn't offered here either.
- .filter((m) => (mode === "both" || (m.engines ?? [m.engine]).includes(mode)) && offered(access, m.id, mode === "both" ? undefined : mode))
+ .filter((m) => mode === "both" || (m.engines ?? [m.engine]).includes(mode))
.map((m): PaletteEntry => {
+ // Settings → Models & licences: a model switched off opens the switches, not a studio that would refuse it.
+ if (!offered(access, m.id, mode === "both" ? undefined : mode)) {
+ return { key: `model:${m.id}`, kind: "model", label: m.name, hint: `${m.vendor} · turned off in Models & licences`, href: "/settings/models", keywords: `${m.ops} turned off licence` };
+ }
const both = (m.engines?.length ?? 0) > 1;
return {
key: `model:${m.id}`,
diff --git a/tests/model-access-listings.test.ts b/tests/model-access-listings.test.ts
index bebb53d0..0a2ae694 100644
--- a/tests/model-access-listings.test.ts
+++ b/tests/model-access-listings.test.ts
@@ -75,11 +75,11 @@ describe("Models & licences in listings and picks", () => {
expect(plan()).not.toBe("nano-banana-pro");
});
- it("leaves switched-off models out of the ⌘K palette", () => {
+ it("sends a switched-off model in the ⌘K palette to Models & licences instead of its studio", () => {
const index = paletteIndex();
- const has = (access?: { off: string[] }) => indexEntries(index, "both", access).some((e) => e.key === "model:nano-banana-pro");
- expect(has()).toBe(true);
- expect(has({ off: ["nano-banana-pro"] })).toBe(false);
+ const entry = (access?: { off: string[] }) => indexEntries(index, "both", access).find((e) => e.key === "model:nano-banana-pro")!;
+ expect(entry().href).not.toBe("/settings/models");
+ expect(entry({ off: ["nano-banana-pro"] })).toMatchObject({ href: "/settings/models", hint: "Google · turned off in Models & licences" });
});
it("refuses a model that is off through the API, naming the switch", async () => {