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.

Thanks & licences: Built on, with ComfyUI first, the model makers and tidy credits

Adarsh60bf8c6ccc79
diff --git a/src/components/thanks/thanks-list.tsx b/src/components/thanks/thanks-list.tsx
index a83f0024..3c38e953 100644
--- a/src/components/thanks/thanks-list.tsx
+++ b/src/components/thanks/thanks-list.tsx
@@ -1,25 +1,45 @@
"use client";
import { ExternalLink, Search, X } from "lucide-react";
-import { memo, useDeferredValue, useMemo, useState } from "react";
-import { searchText, type ThanksGroup, type ThanksRow } from "@/lib/thanks";
+import { memo, useDeferredValue, useEffect, useMemo, useState, useSyncExternalStore } from "react";
+import { searchText, type ThanksGroup, type ThanksMaker, type ThanksRow } from "@/lib/thanks";
+
+function subscribeHash(cb: () => void) {
+ window.addEventListener("hashchange", cb);
+ return () => window.removeEventListener("hashchange", cb);
+}
+
+const smooth = (): ScrollBehavior => (matchMedia("(prefers-reduced-motion: reduce)").matches ? "auto" : "smooth");
/**
* Thanks & licences' list: a search box, chips that jump to each group, then the groups, one row each (name and maker,
- * what Fuobe uses it for, its licence and any condition). A search keeps the rows that have every word typed.
+ * what Fuobe uses it for, its licence and any condition). A search keeps the rows that have every word typed. A model
+ * maker's card above links to #by-<maker>, which keeps only the rows that run that maker's models until it's cleared.
*/
-export function ThanksList({ groups }: { groups: ThanksGroup[] }) {
+export function ThanksList({ groups, makers = [] }: { groups: ThanksGroup[]; makers?: ThanksMaker[] }) {
const [query, setQuery] = useState("");
const deferred = useDeferredValue(query);
+ const hash = useSyncExternalStore(subscribeHash, () => location.hash, () => "");
+ const maker = makers.find((m) => `#by-${m.id}` === hash);
+ const by = maker?.id;
+ const clearMaker = () => {
+ history.replaceState(null, "", location.pathname + location.search);
+ window.dispatchEvent(new HashChangeEvent("hashchange"));
+ };
+ // A maker chosen above: bring its rows into view.
+ useEffect(() => {
+ if (by) document.getElementById("thanks-list")?.scrollIntoView({ block: "start", behavior: smooth() });
+ }, [by]);
const index = useMemo(() => groups.map((g) => ({ ...g, rows: g.rows.map((r) => ({ row: r, text: searchText(r) })) })), [groups]);
const shown = useMemo(() => {
const words = deferred.toLowerCase().split(/\s+/).filter(Boolean);
- return index.map((g) => ({ ...g, rows: words.length ? g.rows.filter((r) => words.every((w) => r.text.includes(w))) : g.rows }));
- }, [index, deferred]);
+ return index.map((g) => ({ ...g, rows: g.rows.filter((r) => (!by || r.row.makers?.includes(by)) && words.every((w) => r.text.includes(w))) }));
+ }, [index, deferred, by]);
const any = shown.some((g) => g.rows.length);
return (
<>
+ <div id="thanks-list" className="scroll-mt-12 md:scroll-mt-[var(--chrome-top)]" />
<div className="sticky top-12 z-10 -mx-4 border-b bg-background/90 px-4 py-2 backdrop-blur sm:-mx-8 sm:px-8 md:top-chrome">
<div className="flex flex-col gap-2 lg:flex-row lg:items-center">
<label className="relative block min-w-0 lg:w-80 lg:shrink-0">
@@ -55,8 +75,9 @@ export function ThanksList({ groups }: { groups: ThanksGroup[] }) {
const to = document.getElementById(`thanks-${g.id}`);
if (!to) return;
e.preventDefault();
- to.scrollIntoView({ block: "start", behavior: matchMedia("(prefers-reduced-motion: reduce)").matches ? "auto" : "smooth" });
- history.replaceState(null, "", `#thanks-${g.id}`);
+ to.scrollIntoView({ block: "start", behavior: smooth() });
+ // A maker's filter stays in the address until it is cleared.
+ if (!by) history.replaceState(null, "", `#thanks-${g.id}`);
}}
className="inline-flex h-11 items-center gap-1.5 rounded-full border px-3.5 text-[13px] font-medium whitespace-nowrap transition-colors hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none lg:h-9"
>
@@ -68,6 +89,21 @@ export function ThanksList({ groups }: { groups: ThanksGroup[] }) {
</ul>
</nav>
</div>
+ {maker && (
+ <p role="status" className="mt-2 flex flex-wrap items-center gap-x-2 text-[13px]">
+ <span className="text-muted-foreground">
+ Models by <span className="font-medium text-foreground">{maker.name}</span>
+ </span>
+ <button
+ type="button"
+ onClick={clearMaker}
+ className="inline-flex h-11 items-center gap-1 rounded-full px-2 font-medium text-brand-text hover:bg-brand-faint focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none lg:h-8"
+ >
+ <X className="size-3.5" aria-hidden />
+ Show everything
+ </button>
+ </p>
+ )}
</div>
{shown.map((g) =>
diff --git a/src/components/thanks/thanks-view.tsx b/src/components/thanks/thanks-view.tsx
index 9b0c7d4a..77054b7e 100644
--- a/src/components/thanks/thanks-view.tsx
+++ b/src/components/thanks/thanks-view.tsx
@@ -1,30 +1,184 @@
-import type { Thanks } from "@/lib/thanks";
+import { ArrowRight, ChevronDown, ExternalLink } from "lucide-react";
+import type { Thanks, ThanksLicence, ThanksMaker, ThanksProject } from "@/lib/thanks";
import { ThanksList } from "./thanks-list";
+/** Model makers shown before "Show more". */
+const MAKERS_SHOWN = 12;
+
+const LINK =
+ "inline-flex min-h-11 items-center gap-1 text-[13px] font-medium text-brand-text underline-offset-2 hover:underline focus-visible:rounded-sm focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none sm:min-h-0";
+const SUMMARY =
+ "inline-flex min-h-11 cursor-pointer list-none items-center gap-1 rounded-md text-[13px] font-medium text-brand-text select-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none sm:min-h-8 [&::-webkit-details-marker]:hidden";
+
+function Out({ href, children, className = LINK }: { href: string; children: React.ReactNode; className?: string }) {
+ return (
+ <a href={href} target="_blank" rel="noreferrer" className={className}>
+ {children}
+ <ExternalLink className="size-3 shrink-0 opacity-70" aria-hidden />
+ <span className="sr-only">(opens in a new tab)</span>
+ </a>
+ );
+}
+
+function Licence({ licence }: { licence: ThanksLicence }) {
+ return licence.url ? <Out href={licence.url}>{licence.name}</Out> : <span className="text-[13px] font-medium">{licence.name}</span>;
+}
+
+/** "In 20 models and tools" with a Show all list, or the one name when there is one. */
+function Users({ names }: { names: string[] }) {
+ if (names.length === 1) return <p className="mt-1 text-[13px] text-muted-foreground">In {names[0]}</p>;
+ return (
+ <details className="group mt-1">
+ <summary className={SUMMARY}>
+ <span className="font-normal text-muted-foreground">In {names.length} models and tools</span>
+ <span className="ml-1.5">Show all</span>
+ <ChevronDown className="size-3.5 transition-transform group-open:rotate-180" aria-hidden />
+ </summary>
+ <ul className="mt-2 mb-1 space-y-1.5 border-l pl-3 text-[13px] leading-snug text-pretty text-muted-foreground">
+ {names.map((n) => (
+ <li key={n} className="[overflow-wrap:anywhere]">
+ {n}
+ </li>
+ ))}
+ </ul>
+ </details>
+ );
+}
+
+function Maker({ m }: { m: ThanksMaker }) {
+ return (
+ <li className="min-w-0">
+ <a
+ href={`#by-${m.id}`}
+ className="group/maker flex h-full min-h-11 items-start justify-between gap-3 rounded-xl border bg-background px-4 py-3 transition-colors hover:border-foreground/25 hover:bg-accent/40 focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none"
+ >
+ <span className="min-w-0">
+ <span className="block text-[15px] font-medium [overflow-wrap:anywhere]">{m.name}</span>
+ <span className="mt-0.5 block text-[12.5px] leading-snug text-pretty text-muted-foreground">
+ {m.models.map((f, i) => (
+ <span key={f}>
+ {i > 0 && " · "}
+ <span className="whitespace-nowrap">{f}</span>
+ </span>
+ ))}
+ </span>
+ </span>
+ <span className="mt-0.5 inline-flex shrink-0 items-center gap-1 text-[12.5px] whitespace-nowrap text-brand-text tabular-nums">
+ {m.count} {m.count === 1 ? "tool" : "tools"}
+ <span className="sr-only">, show them below</span>
+ <ArrowRight className="size-3.5 transition-transform group-hover/maker:translate-x-0.5" aria-hidden />
+ </span>
+ </a>
+ </li>
+ );
+}
+
+function Project({ p }: { p: ThanksProject }) {
+ return (
+ <li className="flex min-w-0 flex-col rounded-xl border bg-background px-4 py-3">
+ <Out
+ href={p.url}
+ className="inline-flex min-h-11 items-center gap-1 self-start text-[15px] font-medium underline-offset-2 hover:underline focus-visible:rounded-sm focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none sm:min-h-0"
+ >
+ {p.name}
+ </Out>
+ {p.maker && p.maker !== p.name && <p className="text-[12px] text-muted-foreground [overflow-wrap:anywhere]">{p.maker}</p>}
+ <p className="mt-1 text-[12.5px] leading-snug text-pretty text-muted-foreground">{p.use}</p>
+ {p.licence && (
+ <p className="mt-auto pt-1">
+ <Licence licence={p.licence} />
+ </p>
+ )}
+ </li>
+ );
+}
+
/**
- * Thanks & licences: the names some licences ask Fuobe to show, then every model, LoRA, node pack and library in groups
- * (ThanksList, which searches them).
+ * Thanks & licences: Built on (ComfyUI first, the code and services under the app, the model makers, and the names
+ * some licences ask Fuobe to show), then every model, LoRA, node pack and library in groups (ThanksList, which
+ * searches them and filters them by maker).
*/
export function ThanksView({ thanks }: { thanks: Thanks }) {
+ const [comfy, ...projects] = thanks.builtOn;
+ const shown = thanks.makers.slice(0, MAKERS_SHOWN);
+ const more = thanks.makers.slice(MAKERS_SHOWN);
return (
<div data-thanks className="min-w-0">
- {thanks.credits.length > 0 && (
- <section aria-labelledby="thanks-credits" className="mb-8 rounded-2xl border bg-muted/30 p-4 sm:p-6">
- <h2 id="thanks-credits" className="text-[13px] font-semibold tracking-wide text-muted-foreground uppercase">
- Credits
- </h2>
- <ul className="mt-3 grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
- {thanks.credits.map((c) => (
- <li key={c.text} className="min-w-0">
- <p className="font-heading text-[22px] leading-tight [overflow-wrap:anywhere]">{c.text}</p>
- <p className="mt-1 text-[12px] leading-relaxed text-pretty text-muted-foreground">{c.names.join(", ")}</p>
- </li>
+ <section aria-labelledby="thanks-built-on" className="mb-10">
+ <h2 id="thanks-built-on" className="border-b pb-2 font-heading text-[24px] leading-tight">
+ Built on
+ </h2>
+
+ {comfy && (
+ <div className="relative mt-3 overflow-hidden rounded-2xl border bg-brand-faint p-5 sm:p-7">
+ <p className="text-[12.5px] font-medium text-brand-text">Thank you, {comfy.maker}</p>
+ <p className="mt-1 font-heading text-[34px] leading-none sm:text-[44px]">{comfy.name}</p>
+ <p className="mt-3 max-w-xl text-[15px] leading-relaxed text-pretty">{comfy.use} It is free and open, and Fuobe would not exist without it.</p>
+ <p className="mt-3 flex flex-wrap items-center gap-x-4">
+ <Out href={comfy.url}>Its code</Out>
+ {comfy.licence && <Licence licence={comfy.licence} />}
+ </p>
+ </div>
+ )}
+
+ {projects.length > 0 && (
+ <ul className="mt-3 grid grid-cols-2 gap-2.5 sm:grid-cols-3 lg:grid-cols-5">
+ {projects.map((p) => (
+ <Project key={p.id} p={p} />
))}
</ul>
- </section>
- )}
+ )}
+
+ {thanks.makers.length > 0 && (
+ <div className="mt-8">
+ <h3 id="thanks-makers" className="font-heading text-[22px] leading-tight">
+ The model makers
+ </h3>
+ <p className="mt-1 max-w-2xl text-[13.5px] leading-relaxed text-pretty text-muted-foreground">
+ The labs and people who publish the open models Fuobe runs. Thank you for sharing them. Tap one to see where Fuobe uses its models.
+ </p>
+ <ul className="mt-3 grid gap-2.5 sm:grid-cols-2 lg:grid-cols-3">
+ {shown.map((m) => (
+ <Maker key={m.id} m={m} />
+ ))}
+ </ul>
+ {more.length > 0 && (
+ <details className="group mt-2.5">
+ <summary className={SUMMARY}>
+ Show {more.length} more makers
+ <ChevronDown className="size-3.5 transition-transform group-open:rotate-180" aria-hidden />
+ </summary>
+ <ul className="mt-2.5 grid gap-2.5 sm:grid-cols-2 lg:grid-cols-3">
+ {more.map((m) => (
+ <Maker key={m.id} m={m} />
+ ))}
+ </ul>
+ </details>
+ )}
+ </div>
+ )}
+
+ {thanks.credits.length > 0 && (
+ <div className="mt-8">
+ <h3 id="thanks-credits" className="font-heading text-[22px] leading-tight">
+ Named with thanks
+ </h3>
+ <p className="mt-1 max-w-2xl text-[13.5px] leading-relaxed text-pretty text-muted-foreground">
+ Some licences ask us to show their name, like a &ldquo;Built with&rdquo; line. We&apos;re glad to.
+ </p>
+ <ul className="mt-3 grid gap-2.5 sm:grid-cols-2 lg:grid-cols-3">
+ {thanks.credits.map((c) => (
+ <li key={c.text} className="min-w-0 rounded-xl border bg-background px-4 py-3">
+ <p className="font-heading text-[24px] leading-tight [overflow-wrap:anywhere]">{c.text}</p>
+ <Users names={c.names} />
+ </li>
+ ))}
+ </ul>
+ </div>
+ )}
+ </section>
- <ThanksList groups={thanks.groups} />
+ <ThanksList groups={thanks.groups} makers={thanks.makers} />
<p className="mt-10 max-w-2xl text-[12px] leading-relaxed text-pretty text-muted-foreground">
This list is a guide, not legal advice. Read a model&apos;s own licence before you sell what you make with it.
diff --git a/src/lib/thanks.ts b/src/lib/thanks.ts
index dab9a718..a6648424 100644
--- a/src/lib/thanks.ts
+++ b/src/lib/thanks.ts
@@ -6,6 +6,9 @@
*
* Some licences ask the app to name them ("Built with DINOv3", MiniMax H3's "MiniMax H3"): those rows carry `credits`,
* and the page names each one at the top, which is where Fuobe meets that condition.
+ *
+ * Above the list, "Built on" thanks the projects Fuobe stands on (ComfyUI first) and the labs and people whose open
+ * models it runs, grouped by maker from the same rows: the files each tool downloads, its name and its vendor.
*/
import {
ATTRIBUTIONS,
@@ -45,6 +48,8 @@ export interface ThanksRow {
condition?: string;
/** Names its licence asks the app to show ("Built with DINOv3"): this page shows them. */
credits?: string[];
+ /** The model makers (MAKERS ids) whose weights it runs, for a model or tool row. */
+ makers?: string[];
}
export interface ThanksGroup {
@@ -53,7 +58,33 @@ export interface ThanksGroup {
rows: ThanksRow[];
}
+/** A project Fuobe stands on, thanked at the top of the page. */
+export interface ThanksProject {
+ id: string;
+ name: string;
+ maker?: string;
+ url: string;
+ /** What it does for Fuobe, in one plain sentence. */
+ use: string;
+ /** None for a service (Hugging Face hosts the files; each model keeps its own licence). */
+ licence?: ThanksLicence;
+}
+
+/** A lab or person whose open models Fuobe runs. */
+export interface ThanksMaker {
+ id: string;
+ name: string;
+ /** Their model families Fuobe runs, in MAKERS order (the main model first). */
+ models: string[];
+ /** How many model and tool rows below run them. */
+ count: number;
+}
+
export interface Thanks {
+ /** ComfyUI first, then the services and code the app is built with. */
+ builtOn: ThanksProject[];
+ /** The model makers: premium image and video makers first, then by how many rows run their models. */
+ makers: ThanksMaker[];
/** Each name a licence asks Fuobe to show, with what carries it. */
credits: { text: string; names: string[] }[];
groups: ThanksGroup[];
@@ -97,9 +128,220 @@ export const GROUP_TITLE: Record<ThanksGroupId, string> = {
const GROUP_ORDER: ThanksGroupId[] = ["image", "video", "audio", "3d", "text", "loras", "packs", "code"];
const FUOBE_REPO = "https://github.com/workingprototype/Fuobe";
-const COMFYUI_REPO = "https://github.com/comfyanonymous/ComfyUI";
const SPDX = (id: string) => `https://spdx.org/licenses/${id}.html`;
+/** ComfyUI: thanked first at the top of the page, and listed under Code and libraries. */
+export const COMFYUI = {
+ name: "ComfyUI",
+ maker: "Comfy Org",
+ url: "https://github.com/Comfy-Org/ComfyUI",
+ licence: { name: "GPL-3.0", url: SPDX("GPL-3.0-only") },
+} as const;
+
+/** Packages the app ships with that Built on thanks by name (only when package.json lists them), with what each does. */
+export const BUILT_ON_PACKAGES: { pkg: string; name: string; maker: string; use: string }[] = [
+ { pkg: "next", name: "Next.js", maker: "Vercel", use: "The framework the app is built with" },
+ { pkg: "react", name: "React", maker: "The React team", use: "Draws every screen" },
+ { pkg: "three", name: "three.js", maker: "mrdoob and contributors", use: "Shows 3D models in your browser" },
+];
+
+interface MakerDef {
+ id: string;
+ name: string;
+ /** A maker of Fuobe's premium image and video models: listed first. */
+ premium?: boolean;
+ /** Its model families, matched in a tool's downloaded file names, its name and its vendor (in lower case). */
+ families: { name: string; re: RegExp }[];
+}
+
+/**
+ * The labs and people behind the open models Fuobe runs. Only makers some row matches are shown, so the page never
+ * thanks a model Fuobe doesn't ship. A model inside another counts too (Qwen-VL reads the prompt for Krea 2).
+ */
+export const MAKERS: MakerDef[] = [
+ {
+ id: "qwen",
+ name: "Qwen team, Alibaba",
+ premium: true,
+ families: [
+ { name: "Qwen-Image", re: /qwen[-_ ]?image|qwen[-_ ]?edit|\bqi_?2\.1/ },
+ { name: "Qwen-VL", re: /qwen_?3_?vl|qwen3-vl|qwen_?2\.5_?vl/ },
+ { name: "Qwen3", re: /qwen_3_4b|qwen3\.5/ },
+ { name: "Qwen3-TTS", re: /qwen3-tts/ },
+ { name: "Qwen3-ASR", re: /qwen3-asr/ },
+ ],
+ },
+ { id: "ideogram", name: "Ideogram", premium: true, families: [{ name: "Ideogram 4", re: /ideogram[-_ ]?4/ }] },
+ {
+ id: "bfl",
+ name: "Black Forest Labs",
+ premium: true,
+ families: [
+ { name: "FLUX 3", re: /flux[-_. ]?3/ },
+ { name: "FLUX.2", re: /flux[-_. ]?2/ },
+ { name: "FLUX.1", re: /flux[-_. ]?1/ },
+ ],
+ },
+ {
+ id: "wan",
+ name: "Wan team, Alibaba",
+ premium: true,
+ families: [
+ { name: "Wan 2.2", re: /wan[-_ ]?2[._]?2/ },
+ { name: "Wan 2.1", re: /wan[-_ ]?2[._]?1/ },
+ { name: "Wan Animate 2", re: /wan[-_ ]?animate/ },
+ ],
+ },
+ { id: "minimax", name: "MiniMax", premium: true, families: [{ name: "MiniMax H3", re: /minimax[-_ ]?h3/ }] },
+ {
+ id: "krea",
+ name: "Krea",
+ premium: true,
+ families: [
+ { name: "Krea 2", re: /krea[-_ ]?2/ },
+ { name: "FLUX.1 Krea", re: /flux[-_. ]?1[-_. ]?krea/ },
+ ],
+ },
+ { id: "tongyi", name: "Tongyi Lab, Alibaba", premium: true, families: [{ name: "Z-Image", re: /\bz[-_ ]?image/ }] },
+ {
+ id: "lightricks",
+ name: "Lightricks",
+ premium: true,
+ families: [
+ { name: "LTX-2.5", re: /ltx[-_ ]?2\.5/ },
+ { name: "LTX-2.3", re: /ltx[-_ ]?2\.3/ },
+ { name: "LTX-2", re: /ltx[-_ ]?2(?![.\d])/ },
+ ],
+ },
+ {
+ id: "tencent",
+ name: "Tencent",
+ premium: true,
+ families: [
+ { name: "HunyuanVideo 1.5", re: /hunyuanvideo[-_ ]?1\.5/ },
+ { name: "HunyuanVideo-Foley", re: /hunyuanvideo[-_ ]?foley/ },
+ { name: "Hunyuan3D 2.1", re: /hunyuan[-_ ]?3d/ },
+ { name: "Pixal3D", re: /pixal3d/ },
+ ],
+ },
+ { id: "bria", name: "Bria", premium: true, families: [{ name: "FIBO 2", re: /fibo[-_ ]?2/ }] },
+ {
+ id: "meta",
+ name: "Meta",
+ families: [
+ { name: "SAM 3", re: /\bsam[-_ ]?3/ },
+ { name: "DINOv3", re: /dino[-_ ]?v3/ },
+ { name: "Llama 3.1", re: /llama/ },
+ ],
+ },
+ {
+ id: "bytedance",
+ name: "ByteDance",
+ families: [
+ { name: "SeedVR2", re: /seedvr2/ },
+ { name: "Depth Anything", re: /depth[-_ ]?anything/ },
+ { name: "USO", re: /\buso\b|uso-flux/ },
+ { name: "LatentSync", re: /latentsync/ },
+ ],
+ },
+ {
+ id: "stability",
+ name: "Stability AI",
+ families: [
+ { name: "Stable Audio", re: /stable[-_ ]?audio/ },
+ { name: "SDXL", re: /\bsdxl|sd_xl/ },
+ ],
+ },
+ { id: "openmoss", name: "OpenMOSS", families: [{ name: "MOSS-Image", re: /moss[-_ ]?image/ }] },
+ { id: "hidream", name: "HiDream.ai", families: [{ name: "HiDream-I1", re: /hidream/ }] },
+ {
+ id: "microsoft",
+ name: "Microsoft",
+ families: [
+ { name: "TRELLIS.2", re: /trellis[-_. ]?2/ },
+ { name: "MoGe 2", re: /\bmoge/ },
+ ],
+ },
+ { id: "vast", name: "VAST (Tripo)", families: [{ name: "TripoSplat", re: /triposplat/ }] },
+ {
+ id: "nvidia",
+ name: "NVIDIA",
+ families: [
+ { name: "Open-H3 Regenerate", re: /open[-_ ]?h3/ },
+ { name: "RE-USE", re: /\bre-use\b|nemotronlabs/ },
+ ],
+ },
+ {
+ id: "google",
+ name: "Google",
+ families: [
+ { name: "umT5", re: /umt5/ },
+ { name: "Gemma", re: /gemma/ },
+ { name: "T5", re: /t5xxl|t5-base/ },
+ { name: "SigLIP", re: /sigclip|siglip/ },
+ { name: "FILM", re: /film_net|\(film\b/ },
+ ],
+ },
+ { id: "mistral", name: "Mistral AI", families: [{ name: "Mistral Small 3", re: /mistral/ }] },
+ {
+ id: "openai",
+ name: "OpenAI",
+ families: [
+ { name: "Whisper", re: /whisper/ },
+ { name: "CLIP", re: /\bclip_l\b|clip_l[_.]/ },
+ ],
+ },
+ { id: "meigen", name: "MeiGen-AI", families: [{ name: "InfiniteTalk", re: /infinite[-_ ]?talk/ }] },
+ { id: "resemble", name: "Resemble AI", families: [{ name: "Chatterbox", re: /chatterbox/ }] },
+ { id: "bilibili", name: "Bilibili", families: [{ name: "IndexTTS-2", re: /indextts/ }] },
+ { id: "openbmb", name: "OpenBMB", families: [{ name: "VoxCPM2", re: /voxcpm/ }] },
+ { id: "ace", name: "ACE Studio and StepFun", families: [{ name: "ACE-Step 1.5", re: /ace[-_ ]?step/ }] },
+ { id: "funaudiollm", name: "FunAudioLLM", families: [{ name: "ThinkSound", re: /thinksound/ }] },
+ { id: "mmaudio", name: "Ho Kei Cheng", families: [{ name: "MMAudio", re: /mmaudio/ }] },
+ { id: "netflix", name: "Netflix", families: [{ name: "VOID", re: /(?:^|[^a-z])void(?:[^a-z]|$)/ }] },
+ { id: "birefnet", name: "Peng Zheng", families: [{ name: "BiRefNet", re: /birefnet/ }] },
+ { id: "esrgan", name: "Xintao Wang", families: [{ name: "Real-ESRGAN", re: /esrgan/ }] },
+ { id: "rife", name: "Zhewei Huang", families: [{ name: "RIFE", re: /\brife\b|rife_v/ }] },
+ { id: "dbs", name: "Kai Li", families: [{ name: "DBS", re: /\bdbs\b|dbs-/ }] },
+ { id: "insightface", name: "InsightFace", families: [{ name: "inswapper", re: /inswapper/ }] },
+];
+
+/** The makers and families a piece of text names (a file name, a row's name or vendor, in lower case). */
+function familiesIn(text: string): [string, string][] {
+ return MAKERS.flatMap((m) => m.families.filter((f) => f.re.test(text)).map((f): [string, string] => [m.id, f.name]));
+}
+
+/** A download's file name and its repository ("comfy-org/qwen-image-2.1"), in lower case. */
+function downloadParts(url: string): { file: string; repo: string } {
+ const clean = url.split("?")[0];
+ let file = clean.split("/").at(-1) ?? "";
+ try {
+ file = decodeURIComponent(file);
+ } catch {
+ // A file name that isn't valid percent-encoding is read as it is.
+ }
+ const repo = /^https:\/\/(?:huggingface\.co|github\.com)\/(?:datasets\/)?([^/]+\/[^/]+)/.exec(clean)?.[1] ?? "";
+ return { file: file.toLowerCase(), repo: repo.toLowerCase() };
+}
+
+/**
+ * The makers whose weights a tool runs, with the family of each, as [maker id, family]: from the files its workflows
+ * download (a file's own name, else its repository's when the name says nothing, like "model.safetensors"), its name
+ * and its vendor.
+ */
+export function makersOf(name: string, by: string, downloads: string[]): [string, string][] {
+ const found = [
+ ...downloads.flatMap((u) => {
+ const { file, repo } = downloadParts(u);
+ const own = familiesIn(file);
+ return own.length ? own : familiesIn(repo);
+ }),
+ ...familiesIn(name.toLowerCase()),
+ ...familiesIn(by.toLowerCase()),
+ ];
+ return [...new Map(found.map((f) => [f.join("|"), f])).values()];
+}
+
/** A model's kind, or a library workflow's capability, as a group. */
export function groupOf(kind: string): ThanksGroupId {
if (kind === "image" || kind === "video" || kind === "audio" || kind === "text") return kind;
@@ -199,6 +441,8 @@ export function buildThanks(input: ThanksInput): Thanks {
const list = buildLicenceList(input.models, input.workflows);
const model = new Map(input.models.map((m) => [m.id, m]));
const workflow = new Map(input.workflows.map((w) => [w.id, w]));
+ // The model makers: how many rows run each of their families.
+ const families = new Map<string, Map<string, number>>();
for (const r of list.rows) {
const m = model.get(r.id);
const wf = workflow.get(r.workflows[0]);
@@ -209,6 +453,14 @@ export function buildThanks(input: ThanksInput): Thanks {
].filter(Boolean);
own.forEach((n) => credit(n, r.name));
const card = wf?.models?.map((x) => modelCardOf(x.url)).find(Boolean);
+ const downloads = r.workflows.flatMap((id) => workflow.get(id)?.models ?? []).flatMap((x) => (x.url ? [x.url] : []));
+ const made = makersOf(r.name, r.by, downloads);
+ for (const [maker, family] of made) {
+ const counts = families.get(maker) ?? new Map<string, number>();
+ counts.set(family, (counts.get(family) ?? 0) + 1);
+ families.set(maker, counts);
+ }
+ const makers = [...new Set(made.map(([id]) => id))];
groups.get(groupOf(r.kind))!.push({
id: `model:${r.id}`,
name: r.name,
@@ -218,6 +470,7 @@ export function buildThanks(input: ThanksInput): Thanks {
licences: rowLicences(r.licences, r.links),
...(conditions.length && { condition: conditions.join(". ") }),
...(own.length && { credits: own }),
+ ...(makers.length && { makers }),
});
}
// Cloud models whose results carry a name too (TRELLIS.2 and TripoSplat on fal encode with DINOv3).
@@ -266,7 +519,7 @@ export function buildThanks(input: ThanksInput): Thanks {
// Code: Fuobe itself, ComfyUI, the code and data its tools credit, and the packages the app ships with.
const code = groups.get("code")!;
code.push({ id: "code:fuobe", name: "Fuobe", url: FUOBE_REPO, use: "This app, open source", licences: [{ name: "MIT", url: `${FUOBE_REPO}/blob/main/LICENSE` }] });
- code.push({ id: "code:comfyui", name: "ComfyUI", maker: "Comfy Org", url: COMFYUI_REPO, use: "Runs the open models on your GPU", licences: [{ name: "GPL-3.0", url: SPDX("GPL-3.0-only") }] });
+ code.push({ id: "code:comfyui", name: COMFYUI.name, maker: COMFYUI.maker, url: COMFYUI.url, use: "Runs the open models on your GPU", licences: [{ ...COMFYUI.licence }] });
// The Character swap's workflow (its models, LoRAs and node packs are listed above).
for (const l of CHARACTER_LICENCES.filter((x) => /workflow/i.test(x.item))) {
code.push({ id: `code:${l.item}`, name: l.item, maker: ownerOf(l.url), url: l.url, use: "The Character swap's ComfyUI graph", licences: [{ name: l.name, url: l.url }] });
@@ -297,7 +550,35 @@ export function buildThanks(input: ThanksInput): Thanks {
});
}
+ // Built on: ComfyUI, where the open weights are hosted, the app's frameworks and FFmpeg, each only when Fuobe uses it.
+ const builtOn: ThanksProject[] = [{ id: "comfyui", name: COMFYUI.name, maker: COMFYUI.maker, url: COMFYUI.url, use: "Every open model in Fuobe runs through ComfyUI, on your own GPU.", licence: { ...COMFYUI.licence } }];
+ if (input.workflows.some((w) => w.models?.some((x) => x.url?.startsWith("https://huggingface.co/")))) {
+ builtOn.push({ id: "huggingface", name: "Hugging Face", maker: "Hugging Face", url: "https://huggingface.co", use: "Hosts the open model files Fuobe runs" });
+ }
+ for (const b of BUILT_ON_PACKAGES) {
+ const p = input.packages.find((x) => x.name === b.pkg);
+ if (!p) continue;
+ const url = spdxLink(p.license);
+ builtOn.push({ id: `package:${p.name}`, name: b.name, maker: b.maker, url: p.url ?? `https://www.npmjs.com/package/${p.name}`, use: b.use, licence: { name: p.license || "See its page", ...(url && { url }) } });
+ }
+ // FFmpeg: the cloud joins run on fal's FFmpeg API, and VideoHelperSuite reads and writes video with it in ComfyUI.
+ if (input.models.some((m) => m.routes.some((r) => /ffmpeg/i.test(r.endpoint))) || input.workflows.some((w) => w.packs?.includes("ComfyUI-VideoHelperSuite"))) {
+ builtOn.push({ id: "ffmpeg", name: "FFmpeg", maker: "The FFmpeg developers", url: "https://ffmpeg.org", use: "Joins, encodes and reads video", licence: { name: "LGPL-2.1+", url: "https://ffmpeg.org/legal.html" } });
+ }
+
+ const modelRows = GROUP_ORDER.filter((g) => g !== "loras" && g !== "packs" && g !== "code").flatMap((g) => groups.get(g)!);
+ const makers = MAKERS.flatMap((m) => {
+ const counts = families.get(m.id);
+ if (!counts) return [];
+ const maker: ThanksMaker = { id: m.id, name: m.name, models: m.families.map((f) => f.name).filter((f) => counts.has(f)), count: modelRows.filter((r) => r.makers?.includes(m.id)).length };
+ return [{ maker, premium: !!m.premium }];
+ })
+ .sort((a, b) => Number(b.premium) - Number(a.premium) || b.maker.count - a.maker.count || a.maker.name.localeCompare(b.maker.name))
+ .map((x) => x.maker);
+
return {
+ builtOn,
+ makers,
credits: [...credits].map(([text, names]) => ({ text, names })),
groups: GROUP_ORDER.map((id) => ({ id, title: GROUP_TITLE[id], rows: groups.get(id)! })).filter((g) => g.rows.length),
};
@@ -312,7 +593,7 @@ export function searchText(r: ThanksRow): string {
export function packageFacts(pkg: { name?: string; description?: string; license?: unknown; author?: unknown; repository?: unknown; homepage?: unknown }): Omit<ThanksPackage, "name"> {
const author = typeof pkg.author === "string" ? pkg.author : (pkg.author as { name?: string } | undefined)?.name;
const repo = typeof pkg.repository === "string" ? pkg.repository : (pkg.repository as { url?: string } | undefined)?.url;
- const github = repo && /github\.com[/:]([^/]+)\/([^/#.]+)/.exec(repo);
+ const github = repo && /github\.com[/:]([^/]+)\/([^/#]+?)(?:\.git)?(?:[/#]|$)/.exec(repo);
const shorthand = repo && /^([\w.-]+)\/([\w.-]+)$/.exec(repo);
const url = github ? `https://github.com/${github[1]}/${github[2]}` : shorthand ? `https://github.com/${shorthand[1]}/${shorthand[2]}` : typeof pkg.homepage === "string" ? pkg.homepage : undefined;
const maker = author?.replace(/\s*[<(].*$/, "").trim() || (github?.[1] ?? shorthand?.[1]);
diff --git a/tests/e2e/thanks-licences.mjs b/tests/e2e/thanks-licences.mjs
index bda1bfc0..81a6fb44 100644
--- a/tests/e2e/thanks-licences.mjs
+++ b/tests/e2e/thanks-licences.mjs
@@ -1,6 +1,8 @@
-// Thanks & licences, as a guest: the page opens from the footer and lists every group with its jump chips, the credits
-// some licences ask for, a search that narrows the rows and says when nothing matches, and no sideways scroll at 390 and
-// 1440 px, light and dark, with 44 px taps on a phone. Then six feature pages that used to show licence notes show none.
+// Thanks & licences, as a guest: the page opens from the footer with Built on at the top (ComfyUI first, with its
+// licence), the model makers (a maker's card keeps only its rows until cleared), the names some licences ask for (each
+// with a Show all list), then every group with its jump chips, a search that narrows the rows and says when nothing
+// matches, and no sideways scroll at 390 and 1440 px, light and dark, with 44 px taps on a phone. Then six feature pages
+// that used to show licence notes show none.
// Usage: node tests/e2e/thanks-licences.mjs [appUrl] [--shots <dir>] (the app with a password and FUOBE_PUBLIC_SIGNUP=1,
// so a browser with no session is a guest). Exits 1 on a failed check.
import fs from "node:fs";
@@ -49,20 +51,56 @@ for (const [label, device] of [
const chips = (await nav.getByRole("link").allInnerTexts()).map((t) => t.replace(/\s+\d+$/, "").trim());
check(`${tag}: a jump chip for each group`, GROUPS.every((g) => chips.includes(g)), chips.join(", "));
for (const g of GROUPS) check(`${tag}: ${g} is listed`, (await page.getByRole("heading", { level: 2, name: new RegExp(`^${g.replace(/[()]/g, "\\$&")}`) }).count()) === 1);
- const credits = await page.locator("#thanks-credits").locator("..").innerText();
+ // Built on: ComfyUI first, with its page and licence.
+ const builtOn = page.locator("#thanks-built-on").locator("..");
+ const firstName = (await builtOn.locator("p.font-heading").first().innerText()).trim();
+ check(`${tag}: Built on thanks ComfyUI first`, firstName === "ComfyUI", firstName);
+ check(`${tag}: ComfyUI links its code and its GPL-3.0 licence`, (await builtOn.locator('a[href="https://github.com/Comfy-Org/ComfyUI"]').count()) > 0 && (await builtOn.getByRole("link", { name: /GPL-3\.0/ }).count()) > 0);
+ const builtText = await builtOn.innerText();
+ check(`${tag}: Built on names Hugging Face, Next.js, React, three.js and FFmpeg`, ["Hugging Face", "Next.js", "React", "three.js", "FFmpeg"].every((n) => builtText.includes(n)));
+ check(`${tag}: the model makers name Qwen, Ideogram, Black Forest Labs, Wan and MiniMax`, ["Qwen team", "Ideogram", "Black Forest Labs", "Wan team", "MiniMax"].every((n) => builtText.includes(n)));
+
+ // The names licences ask for stay on show, each with a count and a Show all list.
+ const creditsBox = page.locator("#thanks-credits").locator("..");
+ const credits = await creditsBox.innerText();
check(`${tag}: the credits name MiniMax H3, DINOv3 and Llama`, /MiniMax H3/.test(credits) && /Built with DINOv3/.test(credits) && /Built with Llama/.test(credits));
+ check(`${tag}: and say why they're there`, /licences ask us to show their name/.test(credits));
+ const h3 = creditsBox.locator("li", { hasText: "MiniMax H3" }).first();
+ check(`${tag}: MiniMax H3 says how many rows carry it`, /In \d+ models and tools/.test(await h3.innerText()));
+ const h3List = h3.locator("details ul");
+ check(`${tag}: its list is folded away`, !(await h3List.isVisible()));
+ await h3.locator("summary").click();
+ check(`${tag}: Show all lists every one`, (await h3List.isVisible()) && (await h3List.locator("li").count()) > 5, `${await h3List.locator("li").count()} names`);
check(`${tag}: no sideways scroll`, await noSideways(page));
if (label === "390") {
const small = await page.evaluate(() =>
- [...document.querySelectorAll("[data-thanks] a, [data-thanks] button, [data-thanks] input, a[href=\"/settings#about\"]")]
+ [...document.querySelectorAll("[data-thanks] a, [data-thanks] button, [data-thanks] input, [data-thanks] summary, a[href=\"/settings#about\"]")]
.filter((el) => el.getClientRects().length && getComputedStyle(el).visibility !== "hidden")
.map((el) => ({ h: el.getBoundingClientRect().height, t: (el.textContent || el.getAttribute("aria-label") || el.getAttribute("placeholder") || "").trim().slice(0, 30) }))
.filter((x) => x.h < 43.5),
);
check(`${tag}: every tap target is at least 44 px tall`, small.length === 0, small.slice(0, 4).map((s) => `${s.t}=${Math.round(s.h)}`).join(" | "));
}
+ await h3.locator("summary").click();
+ await page.evaluate(() => scrollTo(0, 0));
+ await page.waitForTimeout(300);
await shot(page, `thanks-${label}-${scheme}`);
+ // A maker's card keeps only the rows that run its models, until it is cleared.
+ await page.locator('a[href="#by-ideogram"]').click();
+ await page.waitForTimeout(1200);
+ const status = page.getByRole("status").filter({ hasText: "Models by" });
+ check(`${tag}: a maker's card filters the list`, (await status.innerText().catch(() => "")).includes("Ideogram"));
+ const imageRows = await page.locator("#thanks-image li").allInnerTexts();
+ check(`${tag}: to that maker's rows`, imageRows.length > 0 && imageRows.some((t) => t.includes("Ideogram 4")) && (await page.locator("#thanks-loras").count()) === 0, `${imageRows.length} image rows`);
+ const listTop = await page.locator("#thanks-image").evaluate((el) => el.getBoundingClientRect().top);
+ const viewH = await page.evaluate(() => innerHeight);
+ check(`${tag}: and brings them into view`, listTop > 0 && listTop < viewH - 80, `top ${Math.round(listTop)} of ${viewH}`);
+ await shot(page, `thanks-${label}-${scheme}-maker`);
+ await page.getByRole("button", { name: "Show everything" }).click();
+ await page.waitForTimeout(400);
+ check(`${tag}: clearing the maker brings every group back`, (await page.locator("section[id^='thanks-']").count()) >= GROUPS.length);
+
// A chip jumps to its group.
await nav.getByRole("link", { name: /^ComfyUI node packs/ }).click();
await page.waitForTimeout(2000);
diff --git a/tests/thanks.test.ts b/tests/thanks.test.ts
index b1ce6d1d..af6ab13b 100644
--- a/tests/thanks.test.ts
+++ b/tests/thanks.test.ts
@@ -8,7 +8,7 @@ import { CLOUD_NOTICES } from "@/lib/av/model3d";
import { MODELS } from "@/lib/catalog";
import { ATTRIBUTIONS, buildLicenceList, licenceInfo, NODE_PACKS, OPENMDW_NOTICE } from "@/lib/licences";
import { loraLicenceRows } from "@/lib/lora-licences";
-import { baseLabel, buildThanks, groupOf, ownerOf, packageFacts, searchText, shownName } from "@/lib/thanks";
+import { BUILT_ON_PACKAGES, baseLabel, buildThanks, COMFYUI, groupOf, MAKERS, makersOf, ownerOf, packageFacts, searchText, shownName } from "@/lib/thanks";
import { readThanks } from "@/server/thanks";
const ROOT = path.join(__dirname, "..");
@@ -106,8 +106,125 @@ describe("Thanks & licences", () => {
license: "MIT",
});
expect(packageFacts({ repository: "vercel/next.js" })).toEqual({ author: "vercel", url: "https://github.com/vercel/next.js" });
+ // A repository name with a dot keeps it ("three.js"), and ".git" is dropped.
+ expect(packageFacts({ repository: { url: "git+https://github.com/mrdoob/three.js.git" } }).url).toBe("https://github.com/mrdoob/three.js");
// A model's licence is said once per name, linked where the data has a page.
const empty = buildThanks({ models: [], workflows: [], loras: [], packages: [] });
expect(empty.groups.map((g) => g.id)).toEqual(["packs", "code"]);
});
+
+ it("thanks ComfyUI first in Built on, with its page and licence, and keeps its row under Code and libraries", () => {
+ const [comfy] = thanks.builtOn;
+ expect(comfy).toMatchObject({ id: "comfyui", name: "ComfyUI", maker: "Comfy Org", url: COMFYUI.url, licence: { name: "GPL-3.0" } });
+ expect(comfy.url).toBe("https://github.com/Comfy-Org/ComfyUI");
+ expect(comfy.licence?.url).toMatch(/^https:\/\/spdx\.org\/licenses\/GPL-3\.0/);
+ expect(comfy.use).toMatch(/your own GPU/);
+ // On the page: Built on comes first, ComfyUI first in it, then the model makers, the named credits and the list.
+ const at = (s: string) => html.indexOf(s);
+ expect(at('id="thanks-built-on"')).toBeGreaterThan(-1);
+ expect(at('id="thanks-built-on"')).toBeLessThan(at(">ComfyUI<"));
+ expect(at(">ComfyUI<")).toBeLessThan(at('id="thanks-makers"'));
+ expect(at('id="thanks-makers"')).toBeLessThan(at('id="thanks-credits"'));
+ expect(at('id="thanks-credits"')).toBeLessThan(at('id="thanks-list"'));
+ expect(html).toContain(`href="${COMFYUI.url}"`);
+ expect(html).toContain(`href="${comfy.licence!.url}"`);
+ expect(thanks.groups.find((g) => g.id === "code")!.rows.find((r) => r.id === "code:comfyui")).toMatchObject({ name: "ComfyUI", url: COMFYUI.url });
+ });
+
+ it("thanks in Built on only what Fuobe really uses, each with a link and, for code, its licence", () => {
+ const raw = JSON.parse(fs.readFileSync(path.join(ROOT, "workflows", "comfyui", "manifest.json"), "utf8")) as {
+ workflows: { models?: { url?: string }[]; customNodes?: { name: string }[] }[];
+ };
+ const ids = thanks.builtOn.map((b) => b.id);
+ expect(new Set(ids).size).toBe(ids.length);
+ expect(ids).toEqual(expect.arrayContaining(["comfyui", "huggingface", "package:next", "package:react", "package:three", "ffmpeg"]));
+ for (const b of thanks.builtOn) {
+ expect(b.url, b.id).toMatch(/^https:\/\//);
+ expect(b.use.trim(), b.id).not.toBe("");
+ expect(shown(b.name), b.name).toBe(true);
+ if (b.id === "huggingface") {
+ // A host, not code: the open weights come from there.
+ expect(raw.workflows.some((w) => w.models?.some((m) => m.url?.startsWith("https://huggingface.co/")))).toBe(true);
+ expect(b.licence).toBeUndefined();
+ continue;
+ }
+ expect(b.licence?.name, b.id).toBeTruthy();
+ expect(b.licence?.url, b.id).toMatch(/^https:\/\//);
+ if (b.id.startsWith("package:")) {
+ const name = b.id.slice("package:".length);
+ expect(Object.keys(pkg.dependencies), name).toContain(name);
+ const own = JSON.parse(fs.readFileSync(path.join(ROOT, "node_modules", name, "package.json"), "utf8")) as { license?: string };
+ expect(b.licence?.name).toBe(own.license);
+ }
+ if (b.id === "ffmpeg") {
+ const cloud = MODELS.some((m) => m.routes.some((r) => /ffmpeg/i.test(r.endpoint)));
+ const comfyPack = raw.workflows.some((w) => w.customNodes?.some((n) => n.name === "ComfyUI-VideoHelperSuite"));
+ expect(cloud || comfyPack).toBe(true);
+ }
+ }
+ expect(BUILT_ON_PACKAGES.every((p) => ids.includes(`package:${p.pkg}`) === p.pkg in pkg.dependencies)).toBe(true);
+ // With nothing to go on, only ComfyUI is thanked.
+ expect(buildThanks({ models: [], workflows: [], loras: [], packages: [] }).builtOn.map((b) => b.id)).toEqual(["comfyui"]);
+ });
+
+ it("thanks the model makers whose models Fuobe runs, premium image and video makers first, each linking to its rows", () => {
+ const modelRows = thanks.groups.filter((g) => !["loras", "packs", "code"].includes(g.id)).flatMap((g) => g.rows);
+ expect(thanks.makers.map((m) => m.id)).toEqual(expect.arrayContaining(["qwen", "ideogram", "bfl", "wan", "minimax", "lightricks", "tencent", "meta", "stability"]));
+ const premium = new Set(MAKERS.filter((m) => m.premium).map((m) => m.id));
+ const firstOther = thanks.makers.findIndex((m) => !premium.has(m.id));
+ expect(firstOther).toBeGreaterThan(0);
+ expect(thanks.makers.slice(firstOther).every((m) => !premium.has(m.id))).toBe(true);
+ for (const m of thanks.makers) {
+ // Only makers some row runs, with the count of those rows and the families found.
+ expect(m.count, m.id).toBeGreaterThan(0);
+ expect(m.count, m.id).toBe(modelRows.filter((r) => r.makers?.includes(m.id)).length);
+ expect(m.models.length, m.id).toBeGreaterThan(0);
+ const def = MAKERS.find((d) => d.id === m.id)!;
+ for (const f of m.models) expect(def.families.map((x) => x.name), m.id).toContain(f);
+ expect(html).toContain(`href="#by-${m.id}"`);
+ expect(shown(m.name), m.name).toBe(true);
+ }
+ // Within each tier, the most used first.
+ for (const tier of [thanks.makers.slice(0, firstOther), thanks.makers.slice(firstOther)]) {
+ expect(tier.map((m) => m.count)).toEqual([...tier.map((m) => m.count)].sort((a, b) => b - a));
+ }
+ // Qwen-Image and Ideogram 4 are thanked by name, and every premium maker shows before "Show more".
+ expect(thanks.makers.find((m) => m.id === "qwen")!.models[0]).toBe("Qwen-Image");
+ expect(thanks.makers.find((m) => m.id === "ideogram")!.models).toEqual(["Ideogram 4"]);
+ const more = html.indexOf("more makers");
+ for (const m of thanks.makers.slice(0, firstOther)) expect(html.indexOf(`href="#by-${m.id}"`), m.id).toBeLessThan(more === -1 ? Infinity : more);
+ // A maker no row runs isn't thanked.
+ expect(buildThanks({ models: [], workflows: [], loras: [], packages: [] }).makers).toEqual([]);
+ });
+
+ it("finds a tool's makers in the files it downloads, its name and its vendor", () => {
+ // A text reader stored in another model's folder counts for its own maker, not the folder's.
+ expect(makersOf("Krea 2 Turbo", "Krea", ["https://huggingface.co/Comfy-Org/Fibo-2.0/resolve/main/split_files/text_encoders/qwen3vl_4b_int8_convrot.safetensors"])).toEqual([
+ ["qwen", "Qwen-VL"],
+ ["krea", "Krea 2"],
+ ]);
+ // A file whose name says nothing is read by its repository.
+ expect(makersOf("Clean up voice", "nvidia", ["https://huggingface.co/nvidia/NVIDIA-NemotronLabs-RE-USE/resolve/main/model.safetensors"])).toEqual([["nvidia", "RE-USE"]]);
+ expect(makersOf("Chatterbox Multilingual", "Resemble AI", [])).toEqual([["resemble", "Chatterbox"]]);
+ expect(makersOf("Fuobe Soul", "Fuobe Original", ["https://huggingface.co/Comfy-Org/z_image_turbo/resolve/main/split_files/diffusion_models/z_image_turbo_bf16.safetensors"])).toEqual([["tongyi", "Z-Image"]]);
+ expect(makersOf("Avoid me", "Someone", [])).toEqual([]);
+ });
+
+ it("shows each name a licence asks for, with how many rows carry it and the full list behind Show all", () => {
+ const plain = (s: string) => s.replace(/&#x27;|&#39;/g, "'").replace(/&amp;/g, "&").replace(/&quot;/g, '"');
+ for (const c of thanks.credits) {
+ expect(text, c.text).toContain(c.text);
+ if (c.names.length === 1) {
+ expect(text).toContain(`In ${c.names[0]}`);
+ continue;
+ }
+ expect(text).toContain(`In ${c.names.length} models and tools`);
+ const at = html.indexOf(`>${c.text}<`, html.indexOf('id="thanks-credits"'));
+ const block = plain(html.slice(at, html.indexOf("</details>", at)));
+ expect(block, c.text).toContain("<details");
+ expect(block, c.text).toContain("Show all");
+ for (const n of c.names) expect(block, n).toContain(n);
+ }
+ expect(text).toMatch(/Some licences ask us to show their name/);
+ });
});