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.

Originals O5: each Genjutsu model's own licence in the picker, Originals first; browser check

Claude08b03f07c41d
diff --git a/src/components/genjutsu/character-panel.tsx b/src/components/genjutsu/character-panel.tsx
index f04c7fec..17f39fc7 100644
--- a/src/components/genjutsu/character-panel.tsx
+++ b/src/components/genjutsu/character-panel.tsx
@@ -12,7 +12,6 @@ import {
CHARACTER_GPU,
CHARACTER_LIMITS,
CHARACTER_SWAP,
- characterLicenceLine,
HISTORY_CHOICES,
SPEECH_LABELS,
SWAP_LORAS,
@@ -142,7 +141,7 @@ export function CharacterControls({
/>
</Field>
- <Field label="Seed (optional)" htmlFor="gj-seed" hint={seedProblem ?? "Blank is random; the same seed repeats a take"}>
+ <Field label="Seed (optional)" htmlFor="gj-seed" hint={seedProblem ?? "Blank is random"}>
<Input id="gj-seed" type="number" inputMode="numeric" min={0} max={CHARACTER_SWAP.maxSeed} value={seed} onChange={(e) => onSeed(e.target.value)} placeholder="Random" className="text-[13px]" aria-invalid={!!seedProblem} />
</Field>
@@ -273,12 +272,10 @@ export function CharacterFacts({ engine, maker, cut }: { engine: Engine; maker:
</span>
</p>
)}
- {maker && (
- <p className="flex gap-1.5">
- <Scale className="mt-0.5 size-3.5 shrink-0" />
- <span>{characterLicenceLine(engine, maker.id)}. Your admin decides what runs (Settings → Models &amp; licences).</span>
- </p>
- )}
+ <p className="flex gap-1.5">
+ <Scale className="mt-0.5 size-3.5 shrink-0" />
+ <span>Licences are information: each model&apos;s is under its name above, and your admin decides what runs (Settings → Models &amp; licences).</span>
+ </p>
</div>
);
}
diff --git a/src/components/genjutsu/genjutsu-studio.tsx b/src/components/genjutsu/genjutsu-studio.tsx
index 9049074b..aa5c23ad 100644
--- a/src/components/genjutsu/genjutsu-studio.tsx
+++ b/src/components/genjutsu/genjutsu-studio.tsx
@@ -23,7 +23,7 @@ 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 { CHARACTER_SWAP, characterLicenceLine, cutsInPart, cutWarning, seedProblem, type CharacterOptions, type CharacterQuality } from "@/lib/catalog/character-swap";
+import { CHARACTER_SWAP, cutsInPart, cutWarning, seedProblem, type CharacterOptions, type CharacterQuality } from "@/lib/catalog/character-swap";
import {
chooseMaker,
decodeSetup,
@@ -31,6 +31,7 @@ import {
GENJUTSU_MODES,
genjutsuProblem,
getMode,
+ makerLicence,
makersFor,
MODE_TARGETS,
OPEN_TARGET_PROBLEM,
@@ -46,7 +47,7 @@ import {
type Maker,
} from "@/lib/catalog/genjutsu";
import { chainState } from "@/lib/catalog/shorts";
-import type { Engine, PixelPoint } from "@/lib/catalog/types";
+import type { PixelPoint } from "@/lib/catalog/types";
import { downloadHref, downloadName } from "@/lib/library";
import { cn } from "@/lib/utils";
import { CharacterControls, CharacterFacts } from "./character-panel";
@@ -611,12 +612,12 @@ export function GenjutsuStudio() {
{maker && options.length > 1 && (
<Field label="Model">
- <MakerList options={options} value={maker.pair && maker.tier === "high" ? maker.pair : maker.id} engine={engine} character={isCharacter} onChange={(id) => setPicked((p) => ({ ...p, [choiceKey]: id }))} />
+ <MakerList options={options} value={maker.pair && maker.tier === "high" ? maker.pair : maker.id} onChange={(id) => setPicked((p) => ({ ...p, [choiceKey]: id }))} />
</Field>
)}
{maker && options.length <= 1 && (
<p className="text-[12px] text-muted-foreground">
- <SourceBadge source={maker.source} /> <span className="font-medium text-foreground">{maker.label}</span> · {maker.note}
+ <SourceBadge source={maker.source} /> <span className="font-medium text-foreground">{maker.label}</span> · {maker.note} · {makerLicence(maker)}
</p>
)}
@@ -823,7 +824,7 @@ function SourceBadge({ source }: { source: Maker["source"] }) {
}
/** The models for this mode and engine, one line each (where it comes from, what it's good at, its limits, its licence). */
-function MakerList({ options, value, engine, character, onChange }: { options: Maker[]; value: string; engine: Engine; character: boolean; onChange: (id: string) => void }) {
+function MakerList({ options, value, onChange }: { options: Maker[]; value: string; onChange: (id: string) => void }) {
return (
<div role="radiogroup" aria-label="Model" onKeyDown={radioKeys} className="space-y-1.5">
{options.map((m) => (
@@ -845,7 +846,7 @@ function MakerList({ options, value, engine, character, onChange }: { options: M
{m.label} <SourceBadge source={m.source} />
</span>
<span className="block text-[12px] leading-snug text-muted-foreground">{m.note}</span>
- {character && <span className="mt-0.5 block text-[11px] leading-snug text-muted-foreground/90">{characterLicenceLine(engine, m.id)}</span>}
+ <span className="mt-0.5 block text-[11px] leading-snug text-muted-foreground/90">{makerLicence(m)}</span>
</span>
</button>
))}
diff --git a/src/lib/catalog/genjutsu.ts b/src/lib/catalog/genjutsu.ts
index 04c4e9a2..31a83a6c 100644
--- a/src/lib/catalog/genjutsu.ts
+++ b/src/lib/catalog/genjutsu.ts
@@ -21,6 +21,7 @@ import {
anchorPrompt,
ANCHOR_FALLBACK,
CHARACTER_SWAP,
+ characterLicenceLine,
characterQuality,
cutsInPart,
partProblem,
@@ -580,7 +581,31 @@ export const LEGACY_MAKERS: Record<string, string> = {
"oss-wan22-vace-restyle": ORIGINALS.restyle,
};
-/** The models you can pick for this engine, mode and way of pointing. */
+const SOURCE_RANK: Record<MakerSource, number> = { original: 0, open: 1, partner: 2 };
+
+/** The open weights under each model that isn't MiniMax H3 (docs/research/fuobe-originals-recipes-5.json, studios.genjutsu). */
+const WEIGHTS: Record<string, string> = {
+ [ORIGINALS.motion]: "Wan Animate weights: Apache-2.0",
+ [ORIGINALS.motionLite]: "Wan Animate weights: Apache-2.0",
+ [ORIGINALS.swap]: "Wan VACE weights: Apache-2.0 · SAM 3.1: Meta's SAM License",
+ [ORIGINALS.swapLite]: "Wan VACE weights: Apache-2.0 · SAM 3.1: Meta's SAM License",
+ [ORIGINALS.restyle]: "Wan 2.2 Fun VACE weights: Apache-2.0",
+ "scail-2": "SCAIL-2 weights: MIT",
+ "wan-motion": "Wan Animate weights: Apache-2.0",
+ "wan-22-animate-replace": "Wan 2.2 Animate weights: Apache-2.0",
+ "wan-22-vace-inpaint": "Wan 2.2 Fun VACE weights: Apache-2.0",
+ "oss-vace-insert": "Wan 2.1 VACE weights: Apache-2.0",
+};
+
+/** A model's licence in one line, as information for the picker (the admin decides what runs, in Settings). */
+export function makerLicence(m: Maker): string {
+ if (m.h3 || m.id === "h3-max-recast") return characterLicenceLine(m.engine, m.id);
+ if (m.source === "partner") return "Closed model: pay per use, under its provider's terms";
+ const where = m.engine === "open" ? "free on your GPU" : "on fal, pay per use";
+ return WEIGHTS[m.id] ? `${WEIGHTS[m.id]} · ${where}` : `Open weights · ${where}`;
+}
+
+/** The models you can pick for this engine, mode and way of pointing: Fuobe's Original first, then open weights, then partners. */
export function makersFor(engine: Engine, mode: GenjutsuMode, target?: GenjutsuTarget): Maker[] {
return MAKERS.filter((m) => {
if (m.engine !== engine || !m.modes.includes(mode)) return false;
@@ -588,7 +613,7 @@ export function makersFor(engine: Engine, mode: GenjutsuMode, target?: GenjutsuT
// Lite and the full Original are one choice in the picker (Quality: Standard / High).
if (m.tier === "high") return false;
return true;
- });
+ }).sort((a, b) => SOURCE_RANK[a.source] - SOURCE_RANK[b.source]);
}
export const OPEN_TARGET_PROBLEM: Partial<Record<GenjutsuMode, string>> = {
@@ -599,8 +624,6 @@ export const OPEN_TARGET_PROBLEM: Partial<Record<GenjutsuMode, string>> = {
/** 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";
-const SOURCE_RANK: Record<MakerSource, number> = { original: 0, open: 1, partner: 2 };
-
/**
* 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.
diff --git a/tests/e2e/genjutsu-original.mjs b/tests/e2e/genjutsu-original.mjs
new file mode 100644
index 00000000..9c0fb860
--- /dev/null
+++ b/tests/e2e/genjutsu-original.mjs
@@ -0,0 +1,128 @@
+// Fuobe Genjutsu on the Originals, browser check (build plan O5 + Openjutsu): /genjutsu runs Fuobe's Originals by
+// default on both engines, with open weights and partners as labelled alternatives, and a Character swap mode
+// (MiniMax H3). At 1440 and 390 px, light and dark: the Character swap mode shows who to swap, the quality, the first
+// frame switch, the limits and the licence line; the model list badges each model's source; a run is made in demo mode
+// and finishes; the open engine allows clicking the person and shows the GPU line; Motion and Restyle list the
+// Originals first and Restyle has Soul looks; no Higgsfield anywhere; nothing scrolls sideways.
+// Usage: node tests/e2e/genjutsu-original.mjs [appUrl] [--shots <dir>] (app running in demo mode, ComfyUI unreachable).
+// Exits 1 on a failed check.
+import fs from "node:fs";
+import path from "node:path";
+import { launch, root } from "./_browser.mjs";
+
+const argv = process.argv.slice(2);
+const app = (argv.find((a) => !a.startsWith("--") && argv[argv.indexOf(a) - 1] !== "--shots") ?? "http://localhost:3000").replace(/\/$/, "");
+const shots = argv.includes("--shots") ? argv[argv.indexOf("--shots") + 1] : undefined;
+if (shots) fs.mkdirSync(shots, { recursive: true });
+
+const failures = [];
+const check = (label, ok, extra = "") => {
+ console.log(`${ok ? "ok " : "FAIL"} ${label.padEnd(72)}${extra ? ` ${extra}` : ""}`);
+ if (!ok) failures.push(label);
+};
+
+async function upload(file, type, name) {
+ const form = new FormData();
+ form.append("file", new Blob([fs.readFileSync(path.join(root, file))], { type }), name);
+ const res = await fetch(`${app}/api/uploads`, { method: "POST", body: form });
+ if (!res.ok) throw new Error(`upload failed: ${res.status}`);
+ return (await res.json()).url;
+}
+
+// A 6 s clip (a drawn figure walking, with a hum) and a drawn character: Character swap needs 5 s or more.
+const clip = await upload("scripts/eval/fixtures/walk-6s.mp4", "video/mp4", "walk.mp4");
+const hero = await upload("scripts/eval/fixtures/character/drawn-face-2.png", "image/png", "hero.png");
+
+const browser = await launch();
+try {
+ for (const [width, height] of [
+ [1440, 900],
+ [390, 844],
+ ]) {
+ for (const scheme of ["light", "dark"]) {
+ const tag = `${width} ${scheme}`;
+ const context = await browser.newContext({ viewport: { width, height }, colorScheme: scheme, ...(width < 500 ? { isMobile: true, hasTouch: true } : {}) });
+ await context.addInitScript(() => {
+ try {
+ localStorage.setItem("fuobe.engine", "cloud");
+ } catch {}
+ });
+ const page = await context.newPage();
+ const shot = async (name) => shots && (await page.screenshot({ path: path.join(shots, `${name}-${width}-${scheme}.png`), fullPage: true }));
+ const sideways = () => page.evaluate(() => document.documentElement.scrollWidth - document.documentElement.clientWidth);
+ const text = () => page.evaluate(() => document.body.innerText);
+
+ await page.goto(`${app}/genjutsu?mode=character&video=${encodeURIComponent(clip)}&image=${encodeURIComponent(hero)}`, { waitUntil: "load", timeout: 180_000 });
+ const tab = page.getByRole("tab", { name: "Character swap" });
+ await tab.waitFor({ timeout: 120_000 });
+ // ?mode= is read once the page has the URL's query.
+ await page.waitForFunction(() => document.querySelector('[role="tab"][aria-selected="true"]')?.textContent === "Character swap", null, { timeout: 30_000 }).catch(() => {});
+ check(`${tag}: Character swap is the open tab`, (await tab.getAttribute("aria-selected")) === "true");
+ const who = page.getByRole("radiogroup", { name: "Who to swap" });
+ await who.waitFor({ timeout: 60_000 });
+ check(`${tag}: who to swap: Largest, Leftmost, Rightmost, Person #`, (await who.getByRole("radio").allInnerTexts()).join("|") === "Largest|Leftmost|Rightmost|Person #");
+ check(`${tag}: quality 480p / 768p, 768p by default`, (await page.getByRole("radiogroup", { name: "Quality" }).getByRole("radio", { name: "768p" }).getAttribute("aria-checked")) === "true");
+ check(`${tag}: the first frame is made first by default`, (await page.getByRole("switch", { name: "Make the first frame first" }).getAttribute("aria-checked")) === "true");
+ // Clicking runs on the GPU only: the cloud says so.
+ check(`${tag}: cloud: "Click them" is off, said in words`, (await page.getByRole("radio", { name: "Click them" }).isDisabled()) && /Clicking runs on your GPU/.test(await text()));
+ const models = page.getByRole("radiogroup", { name: "Model", exact: true });
+ await models.waitFor({ timeout: 30_000 });
+ const first = (await models.getByRole("radio").first().innerText()).replace(/\s+/g, " ");
+ check(`${tag}: the Original is first, badged`, /^Fuobe Character swap Fuobe Original/.test(first), JSON.stringify(first.slice(0, 60)));
+ const listed = (await models.innerText()).replace(/\s+/g, " ");
+ check(`${tag}: open weights and partners are labelled alternatives`, /Open weights/.test(listed) && /Partner/.test(listed));
+ check(`${tag}: the licence line is in the picker`, /MiniMax H3 Community License — not licensed in the US, the EU, the UK and South Korea/.test(listed));
+ check(`${tag}: each model's own licence (MIT for SCAIL-2, closed for partners)`, /SCAIL-2 weights: MIT/.test(listed) && /Closed model: pay per use/.test(listed));
+ // The price (demo: no keys), the limits.
+ await page.getByText(/Demo · free|≈ \$|Price unknown/).first().waitFor({ timeout: 60_000 });
+ const body = await text();
+ check(`${tag}: the limits are shown`, /One continuous shot: a hard cut breaks the swap/.test(body) && /The person must be visible in the part's first frame/.test(body));
+ check(`${tag}: no Higgsfield anywhere`, !/higgsfield/i.test(body));
+ check(`${tag}: no sideways scroll (Character swap)`, (await sideways()) <= 1, `${await sideways()} px`);
+ await shot("genjutsu-character-cloud");
+
+ // A demo run: the steps run through and the result comes back.
+ if (scheme === "light") {
+ await page.getByRole("button", { name: "Generate" }).click();
+ const done = await page
+ .getByRole("link", { name: "Download" })
+ .waitFor({ timeout: 120_000 })
+ .then(() => true)
+ .catch(() => false);
+ check(`${tag}: a demo Character swap finishes with a before / after`, done);
+ await shot("genjutsu-character-result");
+ }
+
+ // The open engine: clicks allowed, the GPU line.
+ await page.getByRole("radiogroup", { name: "Engine" }).getByRole("radio", { name: "Open source" }).click();
+ await page.waitForTimeout(600);
+ check(`${tag}: open: "Click them" is on`, !(await page.getByRole("radio", { name: "Click them" }).isDisabled()));
+ const openBody = await text();
+ check(`${tag}: open: the GPU it was tested on`, /Tested by its authors on a 96 GB RTX PRO 6000/.test(openBody));
+ check(`${tag}: open: the H3 Relay is an open alternative`, /H3 Relay/.test(openBody));
+ await page.getByText("Advanced").first().click();
+ check(`${tag}: open: Advanced has the LoRA release and the window`, (await page.getByRole("radiogroup", { name: "Swap LoRA" }).count()) === 1 && (await page.getByText("Window", { exact: true }).count()) >= 1);
+ check(`${tag}: no sideways scroll (open)`, (await sideways()) <= 1, `${await sideways()} px`);
+ await shot("genjutsu-character-open");
+
+ // Motion transfer: the Original first; Restyle: Soul looks, no Higgsfield.
+ await page.getByRole("radiogroup", { name: "Engine" }).getByRole("radio", { name: "Cloud" }).click();
+ await page.getByRole("tab", { name: "Motion transfer" }).click();
+ await page.waitForTimeout(500);
+ const motion = (await page.getByRole("radiogroup", { name: "Model", exact: true }).getByRole("radio").first().innerText()).replace(/\s+/g, " ");
+ check(`${tag}: motion: Fuobe Genjutsu first, an Original (Lite by default)`, /^Fuobe Genjutsu Fuobe Original .*480p/.test(motion), JSON.stringify(motion.slice(0, 60)));
+ await page.getByRole("tab", { name: "Restyle" }).click();
+ await page.waitForTimeout(500);
+ check(`${tag}: restyle: Soul looks are a tab`, (await page.getByRole("tab", { name: "Soul looks" }).count()) === 1);
+ await page.getByRole("tab", { name: "Soul looks" }).click();
+ check(`${tag}: restyle: no Higgsfield anywhere`, !/higgsfield/i.test(await text()));
+ check(`${tag}: no sideways scroll (Restyle)`, (await sideways()) <= 1, `${await sideways()} px`);
+ await shot("genjutsu-restyle-soul");
+ await context.close();
+ }
+ }
+} finally {
+ await browser.close();
+}
+console.log(failures.length ? `\n${failures.length} check(s) failed` : "\nall checks passed");
+process.exit(failures.length ? 1 : 0);
diff --git a/tests/genjutsu.test.ts b/tests/genjutsu.test.ts
index 294dbbba..95b94c5d 100644
--- a/tests/genjutsu.test.ts
+++ b/tests/genjutsu.test.ts
@@ -9,6 +9,7 @@ import {
getMaker,
h3Extra,
LEGACY_MAKERS,
+ makerLicence,
makerPrompt,
makersFor,
makerStepUsd,
@@ -80,6 +81,16 @@ describe("Genjutsu: which model runs", () => {
expect(chooseMaker({ engine: "cloud", mode: "character", modelId: "h3-max-recast" })).toMatchObject({ maker: { id: "h3-max-recast" } });
});
+ it("each model's licence is a line of information in the picker", () => {
+ expect(makerLicence(maker(ORIGINALS.character))).toMatch(/^MiniMax H3 Community License — not licensed in the US, the EU, the UK and South Korea.* on fal, pay per second$/);
+ expect(makerLicence(maker(ORIGINALS.character, "open"))).toMatch(/nodes GPL-3\.0 · SAM License$/);
+ expect(makerLicence(maker("h3-max-recast"))).toMatch(/^MiniMax's closed H3 Max through fal/);
+ expect(makerLicence(maker(ORIGINALS.swap, "open"))).toBe("Wan VACE weights: Apache-2.0 · SAM 3.1: Meta's SAM License · free on your GPU");
+ expect(makerLicence(maker("scail-2"))).toBe("SCAIL-2 weights: MIT · on fal, pay per use");
+ expect(makerLicence(maker("kling-o3"))).toBe("Closed model: pay per use, under its provider's terms");
+ expect(MAKERS.every((m) => makerLicence(m).length > 10)).toBe(true);
+ });
+
it("refuses in words what an engine can't do", () => {
expect(chooseMaker({ engine: "cloud", mode: "character", target: "click" })).toEqual({ problem: CLOUD_CLICK_PROBLEM });
expect(chooseMaker({ engine: "open", mode: "character", target: "click" })).toMatchObject({ maker: { id: ORIGINALS.character, engine: "open" } });