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
Image: Bria RMBG-3.0 cut-outs on your GPU
Adarsha4047094dff0
diff --git a/scripts/comfy/hand-built/bg-remove-rmbg3.json b/scripts/comfy/hand-built/bg-remove-rmbg3.jsonnew file mode 100644index 00000000..489ed80d--- /dev/null+++ b/scripts/comfy/hand-built/bg-remove-rmbg3.json@@ -0,0 +1,200 @@+{+ "1": {+ "class_type": "LoadImage",+ "inputs": {+ "image": "input.png"+ },+ "_meta": {+ "title": "Picture (image)"+ }+ },+ "2": {+ "class_type": "UNETLoader",+ "inputs": {+ "unet_name": "RMBG-3.0-bf16.safetensors",+ "weight_dtype": "default"+ },+ "_meta": {+ "title": "RMBG-3.0 (FIBO 2 Edit Turbo fine-tune, bf16)"+ }+ },+ "3": {+ "class_type": "CLIPLoader",+ "inputs": {+ "clip_name": "qwen3vl_4b_int8_convrot.safetensors",+ "type": "fibo2",+ "device": "default"+ },+ "_meta": {+ "title": "Qwen3-VL 4B (FIBO 2 encoder, int8)"+ }+ },+ "4": {+ "class_type": "VAELoader",+ "inputs": {+ "vae_name": "flux2-vae.safetensors"+ },+ "_meta": {+ "title": "FLUX.2 VAE"+ }+ },+ "5": {+ "class_type": "TextEncodeFibo2",+ "inputs": {+ "clip": [+ "3",+ 0+ ],+ "prompt": "{\"edit_instruction\": \"Generate a detailed grayscale alpha matte. Map the opaque foreground to white and the background to black. Produce soft, anti-aliased grayscale gradients at the edges of the subject to represent fine details and transparency.\"}",+ "negative_prompt": "",+ "vae": [+ "4",+ 0+ ],+ "images.image_1": [+ "1",+ 0+ ],+ "width": 0,+ "height": 0,+ "batch_size": 1+ },+ "_meta": {+ "title": "The fixed matte instruction, with the picture"+ }+ },+ "6": {+ "class_type": "KSampler",+ "inputs": {+ "model": [+ "2",+ 0+ ],+ "positive": [+ "5",+ 0+ ],+ "negative": [+ "5",+ 1+ ],+ "latent_image": [+ "5",+ 2+ ],+ "seed": 0,+ "steps": 4,+ "cfg": 1,+ "sampler_name": "euler",+ "scheduler": "simple",+ "denoise": 1+ },+ "_meta": {+ "title": "Sampler (4 steps, CFG 1, euler / simple)"+ }+ },+ "7": {+ "class_type": "VAEDecode",+ "inputs": {+ "samples": [+ "6",+ 0+ ],+ "vae": [+ "4",+ 0+ ]+ },+ "_meta": {+ "title": "The matte (white = the subject)"+ }+ },+ "8": {+ "class_type": "GetImageSize",+ "inputs": {+ "image": [+ "1",+ 0+ ]+ },+ "_meta": {+ "title": "The picture size"+ }+ },+ "9": {+ "class_type": "ImageScale",+ "inputs": {+ "image": [+ "7",+ 0+ ],+ "upscale_method": "lanczos",+ "width": [+ "8",+ 0+ ],+ "height": [+ "8",+ 1+ ],+ "crop": "disabled"+ },+ "_meta": {+ "title": "The matte at the picture size (lanczos)"+ }+ },+ "10": {+ "class_type": "ImageToMask",+ "inputs": {+ "image": [+ "9",+ 0+ ],+ "channel": "red"+ },+ "_meta": {+ "title": "Matte to mask"+ }+ },+ "11": {+ "class_type": "InvertMask",+ "inputs": {+ "mask": [+ "10",+ 0+ ]+ },+ "_meta": {+ "title": "Invert (JoinImageWithAlpha takes 1 = clear)"+ }+ },+ "12": {+ "class_type": "JoinImageWithAlpha",+ "inputs": {+ "image": [+ "1",+ 0+ ],+ "alpha": [+ "11",+ 0+ ]+ },+ "_meta": {+ "title": "The picture with the matte as alpha"+ }+ },+ "13": {+ "class_type": "SaveImage",+ "inputs": {+ "images": [+ "12",+ 0+ ],+ "filename_prefix": "fuobe/bg-remove-rmbg3"+ },+ "_meta": {+ "title": "Save Image (RGBA)"+ }+ }+}diff --git a/scripts/comfy/library.spec.mjs b/scripts/comfy/library.spec.mjsindex e9182287..54c36aa5 100644--- a/scripts/comfy/library.spec.mjs+++ b/scripts/comfy/library.spec.mjs@@ -684,6 +684,9 @@ export const KNOWN_MODELS = {'fibo2_dev_int8_convrot.safetensors': { folder: 'diffusion_models', url: 'https://huggingface.co/Comfy-Org/Fibo-2.0/resolve/main/diffusion_models/fibo2_dev_int8_convrot.safetensors', variants: ['fibo2_dev_bf16.safetensors'] },'fibo2_edit_turbo_int8_convrot.safetensors': { folder: 'diffusion_models', url: 'https://huggingface.co/Comfy-Org/Fibo-2.0/resolve/main/diffusion_models/fibo2_edit_turbo_int8_convrot.safetensors', variants: ['fibo2_edit_turbo_bf16.safetensors'] },'qwen3vl_4b_int8_convrot.safetensors': { folder: 'text_encoders', url: 'https://huggingface.co/Comfy-Org/Fibo-2.0/resolve/main/text_encoders/qwen3vl_4b_int8_convrot.safetensors' },+ // RMBG-3.0 (bg-remove-rmbg3): Bria's FIBO 2 transformer fine-tuned for alpha mattes, as one bf16 file in ComfyUI's key layout+ // (1038lab's repack; scripts/convert-rmbg3.mjs makes the same bytes from Bria's four diffusers shards).+ 'RMBG-3.0-bf16.safetensors': { folder: 'diffusion_models', url: 'https://huggingface.co/1038lab/RMBG-3.0/resolve/f8aa73a836ceeb9c8840e8dc70878b69a7114b78/RMBG-3.0-bf16.safetensors' },'qwen3.5_9b_int8_convrot.safetensors': { folder: 'text_encoders', url: 'https://huggingface.co/Comfy-Org/MOSS-Image/resolve/main/text_encoders/qwen3.5_9b_int8_convrot.safetensors', variants: ['qwen3.5_9b_bf16.safetensors'] },// FLUX 3 Image Klein (research #10 §6.3, nm10-flux3-klein): BFL's ComfyUI repack, gated "auto" (accept the FLUX Kommunity// License on Hugging Face, then a token downloads it), pinned to the revision read on 2026-11-01. Its Qwen3-VL-4B int8 encoder and@@ -1724,6 +1727,28 @@ export const SPEC = ['AILab_FeyNoBg (ComfyUI-RMBG 3.3.0): a 263M Swin-L matting model for hair, fur, glass and lace, no trimap; refine_foreground on (sub-pixel edge refinement), background Alpha -> RGBA PNG. ' +'Needs the nobg Python package (the pack\'s requirements.txt: nobg>=0.3.1). The class is recorded from ComfyUI-RMBG\'s source at the pinned commit.',},+ {+ id: 'bg-remove-rmbg3',+ title: 'Remove background (Bria RMBG-3.0: a soft alpha matte from FIBO 2 Edit Turbo, 4 steps)',+ capability: 'bg-remove',+ handBuilt: 'hand-built/bg-remove-rmbg3.json',+ bindings: { image: [b('1', 'image')] },+ outputs: [{ node: '13', kind: 'image' }],+ limits: { maxWidth: 4096, maxHeight: 4096 },+ vramGb: 32,+ license:+ 'CC-BY-NC-4.0 (Bria RMBG-3.0 weights, non-commercial; 1038lab\'s single-file repack carries the same terms); Qwen3-VL-4B text encoder Apache-2.0; ' ++ 'FLUX.2 VAE Apache-2.0',+ notes:+ 'fibo2-edit-turbo-edit with RMBG-3.0\'s transformer (briaai/RMBG-3.0 at 87330e3f, a fine-tune of FIBO 2.0 Edit Turbo) and the card\'s fixed instruction, ' ++ 'word for word, as the card sends it ({"edit_instruction": ...}): another or no instruction makes a coloured picture, not a matte. Core nodes only. ' ++ 'TextEncodeFibo2 takes the picture as image 1 and makes the latent at FIBO 2\'s trained size for its shape (about 1 MP, centre-cropped, as Bria\'s ' ++ 'pipeline does); 4 steps, CFG 1 (no negative pass), euler / simple, seed 0 as on the card. The decoded matte (white = the subject, grey = partly see-through) ' ++ 'is scaled to the picture\'s size with lanczos (GetImageSize, ImageScale), read as a mask from its red channel, inverted for JoinImageWithAlpha, and ' ++ 'joined to the original picture as its alpha: a transparent PNG at full size. ComfyUI\'s UNETLoader reads one file whose names follow its FIBO 2 layout ' ++ '(fused qkv, to_kv and w13), not Bria\'s four diffusers shards: RMBG-3.0-bf16.safetensors is that file. VRAM: the card measured a 28.5 GiB peak in bf16 ' ++ 'for the whole pipeline; the transformer alone is 15.1 GiB.',+ },{id: 'face-swap-reactor',title: 'Face Swap (ReActor)',diff --git a/scripts/convert-rmbg3.mjs b/scripts/convert-rmbg3.mjsnew file mode 100644index 00000000..c13253dd--- /dev/null+++ b/scripts/convert-rmbg3.mjs@@ -0,0 +1,251 @@+#!/usr/bin/env node+/**+ * Makes RMBG-3.0-bf16.safetensors (bg-remove-rmbg3's model file) from Bria's own files: the four diffusers shards of+ * briaai/RMBG-3.0's transformer, joined into one file in ComfyUI's FIBO 2 key layout. CPU only, no Python, no GPU.+ *+ * node scripts/convert-rmbg3.mjs <folder with the four shards> <ComfyUI models/diffusion_models folder, or a .safetensors path>+ * node scripts/convert-rmbg3.mjs ... --skip-input-check # the shards' sizes and SHA-256 are not checked first+ *+ * The layout: attention to_q / to_k / to_v become one qkv, the cross- and Perceiver attentions' to_k / to_v one to_kv, each+ * SwiGLU's w1 / w3 one w13 (w1 first), to_out.0 becomes out (to_out in the cross- and Perceiver attentions), norm_q / norm_k+ * become q_norm / k_norm in the joint attention; everything else keeps its name. Tensors are copied byte for byte (bf16, no+ * cast), sorted by name, with a header as the safetensors library writes one. The result must match the pin of+ * RMBG-3.0-bf16.safetensors in workflows/comfyui/model-pins.json: it is read back from disk and hashed, and a file that+ * doesn't match is left as <name>.part.+ */+import crypto from "node:crypto";+import fs from "node:fs";+import path from "node:path";+import { fileURLToPath } from "node:url";++export const OUT_FILE = "RMBG-3.0-bf16.safetensors";+/** The download the converted file must equal (its pin in model-pins.json). */+export const OUT_URL = `https://huggingface.co/1038lab/RMBG-3.0/resolve/f8aa73a836ceeb9c8840e8dc70878b69a7114b78/${OUT_FILE}`;+/** Bria's transformer shards at the revision read (sizes and SHA-256 from the Hugging Face API's LFS oids). */+export const SOURCE = { repo: "briaai/RMBG-3.0", revision: "87330e3f87d9d856a21453e5acd120219984a66b", folder: "transformer" };+export const SHARDS = [+ { file: "diffusion_pytorch_model-00001-of-00004.safetensors", sizeBytes: 4996274842, sha256: "51eb0fdada5641207ac896407b7cbc20aef5dbe20c1e6746fe5baa257e916507" },+ { file: "diffusion_pytorch_model-00002-of-00004.safetensors", sizeBytes: 4999943404, sha256: "c0ce25f35dda1d3ee9c1aca8ac573e29b163aa2837f7398da62118906ba29461" },+ { file: "diffusion_pytorch_model-00003-of-00004.safetensors", sizeBytes: 4999944124, sha256: "e19da4c3d63101c68bbd5b65e225cd26434d9d62a8fd87a541b12b7c08ed0d44" },+ { file: "diffusion_pytorch_model-00004-of-00004.safetensors", sizeBytes: 1258606904, sha256: "4ef85b4d5db2e189ba8d5e3d1e218ee0a4009621a7862590ae63403d9b789c41" },+];++const JOINT = String.raw`((?:layers|noise_refiner)\.\d+\.attention)`;+const OTHER_ATTN = String.raw`((?:layers\.\d+\.cross_attention)|(?:perceiver\.layers\.\d+\.(?:cross|self)_attention))`;+const FFN = String.raw`((?:(?:layers|noise_refiner)\.\d+\.feed_forward)|(?:perceiver\.layers\.\d+\.ffn))`;++/** Tensors joined along their first dimension: the pattern of a part, the joined name, and its parts in order. */+const JOINS = [+ { re: new RegExp(`^${JOINT}\\.to_[qkv]\\.weight$`), to: (p) => `${p}.qkv.weight`, parts: (p) => ["q", "k", "v"].map((x) => `${p}.to_${x}.weight`) },+ { re: new RegExp(`^${OTHER_ATTN}\\.to_[kv]\\.weight$`), to: (p) => `${p}.to_kv.weight`, parts: (p) => ["k", "v"].map((x) => `${p}.to_${x}.weight`) },+ { re: new RegExp(`^${FFN}\\.w[13]\\.weight$`), to: (p) => `${p}.w13.weight`, parts: (p) => ["1", "3"].map((x) => `${p}.w${x}.weight`) },+];+/** Tensors renamed: [pattern, the new name]. */+const RENAMES = [+ [new RegExp(`^${JOINT}\\.to_out\\.0\\.weight$`), "$1.out.weight"],+ [new RegExp(`^${JOINT}\\.norm_q\\.weight$`), "$1.q_norm.weight"],+ [new RegExp(`^${JOINT}\\.norm_k\\.weight$`), "$1.k_norm.weight"],+ [new RegExp(`^${OTHER_ATTN}\\.to_out\\.0\\.weight$`), "$1.to_out.weight"],+];+/** Tensors kept as they are. Any other name stops the conversion: the upstream layout changed. */+const KEEPS = [+ /^x_embedder\.(weight|bias)$/,+ /^t_embedder\.mlp\.[02]\.(weight|bias)$/,+ /^final_layer\.(linear|adaLN_modulation\.1)\.(weight|bias)$/,+ /^(layers|noise_refiner)\.\d+\.adaLN_modulation\.0\.(weight|bias)$/,+ /^(layers|noise_refiner)\.\d+\.(attention_norm1|attention_norm2|ffn_norm1|ffn_norm2)\.weight$/,+ /^layers\.\d+\.(cross_attn_norm1|cross_attn_norm2)\.weight$/,+ /^layers\.\d+\.cross_attn_gate$/,+ new RegExp(`^${FFN}\\.w2\\.weight$`),+ new RegExp(`^${OTHER_ATTN}\\.(to_q|norm_q|norm_k)\\.weight$`),+ /^perceiver\.layers\.\d+\.(cross_attn_norm|self_attn_norm|ffn_norm)\.weight$/,+ /^perceiver\.(latent_queries|norm_out\.weight)$/,+];++const DTYPE_BYTES = { BF16: 2, F16: 2, F32: 4, F64: 8, I64: 8, I32: 4, I16: 2, I8: 1, U8: 1, BOOL: 1 };++/** A safetensors file's header: its tensors (name, dtype, shape, absolute byte range) and where the data starts. */+export function readHeader(file) {+ const fd = fs.openSync(file, "r");+ try {+ const len = Buffer.alloc(8);+ fs.readSync(fd, len, 0, 8, 0);+ const n = Number(len.readBigUInt64LE(0));+ if (n <= 0 || n > 100 * 2 ** 20) throw new Error(`${file}: not a safetensors file (header of ${n} bytes)`);+ const json = Buffer.alloc(n);+ fs.readSync(fd, json, 0, n, 8);+ const header = JSON.parse(json.toString("utf8"));+ const tensors = Object.entries(header)+ .filter(([k]) => k !== "__metadata__")+ .map(([name, t]) => ({ name, dtype: t.dtype, shape: t.shape, start: 8 + n + t.data_offsets[0], end: 8 + n + t.data_offsets[1] }));+ return { tensors, dataStart: 8 + n };+ } finally {+ fs.closeSync(fd);+ }+}++/**+ * The output's tensors, sorted by name, each with the byte ranges of the source tensors it is made of (in order).+ * `sources`: every input tensor as readHeader gives it, plus its file.+ */+export function planLayout(sources) {+ const byName = new Map();+ for (const s of sources) {+ if (byName.has(s.name)) throw new Error(`${s.name} is in two shards`);+ byName.set(s.name, s);+ }+ const out = new Map();+ const used = new Set();+ const add = (name, parts) => {+ if (out.has(name)) throw new Error(`${name} would be written twice`);+ const [first] = parts;+ for (const p of parts) {+ if (p.dtype !== first.dtype) throw new Error(`${name}: ${p.name} is ${p.dtype}, ${first.name} is ${first.dtype}`);+ if (JSON.stringify(p.shape.slice(1)) !== JSON.stringify(first.shape.slice(1)) || !p.shape.length) throw new Error(`${name}: ${p.name} has shape [${p.shape}], ${first.name} [${first.shape}]`);+ const want = p.shape.reduce((a, b) => a * b, 1) * (DTYPE_BYTES[p.dtype] ?? NaN);+ if (p.end - p.start !== want) throw new Error(`${p.name}: ${p.end - p.start} bytes for [${p.shape}] ${p.dtype}`);+ }+ const shape = parts.length > 1 ? [parts.reduce((a, p) => a + p.shape[0], 0), ...first.shape.slice(1)] : first.shape;+ out.set(name, { name, dtype: first.dtype, shape, parts: parts.map((p) => ({ file: p.file, start: p.start, end: p.end })) });+ for (const p of parts) used.add(p.name);+ };+ for (const s of byName.values()) {+ if (used.has(s.name)) continue;+ const join = JOINS.find((j) => j.re.test(s.name));+ if (join) {+ const prefix = join.re.exec(s.name)[1];+ const names = join.parts(prefix);+ const parts = names.map((n) => byName.get(n));+ const missing = names.filter((_n, i) => !parts[i]);+ if (missing.length) throw new Error(`${join.to(prefix)}: ${missing.join(", ")} missing`);+ add(join.to(prefix), parts);+ continue;+ }+ const rename = RENAMES.find(([re]) => re.test(s.name));+ if (rename) add(s.name.replace(rename[0], rename[1]), [s]);+ else if (KEEPS.some((re) => re.test(s.name))) add(s.name, [s]);+ else throw new Error(`${s.name}: a tensor this conversion doesn't know (has the upstream layout changed?)`);+ }+ return [...out.values()].sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0));+}++/** The header the safetensors library writes: names sorted, offsets in that order, no metadata, padded with spaces to 8 bytes. */+export function headerBytes(plan) {+ let offset = 0;+ const header = {};+ for (const t of plan) {+ const size = t.parts.reduce((a, p) => a + (p.end - p.start), 0);+ header[t.name] = { dtype: t.dtype, shape: t.shape, data_offsets: [offset, offset + size] };+ offset += size;+ }+ let json = Buffer.from(JSON.stringify(header), "utf8");+ const pad = (8 - (json.length % 8)) % 8;+ if (pad) json = Buffer.concat([json, Buffer.alloc(pad, 0x20)]);+ const len = Buffer.alloc(8);+ len.writeBigUInt64LE(BigInt(json.length));+ return { bytes: Buffer.concat([len, json]), dataBytes: offset };+}++const CHUNK = 64 * 2 ** 20;++/** SHA-256 and size of a file as it is on disk. */+export function hashFile(file) {+ const h = crypto.createHash("sha256");+ const fd = fs.openSync(file, "r");+ const buf = Buffer.alloc(CHUNK);+ let size = 0;+ try {+ for (;;) {+ const n = fs.readSync(fd, buf, 0, CHUNK, null);+ if (!n) break;+ h.update(buf.subarray(0, n));+ size += n;+ }+ } finally {+ fs.closeSync(fd);+ }+ return { sizeBytes: size, sha256: h.digest("hex") };+}++/** The pin the output must match: model-pins.json's entry for OUT_URL. */+export function outputPin(root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..")) {+ const pins = JSON.parse(fs.readFileSync(path.join(root, "workflows/comfyui/model-pins.json"), "utf8"));+ const pin = pins[OUT_URL];+ if (!pin?.sha256) throw new Error(`model-pins.json has no pin for ${OUT_URL}`);+ return pin;+}++/**+ * Converts the shards in `dir` into `out`. Checks each shard's size and SHA-256 first (unless checkInputs is false), writes+ * `out`.part, reads it back, and renames it to `out` only when its size and SHA-256 are `expect`'s.+ */+export function convert({ dir, out, shards = SHARDS, expect = outputPin(), checkInputs = true, log = console.log }) {+ for (const s of shards) {+ const file = path.join(dir, s.file);+ if (!fs.existsSync(file)) throw new Error(`${file} is missing`);+ const size = fs.statSync(file).size;+ if (size !== s.sizeBytes) throw new Error(`${s.file}: ${size} bytes, the pin says ${s.sizeBytes}`);+ if (checkInputs) {+ log(`checking ${s.file}`);+ const { sha256 } = hashFile(file);+ if (sha256 !== s.sha256) throw new Error(`${s.file}: SHA-256 ${sha256}, the pin says ${s.sha256}`);+ }+ }+ const sources = shards.flatMap((s) => readHeader(path.join(dir, s.file)).tensors.map((t) => ({ ...t, file: path.join(dir, s.file) })));+ const plan = planLayout(sources);+ const { bytes, dataBytes } = headerBytes(plan);+ const total = bytes.length + dataBytes;+ if (expect.sizeBytes !== undefined && total !== expect.sizeBytes) throw new Error(`the result would be ${total} bytes, the pin says ${expect.sizeBytes}`);+ log(`${sources.length} tensors in, ${plan.length} out, ${total} bytes`);+ const part = `${out}.part`;+ fs.mkdirSync(path.dirname(out), { recursive: true });+ const fdOut = fs.openSync(part, "w");+ const buf = Buffer.alloc(CHUNK);+ const fds = new Map();+ try {+ fs.writeSync(fdOut, bytes);+ for (const t of plan) {+ for (const p of t.parts) {+ if (!fds.has(p.file)) fds.set(p.file, fs.openSync(p.file, "r"));+ const fd = fds.get(p.file);+ for (let at = p.start; at < p.end; ) {+ const n = fs.readSync(fd, buf, 0, Math.min(CHUNK, p.end - at), at);+ if (!n) throw new Error(`${p.file}: ended at byte ${at}`);+ fs.writeSync(fdOut, buf, 0, n);+ at += n;+ }+ }+ }+ fs.fsyncSync(fdOut);+ } finally {+ fs.closeSync(fdOut);+ for (const fd of fds.values()) fs.closeSync(fd);+ }+ log(`reading ${part} back`);+ const got = hashFile(part);+ if (got.sizeBytes !== total || got.sha256 !== expect.sha256) {+ throw new Error(`${part}: ${got.sizeBytes} bytes, SHA-256 ${got.sha256}; the pin says ${expect.sizeBytes} bytes, ${expect.sha256}. Left as ${path.basename(part)}.`);+ }+ fs.renameSync(part, out);+ log(`${out}: ${got.sizeBytes} bytes, SHA-256 ${got.sha256} (matches its pin)`);+ return got;+}++function main(argv) {+ const args = argv.filter((a) => !a.startsWith("--"));+ if (args.length !== 2) {+ console.error("usage: node scripts/convert-rmbg3.mjs <folder with the four shards> <models/diffusion_models folder or .safetensors path> [--skip-input-check]");+ return 2;+ }+ const [dir, dest] = args;+ const out = dest.endsWith(".safetensors") ? dest : path.join(dest, OUT_FILE);+ try {+ convert({ dir, out, checkInputs: !argv.includes("--skip-input-check") });+ return 0;+ } catch (e) {+ console.error(e.message);+ return 1;+ }+}++if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) process.exitCode = main(process.argv.slice(2));diff --git a/src/lib/catalog/models.ts b/src/lib/catalog/models.tsindex 6cc1a09c..79ad46e9 100644--- a/src/lib/catalog/models.ts+++ b/src/lib/catalog/models.ts@@ -729,6 +729,19 @@ const open: ModelDef[] = [routes: [comfy("bg-remove", "image-matte-feynobg")],options: {},}),+ // Image cut-outs at their finest: Bria's RMBG-3.0, a FIBO 2 Edit Turbo fine-tune that draws a soft alpha matte in 4 steps,+ // applied to the picture at full size (bg-remove-rmbg3).+ o({+ id: "oss-rmbg3",+ name: "Bria RMBG-3.0",+ vendor: "Bria",+ family: "bria",+ kind: "image",+ tagline: "The finest cut-outs: every person kept, holes and mesh cleared, soft natural edges · 32 GB GPU",+ badges: ["new", "top"],+ routes: [comfy("bg-remove", "bg-remove-rmbg3", "RMBG-3.0 matte in 4 steps, applied at full size")],+ options: {},+ }),// ---------------- Video// MiniMax H3: text, image and start + end frame to video with its own sound, on the fl2va model. Standard runs larryvrh'sdiff --git a/src/lib/layers.ts b/src/lib/layers.tsindex f7695d01..26edb85d 100644--- a/src/lib/layers.ts+++ b/src/lib/layers.ts@@ -244,8 +244,9 @@ export const TOOL_MODELS: Record<LayerTool, { cloud: string[]; open: string[] }>// reads it (fal lists $0 per compute second, real cost unverified: the catalog's $0.001 is a placeholder)."text-detect": { cloud: ["ideogram-3-text-layers", "florence-2-ocr"], open: ["oss-ocr-lines"] },"text-edit": { cloud: ["nano-banana-pro", "seedream-5-pro"], open: ["oss-qwen-image-21", "oss-qwen-image-21-turbo", "oss-krea2-edit"] },- // Bria's guided cut-out takes optional words on what to keep or drop; FeyNoBg keeps fine hair (nm10-keying).- "bg-remove": { cloud: ["birefnet-cloud", "ideogram-remove-bg", "bria-guided-cutout"], open: ["oss-rmbg", "oss-matte-feynobg"] },+ // Bria's guided cut-out takes optional words on what to keep or drop; FeyNoBg keeps fine hair (nm10-keying); Bria's RMBG-3.0+ // gives the finest matte on a 32 GB card.+ "bg-remove": { cloud: ["birefnet-cloud", "ideogram-remove-bg", "bria-guided-cutout"], open: ["oss-rmbg", "oss-matte-feynobg", "oss-rmbg3"] },regional: { cloud: ["seedream-5-pro", "nano-banana-pro"], open: ["oss-qwen-image-21", "oss-krea2-edit", "oss-fibo2-edit-turbo"] },// SeedVR2 restores detail as it enlarges; 4x ESRGAN is the quick choice.upscale: { cloud: ["topaz-image", "seedvr-image", "recraft-crisp"], open: ["oss-seedvr2-image", "oss-upscale-image"] },diff --git a/src/server/gpu/tools.ts b/src/server/gpu/tools.tsindex b07c553d..cbb87891 100644--- a/src/server/gpu/tools.ts+++ b/src/server/gpu/tools.ts@@ -205,6 +205,9 @@ export const STUDIO_ROWS: StudioRowDef[] = [{ modelId: "oss-minimax-h3-image", op: "edit" },],},+ // Layers → Remove background's finest cut-out: Bria's RMBG-3.0 (its own 16 GB transformer with FIBO 2's encoder and VAE, a+ // 32 GB card), which the other cut-out models don't load.+ { href: "/layers", label: "Remove background · RMBG-3.0", group: "Images", steps: [{ modelId: "oss-rmbg3", op: "bg-remove" }] },{ href: "/upscale", label: "Upscale", group: "Images", config: S.UPSCALE_STUDIO },// hi3d-refine: Image to 3D with "Refine detail · Hi3D 1.0": the default open model, then Hi3D's refine of its mesh.{diff --git a/tests/comfy-library-4.test.ts b/tests/comfy-library-4.test.tsindex cd4a8498..8d1f87f0 100644--- a/tests/comfy-library-4.test.ts+++ b/tests/comfy-library-4.test.ts@@ -109,6 +109,8 @@ describe("round-4 ComfyUI workflows", () => {// Green screen and fine hair (nm10-keying): ComfyUI-RMBG 3.3.0 and the CorridorKey wrapper aren't on the validation// server (tests/keying.test.ts checks their classes against the packs' source)."image-matte-feynobg",+ // Bria's RMBG-3.0 cut-out: core nodes, unvalidated until its /prompt check with its 16 GB file (tests/rmbg3.test.ts).+ "bg-remove-rmbg3",// MiniMax H3 on 8-31 GB cards: FastH3 V2 and Trim, unvalidated like the H3 graphs until a GPU run."minimax-h3-trim-t2v",// Design a voice: ComfyUI-QwenTTS and ComfyUI-VoxCPM2 aren't on the validation server (tests/voice-design-server.test.ts).diff --git a/tests/rmbg3.test.ts b/tests/rmbg3.test.tsnew file mode 100644index 00000000..b432165d--- /dev/null+++ b/tests/rmbg3.test.ts@@ -0,0 +1,369 @@+import crypto from "node:crypto";+import { spawnSync } from "node:child_process";+import fs from "node:fs";+import path from "node:path";+import { describe, expect, it } from "vitest";+import { getModel, getPreset, modelsFor } from "@/lib/catalog";+import { planGeneration, routesFor } from "@/lib/catalog/plan";+import type { GenInput } from "@/lib/catalog/types";+import type { ComfyWorkflow, Manifest } from "@/lib/comfy";+import { TOOL_MODELS } from "@/lib/layers";+import { licenceInfo, licenceTerms } from "@/lib/licences";+import { modelHref } from "@/lib/palette-index";+import { graphCheck } from "../bin/lib/worker/checks.mjs";+import { loaderInput } from "../bin/lib/worker/rules.mjs";+import { convert, hashFile, headerBytes, OUT_FILE, OUT_URL, outputPin, planLayout, readHeader, SHARDS, SOURCE } from "../scripts/convert-rmbg3.mjs";+import { allowedNodeList, inputRules, readCatalog } from "../scripts/lib/worker-catalog.mjs";+import { tempDir } from "./helpers/temp-dir";++// Bria's RMBG-3.0 on your GPU (bg-remove-rmbg3): the FIBO 2 Edit Turbo graph with RMBG-3.0's transformer and the card's fixed+// instruction, its matte joined to the picture as alpha with core nodes; the file pinned; the CPU conversion that makes that+// file from Bria's own shards, on a small made-up set of tensors.+process.env.FUOBE_DATA_DIR = tempDir("fuobe-rmbg3-");+process.env.COMFYUI_URL = "http://comfy.test:8188";+const { prepareWorkflow } = await import("@/server/providers/comfyui");+const { STUDIO_ROWS, studioTool } = await import("@/server/gpu/tools");++const root = path.resolve(__dirname, "..");+const dir = path.join(root, "workflows/comfyui");+const read = <T>(f: string) => JSON.parse(fs.readFileSync(path.join(dir, f), "utf8")) as T;+const manifest = read<Manifest>("manifest.json");+const pins = read<Record<string, { revision: string; sizeBytes: number; sha256?: string }>>("model-pins.json");+const requirements = read<{ files: Record<string, { url: string; sizeBytes: number }>; workflows: Record<string, { core: string[]; packs: Record<string, string[]>; files: string[]; optional: string[]; vramGb: number; firstRun: string[] }> }>("requirements.json");+const subset = read<Record<string, unknown>>("object_info.subset.json");++const ID = "bg-remove-rmbg3";+const MODEL = "oss-rmbg3";+const entry = manifest.workflows.find((w) => w.id === ID)!;+const graph = read<ComfyWorkflow>(`${ID}.json`);+/** The model card's instruction, as its code sends it: json.dumps({"edit_instruction": INSTRUCTION}). */+const INSTRUCTION =+ "Generate a detailed grayscale alpha matte. Map the opaque foreground to white and the background to black. Produce soft, anti-aliased grayscale gradients at the edges of the subject to represent fine details and transparency.";++describe("bg-remove-rmbg3 in the library", () => {+ it("is the FIBO 2 Edit Turbo graph on RMBG-3.0's transformer with the card's instruction, word for word", () => {+ expect(graph).toEqual(JSON.parse(fs.readFileSync(path.join(root, "scripts/comfy/hand-built", `${ID}.json`), "utf8")));+ for (const n of Object.values(graph)) expect(subset[n.class_type], n.class_type).toBeTruthy();+ expect(graph["2"]).toMatchObject({ class_type: "UNETLoader", inputs: { unet_name: OUT_FILE, weight_dtype: "default" } });+ // FIBO 2 Edit Turbo's encoder and VAE, as fibo2-edit-turbo-edit loads them.+ const turbo = read<ComfyWorkflow>("fibo2-edit-turbo-edit.json");+ expect(graph["3"].inputs).toEqual(turbo["38"].inputs);+ expect(graph["4"].inputs).toEqual(turbo["39"].inputs);+ expect(graph["5"].class_type).toBe("TextEncodeFibo2");+ expect(graph["5"].inputs).toEqual({ clip: ["3", 0], prompt: `{"edit_instruction": ${JSON.stringify(INSTRUCTION)}}`, negative_prompt: "", vae: ["4", 0], "images.image_1": ["1", 0], width: 0, height: 0, batch_size: 1 });+ expect(JSON.parse(String(graph["5"].inputs.prompt))).toEqual({ edit_instruction: INSTRUCTION });+ expect(graph["6"]).toMatchObject({ class_type: "KSampler", inputs: { model: ["2", 0], positive: ["5", 0], negative: ["5", 1], latent_image: ["5", 2], seed: 0, steps: 4, cfg: 1, sampler_name: "euler", scheduler: "simple", denoise: 1 } });+ });++ it("scales the matte to the picture, reads it as a mask and joins it as alpha: a transparent PNG at full size", () => {+ expect(graph["7"]).toMatchObject({ class_type: "VAEDecode", inputs: { samples: ["6", 0], vae: ["4", 0] } });+ expect(graph["8"]).toMatchObject({ class_type: "GetImageSize", inputs: { image: ["1", 0] } });+ expect(graph["9"]).toMatchObject({ class_type: "ImageScale", inputs: { image: ["7", 0], upscale_method: "lanczos", width: ["8", 0], height: ["8", 1], crop: "disabled" } });+ expect(graph["10"]).toMatchObject({ class_type: "ImageToMask", inputs: { image: ["9", 0], channel: "red" } });+ // JoinImageWithAlpha keeps 1 - mask: the matte (white = the subject) is inverted first, as bg-remove-birefnet does.+ expect(graph["11"]).toMatchObject({ class_type: "InvertMask", inputs: { mask: ["10", 0] } });+ expect(graph["12"]).toMatchObject({ class_type: "JoinImageWithAlpha", inputs: { image: ["1", 0], alpha: ["11", 0] } });+ expect(graph["13"]).toMatchObject({ class_type: "SaveImage", inputs: { images: ["12", 0] } });+ const birefnet = read<ComfyWorkflow>("bg-remove-birefnet.json");+ expect(Object.values(birefnet).map((n) => n.class_type)).toEqual(expect.arrayContaining(["InvertMask", "JoinImageWithAlpha"]));+ });++ it("is a bg-remove entry of core nodes, 32 GB, with its licence as information", () => {+ expect(entry).toMatchObject({ capability: "bg-remove", customNodes: [], vramGb: 32, validated: false, outputs: [{ node: "13", kind: "image" }], source: `hand-built (scripts/comfy/hand-built/${ID}.json)` });+ expect(Object.keys(entry.bindings).sort()).toEqual(["filenamePrefix", "image"]);+ expect(entry.bindings.image).toEqual([{ node: "1", input: "image" }]);+ expect(entry.limits).toEqual({ maxWidth: 4096, maxHeight: 4096 });+ expect(entry.license).toMatch(/^CC-BY-NC-4\.0 \(Bria RMBG-3\.0 weights, non-commercial/);+ expect(entry.license).not.toMatch(/permission|agreement|needs/i);+ expect(licenceTerms(entry.license!).flags).toEqual(["non-commercial"]);+ expect(licenceInfo(entry.license!).class).not.toBe("unknown");+ expect(entry.notes).toMatch(/28\.5 GiB/);+ });++ it("pins every file by size and SHA-256: RMBG-3.0's single file, and FIBO 2's encoder and VAE", () => {+ const r = requirements.workflows[ID];+ expect([...r.files].sort()).toEqual([`diffusion_models/${OUT_FILE}`, "text_encoders/qwen3vl_4b_int8_convrot.safetensors", "vae/flux2-vae.safetensors"]);+ expect(r).toMatchObject({ packs: {}, optional: [], vramGb: 32, firstRun: [] });+ expect(r.core).toEqual(expect.arrayContaining(["TextEncodeFibo2", "ImageScale", "ImageToMask", "InvertMask", "JoinImageWithAlpha", "GetImageSize"]));+ for (const f of r.files) expect(pins[requirements.files[f].url]?.sha256, f).toMatch(/^[0-9a-f]{64}$/);+ expect(pins[OUT_URL]).toEqual({ revision: "f8aa73a836ceeb9c8840e8dc70878b69a7114b78", sizeBytes: 16254753314, sha256: "a864baf0379d355982142a5577e96d82486fc6ee1628aa3ce363ae93f7f8296a" });+ expect(entry.models.find((m) => m.file === OUT_FILE)).toMatchObject({ folder: "diffusion_models", url: OUT_URL });+ expect(outputPin(root)).toEqual(pins[OUT_URL]);+ });+});++describe("RMBG-3.0 in the catalog", () => {+ const model = getModel(MODEL)!;++ it("is an open cut-out model on its graph, its card's 32 GB in the tagline, no price", () => {+ expect(model).toMatchObject({ engine: "open", kind: "image", vendor: "Bria", family: "bria", name: "Bria RMBG-3.0" });+ expect(model.routes.map((r) => [r.op, r.provider, r.endpoint])).toEqual([["bg-remove", "comfyui", ID]]);+ expect(model.tagline).toMatch(/32 GB GPU$/);+ expect(JSON.stringify(model)).not.toMatch(/\$|price|credit/i);+ expect(model.hidden).toBeFalsy();+ });++ it("is offered in Layers → Remove background after the default, and opens there", () => {+ expect(TOOL_MODELS["bg-remove"].open).toEqual(["oss-rmbg", "oss-matte-feynobg", MODEL]);+ expect(modelsFor({ kind: "image", ops: ["bg-remove"] }).map((m) => m.id)).toContain(MODEL);+ expect(modelHref(model)).toBe("/layers");+ const p = planGeneration({ feature: "image", modelId: MODEL, inputs: { images: ["/api/files/p.png"] } } as never, getModel, getPreset);+ expect([p.op, routesFor(p.model, p.op).map((r) => r.endpoint)]).toEqual(["bg-remove", [ID]]);+ });++ it("has a row on the GPU board that names its graph", () => {+ const row = STUDIO_ROWS.find((r) => r.steps?.some((s) => s.modelId === MODEL))!;+ expect(row).toMatchObject({ href: "/layers", label: "Remove background · RMBG-3.0", group: "Images", steps: [{ modelId: MODEL, op: "bg-remove" }] });+ expect(studioTool(row)?.workflows).toEqual([ID]);+ });+});++describe("bg-remove-rmbg3 as the provider fills it, and as a worker takes it", () => {+ type Graph = Record<string, { class_type: string; inputs: Record<string, unknown> }>;+ const prepare = async (input: GenInput) => (await prepareWorkflow(ID, input, { generationId: "g-rmbg3", op: "bg-remove", upload: async (_d, _t, name) => name })).workflow as unknown as Graph;+ const catalog = readCatalog(root) as unknown as { requirements: { files: Record<string, { folder: string; file: string }> } };+ const rules = inputRules(catalog as never);+ const allowed = new Set(allowedNodeList(root, catalog as never));+ const verified = Object.values(catalog.requirements.files).map((f) => ({ folder: f.folder, name: f.file }));+ const sent = (g: Graph) => Object.values(g).flatMap((n) => Object.entries(n.inputs).filter(([k, v]) => loaderInput(n.class_type, k) && typeof v === "string").map(([, v]) => v as string));++ it("binds the picture and the save name, and keeps the instruction whatever words come with the run", async () => {+ const g = await prepare({ images: ["fuobe_abcdefgh01.png"], prompt: "keep the dog" } as GenInput);+ expect(g["1"].inputs.image).toBe("fuobe_abcdefgh01.png");+ expect(String(g["13"].inputs.filename_prefix)).toMatch(/^fuobe\//);+ expect(g["5"].inputs.prompt).toBe(graph["5"].inputs.prompt);+ expect(g["5"].inputs["images.image_1"]).toEqual(["1", 0]);+ });++ it("passes the worker's checks, and is refused while RMBG-3.0's file isn't verified there", async () => {+ const g = await prepare({ images: ["fuobe_abcdefgh01.png"] } as GenInput);+ expect(graphCheck(g, allowed, verified, { rules, staged: sent(g) })).toBeNull();+ expect(graphCheck(g, allowed, verified.filter((v) => v.name !== OUT_FILE), { rules, staged: sent(g) })?.reason).toBe("model-unverified");+ });+});++// ---- the conversion, on a made-up model of a few tiny tensors ------------------------------------------------------------------++type T = { dtype: string; shape: number[]; data: Buffer };+let fill = 1;+const tensor = (...shape: number[]): T => {+ const data = Buffer.alloc(shape.reduce((a, b) => a * b, 1) * 2);+ for (let i = 0; i < data.length; i++) data[i] = fill++ % 251;+ return { dtype: "BF16", shape, data };+};+/** Writes a safetensors file with its tensors in the order given (and, like Bria's shards, a __metadata__ entry). */+function writeSafetensors(file: string, tensors: Record<string, T>) {+ let offset = 0;+ const header: Record<string, unknown> = { __metadata__: { format: "pt" } };+ for (const [name, t] of Object.entries(tensors)) {+ header[name] = { dtype: t.dtype, shape: t.shape, data_offsets: [offset, offset + t.data.length] };+ offset += t.data.length;+ }+ const json = Buffer.from(JSON.stringify(header));+ const len = Buffer.alloc(8);+ len.writeBigUInt64LE(BigInt(json.length));+ fs.writeFileSync(file, Buffer.concat([len, json, ...Object.values(tensors).map((t) => t.data)]));+}+/** A FIBO 2 transformer in Bria's diffusers names: two joint blocks (one with cross-attention), a refiner block, the Perceiver. */+function diffusersModel(): Record<string, T> {+ const m: Record<string, T> = {+ "x_embedder.weight": tensor(4, 8),+ "x_embedder.bias": tensor(4),+ "t_embedder.mlp.0.weight": tensor(4, 2),+ "t_embedder.mlp.0.bias": tensor(4),+ "t_embedder.mlp.2.weight": tensor(2, 4),+ "t_embedder.mlp.2.bias": tensor(2),+ "final_layer.linear.weight": tensor(8, 4),+ "final_layer.linear.bias": tensor(8),+ "final_layer.adaLN_modulation.1.weight": tensor(4, 2),+ "final_layer.adaLN_modulation.1.bias": tensor(4),+ "perceiver.latent_queries": tensor(3, 4),+ "perceiver.norm_out.weight": tensor(4),+ };+ for (const b of ["layers.0", "layers.1", "noise_refiner.0"]) {+ for (const x of ["q", "k", "v"]) m[`${b}.attention.to_${x}.weight`] = tensor(4, 4);+ m[`${b}.attention.to_out.0.weight`] = tensor(4, 4);+ m[`${b}.attention.norm_q.weight`] = tensor(2);+ m[`${b}.attention.norm_k.weight`] = tensor(2);+ for (const w of ["w1", "w3"]) m[`${b}.feed_forward.${w}.weight`] = tensor(6, 4);+ m[`${b}.feed_forward.w2.weight`] = tensor(4, 6);+ for (const n of ["attention_norm1", "attention_norm2", "ffn_norm1", "ffn_norm2"]) m[`${b}.${n}.weight`] = tensor(4);+ m[`${b}.adaLN_modulation.0.weight`] = tensor(16, 2);+ m[`${b}.adaLN_modulation.0.bias`] = tensor(16);+ }+ const attention = (p: string, kv: number) => {+ m[`${p}.to_q.weight`] = tensor(4, 4);+ m[`${p}.to_k.weight`] = tensor(4, kv);+ m[`${p}.to_v.weight`] = tensor(4, kv);+ m[`${p}.to_out.0.weight`] = tensor(4, 4);+ m[`${p}.norm_q.weight`] = tensor(2);+ m[`${p}.norm_k.weight`] = tensor(2);+ };+ m["layers.1.cross_attn_gate"] = tensor(1);+ m["layers.1.cross_attn_norm1.weight"] = tensor(4);+ m["layers.1.cross_attn_norm2.weight"] = tensor(4);+ attention("layers.1.cross_attention", 5);+ attention("perceiver.layers.0.cross_attention", 5);+ attention("perceiver.layers.0.self_attention", 4);+ for (const n of ["cross_attn_norm", "self_attn_norm", "ffn_norm"]) m[`perceiver.layers.0.${n}.weight`] = tensor(4);+ for (const w of ["w1", "w3"]) m[`perceiver.layers.0.ffn.${w}.weight`] = tensor(6, 4);+ m["perceiver.layers.0.ffn.w2.weight"] = tensor(4, 6);+ return m;+}+/** The names ComfyUI's FIBO 2 loader reads for that model (the layout of Comfy-Org's own FIBO 2 files). */+const COMFY_NAMES = [+ "final_layer.adaLN_modulation.1.bias",+ "final_layer.adaLN_modulation.1.weight",+ "final_layer.linear.bias",+ "final_layer.linear.weight",+ ...["layers.0", "layers.1", "noise_refiner.0"].flatMap((b) => [+ `${b}.adaLN_modulation.0.bias`,+ `${b}.adaLN_modulation.0.weight`,+ `${b}.attention.k_norm.weight`,+ `${b}.attention.out.weight`,+ `${b}.attention.q_norm.weight`,+ `${b}.attention.qkv.weight`,+ `${b}.attention_norm1.weight`,+ `${b}.attention_norm2.weight`,+ `${b}.feed_forward.w13.weight`,+ `${b}.feed_forward.w2.weight`,+ `${b}.ffn_norm1.weight`,+ `${b}.ffn_norm2.weight`,+ ]),+ ...["layers.1.cross_attention", "perceiver.layers.0.cross_attention", "perceiver.layers.0.self_attention"].flatMap((p) => [`${p}.norm_k.weight`, `${p}.norm_q.weight`, `${p}.to_kv.weight`, `${p}.to_out.weight`, `${p}.to_q.weight`]),+ "layers.1.cross_attn_gate",+ "layers.1.cross_attn_norm1.weight",+ "layers.1.cross_attn_norm2.weight",+ "perceiver.latent_queries",+ "perceiver.layers.0.cross_attn_norm.weight",+ "perceiver.layers.0.ffn.w13.weight",+ "perceiver.layers.0.ffn.w2.weight",+ "perceiver.layers.0.ffn_norm.weight",+ "perceiver.layers.0.self_attn_norm.weight",+ "perceiver.norm_out.weight",+ "t_embedder.mlp.0.bias",+ "t_embedder.mlp.0.weight",+ "t_embedder.mlp.2.bias",+ "t_embedder.mlp.2.weight",+ "x_embedder.bias",+ "x_embedder.weight",+].sort();++/** The made-up model in two shards (names shuffled across them), with their pins. */+function shardsOf(model: Record<string, T>, at: string) {+ const names = Object.keys(model).reverse();+ const half = Math.ceil(names.length / 2);+ return [names.slice(0, half), names.slice(half)].map((list, i) => {+ const file = `diffusion_pytorch_model-0000${i + 1}-of-00002.safetensors`;+ writeSafetensors(path.join(at, file), Object.fromEntries(list.map((n) => [n, model[n]])));+ return { file, ...hashFile(path.join(at, file)) };+ });+}+function tensorBytes(file: string) {+ const buf = fs.readFileSync(file);+ return Object.fromEntries(readHeader(file).tensors.map((t) => [t.name, { ...t, data: buf.subarray(t.start, t.end) }]));+}++describe("scripts/convert-rmbg3.mjs", () => {+ it("names Bria's four shards with their sizes and SHA-256, and the pin the result must match", () => {+ expect(SOURCE).toEqual({ repo: "briaai/RMBG-3.0", revision: "87330e3f87d9d856a21453e5acd120219984a66b", folder: "transformer" });+ expect(SHARDS.map((s) => s.file)).toEqual([1, 2, 3, 4].map((i) => `diffusion_pytorch_model-0000${i}-of-00004.safetensors`));+ for (const s of SHARDS) expect(s.sha256, s.file).toMatch(/^[0-9a-f]{64}$/);+ // The shards hold 16,254,684,426 bytes of tensors; the single file adds its own header.+ expect(SHARDS.reduce((a, s) => a + s.sizeBytes, 0)).toBe(16254769274);+ expect(OUT_URL).toBe(requirements.files[`diffusion_models/${OUT_FILE}`].url);+ });++ it("joins q/k/v, k/v and w1/w3 in order, renames the rest as ComfyUI's FIBO 2 layout reads it, and copies every byte", () => {+ const at = tempDir("fuobe-rmbg3-convert-");+ const model = diffusersModel();+ const shards = shardsOf(model, at);+ const out = path.join(at, "out", OUT_FILE);+ const quiet = () => {};+ // A pin the result doesn't match: the file stays as .part, and nothing is at the final name.+ expect(() => convert({ dir: at, out, shards, expect: { sha256: "0".repeat(64) }, log: quiet })).toThrow(/the pin says .*Left as RMBG-3\.0-bf16\.safetensors\.part/);+ expect(fs.existsSync(out)).toBe(false);+ const part = `${out}.part`;+ const got = tensorBytes(part);+ expect(Object.keys(got)).toEqual(COMFY_NAMES);+ const cat = (...names: string[]) => Buffer.concat(names.map((n) => model[n].data));+ for (const b of ["layers.0", "layers.1", "noise_refiner.0"]) {+ expect(got[`${b}.attention.qkv.weight`]).toMatchObject({ dtype: "BF16", shape: [12, 4] });+ expect(got[`${b}.attention.qkv.weight`].data.equals(cat(...["q", "k", "v"].map((x) => `${b}.attention.to_${x}.weight`)))).toBe(true);+ expect(got[`${b}.feed_forward.w13.weight`].shape).toEqual([12, 4]);+ expect(got[`${b}.feed_forward.w13.weight`].data.equals(cat(`${b}.feed_forward.w1.weight`, `${b}.feed_forward.w3.weight`))).toBe(true);+ expect(got[`${b}.attention.out.weight`].data.equals(model[`${b}.attention.to_out.0.weight`].data)).toBe(true);+ expect(got[`${b}.attention.q_norm.weight`].data.equals(model[`${b}.attention.norm_q.weight`].data)).toBe(true);+ expect(got[`${b}.attention.k_norm.weight`].data.equals(model[`${b}.attention.norm_k.weight`].data)).toBe(true);+ }+ for (const [p, kv] of [["layers.1.cross_attention", 5], ["perceiver.layers.0.cross_attention", 5], ["perceiver.layers.0.self_attention", 4]] as const) {+ expect(got[`${p}.to_kv.weight`].shape).toEqual([8, kv]);+ expect(got[`${p}.to_kv.weight`].data.equals(cat(`${p}.to_k.weight`, `${p}.to_v.weight`))).toBe(true);+ expect(got[`${p}.to_out.weight`].data.equals(model[`${p}.to_out.0.weight`].data)).toBe(true);+ for (const k of ["to_q", "norm_q", "norm_k"]) expect(got[`${p}.${k}.weight`].data.equals(model[`${p}.${k}.weight`].data), `${p}.${k}`).toBe(true);+ }+ expect(got["perceiver.layers.0.ffn.w13.weight"].data.equals(cat("perceiver.layers.0.ffn.w1.weight", "perceiver.layers.0.ffn.w3.weight"))).toBe(true);+ for (const k of ["x_embedder.weight", "t_embedder.mlp.2.bias", "final_layer.adaLN_modulation.1.weight", "perceiver.latent_queries", "layers.1.cross_attn_gate", "layers.0.feed_forward.w2.weight"]) {+ expect(got[k].data.equals(model[k].data), k).toBe(true);+ expect(got[k].shape, k).toEqual(model[k].shape);+ }+ // The header as the safetensors library writes it: names sorted, offsets one after another, no metadata, spaces to 8 bytes.+ const buf = fs.readFileSync(part);+ const n = Number(buf.readBigUInt64LE(0));+ expect(n % 8).toBe(0);+ const text = buf.subarray(8, 8 + n).toString("utf8");+ expect(text).toMatch(/^\{"final_layer\.adaLN_modulation\.1\.bias":\{"dtype":"BF16","shape":\[4\],"data_offsets":\[0,8\]\},/);+ expect(text).toMatch(/\} *$/);+ expect(JSON.parse(text).__metadata__).toBeUndefined();+ const all = Object.values(JSON.parse(text) as Record<string, { data_offsets: [number, number] }>);+ all.forEach((t, i) => expect(t.data_offsets[0]).toBe(i ? all[i - 1].data_offsets[1] : 0));+ expect(buf.length).toBe(8 + n + all[all.length - 1].data_offsets[1]);+ // With the right pin it is read back, checked and put in place; the same shards make the same bytes.+ const pin = hashFile(part);+ expect(pin.sha256).toBe(crypto.createHash("sha256").update(buf).digest("hex"));+ expect(convert({ dir: at, out, shards, expect: pin, log: quiet })).toEqual(pin);+ expect([fs.existsSync(out), fs.existsSync(part)]).toEqual([true, false]);+ });++ it("checks the shards first: a missing one, another size or another SHA-256 stops it before anything is written", () => {+ const at = tempDir("fuobe-rmbg3-inputs-");+ const shards = shardsOf(diffusersModel(), at);+ const out = path.join(at, OUT_FILE);+ const run = (s: typeof shards, checkInputs = true) => () => convert({ dir: at, out, shards: s, expect: { sha256: "0".repeat(64) }, checkInputs, log: () => {} });+ expect(run([shards[0], { ...shards[1], sha256: "f".repeat(64) }])).toThrow(/00002-of-00002\.safetensors: SHA-256 [0-9a-f]{64}, the pin says f{64}/);+ expect(run([shards[0], { ...shards[1], sizeBytes: shards[1].sizeBytes + 1 }], false)).toThrow(/bytes, the pin says/);+ expect(run([...shards, { file: "gone.safetensors", sizeBytes: 1, sha256: "0".repeat(64) }])).toThrow(/gone\.safetensors is missing/);+ expect(fs.existsSync(`${out}.part`)).toBe(false);+ // A size the pin says the result can't have stops it before writing too.+ expect(() => convert({ dir: at, out, shards, expect: { sizeBytes: 1, sha256: "0".repeat(64) }, log: () => {} })).toThrow(/the result would be \d+ bytes, the pin says 1/);+ expect(fs.existsSync(`${out}.part`)).toBe(false);+ });++ it("refuses a layout it doesn't know: an unknown tensor, a missing part, another dtype or a tensor in two shards", () => {+ const sources = (m: Record<string, T>) => {+ let at = 0;+ return Object.entries(m).map(([name, t]) => ({ name, dtype: t.dtype, shape: t.shape, start: at, end: (at += t.data.length), file: "x" }));+ };+ expect(planLayout(sources(diffusersModel())).map((t: { name: string }) => t.name)).toEqual(COMFY_NAMES);+ const extra = { ...diffusersModel(), "layers.0.attention.to_gate.weight": tensor(4, 4) };+ expect(() => planLayout(sources(extra))).toThrow(/layers\.0\.attention\.to_gate\.weight: a tensor this conversion doesn't know/);+ const noV = diffusersModel();+ delete noV["layers.1.cross_attention.to_v.weight"];+ expect(() => planLayout(sources(noV))).toThrow(/layers\.1\.cross_attention\.to_kv\.weight: layers\.1\.cross_attention\.to_v\.weight missing/);+ const f32 = diffusersModel();+ f32["noise_refiner.0.feed_forward.w3.weight"] = { dtype: "F32", shape: [6, 2], data: Buffer.alloc(48) };+ expect(() => planLayout(sources(f32))).toThrow(/noise_refiner\.0\.feed_forward\.w13\.weight: .* is F32/);+ const twice = sources(diffusersModel());+ expect(() => planLayout([...twice, twice[0]])).toThrow(/is in two shards/);+ // The header alone, for a plan: sorted names, the data size it describes.+ const { bytes, dataBytes } = headerBytes(planLayout(sources(diffusersModel())));+ expect(bytes.length % 8).toBe(0);+ expect(dataBytes).toBe(Object.values(diffusersModel()).reduce((a, t) => a + t.data.length, 0));+ });++ it("says how to run it when called without its two folders", () => {+ const r = spawnSync(process.execPath, [path.join(root, "scripts/convert-rmbg3.mjs")], { encoding: "utf8" });+ expect(r.status).toBe(2);+ expect(r.stderr).toMatch(/^usage: node scripts\/convert-rmbg3\.mjs <folder with the four shards>/);+ });+});diff --git a/workflows/comfyui/bg-remove-rmbg3.json b/workflows/comfyui/bg-remove-rmbg3.jsonnew file mode 100644index 00000000..489ed80d--- /dev/null+++ b/workflows/comfyui/bg-remove-rmbg3.json@@ -0,0 +1,200 @@+{+ "1": {+ "class_type": "LoadImage",+ "inputs": {+ "image": "input.png"+ },+ "_meta": {+ "title": "Picture (image)"+ }+ },+ "2": {+ "class_type": "UNETLoader",+ "inputs": {+ "unet_name": "RMBG-3.0-bf16.safetensors",+ "weight_dtype": "default"+ },+ "_meta": {+ "title": "RMBG-3.0 (FIBO 2 Edit Turbo fine-tune, bf16)"+ }+ },+ "3": {+ "class_type": "CLIPLoader",+ "inputs": {+ "clip_name": "qwen3vl_4b_int8_convrot.safetensors",+ "type": "fibo2",+ "device": "default"+ },+ "_meta": {+ "title": "Qwen3-VL 4B (FIBO 2 encoder, int8)"+ }+ },+ "4": {+ "class_type": "VAELoader",+ "inputs": {+ "vae_name": "flux2-vae.safetensors"+ },+ "_meta": {+ "title": "FLUX.2 VAE"+ }+ },+ "5": {+ "class_type": "TextEncodeFibo2",+ "inputs": {+ "clip": [+ "3",+ 0+ ],+ "prompt": "{\"edit_instruction\": \"Generate a detailed grayscale alpha matte. Map the opaque foreground to white and the background to black. Produce soft, anti-aliased grayscale gradients at the edges of the subject to represent fine details and transparency.\"}",+ "negative_prompt": "",+ "vae": [+ "4",+ 0+ ],+ "images.image_1": [+ "1",+ 0+ ],+ "width": 0,+ "height": 0,+ "batch_size": 1+ },+ "_meta": {+ "title": "The fixed matte instruction, with the picture"+ }+ },+ "6": {+ "class_type": "KSampler",+ "inputs": {+ "model": [+ "2",+ 0+ ],+ "positive": [+ "5",+ 0+ ],+ "negative": [+ "5",+ 1+ ],+ "latent_image": [+ "5",+ 2+ ],+ "seed": 0,+ "steps": 4,+ "cfg": 1,+ "sampler_name": "euler",+ "scheduler": "simple",+ "denoise": 1+ },+ "_meta": {+ "title": "Sampler (4 steps, CFG 1, euler / simple)"+ }+ },+ "7": {+ "class_type": "VAEDecode",+ "inputs": {+ "samples": [+ "6",+ 0+ ],+ "vae": [+ "4",+ 0+ ]+ },+ "_meta": {+ "title": "The matte (white = the subject)"+ }+ },+ "8": {+ "class_type": "GetImageSize",+ "inputs": {+ "image": [+ "1",+ 0+ ]+ },+ "_meta": {+ "title": "The picture size"+ }+ },+ "9": {+ "class_type": "ImageScale",+ "inputs": {+ "image": [+ "7",+ 0+ ],+ "upscale_method": "lanczos",+ "width": [+ "8",+ 0+ ],+ "height": [+ "8",+ 1+ ],+ "crop": "disabled"+ },+ "_meta": {+ "title": "The matte at the picture size (lanczos)"+ }+ },+ "10": {+ "class_type": "ImageToMask",+ "inputs": {+ "image": [+ "9",+ 0+ ],+ "channel": "red"+ },+ "_meta": {+ "title": "Matte to mask"+ }+ },+ "11": {+ "class_type": "InvertMask",+ "inputs": {+ "mask": [+ "10",+ 0+ ]+ },+ "_meta": {+ "title": "Invert (JoinImageWithAlpha takes 1 = clear)"+ }+ },+ "12": {+ "class_type": "JoinImageWithAlpha",+ "inputs": {+ "image": [+ "1",+ 0+ ],+ "alpha": [+ "11",+ 0+ ]+ },+ "_meta": {+ "title": "The picture with the matte as alpha"+ }+ },+ "13": {+ "class_type": "SaveImage",+ "inputs": {+ "images": [+ "12",+ 0+ ],+ "filename_prefix": "fuobe/bg-remove-rmbg3"+ },+ "_meta": {+ "title": "Save Image (RGBA)"+ }+ }+}diff --git a/workflows/comfyui/manifest.json b/workflows/comfyui/manifest.jsonindex 92589d54..2b312f73 100644--- a/workflows/comfyui/manifest.json+++ b/workflows/comfyui/manifest.json@@ -3596,6 +3596,63 @@],"validationError": "HTTP 400: missing_node_type: Node 'FeyNoBg fine-hair matte (foreground refine on)' not found. The custom node may not be installed. (Node ID '#2')"},+ {+ "id": "bg-remove-rmbg3",+ "title": "Remove background (Bria RMBG-3.0: a soft alpha matte from FIBO 2 Edit Turbo, 4 steps)",+ "capability": "bg-remove",+ "file": "bg-remove-rmbg3.json",+ "source": "hand-built (scripts/comfy/hand-built/bg-remove-rmbg3.json)",+ "bindings": {+ "image": [+ {+ "node": "1",+ "input": "image"+ }+ ],+ "filenamePrefix": [+ {+ "node": "13",+ "input": "filename_prefix"+ }+ ]+ },+ "outputs": [+ {+ "node": "13",+ "kind": "image"+ }+ ],+ "defaults": {},+ "limits": {+ "maxWidth": 4096,+ "maxHeight": 4096+ },+ "models": [+ {+ "file": "RMBG-3.0-bf16.safetensors",+ "folder": "diffusion_models",+ "url": "https://huggingface.co/1038lab/RMBG-3.0/resolve/f8aa73a836ceeb9c8840e8dc70878b69a7114b78/RMBG-3.0-bf16.safetensors",+ "sizeGb": 16.25+ },+ {+ "file": "qwen3vl_4b_int8_convrot.safetensors",+ "folder": "text_encoders",+ "url": "https://huggingface.co/Comfy-Org/Fibo-2.0/resolve/main/text_encoders/qwen3vl_4b_int8_convrot.safetensors",+ "sizeGb": 4.86+ },+ {+ "file": "flux2-vae.safetensors",+ "folder": "vae",+ "url": "https://huggingface.co/Comfy-Org/flux2-dev/resolve/main/split_files/vae/flux2-vae.safetensors",+ "sizeGb": 0.34+ }+ ],+ "customNodes": [],+ "vramGb": 32,+ "license": "CC-BY-NC-4.0 (Bria RMBG-3.0 weights, non-commercial; 1038lab's single-file repack carries the same terms); Qwen3-VL-4B text encoder Apache-2.0; FLUX.2 VAE Apache-2.0",+ "validated": false,+ "notes": "fibo2-edit-turbo-edit with RMBG-3.0's transformer (briaai/RMBG-3.0 at 87330e3f, a fine-tune of FIBO 2.0 Edit Turbo) and the card's fixed instruction, word for word, as the card sends it ({\"edit_instruction\": ...}): another or no instruction makes a coloured picture, not a matte. Core nodes only. TextEncodeFibo2 takes the picture as image 1 and makes the latent at FIBO 2's trained size for its shape (about 1 MP, centre-cropped, as Bria's pipeline does); 4 steps, CFG 1 (no negative pass), euler / simple, seed 0 as on the card. The decoded matte (white = the subject, grey = partly see-through) is scaled to the picture's size with lanczos (GetImageSize, ImageScale), read as a mask from its red channel, inverted for JoinImageWithAlpha, and joined to the original picture as its alpha: a transparent PNG at full size. ComfyUI's UNETLoader reads one file whose names follow its FIBO 2 layout (fused qkv, to_kv and w13), not Bria's four diffusers shards: RMBG-3.0-bf16.safetensors is that file. VRAM: the card measured a 28.5 GiB peak in bf16 for the whole pipeline; the transformer alone is 15.1 GiB."+ },{"id": "face-swap-reactor","title": "Face Swap (ReActor)",diff --git a/workflows/comfyui/model-pins.json b/workflows/comfyui/model-pins.jsonindex 57e5586b..8fcabc76 100644--- a/workflows/comfyui/model-pins.json+++ b/workflows/comfyui/model-pins.json@@ -1449,6 +1449,11 @@"sizeBytes": 884915688,"sha256": "3100fd296d2991f4859db9d83c43ece45f432659b06db3d79810dad033c62253"},+ "https://huggingface.co/1038lab/RMBG-3.0/resolve/f8aa73a836ceeb9c8840e8dc70878b69a7114b78/RMBG-3.0-bf16.safetensors": {+ "revision": "f8aa73a836ceeb9c8840e8dc70878b69a7114b78",+ "sizeBytes": 16254753314,+ "sha256": "a864baf0379d355982142a5577e96d82486fc6ee1628aa3ce363ae93f7f8296a"+ },"https://huggingface.co/1038lab/FeyNobg/resolve/59dd27c65909b7dcc2de8c3239712b0b997c3e41/FeyNobg.safetensors": {"revision": "59dd27c65909b7dcc2de8c3239712b0b997c3e41","sizeBytes": 1051353168,diff --git a/workflows/comfyui/requirements.json b/workflows/comfyui/requirements.jsonindex eb1b78e0..be4c3f21 100644--- a/workflows/comfyui/requirements.json+++ b/workflows/comfyui/requirements.json@@ -1,6 +1,6 @@{"v": 1,- "hash": "4d0d89b8b9020cc5a1daefe052ef69af3f30c71210ce6d6a0c99e1c9c9e0fdfa",+ "hash": "40620e20a7dbfe5fa7a99240b792816f731a1d62459edd7707c1941a6348af67","comfyui": {"min":"0.42.0","testedCommit":"5841c187"},"folders": ["Hi3D","RMBG","audio_encoders","background_removal","checkpoints","clip_vision","dbs","detection","diffusion_models","facerestore_models","foley","frame_interpolation","geometry_estimation","insightface","kandinsky6_audio_vae","latent_upscale_models","loras","mmaudio","model_patches","optical_flow","reuse","sams","text_encoders","thinksound","ultralytics","upscale_models","vae"],"sentinels": ["AILab_FeyNoBg","AILab_Qwen3ASRSubtitle","AILab_Qwen3TTSVoiceClone_Advanced","AILab_Qwen3TTSVoiceDesign_Advanced","AILab_VRMBG","AUSBOSS_NODES_CropForInpaint","AUSBOSS_NODES_ImageCropRotatePad","AUSBOSS_NODES_MaskByTouch","AUSBOSS_NODES_StitchInpaint","Add Subtitles To Frames","Apply Whisper","AuKGenerateEdit","AuKModelLoader","BodyDoubleFit","BodyDoubleLook","CFGOverride","ClothesSegment","ComfyMathExpression","CorridorKey2","CropFuobeLive","DBSLoader","DBSSeparate","DownloadAndLoadWav2VecModel","DualModelGuider","FL_ChatterboxDialogTTS","FL_ChatterboxMultilingualTTS","FL_ChatterboxVC","GetImageRangeFromBatch","GetImageSizeAndCount","GrowMaskWithBlur","H3AdaLNLoRAFix","H3AdvancedSwapPlan","H3CharacterSwapAssemble","H3CharacterSwapController","H3CharacterSwapExpandMask","H3CharacterSwapModels","H3CharacterSwapPrepareVideo","H3CharacterSwapRecoverMasks","H3CharacterSwapSelectSubject","H3CharacterSwapSettings","H3CharacterSwapShot","H3CharacterSwapWindowPlan","H3ClipShots","H3FaceChunks","H3FaceJoin","H3FaceMaskSAM","H3FaceStitch","H3FaceTrackCrop","H3FillShots","H3GreyMannequins","H3ObjectSwapPlan","H3PeopleMask","H3RelayAppendWindow","H3RelayApplyEditMask","H3RelayApplyHistory","H3RelayExpandMask","H3RelayFinishWindows","H3RelayPrepareSource","H3RelayRecoverMasks","H3RelayReviewWindows","H3RelaySamplingMemory","H3RelaySelectMask","H3RelayTextMemory","H3RelayWindowInputs","H3RelayWindowPlan","H3RoleMask","H3SLAAttention","H3SoundtrackOrSilence","H3SourceSlice","H3SubjectPrompt","H3TrackCrops","H3TrackRoles","Hi3DLoadMesh","Hi3DModelLoader","Hi3DRefine","HunyuanDependenciesLoader","HunyuanFoleySampler","HunyuanModelLoader","HyperFlowGGUFLoader","HyperFlowSigmas","INTConstant","Ideogram4Scheduler","IdolCamera","IdolPreprocessImage","IdolPruneSplat","ImageBatchExtendWithOverlap","ImageDetailContrast","ImageGridtoBatch","ImageResizeKJv2","ImageUpscaleWithModelBatched","IndexTTS2Simple","InstantHMRLoader","InstantHMRPredict","Kandinsky6AudioVAEDecode","Kandinsky6AudioVAELoader","Kandinsky6BeautifyPrompt","Kandinsky6EmptyLatent","Kandinsky6ImageToVideoAudio","Kandinsky6LatentUpscalerLoader","Kandinsky6RemoveReferenceLatent","Kandinsky6SRVAELoader","Kandinsky6Sampler","Kandinsky6TextEncode","Kandinsky6VSRUpscale","Krea2EditGroundedEncode","Krea2EditModelPatch","Krea2OstrisEditModelPatch","LTXAVTextEncoderLoader","LTXAddVideoICLoRAGuide","LTXICLoRALoaderModelOnly","LTXVAddGuide","LTXVAudioVAEDecode","LTXVAudioVAELoader","LTXVConcatAVLatent","LTXVConditioning","LTXVCropGuides","LTXVDualCFGGuider","LTXVEmptyLatentAudio","LTXVImgToVideoInplace","LTXVLatentUpsampler","LTXVPreprocess","LTXVScheduler","LTXVSeparateAVLatent","LTXVTiledFusionSampler","LatentSyncNode","LoadBackgroundRemovalModel","LoadImageFuobeLive","LoadVideoDepthAnythingModel","MMAudioFeatureUtilsLoader","MMAudioModelLoader","MMAudioSampler","MOSSAnyPaintEncode","MOSSAnyPaintModelPatch","MOSSAnyPaintPrepare","MelBandRoFormerModelLoader","MelBandRoFormerSampler","Metric3D-NormalMapPreprocessor","MiniMaxH3ChainAssemble","MiniMaxH3ChainContext","MiniMaxH3ChainCurrent","MiniMaxH3ChainLoopEnd","MiniMaxH3ChainLoopStart","MiniMaxH3ChainPlanModern","MiniMaxH3ChainReview","MiniMaxH3ChainSegmentSave","MiniMaxH3ContexMaskedTarget","MiniMaxH3FantasticVideoEditLatent","MiniMaxH3GenerationProfile","MiniMaxH3ImageConditioning","MiniMaxH3LoopTrim","MiniMaxH3SourceTimeline","MiniMaxH3TurboLoRA","MiniMaxH3TurboSampler","MultiTalkModelLoader","MultiTalkWav2VecEmbeds","NomasCameraPath","NomasWorldContinue","NomasWorldGenerate","NomasWorldPrompt","OpenH3LoadRefinedLatent","OpenH3RegenFastVAEDecode","OpenH3RegenFinish","OpenH3RegenLora","OpenH3RegenPrepareDraft","OpenH3RegenRefineLatent","OpenH3RegenSigmas","OpenH3RegenUpscale","OpenH3SaveRefinedLatent","Orion4D_FXMax_DCTLToneMapper","PasteBackFuobeLive","QWMComposite","QWMDetect","QWMFinal","QWMPrepare","QWMRefineMask","QWMResidualDetect","Qwen21EncodeFuobeLive","Qwen21ReferenceFuobeLive","QwenImage21Cache","REUSEEnhance","REUSELoader","RIFE VFI","RMBG","RTXTrueHDR","RTXVideoFrameGeneration","RTXVideoSuperResolution","ReActorFaceSwap","RemakeConditioning","RemakeKeyframeUntil","RemakeNoise","RemoveBackground","SAM3DBody_Loader","SAM3DBody_Render","SAM3DBody_Smooth","SAM3_Detect","SAM3_TrackToMask","SAM3_VideoTrack","SAMLoader","SaveImageFuobeLive","SeedVR2Conditioning","SeedVR2PostProcessing","SeedVR2Preprocess","SolarRendererConditioning","SolarRendererLoraLoader","SolarRendererModel","SolarRendererSigmas","TS_ImageToSVGStringColor_Vtracer","TS_SVGStringToSVGBytesIO","TextEncodeFibo2","TextEncodeKrea2OstrisEdit","TextEncodeQwenImage21","TextGenerateV2","ThinkSoundFeatureUtilsLoader","ThinkSoundModelLoader","ThinkSoundSampler","Trellis2Conditioning","Trellis2ShapeStage","Trellis2TextureStage","Trellis2UpsampleStage","UnetLoaderGGUF","VHS_BatchManager","VHS_LoadAudioUpload","VHS_LoadVideo","VHS_LoadVideoFFmpeg","VHS_SelectEveryNthImage","VHS_VideoCombine","VHS_VideoInfo","VHS_VideoInfoLoaded","VRAM_Debug","VideoDepthAnythingOutput","VideoDepthAnythingProcess","VideoLengthAdjuster","ViggleTurboLora","ViggleTurboSigmas","VoxCPM2_Clone","VoxCPM2_TTS","WanVideoBlockSwap","WanVideoClipVisionEncode","WanVideoDecode","WanVideoEncode","WanVideoImageToVideoMultiTalk","WanVideoLoraSelect","WanVideoModelLoader","WanVideoPassImagesFromSamples","WanVideoSampler","WanVideoTextEncodeCached","WanVideoVAELoader","ZenImage21AdapterLoader","ZenImage21TextEncode"],@@ -117,6 +117,7 @@"diffusion_models/Kandinsky-6.0-VSR-distilled2steps-5s-Diffusers/vae/config.json": {"folder":"diffusion_models","file":"Kandinsky-6.0-VSR-distilled2steps-5s-Diffusers/vae/config.json","url":"https://huggingface.co/kandinskylab/Kandinsky-6.0-VSR-distilled2steps-5s-Diffusers/resolve/3d6672923a4dfcd387961864654e123dd53b8ee4/vae/config.json","pinnedUrl":"https://huggingface.co/kandinskylab/Kandinsky-6.0-VSR-distilled2steps-5s-Diffusers/resolve/3d6672923a4dfcd387961864654e123dd53b8ee4/vae/config.json","sizeBytes":569,"sha256":"48e9f4a5f8e911d6abf37126d46de0527e9b32c97df150b0eed046bbeb5d6f9c","gated":false,"presence":"unobservable"},"diffusion_models/Kandinsky-6.0-VSR-distilled2steps-5s-Diffusers/vae/diffusion_pytorch_model.safetensors": {"folder":"diffusion_models","file":"Kandinsky-6.0-VSR-distilled2steps-5s-Diffusers/vae/diffusion_pytorch_model.safetensors","url":"https://huggingface.co/kandinskylab/Kandinsky-6.0-VSR-distilled2steps-5s-Diffusers/resolve/3d6672923a4dfcd387961864654e123dd53b8ee4/vae/diffusion_pytorch_model.safetensors","pinnedUrl":"https://huggingface.co/kandinskylab/Kandinsky-6.0-VSR-distilled2steps-5s-Diffusers/resolve/3d6672923a4dfcd387961864654e123dd53b8ee4/vae/diffusion_pytorch_model.safetensors","sizeBytes":6955556660,"gated":false,"presence":"loader","loaders":[["Kandinsky6SRVAELoader","kvae_checkpoint"]]},"diffusion_models/MelBandRoformer_fp16.safetensors": {"folder":"diffusion_models","file":"MelBandRoformer_fp16.safetensors","url":"https://huggingface.co/Kijai/MelBandRoFormer_comfy/resolve/main/MelBandRoformer_fp16.safetensors","pinnedUrl":"https://huggingface.co/Kijai/MelBandRoFormer_comfy/resolve/7dc5fa7824f1f3089a5c4b130d767004ccc1ed12/MelBandRoformer_fp16.safetensors","sizeBytes":456479072,"gated":false,"presence":"loader","loaders":[["MelBandRoFormerModelLoader","model_name"]]},+ "diffusion_models/RMBG-3.0-bf16.safetensors": {"folder":"diffusion_models","file":"RMBG-3.0-bf16.safetensors","url":"https://huggingface.co/1038lab/RMBG-3.0/resolve/f8aa73a836ceeb9c8840e8dc70878b69a7114b78/RMBG-3.0-bf16.safetensors","pinnedUrl":"https://huggingface.co/1038lab/RMBG-3.0/resolve/f8aa73a836ceeb9c8840e8dc70878b69a7114b78/RMBG-3.0-bf16.safetensors","sizeBytes":16254753314,"gated":false,"presence":"loader","loaders":[["UNETLoader","unet_name"]]},"diffusion_models/Wan21-WanMove_fp8_scaled_e4m3fn_KJ.safetensors": {"folder":"diffusion_models","file":"Wan21-WanMove_fp8_scaled_e4m3fn_KJ.safetensors","url":"https://huggingface.co/Kijai/WanVideo_comfy_fp8_scaled/resolve/main/WanMove/Wan21-WanMove_fp8_scaled_e4m3fn_KJ.safetensors","pinnedUrl":"https://huggingface.co/Kijai/WanVideo_comfy_fp8_scaled/resolve/033a4e487f60220b3d6e469599a6aebc46e13cee/WanMove/Wan21-WanMove_fp8_scaled_e4m3fn_KJ.safetensors","sizeBytes":16402832658,"gated":false,"presence":"loader","loaders":[["UNETLoader","unet_name"]]},"diffusion_models/Wan2_1-I2V-14B-480p_fp8_e4m3fn_scaled_KJ.safetensors": {"folder":"diffusion_models","file":"Wan2_1-I2V-14B-480p_fp8_e4m3fn_scaled_KJ.safetensors","url":"https://huggingface.co/Kijai/WanVideo_comfy_fp8_scaled/resolve/main/I2V/Wan2_1-I2V-14B-480p_fp8_e4m3fn_scaled_KJ.safetensors","pinnedUrl":"https://huggingface.co/Kijai/WanVideo_comfy_fp8_scaled/resolve/033a4e487f60220b3d6e469599a6aebc46e13cee/I2V/Wan2_1-I2V-14B-480p_fp8_e4m3fn_scaled_KJ.safetensors","sizeBytes":16643349018,"gated":false,"presence":"loader","loaders":[["UNETLoader","unet_name"]]},"diffusion_models/Wan2_1-InfiniteTalk_Single_Q8.gguf": {"folder":"diffusion_models","file":"Wan2_1-InfiniteTalk_Single_Q8.gguf","url":"https://huggingface.co/Kijai/WanVideo_comfy_GGUF/resolve/main/InfiniteTalk/Wan2_1-InfiniteTalk_Single_Q8.gguf","pinnedUrl":"https://huggingface.co/Kijai/WanVideo_comfy_GGUF/resolve/8418a4ed00314a49f44b73a0d43d40aa539264da/InfiniteTalk/Wan2_1-InfiniteTalk_Single_Q8.gguf","sizeBytes":2646330016,"sha256":"c5e251c56174995d940494ec02fdf9d36da00dffdde6827829801cd171fe8ffd","gated":false,"presence":"loader","loaders":[["MultiTalkModelLoader","model"]]},@@ -359,6 +360,7 @@"audio-timeline": {"core":["AudioConcat","AudioMerge","EmptyAudio","LoadAudio","SaveAudio","TrimAudioDuration"],"packs":{},"files":[],"optional":[],"vramGb":0,"isolated":false,"firstRun":[],"validated":true,"cpu":true},"bg-remove-birefnet": {"core":["InvertMask","JoinImageWithAlpha","LoadBackgroundRemovalModel","LoadImage","RemoveBackground","SaveImage"],"packs":{},"files":["background_removal/birefnet.safetensors"],"optional":[],"vramGb":4,"isolated":false,"firstRun":[],"validated":true},"bg-remove-rmbg": {"core":["LoadImage","SaveImage"],"packs":{"ComfyUI-RMBG":["RMBG"]},"files":[],"optional":[],"vramGb":4,"isolated":false,"firstRun":["ComfyUI-RMBG downloads the selected model (BEN2 -> models/RMBG/BEN2) from Hugging Face on first run"],"validated":true},+ "bg-remove-rmbg3": {"core":["CLIPLoader","GetImageSize","ImageScale","ImageToMask","InvertMask","JoinImageWithAlpha","KSampler","LoadImage","SaveImage","TextEncodeFibo2","UNETLoader","VAEDecode","VAELoader"],"packs":{},"files":["diffusion_models/RMBG-3.0-bf16.safetensors","text_encoders/qwen3vl_4b_int8_convrot.safetensors","vae/flux2-vae.safetensors"],"optional":[],"vramGb":32,"isolated":false,"firstRun":[]},"body-double-clip-instanthmr": {"core":["BuildPoseFile","CheckpointLoaderSimple","GrowMask","ImageScaleToMaxDimension","LoadMoGeModel","MoGeInference","MoGeRender","RTDETR_detect","SAM3DBody_Loader","SAM3DBody_Render","SAM3DBody_Smooth","SAM3_Detect","SaveGLB","UNETLoader"],"packs":{"ComfyUI-BodyDouble":["BodyDoubleFit","BodyDoubleLook"],"ComfyUI-InstantHMR":["InstantHMRLoader","InstantHMRPredict"],"ComfyUI-VideoHelperSuite":["VHS_LoadVideoFFmpeg","VHS_VideoCombine"]},"files":["checkpoints/sam3.1_multiplex_fp16.safetensors","detection/instanthmr_medium.safetensors","detection/sam_3d_body_dinov3_int8_convrot.safetensors","diffusion_models/rt_detr_v4-x-hgnet_fp16.safetensors","geometry_estimation/moge_2_vitl_normal_fp16.safetensors"],"optional":[],"vramGb":10,"isolated":false,"firstRun":[],"validated":true},"body-double-photo-instanthmr": {"core":["BuildPoseFile","CheckpointLoaderSimple","GrowMask","LoadImage","LoadMoGeModel","MoGeInference","MoGeRender","RTDETR_detect","SAM3DBody_Loader","SAM3DBody_Render","SAM3_Detect","SaveGLB","SaveImage","UNETLoader"],"packs":{"ComfyUI-BodyDouble":["BodyDoubleFit","BodyDoubleLook"],"ComfyUI-InstantHMR":["InstantHMRLoader","InstantHMRPredict"]},"files":["checkpoints/sam3.1_multiplex_fp16.safetensors","detection/instanthmr_medium.safetensors","detection/sam_3d_body_dinov3_int8_convrot.safetensors","diffusion_models/rt_detr_v4-x-hgnet_fp16.safetensors","geometry_estimation/moge_2_vitl_normal_fp16.safetensors"],"optional":[],"vramGb":8,"isolated":false,"firstRun":[],"validated":true},"captions-burnin": {"core":["ConcatenateVideo","CreateVideo","GetVideoComponents","LoadAudio","LoadVideo","SaveVideo","TextOverlay","Video Slice"],"packs":{},"files":[],"optional":[],"vramGb":0,"isolated":false,"firstRun":[],"validated":true,"cpu":true},