Skip to content

One-click character swap for videos: an open-source, local Higgsfield Genjutsu alternative built on ComfyUI and MiniMax H3, with FLUX.3 Klein relighting.

Add steps, base model and LoRA settings

D3voz2d089da42942
diff --git a/.env.example b/.env.example
index 1cdc22d..21fdc3f 100644
--- a/.env.example
+++ b/.env.example
@@ -2,3 +2,5 @@
COMFY_BASE_URL=http://127.0.0.1:8189
# Only for a Comfy Developer Platform deployment or Comfy Cloud.
COMFY_API_KEY=
+# ComfyUI itself (not the proxy), only to fill the base model and LoRA pickers. Leave empty for 127.0.0.1:8188.
+COMFYUI_URL=
diff --git a/README.md b/README.md
index 6764353..b28d51a 100644
--- a/README.md
+++ b/README.md
@@ -65,7 +65,7 @@ On Windows, double-click `start_openjutsu.bat` (ComfyUI must be running, or star
4. Open <http://127.0.0.1:3000>.
-`.env.local` sets `COMFY_BASE_URL=http://127.0.0.1:8189`. Leave `COMFY_API_KEY` empty for a local proxy.
+`.env.local` sets `COMFY_BASE_URL=http://127.0.0.1:8189`. Leave `COMFY_API_KEY` empty for a local proxy. The base model and LoRA pickers read ComfyUI's model lists from `COMFYUI_URL` (default `http://127.0.0.1:8188`); without it they become text fields.
A 6 s clip at 480p takes about 6–13 minutes on a 4060 Ti, most of it in H3 sampling. 736p is the default; 1080p is about 2.5× slower than 736p and needs much more memory.
@@ -76,6 +76,7 @@ A 6 s clip at 480p takes about 6–13 minutes on a 4060 Ti, most of it in H3 sam
- **Hat fix** also masks the hat, so it is replaced too (about 45 s more per clip).
- **Check mask** runs only SAM and the mask (about a minute per 3 s of video) and shows a preview you can scrub frame by frame: cyan is the area H3 regenerates, orange the tracked person, and on the right the grey mannequin H3 copies the motion from. Anything outside the cyan area stays as it is. If the character is cut off or too much background changes, set **Mask margin** (Tight, Normal, Loose) and check again; a re-check takes seconds.
- Change the **seed** (under Advanced) for a new take. Running the same inputs again resumes from the last finished clip.
+- **Steps**, **Base model** and **LoRAs** (under Advanced) default to the H3 pruned INT8 model with the DMAD speed LoRA at 6 steps. LoRAs apply in order; without a speed LoRA, use 20 steps or more. Check mask ignores them.
- **Advanced mode:** give roles as `the drummer`, optionally with how they look after ` - ` (`the drummer - man in a cap`); the look only helps match people and never reaches H3. **One pass per person** gives each of two characters their own H3 pass with only their photo (about twice the time). Check mask is Simple-only for now.
## How it works
@@ -87,6 +88,8 @@ Each clip, SAM 3.1 tracks everyone at 1008 px (its own working size), and H3 Peo
- without the hat fix, removes the hat nodes and connects Grow Mask to the People Mask output;
- sets the Swap Plan's resolution, seed, clip length and role.
+`lib/model.ts` then sets the Swap Plan's steps and the H3 Diffusion Model file, and replaces the DMAD LoRA node with the chosen LoRAs in a chain (or links the model straight through when there are none). Advanced mode does the same.
+
`lib/comfy.ts` binds the uploaded video to `VHS_LoadVideo` and the photo to the `LoadImage` node, then submits with the SDK. `/api/jobs/[id]/events` streams `job.events()` to the page as server-sent events. Node ids are turned into node titles and clip numbers there: each clip after the first is a graph expansion whose node ids carry a prefix per clip (`58`, `64.0.0.58`, `64.0.0.Recurse.0.0.58`). The final MP4 is the output of the Final Video node (`MiniMaxH3ChainAssemble`, node `65`).
`workflows/mask.api.json` is the mask check: the same SAM, People Mask and grow settings over the whole video, with the mask tinted over the frames next to the mannequin, saved as an MP4.
diff --git a/app/api/jobs/route.ts b/app/api/jobs/route.ts
index a299b30..8a5cf08 100644
--- a/app/api/jobs/route.ts
+++ b/app/api/jobs/route.ts
@@ -1,6 +1,7 @@
import { NextResponse } from "next/server";
-import { submitAdvanced, submitMask, submitSimple } from "../../../lib/comfy.ts";
+import { listModels, submitAdvanced, submitMask, submitSimple } from "../../../lib/comfy.ts";
import { MAX_CHARACTERS } from "../../../lib/advanced.ts";
+import { MAX_LORAS, STEPS, STRENGTH, type ModelSettings } from "../../../lib/model.ts";
import { CLIP_SECONDS, MARGINS, MAX_SEED, RESOLUTIONS, type Margin, type Resolution, type SimpleSettings } from "../../../lib/simple.ts";
export const runtime = "nodejs";
@@ -37,6 +38,22 @@ function parseRun(form: FormData) {
return { resolution: resolution as Resolution, ...parseMask(form), seed, clipSeconds };
}
+function parseModel(form: FormData, available: { models: string[]; loras: string[] } | null): ModelSettings {
+ const steps = Number(form.get("steps"));
+ if (!Number.isInteger(steps) || steps < STEPS.min || steps > STEPS.max) throw new Error(`Steps must be a whole number from ${STEPS.min} to ${STEPS.max}.`);
+ const model = String(form.get("model") ?? "").trim();
+ if (!model || (available && !available.models.includes(model))) throw new Error("Choose a base model ComfyUI has.");
+ const names = form.getAll("lora").map((name) => String(name).trim());
+ const strengths = form.getAll("lora_strength").map(Number);
+ if (names.length > MAX_LORAS || strengths.length !== names.length) throw new Error(`Use at most ${MAX_LORAS} LoRAs, each with a strength.`);
+ const loras = names.map((name, i) => {
+ if (!name || (available && !available.loras.includes(name))) throw new Error("Choose LoRAs ComfyUI has.");
+ if (!(strengths[i] >= STRENGTH.min && strengths[i] <= STRENGTH.max)) throw new Error(`LoRA strength must be ${STRENGTH.min} to ${STRENGTH.max}.`);
+ return { name, strength: strengths[i] };
+ });
+ return { steps, model, loras };
+}
+
function parseSimple(form: FormData) {
const picture = parsePicture(form.get("picture"));
const settings: SimpleSettings = { role: String(form.get("role") ?? "").slice(0, 200), ...parseRun(form) };
@@ -63,10 +80,12 @@ export async function POST(request: Request) {
submit = () => submitMask(video, hatFix, margin);
} else if (mode === "simple") {
const { picture, settings } = parseSimple(form);
- submit = () => submitSimple(video, picture, settings);
+ const model = parseModel(form, await listModels());
+ submit = () => submitSimple(video, picture, settings, model);
} else if (mode === "advanced") {
const { pictures, maxQuality, settings } = parseAdvanced(form);
- submit = () => submitAdvanced(video, pictures, settings, maxQuality);
+ const model = parseModel(form, await listModels());
+ submit = () => submitAdvanced(video, pictures, settings, maxQuality, model);
} else {
throw new Error("Unknown mode.");
}
diff --git a/app/api/models/route.ts b/app/api/models/route.ts
new file mode 100644
index 0000000..e9e6931
--- /dev/null
+++ b/app/api/models/route.ts
@@ -0,0 +1,9 @@
+import { NextResponse } from "next/server";
+import { listModels } from "../../../lib/comfy.ts";
+
+export const runtime = "nodejs";
+export const dynamic = "force-dynamic";
+
+export async function GET() {
+ return NextResponse.json((await listModels()) ?? { models: [], loras: [] });
+}
diff --git a/app/globals.css b/app/globals.css
index e261dd3..a761504 100644
--- a/app/globals.css
+++ b/app/globals.css
@@ -78,10 +78,10 @@ video { width: 100%; border-radius: 12px; background: #000; max-height: 420px; }
.character { position: relative; background: var(--panel-2); border-radius: 14px; overflow: hidden; display: grid; }
.character img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; }
.character label { display: grid; gap: 4px; padding: 10px; font-size: 0.82em; color: var(--muted); }
-.character input, .seed input {
+.character input, .seed input, .file-name, .steps-input, .lora input {
background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; width: 100%;
}
-.character input:focus, .seed input:focus { outline: none; border-color: var(--accent); }
+.character input:focus, .seed input:focus, .file-name:focus, .steps-input:focus, .lora input:focus { outline: none; border-color: var(--accent); }
.remove {
position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; border: 0;
background: #000a; font-size: 18px; line-height: 1;
@@ -142,3 +142,10 @@ input[type="range"] { accent-color: var(--accent); width: 220px; max-width: 100%
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.swatch.cyan { background: rgb(0, 200, 255); }
.swatch.orange { background: rgb(255, 140, 0); }
+
+.file-name { min-width: 0; width: min(100%, 420px); }
+.steps-input { width: 6rem; }
+.setting.loras { align-items: flex-start; }
+.lora-list { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; flex: 1 1 100%; }
+.lora { display: grid; grid-template-columns: minmax(0, 1fr) 4.5rem auto; gap: 8px; width: 100%; }
+.lora .file-name { width: 100%; }
diff --git a/components/openjutsu.tsx b/components/openjutsu.tsx
index 34e782f..97b1756 100644
--- a/components/openjutsu.tsx
+++ b/components/openjutsu.tsx
@@ -6,6 +6,7 @@ import type { NodeInfo } from "../lib/progress.ts";
import { clipCount, clipStarts } from "../lib/clips.ts";
import { CLIP_SECONDS, MARGINS, MAX_SEED, RESOLUTIONS, type Margin, type Resolution } from "../lib/simple.ts";
import { MAX_CHARACTERS } from "../lib/advanced.ts";
+import { DEFAULT_MODEL, MAX_LORAS, STEPS, STRENGTH, type Lora } from "../lib/model.ts";
type Character = { file: File; url: string; role: string };
type Mode = "simple" | "advanced";
@@ -58,6 +59,16 @@ function clipShare(progress: Progress) {
return 0.05;
}
+// A picker over ComfyUI's files, or a text field when the list could not be read.
+function FilePicker({ value, options, onChange, label }: { value: string; options: string[]; onChange: (value: string) => void; label: string }) {
+ if (!options.length) return <input className="file-name" aria-label={label} value={value} onChange={(event) => onChange(event.target.value)} />;
+ return (
+ <select className="file-name" aria-label={label} value={value} onChange={(event) => onChange(event.target.value)}>
+ {(options.includes(value) ? options : [value, ...options]).map((name) => <option key={name} value={name}>{name}</option>)}
+ </select>
+ );
+}
+
function MarginPicker({ value, onChange }: { value: Margin; onChange: (margin: Margin) => void }) {
return (
<div className="segmented">
@@ -96,6 +107,10 @@ export function Openjutsu() {
const [margin, setMargin] = useState<Margin>("normal");
const [seed, setSeed] = useState(0);
const [clipSeconds, setClipSeconds] = useState(CLIP_SECONDS.default);
+ const [steps, setSteps] = useState(DEFAULT_MODEL.steps);
+ const [model, setModel] = useState(DEFAULT_MODEL.model);
+ const [loras, setLoras] = useState<Lora[]>(DEFAULT_MODEL.loras);
+ const [files, setFiles] = useState<{ models: string[]; loras: string[] }>({ models: [], loras: [] });
const [submitting, setSubmitting] = useState(false);
const [formError, setFormError] = useState("");
@@ -108,6 +123,10 @@ export function Openjutsu() {
useEffect(() => setRun(readRun()), []);
+ useEffect(() => {
+ fetch("/api/models").then((response) => response.json()).then(setFiles, () => {});
+ }, []);
+
useEffect(() => {
if (!run) return;
const source = new EventSource(`/api/jobs/${run.id}/events?kind=${run.kind ?? "simple"}`);
@@ -204,6 +223,14 @@ export function Openjutsu() {
form.set("seed", String(seed));
form.set("clip_seconds", String(clipSeconds));
}
+ if (kind !== "mask") {
+ form.set("steps", String(steps));
+ form.set("model", model);
+ for (const l of loras) {
+ form.append("lora", l.name);
+ form.append("lora_strength", String(l.strength));
+ }
+ }
try {
const response = await fetch("/api/jobs", { method: "POST", body: form });
const body = await response.json();
@@ -369,6 +396,35 @@ export function Openjutsu() {
<span>Clip length <small>{clipSeconds.toFixed(1)} s per H3 generation</small></span>
<input type="range" min={CLIP_SECONDS.min} max={CLIP_SECONDS.max} step={0.5} value={clipSeconds} onChange={(event) => setClipSeconds(Number(event.target.value))} />
</div>
+ <div className="setting">
+ <span>Steps <small>6 with the DMAD speed LoRA; without a speed LoRA, 20 or more.</small></span>
+ <input
+ className="steps-input" type="number" min={STEPS.min} max={STEPS.max} value={steps}
+ onChange={(event) => setSteps(Math.min(STEPS.max, Math.max(STEPS.min, Math.floor(Number(event.target.value) || STEPS.min))))}
+ />
+ </div>
+ <div className="setting">
+ <span>Base model <small>The H3 diffusion model in ComfyUI&apos;s models/diffusion_models.</small></span>
+ <FilePicker label="Base model" value={model} options={files.models} onChange={setModel} />
+ </div>
+ <div className="setting loras">
+ <span>LoRAs <small>Applied in order to the base model. Remove the DMAD LoRA only together with more steps.</small></span>
+ <div className="lora-list">
+ {loras.map((l, i) => (
+ <div className="lora" key={i}>
+ <FilePicker label={`LoRA ${i + 1}`} value={l.name} options={files.loras} onChange={(name) => setLoras(loras.map((x, j) => (j === i ? { ...x, name } : x)))} />
+ <input
+ type="number" aria-label={`LoRA ${i + 1} strength`} min={STRENGTH.min} max={STRENGTH.max} step={0.05} value={l.strength}
+ onChange={(event) => setLoras(loras.map((x, j) => (j === i ? { ...x, strength: Math.min(STRENGTH.max, Math.max(STRENGTH.min, Number(event.target.value) || 0)) } : x)))}
+ />
+ <button className="secondary" onClick={() => setLoras(loras.filter((_, j) => j !== i))} aria-label={`Remove LoRA ${i + 1}`}>×</button>
+ </div>
+ ))}
+ {loras.length < MAX_LORAS && (
+ <button className="secondary" onClick={() => setLoras([...loras, { name: files.loras[0] ?? "", strength: 1 }])}>Add LoRA</button>
+ )}
+ </div>
+ </div>
</details>
</section>
diff --git a/lib/advanced.ts b/lib/advanced.ts
index b33519a..58ef58d 100644
--- a/lib/advanced.ts
+++ b/lib/advanced.ts
@@ -21,7 +21,7 @@ export const VIDEO = "Source video (people get replaced)";
export function nodeByTitle(graph: ApiGraph, title: string) {
const ids = Object.keys(graph).filter((id) => graph[id]._meta?.title === title);
- if (ids.length !== 1) throw new Error(`Expected one "${title}" node in the advanced workflow, found ${ids.length}.`);
+ if (ids.length !== 1) throw new Error(`Expected one "${title}" node in the workflow, found ${ids.length}.`);
return ids[0];
}
diff --git a/lib/comfy.ts b/lib/comfy.ts
index 3458709..ef21e7c 100644
--- a/lib/comfy.ts
+++ b/lib/comfy.ts
@@ -4,6 +4,7 @@ import { Comfy, resolveBaseUrl, resolveCredentials, type Job } from "@comfyorg/s
import { ComfyLow } from "@comfyorg/sdk/low";
import { MASK_NODES, NODES, pruneMask, pruneSimple, type ApiGraph, type Margin, type SimpleSettings } from "./simple.ts";
import { VIDEO, nodeByTitle, pruneAdvanced, type AdvancedSettings } from "./advanced.ts";
+import { applyModel, type ModelSettings } from "./model.ts";
export type PublicJob = {
id: string;
@@ -63,17 +64,20 @@ function upload(comfy: Comfy, file: File) {
);
}
-export async function submitSimple(video: File, picture: File, settings: SimpleSettings) {
+export async function submitSimple(video: File, picture: File, settings: SimpleSettings, model: ModelSettings) {
const comfy = client();
- const workflow = comfy.workflows.fromJson(pruneSimple(await loadGraph("simple"), settings));
+ const graph = pruneSimple(await loadGraph("simple"), settings);
+ applyModel(graph, model);
+ const workflow = comfy.workflows.fromJson(graph);
workflow.setInput(NODES.video, "video", await upload(comfy, video));
workflow.setInput(NODES.picture, "image", await upload(comfy, picture));
return publicJob(await comfy.submit(workflow));
}
-export async function submitAdvanced(video: File, pictures: File[], settings: AdvancedSettings, maxQuality: boolean) {
+export async function submitAdvanced(video: File, pictures: File[], settings: AdvancedSettings, maxQuality: boolean, model: ModelSettings) {
const comfy = client();
const graph = pruneAdvanced(await loadGraph(maxQuality ? "advanced_maxq" : "advanced"), pictures.length, settings);
+ applyModel(graph, model);
const workflow = comfy.workflows.fromJson(graph);
workflow.setInput(nodeByTitle(graph, VIDEO), "video", await upload(comfy, video));
for (const [i, picture] of pictures.entries()) workflow.setInput(nodeByTitle(graph, `Picture ${i + 1}`), "image", await upload(comfy, picture));
@@ -87,6 +91,22 @@ export async function submitMask(video: File, hatFix: boolean, margin: Margin) {
return publicJob(await comfy.submit(workflow));
}
+// The proxy has no model listing, so the pickers read ComfyUI's own node info. COMFYUI_URL points at ComfyUI itself
+// (not the proxy); without it, or when it does not answer, the page falls back to typed file names.
+export async function listModels(): Promise<{ models: string[]; loras: string[] } | null> {
+ const base = process.env.COMFYUI_URL || "http://127.0.0.1:8188";
+ const options = async (node: string, input: string) => {
+ const info = await (await fetch(`${base}/object_info/${node}`, { signal: AbortSignal.timeout(5000) })).json();
+ return info[node].input.required[input][0] as string[];
+ };
+ try {
+ const [models, loras] = await Promise.all([options("UNETLoader", "unet_name"), options("LoraLoaderModelOnly", "lora_name")]);
+ return { models, loras };
+ } catch {
+ return null;
+ }
+}
+
export function getJob(id: string) {
return client().jobs.get(id);
}
diff --git a/lib/model.ts b/lib/model.ts
new file mode 100644
index 0000000..898a0e7
--- /dev/null
+++ b/lib/model.ts
@@ -0,0 +1,39 @@
+// Base model, LoRAs and steps, shared by every swap workflow. Each export has one "H3 Diffusion Model" UNETLoader
+// feeding one "DMAD LoRA" LoraLoaderModelOnly; the LoRA list replaces that node with a chain (or removes it).
+import { nodeByTitle } from "./advanced.ts";
+import { isLink, type ApiGraph } from "./simple.ts";
+
+export type Lora = { name: string; strength: number };
+export type ModelSettings = { model: string; loras: Lora[]; steps: number };
+
+export const DEFAULT_MODEL: ModelSettings = {
+ model: "minimax_h3_ref2va_pruned_int8_convrot.safetensors",
+ loras: [{ name: "minimax_h3_DMAD_4step_full_lora_avg_rank_39_bf16.safetensors", strength: 1 }],
+ steps: 6,
+};
+export const MAX_LORAS = 4;
+export const STEPS = { min: 1, max: 100 };
+export const STRENGTH = { min: -4, max: 4 };
+
+// Mutates graph: the Swap Plan's steps, the chosen diffusion model, then the LoRAs in order into whatever read the old LoRA node.
+export function applyModel(graph: ApiGraph, settings: ModelSettings) {
+ const plans = Object.values(graph).filter((node) => node.class_type === "H3OneClickSwapPlan" || node.class_type === "H3AdvancedSwapPlan");
+ if (plans.length !== 1) throw new Error(`Expected one Swap Plan node in the workflow, found ${plans.length}.`);
+ plans[0].inputs.steps = settings.steps;
+ const unet = nodeByTitle(graph, "H3 Diffusion Model");
+ const lora = nodeByTitle(graph, "DMAD LoRA");
+ graph[unet].inputs.unet_name = settings.model;
+
+ const template = graph[lora];
+ delete graph[lora];
+ let last: [string, number] = [unet, 0];
+ settings.loras.forEach((l, i) => {
+ const id = i === 0 ? lora : `${lora}_lora${i + 1}`;
+ graph[id] = { ...template, inputs: { ...template.inputs, lora_name: l.name, strength_model: l.strength, model: last }, _meta: { title: `LoRA ${i + 1}` } };
+ last = [id, 0];
+ });
+ for (const [id, node] of Object.entries(graph)) {
+ if (id === lora || id.startsWith(`${lora}_lora`)) continue;
+ for (const [name, value] of Object.entries(node.inputs)) if (isLink(value) && value[0] === lora) node.inputs[name] = last;
+ }
+}
diff --git a/test/model.test.ts b/test/model.test.ts
new file mode 100644
index 0000000..e7c4e26
--- /dev/null
+++ b/test/model.test.ts
@@ -0,0 +1,58 @@
+import assert from "node:assert/strict";
+import { readFileSync } from "node:fs";
+import test from "node:test";
+import { nodeByTitle } from "../lib/advanced.ts";
+import { DEFAULT_MODEL, applyModel } from "../lib/model.ts";
+import { isLink, type ApiGraph } from "../lib/simple.ts";
+
+const load = (name: string): ApiGraph => JSON.parse(readFileSync(new URL(`../workflows/${name}.api.json`, import.meta.url), "utf8"));
+const exports = ["simple", "advanced", "advanced_maxq"];
+const plan = (g: ApiGraph) => Object.values(g).find((node) => /^H3(OneClick|Advanced)SwapPlan$/.test(node.class_type))!;
+const loras = (g: ApiGraph) => Object.entries(g).filter(([, node]) => node.class_type === "LoraLoaderModelOnly");
+const dangling = (g: ApiGraph) => Object.entries(g).flatMap(([id, node]) =>
+ Object.entries(node.inputs).filter(([, v]) => isLink(v) && !g[v[0]]).map(([name]) => `${id}.${name}`));
+// Whatever read the export's LoRA node (the model input of the sampling chain).
+const consumers = (g: ApiGraph, id: string) => Object.entries(g).flatMap(([cid, node]) =>
+ Object.entries(node.inputs).filter(([, v]) => isLink(v) && v[0] === id).map(([name]) => [cid, name] as const));
+
+test("the default settings match the exports", () => {
+ for (const name of exports) {
+ const g = load(name);
+ const lora = g[nodeByTitle(g, "DMAD LoRA")].inputs;
+ assert.equal(g[nodeByTitle(g, "H3 Diffusion Model")].inputs.unet_name, DEFAULT_MODEL.model, name);
+ assert.deepEqual([lora.lora_name, lora.strength_model], [DEFAULT_MODEL.loras[0].name, DEFAULT_MODEL.loras[0].strength], name);
+ assert.equal(plan(g).inputs.steps, DEFAULT_MODEL.steps, name);
+ }
+});
+
+test("two LoRAs chain from the base model into the sampler", () => {
+ for (const name of exports) {
+ const g = load(name);
+ const unet = nodeByTitle(g, "H3 Diffusion Model");
+ const old = nodeByTitle(g, "DMAD LoRA");
+ const readers = consumers(g, old);
+ applyModel(g, { model: "other.safetensors", loras: [{ name: "a.safetensors", strength: 0.5 }, { name: "b.safetensors", strength: -1 }], steps: 20 });
+ assert.deepEqual(dangling(g), [], name);
+ assert.equal(g[unet].inputs.unet_name, "other.safetensors");
+ assert.equal(plan(g).inputs.steps, 20);
+ const chain = loras(g);
+ assert.deepEqual(chain.map(([id, n]) => [id, n._meta?.title, n.inputs.lora_name, n.inputs.strength_model]),
+ [[old, "LoRA 1", "a.safetensors", 0.5], [`${old}_lora2`, "LoRA 2", "b.safetensors", -1]]);
+ assert.deepEqual(g[old].inputs.model, [unet, 0]);
+ assert.deepEqual(g[`${old}_lora2`].inputs.model, [old, 0]);
+ for (const [id, input] of readers) assert.deepEqual(g[id].inputs[input], [`${old}_lora2`, 0], name);
+ }
+});
+
+test("no LoRAs feed the base model straight to the sampler", () => {
+ for (const name of exports) {
+ const g = load(name);
+ const unet = nodeByTitle(g, "H3 Diffusion Model");
+ const readers = consumers(g, nodeByTitle(g, "DMAD LoRA"));
+ applyModel(g, { ...DEFAULT_MODEL, loras: [], steps: 24 });
+ assert.deepEqual(dangling(g), [], name);
+ assert.deepEqual(loras(g), []);
+ assert.equal(plan(g).inputs.steps, 24);
+ for (const [id, input] of readers) assert.deepEqual(g[id].inputs[input], [unet, 0], name);
+ }
+});