The open creative studio on ComfyUI: images, video, 3D and audio on open weights, on your own GPU or the cloud. Camera motions, effects, apps, Cinema, Layers, Image to 3D and an AI agent.
TypeScript ai-videocomfyuicreative-toolsgenerative-aiideogramimage-generationimage-to-3dimage-to-videoltx-videominimax-h3nextjsopen-sourceopen-weightsqwen-imagetext-to-imagevideo-generationwan
#!/usr/bin/env node
/**
* Writes CREDITS.md at the repo root: the notices and attributions the licences of Fuobe's open models and bundled code
* ask for, and the licence of every open model it runs. The data is src/lib/licences.ts, the catalog and the ComfyUI
* manifest (workflows/comfyui/manifest.json), so run it again after any of them changes:
*
* node scripts/credits.mjs write CREDITS.md
* node scripts/credits.mjs --check exit 1 when CREDITS.md is out of date
*/
import fs from "node:fs";
import { registerHooks } from "node:module";
import path from "node:path";
import { fileURLToPath, pathToFileURL } from "node:url";
import { resolve } from "./lib/ts-paths.mjs";
registerHooks({ resolve });
// Node reads src/ as ES modules after a first look: that note is expected here.
process.removeAllListeners("warning");
process.on("warning", (w) => w.name !== "Warning" || !/Module type of/.test(w.message) ? console.warn(`${w.name}: ${w.message}`) : undefined);
const ROOT = path.join(path.dirname(fileURLToPath(import.meta.url)), "..");
const OUT = path.join(ROOT, "CREDITS.md");
const load = (p) => import(pathToFileURL(path.join(ROOT, p)).href);
const { ATTRIBUTIONS, FLAG_LABEL, NODE_PACKS, buildLicenceList, kindLabel } = await load("src/lib/licences.ts");
const { MODELS } = await load("src/lib/catalog/index.ts");
const manifest = JSON.parse(fs.readFileSync(path.join(ROOT, "workflows", "comfyui", "manifest.json"), "utf8"));
const list = buildLicenceList(
MODELS.map((m) => ({ id: m.id, name: m.name, vendor: m.vendor, kind: m.kind, hidden: m.hidden, routes: m.routes.map((r) => ({ provider: r.provider, endpoint: r.endpoint })) })),
(manifest.workflows ?? []).map((w) => ({ id: w.id, title: w.title, capability: w.capability, license: w.license, models: (w.models ?? []).map((m) => ({ url: m.url, sizeGb: m.sizeGb })) })),
);
/** Text for a Markdown table cell: no pipes or line breaks. */
const cell = (s) => String(s ?? "").replace(/\|/g, "\\|").replace(/\s*\n\s*/g, " ").trim();
const link = (text, url) => (url ? `[${text}](${url})` : text);
const out = [];
out.push("# Credits", "");
out.push(
"Fuobe's own code is open source under the [MIT licence](LICENSE). The open models it runs, and the code that comes with them, each have their own licence. This file lists the notices and attributions those licences ask for, then the licence of every open model Fuobe runs.",
"",
"Most allow commercial use; some have conditions, some are non-commercial and a few aren't available everywhere. Read a model's own licence before you sell what you make with it. This list is a guide, not legal advice.",
"",
"This file is generated by `node scripts/credits.mjs` from `src/lib/licences.ts`, the model catalog and `workflows/comfyui/manifest.json`.",
"",
);
if (list.notices.length) {
out.push("## Notices", "", "Some licences ask the app that runs their model to say so.", "");
for (const n of list.notices) out.push(`- **${n.text}**: ${n.models.join(", ")}`);
out.push("");
}
out.push("## Attributions", "");
for (const a of ATTRIBUTIONS) {
out.push(`- ${link(a.text, a.url)}. ${a.licence}. For ${a.for.charAt(0).toLowerCase()}${a.for.slice(1)}.${a.note ? ` ${a.note}` : ""}`);
}
out.push("");
const c = list.counts;
out.push("## Open model licences", "");
out.push(
`${c.all} models, one row for each set of open weights Fuobe runs: ${c.clear} allow commercial use, ${c.conditions} with conditions, ${c["non-commercial"]} are non-commercial and ${c.territory} aren't available everywhere.`,
"",
);
out.push("| Model | By | Kind | Licence | Note |", "| --- | --- | --- | --- | --- |");
for (const r of list.rows) {
const licences = r.licences.map((l, i) => link(cell(l), r.links[i])).join("; ");
const note = r.flags.map((f) => (f === "territory" && r.excludes ? `Not available in ${r.excludes}` : FLAG_LABEL[f])).join(", ");
out.push(`| ${cell(r.name)} | ${cell(r.by)} | ${cell(kindLabel(r.kind))} | ${licences} | ${cell(note)} |`);
}
out.push("");
if (list.noWeights.length) {
out.push("## Tools with no model weights", "", `These run on ComfyUI's own nodes or Fuobe's code, under their MIT and GPL licences: ${list.noWeights.join(", ")}.`, "");
}
out.push("## ComfyUI node packs", "", "The custom nodes Fuobe's workflows install, with their licences.", "");
out.push("| Node pack | Licence | Note |", "| --- | --- | --- |");
for (const p of NODE_PACKS) {
const licence = p.licence.url && p.licence.url !== p.repo ? link(cell(p.licence.name), p.licence.url) : cell(p.licence.name);
out.push(`| ${link(cell(p.name), p.repo)} | ${licence} | ${cell(p.licence.note)} |`);
}
out.push("");
out.push(
"## Elsewhere",
"",
"Models you run in Ollama, LM Studio or Unsloth Studio for Assist and prompt help carry their own licences: see each model's card, or `ollama show <model> --license` in Ollama.",
"",
);
const text = out.join("\n");
if (process.argv.includes("--check")) {
const now = fs.existsSync(OUT) ? fs.readFileSync(OUT, "utf8") : "";
if (now !== text) {
console.error("CREDITS.md is out of date: run node scripts/credits.mjs");
process.exit(1);
}
console.log("CREDITS.md is up to date");
} else {
fs.writeFileSync(OUT, text);
console.log(`Wrote CREDITS.md: ${list.rows.length} models, ${ATTRIBUTIONS.length} attributions, ${NODE_PACKS.length} node packs`);
}