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.

LoRAs: a GPU-only civitai LoRA needs the key on the cloud too; listings read the switches once

Claude45de278f85cb
diff --git a/src/server/loras.ts b/src/server/loras.ts
index 4e91c1d8..faa9ed3a 100644
--- a/src/server/loras.ts
+++ b/src/server/loras.ts
@@ -431,9 +431,9 @@ export function filesInLoraFolder(): { files: Set<string>; problem?: string } {
/**
* Before a Fuobe Soul run, without a civitai key: the civitai LoRAs it can't get, so the run goes ahead without
* them (the look's words still carry it) and says how to add them, instead of failing at the download. A LoRA is
- * still reachable when ComfyUI's LoRA folder already has it (open engine) or a live mirror exists (cloud). A
- * local-only LoRA (civitai's RentCivit-only licence) counts on the open engine; a cloud run never carries it
- * (fitLoras leaves it out and says so).
+ * still reachable when ComfyUI's LoRA folder already has it (open engine) or a live mirror exists (cloud). A LoRA
+ * licensed for the GPU only counts on both engines, unless the admin keeps such LoRAs on the GPU: then a cloud run
+ * never carries it (fitLoras leaves it out and says so).
*/
export function withoutUnreachableCivitai(loras: LoraRef[], target: MirrorTarget): { loras: LoraRef[]; notes: string[] } {
const civitai = loras.filter((l) => !l.hostedUrl && needsToken(l.url) && (target === "comfyui" || !localOnly(l)));
diff --git a/src/server/model-access.ts b/src/server/model-access.ts
index 5f23d782..ce55b072 100644
--- a/src/server/model-access.ts
+++ b/src/server/model-access.ts
@@ -123,7 +123,8 @@ export function offeredModel(m: ModelDef): ModelDef | undefined {
/** Listings (the API, Assist, MCP, the CLI): only what is on, each model with the routes that are on. */
export function offeredModels(list: ModelDef[]): ModelDef[] {
- return list.flatMap((m) => offeredModel(m) ?? []);
+ const access = readAccess();
+ return list.flatMap((m) => gateModel(m, access, factsOf) ?? []);
}
/** Why a model is off, as the refusal names it ("…turned off in Settings → Models & licences (fal.ai is switched off)"). */
diff --git a/tests/soul-fixes.test.ts b/tests/soul-fixes.test.ts
index 4f87063f..fd51e952 100644
--- a/tests/soul-fixes.test.ts
+++ b/tests/soul-fixes.test.ts
@@ -222,8 +222,11 @@ describe("civitai LoRAs without a key", () => {
try {
const rent: LoraRef = { file: "rent-only.safetensors", url: "https://civitai.com/api/download/models/999", strength: 1, licence: { commercial: true, hostedOk: false } as LoraRef["licence"] };
expect(withoutUnreachableCivitai([rent], "comfyui").loras).toEqual([]);
- // On the cloud it was never sent (fitLoras leaves it out and says so), so it isn't listed twice.
- expect(withoutUnreachableCivitai([rent], "fal")).toEqual({ loras: [rent], notes: [] });
+ // On the cloud it goes like any LoRA (its licence is information), so without a key it's unreachable there too...
+ expect(withoutUnreachableCivitai([rent], "fal").loras).toEqual([]);
+ // ...unless the admin keeps such LoRAs on the GPU: then fitLoras leaves it out and says so, so it isn't listed twice.
+ const kept = { ...rent, keepOnGpu: true as const };
+ expect(withoutUnreachableCivitai([kept], "fal")).toEqual({ loras: [kept], notes: [] });
} finally {
setSetting("comfyLorasDir", "");
}