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.

Merge branch 'claude/fuobe-parity-4' into o/genjutsu-original

Claudee036070dd5aa
diff --cc src/components/genjutsu/genjutsu-studio.tsx
index aa5c23ad,1ba05df8..c576cd20
--- a/src/components/genjutsu/genjutsu-studio.tsx
+++ b/src/components/genjutsu/genjutsu-studio.tsx
@@@ -22,8 -21,7 +22,8 @@@ import { fileToList, MediaSlot, type Sl
import { radioKeys, radioTab } from "@/components/studio/radio-keys";
import { SketchEditor, type Stroke } from "@/components/studio/sketch-editor";
import { VideoTrimmer, type TrimRange, type VideoTrimmerHandle } from "@/components/studio/video-trimmer";
- import { useEngine, useGenerations } from "@/lib/api";
-import { useEngine, useGenerations, useModelAccess, useStatus } from "@/lib/api";
++import { useEngine, useGenerations, useModelAccess } from "@/lib/api";
+import { CHARACTER_SWAP, cutsInPart, cutWarning, seedProblem, type CharacterOptions, type CharacterQuality } from "@/lib/catalog/character-swap";
import {
chooseMaker,
decodeSetup,
@@@ -49,8 -45,8 +49,9 @@@
import { chainState } from "@/lib/catalog/shorts";
import type { PixelPoint } from "@/lib/catalog/types";
import { downloadHref, downloadName } from "@/lib/library";
+ import { keepOffered, offered } from "@/lib/model-access";
import { cn } from "@/lib/utils";
+import { CharacterControls, CharacterFacts } from "./character-panel";
import { useGenjutsuEstimate, useGenjutsuRun, type GenjutsuBody } from "./hooks";
import { LookPicker, type LookSource } from "./look-picker";
import { SetupCode } from "./setup-code";
@@@ -91,6 -82,9 +92,7 @@@ const seedOf = (s: string): number | un
*/
export function GenjutsuStudio() {
const [engine, setEngine, engineMode] = useEngine();
+ const access = useModelAccess();
- const status = useStatus().data;
- const higgsfield = !!status?.providers.higgsfield?.configured;
const [mode, setModeState] = useState<GenjutsuMode>("motion");
const source = useSourceClip(GENJUTSU.maxBytes);
const clip = source.clip;
@@@ -154,23 -136,19 +156,25 @@@
? undefined
: lookSource === "custom"
? { kind: "custom", images: ready(custom), ...(words.trim() ? { words: words.trim() } : {}) }
- : look && look.kind === (lookSource === "fuobe" ? "preset" : "higgsfield")
+ : look && look.kind === (lookSource === "fuobe" ? "preset" : "soul")
? look
: undefined;
- const lookKind = mode === "restyle" ? (lookSource === "higgsfield" ? "higgsfield" : "fuobe") : "";
+ const lookKind = mode === "restyle" ? lookSource : "";
const choiceKey = `${engine}:${mode}:${target ?? ""}:${lookKind}`;
- const choice = chooseMaker({ engine, mode, target, tier, look: effLook ?? (mode === "restyle" ? lookPlaceholder(lookSource) : undefined), modelId: picked[choiceKey] });
+ // Models switched off in Settings → Models & licences leave the list, and the pick falls back to one that is on.
+ const isOn = (id: string) => offered(access, id, engine);
- const choice = chooseMaker({ engine, mode, target, tier, look: effLook ?? (mode === "restyle" ? lookPlaceholder(lookSource) : undefined), modelId: picked[choiceKey], higgsfield, offered: isOn });
++ const choice = chooseMaker({ engine, mode, target, tier, look: effLook ?? (mode === "restyle" ? lookPlaceholder(lookSource) : undefined), modelId: picked[choiceKey], offered: isOn });
const maker: Maker | null = "maker" in choice ? choice.maker : null;
- const options = makersFor(engine, mode, target);
- const options = keepOffered(makersFor(engine, mode, target, effLook ?? (mode === "restyle" ? lookPlaceholder(lookSource) : undefined)), (m) => isOn(m.id));
- const references = mode === "restyle" && lookSource !== "higgsfield" ? [] : ready(refs);
- const showRefs = mode !== "restyle" || lookSource === "higgsfield";
- const needsFrame = (mode === "swap" && (target === "click" || target === "paint")) || (mode === "insert" && target === "paint");
++ const options = keepOffered(makersFor(engine, mode, target), (m) => isOn(m.id));
+ const references = mode === "restyle" ? [] : ready(refs);
+ const showRefs = mode !== "restyle";
+ const maxRefs = isCharacter ? Math.max(1, maker?.refs.max ?? 1) : GENJUTSU.maxReferences;
+ const needsFrame = ((mode === "swap" || isCharacter) && target === "click") || ((mode === "swap" || mode === "insert") && target === "paint");
+ // Character swap: the clip's hard cuts (found in the browser), for the "one continuous shot" warning.
+ const cuts = useClipCuts(clip?.preview, isCharacter && !!clip && !clip.error);
+ const partCuts = isCharacter && range ? cutsInPart(cuts ?? undefined, { start: range.startTime, end: range.endTime }) : [];
+ const cut = cutWarning(partCuts);
+ const seedNumber = seedOf(seed);
// The selection's first frame, grabbed by the browser: what points and paint are made on.
const startAt = range ? Math.round(range.startTime * 100) / 100 : null;
diff --cc src/lib/catalog/genjutsu.ts
index 31a83a6c,aa6029d7..73e70ab1
--- a/src/lib/catalog/genjutsu.ts
+++ b/src/lib/catalog/genjutsu.ts
@@@ -1,39 -1,19 +1,40 @@@
/**
- * Genjutsu (Higgsfield's /genjutsu): keep a clip's motion, camera and framing, change what is in it. Four modes:
- * Motion transfer (your character does what the clip's person does), Object swap (a thing, a person or an outfit in
- * the clip becomes your reference), Restyle (every frame takes a look) and Insert (your reference is added where you
- * say). Higgsfield runs the first three on its Genjutsu models (Lite: motion and swap only, cheaper); Fuobe also runs
- * every mode without a Higgsfield key (Kling O3 edit, Kling 3.0 Motion Control, hosted Wan 2.2 VACE, P-Video Replace,
- * the Shorts restyle models) and on the open engine (Wan Animate 2, Wan 2.1 VACE swap and insert, the Shorts
- * Fun VACE restyle chain).
+ * Fuobe Genjutsu (build plan O5): keep a clip's motion, camera and framing, change what is in it. Five modes: Motion
+ * transfer (your character does what the clip's person does), Character swap (the person in a 5–15 s part becomes your
+ * character, sound and performance kept: Openjutsu / Akatz Labs' H3 Character Swap), Object swap (a thing, a person or
+ * an outfit becomes your reference), Restyle (every frame takes a look) and Insert (your reference is added where you
+ * say). Each mode's default is a Fuobe Original — open weights on your GPU (ComfyUI) and the same open weights hosted on
+ * fal in the cloud: Wan Animate for motion, MiniMax H3 + the Character Swap LoRA for characters, SAM 3.1 + Wan VACE for
+ * swaps, a restyled first frame + Wan Fun VACE for looks. Lite is the cheaper, faster tier of the same Original. Other
+ * hosted open models (SCAIL-2, Wan Motion, Wan 2.2 Animate Replace, hosted Wan 2.2 VACE) and partner models (Kling,
+ * P-Video, H3 Max Recast, Gemini Omni, Happy Horse) stay as labelled alternatives. No Higgsfield model or look.
*
- * Every model takes a part of the clip (Genjutsu Lite 15 s, Kling 3–15 s, VACE 81 or 241 frames…), so longer
- * selections are cut into pieces or windows, made one by one, joined, and the clip's own sound put back (the
- * remove-object plumbing). Pure module (models per mode and engine, limits, prompts, prices, the pipeline's steps and
- * the shareable setup code), shared by the page, the server (src/server/genjutsu.ts) and the tests.
- * Research: docs/research/higgsfield-delta-4.md §4.2, paid-model-apis-4.md §4, comfyui-oss-4.md §c.
+ * Every model takes a part of the clip (Kling 3–15 s, VACE 81 or 241 frames, H3 5–15 s…), so longer selections are cut
+ * into pieces or windows, made one by one, joined, and the clip's own sound put back (the remove-object plumbing). Pure
+ * module (models per mode and engine, limits, prompts, prices, the pipeline's steps and the shareable setup code),
+ * shared by the page, the server (src/server/genjutsu.ts) and the tests.
+ * Research: docs/research/fuobe-originals-recipes-5.md §8 genjutsu and O5, openjutsu-6.md, paid-model-apis-4.md §4,
+ * comfyui-oss-4.md §c.
*/
+ import { keepOffered } from "@/lib/model-access";
+import {
+ anchorModel,
+ anchorPrompt,
+ ANCHOR_FALLBACK,
+ CHARACTER_SWAP,
+ characterLicenceLine,
+ characterQuality,
+ cutsInPart,
+ partProblem,
+ seedProblem,
+ swapLoraRef,
+ swapPrompt,
+ whoWords,
+ type CharacterOptions,
+ type SwapLora,
+ type SwapSpeech,
+ type SwapWho,
+} from "./character-swap";
import {
joinWithSound,
MASK_TRACKER,
@@@ -621,32 -374,47 +622,46 @@@ export const OPEN_TARGET_PROBLEM: Parti
insert: "On your ComfyUI, paint where it goes — saying it in words is on the cloud engine",
};
-/** Restyle on the open engine with one of Higgsfield's looks (they run on Higgsfield's Genjutsu Restyle only). */
-export const OPEN_LOOK_PROBLEM = "Higgsfield's looks run on the cloud engine — pick one of the 44 looks or Your own";
+/** Clicking who to swap needs SAM 3.1's mask, which only the open graph has. */
+export const CLOUD_CLICK_PROBLEM = "Clicking the person works on your GPU (SAM 3.1 marks them) — on the cloud, pick who in words";
/**
- * The model a request runs on, or why there is none. Without a modelId: Genjutsu (Lite unless Quality is High) with a
- * Higgsfield key, else the keyless route for the mode; on the open engine, the one graph that does the mode.
+ * The model a request runs on, or why there is none. Without a modelId: the mode's Fuobe Original (Lite unless the
+ * tier is High), then other open weights, then partners.
*/
- export function chooseMaker(o: { engine: Engine; mode: GenjutsuMode; target?: GenjutsuTarget; tier?: GenjutsuTier; look?: GenjutsuLook; modelId?: string }): { maker: Maker } | { problem: string } {
+ export function chooseMaker(o: {
+ engine: Engine;
+ mode: GenjutsuMode;
+ target?: GenjutsuTarget;
+ tier?: GenjutsuTier;
+ look?: GenjutsuLook;
+ modelId?: string;
- /** A Higgsfield key is set. */
- higgsfield: boolean;
+ /**
+ * Whether Settings → Models & licences offers a model: one switched off isn't picked while another is on (with
+ * all of them off the pick stays, and its run names the switch).
+ */
+ offered?: (id: string) => boolean;
+ }): { maker: Maker } | { problem: string } {
const target = MODE_TARGETS[o.mode].length ? (o.target ?? MODE_TARGETS[o.mode][0]) : undefined;
- if (target && !MODE_TARGETS[o.mode].includes(target)) return { problem: `${getMode(o.mode).label} doesn't take ${target === "click" ? "clicks" : "that"} — pick another way` };
+ if (target && !MODE_TARGETS[o.mode].includes(target)) return { problem: `${getMode(o.mode).label} doesn't take ${target === "click" ? "clicks" : target === "paint" ? "paint" : "that"} — pick another way` };
- const options = makersFor(o.engine, o.mode, target);
+ const on = o.offered;
- const all = makersFor(o.engine, o.mode, target, o.look);
++ const all = makersFor(o.engine, o.mode, target);
+ const options = on ? keepOffered(all, (m) => on(m.id)) : all;
if (!options.length) {
- if (o.engine === "open" && o.mode === "restyle" && o.look?.kind === "higgsfield") return { problem: OPEN_LOOK_PROBLEM };
+ if (o.engine === "cloud" && o.mode === "character" && target === "click") return { problem: CLOUD_CLICK_PROBLEM };
return { problem: (o.engine === "open" && OPEN_TARGET_PROBLEM[o.mode]) || "Nothing on this engine does that yet" };
}
- const withTier = (m: Maker) => (m.pair && o.tier && m.tier !== o.tier ? (getMaker(m.pair) ?? m) : m);
- const picked = getMaker(o.modelId);
+ const withTier = (m: Maker) => (m.pair && o.tier && m.tier !== o.tier ? (getMaker(m.pair, m.engine) ?? m) : m);
+ const id = o.modelId && (LEGACY_MAKERS[o.modelId] ?? o.modelId);
+ const picked = getMaker(id, o.engine);
if (picked) {
- // The picker lists the Lite model; a High pick (or an old setup naming the full model) is the same choice.
- const lite = picked.tier === "high" && picked.pair ? getMaker(picked.pair)! : picked;
- if (options.includes(lite)) return { maker: withTier(lite) };
+ // The picker lists Lite; a High pick (or a setup naming the full Original) is the same choice.
+ const lite = picked.tier === "high" && picked.pair ? getMaker(picked.pair, picked.engine)! : picked;
+ if (options.includes(lite)) return { maker: o.tier ? withTier(lite) : picked };
}
- const first = (o.higgsfield ? options.find((m) => m.higgsfield) : undefined) ?? options.find((m) => !m.higgsfield) ?? options[0];
- // Restyle with a custom look: a model that reads its images.
- if (o.mode === "restyle" && o.look?.kind === "custom" && o.engine === "cloud") return { maker: options.find((m) => m.readsLookImages) ?? first };
+ const first = [...options].sort((a, b) => SOURCE_RANK[a.source] - SOURCE_RANK[b.source])[0];
+ // Restyle with your own look's images on a partner list: a model that reads them.
+ if (o.mode === "restyle" && o.look?.kind === "custom" && first.source === "partner") return { maker: options.find((m) => m.readsLookImages) ?? first };
return { maker: withTier(first) };
}
diff --cc src/lib/licences.ts
index c9173d00,32a937e4..a8b269c5
--- a/src/lib/licences.ts
+++ b/src/lib/licences.ts
@@@ -194,3 -194,255 +194,266 @@@ export const FLAG_LABEL: Record<Licence
territory: "Not everywhere",
conditions: "Conditions apply",
};
+
+ // ---------------------------------------------------------------------------
+ // Licence classes (Settings → Models & licences). The owner's decision of 2026-10-27: licences are
+ // information, never a gate. Every model, LoRA and node pack carries its licence as data, sorted into a
+ // class an admin can switch off; everything is on by default.
+
+ export type LicenceClass = "commercial" | "conditions" | "regions" | "non-commercial" | "research" | "paid-api" | "unknown";
+
+ /** In the order Settings lists them: the freest first, then the cloud's, then what isn't recorded. */
+ export const LICENCE_CLASSES: LicenceClass[] = ["commercial", "conditions", "regions", "non-commercial", "research", "paid-api", "unknown"];
+
+ export const CLASS_LABEL: Record<LicenceClass, string> = {
+ commercial: "Commercial use allowed",
+ conditions: "Commercial use with conditions",
+ regions: "Restricted regions",
+ "non-commercial": "Non-commercial",
+ research: "Research only",
+ "paid-api": "Proprietary paid API",
+ unknown: "Licence unknown",
+ };
+
+ /** What a class means, in one line (the section headers in Settings). */
+ export const CLASS_HINT: Record<LicenceClass, string> = {
+ commercial: "Open licences that let you sell what you make (Apache-2.0, MIT, BSD) and tools with no model weights.",
+ conditions: "Commercial use is allowed within limits: a revenue ceiling, registration, attribution or use rules.",
+ regions: "The licence leaves out some countries or regions.",
+ "non-commercial": "The weights or code may not be used commercially without another licence.",
+ research: "Released for research only.",
+ "paid-api": "Closed or hosted models you pay for per run, under the provider's and the vendor's terms.",
+ unknown: "No licence is recorded yet: check the model card or repository.",
+ };
+
+ /** A model's, LoRA's or node pack's licence, as information. */
+ export interface LicenceInfo {
+ /** The licence's name ("Apache-2.0", "FLUX.1 [dev] Non-Commercial License", "fal.ai · paid API"). */
+ name: string;
+ /** Where to read it: the licence text, or the model card / repository that states it. */
+ url?: string;
+ class: LicenceClass;
+ /** Restricted regions: who it leaves out ("the EU, UK and South Korea"). */
+ excludes?: string;
+ /** One line: the licence as recorded (what it covers, its catches). */
+ note: string;
+ /** Notices the app must show ("Built with DINOv3"). */
+ notices?: string[];
+ }
+
+ /** How strict a class is, for a model whose parts carry several licences (the strictest one counts). */
+ const STRICTNESS: Record<LicenceClass, number> = { commercial: 0, "paid-api": 1, conditions: 2, unknown: 3, regions: 4, "non-commercial": 5, research: 6 };
+
+ export const stricter = (a: LicenceClass, b: LicenceClass): LicenceClass => (STRICTNESS[b] > STRICTNESS[a] ? b : a);
+
+ const SPDX = (id: string) => `https://spdx.org/licenses/${id}.html`;
+
+ /**
+ * Licences by name, with the class each one puts a model in and where to read it. Order matters: a text
+ * names a model's licence by the first entry of its class it mentions (a text with Apache-2.0 weights and
+ * the CogVideoX base is the CogVideoX License's).
+ */
+ const KNOWN: { re: RegExp; name: string; class: LicenceClass; url?: string }[] = [
+ { re: /FLUX\.1 \[dev\] Non-Commercial License|FLUX\.1 \[dev\] base is NON-COMMERCIAL/, name: "FLUX.1 [dev] Non-Commercial License", class: "non-commercial", url: "https://huggingface.co/black-forest-labs/FLUX.1-dev" },
+ { re: /FLUX \[dev\] Non-Commercial License/, name: "FLUX [dev] Non-Commercial License", class: "non-commercial", url: "https://huggingface.co/black-forest-labs/FLUX.2-dev" },
+ { re: /inswapper/, name: "InsightFace inswapper (research only)", class: "research", url: "https://github.com/deepinsight/insightface" },
+ { re: /CC-BY-NC-SA-4\.0/, name: "CC BY-NC-SA 4.0", class: "non-commercial", url: SPDX("CC-BY-NC-SA-4.0") },
+ { re: /CC[- ]BY[- ]NC(?:[- ]4\.0)?\b/, name: "CC BY-NC 4.0", class: "non-commercial", url: SPDX("CC-BY-NC-4.0") },
+ { re: /Tencent Hunyuan 3D 2\.1 Community License/, name: "Tencent Hunyuan 3D 2.1 Community License", class: "regions" },
+ { re: /Tencent Hunyuan Community License/, name: "Tencent Hunyuan Community License", class: "regions" },
+ { re: /CogVideoX License/, name: "CogVideoX License", class: "conditions" },
+ { re: /LTX-2(?:\.x)? Community License/, name: "LTX-2 Community License", class: "conditions" },
+ { re: /Stability AI Community License|Stability Community License/, name: "Stability AI Community License", class: "conditions", url: "https://stability.ai/community-license-agreement" },
+ { re: /Krea 2 Community License/, name: "Krea 2 Community License", class: "conditions" },
+ { re: /IndexTTS-2 Model Use License/, name: "bilibili IndexTTS-2 Model Use License", class: "conditions" },
+ { re: /Llama 3\.1 Community License/, name: "Llama 3.1 Community License", class: "conditions", url: "https://www.llama.com/llama3_1/license/" },
+ { re: /DINOv3 License/, name: "DINOv3 License", class: "conditions" },
++ // Before SAM's: the H3 workflows' text names both, and the territory catch is the one that counts.
++ { re: /MiniMax H3 Community License/, name: "MiniMax H3 Community License", class: "regions", url: "https://huggingface.co/MiniMaxAI/MiniMax-H3/blob/42ed227ee7df40d41602854ae760620d6eb651fe/LICENSE" },
+ { re: /SAM License/, name: "Meta SAM License", class: "conditions" },
+ { re: /OpenRAIL\+\+-M/, name: "CreativeML OpenRAIL++-M", class: "conditions" },
+ { re: /OpenRAIL-M/, name: "CreativeML OpenRAIL-M", class: "conditions", url: SPDX("CreativeML-OpenRAIL-M") },
+ { re: /Gemma Terms of Use/, name: "Gemma Terms of Use", class: "conditions", url: "https://ai.google.dev/gemma/terms" },
+ { re: /Apache[- ]2\.0/, name: "Apache-2.0", class: "commercial", url: SPDX("Apache-2.0") },
+ { re: /\bMIT\b/, name: "MIT", class: "commercial", url: SPDX("MIT") },
+ { re: /BSD-3-Clause/, name: "BSD-3-Clause", class: "commercial", url: SPDX("BSD-3-Clause") },
+ ];
+
+ /** ComfyUI's own licence: the tools with no model weights run on its nodes. */
+ const COMFYUI_REPO = "https://github.com/comfyanonymous/ComfyUI";
+
+ /** A Hugging Face download's repository page, where its licence is stated. */
+ export function modelCardOf(url: string | undefined): string | undefined {
+ const m = url && /^https:\/\/huggingface\.co\/([^/]+\/[^/]+)\/(?:resolve|blob)\//.exec(url);
+ return m ? `https://huggingface.co/${m[1]}` : undefined;
+ }
+
+ /**
+ * What a recorded licence text means as information: its class, a short name, where to read it. `cards` are
+ * the model downloads it covers (the largest first): their Hugging Face page is the link when the licence
+ * has no page of its own.
+ */
+ export function licenceInfo(text: string, cards: string[] = []): LicenceInfo {
+ const terms = licenceTerms(text);
+ const card = cards.map(modelCardOf).find(Boolean);
+ if (text === UNKNOWN_LICENCE) return { name: "Not recorded", class: "unknown", note: text, ...(card && { url: card }) };
+ if (terms.noWeights) return { name: "No model weights", class: "commercial", url: COMFYUI_REPO, note: `${text.replace(/^n\/a \((.*)\)$/, "$1")}: ComfyUI's own nodes (GPL-3.0) or FFmpeg` };
+ const cls: LicenceClass = terms.flags.includes("non-commercial")
+ ? /research (?:use )?only/i.test(text)
+ ? "research"
+ : "non-commercial"
+ : terms.flags.includes("territory")
+ ? "regions"
+ : terms.flags.includes("conditions")
+ ? "conditions"
+ : "commercial";
+ const found = KNOWN.filter((k) => k.re.test(text));
+ const named = found.find((k) => k.class === cls) ?? found[0];
+ const name = named?.name ?? text.split(/[(;:]/)[0].trim();
+ // The licence's own text when it has a page, else the model card that states it.
+ const url = named?.url ?? card;
+ return { name, class: cls, note: text, ...(url && { url }), ...(terms.excludes && { excludes: terms.excludes }), ...(terms.notices.length && { notices: terms.notices }) };
+ }
+
+ /** Several licences as one (a model running several workflows, a chain): the strictest class names it. */
+ export function mergeLicences(infos: LicenceInfo[]): LicenceInfo {
+ if (infos.length <= 1) return infos[0] ?? { name: "Not recorded", class: "unknown", note: UNKNOWN_LICENCE };
+ const lead = infos.reduce((a, b) => (STRICTNESS[b.class] > STRICTNESS[a.class] ? b : a));
+ const notes = [...new Set(infos.map((i) => i.note))];
+ const notices = [...new Set(infos.flatMap((i) => i.notices ?? []))];
+ return { ...lead, note: notes.join(" · "), ...(notices.length && { notices }) };
+ }
+
+ /** Where a provider shows a hosted model (its page states the model's licence and the provider's terms). */
+ export function providerPage(provider: string, endpoint: string): string | undefined {
+ if (provider === "fal") return `https://fal.ai/models/${endpoint}`;
+ if (provider === "replicate") return `https://replicate.com/${endpoint.split(":")[0]}`;
+ if (provider === "llm") return "https://www.anthropic.com/legal/commercial-terms";
+ return undefined;
+ }
+
+ export const PROVIDER_NAME: Record<string, string> = {
+ fal: "fal.ai",
+ replicate: "Replicate",
+ higgsfield: "Higgsfield",
+ comfyui: "ComfyUI (your GPU)",
+ llm: "Claude or Ollama",
+ local: "Your browser",
+ openai: "OpenAI",
+ google: "Google",
+ };
+
+ /** A model on a paid API: the provider's and the vendor's terms (a closed model, or open weights the provider hosts). */
+ export function paidApiLicence(vendor: string, routes: { provider: string; endpoint: string }[]): LicenceInfo {
+ const providers = [...new Set(routes.map((r) => r.provider))];
+ const names = providers.map((p) => PROVIDER_NAME[p] ?? p);
+ const first = routes[0];
+ const url = first && providerPage(first.provider, first.endpoint);
+ return {
+ name: `Paid API · ${names.join(", ")}`,
+ class: "paid-api",
+ note: `${vendor}'s model through ${names.join(" or ")} on your key: you pay per run, under the provider's terms and the model's own (the provider's page states both)`,
+ ...(url && { url }),
+ };
+ }
+
+ /** Text steps: Claude through the Anthropic key, else the Ollama model; on the open engine, Ollama only. */
+ export function llmLicence(endpoint: string, ollamaModel = "qwen3:8b"): LicenceInfo {
+ if (endpoint !== "ollama") {
+ return {
+ name: "Paid API · Anthropic (or Ollama)",
+ class: "paid-api",
+ url: "https://www.anthropic.com/legal/commercial-terms",
+ note: "Claude through your Anthropic key, under Anthropic's commercial terms; with no key, the Ollama model on your machine",
+ };
+ }
+ const known: [RegExp, string, LicenceClass, string?][] = [
+ [/^qwen/i, "Apache-2.0", "commercial", SPDX("Apache-2.0")],
+ [/^(mistral|mixtral)/i, "Apache-2.0", "commercial", SPDX("Apache-2.0")],
+ [/^(phi|deepseek)/i, "MIT", "commercial", SPDX("MIT")],
+ [/^gemma/i, "Gemma Terms of Use", "conditions", "https://ai.google.dev/gemma/terms"],
+ [/^llama/i, "Llama Community License", "conditions", "https://www.llama.com/"],
+ ];
+ const hit = known.find(([re]) => re.test(ollamaModel));
+ const note = `The Ollama model this install uses (${ollamaModel}); another model carries its own licence: ollama show <model> --license`;
+ return hit ? { name: hit[1], class: hit[2], note, ...(hit[3] && { url: hit[3] }) } : { name: "Not recorded", class: "unknown", note };
+ }
+
+ /** Tools that run in the browser (colour grade, ad compositing): Fuobe's own code. */
+ export const BROWSER_LICENCE: LicenceInfo = { name: "Fuobe (open source)", class: "commercial", note: "Runs in your browser with Fuobe's own code: no model weights, nothing sent anywhere" };
+
+ // ---------------------------------------------------------------------------
+ // ComfyUI node packs: the code a workflow loads beside ComfyUI (scripts/comfy/install-comfyui.sh and
+ // install-isolated-worker.sh), from the research (docs/research/comfyui-oss*.json) and the manifest's licence
+ // notes. A pack whose repository has no LICENSE file is recorded as unknown.
+
+ export interface NodePack {
+ name: string;
+ repo: string;
+ licence: LicenceInfo;
+ /** Installed on the isolated worker (install-isolated-worker.sh), not the main ComfyUI. */
+ worker?: "isolated";
+ }
+
+ const pack = (name: string, repo: string, licence: Omit<LicenceInfo, "url"> & { url?: string }, worker?: "isolated"): NodePack => ({
+ name,
+ repo,
+ licence: { url: repo, ...licence },
+ ...(worker && { worker }),
+ });
+ const GPL: Omit<LicenceInfo, "note"> = { name: "GPL-3.0", class: "commercial", url: SPDX("GPL-3.0-only") };
+ const NO_FILE = (extra = "") => ({ name: "Not recorded", class: "unknown" as const, note: `The repository has no LICENSE file${extra}` });
+
+ export const NODE_PACKS: NodePack[] = [
+ pack("ComfyUI-WanVideoWrapper", "https://github.com/kijai/ComfyUI-WanVideoWrapper", { name: "Apache-2.0", class: "commercial", url: SPDX("Apache-2.0"), note: "Code Apache-2.0; the Wan weights it loads are Apache-2.0" }),
+ pack("ComfyUI-VideoHelperSuite", "https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite", { ...GPL, note: "Video loading and saving; GPL-3.0 code, like ComfyUI" }),
+ pack("ComfyUI-KJNodes", "https://github.com/kijai/ComfyUI-KJNodes", { ...GPL, note: "Utility nodes (GrowMaskWithBlur, resizing); GPL-3.0 code, like ComfyUI" }),
+ pack("ComfyUI-SeedVR2_VideoUpscaler", "https://github.com/numz/ComfyUI-SeedVR2_VideoUpscaler", { name: "Apache-2.0", class: "commercial", url: SPDX("Apache-2.0"), note: "SeedVR2 upscaling; code and weights Apache-2.0" }),
+ pack("ComfyUI-Frame-Interpolation", "https://github.com/Fannovel16/ComfyUI-Frame-Interpolation", { name: "MIT", class: "commercial", url: SPDX("MIT"), note: "RIFE and FILM frame interpolation; MIT code" }),
+ pack("ComfyUI-RMBG", "https://github.com/1038lab/ComfyUI-RMBG", { ...GPL, note: "Background removal; GPL-3.0 code. Fuobe uses BEN2 (MIT); RMBG-2.0 in the same pack is CC BY-NC 4.0" }),
+ pack("ComfyUI-ReActor", "https://github.com/Gourieff/ComfyUI-ReActor", { name: "MIT (per the research)", class: "commercial", note: "Face swap node; the inswapper_128 weights it loads are for non-commercial research only" }),
+ pack("ComfyUI-MMAudio", "https://github.com/kijai/ComfyUI-MMAudio", { name: "Not recorded", class: "unknown", note: "Code licence not recorded; the MMAudio weights it loads are CC BY-NC 4.0 (non-commercial)" }),
+ pack("ComfyUI_Fill-ChatterBox", "https://github.com/filliptm/ComfyUI_Fill-ChatterBox", NO_FILE("; the Chatterbox weights are MIT")),
+ pack("ComfyUI-IndexTTS2", "https://github.com/snicolast/ComfyUI-IndexTTS2", NO_FILE("; the IndexTTS-2 weights have their own Model Use License")),
+ pack("ComfyUI-Video-Depth-Anything", "https://github.com/yuvraj108c/ComfyUI-Video-Depth-Anything", { name: "Not recorded", class: "unknown", note: "Code licence not recorded; Fuobe loads the Apache-2.0 Small model (Base and Large are CC BY-NC 4.0)" }),
+ pack("ComfyUI-MelBandRoFormer", "https://github.com/kijai/ComfyUI-MelBandRoFormer", { name: "Not recorded", class: "unknown", note: "Code licence not recorded; the MelBand RoFormer weights are MIT" }),
+ pack("ComfyUI-QwenASR", "https://github.com/1038lab/ComfyUI-QwenASR", { ...GPL, note: "Qwen3-ASR transcription; GPL-3.0 code, Apache-2.0 weights" }),
+ pack("ComfyUI-HunyuanVideo-Foley", "https://github.com/phazei/ComfyUI-HunyuanVideo-Foley", { name: "Not recorded", class: "unknown", note: "Code licence not recorded; the HunyuanVideo-Foley weights leave out the EU, UK and South Korea" }),
+ pack("ComfyUI-ToSVG", "https://github.com/Yanick112/ComfyUI-ToSVG", { name: "MIT", class: "commercial", url: SPDX("MIT"), note: "VTracer vectorising; MIT. The pack also imports PyMuPDF (AGPL-3.0) for a node Fuobe doesn't use" }),
+ pack("ComfyUI-Whisper", "https://github.com/yuvraj108c/ComfyUI-Whisper", { name: "CC BY-NC-SA 4.0", class: "non-commercial", url: SPDX("CC-BY-NC-SA-4.0"), note: "Word-timed captions in one job; non-commercial code (the author asks to be contacted for commercial use). The Whisper weights are MIT" }),
+ pack("ComfyUI-LatentSyncWrapper", "https://github.com/ShmuelRonen/ComfyUI-LatentSyncWrapper", NO_FILE("; the LatentSync 1.6 weights are CreativeML OpenRAIL++-M"), "isolated"),
+ pack("ComfyUI-ThinkSound_Wrapper", "https://github.com/ShmuelRonen/ComfyUI-ThinkSound_Wrapper", NO_FILE("; the ThinkSound weights are Apache-2.0"), "isolated"),
++ // Genjutsu's Character swap (docs/research/openjutsu-6.md §7): Akatz Labs' packs, pinned in install-comfyui.sh.
++ pack("h3_character_swap", "https://github.com/akatz-labs/h3-character-swap-tool/tree/0670e4fdf95adf2262caa4b81afed2a9c4ae4b7b/worker_nodes/h3_character_swap", {
++ ...GPL,
++ note: "MiniMax H3 character swap nodes (Akatz Labs); GPL-3.0 code, a modified NVIDIA INT8 kernel inside is Apache-2.0. The MiniMax H3 weights it runs leave out the US, the EU, the UK and South Korea",
++ }),
++ pack("h3-relay", "https://github.com/akatz-ai/h3-relay/tree/e2a7665b6eb8ea37a88c0de2c9c6b69a8f7c9220", {
++ ...GPL,
++ note: "H3 Relay 2.0 (Sendy Software LLC and contributors); GPL-3.0 code, vendored Context Loop and Spectrum GPL-3.0. Opt-in (H3_RELAY=1): it registers HTTP routes when it loads",
++ }),
+ ];
+
+ export const nodePack = (name: string): NodePack | undefined => NODE_PACKS.find((p) => p.name === name);
+
+ /** The parts of a LoRA's licence snapshot the class needs (src/lib/catalog/types.ts LoraLicence). */
+ interface LoraLicenceLike {
+ commercial: boolean;
+ hostedOk: boolean;
+ snapshotDate?: string;
+ name?: string;
+ }
+
+ /**
+ * A LoRA's licence as information: commercial and hostable, commercial on your GPU only (civitai lists no
+ * "Rent": a condition), non-commercial, or not recorded. `page` is its model card.
+ */
+ export function loraLicenceInfo(l: LoraLicenceLike | undefined, page?: string, extra?: string): LicenceInfo {
+ if (!l) return { name: "Your own", class: "commercial", note: "A LoRA you trained or added yourself", ...(page && { url: page }) };
+ const recorded = l.name?.trim();
+ const unknown = !recorded || /unspecified|no licen[cs]e|check (?:the )?card/i.test(recorded);
+ const cls: LicenceClass = unknown && !l.commercial ? "unknown" : !l.commercial ? "non-commercial" : !l.hostedOk ? "conditions" : "commercial";
+ const what = !l.commercial ? "Outputs may not be sold" : l.hostedOk ? "Commercial use, on your GPU and in the cloud" : "Commercial use on your GPU; the licence doesn't allow running it on another hosted service";
+ const note = [what, recorded && `licence as read: ${recorded}`, l.snapshotDate && `read ${l.snapshotDate}`, extra].filter(Boolean).join(" · ");
+ return { name: unknown ? "Not recorded" : (KNOWN.find((k) => k.re.test(recorded!))?.name ?? recorded!), class: cls, note, ...(page && { url: page }) };
+ }
diff --cc src/server/generations.ts
index dd222159,cdc166e4..266d2d97
--- a/src/server/generations.ts
+++ b/src/server/generations.ts
@@@ -43,8 -43,8 +43,9 @@@ import { enhancePrompt, enhanceSoulWord
import { setResolver, watchGenerations, type LiveEvent } from "./live";
import { provider } from "./providers";
import { comfyLoraFiles, probeComfy } from "./providers/comfyui";
+import { graphLoras } from "@/lib/catalog/character-swap";
import { ensureLorasOnComfy, prepareCloudLoras, withoutUnreachableCivitai } from "./loras";
+ import { offeredLoras, offeredRoutes, requireOffered } from "./model-access";
import { llmBackends, llmMissing, llmUsesClaude, probeOllama } from "./providers/llm";
import type { PollContext, PollResult, RemoteOutput } from "./providers/types";
import { mediaFacts } from "./media-facts";
diff --cc src/server/genjutsu.ts
index 389b2e35,cb985c4b..e231d0ba
--- a/src/server/genjutsu.ts
+++ b/src/server/genjutsu.ts
@@@ -151,7 -128,16 +152,15 @@@ interface Planned
async function planInput(body: GenjutsuBody, opts: { probe: boolean }): Promise<Planned> {
mustMatchMode(body.engine);
- const picked = chooseMaker({ engine: body.engine, mode: body.mode, target: body.target, tier: body.tier, look: body.look, modelId: body.modelId });
+ const picked = chooseMaker({
+ engine: body.engine,
+ mode: body.mode,
+ target: body.target,
+ tier: body.tier,
+ look: body.look,
+ modelId: body.modelId,
- higgsfield: higgsfieldReady(),
+ offered: (id) => isOffered(id, body.engine),
+ });
if ("problem" in picked) throw new ShortsError(picked.problem, 422);
const maker = picked.maker;
// The header's facts win over what the browser read (the estimate runs before the upload is read).
@@@ -331,13 -285,9 +340,13 @@@ function mixProblem(modes: StepMode[],
return `${parts.join(", and ")} — add ${key} in Settings → API keys${around ? `, or ${around}` : ""}`;
}
-/** Another model for the same job that doesn't need Higgsfield (the way around a missing Higgsfield key). */
+/** Another model for the same job that runs with the keys set now (the way around a missing key). */
function otherModel(input: GenjutsuPlanInput): string | undefined {
- const other = makersFor(input.engine, input.mode, input.target, input.look).find((x) => x.id !== input.maker.id && !x.higgsfield && isOffered(x.id, input.engine));
+ const runs = (id: string) => {
+ const m = getModel(id);
- return !!m && onEngine(m, input.engine).routes.some((r) => provider(r.provider).isConfigured());
++ return !!m && isOffered(id, input.engine) && onEngine(m, input.engine).routes.some((r) => provider(r.provider).isConfigured());
+ };
+ const other = makersFor(input.engine, input.mode, input.target).find((x) => x.id !== input.maker.id && x.pair !== input.maker.id && runs(x.id));
return other ? `pick ${other.label}` : undefined;
}
diff --cc src/server/katana.ts
index 43e3ce4f,499b2a63..6a1a45ed
--- a/src/server/katana.ts
+++ b/src/server/katana.ts
@@@ -175,8 -176,9 +176,9 @@@ export function planKatana(body: Katana
const engine: Engine = mode === "both" ? body.engine : mode;
const duration = Math.min(referenceLength(body.reference, body.duration), KATANA_LIMITS.maxReference);
if (duration < KATANA_LIMITS.minReference) throw new Error("The reference is too short");
- const m = motionModel(engine, body.motionModel);
+ // Without one asked for: the first motion model switched on in Settings → Models & licences.
+ const m = motionModel(engine, body.motionModel ?? firstOn(MOTION_MODELS[engine].map((x) => x.id), engine));
- if (body.motionModel && m.id !== body.motionModel) throw new Error(`${getModel(body.motionModel)?.name ?? body.motionModel} isn't a ${engine === "open" ? "open-source" : "cloud"} motion model for Katana`);
+ if (body.motionModel && m.id !== (RETIRED_MOTION_MODELS[body.motionModel] ?? body.motionModel)) throw new Error(`${getModel(body.motionModel)?.name ?? body.motionModel} isn't a ${engine === "open" ? "open-source" : "cloud"} motion model for Katana`);
const segments = body.segments?.length ? validSegments(body.segments, duration) : planSegments({ duration, mode: "fixed", length: body.length ?? m.max, min: m.min, max: m.max });
const title = body.title?.trim().slice(0, 120) || "Katana edit";
return {
diff --cc tests/model-access-studios.test.ts
index 00000000,bffce7a4..cf723fe4
mode 000000,100644..100644
--- a/tests/model-access-studios.test.ts
+++ b/tests/model-access-studios.test.ts
@@@ -1,0 -1,98 +1,98 @@@
+ import fs from "node:fs";
+ import os from "node:os";
+ import path from "node:path";
+ import { afterAll, beforeEach, describe, expect, it } from "vitest";
+ import { chooseMaker, makersFor } from "@/lib/catalog/genjutsu";
+ import { MOTION_MODELS } from "@/lib/av/katana";
+ import { chooseEraser, erasersFor } from "@/lib/catalog/remove-object";
+ import { SHORTS_MODELS } from "@/lib/catalog/shorts";
+ import { TOOL_MODELS } from "@/lib/layers";
+ import { keepOffered, offered } from "@/lib/model-access";
+
+ /**
+ * Settings → Models & licences in the studios with their own model menus (Genjutsu, Remove object, Shorts, Layers,
+ * Katana, Marketing's Ad Multiplier, Faceless): a model switched off leaves the menu, and a default that is off
+ * gives way to the next one that is on, in the browser (keepOffered + offered) as on the server (firstOn, isOffered).
+ */
+
+ const dir = fs.mkdtempSync(path.join(os.tmpdir(), "fuobe-access-studios-"));
+ process.env.FUOBE_DATA_DIR = dir;
+ process.env.COMFYUI_URL = "http://127.0.0.1:9";
+ const { changeAccess, firstOn, isOffered } = await import("@/server/model-access");
+ const { toolModel } = await import("@/server/layers");
+ const { planKatana } = await import("@/server/katana");
+ const { multiplierModel } = await import("@/server/marketing");
+ const { withOfferedVideo } = await import("@/server/faceless");
+ const { setSetting } = await import("@/server/settings");
+ afterAll(() => fs.rmSync(dir, { recursive: true, force: true }));
+
+ beforeEach(() => {
+ changeAccess([{ kind: "reset" }]);
+ setSetting("engineMode", "both");
+ setSetting("demoMode", "on");
+ });
+
+ describe("a studio's own model menu", () => {
+ it("keeps the choices that are on, and all of them when none is (a run then names the switch)", () => {
+ const summary = { off: ["a", "b"] };
+ expect(keepOffered(["a", "b", "c"], (id) => offered(summary, id))).toEqual(["c"]);
+ expect(keepOffered(["a", "b"], (id) => offered(summary, id))).toEqual(["a", "b"]);
+ expect(keepOffered(["a"], (id) => offered(undefined, id))).toEqual(["a"]);
+ });
+
+ it("Genjutsu and Remove object pick past a model that is off", () => {
+ const motion = makersFor("cloud", "motion");
+ expect(motion.length).toBeGreaterThan(1);
- const first = chooseMaker({ engine: "cloud", mode: "motion", higgsfield: false });
++ const first = chooseMaker({ engine: "cloud", mode: "motion" });
+ expect("maker" in first).toBe(true);
+ const firstId = "maker" in first ? first.maker.id : "";
- const next = chooseMaker({ engine: "cloud", mode: "motion", higgsfield: false, offered: (id) => id !== firstId });
++ const next = chooseMaker({ engine: "cloud", mode: "motion", offered: (id) => id !== firstId });
+ expect("maker" in next && next.maker.id).not.toBe(firstId);
+ // An explicit pick that is off isn't kept while another is on.
- expect(chooseMaker({ engine: "cloud", mode: "motion", higgsfield: false, modelId: firstId, offered: (id) => id !== firstId })).toMatchObject({ maker: { id: expect.not.stringMatching(firstId) } });
++ expect(chooseMaker({ engine: "cloud", mode: "motion", modelId: firstId, offered: (id) => id !== firstId })).toMatchObject({ maker: { id: expect.not.stringMatching(firstId) } });
+ // With every one off, the default stays: its run names the switch.
- expect(chooseMaker({ engine: "cloud", mode: "motion", higgsfield: false, offered: () => false })).toMatchObject({ maker: { id: firstId } });
++ expect(chooseMaker({ engine: "cloud", mode: "motion", offered: () => false })).toMatchObject({ maker: { id: firstId } });
+
+ const eraser = chooseEraser({ engine: "cloud", mode: "type" });
+ const eraserId = "eraser" in eraser ? eraser.eraser.id : "";
+ expect(erasersFor("cloud", "type").length).toBeGreaterThan(1);
+ const other = chooseEraser({ engine: "cloud", mode: "type", offered: (id) => id !== eraserId });
+ expect("eraser" in other && other.eraser.id).not.toBe(eraserId);
+ expect(chooseEraser({ engine: "cloud", mode: "type", offered: () => false })).toMatchObject({ eraser: { id: eraserId } });
+ });
+ });
+
+ describe("a studio's default on the server", () => {
+ it("is the first model that is on (Shorts, Layers, Katana), else the first", () => {
+ expect(firstOn(SHORTS_MODELS.cloud, "cloud")).toBe(SHORTS_MODELS.cloud[0]);
+ changeAccess([{ kind: "model", id: SHORTS_MODELS.cloud[0], on: false }]);
+ expect(firstOn(SHORTS_MODELS.cloud, "cloud")).toBe(SHORTS_MODELS.cloud[1]);
+
+ const [seedream, flash] = TOOL_MODELS.decompose.cloud;
+ expect(toolModel("decompose", "cloud").id).toBe(seedream);
+ changeAccess([{ kind: "model", id: seedream, on: false }]);
+ expect(toolModel("decompose", "cloud").id).toBe(flash);
+ // A model asked for by name is the caller's choice: it runs (or is refused) as it is.
+ expect(toolModel("decompose", "cloud", seedream).id).toBe(seedream);
+
+ const [kling, next] = MOTION_MODELS.cloud;
+ const katana = { engine: "cloud" as const, reference: "/api/files/ref.mp4", duration: 8, photos: ["/api/files/me.png"] };
+ expect(planKatana(katana).input.motionModel).toBe(kling.id);
+ changeAccess([{ kind: "model", id: kling.id, on: false }]);
+ expect(planKatana(katana).input.motionModel).toBe(next.id);
+ expect(isOffered(kling.id, "cloud")).toBe(false);
+ });
+
+ it("Ad Multiplier and Faceless fall back past a switched-off default", () => {
+ expect(multiplierModel({ engine: "cloud" }, false).id).toBe("kling-o3");
+ changeAccess([{ kind: "model", id: "kling-o3", on: false }]);
+ expect(multiplierModel({ engine: "cloud" }, false).id).not.toBe("kling-o3");
+
+ const settings = { engine: "cloud" as const, animation: "animated" } as Parameters<typeof withOfferedVideo>[0];
+ expect(withOfferedVideo(settings)).toBe(settings);
+ changeAccess([{ kind: "model", id: "gemini-omni-flash", on: false }]);
+ expect(withOfferedVideo(settings).videoModel).toBe("seedance-2-5");
+ // A pick stays the pick.
+ expect(withOfferedVideo({ ...settings, videoModel: "gemini-omni-flash" }).videoModel).toBe("gemini-omni-flash");
+ });
+ });