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.
TypeScript ai-videocomfyuicreative-toolsgenerative-aiideogramimage-generationimage-to-3dimage-to-videoltx-videominimax-h3nextjsopen-sourceopen-weightsqwen-imagetext-to-imagevideo-generationwan
LoRAs: a licence is information; GPU-only LoRAs go to the cloud unless the admin keeps them home
Claudee1774ecfcff6
diff --git a/scripts/gen-lora-library.py b/scripts/gen-lora-library.pyindex 3d0119ab..7b5b5219 100644--- a/scripts/gen-lora-library.py+++ b/scripts/gen-lora-library.py@@ -11,12 +11,13 @@ Every file is pinned to exact bytes (scripts/fetch-lora-pins.py reads the pins othe Hugging Face commit the URL is rewritten to (resolve/<commit>/…), plus the file's SHA256 and size, whichthe downloader checks instead of trusting what the source serves that day.-Fails (exit 1) when an entry breaks the licence rules of the build plan:+Licences are information (the owner's decision of 2026-10-27; Settings → Models & licences has the switches):+a default that uses a non-commercial LoRA, or sends one licensed for the user's GPU only to the cloud, is+printed as a licence note, never a failure.++Fails (exit 1) when an entry's data is wrong:- a civitai entry without a pinned version id or a permission snapshot, or whose commercial / hostedOkflags disagree with its permissions (Image = outputs may be sold, Rent = may run on fal / Replicate);-- a LoRA a default uses with commercial: false (a Soul look a preset uses, or a motion / effect row whose- status makes it a default: add-lora, replace, relight-route, weak-candidate, local-only), or one such a row- sends to the cloud with hostedOk: false (only local-only rows keep a LoRA on the user's GPU);- a file without a SHA256 pin, or a Hugging Face file without a pinned commit;- two entries with the same local file name but different downloads (ComfyUI keys LoRAs on the name), or aname many unrelated LoRAs share (pytorch_lora_weights.safetensors, lora_weights_step_02000.safetensors…);@@ -41,8 +42,9 @@ HF_MAIN = re.compile(r"^(https://huggingface\.co/[^/]+/[^/]+/resolve/)main/(.+)$SHA256 = re.compile(r"^[0-9a-f]{64}$")COMMIT = re.compile(r"^[0-9a-f]{40}$")# Motion / effect statuses whose LoRAs become defaults (build plan O4: gen-oss-loras.py takes these rows).-DEFAULT_STATUSES = {"add-lora", "replace", "relight-route", "weak-candidate", "local-only"}+DEFAULT_STATUSES = {"add-lora", "replace", "relight-route", "weak-candidate", "local-only", "licence-hold"}errors = []+notes = []def slug(s):@@ -115,7 +117,7 @@ def entry(raw, key, group, checked=None, spare=False):if spare:out["spare"] = True- # Licence rules (build plan → "Licence rules for Originals" → enforced by tests).+ # The data's own rules (pins, file names, flags that match the permissions).if not SAFE_FILE.match(out["file"]) or "/" in out["file"] or ".." in out["file"]:errors.append(f"{where}: file {out['file']!r} is not a plain .safetensors name")if GENERIC_FILE.match(out["file"]):@@ -158,10 +160,10 @@ def add(e):for raw in DATA["loraLibrary"]:add(entry(raw, raw["key"], "look", spare=raw["key"] not in used))-# A look a Soul preset uses is a default on both engines: commercial and hostable (licence rules).+# A look a Soul preset uses runs on both engines: its licence is said, not enforced.for e in library:if not e.get("spare") and not (e["licence"]["commercial"] and e["licence"]["hostedOk"]):- errors.append(f"look {e['key']}: a preset uses it, but commercial={e['licence']['commercial']} hostedOk={e['licence']['hostedOk']}")+ notes.append(f"look {e['key']}: a preset uses it with commercial={e['licence']['commercial']} hostedOk={e['licence']['hostedOk']}")motions = []for m in DATA["motionsEffects"]:@@ -173,9 +175,9 @@ for m in DATA["motionsEffects"]:if m["status"] in DEFAULT_STATUSES:where = f"{m['kind']} {', '.join(m['presets'][:3])} ({m['status']}): {e['key']}"if not e["licence"]["commercial"]:- errors.append(f"{where} has commercial: false, so it can't be a default (use status licence-hold until the licence is clear)")- elif m["status"] != "local-only" and not e["licence"]["hostedOk"]:- errors.append(f"{where} has hostedOk: false, so it runs only on the user's GPU: use status local-only")+ notes.append(f"{where} is non-commercial")+ elif not e["licence"]["hostedOk"]:+ notes.append(f"{where} is licensed for the user's GPU only")row = {"kind": m["kind"], "presets": m["presets"], "status": m["status"], "loras": keys,"bothEnginesToday": bool(m.get("bothEnginesToday")), "newSinceMid2026": bool(m.get("newSinceMid2026"))}hosted = (m.get("hosted") or {}).get("endpoint")@@ -191,8 +193,10 @@ if dup:errors.append(f"duplicate keys: {dup}")if errors:- print("gen-lora-library: the research breaks the licence rules:\n " + "\n ".join(errors), file=sys.stderr)+ print("gen-lora-library: the research data is wrong:\n " + "\n ".join(errors), file=sys.stderr)sys.exit(1)+if notes:+ print("licence notes (information, shown in Settings → Models & licences):\n " + "\n ".join(dict.fromkeys(notes)))ts = ("// Generated by scripts/gen-lora-library.py from docs/research/fuobe-originals-recipes-5.json — do not edit by hand.\n"diff --git a/scripts/gen-oss-loras.py b/scripts/gen-oss-loras.pyindex 2ea608f4..0c6ba5c6 100644--- a/scripts/gen-oss-loras.py+++ b/scripts/gen-oss-loras.py@@ -17,10 +17,11 @@ Each LoRA carries its base (wan2.2-i2v-a14b high / low, wan2.1 on both experts,ltx-2.5-22b, qwen-image-edit-2509) and its licence flags (commercial: outputs may be sold; hostedOk: it mayrun on fal / Replicate). src/lib/catalog/dop.ts turns this into each preset's open and cloud routes.-Licence rules (build plan → "Licence rules for Originals"): a round-1 LoRA whose licence isn't a known-commercial-use licence (e.g. "unspecified (check card)") is left out of the map; a map v2 row that would make a-non-commercial LoRA a default, or send a hostedOk: false LoRA to the cloud outside a local-only row, fails the-generator (gen-lora-library.py checks the same rows).+Licences are information (the owner's decision of 2026-10-27; Settings → Models & licences has the switches): every+LoRA goes into the map with its licence as recorded. A round-1 LoRA whose licence isn't a known commercial-use+licence (e.g. "unspecified (check card)") is kept with commercial: false and its licence named; a map v2 row that+makes a non-commercial LoRA a default, sends a hostedOk: false LoRA to the cloud, or is on licence hold is listed+as a note, never a failure.Run: python3 scripts/gen-oss-loras.py"""@@ -35,14 +36,14 @@ RECIPES = json.loads((ROOT / "docs/research/fuobe-originals-recipes-5.json").rea# Licences that allow selling outputs and running the weights anywhere (the user's GPU, fal, Replicate).COMMERCIAL = {"Apache-2.0", "MIT", "CC0-1.0", "CreativeML OpenRAIL-M", "BigScience OpenRAIL-M"}-# Map v2 statuses whose LoRAs a preset uses by default (as in gen-lora-library.py).-DEFAULT_STATUSES = {"add-lora", "replace", "relight-route", "weak-candidate", "local-only"}+# Map v2 statuses whose LoRAs a preset uses by default (as in gen-lora-library.py). A licence on hold is information.+DEFAULT_STATUSES = {"add-lora", "replace", "relight-route", "weak-candidate", "local-only", "licence-hold"}# Wan 2.2 Fun Camera's poses (wan22-fun-camera-14b cameraMotion), LTX-2.3's camera_lora and LTX-2.5's camera_motion.FUN_POSES = {"Static", "Pan Up", "Pan Down", "Pan Left", "Pan Right", "Zoom In", "Zoom Out", "Anti Clockwise (ACW)", "ClockWise (CW)"}LTX_CAMERA = {"dolly_in", "dolly_out", "dolly_left", "dolly_right", "jib_up", "jib_down", "static"}LTX25_MOTION = LTX_CAMERA | {"focus_shift"}errors = []-skipped = []+notes = []def slug(s):@@ -53,14 +54,15 @@ def slug(s):# Round 1: Wan I2V LoRAs from comfyui-oss.json (bare slugs)round1 = {}-for l in ROUND1["loras"]:+# Commercial-use LoRAs first: one whose licence isn't recorded fills a preset nothing else covers, and never+# displaces one that is (the presets kept their LoRA when the gate became information; see the notes).+ROUND1_LORAS = sorted(ROUND1["loras"], key=lambda l: (l.get("license") or "").strip() not in COMMERCIAL)+for l in ROUND1_LORAS:base = l.get("baseModel", "")if l["type"] not in ("camera", "vfx") or not (base.startswith("wan2.1-i2v") or base.startswith("wan2.2-i2v")):continuelicence = (l.get("license") or "").strip()- if licence not in COMMERCIAL:- skipped.append(f"{l['name']} ({licence or 'no licence'})")- continue+ commercial = licence in COMMERCIALeq = l.get("higgsfieldEquivalent") or ""names = [re.sub(r"\(.*?\)", "", n).strip() for n in re.split(r"/|,", eq)]names = [n for n in names if n and n != "-"]@@ -79,13 +81,19 @@ for l in ROUND1["loras"]:"target": noise,**({"trigger": trigger} if trigger else {}),"base": base,- "licence": {"commercial": True, "hostedOk": not l.get("gated"), "snapshotDate": ROUND1["asOf"], "name": licence},+ "licence": {"commercial": commercial, "hostedOk": not l.get("gated"), "snapshotDate": ROUND1["asOf"], "name": licence or "not recorded"},}for n in names:key = slug(n)if not key:continuecur = round1.setdefault(key, [])+ if not commercial:+ if cur and not any(c["file"] == ref["file"] for c in cur):+ notes.append(f"{l['name']} (licence {licence or 'not recorded'}): {key} keeps {cur[0]['file']}; a candidate to compare")+ continue+ if not cur:+ notes.append(f"{l['name']}: licence {licence or 'not recorded'}, used for {key} as commercial: false")# Prefer native Wan 2.2 LoRAs over 2.1 ones for the same preset.if base.startswith("wan2.2") and cur and all(c["base"].startswith("wan2.1") for c in cur):cur.clear()@@ -107,9 +115,9 @@ def v2_lora(raw, where, status):if perms:licence["permissions"] = [p for p in (re.sub(r"\(.*?\)", "", x).strip() for x in perms.group(1).split(",")) if p]if not licence["commercial"]:- errors.append(f"{where}: {raw['name']} has commercial: false, so it can't be a default")- elif status != "local-only" and not licence["hostedOk"]:- errors.append(f"{where}: {raw['name']} has hostedOk: false outside a local-only row")+ notes.append(f"{where}: {raw['name']} is non-commercial")+ elif not licence["hostedOk"]:+ notes.append(f"{where}: {raw['name']} is licensed for the user's GPU only")base = raw.get("base") or ""target = raw.get("target") or ("both" if not base.startswith("wan2.2") else "high")out = {"file": raw["file"], "url": raw["url"], "strength": raw.get("strength", 1.0), "target": target}@@ -198,5 +206,5 @@ ts = ()(ROOT / "src/lib/catalog/oss-loras.generated.ts").write_text(ts, encoding="utf-8")print(f"wrote {len(v2)} map v2 presets + {len(round1)} round-1 keys and {len(recipes)} DoP recipes")-if skipped:- print(f"left out (licence not cleared for a default): {', '.join(skipped)}")+if notes:+ print("licence notes (information, shown in Settings → Models & licences):\n " + "\n ".join(dict.fromkeys(notes)))diff --git a/scripts/gen-soul-originals.py b/scripts/gen-soul-originals.pyindex 1fbe5519..e624a029 100644--- a/scripts/gen-soul-originals.py+++ b/scripts/gen-soul-originals.py@@ -16,9 +16,12 @@ evaluation harness measures (scripts/eval/lib/recipes.mjs). Higgsfield's style ianywhere. No Higgsfield description, prompt or preview is copied: the look sentence is the research's ownwording (the template), the categories are generic words.-Fails (exit 1) when the research breaks the licence rules of the build plan or the Soul recipe:-- a look's LoRA isn't in the LoRA library, or is non-commercial or may not run on a hosted service- (a default must be commercial-safe on both engines);+Licences are information (the owner's decision of 2026-10-27; Settings → Models & licences has the switches): a+look whose LoRA is non-commercial or licensed for the user's GPU only, or that the research marks not+commercial-safe, is printed as a licence note, never a failure.++Fails (exit 1) when the research breaks the Soul recipe:+- a look's LoRA isn't in the LoRA library;- a look lists more than 3 LoRAs (fal's Z-Image endpoint takes 3), or a LoRA for another base;- a template that isn't "{prompt}. <look>. <tail>", or triggers that aren't its LoRAs' triggers;- a grade that isn't a src/lib/grade.ts preset, a size off the 16-pixel grid or above 2048;@@ -49,6 +52,7 @@ BASE_LORAS = {"z-image": re.compile(r"^z-image"), "qwen-2512": re.compile(r"^qweOVERLAYS = {"date-stamp", "cctv", "photo-booth"}MAX_LORAS = 3errors = []+notes = []def slug(s):@@ -84,9 +88,9 @@ def lora_list(raw, where, base):errors.append(f"{where}: LoRA {key!r} is not in loraLibrary")continueif not e.get("commercial"):- errors.append(f"{where}: {key} is non-commercial, so it can't be a default")+ notes.append(f"{where}: {key} is non-commercial")if not e.get("hostedOk"):- errors.append(f"{where}: {key} may not run on a hosted service, so the cloud engine couldn't run this look")+ notes.append(f"{where}: {key} is licensed for the user's GPU only")if not BASE_LORAS[base].match(e.get("base") or ""):errors.append(f"{where}: {key} is a {e.get('base')} LoRA, not one for {base}")s = l.get("strength", e.get("strength"))@@ -196,7 +200,7 @@ for p in RECIPES["presets"]:if overlay and overlay not in OVERLAYS:errors.append(f"{where}: unknown overlay {overlay!r}")if p.get("commercialOk") is False or p.get("hostedOk") is False:- errors.append(f"{where}: the research marks it not commercial-safe on both engines")+ notes.append(f"{where}: the research marks it not commercial-safe on both engines")entry = {"id": f"{family}-{slug(meta['name'])}","name": clean(meta["name"]),@@ -232,6 +236,8 @@ if errors:for e in errors:print(f"error: {e}", file=sys.stderr)sys.exit(1)+for n in dict.fromkeys(notes):+ print(f"licence note (information, shown in Settings → Models & licences): {n}")def ts(v):diff --git a/src/lib/catalog/cinema.ts b/src/lib/catalog/cinema.tsindex 496cfd20..92fef899 100644--- a/src/lib/catalog/cinema.ts+++ b/src/lib/catalog/cinema.ts@@ -1135,9 +1135,10 @@ export type CinemaMoveRoute =/*** A camera move on Fuobe Cinema (research studios[cinema-studio].original.cameraLora). In the cloud: LTX-2.3's camera* LoRA where one fits, else (with a start frame) the move's Wan 2.2 LoRA on Fuobe DoP or a hosted model's own move, else- * words. On the user's GPU: the move's Wan 2.2 LoRA or a Fun Camera pose (with a start frame), else words. A LoRA whose- * licence keeps it on the GPU never goes to the cloud, and one that downloads from civitai goes only with a civitai key- * (`civitai: false`: none is set; the cloud run would stop at the download, so the move runs on its words).+ * words. On the user's GPU: the move's Wan 2.2 LoRA or a Fun Camera pose (with a start frame), else words. A LoRA licensed+ * for the GPU only goes to the cloud too unless the run marks it kept there (Settings → Models & licences), and one that+ * downloads from civitai goes only with a civitai key (`civitai: false`: none is set; the cloud run would stop at the+ * download, so the move runs on its words).*/export function cinemaMoveRoute(slug: string, engine: Engine, hasStartFrame: boolean, opts: { civitai?: boolean } = {}): CinemaMoveRoute {const move = moveBySlug(slug);diff --git a/src/lib/catalog/dop.ts b/src/lib/catalog/dop.tsindex a5d9817f..9cd877ab 100644--- a/src/lib/catalog/dop.ts+++ b/src/lib/catalog/dop.ts@@ -11,14 +11,15 @@* cloud runs the preset's words. Focus Change is LTX-2.5's own focus_shift move, hosted (LTX-2.5 Fast).* - Effects that are a grade (15) animate without a LoRA, then the grade is applied in the browser; the relight* effects (6) relight the start frame first (Qwen-Image-Edit 2509 + its Relight LoRA), then animate it.- * - A LoRA whose licence doesn't allow hosting (civitai "RentCivit") stays on the user's GPU: the cloud route leaves- * it out (and fitLoras would too, saying so).+ * - Licences are information: a LoRA licensed for the user's GPU only (civitai "RentCivit") goes to the cloud route+ * too, unless Settings → Models & licences keeps such LoRAs on the GPU (fitLoras then leaves it out, saying so); a+ * non-commercial LoRA or one whose licence the research holds is used and said in the preset's line.* - A preset with nothing of the Original's own in the cloud (no hostable LoRA, camera LoRA, hosted move, grade or* relight) keeps its partner route there, Kling 2.5 Turbo on the preset's words: Fuobe DoP on the words alone* becomes its cloud default only when the evaluation harness (scripts/eval, O8) promotes it. On the user's GPU it* is Fuobe DoP (Wan 2.2 on the words, as before).*/-import { libraryEntry, localOnly, loraName, loraRef, triggerOf } from "./loras";+import { gpuOnlyLicence, libraryEntry, loraName, loraRef, triggerOf } from "./loras";import { DOP_RECIPES, OSS_LORAS, type DopRecipe, type OssLora } from "./oss-loras.generated";import type { LoraRef, Operation, Preset, PresetRoute } from "./types";@@ -49,7 +50,11 @@ export function loraFamily(base: string): LoraFamily | undefined {return undefined;}-/** Statuses whose preset runs on its words alone (no cleared LoRA, a licence on hold, or a better route elsewhere). */+/**+ * Statuses whose preset runs on its words alone (no LoRA, or a better route elsewhere). A licence the research holds+ * ("licence-hold": BTS) is information now, and its LoRA is in the map with it; the preset keeps the words it ran on+ * until the evaluation harness measures the LoRA, so no default changes with the licence rule (a suggestion).+ */const WORDS_ONLY = new Set(["post-grade", "mixed-media-route", "licence-hold", "prompt-only", "train-own", "motion-library"]);/**@@ -186,11 +191,12 @@ export function dopPreset(p: Preset): Preset {};}- // In the cloud: LTX-2.5's own move, LTX-2.3's camera LoRA, the Wan or LTX LoRAs a host may run, a grade or a relight- // on Wan. A LoRA whose licence keeps it on the GPU never reaches the cloud route (its trigger stays out too).- // Anything else keeps its partner route on the preset's words until the evaluation harness promotes Fuobe DoP's.- const wanHosted = wan.filter((l) => !localOnly(l));- const ltxHosted = ltx.filter((l) => !localOnly(l));+ // In the cloud: LTX-2.5's own move, LTX-2.3's camera LoRA, the Wan or LTX LoRAs a host runs, a grade or a relight on+ // Wan. A LoRA licensed for the GPU only rides along on Fuobe DoP (said below; the admin can keep such LoRAs on the+ // GPU), but doesn't make Fuobe DoP the cloud default by itself: that preset keeps its partner route on the words+ // (Wiggle), like anything else, until the evaluation harness promotes Fuobe DoP's.+ const wanHosted = wan.some((l) => !gpuOnlyLicence(l)) ? wan : [];+ const ltxHosted = ltx.some((l) => !gpuOnlyLicence(l)) ? ltx : [];let cloud: PresetRoute;let cloudSays: string;if (recipe?.cameraMotion) {@@ -214,13 +220,22 @@ export function dopPreset(p: Preset): Preset {cloudSays = `the preset's words on a partner model until the evaluation harness measures Fuobe DoP on them${ltx25.length ? " (fal has no LTX-2.5 LoRA endpoint)" : ""}`;}- const local = [...wan, ...ltx].filter(localOnly);+ const local = [...wan, ...ltx].filter(gpuOnlyLicence);+ const used = [...wan, ...ltx, ...(open.modelId === LTX25_OPEN ? ltx25 : [])];+ const nonCommercial = used.filter((l) => (l.licence ?? libraryEntry(l)?.licence)?.commercial === false);+ const held = status === "licence-hold" ? presetLoras(p.id).map((l) => l.ref) : [];let parity: string;if (grade) parity = "Fuobe DoP animates your still without a LoRA, then your browser grades the clip";else if (extras.prestep) parity = "Fuobe DoP relights your still first (Qwen-Image-Edit 2509 + its Relight LoRA), then animates it";else if (status === "mixed-media-route") parity = `${p.parity ?? ""}${p.parity ? ". " : ""}For a whole clip restyled frame by frame, use Mixed Media`;else if (openSays === cloudSays) parity = `Fuobe DoP: ${openSays}, on your GPU and in the cloud`;else parity = `Fuobe DoP on your GPU: ${openSays}. In the cloud: ${cloudSays}`;- if (local.length) parity += `. ${names(local)} runs on your GPU only (its licence doesn't allow hosting), so the cloud runs the words`;+ if (local.length) {+ parity += cloud.modelId === DOP_MODEL || cloud.modelId === DOP_LTX_MODEL+ ? `. ${names(local)} is licensed for your GPU only (civitai lists no “Rent”): the cloud runs it too unless Settings → Models & licences keeps such LoRAs on your GPU`+ : `. ${names(local)} is licensed for your GPU only (civitai lists no “Rent”), so the cloud keeps the preset's partner route until Fuobe DoP with it is evaluated`;+ }+ if (nonCommercial.length) parity += `. ${names(nonCommercial)} is licensed for non-commercial use`;+ if (held.length) parity += `. ${names(held)} is in Fuobe's LoRA library, but the research holds its licence (its Hugging Face and civitai pages disagree), so the preset runs on its words until it is evaluated`;return { ...p, open, cloud, parity, ...extras };}diff --git a/src/lib/catalog/loras.ts b/src/lib/catalog/loras.tsindex 6f603a5b..514dbc0b 100644--- a/src/lib/catalog/loras.ts+++ b/src/lib/catalog/loras.ts@@ -1,8 +1,9 @@/*** LoRAs as part of a recipe, on both engines. Pure logic, no I/O:* - the researched library (lora-library.generated.ts) and how to turn an entry into a LoraRef;- * - what a cloud run may carry (the licence rules of the build plan: a LoRA whose licence doesn't allow- * hosting runs only on the user's GPU) and how many the route's API takes (fitLoras);+ * - what a cloud run may carry and how many the route's API takes (fitLoras). A LoRA whose licence allows the+ * user's GPU only is information: it goes to the cloud too, unless Settings → Models & licences keeps such LoRAs+ * on the GPU (the server marks the run's LoRAs `keepOnGpu`);* - the payload fields each API shape wants (loraFields) and when a route switches to its LoRA endpoint.* Downloads, mirrors and the civitai key live in src/server/loras.ts.*/@@ -107,11 +108,16 @@ export function cloudPath(l: LoraRef): string | undefined {export const gated = (l: Pick<LoraRef, "file" | "url">): boolean => libraryEntry(l)?.download === "hf-gated";/**- * Runs only on the user's GPU: its licence doesn't allow running it on fal or Replicate (civitai without- * "Rent"). The library's licence counts even when the ref carries none (or another): either one saying- * no keeps it off the cloud.+ * Its licence allows running it on the user's GPU only, not on fal or Replicate (civitai without "Rent"). The+ * library's licence counts even when the ref carries none (or another). Information: shown wherever it is used.*/-export const localOnly = (l: LoraRef): boolean => l.licence?.hostedOk === false || libraryEntry(l)?.licence.hostedOk === false;+export const gpuOnlyLicence = (l: LoraRef): boolean => l.licence?.hostedOk === false || libraryEntry(l)?.licence.hostedOk === false;++/**+ * Kept off the cloud: a GPU-only licence while Settings → Models & licences keeps such LoRAs on the user's GPU+ * (the server marks the run's LoRAs `keepOnGpu`). By default they are sent like any other LoRA.+ */+export const localOnly = (l: LoraRef): boolean => !!l.keepOnGpu && gpuOnlyLicence(l);/*** The first LoRA's trigger word as a prompt can lead with it: without the full stop its author wrote after it (the@@ -194,7 +200,8 @@ const list = (names: string[]) => (names.length < 2 ? names.join("") : `${names./*** The LoRAs a cloud run carries, and what it says about the ones it leaves out:- * - a LoRA whose licence doesn't allow hosting (civitai "RentCivit" only) runs only on the user's GPU;+ * - a LoRA licensed for the user's GPU only (civitai "RentCivit" only) is sent and said, unless Settings → Models &+ * licences keeps such LoRAs on the GPU (localOnly): then this run leaves it out;* - a gated Hugging Face LoRA (accept its licence first) runs only on the user's GPU;* - a LoRA that exists only as a file on the user's ComfyUI (an open-engine training) can't be sent;* - beyond the API's maximum (3 on Z-Image, Qwen, FLUX.2 [klein] and LTX-2.3 quality; one per expert on@@ -205,13 +212,15 @@ const list = (names: string[]) => (names.length < 2 ? names.join("") : `${names.export function fitLoras(loras: LoraRef[], route: Pick<ModelRoute, "provider" | "map" | "loraEndpoint">): { loras: LoraRef[]; notes: string[] } {if (!loras.length || route.provider === "comfyui" || route.provider === "mock") return { loras, notes: [] };const notes: string[] = [];- const local = loras.filter(localOnly);- if (local.length) notes.push(`${list(local.map(loraName))} ${local.length > 1 ? "run" : "runs"} only on your GPU (the licence doesn't allow hosting it), so this cloud run leaves ${local.length > 1 ? "them" : "it"} out`);+ const local = [...new Set(loras.filter(localOnly).map(loraName))];+ if (local.length) notes.push(`${list(local)} ${local.length > 1 ? "are" : "is"} licensed for your GPU only and Settings → Models & licences keeps such LoRAs off the cloud, so this run leaves ${local.length > 1 ? "them" : "it"} out`);const locked = loras.filter((l) => !localOnly(l) && !l.hostedUrl && gated(l));if (locked.length) notes.push(`${list(locked.map(loraName))} ${locked.length > 1 ? "are" : "is"} in a gated Hugging Face repo, so this cloud run leaves ${locked.length > 1 ? "them" : "it"} out (on your GPU ${locked.length > 1 ? "they run" : "it runs"} once you've accepted the licence)`);const unsent = loras.filter((l) => !localOnly(l) && !gated(l) && !sendable(l));if (unsent.length) notes.push(`${list(unsent.map(loraName))} ${unsent.length > 1 ? "exist" : "exists"} only on your ComfyUI, so this cloud run leaves ${unsent.length > 1 ? "them" : "it"} out`);const cloud = sendableToCloud(loras);+ const gpuOnly = [...new Set(cloud.filter(gpuOnlyLicence).map(loraName))];+ if (gpuOnly.length) notes.push(`${list(gpuOnly)}: ${gpuOnly.length > 1 ? "their licences allow your GPU only (civitai lists no “Rent”); they run" : "its licence allows your GPU only (civitai lists no “Rent”); it runs"} in the cloud because Settings → Models & licences lets such LoRAs go there`);const field = routeLoraField(route);if (!field) {if (cloud.length) notes.push(`This model takes no LoRAs in the cloud, so ${list(cloud.map(loraName))} ${cloud.length > 1 ? "are" : "is"} left out`);diff --git a/src/lib/catalog/oss-loras.generated.ts b/src/lib/catalog/oss-loras.generated.tsindex a5cc6f82..2270c386 100644--- a/src/lib/catalog/oss-loras.generated.ts+++ b/src/lib/catalog/oss-loras.generated.ts@@ -684,6 +684,22 @@ export const OSS_LORAS: Record<string, OssLora[]> = {}}],+ "motion-bts": [+ {+ "file": "BTSMovieSet_LTX25_v1.safetensors",+ "url": "https://huggingface.co/SOLRICKS/LTX-2.5-BTS-Movie-Set/resolve/main/BTSMovieSet_LTX25_v1.safetensors",+ "strength": 0.8,+ "target": "both",+ "trigger": "btssetstyle",+ "base": "ltx-2.5-22b",+ "licence": {+ "commercial": false,+ "hostedOk": false,+ "snapshotDate": "2026-10-23",+ "name": "HF card: LTX-2.x Community; civitai 2941912 lists RentCivit only"+ }+ }+ ],"motion-wiggle": [{"file": "civitai-2490836-wiggle-redmond.safetensors",diff --git a/src/server/loras.ts b/src/server/loras.tsindex 5fa4906a..4e91c1d8 100644--- a/src/server/loras.ts+++ b/src/server/loras.ts@@ -317,8 +317,10 @@ export async function ensureLorasOnComfy(loras: LoraRef[] | undefined, listed: s/*** Before a fal or Replicate run: every LoRA gets a URL the provider can fetch. Public files go as they are;- * a civitai file is mirrored once to the provider's storage (`upload`), when the model's civitai permissions- * still include "Rent" (running it on a third-party service), and the mirror is reused while it lives.+ * a civitai file is mirrored once to the provider's storage (`upload`) and the mirror is reused while it lives.+ * The civitai permissions are read before each copy and recorded with it (information). Only while Settings →+ * Models & licences keeps LoRAs licensed for your GPU only on the GPU (the run's LoRAs are marked `keepOnGpu`)+ * do they decide: no "Rent", or no answer, and the file isn't copied.*/export async function prepareCloudLoras(loras: LoraRef[] | undefined,@@ -332,8 +334,8 @@ export async function prepareCloudLoras(for (const l of loras) {const entry = libraryEntry(l);const name = loraName(l);- // The library's licence counts even when the ref carries none: a GPU-only file never reaches a provider.- if (localOnly(l)) throw new LoraError(`${name} runs only on your GPU (its licence doesn't allow hosting it)`);+ // Only while the admin keeps GPU-only LoRAs on the GPU (fitLoras has left it out of a cloud run already).+ if (localOnly(l)) throw new LoraError(`${name} is licensed for your GPU only, and Settings → Models & licences keeps such LoRAs off the cloud`);if (cloudPath(l)) {out.push(l);continue;@@ -345,13 +347,15 @@ export async function prepareCloudLoras(out.push({ ...l, hostedUrl: cached.hostedUrl });continue;}- // The hosting right is read again before a copy is made (civitai permissions can change). No answer, no copy.+ // The hosting right is read again before a copy is made (civitai permissions can change) and recorded with the copy.+ // It decides only while the admin keeps GPU-only LoRAs on the GPU: then no answer, or no "Rent", means no copy.const version = l.version ?? entry?.version ?? civitaiVersion(l.url);+ const strict = !!l.keepOnGpu;const modelId = entry?.civitaiModel ?? (version ? (await civitaiVersionFacts(version)).modelId : undefined);const now = modelId ? await civitaiPermissions(modelId) : null;- if (!now) throw new LoraError(`Couldn't confirm on civitai that ${name} may run on a hosted service, so it isn't copied to ${host}. Try again in a moment, or run it on your GPU`);- if (!now.includes("Rent")) {- throw new LoraError(`${name}'s civitai licence no longer allows running it on a hosted service, so it can only run on your GPU`);+ if (strict && !now) throw new LoraError(`Couldn't confirm on civitai that ${name} may run on a hosted service, so it isn't copied to ${host} (Settings → Models & licences keeps LoRAs licensed for your GPU only off the cloud). Try again in a moment, or run it on your GPU`);+ if (strict && !now!.includes("Rent")) {+ throw new LoraError(`${name}'s civitai licence no longer allows running it on a hosted service, and Settings → Models & licences keeps such LoRAs off the cloud, so it runs only on your GPU`);}// A copy already on this machine is used when its bytes are the pinned ones (a same-named file may be another LoRA).const local = [getSetting("comfyLorasDir"), LORA_CACHE_DIR]@@ -382,7 +386,7 @@ export async function prepareCloudLoras(hostedUrl,sha256: facts?.sha256 ?? crypto.createHash("sha256").update(data).digest("hex"),sizeBytes: data.length,- licence: licenceSnapshot(l, entry, now),+ licence: { ...licenceSnapshot(l, entry, now), ...(!now?.includes("Rent") && { hosting: "copied without civitai's “Rent” permission: Settings → Models & licences lets LoRAs licensed for your GPU only go to the cloud" }) },});out.push({ ...l, hostedUrl });}diff --git a/tests/cinema-original.test.ts b/tests/cinema-original.test.tsindex 3578fb61..fbdea0d6 100644--- a/tests/cinema-original.test.ts+++ b/tests/cinema-original.test.ts@@ -128,11 +128,14 @@ describe("Fuobe Cinema on both engines", () => {expect(body.loras).toBeUndefined();});- it("switches to the /lora endpoint when a LoRA rides along, and never sends a GPU-only LoRA", async () => {+ it("switches to the /lora endpoint when a LoRA rides along; a GPU-only LoRA stays home only when the admin keeps it there", async () => {const { url, body } = await submit(view("cloud"), fal("t2v"), { prompt: "x", duration: 5, resolution: "720p", aspectRatio: "16:9", loras: [LTX_LORA] });expect(url).toMatch(/\/fal-ai\/ltx-2\.3-22b\/text-to-video\/lora$/);expect(body.loras).toEqual([{ path: LTX_LORA.url, scale: 0.8 }]);- const local = { ...LTX_LORA, licence: { commercial: true, hostedOk: false, snapshotDate: "2026-10-26" } };+ const gpuOnly = { ...LTX_LORA, licence: { commercial: true, hostedOk: false, snapshotDate: "2026-10-26" } };+ const sent = await submit(view("cloud"), fal("t2v"), { prompt: "x", duration: 5, loras: [gpuOnly] });+ expect(sent.url).toMatch(/\/fal-ai\/ltx-2\.3-22b\/text-to-video\/lora$/);+ const local = { ...gpuOnly, keepOnGpu: true as const };const plain = await submit(view("cloud"), fal("t2v"), { prompt: "x", duration: 5, loras: [local] });expect(plain.url).toMatch(/\/fal-ai\/ltx-2\.3-22b\/text-to-video$/);expect(plain.body.loras).toBeUndefined();diff --git a/tests/dop-originals.test.ts b/tests/dop-originals.test.tsindex 1a3b0726..68dff219 100644--- a/tests/dop-originals.test.ts+++ b/tests/dop-originals.test.ts@@ -328,8 +328,8 @@ describe("review fixes", () => {expect(plan("cloud", { presetId: "motion-whip-pan" }, "fuobe-dop").model.id).toBe("fuobe-dop");});- it("never puts a local-only LoRA (or its trigger) on a cloud route, and prices Wiggle as what runs", () => {- for (const p of [...MOTIONS, ...EFFECTS]) for (const l of p.cloud?.loras ?? []) expect(l.licence?.hostedOk, `${p.id} ${l.file}`).not.toBe(false);+ it("says when a cloud route carries a LoRA licensed for the GPU only, and prices Wiggle as what runs", () => {+ for (const p of [...MOTIONS, ...EFFECTS]) if ((p.cloud?.loras ?? []).some((l) => l.licence?.hostedOk === false)) expect(p.parity, p.id).toMatch(/licensed for your GPU only/);const wiggle = getPreset("motion-wiggle")!;expect(wiggle.open!.loras!.every((l) => l.licence?.hostedOk === false)).toBe(true);expect(wiggle.cloud).toMatchObject({ modelId: "kling-2-5-turbo", partner: true });diff --git a/tests/fal-lora.test.ts b/tests/fal-lora.test.tsindex fd3693d5..c2d6c361 100644--- a/tests/fal-lora.test.ts+++ b/tests/fal-lora.test.ts@@ -83,18 +83,23 @@ describe("fal LoRA payloads (generated FieldMap.loras)", () => {expect((loraFields(r.map!.loras!, four).loras as unknown[]).length).toBe(3);});- it("drops LoRAs whose licence doesn't allow hosting and says so (they run only on the GPU)", () => {+ it("sends a LoRA licensed for the GPU only and says so; one kept on the GPU (the admin's switch) is dropped", () => {const r = route("wan-2-2-a14b-cloud", "i2v");const wiggle = loraRef(loraEntry("civitai-2490836-wiggle-redmond")!);expect(wiggle.licence?.hostedOk).toBe(false);const keep = hf("squish_18.safetensors", { target: "both" });- const fitted = fitLoras([wiggle, keep], r);- expect(fitted.loras).toEqual([keep]);- expect(fitted.notes[0]).toMatch(/^Wiggle Redmond runs only on your GPU/);+ const sent = fitLoras([wiggle, keep], r);+ expect(sent.loras).toEqual([wiggle, keep]);+ expect(sent.notes[0]).toMatch(/^Wiggle Redmond: its licence allows your GPU only/);+ expect(loraFields(r.map!.loras!, [{ ...wiggle, hostedUrl: "https://v3.fal.media/x" }])).toMatchObject({ loras: [{ path: "https://v3.fal.media/x" }] });+ // Settings → Models & licences keeps GPU-only LoRAs on the GPU: the run's LoRAs come marked.+ const kept = fitLoras([{ ...wiggle, keepOnGpu: true }, keep], r);+ expect(kept.loras).toEqual([keep]);+ expect(kept.notes[0]).toMatch(/^Wiggle Redmond is licensed for your GPU only and Settings → Models & licences keeps such LoRAs off the cloud/);// Defensively, the payload drops it too.- expect(loraFields(r.map!.loras!, [{ ...wiggle, hostedUrl: "https://v3.fal.media/x" }])).toEqual({});+ expect(loraFields(r.map!.loras!, [{ ...wiggle, keepOnGpu: true, hostedUrl: "https://v3.fal.media/x" }])).toEqual({});// The open engine carries every LoRA.- expect(fitLoras([wiggle, keep], { provider: "comfyui" }).loras).toHaveLength(2);+ expect(fitLoras([{ ...wiggle, keepOnGpu: true }, keep], { provider: "comfyui" }).loras).toHaveLength(2);});it("never sends a civitai URL (the user's key stays home): only its mirror", () => {@@ -118,8 +123,8 @@ describe("fal LoRA payloads (generated FieldMap.loras)", () => {// Prompt expansion would rewrite the prompt; 5 s at 24 fps = 121 frames (8n+1).expect(withOne.body.enable_prompt_expansion).toBe(false);expect(withOne.body.num_frames).toBe(121);- // No LoRA left (all local-only): the plain endpoint, never an empty required list.- const none = await submit(r, { prompt: "fly", images: ["https://x/a.png"], loras: [{ ...fpv, licence: { ...fpv.licence!, hostedOk: false } }] });+ // No LoRA left (all kept on the GPU by the admin's switch): the plain endpoint, never an empty required list.+ const none = await submit(r, { prompt: "fly", images: ["https://x/a.png"], loras: [{ ...fpv, keepOnGpu: true, licence: { ...fpv.licence!, hostedOk: false } }] });expect(none.url).toBe("https://queue.fal.run/fal-ai/ltx-2.3-22b/image-to-video");expect(none.body.loras).toBeUndefined();// A route that is only the /lora endpoint refuses to run without one.diff --git a/tests/lora-fetch.test.ts b/tests/lora-fetch.test.tsindex 1095cfb5..a81e7f76 100644--- a/tests/lora-fetch.test.ts+++ b/tests/lora-fetch.test.ts@@ -223,30 +223,43 @@ describe("Before a cloud run", () => {expect(up.sent).toHaveLength(1);});- it("won't mirror when civitai no longer allows hosting, or a local-only LoRA", async () => {+ it("mirrors a civitai file whose hosting permission is gone, recording what civitai says (licences are information)", async () => {setSetting("civitaiKey", KEY);net = network(civitaiRoutes(Y2K_BODY, { permissions: ["Image", "RentCivit"] }));const up = upload();- await expect(prepareCloudLoras([y2k], "fal", up.fn)).rejects.toThrow(/no longer allows running it on a hosted service/);+ const out = (await prepareCloudLoras([y2k], "fal", up.fn)) as LoraRef[];+ expect(out[0].hostedUrl).toBe("https://v3.fal.media/files/civitai-3422541-y2k.safetensors");+ const mirror = listLoraCopies().find((c) => c.target === "fal")!;+ expect(mirror.licence).toMatchObject({ permissionsNow: ["Image", "RentCivit"], hosting: expect.stringMatching(/without civitai's “Rent” permission: Settings → Models & licences/) });+ });++ it("goes back to civitai's hosting permission while Settings → Models & licences keeps GPU-only LoRAs on the GPU", async () => {+ setSetting("civitaiKey", KEY);+ net = network(civitaiRoutes(Y2K_BODY, { permissions: ["Image", "RentCivit"] }));+ const up = upload();+ await expect(prepareCloudLoras([{ ...y2k, keepOnGpu: true }], "fal", up.fn)).rejects.toThrow(/no longer allows running it on a hosted service, and Settings → Models & licences keeps such LoRAs off the cloud/);const wiggle = loraRef(loraEntry("civitai-2490836-wiggle-redmond")!);- await expect(prepareCloudLoras([wiggle], "replicate", up.fn)).rejects.toThrow(/runs only on your GPU/);+ await expect(prepareCloudLoras([{ ...wiggle, keepOnGpu: true }], "replicate", up.fn)).rejects.toThrow(/licensed for your GPU only, and Settings → Models & licences keeps such LoRAs off the cloud/);expect(up.sent).toEqual([]);});- it("keeps a GPU-only file off the cloud even when the ref carries no licence, and when civitai doesn't answer", async () => {+ it("sends a GPU-only LoRA to the cloud and says so, unless the run keeps such LoRAs on the GPU", async () => {setSetting("civitaiKey", KEY);const entry = loraEntry("civitai-2490836-wiggle-redmond")!;// Built by hand (no loraRef, so no licence): the library's licence still counts.const bare: LoraRef = { file: entry.file, url: entry.url, strength: 1 };- const fitted = fitLoras([bare], { provider: "fal", loraEndpoint: "fal-ai/wan/v2.2-a14b/image-to-video/lora" });- expect(fitted.loras).toEqual([]);- expect(fitted.notes[0]).toMatch(/^Wiggle Redmond runs only on your GPU/);- // Even with civitai's API down (nothing to re-read), it is never downloaded or copied.+ const route = { provider: "fal" as const, loraEndpoint: "fal-ai/wan/v2.2-a14b/image-to-video/lora" };+ const sent = fitLoras([bare], route);+ expect(sent.loras).toEqual([bare]);+ expect(sent.notes[0]).toMatch(/^Wiggle Redmond: its licence allows your GPU only \(civitai lists no “Rent”\); it runs in the cloud because Settings → Models & licences lets such LoRAs go there/);+ const kept = fitLoras([{ ...bare, keepOnGpu: true }], route);+ expect(kept.loras).toEqual([]);+ expect(kept.notes[0]).toMatch(/^Wiggle Redmond is licensed for your GPU only and Settings → Models & licences keeps such LoRAs off the cloud, so this run leaves it out/);+ // With civitai's API down (nothing to re-read), a kept file is never downloaded or copied, nor is a hostable one.net = network({ "https://civitai.com/api/": () => new Response("down", { status: 503 }) });const up = upload();- await expect(prepareCloudLoras([bare], "fal", up.fn)).rejects.toThrow(/runs only on your GPU/);- // A hostable civitai file isn't copied either while civitai can't confirm its permissions: no answer, no copy.- await expect(prepareCloudLoras([y2k], "fal", up.fn)).rejects.toThrow(/Couldn't confirm on civitai/);+ await expect(prepareCloudLoras([{ ...bare, keepOnGpu: true }], "fal", up.fn)).rejects.toThrow(/licensed for your GPU only/);+ await expect(prepareCloudLoras([{ ...y2k, keepOnGpu: true }], "fal", up.fn)).rejects.toThrow(/Couldn't confirm on civitai/);expect(up.sent).toEqual([]);expect(net.calls.filter((c) => c.url.includes("/api/download/"))).toEqual([]);});diff --git a/tests/lora-library.test.ts b/tests/lora-library.test.tsindex 06e7b804..0e0e3c03 100644--- a/tests/lora-library.test.ts+++ b/tests/lora-library.test.ts@@ -114,13 +114,18 @@ describe("LoRA library (lora-library.generated.ts)", () => {expect(loraRef(loraEntry("awportrait")!).strength).toBe(0.6);});- it("is what the generator writes (no hand edits) and the generator refuses what breaks the licence and pin rules", () => {+ it("is what the generator writes (no hand edits); the generator refuses broken pins and only notes licences", () => {const tmp = fs.mkdtempSync(path.join(os.tmpdir(), "fuobe-lora-gen-"));const research = () => JSON.parse(fs.readFileSync(path.join(ROOT, "docs/research/fuobe-originals-recipes-5.json"), "utf8"));const refuses = (data: unknown, why: RegExp) => {fs.writeFileSync(path.join(tmp, "docs/research/fuobe-originals-recipes-5.json"), JSON.stringify(data));expect(() => execFileSync("python3", [path.join(tmp, "scripts/gen-lora-library.py")], { stdio: "pipe" })).toThrow(why);};+ // Licences are information (Settings → Models & licences): the generator writes the library and prints a note.+ const notes = (data: unknown, what: RegExp) => {+ fs.writeFileSync(path.join(tmp, "docs/research/fuobe-originals-recipes-5.json"), JSON.stringify(data));+ expect(execFileSync("python3", [path.join(tmp, "scripts/gen-lora-library.py")], { stdio: "pipe" }).toString()).toMatch(what);+ };try {// A copy of the repo layout the script reads, with one civitai URL unpinned.fs.mkdirSync(path.join(tmp, "scripts"));@@ -135,14 +140,14 @@ describe("LoRA library (lora-library.generated.ts)", () => {let data = research();data.loraLibrary.find((l: Raw) => l.key === "y2k").url = "https://civitai.com/models/2979601";refuses(data, /pinned version/);- // A non-commercial LoRA made a default (BTS back to add-lora).+ // A non-commercial LoRA made a default (BTS back to add-lora): a note, not a failure.data = research();data.motionsEffects.find((m: Raw) => m.presets?.includes("BTS")).status = "add-lora";- refuses(data, /BTS \(add-lora\).*commercial: false/);- // A GPU-only (RentCivit) LoRA in a row that would send it to the cloud.+ notes(data, /licence notes \(information, shown in Settings → Models & licences\):[\s\S]*BTS \(add-lora\).*is non-commercial/);+ // A GPU-only (RentCivit) LoRA in a row that sends it to the cloud: a note too.data = research();data.motionsEffects.find((m: Raw) => m.presets?.includes("Wiggle")).status = "add-lora";- refuses(data, /hostedOk: false.*local-only/);+ notes(data, /Wiggle \(add-lora\).*licensed for the user's GPU only/);// A file without its SHA256 pin, and a Hugging Face file without its commit.data = research();delete data.loraLibrary.find((l: Raw) => l.key === "y2k").sha256;diff --git a/tests/oss-loras.test.ts b/tests/oss-loras.test.tsindex cc73a803..890efc32 100644--- a/tests/oss-loras.test.ts+++ b/tests/oss-loras.test.ts@@ -46,13 +46,17 @@ describe("the map v2", () => {}});- it("only makes commercial LoRAs defaults; a LoRA of unknown licence stays out", () => {- for (const loras of Object.values(OSS_LORAS)) for (const l of loras) expect(l.licence.commercial, l.file).toBe(true);- // wolfer45's Bullet Time LoRA has no licence on its card: round 1's Remade matrix-shot (Apache-2.0) runs instead.+ it("keeps every LoRA with its licence as information, without changing which LoRA a preset runs", () => {+ // Licences are information: a non-commercial LoRA is in the map with its licence named.+ const bts = OSS_LORAS["motion-bts"];+ expect(bts.map((l) => l.file)).toEqual(["BTSMovieSet_LTX25_v1.safetensors"]);+ expect(bts[0].licence).toMatchObject({ commercial: false, hostedOk: false });+ // wolfer45's Bullet Time LoRA has no licence on its card: it doesn't displace round 1's matrix-shot (Apache-2.0),+ // which the preset ran before (a candidate for the evaluation harness, not a default change).expect(OSS_LORAS["bullet-time"].map((l) => l.file)).toEqual(["matrix_shot.safetensors"]);- // BTS's licence is on hold: its preset runs its words.- expect(OSS_LORAS["motion-bts"]).toBeUndefined();+ // BTS's licence is on hold in the research: its preset keeps running its words until it is evaluated, and says why.expect(getPreset("motion-bts")!.open!.loras).toBeUndefined();+ expect(getPreset("motion-bts")!.parity).toMatch(/BTS Movie Set is in Fuobe's LoRA library, but the research holds its licence/);});it("knows each LoRA's family", () => {@@ -138,19 +142,23 @@ describe("every motion and effect on Fuobe DoP", () => {expect(thunder.cloud!.promptTemplate).toBe(thunder.open!.promptTemplate);});- it("keeps a local-only LoRA on the user's GPU: a cloud run leaves it out and says so", () => {+ it("sends a GPU-only LoRA to the cloud only when asked, and keeps the preset's partner route until it's evaluated", () => {const wiggle = getPreset("motion-wiggle")!;expect(wiggle.open!.loras).toHaveLength(2);- // The cloud route carries neither the LoRA nor its trigger: the words, on the partner model.+ // The cloud route stays the partner model on the words (the default it had), and says why.expect(wiggle.cloud).toMatchObject({ modelId: "kling-2-5-turbo", partner: true });expect(wiggle.cloud!.loras).toBeUndefined();expect(wiggle.cloud!.promptTemplate).toBeUndefined();- // Sent to fal anyway (a Mix, a hand-made request), fitLoras still leaves it out and says so.+ expect(wiggle.parity).toMatch(/licensed for your GPU only \(civitai lists no “Rent”\), so the cloud keeps the preset's partner route until Fuobe DoP with it is evaluated/);+ // Sent to fal (a Mix, a hand-made request), it goes and the run says what the licence says...const fal = getModel(DOP_MODEL)!.routes.find((r) => r.provider === "fal" && r.op === "i2v")!;- const fitted = fitLoras(wiggle.open!.loras ?? [], fal);- expect(fitted.loras).toEqual([]);- expect(fitted.notes.join(" ")).toMatch(/only on your GPU/);- expect(wiggle.parity).toMatch(/your GPU only/);+ const sent = fitLoras(wiggle.open!.loras ?? [], fal);+ expect(sent.loras).toHaveLength(2);+ expect(sent.notes.join(" ")).toMatch(/licence allows your GPU only/);+ // ...unless Settings → Models & licences keeps such LoRAs on the GPU.+ const kept = fitLoras((wiggle.open!.loras ?? []).map((l) => ({ ...l, keepOnGpu: true as const })), fal);+ expect(kept.loras).toEqual([]);+ expect(kept.notes.join(" ")).toMatch(/keeps such LoRAs off the cloud/);});it("grades the colour-grade effects and relights the relight effects first", () => {diff --git a/tests/replicate-lora.test.ts b/tests/replicate-lora.test.tsindex e267db48..3fd6fb78 100644--- a/tests/replicate-lora.test.ts+++ b/tests/replicate-lora.test.ts@@ -14,6 +14,7 @@ process.env.FUOBE_DATA_DIR = dir;const { replicateProvider } = await import("@/server/providers/replicate");const { setSetting } = await import("@/server/settings");const { chooseRoute, createGenerations, getGeneration, previewGeneration } = await import("@/server/generations");+const { changeAccess } = await import("@/server/model-access");afterAll(() => fs.rmSync(dir, { recursive: true, force: true }));async function submit(route: ModelRoute, input: GenInput): Promise<{ url: string; body: Record<string, unknown> }> {@@ -94,9 +95,11 @@ describe("Replicate LoRA payloads", () => {const mix = [...one, hf("effect_high.safetensors", { target: "high" })];expect(chooseRoute(routes, 1, one).route.provider).toBe("replicate");expect(chooseRoute(routes, 1, mix).route.provider).toBe("fal");- // Local-only LoRAs don't count: they never go to the cloud.+ // A LoRA licensed for the GPU only goes to the cloud like any other (licences are information)...const wiggle = loraRef(loraEntry("civitai-2490836-wiggle-redmond")!);- expect(chooseRoute(routes, 1, [...one, wiggle]).route.provider).toBe("replicate");+ expect(chooseRoute(routes, 1, [...one, wiggle]).route.provider).toBe("fal");+ // ...and doesn't count while Settings → Models & licences keeps such LoRAs on the GPU (the run marks them).+ expect(chooseRoute(routes, 1, [...one, { ...wiggle, keepOnGpu: true }]).route.provider).toBe("replicate");});it("wan-2.2 t2v fast: stays at 16 fps (interpolate_output off) and gets only values it takes", async () => {@@ -154,8 +157,14 @@ describe("Replicate LoRA payloads", () => {it("returns what a run leaves out with the generations it creates", async () => {setSetting("demoMode", "on");const wiggle = loraRef(loraEntry("civitai-2490836-wiggle-redmond")!);+ // Sent (the licence is information, said in the notes)...+ const [sent] = createGenerations({ feature: "image", modelId: "z-image-turbo-cloud", prompt: "a cat", loras: [wiggle] });+ expect(sent.notes).toEqual(["Wiggle Redmond: its licence allows your GPU only (civitai lists no “Rent”); it runs in the cloud because Settings → Models & licences lets such LoRAs go there"]);+ // ...or left out while the admin keeps LoRAs licensed for the GPU only there.+ changeAccess([{ kind: "keepGpuOnlyLoras", on: true }]);const [g] = createGenerations({ feature: "image", modelId: "z-image-turbo-cloud", prompt: "a cat", loras: [wiggle] });- expect(g.notes).toEqual(["Wiggle Redmond runs only on your GPU (the licence doesn't allow hosting it), so this cloud run leaves it out"]);+ changeAccess([{ kind: "reset" }]);+ expect(g.notes).toEqual(["Wiggle Redmond is licensed for your GPU only and Settings → Models & licences keeps such LoRAs off the cloud, so this run leaves it out"]);// Not stored: the run itself is an ordinary one.for (let i = 0; i < 200; i++) {const now = getGeneration(g.id) as Generation;diff --git a/tests/soul-originals.test.ts b/tests/soul-originals.test.tsindex 77f099b8..c9c199bf 100644--- a/tests/soul-originals.test.ts+++ b/tests/soul-originals.test.ts@@ -43,14 +43,14 @@ describe("Soul looks (soul-originals.generated.ts)", () => {}});- it("gives every look at most 3 LoRAs, each in the library and commercial-safe on both engines", () => {+ it("gives every look at most 3 LoRAs, each in the library with its licence recorded (information, not a rule)", () => {for (const l of SOUL_ORIGINALS) {expect(l.loras.length, l.id).toBeLessThanOrEqual(3);for (const x of l.loras) {const e = loraEntry(x.key);expect(e, `${l.id}: ${x.key}`).toBeDefined();- expect(e!.licence.commercial, `${l.id}: ${x.key}`).toBe(true);- expect(e!.licence.hostedOk, `${l.id}: ${x.key}`).toBe(true);+ expect(e!.licence.name, `${l.id}: ${x.key}`).toBeTruthy();+ expect(typeof e!.licence.commercial, `${l.id}: ${x.key}`).toBe("boolean");expect(x.strength).toBeGreaterThan(0);}}