Skip to content

armgit / fuobe

Public Imported from GitHub
0

The open creative studio on ComfyUI: images, video, 3D and audio on open weights, on your own GPU or the cloud. Camera motions, effects, apps, Cinema, Layers, Image to 3D and an AI agent.

Workers: stream any workflow whose files fit in VRAM and RAM, and move a streamed job that runs out of memory

Adarsh1c8d237539b3
diff --git a/scripts/comfy/build-requirements.mjs b/scripts/comfy/build-requirements.mjs
index f0c660cc..947ec1a2 100644
--- a/scripts/comfy/build-requirements.mjs
+++ b/scripts/comfy/build-requirements.mjs
@@ -8,8 +8,8 @@
* Built from the committed library alone, no ComfyUI and no network: manifest.json, the workflow graphs,
* object_info.subset.json (which classes are core and which belong to a pack), packs.json (pins, kept by hand),
* model-pins.json (revisions and sizes), model-variants.json (other files of the same models, kept by hand) and
- * stream-needs.json (the smaller card and the RAM a workflow runs on with its weights streamed from RAM, kept by hand). It
- * runs at the end of build-library.mjs and alone:
+ * stream-needs.json (the smaller card and the RAM a workflow runs on with its weights streamed from RAM, and the packs
+ * and workflows that never stream, kept by hand). It runs at the end of build-library.mjs and alone:
*
* node scripts/comfy/build-requirements.mjs # write requirements.json
* node scripts/comfy/build-requirements.mjs --refresh-pins # maintainers: re-read model-pins.json from Hugging Face
@@ -235,8 +235,9 @@ export function buildIndex({ manifest, graphs, subset, packs, pins, variants = {
problems.push(...built.problems);
for (const [id, list] of Object.entries(built.byWorkflow)) workflows[id] = { ...workflows[id], variants: list };
- // Streaming needs: the smaller card and the RAM a workflow runs on with part of its weights in RAM (stream-needs.json).
- const streamed = streamNeeds({ streams, workflows });
+ // Streaming needs: the smaller card and the RAM a workflow runs on with part of its weights in RAM (stream-needs.json),
+ // or false for a workflow that never streams.
+ const streamed = streamNeeds({ streams, workflows, packs });
problems.push(...streamed.problems);
for (const [id, stream] of Object.entries(streamed.byWorkflow)) workflows[id] = { ...workflows[id], stream };
@@ -396,13 +397,21 @@ const STREAM_MAX_GB = 2048;
* stops on any). An entry is refused when a number isn't above 0, when its VRAM isn't below the workflow's own VRAM
* need, when it names a workflow the manifest doesn't have, and when a workflow is named twice.
*
- * @param {{ streams: { streams?: object[] }, workflows: Record<string, { vramGb: number }> }} o
+ * A workflow with no streaming need of its own may still stream by the computed rule (src/lib/lanes.ts streamFits: the
+ * size of the files it loads against the GPU's VRAM and RAM), unless it never streams: `noStream` names the node packs
+ * (`packs`) and the workflows (`workflows`) whose models are loaded outside ComfyUI's model management (a pack's own
+ * loader and offloading), which dynamic VRAM loading can't stream. An isolated workflow never streams either: it runs on
+ * a ComfyUI of its own. Each of these gets `false` in `byWorkflow`. A name the catalog doesn't have is refused, and so is
+ * a workflow that has a streaming need and never streams.
+ *
+ * @param {{ streams: { streams?: object[], noStream?: { packs?: string[], workflows?: string[] } }, workflows: Record<string, { vramGb: number, packs?: Record<string, string[]>, isolated?: boolean }>, packs?: Record<string, object> }} o
*/
-export function streamNeeds({ streams, workflows }) {
+export function streamNeeds({ streams, workflows, packs = {} }) {
const problems = [];
const byWorkflow = {};
const list = streams?.streams;
if (!Array.isArray(list)) return { byWorkflow, problems: ['stream-needs.json: "streams" must be a list'] };
+ for (const k of Object.keys(streams ?? {})) if (k !== 'streams' && k !== 'noStream') problems.push(`stream-needs.json: unknown field ${k}`);
const gb = (v) => typeof v === 'number' && Number.isFinite(v) && v > 0 && v <= STREAM_MAX_GB;
const known = new Set(['workflows', 'vramGb', 'ramGb']);
list.forEach((e, i) => {
@@ -427,6 +436,30 @@ export function streamNeeds({ streams, workflows }) {
if (gb(e.vramGb) && gb(e.ramGb)) byWorkflow[id] = { vramGb: e.vramGb, ramGb: e.ramGb };
}
});
+ // The workflows that never stream: noStream's packs and workflows, and every isolated workflow.
+ const no = streams.noStream ?? {};
+ const names = (k) => (Array.isArray(no[k]) && no[k].every((x) => typeof x === 'string') ? no[k] : null);
+ const noPacks = names('packs');
+ const noWorkflows = names('workflows');
+ if (!no || typeof no !== 'object' || Array.isArray(no)) problems.push('stream-needs.json: "noStream" must be an object');
+ else {
+ for (const k of Object.keys(no)) if (k !== 'packs' && k !== 'workflows') problems.push(`stream-needs.json noStream: unknown field ${k}`);
+ if (no.packs !== undefined && !noPacks) problems.push('stream-needs.json noStream: packs must be a list of node pack names');
+ if (no.workflows !== undefined && !noWorkflows) problems.push('stream-needs.json noStream: workflows must be a list of workflow ids');
+ }
+ for (const p of noPacks ?? []) if (!packs[p]) problems.push(`stream-needs.json noStream: ${p} isn't a node pack of packs.json`);
+ for (const id of noWorkflows ?? []) if (!workflows[id]) problems.push(`stream-needs.json noStream: ${id} isn't a workflow of the manifest`);
+ const packSet = new Set(noPacks ?? []);
+ const wfSet = new Set(noWorkflows ?? []);
+ for (const [id, wf] of Object.entries(workflows)) {
+ const why = wf.isolated ? 'it runs isolated' : wfSet.has(id) ? 'noStream names it' : Object.keys(wf.packs ?? {}).find((p) => packSet.has(p));
+ if (!why) continue;
+ if (byWorkflow[id]) {
+ problems.push(`stream-needs.json: ${id} has a streaming need, but it never streams (${packSet.has(why) ? `it uses ${why}` : why})`);
+ continue;
+ }
+ byWorkflow[id] = false;
+ }
return { byWorkflow, problems };
}
diff --git a/src/app/api/admin/workers/[id]/route.ts b/src/app/api/admin/workers/[id]/route.ts
index f18b8440..6248e61f 100644
--- a/src/app/api/admin/workers/[id]/route.ts
+++ b/src/app/api/admin/workers/[id]/route.ts
@@ -4,11 +4,11 @@ import { patchWorker, type WorkerPatch } from "@/server/computer/pool";
const NO_STORE = { "Cache-Control": "no-store" };
/** The changes a worker takes: the log names which were sent, never their values (a rotate's token least of all). */
-const KEYS = ["paused", "pauseNow", "drain", "autoResume", "hours", "allow", "claimAfterMs", "switchAfterMs", "pickOrder", "rotate", "revoke"] as const;
+const KEYS = ["paused", "pauseNow", "drain", "autoResume", "hours", "allow", "claimAfterMs", "switchAfterMs", "pickOrder", "clearNoStream", "rotate", "revoke"] as const;
/**
* Change a worker (owner only, or an admin token with workers:write):
- * `{ paused, pauseNow, drain, autoResume, hours, allow, claimAfterMs, switchAfterMs, pickOrder, rotate, revoke }`.
+ * `{ paused, pauseNow, drain, autoResume, hours, allow, claimAfterMs, switchAfterMs, pickOrder, clearNoStream, rotate, revoke }`.
* Each reaches the worker at its next beat. Rotate answers with the new token, once (an admin token needs
* workers:tokens for it); revoke stops the old token at once and puts its job back in line.
*/
diff --git a/src/components/workers-admin.tsx b/src/components/workers-admin.tsx
index ba9b43e1..898dfc9d 100644
--- a/src/components/workers-admin.tsx
+++ b/src/components/workers-admin.tsx
@@ -39,6 +39,8 @@ interface WorkerView {
allow: Record<string, { delayMs: number }>;
/** Its pick order: above 0, it gets first pick of the jobs it can run while it is free (a server from before sends none). */
pickOrder?: number;
+ /** The workflows it takes only with every weight on its card, newest first (a server from before sends none). */
+ noStream?: { workflowId: string; at: number }[];
/** The lanes it can run every workflow of. */
lanes: string[];
/** The lanes it can run only some workflows of (a server from before sends none). */
@@ -312,6 +314,46 @@ export function UpdateLine({ w, now }: { w: Pick<WorkerView, "id" | "words" | "u
);
}
+/** How long ago, in minutes, hours or days. */
+const agoWords = (ms: number) => {
+ const min = Math.max(0, Math.round(ms / 60_000));
+ if (min < 60) return `${min} min ago`;
+ const h = Math.round(min / 60);
+ return h < 48 ? `${h} h ago` : `${Math.round(h / 24)} days ago`;
+};
+
+/**
+ * The workflows a worker takes only with every weight on its card: a job of each ran out of memory there with its
+ * weights streamed from RAM, and went to another worker. Clearing one lets the worker stream it again.
+ */
+function NoStreamList({ list, now, busy, onClear }: { list: { workflowId: string; at: number }[]; now: number; busy: boolean; onClear: (ids: true | string[]) => void }) {
+ return (
+ <div className="space-y-1 text-[13px]">
+ <p>
+ Runs these only with every weight on its card
+ <span className="block text-[12px] text-muted-foreground">A job of each ran out of memory here with its weights streamed from RAM, and another worker took it. Clear one to let this worker stream it again.</span>
+ </p>
+ <ul className="space-y-0.5">
+ {list.map((n) => (
+ <li key={n.workflowId} className="flex items-center justify-between gap-2">
+ <span className="min-w-0 truncate">
+ {n.workflowId} <span className="text-[12px] text-muted-foreground">· {agoWords(now - n.at)}</span>
+ </span>
+ <Button size="sm" variant="ghost" className="h-7 shrink-0" disabled={busy} onClick={() => onClear([n.workflowId])}>
+ Clear
+ </Button>
+ </li>
+ ))}
+ </ul>
+ {list.length > 1 && (
+ <Button size="sm" variant="ghost" className="h-7" disabled={busy} onClick={() => onClear(true)}>
+ Clear all
+ </Button>
+ )}
+ </div>
+ );
+}
+
function WorkerCard({ w, lanes, onToken }: { w: WorkerView; lanes: Lane[]; onToken: (t: string) => void }) {
const qc = useQueryClient();
const now = useNow(10_000);
@@ -395,6 +437,7 @@ function WorkerCard({ w, lanes, onToken }: { w: WorkerView; lanes: Lane[]; onTok
</span>
</label>
)}
+ {!!w.noStream?.length && <NoStreamList list={w.noStream} now={now} busy={patch.isPending} onClear={(clearNoStream) => patch.mutate({ clearNoStream })} />}
<HoursEditor w={w} onSave={(hours) => patch.mutate({ hours })} />
<LanesEditor key={JSON.stringify(w.allow)} w={w} lanes={lanes} onSave={(allow) => patch.mutate({ allow })} />
<div className="flex flex-wrap gap-1.5 border-t pt-2">
diff --git a/src/lib/gpu/model-variants.ts b/src/lib/gpu/model-variants.ts
index ef2d6ad9..9ae12a88 100644
--- a/src/lib/gpu/model-variants.ts
+++ b/src/lib/gpu/model-variants.ts
@@ -67,8 +67,11 @@ export interface ChoiceDevice {
gpuGen?: string | null;
/** Has it this file (a worker: verified against its pin; a person's ComfyUI: there, as its check read it)? */
has: (key: FileKey) => boolean;
- /** Its graphics memory: a choice that needs more is left out. Undefined: not checked here. */
- fits?: (vramGb: number) => boolean;
+ /**
+ * Its memory: a choice that needs more is left out. Given the choice's VRAM need and the files it loads (whose total
+ * size the computed streaming rule reads: src/lib/lanes.ts streamFits). Undefined: not checked here.
+ */
+ fits?: (vramGb: number, files: readonly FileKey[]) => boolean;
/** False: the workflow's own files only (a GPU that can't take a variant). */
variants: boolean;
}
@@ -80,7 +83,7 @@ export interface ChoiceDevice {
* workflow's own files count.
*/
export function pickFiles(choices: readonly FileChoice[], device: ChoiceDevice): FileChoice | null {
- const whole = (c: FileChoice) => c.files.every((k) => device.has(k)) && (!device.fits || device.fits(c.vramGb));
+ const whole = (c: FileChoice) => c.files.every((k) => device.has(k)) && (!device.fits || device.fits(c.vramGb, c.files));
const own = choices.find((c) => c.variant === null);
const others = device.variants ? choices.filter((c) => c.variant !== null) : [];
const forCard = others.filter((c) => genInside(device.gpuGen, c.gpuGen));
diff --git a/src/lib/gpu/readiness.ts b/src/lib/gpu/readiness.ts
index cca528ba..42a2a46d 100644
--- a/src/lib/gpu/readiness.ts
+++ b/src/lib/gpu/readiness.ts
@@ -2,8 +2,8 @@ import { compareVersions, formatBytes, nameKey, splitKey, vramGb } from "./requi
import { knownProblemNeed, knownProblems } from "./known-problems";
import { fileChoices, pickFiles, type FileChoice } from "./model-variants";
import { cardFits, GPU_NEED_TEXT, readCard, type GpuNeed } from "./rtx";
-import { streamFits } from "../lanes";
-import type { Badge, FileKey, GpuInventory, IndexFile, InventorySummary, Need, Readiness, RequirementIndex, StreamNeed, ToolReadiness, ToolRef, VramFit } from "./types";
+import { filesBytes, streamFits, type StreamLoad, type StreamRule } from "../lanes";
+import type { Badge, FileKey, GpuInventory, IndexFile, InventorySummary, Need, Readiness, RequirementIndex, ToolReadiness, ToolRef, VramFit } from "./types";
/**
* What can run on a viewer's ComfyUI (SPEC §7, review items 9 and 15). Pure: the same code runs on the
@@ -169,11 +169,12 @@ export function gpuVramGb(inv: GpuInventory): number | undefined {
}
/**
- * How the card holds a workflow of `needGb`. Short of VRAM, a workflow with a streaming need (`stream`,
- * stream-needs.json) still runs when the card and the system RAM cover that need (src/lib/lanes.ts streamFits, the
- * workers' rule): part of its weights stay in RAM, so it is "tight" (slower) with `stream`, never "no".
+ * How the card holds a workflow of `needGb`. Short of VRAM, a workflow still runs with part of its weights streamed from
+ * the system RAM when the card and the RAM allow it (src/lib/lanes.ts streamFits, the workers' rule): its streaming need
+ * (`stream`, stream-needs.json) when it has one, else the computed rule from the size of the files it loads (`load`);
+ * never a workflow whose `stream` is false. It is "tight" (slower) with `stream` then, never "no".
*/
-export function vramFit(needGb: number, inv: GpuInventory, stream?: StreamNeed): ToolReadiness["vram"] {
+export function vramFit(needGb: number, inv: GpuInventory, stream?: StreamRule, load?: StreamLoad): ToolReadiness["vram"] {
const d = inv.devices[0];
const cpu = onCpu(inv);
const haveGb = gpuVramGb(inv) ?? 0;
@@ -183,7 +184,7 @@ export function vramFit(needGb: number, inv: GpuInventory, stream?: StreamNeed):
else if (haveGb >= needGb) fit = "fits";
else if (haveGb >= 0.66 * needGb) fit = "tight";
else fit = "no";
- const streams = (fit === "tight" || fit === "no") && !cpu && streamFits(stream, { vramBytes: d?.vramTotal, ramBytes: inv.ram?.total, dynamicVramOff: inv.comfy?.flags.dynamicVramOff });
+ const streams = (fit === "tight" || fit === "no") && !cpu && streamFits(stream, { vramBytes: d?.vramTotal, ramBytes: inv.ram?.total, dynamicVramOff: inv.comfy?.flags.dynamicVramOff }, load, needGb);
if (streams) fit = "tight";
return { needGb, haveGb, fit, ...(apple && { apple: true }), ...(streams && { stream: true }) };
}
@@ -224,7 +225,7 @@ export function workflowReadiness(id: string, inv: GpuInventory, idx: Requiremen
if (!w || !inv.reachable) return base;
// Its own files, or a model variant's that are all there.
const files = filesHere(id, inv, idx) ?? { files: w.files, vramGb: w.vramGb };
- const out: WorkflowReadiness = { ...base, state: "ready", firstRun: w.firstRun, unvalidated: !w.validated, vram: vramFit(files.vramGb, inv, w.stream) };
+ const out: WorkflowReadiness = { ...base, state: "ready", firstRun: w.firstRun, unvalidated: !w.validated, vram: vramFit(files.vramGb, inv, w.stream, { fileBytes: filesBytes(idx, files.files) }) };
if (w.isolated && ctx.computer) return { ...out, state: "unsupported", reason: "This one needs its own ComfyUI, so it can't run next to your other add-ons." };
if (w.isolated && ctx.account) return { ...out, state: "unsupported", reason: "This one needs its own ComfyUI, so it can't run next to your other add-ons." };
// The NVIDIA RTX Video nodes: only on an NVIDIA RTX card (frame generation: RTX 40 or later). A card the check can't
diff --git a/src/lib/gpu/types.ts b/src/lib/gpu/types.ts
index 7d0f3c13..233a2f3c 100644
--- a/src/lib/gpu/types.ts
+++ b/src/lib/gpu/types.ts
@@ -109,9 +109,11 @@ export interface IndexWorkflow {
/**
* Its streaming need (workflows/comfyui/stream-needs.json): a GPU with less VRAM than `vramGb` above runs it with part of
* its model weights kept in system RAM and streamed to the card at each step (ComfyUI's dynamic VRAM loading), slower.
- * It needs this much VRAM and RAM then (src/lib/lanes.ts memoryFit).
+ * It needs this much VRAM and RAM then (src/lib/lanes.ts memoryFit). `false`: it never streams (its node packs load
+ * models outside ComfyUI's model management, or it runs isolated: stream-needs.json `noStream`). None: the computed
+ * rule decides from the size of the files it loads (src/lib/lanes.ts streamFits).
*/
- stream?: StreamNeed;
+ stream?: StreamNeed | false;
}
/** The VRAM and the system RAM a workflow runs on with its weights streamed from RAM, in GB. */
diff --git a/src/lib/lanes.ts b/src/lib/lanes.ts
index 3dd2bd21..1e508bc2 100644
--- a/src/lib/lanes.ts
+++ b/src/lib/lanes.ts
@@ -61,22 +61,76 @@ export interface MemoryFacts {
}
/**
- * Can a GPU run a workflow with its weights streamed from RAM (its streaming need, stream-needs.json): its VRAM covers the
- * need's VRAM and its RAM covers the need's RAM, each with the same 3% allowance as the VRAM test (a 32 GB PC reports
- * about 31.9 GiB). Never with no streaming need, unknown RAM, or dynamic VRAM off.
+ * A workflow's streaming rule as requirements.json gives it (`stream`): a streaming need of its own (stream-needs.json),
+ * `false` when it never streams (its node packs load models outside ComfyUI's model management, or it runs isolated),
+ * or none: the computed rule (streamLoadFits) decides from the files it loads.
*/
-export function streamFits(stream: StreamNeed | null | undefined, have: MemoryFacts): boolean {
- if (!stream || have.dynamicVramOff || !have.ramBytes || !have.vramBytes) return false;
- return minVramBytesFor(stream.vramGb) <= have.vramBytes && minVramBytesFor(stream.ramGb) <= have.ramBytes;
+export type StreamRule = StreamNeed | false | null | undefined;
+
+/** The model files a GPU would load for a workflow, in bytes, as the computed streaming rule reads them. */
+export interface StreamLoad {
+ /** The files of the choice it runs: the workflow's own, or a model variant's (src/lib/gpu/model-variants.ts). */
+ fileBytes: number;
+ /** The files the run adds beyond those (a look's LoRAs: src/lib/runtime-files.ts). */
+ extraBytes?: number;
+}
+
+/**
+ * The room the computed rule leaves in VRAM and RAM together, beyond the model files: the operating system, ComfyUI's own
+ * process, and the activations and buffers that live in RAM while the weights stream. Measured on a 10 GB card with
+ * 32 GB of RAM (the card reports about 10 GiB, the RAM about 31.9 GiB): workflows whose model files total 38.4 to
+ * 39.5 GiB ran with their weights streamed, RAM near full and the page file covering a few GB at the peak; one of
+ * 18.8 GiB used under 29 GB of RAM. 2 GiB keeps those runs in (39.5 + 2 is under 10 + 31.9) and leaves anything larger
+ * out.
+ */
+export const STREAM_RESERVE_BYTES = 2 * 2 ** 30;
+
+/**
+ * The smallest card the computed rule streams on, in whole GB (with the 3% allowance). The card still holds what the
+ * step computes: the block of weights in use, the activations and the decoder's working memory. The measured runs used a
+ * 10 GB card; 8 GB cards hold the same working set at the catalog's sizes with less to spare, and smaller cards run
+ * short of it.
+ */
+export const STREAM_MIN_VRAM_GB = 8;
+
+/**
+ * The computed streaming rule, for a workflow with no streaming need of its own: a card of STREAM_MIN_VRAM_GB or more,
+ * whose VRAM still covers the part of the workflow's VRAM need that isn't its model files (activations, working buffers,
+ * and any weights the catalog doesn't list, such as files a pack downloads itself), and whose VRAM and RAM together hold
+ * every model file it loads with STREAM_RESERVE_BYTES to spare. The caller has checked the facts are known.
+ */
+function streamLoadFits(needGb: number, load: StreamLoad | undefined, vramBytes: number, ramBytes: number): boolean {
+ if (!load || !(load.fileBytes > 0)) return false;
+ if (vramBytes < minVramBytesFor(STREAM_MIN_VRAM_GB)) return false;
+ if (minVramBytesFor(needGb) - load.fileBytes > vramBytes) return false;
+ return load.fileBytes + (load.extraBytes ?? 0) + STREAM_RESERVE_BYTES <= vramBytes + ramBytes;
+}
+
+/**
+ * Can a GPU run a workflow with its weights streamed from RAM? With a streaming need of its own (stream-needs.json), that
+ * need alone decides: its VRAM covers the need's VRAM and its RAM covers the need's RAM, each with the same 3% allowance
+ * as the VRAM test (a 32 GB PC reports about 31.9 GiB). With none, the computed rule (streamLoadFits) decides from
+ * `load`, the files it would load, and `needGb`, the workflow's VRAM need. Never for a workflow that doesn't stream
+ * (`false`), and never with unknown RAM, unknown VRAM, or dynamic VRAM off.
+ */
+export function streamFits(stream: StreamRule, have: MemoryFacts, load?: StreamLoad, needGb = 0): boolean {
+ if (stream === false || have.dynamicVramOff || !have.ramBytes || !have.vramBytes) return false;
+ if (stream) return minVramBytesFor(stream.vramGb) <= have.vramBytes && minVramBytesFor(stream.ramGb) <= have.ramBytes;
+ return streamLoadFits(needGb, load, have.vramBytes, have.ramBytes);
}
/**
* How a GPU holds a workflow of `needGb`: every weight on its card ("vram"), part of them streamed from its RAM
- * ("stream", slower: streamFits), or not at all (null).
+ * ("stream", slower: streamFits, with `load` for the computed rule), or not at all (null).
*/
-export function memoryFit(needGb: number, stream: StreamNeed | null | undefined, have: MemoryFacts): "vram" | "stream" | null {
+export function memoryFit(needGb: number, stream: StreamRule, have: MemoryFacts, load?: StreamLoad): "vram" | "stream" | null {
if (minVramBytesFor(needGb) <= (have.vramBytes ?? 0)) return "vram";
- return streamFits(stream, have) ? "stream" : null;
+ return streamFits(stream, have, load, needGb) ? "stream" : null;
+}
+
+/** The total size of these catalog files in bytes (a key the index doesn't have counts 0). */
+export function filesBytes(index: Pick<RequirementIndex, "files">, keys: readonly string[]): number {
+ return keys.reduce((n, k) => n + (index.files[k as keyof RequirementIndex["files"]]?.sizeBytes ?? 0), 0);
}
type Sha = (text: string) => string;
diff --git a/src/server/computer/pool.ts b/src/server/computer/pool.ts
index 84d91147..76732470 100644
--- a/src/server/computer/pool.ts
+++ b/src/server/computer/pool.ts
@@ -3,7 +3,7 @@ import { ENGINE_WORDS } from "@/lib/engine-error";
import crypto from "node:crypto";
import { FINISH_KINDS, type FinishTicket } from "@/lib/finish-ticket";
import { ceilingProblem, cleanCeiling, insideCeiling, lanesInside, type Ceiling } from "@/lib/job-ticket";
-import { allLanes, hasFiles, laneLabel, lanesFor, MEDIA_KINDS, memoryFit, needsOf, packKey, partLanes, streamFits, unloadedNodes, type FileNeed, type Inventory, type NodePack, type Needs } from "@/lib/lanes";
+import { allLanes, filesBytes, hasFiles, laneLabel, lanesFor, MEDIA_KINDS, memoryFit, needsOf, packKey, partLanes, streamFits, unloadedNodes, type FileNeed, type Inventory, type NodePack, type Needs, type StreamRule } from "@/lib/lanes";
import { fileChoices, hasVariants, pickFiles, swapGraphFiles, type FileChoice } from "@/lib/gpu/model-variants";
import type { FileKey } from "@/lib/gpu/types";
import { POOL_WORDS, RELAY_TIMES, SENT_STATES, type BeatAnswer, type ClaimedTask, type ComputerFacts, type CpuSlot, type WorkerAnswer, type WorkerBeat, type WorkerHolding } from "@/lib/relay";
@@ -16,7 +16,7 @@ import { indexKey, loadIndex } from "../gpu/index-file";
import { hostedRunsOn } from "../hosted-switch";
import { heldView } from "../pool-holds";
import { catalogVersion } from "./catalog-version";
-import { cleanFacts, dropProgress, endTask, json, logWorkerJob, noteCold, noteProgress, noteStage, setPoolClocks, setPoolGiveBack, setPoolLost, setTask, stageOf, takeTask, taskById, taskCold, taskProgress, jobNowOf, type JobNow, type TaskRow } from "./tasks";
+import { cleanFacts, dropProgress, endTask, json, logWorkerJob, noteCold, noteProgress, noteStage, setPoolClocks, setPoolGiveBack, setPoolLost, setPoolOutOfMemory, setTask, stageOf, takeTask, taskById, taskCold, taskProgress, jobNowOf, type JobNow, type TaskRow } from "./tasks";
import { queueSettings, runCeilingMs } from "../queue-settings";
import { createWorker, offerNextToken, revokeWorker, rotateWorker, type WorkerRow } from "./workers";
import { modelLabel } from "./queue-live";
@@ -885,15 +885,19 @@ function claimed(t: TaskRow, w: WorkerRow, device: string, now: number): Claimed
const bench = t.lane ? benchOf(w)[t.lane] : undefined;
// A workflow with model variants: the files this worker runs it with, chosen when it takes the task from the line and
// kept on the task (extra_json.variant), so a worker that lost track of its task gets the same files again.
- const { preempted, variant: lastVariant, ...extra } = json<Record<string, unknown>>(t.extra_json, {});
+ const { preempted, variant: lastVariant, streamed: lastStreamed, ...extra } = json<Record<string, unknown>>(t.extra_json, {});
const index = loadIndex();
const variantOf = !t.finish_json && needs?.workflowId && hasVariants(index, needs.workflowId) ? needs.workflowId : null;
const choice = !variantOf
? null
: t.state === "waiting"
- ? workerFiles(w, variantOf)
+ ? workerFiles(w, variantOf, bytesOf(needs?.runtime))
: (fileChoices(index, variantOf).find((c) => c.variant === (typeof lastVariant === "string" ? lastVariant : null)) ?? null);
const variant = choice?.variant ?? undefined;
+ // Taken with part of its weights streamed from this worker's RAM (not whole on its card): kept on the task
+ // (extra_json.streamed), so a run of it that runs out of memory goes to another worker (setPoolOutOfMemory). A worker
+ // that takes its own task again keeps what its claim said.
+ const streamed = t.state === "waiting" ? !t.finish_json && memoryWayOf(needs, w) === "stream" : lastStreamed === true;
if (t.state === "waiting") logWorkerJob("claimed", t, w.id, now, {}, { ...(variant && { variant }) });
// A worker that lost track of its own task gets it again with its first claim's time, so the sending clock (SENDING_MS)
// is never wound back by asking again.
@@ -903,8 +907,8 @@ function claimed(t: TaskRow, w: WorkerRow, device: string, now: number): Claimed
// A run given back for people (workerBeat) is no longer paused once a worker takes it again.
const ticketNote = !!t.ticket_json && t.state === "waiting";
const before =
- ticketNote || preempted !== undefined || variant !== lastVariant
- ? { extra_json: JSON.stringify({ ...extra, ...(ticketNote && { claimedBefore: t.claimed_at ?? null, claimFor: now }), ...(variant && { variant }) }) }
+ ticketNote || preempted !== undefined || variant !== lastVariant || streamed !== (lastStreamed === true)
+ ? { extra_json: JSON.stringify({ ...extra, ...(ticketNote && { claimedBefore: t.claimed_at ?? null, claimFor: now }), ...(variant && { variant }), ...(streamed && { streamed: true }) }) }
: {};
const c = takeTask(t, device, now, { worker_id: w.id, ...before, ...(t.state !== "waiting" && t.device === device && t.claimed_at && { claimed_at: t.claimed_at }) });
// A GPU job taken by a worker with another model loaded (or none) loads its model first: it is "getting ready" until
@@ -942,29 +946,70 @@ function claimed(t: TaskRow, w: WorkerRow, device: string, now: number): Claimed
/**
* The files this worker runs a workflow with (src/lib/gpu/model-variants.ts pickFiles): a model variant made for its
* card's generation (gpuGen in its facts), else the workflow's own files, else another variant, by the file sets it has
- * whole (its lanes' `sets`, from the files it verified) and its memory: the VRAM of the set, or the workflow's streaming
- * need in VRAM and RAM (memoryFit). Null when it has none of them, or too little memory. A worker program older than
+ * whole (its lanes' `sets`, from the files it verified) and its memory: the VRAM of the set, or streaming its weights
+ * from RAM (memoryFit: the workflow's streaming need, else the size of the set's files and `extraBytes`, the run-time
+ * files the run adds). Null when it has none of them, or too little memory. A worker program older than
* VARIANT_PROTOCOL gets the workflow's own files only.
*/
-export function workerFiles(w: Pick<WorkerRow, "lanes_json" | "facts_json" | "protocol">, workflowId: string): FileChoice | null {
+export function workerFiles(w: Pick<WorkerRow, "lanes_json" | "facts_json" | "protocol" | "no_stream_json">, workflowId: string, extraBytes = 0): FileChoice | null {
const cap = capableOf(w);
if (!cap.workflows.includes(workflowId)) return null;
const whole = cap.sets?.[workflowId] ?? [null];
const facts = json<ComputerFacts>(w.facts_json, {});
const index = loadIndex();
- const stream = index.workflows[workflowId]?.stream;
+ const stream = streamRuleOf(w, workflowId);
const choices = fileChoices(index, workflowId).filter((c) => whole.includes(c.variant));
- return pickFiles(choices, { gpuGen: facts.gpuGen ?? null, has: () => true, fits: (gb) => memoryFit(gb, stream, facts) !== null, variants: (w.protocol ?? 0) >= VARIANT_PROTOCOL });
+ return pickFiles(choices, {
+ gpuGen: facts.gpuGen ?? null,
+ has: () => true,
+ fits: (gb, files) => memoryFit(gb, stream, facts, { fileBytes: filesBytes(index, files), extraBytes }) !== null,
+ variants: (w.protocol ?? 0) >= VARIANT_PROTOCOL,
+ });
}
/**
- * Has this worker the memory for a task's workflow with no model variants: the VRAM the task needs (with the 3%
- * allowance already in it), or the workflow's streaming need in VRAM and RAM (streamFits).
+ * The workflows this worker no longer takes by streaming its weights from RAM, each with when that was noted: a job of
+ * one ran out of memory on it that way (noteNoStream). It still takes them with every weight on its card.
*/
-function memoryFor(needs: Needs | null, w: Pick<WorkerRow, "facts_json">): boolean {
+export function noStreamOf(w: Pick<WorkerRow, "no_stream_json">): Record<string, number> {
+ const raw = json<Record<string, unknown>>(w.no_stream_json ?? null, {});
+ return Object.fromEntries(Object.entries(raw).filter((e): e is [string, number] => typeof e[1] === "number"));
+}
+
+/** A workflow's streaming rule on this worker: the catalog's (requirements.json `stream`), or none after it ran out of memory streaming it. */
+function streamRuleOf(w: Pick<WorkerRow, "no_stream_json">, workflowId: string): StreamRule {
+ return noStreamOf(w)[workflowId] !== undefined ? false : loadIndex().workflows[workflowId]?.stream;
+}
+
+/** The total size of these files in bytes (a task's own files, or the run-time files it adds: a look's LoRAs). */
+const bytesOf = (files: readonly FileNeed[] | undefined): number => (files ?? []).reduce((n, f) => n + (f.size || 0), 0);
+
+/**
+ * How this worker holds a task's workflow with no model variants: the VRAM the task needs (with the 3% allowance
+ * already in it: "vram"), or streaming its weights from RAM ("stream": the workflow's streaming need, else the size of
+ * its files and the run-time files), or not at all (null).
+ */
+function memoryWay(needs: Needs | null, w: Pick<WorkerRow, "facts_json" | "no_stream_json">, extraBytes = bytesOf(needs?.runtime)): "vram" | "stream" | null {
const facts = json<ComputerFacts>(w.facts_json, {});
- if ((needs?.minVramBytes ?? 0) <= (facts.vramBytes ?? 0)) return true;
- return !!needs?.workflowId && streamFits(loadIndex().workflows[needs.workflowId]?.stream, facts);
+ if ((needs?.minVramBytes ?? 0) <= (facts.vramBytes ?? 0)) return "vram";
+ const wf = needs?.workflowId ? loadIndex().workflows[needs.workflowId] : undefined;
+ if (!needs?.workflowId || !wf) return null;
+ return streamFits(streamRuleOf(w, needs.workflowId), facts, { fileBytes: bytesOf(needs.files), extraBytes }, wf.vramGb) ? "stream" : null;
+}
+
+/** Has this worker the memory for a task's workflow with no model variants (memoryWay)? */
+const memoryFor = (needs: Needs | null, w: Pick<WorkerRow, "facts_json" | "no_stream_json">, extraBytes?: number): boolean => memoryWay(needs, w, extraBytes) !== null;
+
+/**
+ * How this worker would hold a task's workflow: whole on its card ("vram"), streamed from its RAM ("stream"), or not at
+ * all (null). With model variants, for the files it would run (workerFiles).
+ */
+function memoryWayOf(needs: Needs | null, w: WorkerRow): "vram" | "stream" | null {
+ const id = needs?.workflowId;
+ if (!id || !hasVariants(loadIndex(), id)) return memoryWay(needs, w);
+ const extraBytes = bytesOf(needs.runtime);
+ const c = workerFiles(w, id, extraBytes);
+ return c ? memoryFit(c.vramGb, streamRuleOf(w, id), json<ComputerFacts>(w.facts_json, {}), { fileBytes: filesBytes(loadIndex(), c.files), extraBytes }) : null;
}
/** How long a task should take on this worker: the lane's bench median there, or the task's own estimate. */
@@ -998,9 +1043,9 @@ function fits(t: TaskRow, w: WorkerRow, now: number): boolean {
// The files the run adds beyond its workflow's own (a look's LoRAs): only a worker that verified each one.
if (needs?.runtime?.length && !hasFiles(inventoryOf(w), needs.runtime)) return false;
// A workflow with model variants: the files (its own or a variant's) and the memory of the choice this worker would
- // run. Either way, the workflow's streaming need counts as well as its VRAM need.
+ // run. Either way, streaming from RAM counts as well as the VRAM need (memoryFit).
if (needs?.workflowId && hasVariants(loadIndex(), needs.workflowId)) {
- if (!workerFiles(w, needs.workflowId)) return false;
+ if (!workerFiles(w, needs.workflowId, bytesOf(needs.runtime))) return false;
} else if (!memoryFor(needs, w)) return false;
if (now - t.created_at < w.claim_after_ms + (allow[lane]?.delayMs ?? 0)) return false;
return true;
@@ -1388,6 +1433,51 @@ setPoolGiveBack((t, why) => {
*/
setPoolLost((t) => backInLine(t, { blame: true, sentBack: "its ComfyUI lost it twice" }));
+/**
+ * A worker's job ran out of memory. One it took by streaming its weights from RAM (extra_json.streamed, from its claim):
+ * the worker no longer takes that workflow by streaming (noteNoStream), and while another worker could run it, the job
+ * goes back in line with its place kept, at no cost to the run (no attempt counted: this worker can't take it that way
+ * again, so it can't come back to it). With no other worker for it, or taken with every weight on the card, it fails as
+ * any failed job does.
+ */
+setPoolOutOfMemory((t, now) => {
+ if (!t.worker_id || json<{ streamed?: unknown }>(t.extra_json, {}).streamed !== true) return false;
+ const needs = json<Needs | null>(t.needs_json, null);
+ if (!needs?.workflowId) return false;
+ noteNoStream(t.worker_id, needs.workflowId, now, t);
+ if (!workersCanRun(needs.workflowId, { size: needs.size, files: needs.runtime, tickets: !!needs.catalogVersion })) return false;
+ if (!backInLine(t, { blame: false, sentBack: "it ran out of memory with its weights streamed from RAM (another worker takes it)" })) return false;
+ setTask(t.id, { comfy_why: null });
+ return true;
+});
+
+/** The most workflows a worker's no-streaming list keeps (the oldest go first). */
+const NO_STREAM_MAX = 200;
+
+/**
+ * This worker no longer takes this workflow by streaming its weights from RAM: noted with the time on the worker
+ * (no_stream_json) and in its timeline. It still takes it with every weight on its card. The owner clears it in
+ * Settings → Workers (WorkerPatch.clearNoStream). Best-effort.
+ */
+export function noteNoStream(workerId: string, workflowId: string, now = Date.now(), t?: Pick<TaskRow, "id" | "generation_id" | "lane">): void {
+ try {
+ const d = db();
+ d.transaction(() => {
+ const w = d.prepare("SELECT no_stream_json FROM relay_workers WHERE id = ?").get(workerId) as Pick<WorkerRow, "no_stream_json"> | undefined;
+ if (!w) return;
+ const list = { ...noStreamOf(w), [workflowId]: now };
+ const kept = Object.entries(list).sort((a, b) => b[1] - a[1]).slice(0, NO_STREAM_MAX);
+ d.prepare("UPDATE relay_workers SET no_stream_json = ? WHERE id = ?").run(JSON.stringify(Object.fromEntries(kept)), workerId);
+ })();
+ logWorkerEvent(
+ { kind: "job", event: "no-stream", workerId, words: `Ran out of memory streaming ${workflowId} from RAM: it takes it only with every weight on its card`, taskId: t?.id ?? null, generationId: t?.generation_id ?? null, lane: t?.lane ?? null, detail: { workflowId } },
+ now,
+ );
+ } catch (e) {
+ console.warn(`[fuobe] Couldn't note a worker's streaming list: ${(e as Error).message}`);
+ }
+}
+
/** Why a worker gave a job back, in the timeline's words. */
const GIVE_BACK_WORDS: Record<string, string> = {
stalled: "it stalled",
@@ -1656,8 +1746,8 @@ function ableWorkers(workflowId: string | null, o: { size?: Needs["size"]; ticke
if (workflowId === null) return cap.workflows.some((id) => poolLane(id) in allow && insideCeiling(ceiling, { workflowId: id, lane: poolLane(id) }));
if (!needs || !(lane! in allow) || !cap.workflows.includes(workflowId) || ceilingProblem(ceiling, { workflowId, lane, size: o.size })) return false;
if (o.files?.length && !hasFiles(inventoryOf(w), o.files)) return false;
- if (hasVariants(loadIndex(), workflowId)) return !!workerFiles(w, workflowId);
- return memoryFor(needs, w);
+ if (hasVariants(loadIndex(), workflowId)) return !!workerFiles(w, workflowId, bytesOf(o.files));
+ return memoryFor(needs, w, bytesOf(o.files));
});
}
@@ -1917,6 +2007,11 @@ export interface WorkerView {
switchAfterMs: number;
/** Its pick order: higher gets first pick of a job that a worker with a lower one could take too, while it is free. 0: none. */
pickOrder: number;
+ /**
+ * The workflows it no longer takes by streaming its weights from RAM (a job of one ran out of memory that way), newest
+ * first, each with when. It still takes them with every weight on its card. The owner clears them (clearNoStream).
+ */
+ noStream: { workflowId: string; at: number }[];
warmLane: string | null;
/** The lanes it can run every workflow of. */
lanes: string[];
@@ -2163,6 +2258,7 @@ export function workerView(w: WorkerRow, now = Date.now(), typical: (lane: strin
claimAfterMs: w.claim_after_ms,
switchAfterMs: w.switch_after_ms,
pickOrder: w.pick_order ?? 0,
+ noStream: Object.entries(noStreamOf(w)).map(([workflowId, at]) => ({ workflowId, at })).sort((a, b) => b.at - a.at),
warmLane: w.warm_lane,
lanes: capableOf(w).lanes,
partLanes: partLanes(loadIndex(), capableOf(w).workflows, sha),
@@ -2222,6 +2318,8 @@ export interface WorkerPatch {
switchAfterMs?: number;
/** A whole number from PICK_ORDER_MIN to PICK_ORDER_MAX: higher picks first (firstPicks). 0: none. */
pickOrder?: number;
+ /** Clear its no-streaming list (WorkerView.noStream): `true` for all of it, or a list of workflow ids. */
+ clearNoStream?: true | string[];
rotate?: boolean;
revoke?: boolean;
}
@@ -2289,6 +2387,12 @@ export function patchWorker(id: string, p: WorkerPatch, now = Date.now(), by = "
if (!Number.isInteger(p.pickOrder) || p.pickOrder < PICK_ORDER_MIN || p.pickOrder > PICK_ORDER_MAX) throw new Error(`The pick order is a whole number from ${PICK_ORDER_MIN} to ${PICK_ORDER_MAX}`);
set.pick_order = p.pickOrder;
}
+ if (p.clearNoStream !== undefined) {
+ const ids = p.clearNoStream;
+ if (ids !== true && !(Array.isArray(ids) && ids.every((x) => typeof x === "string"))) throw new Error("Say which workflows to clear, or all of them");
+ const left = ids === true ? {} : Object.fromEntries(Object.entries(noStreamOf(w)).filter(([k]) => !ids.includes(k)));
+ set.no_stream_json = Object.keys(left).length ? JSON.stringify(left) : null;
+ }
const keys = Object.keys(set);
if (keys.length) d.prepare(`UPDATE relay_workers SET ${keys.map((k) => `${k} = @${k}`).join(", ")} WHERE id = @id`).run({ ...set, id });
const token = p.rotate ? rotateWorker(id) ?? undefined : undefined;
@@ -2302,6 +2406,10 @@ export function patchWorker(id: string, p: WorkerPatch, now = Date.now(), by = "
else if (p.drain === false) actions.push(["undrain", "No longer pausing after its job"]);
const edited = (["autoResume", "hours", "allow", "claimAfterMs", "switchAfterMs", "pickOrder"] as const).filter((k) => p[k] !== undefined);
if (edited.length) actions.push(["edit", `Settings changed: ${edited.join(", ")}`, { keys: edited }]);
+ if (p.clearNoStream !== undefined) {
+ const cleared = p.clearNoStream === true ? Object.keys(noStreamOf(w)) : p.clearNoStream.filter((k) => noStreamOf(w)[k] !== undefined);
+ actions.push(["clear-no-stream", cleared.length ? `May stream from RAM again: ${cleared.join(", ")}` : "Its list of workflows not to stream was already clear", { workflows: cleared }]);
+ }
if (token) actions.push(["rotate", "New token made"]);
noteAdmin(id, actions, by, now);
try {
diff --git a/src/server/computer/tasks.ts b/src/server/computer/tasks.ts
index 8ed6efb9..3c8f0ca7 100644
--- a/src/server/computer/tasks.ts
+++ b/src/server/computer/tasks.ts
@@ -1099,6 +1099,9 @@ function reportOnce(t: TaskRow, e: ReportEvent, plan: (entries: HistoryEntryLike
}
const entries = e.event === "finished" ? [e.entry] : e.entries;
if (!Array.isArray(entries) || entries.some((x) => !x || typeof x !== "object")) throw new RelayError(400, "Bad history entry");
+ // A worker's job that ran out of memory: one it took by streaming its weights from RAM goes to another worker when
+ // one can run it, instead of failing (pool.ts sets this).
+ if (t.pools && t.worker_id && poolOutOfMemory && ranOutOfMemory(entries, e.why) && poolOutOfMemory(t, now)) return { ok: true };
const p = plan(entries, e.event === "passes");
// A worker's job ended on its ComfyUI: the workers' log keeps its measured run (the billing service settles with it,
// and a lane's typical run is read from it). CPU work (light CPU work, a finishing job) uses no GPU: its time and
@@ -1371,6 +1374,31 @@ export const setPoolGiveBack = (fn: (t: TaskRow, why: GiveBackWhy) => void) => (
let poolLost: ((t: TaskRow) => void) | null = null;
export const setPoolLost = (fn: (t: TaskRow) => void) => (poolLost = fn);
+/**
+ * A worker's job ran out of memory (pool.ts sets this too): true when it went back in line for another worker, false
+ * when it fails as any failed job does.
+ */
+let poolOutOfMemory: ((t: TaskRow, now: number) => boolean) | null = null;
+export const setPoolOutOfMemory = (fn: (t: TaskRow, now: number) => boolean) => (poolOutOfMemory = fn);
+
+/**
+ * The words for running out of memory: on the card (CUDA out of memory, torch's OutOfMemoryError, "Allocation on
+ * device"), in system RAM (Python's MemoryError, "not enough memory") or in Windows' page file ("The paging file is too
+ * small for this operation to complete").
+ */
+const OUT_OF_MEMORY = /out of memory|OutOfMemoryError|allocation on device|not enough memory|paging file is too small|MemoryError/i;
+
+/**
+ * Did a finished job end by running out of memory: one of its entries failed with an execution error in those words, or
+ * the worker's reason for its failure (`why`) says so.
+ */
+export function ranOutOfMemory(entries: readonly HistoryEntryLike[], why?: string): boolean {
+ const failed = entries.filter((x) => x?.status?.status_str === "error");
+ if (!failed.length) return false;
+ if (typeof why === "string" && OUT_OF_MEMORY.test(why)) return true;
+ return failed.some((x) => (x.status?.messages ?? []).some((m) => Array.isArray(m) && m[0] === "execution_error" && OUT_OF_MEMORY.test(`${m[1]?.exception_type ?? ""} ${m[1]?.exception_message ?? ""}`)));
+}
+
/** The execution time (ms) and GPU name a worker reported with a finished job, as the workers' log keeps them. */
export interface ExecFacts {
ms: number;
diff --git a/src/server/computer/workers.ts b/src/server/computer/workers.ts
index 7984484e..b3fb107f 100644
--- a/src/server/computer/workers.ts
+++ b/src/server/computer/workers.ts
@@ -61,6 +61,8 @@ export interface WorkerRow {
switch_after_ms: number;
/** Its pick order: a free worker with a higher one gets first pick of a job both can run (pool.ts firstPickOf). 0: none. */
pick_order?: number;
+ /** The workflows it no longer takes by streaming from RAM, as JSON: workflow id → when (pool.ts noStreamOf). */
+ no_stream_json?: string | null;
state: string;
seen_at: number | null;
/** A pool worker's next token (its SHA-256), offered in a beat answer and not used yet; its expiry; when it was made. */
diff --git a/src/server/db.ts b/src/server/db.ts
index e80355ef..83b92bf4 100644
--- a/src/server/db.ts
+++ b/src/server/db.ts
@@ -1151,6 +1151,9 @@ const RELAY_COLUMNS: [string, string, string][] = [
["relay_workers", "stats_json", "TEXT"],
// A worker's pick order (pool.ts firstPickOf): higher picks first among workers that are free and can run a job.
["relay_workers", "pick_order", "INTEGER NOT NULL DEFAULT 0"],
+ // The workflows a worker no longer takes by streaming its weights from RAM (a job of one ran out of memory that way):
+ // workflow id → when, as JSON (pool.ts noStreamOf). The owner clears it in Settings → Workers.
+ ["relay_workers", "no_stream_json", "TEXT"],
];
declare global {
diff --git a/tests/stream-needs.test.ts b/tests/stream-needs.test.ts
index 1e82a7cd..e5a3c37d 100644
--- a/tests/stream-needs.test.ts
+++ b/tests/stream-needs.test.ts
@@ -7,7 +7,7 @@ import { emptyInventory } from "@/lib/gpu/gather";
import { stateLine, toolReadiness, vramFit, workflowReadiness } from "@/lib/gpu/readiness";
import { parseIndex } from "@/lib/gpu/requirements";
import type { GpuInventory, RequirementIndex } from "@/lib/gpu/types";
-import { memoryFit, minVramBytesFor, streamFits } from "@/lib/lanes";
+import { filesBytes, memoryFit, minVramBytesFor, STREAM_MIN_VRAM_GB, STREAM_RESERVE_BYTES, streamFits } from "@/lib/lanes";
import { statsFacts } from "@/lib/local-comfy";
import { tempDir } from "./helpers/temp-dir";
@@ -15,7 +15,9 @@ import { tempDir } from "./helpers/temp-dir";
* Streaming needs (workflows/comfyui/stream-needs.json): a workflow a card can't hold whole still runs on it with part of
* its weights kept in system RAM and streamed to the card each step (ComfyUI's dynamic VRAM loading). The build checks
* the file; a worker qualifies on memory with the workflow's VRAM, or with the streaming need's VRAM and RAM (3%
- * allowance on both, never with unknown RAM or dynamic VRAM off); a person's own GPU reads the same rule.
+ * allowance on both, never with unknown RAM or dynamic VRAM off); a person's own GPU reads the same rule. A workflow with
+ * no streaming need of its own streams by the computed rule (the size of the files it loads against VRAM and RAM, less
+ * a reserve), unless it never streams (stream-needs.json noStream, isolated workflows).
*/
vi.setConfig({ testTimeout: 60_000 });
@@ -32,6 +34,10 @@ const idx: RequirementIndex = parseIndex(JSON.parse(fs.readFileSync(path.join(LI
const GB = 2 ** 30;
const H3 = "minimax-h3-image-t2i";
+/** No streaming need of its own: 39.5 GiB of model files, VRAM need 32 GB. */
+const FLEX = "minimax-h3-flex-i2v";
+/** Never streams: its node pack (ComfyUI-WanVideoWrapper) loads its models itself. */
+const WRAPPED = "lipsync-v2v-infinitetalk";
const KREA = "krea2-turbo-t2i";
const STREAMED = [
"minimax-h3-image-t2i",
@@ -50,7 +56,7 @@ const STREAMED = [
];
/** The committed inputs with stream-needs.json replaced. */
-const build = (streams: object[]) => buildIndex({ ...loadInputs(LIBRARY), streams: { streams } });
+const build = (streams: object[], noStream?: unknown) => buildIndex({ ...loadInputs(LIBRARY), streams: { streams, ...(noStream !== undefined && { noStream }) } as { streams: object[] } });
const entry = (o: Record<string, unknown> = {}) => ({ workflows: [H3], vramGb: 10, ramGb: 32, ...o });
describe("the catalog's streaming needs (build-requirements.mjs)", () => {
@@ -73,6 +79,30 @@ describe("the catalog's streaming needs (build-requirements.mjs)", () => {
// A good one builds.
expect(build([entry({ vramGb: 12, ramGb: 48 })]).workflows[H3].stream).toEqual({ vramGb: 12, ramGb: 48 });
});
+
+ it("marks the workflows that never stream: noStream's packs and workflows, and isolated workflows", () => {
+ for (const id of ["infinitetalk-wanwrapper", WRAPPED, "sfx-hunyuan-foley", "sfx-mmaudio-t2a", "video-upscale-kandinsky6-vsr"]) expect(idx.workflows[id].stream, id).toBe(false);
+ const isolated = Object.keys(idx.workflows).filter((x) => idx.workflows[x].isolated);
+ expect(isolated.length).toBeGreaterThan(0);
+ for (const id of isolated) expect(idx.workflows[id].stream, id).toBe(false);
+ // The others have their streaming need, or no field (the computed rule).
+ expect("stream" in idx.workflows[FLEX]).toBe(false);
+ expect(build([], { packs: [], workflows: [FLEX] }).workflows[FLEX].stream).toBe(false);
+ expect("stream" in build([], { packs: [], workflows: [] }).workflows[WRAPPED]).toBe(false);
+ });
+
+ it("refuses names the catalog doesn't have, unknown fields, and a workflow that has a streaming need and never streams", () => {
+ expect(() => build([], { packs: ["No-Such-Pack"] })).toThrow("No-Such-Pack isn't a node pack of packs.json");
+ expect(() => build([], { workflows: ["no-such-workflow"] })).toThrow("no-such-workflow isn't a workflow of the manifest");
+ expect(() => build([], { packs: "ComfyUI-WanVideoWrapper" })).toThrow(/packs must be a list of node pack names/);
+ expect(() => build([], { workflows: [1] })).toThrow(/workflows must be a list of workflow ids/);
+ expect(() => build([], { note: "x" })).toThrow(/noStream: unknown field note/);
+ expect(() => build([], [])).toThrow(/"noStream" must be an object/);
+ expect(() => buildIndex({ ...loadInputs(LIBRARY), streams: { streams: [], other: 1 } as { streams: object[] } })).toThrow(/stream-needs.json: unknown field other/);
+ expect(() => build([entry({ workflows: [WRAPPED] })], { packs: ["ComfyUI-WanVideoWrapper"] })).toThrow(`${WRAPPED} has a streaming need, but it never streams (it uses ComfyUI-WanVideoWrapper)`);
+ expect(() => build([entry({ workflows: [FLEX] })], { workflows: [FLEX] })).toThrow(`${FLEX} has a streaming need, but it never streams (noStream names it)`);
+ expect(() => build([entry({ workflows: ["lipsync-latentsync16"] })])).toThrow("lipsync-latentsync16 has a streaming need, but it never streams (it runs isolated)");
+ });
});
describe("the memory rule (memoryFit, streamFits)", () => {
@@ -102,6 +132,12 @@ describe("the memory rule (memoryFit, streamFits)", () => {
expect(streamFits(stream, { vramBytes: 12 * GB, ramBytes: minVramBytesFor(32) - 1 })).toBe(false);
});
+ it("a streaming need of its own decides, whatever the computed rule would say", () => {
+ const have = { vramBytes: 8 * GB, ramBytes: 64 * GB };
+ expect(memoryFit(32, undefined, have, { fileBytes: 30 * GB })).toBe("stream");
+ expect(memoryFit(32, stream, have, { fileBytes: 30 * GB })).toBeNull();
+ });
+
it("a ComfyUI's facts say when its dynamic VRAM is off", () => {
const stats = (argv: string[]) => statsFacts({ system: { argv, ram_total: 32 * GB }, devices: [] }, "https://studio.test");
expect(stats(["main.py"]).dynamicVramOff).toBeUndefined();
@@ -110,6 +146,54 @@ describe("the memory rule (memoryFit, streamFits)", () => {
});
});
+describe("the computed rule (a workflow with no streaming need of its own)", () => {
+ /** A 10 GB card and a PC with 32 GB of RAM, as they report themselves. */
+ const small = { vramBytes: 9.99 * GB, ramBytes: 31.9 * GB };
+ const fit = (needGb: number, fileGb: number, have: Parameters<typeof memoryFit>[2], extraGb = 0) => memoryFit(needGb, undefined, have, { fileBytes: fileGb * GB, extraBytes: extraGb * GB });
+
+ it("keeps a 2 GiB reserve and an 8 GB smallest card", () => {
+ expect(STREAM_RESERVE_BYTES).toBe(2 * GB);
+ expect(STREAM_MIN_VRAM_GB).toBe(8);
+ });
+
+ it("the files fit in VRAM and RAM with the reserve to spare: the measured workflows run on a 10 GB card with 32 GB of RAM", () => {
+ expect(fit(32, 39.5, small)).toBe("stream");
+ expect(fit(32, 39.5, { ...small, ramBytes: 31.8 * GB })).toBe("stream");
+ for (const id of ["minimax-h3-fast-t2v", "minimax-h3-i2v", "minimax-h3-flex-ref2va", "qwen-image-21-relight", FLEX]) {
+ const wf = idx.workflows[id];
+ expect(streamFits(undefined, small, { fileBytes: filesBytes(idx, wf.files) }, wf.vramGb), id).toBe(true);
+ }
+ // More than the room: no.
+ expect(fit(32, 40, small)).toBeNull();
+ expect(fit(32, 39.5, { ...small, ramBytes: 16 * GB })).toBeNull();
+ // The run-time files (a look's LoRAs) count too.
+ expect(fit(32, 39.5, small, 1)).toBeNull();
+ });
+
+ it("never on a card under 8 GB (3% allowed), with no files, or for a workflow that never streams", () => {
+ expect(fit(24, 20, { vramBytes: minVramBytesFor(8), ramBytes: 64 * GB })).toBe("stream");
+ expect(fit(24, 20, { vramBytes: minVramBytesFor(8) - 1, ramBytes: 64 * GB })).toBeNull();
+ expect(fit(24, 20, { vramBytes: 6 * GB, ramBytes: 128 * GB })).toBeNull();
+ expect(fit(24, 0, { vramBytes: 10 * GB, ramBytes: 64 * GB })).toBeNull();
+ expect(memoryFit(32, false, small, { fileBytes: 20 * GB })).toBeNull();
+ });
+
+ it("the part of the VRAM need that isn't model files stays on the card", () => {
+ // 24 GB for 4 GiB of files: about 19 GiB of activations and other weights, more than a 10 GB card holds.
+ expect(fit(24, 4, { vramBytes: 10 * GB, ramBytes: 64 * GB })).toBeNull();
+ expect(fit(24, 4, { vramBytes: 20 * GB, ramBytes: 64 * GB })).toBe("stream");
+ // 16 GB for 3.7 GiB: about 11.8 GiB stays on the card.
+ expect(fit(16, 3.7, { vramBytes: 11.5 * GB, ramBytes: 64 * GB })).toBeNull();
+ expect(fit(16, 3.7, { vramBytes: 12 * GB, ramBytes: 64 * GB })).toBe("stream");
+ });
+
+ it("never with unknown RAM, unknown VRAM, or dynamic VRAM off", () => {
+ expect(fit(32, 20, { vramBytes: 10 * GB })).toBeNull();
+ expect(streamFits(undefined, { ramBytes: 64 * GB }, { fileBytes: 20 * GB }, 32)).toBe(false);
+ expect(fit(32, 20, { ...small, dynamicVramOff: true })).toBeNull();
+ });
+});
+
/** A person's ComfyUI with every file and node of the index, this card's VRAM and this RAM (none: not read). */
function comfy(vramGb: number, ramGb?: number, argv: string[] = ["main.py"]): GpuInventory {
const inv = emptyInventory("server", 1);
@@ -152,8 +236,18 @@ describe("a person's own GPU (readiness)", () => {
expect(stateLine(toolReadiness(`workflow:${H3}`, "H3 Image", [H3], [], comfy(24, 16), idx, { account: true }))).toBe("Ready · slow on your GPU");
});
+ it("a workflow with no streaming need of its own: the size of its files decides; one that never streams needs the bigger card", () => {
+ const r = workflowReadiness(FLEX, comfy(10, 31.9), idx, { account: true });
+ expect(r.state).toBe("ready");
+ expect(r.vram).toMatchObject({ needGb: 32, fit: "tight", stream: true });
+ expect(stateLine(toolReadiness(`workflow:${FLEX}`, "H3 Flex", [FLEX], [], comfy(10, 32), idx, { account: true }))).toBe("Ready · uses system RAM, slower");
+ expect(workflowReadiness(FLEX, comfy(10, 16), idx, { account: true }).state).toBe("gpu");
+ expect(workflowReadiness(WRAPPED, comfy(10, 128), idx, { account: true }).vram).toEqual({ needGb: 24, haveGb: 10, fit: "no" });
+ });
+
it("a tool whose other part can't stream needs the bigger card", () => {
- const noStream = Object.keys(idx.workflows).find((id) => !idx.workflows[id].stream && idx.workflows[id].vramGb >= 24 && !idx.workflows[id].isolated && !idx.workflows[id].gpu)!;
+ const noStream = WRAPPED;
+ expect(idx.workflows[noStream].stream).toBe(false);
const t = toolReadiness(`workflow:${H3}`, "Two", [H3, noStream], [], comfy(10, 64), idx, { account: true });
expect(t.state).toBe("gpu");
expect(t.vram.stream).toBeUndefined();
@@ -235,6 +329,16 @@ describe("which workers qualify on memory (the claim)", () => {
expect(pool.workersCanRun(H3)).toBe(false);
});
+ it("no streaming need of its own: a 10 GB card with 32 GB of RAM takes a workflow of 39.5 GiB of files, and the claim notes it streams", () => {
+ const id = job(FLEX);
+ expect(claim(worker("flex-low-ram", FLEX, { vramBytes: 10 * GB, ramBytes: 16 * GB }))).toBeNull();
+ expect(claim(worker("flex", FLEX, { vramBytes: 10 * GB, ramBytes: 31.9 * GB }))?.id).toBe(id);
+ expect(JSON.parse(tasks.taskById(id)!.extra_json ?? "{}").streamed).toBe(true);
+ const whole = job(FLEX);
+ expect(claim(worker("flex-big", FLEX, { vramBytes: 32 * GB, ramBytes: 16 * GB }))?.id).toBe(whole);
+ expect(JSON.parse(tasks.taskById(whole)!.extra_json ?? "{}").streamed).toBeUndefined();
+ });
+
it("a workflow with model variants: the streaming need counts for the files the worker runs", () => {
const id = job(KREA);
const c = claim(worker("ampere", KREA, { vramBytes: 10 * GB, ramBytes: 32 * GB, gpuGen: "8.6" }))!;
diff --git a/tests/stream-oom-fallback.test.ts b/tests/stream-oom-fallback.test.ts
new file mode 100644
index 00000000..cc9073d8
--- /dev/null
+++ b/tests/stream-oom-fallback.test.ts
@@ -0,0 +1,194 @@
+import fs from "node:fs";
+import path from "node:path";
+import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
+import type { HistoryEntryLike } from "@/lib/relay";
+import { tempDir } from "./helpers/temp-dir";
+
+/**
+ * A job a worker took by streaming its weights from RAM that runs out of memory (CUDA out of memory, "Allocation on
+ * device", Windows' page file, Python's MemoryError) goes back in line for another worker instead of failing, and that
+ * worker no longer takes the workflow by streaming (relay_workers.no_stream_json, listed in Settings → Workers, where the
+ * owner clears it). A job taken with every weight on the card, any other error, or no other worker that can run it: it
+ * fails as before.
+ */
+
+vi.setConfig({ testTimeout: 60_000 });
+vi.mock("next/server", async (importOriginal) => ({ ...(await importOriginal<typeof import("next/server")>()), connection: async () => {} }));
+
+const dir = tempDir("fuobe-stream-oom-");
+process.env.FUOBE_DATA_DIR = dir;
+process.env.COMFYUI_URL = "http://owner-comfy.test:8188";
+delete process.env.FUOBE_PASSWORD;
+
+const LIBRARY = path.resolve(__dirname, "..", "workflows/comfyui");
+const GB = 2 ** 30;
+/** No streaming need of its own: 39.5 GiB of model files, VRAM need 32 GB. */
+const FLEX = "minimax-h3-flex-i2v";
+
+const { db } = await import("@/server/db");
+const { resetRates } = await import("@/server/rate");
+const { setSetting } = await import("@/server/settings");
+const tasks = await import("@/server/computer/tasks");
+const pool = await import("@/server/computer/pool");
+const workers = await import("@/server/computer/workers");
+const { loadIndex } = await import("@/server/gpu/index-file");
+
+let clock = Date.UTC(2026, 10, 3, 3, 0, 0);
+const VERSION = "d".repeat(64);
+type W = { id: string; token: string };
+const row = (w: W) => workers.getWorker(w.id)!;
+const filesOf = (id: string) =>
+ loadIndex().workflows[id].files.map((k) => {
+ const f = loadIndex().files[k];
+ return { folder: f.folder, name: f.file, size: f.sizeBytes, sha256: "a".repeat(64) };
+ });
+const beat = (w: W) =>
+ pool.workerBeat(
+ row(w),
+ pool.cleanBeat({ device: `wkr-${w.id}`, protocol: 5, version: "1.0.0", local: { paused: false, why: null, until: null }, gpu: {}, inventoryHash: null, running: [], stopped: [], catalogVersion: VERSION }),
+ clock,
+ );
+function worker(name: string, facts: Record<string, unknown>): W {
+ const w = pool.addWorker(name);
+ pool.patchWorker(w.id, { paused: false, hours: { always: true }, allow: { [pool.poolLane(FLEX)]: { delayMs: 0 } }, claimAfterMs: 0 });
+ beat(w);
+ pool.saveInventory(row(w), { files: filesOf(FLEX), nodePacks: [], media: ["image"] });
+ db().prepare("UPDATE relay_workers SET facts_json = ?, catalog_version = ? WHERE id = ?").run(JSON.stringify(facts), VERSION, w.id);
+ beat(w);
+ return w;
+}
+const STREAMS = { vramBytes: 10 * GB, ramBytes: 31.9 * GB };
+const WHOLE = { vramBytes: 32 * GB, ramBytes: 64 * GB };
+
+let gens = 0;
+function job(): { task: string; gen: string } {
+ const gen = `gen-o-${++gens}`;
+ db()
+ .prepare("INSERT INTO generations (id, feature, model_id, engine, provider, op, kind, status, request_json, outputs_json, created_at, updated_at) VALUES (?, 'video', 'm', 'open', 'comfyui', 'i2v', 'video', 'queued', '{}', '[]', ?, ?)")
+ .run(gen, clock, clock);
+ const graph = JSON.parse(fs.readFileSync(path.join(LIBRARY, `${FLEX}.json`), "utf8"));
+ const task = tasks.createTask({ principal: "owner", generationId: gen, graph, workflowId: FLEX, pool: pool.poolFields(FLEX, {}, clock) }).id;
+ db().prepare("UPDATE relay_tasks SET created_at = ? WHERE id = ?").run(clock, task);
+ return { task, gen };
+}
+const claim = (w: W) => pool.workerClaim(row(w), [], clock);
+const state = (id: string) => tasks.taskById(id)!;
+
+/** A ComfyUI history entry that failed with this execution error. */
+const failed = (exception_type: string, exception_message: string): HistoryEntryLike => ({
+ status: { status_str: "error", completed: false, messages: [["execution_start", {}], ["execution_error", { node_id: "12", node_type: "KSampler", exception_type, exception_message }]] },
+ outputs: {},
+});
+const CUDA_OOM = failed("torch.OutOfMemoryError", "CUDA out of memory. Tried to allocate 2.00 GiB.");
+const PLAN_ERROR = "Your GPU ran out of memory. Try a smaller size or a shorter clip.";
+
+/** The worker took the task: it sends the prompt to its ComfyUI, then reports the entry it finished with. */
+function runs(id: string, entry: HistoryEntryLike, why?: string) {
+ const promptId = crypto.randomUUID();
+ tasks.report(state(id), { event: "sent", promptId }, () => ({ error: "x" }), clock);
+ tasks.report(state(id), { event: "running", value: 1, max: 8 }, () => ({ error: "x" }), clock);
+ return tasks.report(state(id), { event: "finished", entry, ...(why && { why }) }, () => ({ error: PLAN_ERROR }), clock);
+}
+
+beforeAll(() => setSetting("comfyWhere", "workers"));
+beforeEach(() => {
+ resetRates();
+ clock += 60 * 60_000;
+ db().prepare("DELETE FROM relay_workers").run();
+ db().prepare("UPDATE relay_tasks SET state = 'canceled' WHERE state IN ('waiting','sending','queued','running','collecting')").run();
+});
+
+describe("the words for running out of memory (ranOutOfMemory)", () => {
+ it("reads the failed entry's execution error, and the worker's reason", () => {
+ expect(tasks.ranOutOfMemory([CUDA_OOM])).toBe(true);
+ expect(tasks.ranOutOfMemory([failed("RuntimeError", "Allocation on device 0 would exceed allowed memory.")])).toBe(true);
+ expect(tasks.ranOutOfMemory([failed("OSError", "The paging file is too small for this operation to complete. (os error 1455)")])).toBe(true);
+ expect(tasks.ranOutOfMemory([failed("MemoryError", "")])).toBe(true);
+ expect(tasks.ranOutOfMemory([failed("RuntimeError", "Not enough memory resources are available to process this command.")])).toBe(true);
+ expect(tasks.ranOutOfMemory([failed("ValueError", "bad input")])).toBe(false);
+ // The reason the worker gave, for an entry whose messages it didn't keep.
+ expect(tasks.ranOutOfMemory([{ status: { status_str: "error" } }], "CUDA out of memory in KSampler (node 12)")).toBe(true);
+ // A job that didn't fail never ran out of memory, whatever a reason says.
+ expect(tasks.ranOutOfMemory([{ status: { status_str: "success" } }], "CUDA out of memory")).toBe(false);
+ });
+});
+
+describe("a job taken by streaming that runs out of memory", () => {
+ it("goes back in line at no cost, the worker no longer streams that workflow, and another worker runs it", () => {
+ const { task, gen } = job();
+ const small = worker("small", STREAMS);
+ const big = worker("big", WHOLE);
+ expect(claim(small)?.id).toBe(task);
+ expect(JSON.parse(state(task).extra_json ?? "{}").streamed).toBe(true);
+ expect(runs(task, CUDA_OOM).ok).toBe(true);
+ // Back in line, with its place and its tries as they were; the run itself still waits.
+ expect(state(task)).toMatchObject({ state: "waiting", worker_id: null, requeues: 0, comfy_why: null });
+ expect(state(task).error ?? null).toBeNull();
+ expect((db().prepare("SELECT status FROM generations WHERE id = ?").get(gen) as { status: string }).status).not.toBe("failed");
+ // The worker's list, with the time; it takes the workflow no more by streaming.
+ expect(pool.noStreamOf(row(small))).toEqual({ [FLEX]: clock });
+ expect(pool.workerView(row(small), clock).noStream).toEqual([{ workflowId: FLEX, at: clock }]);
+ expect(claim(small)).toBeNull();
+ // Another worker, with every weight on its card, takes it.
+ expect(claim(big)?.id).toBe(task);
+ expect(JSON.parse(state(task).extra_json ?? "{}").streamed).toBeUndefined();
+ // Its timeline says so (for the owner).
+ const ev = db().prepare("SELECT kind, event, words FROM worker_events WHERE worker_id = ? AND event = 'no-stream'").get(small.id) as { kind: string; words: string } | undefined;
+ expect(ev?.kind).toBe("job");
+ expect(ev?.words).toContain(FLEX);
+ });
+
+ it("the page file running out counts the same", () => {
+ const { task } = job();
+ const small = worker("small-pf", STREAMS);
+ worker("big-pf", WHOLE);
+ expect(claim(small)?.id).toBe(task);
+ runs(task, failed("OSError", "The paging file is too small for this operation to complete. (os error 1455)"));
+ expect(state(task).state).toBe("waiting");
+ expect(Object.keys(pool.noStreamOf(row(small)))).toEqual([FLEX]);
+ });
+
+ it("with no other worker that can run it: the worker is noted all the same, and the job fails as before", () => {
+ const { task } = job();
+ const small = worker("alone", STREAMS);
+ expect(claim(small)?.id).toBe(task);
+ runs(task, CUDA_OOM);
+ expect(state(task)).toMatchObject({ state: "failed", error: PLAN_ERROR });
+ expect(Object.keys(pool.noStreamOf(row(small)))).toEqual([FLEX]);
+ expect(pool.workersCanRun(FLEX)).toBe(false);
+ });
+
+ it("taken with every weight on the card, or another error: it fails as before, and nothing is noted", () => {
+ const one = job();
+ const big = worker("whole", WHOLE);
+ worker("other-small", STREAMS);
+ expect(claim(big)?.id).toBe(one.task);
+ runs(one.task, CUDA_OOM);
+ expect(state(one.task).state).toBe("failed");
+ expect(pool.noStreamOf(row(big))).toEqual({});
+ db().prepare("DELETE FROM relay_workers").run();
+ const two = job();
+ const small = worker("small-err", STREAMS);
+ worker("big-err", WHOLE);
+ expect(claim(small)?.id).toBe(two.task);
+ runs(two.task, failed("ValueError", "bad input"));
+ expect(state(two.task).state).toBe("failed");
+ expect(pool.noStreamOf(row(small))).toEqual({});
+ });
+
+ it("the owner clears the list: the worker streams the workflow again", () => {
+ const small = worker("cleared", STREAMS);
+ db().prepare("UPDATE relay_workers SET no_stream_json = ? WHERE id = ?").run(JSON.stringify({ [FLEX]: clock - 1000, "qwen-image-21-t2i": clock - 2000 }), small.id);
+ const { task } = job();
+ expect(claim(small)).toBeNull();
+ expect(pool.workersCanRun(FLEX)).toBe(false);
+ expect(() => pool.patchWorker(small.id, { clearNoStream: "all" as unknown as true }, clock)).toThrow(/Say which workflows to clear/);
+ const v = pool.patchWorker(small.id, { clearNoStream: [FLEX] }, clock).view!;
+ expect(v.noStream).toEqual([{ workflowId: "qwen-image-21-t2i", at: clock - 2000 }]);
+ expect(claim(small)?.id).toBe(task);
+ expect(pool.patchWorker(small.id, { clearNoStream: true }, clock).view!.noStream).toEqual([]);
+ expect(row(small).no_stream_json).toBeNull();
+ const ev = db().prepare("SELECT words FROM worker_events WHERE worker_id = ? AND event = 'clear-no-stream' ORDER BY id").all(small.id) as { words: string }[];
+ expect(ev.map((e) => e.words)).toEqual([`May stream from RAM again: ${FLEX}`, "May stream from RAM again: qwen-image-21-t2i"]);
+ });
+});
diff --git a/workflows/comfyui/requirements.json b/workflows/comfyui/requirements.json
index 3a4586f2..183f63b6 100644
--- a/workflows/comfyui/requirements.json
+++ b/workflows/comfyui/requirements.json
@@ -1,6 +1,6 @@
{
"v": 1,
- "hash": "f9b1c3e0fcae15fadbae0c2c82e9fdcda48194e220f842c3da9e17ccbd38a90f",
+ "hash": "cd7a26a435019c85edbddacdfff726690c44702faa8ef37d619b72c613b5090a",
"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","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"],
@@ -400,7 +400,7 @@
"image-watermark-remove-qwen21-brush": {"core":["CLIPLoader","KSampler","LoadImage","LoadImageMask","ModelAttentionBackend","PreviewAny","QwenImage21Cache","SaveImage","TextEncodeQwenImage21","UNETLoader","VAEDecode","VAELoader"],"packs":{"ComfyUI-Qwen-Watermark":["QWMComposite","QWMDetect","QWMFinal","QWMPrepare","QWMRefineMask","QWMResidualDetect"]},"files":["diffusion_models/qwen_image_2.1_int8_convrot.safetensors","sams/sam_vit_b_01ec64.pth","text_encoders/qwen3vl_8b_int8_convrot.safetensors","vae/qwen_image_2.1_vae_bf16.safetensors"],"optional":[],"vramGb":20,"isolated":false,"firstRun":[],"validated":true},
"image-watermark-scan-qwen3vl": {"core":["CLIPLoader","ComfyMathExpression","GetImageSize","ImageCrop","LoadImage","PreviewAny"],"packs":{"ComfyUI-Qwen-Watermark":["QWMDetect"]},"files":["text_encoders/qwen3vl_8b_int8_convrot.safetensors"],"optional":[],"vramGb":10,"isolated":false,"firstRun":[],"validated":true},
"infinitetalk-native": {"core":["AudioEncoderEncode","AudioEncoderLoader","BasicScheduler","BatchImagesNode","CFGGuider","CLIPLoader","CLIPTextEncode","ConditioningZeroOut","CreateVideo","KSamplerSelect","LoadAudio","LoadImage","LoraLoaderModelOnly","ModelPatchLoader","PrimitiveInt","RandomNoise","SamplerCustomAdvanced","SaveVideo","UNETLoader","VAEDecode","VAELoader","WanInfiniteTalkToVideo"],"packs":{},"files":["audio_encoders/wav2vec2-chinese-base_fp16.safetensors","diffusion_models/Wan2_1-I2V-14B-480p_fp8_e4m3fn_scaled_KJ.safetensors","loras/lightx2v_I2V_14B_480p_cfg_step_distill_rank64_bf16.safetensors","model_patches/wan2.1_infiniteTalk_single_fp16.safetensors","text_encoders/umt5_xxl_fp8_e4m3fn_scaled.safetensors","vae/Wan2_1_VAE_bf16.safetensors"],"optional":[],"vramGb":24,"isolated":false,"firstRun":[],"validated":true},
- "infinitetalk-wanwrapper": {"core":["CLIPVisionLoader","LoadAudio","LoadImage"],"packs":{"ComfyUI-KJNodes":["GetImageSizeAndCount","INTConstant","ImageResizeKJv2"],"ComfyUI-VideoHelperSuite":["VHS_VideoCombine"],"ComfyUI-WanVideoWrapper":["DownloadAndLoadWav2VecModel","MultiTalkModelLoader","MultiTalkWav2VecEmbeds","WanVideoBlockSwap","WanVideoClipVisionEncode","WanVideoImageToVideoMultiTalk","WanVideoLoraSelect","WanVideoModelLoader","WanVideoPassImagesFromSamples","WanVideoSampler","WanVideoTextEncodeCached","WanVideoVAELoader"]},"files":["clip_vision/clip_vision_h.safetensors","diffusion_models/Wan2_1-InfiniteTalk_Single_Q8.gguf","diffusion_models/wan2.1-i2v-14b-480p-Q8_0.gguf","loras/lightx2v_I2V_14B_480p_cfg_step_distill_rank64_bf16.safetensors","text_encoders/umt5-xxl-enc-bf16.safetensors","vae/Wan2_1_VAE_bf16.safetensors"],"optional":["loras/Wan2.1_I2V_14B_FusionX_LoRA.safetensors"],"vramGb":16,"isolated":false,"firstRun":["DownloadAndLoadWav2VecModel downloads TencentGameMate/chinese-wav2vec2-base into models/transformers on first run"],"validated":true},
+ "infinitetalk-wanwrapper": {"core":["CLIPVisionLoader","LoadAudio","LoadImage"],"packs":{"ComfyUI-KJNodes":["GetImageSizeAndCount","INTConstant","ImageResizeKJv2"],"ComfyUI-VideoHelperSuite":["VHS_VideoCombine"],"ComfyUI-WanVideoWrapper":["DownloadAndLoadWav2VecModel","MultiTalkModelLoader","MultiTalkWav2VecEmbeds","WanVideoBlockSwap","WanVideoClipVisionEncode","WanVideoImageToVideoMultiTalk","WanVideoLoraSelect","WanVideoModelLoader","WanVideoPassImagesFromSamples","WanVideoSampler","WanVideoTextEncodeCached","WanVideoVAELoader"]},"files":["clip_vision/clip_vision_h.safetensors","diffusion_models/Wan2_1-InfiniteTalk_Single_Q8.gguf","diffusion_models/wan2.1-i2v-14b-480p-Q8_0.gguf","loras/lightx2v_I2V_14B_480p_cfg_step_distill_rank64_bf16.safetensors","text_encoders/umt5-xxl-enc-bf16.safetensors","vae/Wan2_1_VAE_bf16.safetensors"],"optional":["loras/Wan2.1_I2V_14B_FusionX_LoRA.safetensors"],"vramGb":16,"isolated":false,"firstRun":["DownloadAndLoadWav2VecModel downloads TencentGameMate/chinese-wav2vec2-base into models/transformers on first run"],"validated":true,"stream":false},
"interpolate-film": {"core":["ComfyMathExpression","CreateVideo","FrameInterpolate","FrameInterpolationModelLoader","GetVideoComponents","LoadVideo","PrimitiveInt","SaveVideo"],"packs":{},"files":["frame_interpolation/film_net_fp16.safetensors"],"optional":[],"vramGb":4,"isolated":false,"firstRun":[],"validated":true},
"interpolate-rife": {"core":["ComfyMathExpression","CreateVideo","FrameInterpolate","FrameInterpolationModelLoader","GetVideoComponents","LoadVideo","PrimitiveInt","SaveVideo"],"packs":{},"files":["frame_interpolation/rife_v4.26.safetensors"],"optional":[],"vramGb":2,"isolated":false,"firstRun":[],"validated":true},
"interpolate-rife-fps": {"core":["ComfyMathExpression","CreateVideo","FrameInterpolate","FrameInterpolationModelLoader","GetVideoComponents","ImageBatch","ImageFromBatch","LoadVideo","PrimitiveFloat","PrimitiveInt","SaveVideo"],"packs":{"ComfyUI-VideoHelperSuite":["VHS_SelectEveryNthImage"]},"files":["frame_interpolation/rife_v4.26.safetensors"],"optional":["frame_interpolation/film_net_fp16.safetensors"],"vramGb":2,"isolated":false,"firstRun":[],"validated":true},
@@ -417,8 +417,8 @@
"krea2-turbo-t2i": {"core":["CLIPLoader","CLIPTextEncode","ConditioningZeroOut","EmptyLatentImage","KSampler","SaveImage","UNETLoader","VAEDecode","VAELoader"],"packs":{},"files":["diffusion_models/krea2_turbo_fp8_scaled.safetensors","text_encoders/qwen3vl_4b_fp8_scaled.safetensors","vae/qwen_image_vae.safetensors"],"optional":[],"vramGb":20,"isolated":false,"firstRun":[],"validated":true,"variants":[{"id":"int8","files":{"diffusion_models/krea2_turbo_fp8_scaled.safetensors":"diffusion_models/krea2_turbo_int8_convrot.safetensors","text_encoders/qwen3vl_4b_fp8_scaled.safetensors":"text_encoders/qwen3vl_4b_int8_convrot.safetensors"},"gpuGen":{"min":"8.0","max":"8.6"}}],"stream":{"vramGb":10,"ramGb":32}},
"layers-qwen-image-layered": {"core":["CLIPLoader","CLIPTextEncode","EmptyQwenImageLayeredLatentImage","GetImageSize","ImageScaleToMaxDimension","KSampler","LatentCut","LatentCutToBatch","LoadImage","ModelSamplingAuraFlow","PrimitiveStringMultiline","ReferenceLatent","SaveImage","UNETLoader","VAEDecode","VAEEncode","VAELoader"],"packs":{},"files":["diffusion_models/qwen_image_layered_fp8mixed.safetensors","text_encoders/qwen_2.5_vl_7b_fp8_scaled.safetensors","vae/qwen_image_layered_vae.safetensors"],"optional":[],"vramGb":24,"isolated":false,"firstRun":[],"validated":true},
"layers-qwen-image-layered-control": {"core":["CLIPLoader","CLIPTextEncode","EmptyQwenImageLayeredLatentImage","GetImageSize","ImageScaleToMaxDimension","KSampler","LatentCut","LatentCutToBatch","LoadImage","ModelSamplingAuraFlow","ReferenceLatent","SaveImage","UNETLoader","VAEDecode","VAEEncode","VAELoader"],"packs":{},"files":["diffusion_models/qwen_image_layered_control_bf16.safetensors","text_encoders/qwen_2.5_vl_7b_fp8_scaled.safetensors","vae/qwen_image_layered_vae.safetensors"],"optional":[],"vramGb":24,"isolated":false,"firstRun":[],"validated":true},
- "lipsync-latentsync16": {"core":["LoadAudio"],"packs":{"ComfyUI-LatentSyncWrapper":["LatentSyncNode","VideoLengthAdjuster"],"ComfyUI-VideoHelperSuite":["VHS_LoadVideoFFmpeg","VHS_VideoCombine"]},"files":[],"optional":[],"vramGb":20,"isolated":true,"firstRun":["LatentSyncNode snapshot_downloads ByteDance/LatentSync-1.6 (latentsync_unet.pt 5.07 GB, whisper/tiny.pt 0.08 GB), stabilityai/sd-vae-ft-mse (0.33 GB) and the s3fd face detector (0.09 GB) on first run"],"validated":true},
- "lipsync-v2v-infinitetalk": {"core":["CLIPVisionLoader","LoadAudio"],"packs":{"ComfyUI-KJNodes":["GetImageRangeFromBatch","GetImageSizeAndCount","INTConstant","ImageResizeKJv2"],"ComfyUI-VideoHelperSuite":["VHS_LoadVideoFFmpeg","VHS_VideoCombine"],"ComfyUI-WanVideoWrapper":["DownloadAndLoadWav2VecModel","MultiTalkModelLoader","MultiTalkWav2VecEmbeds","WanVideoBlockSwap","WanVideoClipVisionEncode","WanVideoDecode","WanVideoEncode","WanVideoImageToVideoMultiTalk","WanVideoLoraSelect","WanVideoModelLoader","WanVideoSampler","WanVideoTextEncodeCached","WanVideoVAELoader"]},"files":["clip_vision/clip_vision_h.safetensors","diffusion_models/Wan2_1-InfiniteTalk_Single_Q8.gguf","diffusion_models/wan2.1-i2v-14b-480p-Q8_0.gguf","loras/lightx2v_I2V_14B_480p_cfg_step_distill_rank64_bf16.safetensors","text_encoders/umt5-xxl-enc-bf16.safetensors","vae/Wan2_1_VAE_bf16.safetensors"],"optional":[],"vramGb":24,"isolated":false,"firstRun":["DownloadAndLoadWav2VecModel fetches TencentGameMate/chinese-wav2vec2-base (0.38 GB) on first run"],"validated":true},
+ "lipsync-latentsync16": {"core":["LoadAudio"],"packs":{"ComfyUI-LatentSyncWrapper":["LatentSyncNode","VideoLengthAdjuster"],"ComfyUI-VideoHelperSuite":["VHS_LoadVideoFFmpeg","VHS_VideoCombine"]},"files":[],"optional":[],"vramGb":20,"isolated":true,"firstRun":["LatentSyncNode snapshot_downloads ByteDance/LatentSync-1.6 (latentsync_unet.pt 5.07 GB, whisper/tiny.pt 0.08 GB), stabilityai/sd-vae-ft-mse (0.33 GB) and the s3fd face detector (0.09 GB) on first run"],"validated":true,"stream":false},
+ "lipsync-v2v-infinitetalk": {"core":["CLIPVisionLoader","LoadAudio"],"packs":{"ComfyUI-KJNodes":["GetImageRangeFromBatch","GetImageSizeAndCount","INTConstant","ImageResizeKJv2"],"ComfyUI-VideoHelperSuite":["VHS_LoadVideoFFmpeg","VHS_VideoCombine"],"ComfyUI-WanVideoWrapper":["DownloadAndLoadWav2VecModel","MultiTalkModelLoader","MultiTalkWav2VecEmbeds","WanVideoBlockSwap","WanVideoClipVisionEncode","WanVideoDecode","WanVideoEncode","WanVideoImageToVideoMultiTalk","WanVideoLoraSelect","WanVideoModelLoader","WanVideoSampler","WanVideoTextEncodeCached","WanVideoVAELoader"]},"files":["clip_vision/clip_vision_h.safetensors","diffusion_models/Wan2_1-InfiniteTalk_Single_Q8.gguf","diffusion_models/wan2.1-i2v-14b-480p-Q8_0.gguf","loras/lightx2v_I2V_14B_480p_cfg_step_distill_rank64_bf16.safetensors","text_encoders/umt5-xxl-enc-bf16.safetensors","vae/Wan2_1_VAE_bf16.safetensors"],"optional":[],"vramGb":24,"isolated":false,"firstRun":["DownloadAndLoadWav2VecModel fetches TencentGameMate/chinese-wav2vec2-base (0.38 GB) on first run"],"validated":true,"stream":false},
"ltx2-i2v": {"core":["CFGGuider","CLIPTextEncode","CheckpointLoaderSimple","CreateVideo","EmptyImage","EmptyLTXVLatentVideo","GetImageSize","ImageScaleBy","KSamplerSelect","LTXAVTextEncoderLoader","LTXVAudioVAEDecode","LTXVAudioVAELoader","LTXVConcatAVLatent","LTXVConditioning","LTXVCropGuides","LTXVEmptyLatentAudio","LTXVImgToVideoInplace","LTXVLatentUpsampler","LTXVPreprocess","LTXVScheduler","LTXVSeparateAVLatent","LatentUpscaleModelLoader","LoadImage","LoraLoaderModelOnly","ManualSigmas","PrimitiveInt","RandomNoise","ResizeImageMaskNode","SamplerCustomAdvanced","SaveVideo","VAEDecode"],"packs":{},"files":["checkpoints/ltx-2-19b-dev-fp8.safetensors","latent_upscale_models/ltx-2-spatial-upscaler-x2-1.0.safetensors","loras/ltx-2-19b-distilled-lora-384.safetensors","text_encoders/gemma_3_12B_it_fp4_mixed.safetensors"],"optional":[],"vramGb":32,"isolated":false,"firstRun":[],"validated":true},
"ltx2-t2v": {"core":["CFGGuider","CLIPTextEncode","CheckpointLoaderSimple","CreateVideo","EmptyImage","EmptyLTXVLatentVideo","GetImageSize","ImageScaleBy","KSamplerSelect","LTXAVTextEncoderLoader","LTXVAudioVAEDecode","LTXVAudioVAELoader","LTXVConcatAVLatent","LTXVConditioning","LTXVCropGuides","LTXVEmptyLatentAudio","LTXVLatentUpsampler","LTXVScheduler","LTXVSeparateAVLatent","LatentUpscaleModelLoader","LoraLoaderModelOnly","ManualSigmas","PrimitiveFloat","PrimitiveInt","RandomNoise","SamplerCustomAdvanced","SaveVideo","VAEDecodeTiled"],"packs":{},"files":["checkpoints/ltx-2-19b-dev-fp8.safetensors","latent_upscale_models/ltx-2-spatial-upscaler-x2-1.0.safetensors","loras/ltx-2-19b-distilled-lora-384.safetensors","text_encoders/gemma_3_12B_it_fp4_mixed.safetensors"],"optional":[],"vramGb":32,"isolated":false,"firstRun":[],"validated":true},
"ltx23-flf2v-lora": {"core":["CFGGuider","CLIPTextEncode","CheckpointLoaderSimple","ComfyMathExpression","CreateVideo","EmptyLTXVLatentVideo","GetImageSize","LTXAVTextEncoderLoader","LTXVAddGuide","LTXVAudioVAELoader","LTXVConcatAVLatent","LTXVConditioning","LTXVCropGuides","LTXVEmptyLatentAudio","LTXVPreprocess","LTXVSeparateAVLatent","LoadImage","ManualSigmas","PrimitiveInt","RandomNoise","ResizeImageMaskNode","SamplerCustomAdvanced","SamplerEulerAncestral","SaveVideo","VAEDecodeTiled"],"packs":{},"files":["checkpoints/ltx-2.3-22b-distilled-fp8.safetensors","text_encoders/gemma_3_12B_it_fp4_mixed.safetensors"],"optional":[],"vramGb":32,"isolated":false,"firstRun":[],"validated":true},
@@ -501,11 +501,11 @@
"selftest-meta-batch": {"core":["ImageInvert"],"packs":{"ComfyUI-VideoHelperSuite":["VHS_BatchManager","VHS_LoadVideoFFmpeg","VHS_VideoCombine"]},"files":[],"optional":[],"vramGb":0,"isolated":false,"firstRun":[],"validated":true,"cpu":true},
"selftest-video": {"core":["CreateVideo","ImageBatch","ImageInvert","LoadImage","RepeatImageBatch","SaveVideo"],"packs":{},"files":[],"optional":[],"vramGb":0,"isolated":false,"firstRun":[],"validated":true,"cpu":true},
"separate-soundtrack-dbs": {"core":["AudioMerge","LoadAudio","PreviewAny","SaveAudioAdvanced"],"packs":{"ComfyUI-DBS":["DBSLoader","DBSSeparate"]},"files":["dbs/DBS-BSRNN-DnR/config.json","dbs/DBS-BSRNN-DnR/model.safetensors","dbs/DBS-TIGER-DnR/config.json","dbs/DBS-TIGER-DnR/model.safetensors"],"optional":[],"vramGb":0,"isolated":false,"firstRun":[],"validated":true},
- "sfx-hunyuan-foley": {"core":["SaveAudioMP3"],"packs":{"ComfyUI-HunyuanVideo-Foley":["HunyuanDependenciesLoader","HunyuanFoleySampler","HunyuanModelLoader"]},"files":["foley/hunyuanvideo_foley_xl_fp8_e4m3fn.safetensors","foley/synchformer_state_dict_fp16.safetensors","foley/vae_128d_48k_fp16.safetensors"],"optional":[],"vramGb":12,"isolated":false,"firstRun":["HunyuanDependenciesLoader fetches the SigLIP2 and CLAP text encoders into the Hugging Face cache on first run"],"validated":true},
- "sfx-mmaudio-t2a": {"core":["SaveAudioMP3"],"packs":{"ComfyUI-MMAudio":["MMAudioFeatureUtilsLoader","MMAudioModelLoader","MMAudioSampler"]},"files":["mmaudio/apple_DFN5B-CLIP-ViT-H-14-384_fp16.safetensors","mmaudio/mmaudio_large_44k_v2_fp16.safetensors","mmaudio/mmaudio_synchformer_fp16.safetensors","mmaudio/mmaudio_vae_44k_fp16.safetensors"],"optional":[],"vramGb":8,"isolated":false,"firstRun":[],"validated":true},
+ "sfx-hunyuan-foley": {"core":["SaveAudioMP3"],"packs":{"ComfyUI-HunyuanVideo-Foley":["HunyuanDependenciesLoader","HunyuanFoleySampler","HunyuanModelLoader"]},"files":["foley/hunyuanvideo_foley_xl_fp8_e4m3fn.safetensors","foley/synchformer_state_dict_fp16.safetensors","foley/vae_128d_48k_fp16.safetensors"],"optional":[],"vramGb":12,"isolated":false,"firstRun":["HunyuanDependenciesLoader fetches the SigLIP2 and CLAP text encoders into the Hugging Face cache on first run"],"validated":true,"stream":false},
+ "sfx-mmaudio-t2a": {"core":["SaveAudioMP3"],"packs":{"ComfyUI-MMAudio":["MMAudioFeatureUtilsLoader","MMAudioModelLoader","MMAudioSampler"]},"files":["mmaudio/apple_DFN5B-CLIP-ViT-H-14-384_fp16.safetensors","mmaudio/mmaudio_large_44k_v2_fp16.safetensors","mmaudio/mmaudio_synchformer_fp16.safetensors","mmaudio/mmaudio_vae_44k_fp16.safetensors"],"optional":[],"vramGb":8,"isolated":false,"firstRun":[],"validated":true,"stream":false},
"sfx-stable-audio-3-small": {"core":["CLIPLoader","CLIPTextEncode","CheckpointLoaderSimple","EmptyLatentAudio","KSampler","PrimitiveFloat","PrimitiveStringMultiline","SaveAudioAdvanced","VAEDecodeAudio"],"packs":{},"files":["checkpoints/stable_audio_3_small_sfx.safetensors","text_encoders/t5gemma_b_b_ul2.safetensors"],"optional":[],"vramGb":6,"isolated":false,"firstRun":[],"validated":true},
"sfx-stable-audio-open": {"core":["CLIPLoader","CLIPTextEncode","CheckpointLoaderSimple","EmptyLatentAudio","KSampler","SaveAudioAdvanced","VAEDecodeAudio"],"packs":{},"files":["checkpoints/stable-audio-open-1.0.safetensors","text_encoders/t5-base.safetensors"],"optional":[],"vramGb":6,"isolated":false,"firstRun":[],"validated":true},
- "sfx-thinksound": {"core":["SaveAudioMP3"],"packs":{"ComfyUI-ThinkSound_Wrapper":["ThinkSoundFeatureUtilsLoader","ThinkSoundModelLoader","ThinkSoundSampler"]},"files":["thinksound/synchformer_state_dict.pth","thinksound/thinksound_light.ckpt","thinksound/vae.ckpt"],"optional":[],"vramGb":12,"isolated":true,"firstRun":["ThinkSoundFeatureUtilsLoader fetches google/t5-v1_1-xl and facebook/metaclip-h14 into the Hugging Face cache on first run"],"validated":true},
+ "sfx-thinksound": {"core":["SaveAudioMP3"],"packs":{"ComfyUI-ThinkSound_Wrapper":["ThinkSoundFeatureUtilsLoader","ThinkSoundModelLoader","ThinkSoundSampler"]},"files":["thinksound/synchformer_state_dict.pth","thinksound/thinksound_light.ckpt","thinksound/vae.ckpt"],"optional":[],"vramGb":12,"isolated":true,"firstRun":["ThinkSoundFeatureUtilsLoader fetches google/t5-v1_1-xl and facebook/metaclip-h14 into the Hugging Face cache on first run"],"validated":true,"stream":false},
"soul-cast-sheet-zimage": {"core":["CLIPLoader","CLIPTextEncode","ConditioningZeroOut","EmptySD3LatentImage","KSampler","ModelSamplingAuraFlow","SaveImage","StringConcatenate","UNETLoader","VAEDecode","VAELoader"],"packs":{"ComfyUI-KJNodes":["ImageGridtoBatch"]},"files":["diffusion_models/z_image_turbo_bf16.safetensors","text_encoders/qwen_3_4b.safetensors","vae/ae.safetensors"],"optional":[],"vramGb":14,"isolated":false,"firstRun":[],"validated":true},
"soundtrack-remix-dbs": {"core":["AudioAdjustVolume","AudioMerge","LoadAudio","PreviewAny","SaveAudioAdvanced"],"packs":{"ComfyUI-DBS":["DBSLoader","DBSSeparate"]},"files":["dbs/DBS-BSRNN-DnR/config.json","dbs/DBS-BSRNN-DnR/model.safetensors","dbs/DBS-TIGER-DnR/config.json","dbs/DBS-TIGER-DnR/model.safetensors"],"optional":[],"vramGb":0,"isolated":false,"firstRun":[],"validated":true},
"speech-edit-auk": {"core":["AudioConcat","AudioMerge","EmptyAudio","LoadAudio","SaveAudio","SplitAudioChannels","TrimAudioDuration"],"packs":{"ComfyUI-AuK":["AuKGenerateEdit","AuKModelLoader"]},"files":[],"optional":[],"vramGb":24,"isolated":false,"firstRun":["install-comfyui.sh with AUK=1 AUK_WEIGHTS=1 downloads into the AuK checkout's ckpts/ (relative paths resolve there, not in a ComfyUI models folder): tencent/AuK-Flash at 575b92f0895f75180bf2cbd35f2e176c5732b8ed (auk_flash.safetensors 6.12 GB, vae.safetensors 0.64 GB, config.yaml) and Qwen/Qwen2.5-Omni-3B at f75b40e3da2003cdd6e1829b1f420ca70797c34e (3 safetensors shards, 11.97 GB, plus config and tokenizer files); AUK_BASE=1 adds tencent/AuK at 790742b71a4430120daf2b2099192abae449eb9f (auk_base.safetensors 6.12 GB) for the Best setting"]},
@@ -534,8 +534,8 @@
"upscale-video-rtx": {"core":["ComfyMathExpression","PrimitiveInt","ResizeImageMaskNode"],"packs":{"ComfyUI-VideoHelperSuite":["VHS_BatchManager","VHS_LoadVideoFFmpeg","VHS_VideoCombine","VHS_VideoInfo"],"ComfyUI_Nvidia_VFX_Nodes":["RTXVideoSuperResolution"]},"files":[],"optional":[],"vramGb":0,"isolated":false,"gpu":"nvidia-rtx","firstRun":[]},
"upscale-video-seedvr2": {"core":["CreateVideo","GetVideoComponents","KSampler","LoadVideo","ResizeImageMaskNode","SaveVideo","SeedVR2Conditioning","SeedVR2PostProcessing","SeedVR2Preprocess","UNETLoader","VAEDecodeTiled","VAEEncodeTiled","VAELoader"],"packs":{},"files":["diffusion_models/seedvr2_3b_int8_convrot.safetensors","vae/seedvr2_ema_vae_fp16.safetensors"],"optional":[],"vramGb":16,"isolated":false,"firstRun":[],"validated":true},
"upscale-video-seedvr2-chunked": {"core":["KSampler","ResizeImageMaskNode","SeedVR2Conditioning","SeedVR2PostProcessing","SeedVR2Preprocess","UNETLoader","VAEDecodeTiled","VAEEncodeTiled","VAELoader"],"packs":{"ComfyUI-VideoHelperSuite":["VHS_BatchManager","VHS_LoadVideoFFmpeg","VHS_VideoCombine","VHS_VideoInfo"]},"files":["diffusion_models/seedvr2_3b_int8_convrot.safetensors","vae/seedvr2_ema_vae_fp16.safetensors"],"optional":[],"vramGb":16,"isolated":false,"firstRun":[],"validated":true},
- "v2a-hunyuan-foley": {"core":["ConcatenateVideo","LoadVideo","SaveAudioMP3","SaveVideo"],"packs":{"ComfyUI-HunyuanVideo-Foley":["HunyuanDependenciesLoader","HunyuanFoleySampler","HunyuanModelLoader"],"ComfyUI-VideoHelperSuite":["VHS_LoadVideoFFmpeg"]},"files":["foley/hunyuanvideo_foley_xl_fp8_e4m3fn.safetensors","foley/synchformer_state_dict_fp16.safetensors","foley/vae_128d_48k_fp16.safetensors"],"optional":[],"vramGb":12,"isolated":false,"firstRun":["HunyuanDependenciesLoader fetches the SigLIP2 and CLAP text encoders into the Hugging Face cache on first run"],"validated":true},
- "v2a-mmaudio": {"core":["SaveAudio"],"packs":{"ComfyUI-MMAudio":["MMAudioFeatureUtilsLoader","MMAudioModelLoader","MMAudioSampler"],"ComfyUI-VideoHelperSuite":["VHS_LoadVideoFFmpeg","VHS_VideoCombine","VHS_VideoInfo"]},"files":["mmaudio/apple_DFN5B-CLIP-ViT-H-14-384_fp16.safetensors","mmaudio/mmaudio_large_44k_v2_fp16.safetensors","mmaudio/mmaudio_synchformer_fp16.safetensors","mmaudio/mmaudio_vae_44k_fp16.safetensors"],"optional":[],"vramGb":8,"isolated":false,"firstRun":[],"validated":true},
+ "v2a-hunyuan-foley": {"core":["ConcatenateVideo","LoadVideo","SaveAudioMP3","SaveVideo"],"packs":{"ComfyUI-HunyuanVideo-Foley":["HunyuanDependenciesLoader","HunyuanFoleySampler","HunyuanModelLoader"],"ComfyUI-VideoHelperSuite":["VHS_LoadVideoFFmpeg"]},"files":["foley/hunyuanvideo_foley_xl_fp8_e4m3fn.safetensors","foley/synchformer_state_dict_fp16.safetensors","foley/vae_128d_48k_fp16.safetensors"],"optional":[],"vramGb":12,"isolated":false,"firstRun":["HunyuanDependenciesLoader fetches the SigLIP2 and CLAP text encoders into the Hugging Face cache on first run"],"validated":true,"stream":false},
+ "v2a-mmaudio": {"core":["SaveAudio"],"packs":{"ComfyUI-MMAudio":["MMAudioFeatureUtilsLoader","MMAudioModelLoader","MMAudioSampler"],"ComfyUI-VideoHelperSuite":["VHS_LoadVideoFFmpeg","VHS_VideoCombine","VHS_VideoInfo"]},"files":["mmaudio/apple_DFN5B-CLIP-ViT-H-14-384_fp16.safetensors","mmaudio/mmaudio_large_44k_v2_fp16.safetensors","mmaudio/mmaudio_synchformer_fp16.safetensors","mmaudio/mmaudio_vae_44k_fp16.safetensors"],"optional":[],"vramGb":8,"isolated":false,"firstRun":[],"validated":true,"stream":false},
"video-append-endcard": {"core":["AudioConcat","ComfyMathExpression","ConcatenateVideo","CreateVideo","EmptyAudio","ImageScale","LoadAudio","LoadImage","LoadVideo","PrimitiveFloat","PrimitiveInt","RepeatImageBatch","SaveVideo"],"packs":{},"files":[],"optional":[],"vramGb":0,"isolated":false,"firstRun":[],"validated":true,"cpu":true},
"video-bg-remove-birefnet": {"core":["CreateVideo","GetVideoComponents","InvertMask","JoinImageWithAlpha","LoadBackgroundRemovalModel","LoadVideo","MaskToImage","RemoveBackground","SaveVideo","SaveWEBM"],"packs":{},"files":["background_removal/birefnet.safetensors"],"optional":[],"vramGb":4,"isolated":false,"firstRun":[],"validated":true},
"video-bg-remove-sam3": {"core":["CLIPTextEncode","CheckpointLoaderSimple","CreateVideo","GetVideoComponents","InvertMask","JoinImageWithAlpha","LoadVideo","MaskToImage","SAM3_TrackToMask","SAM3_VideoTrack","SaveVideo","SaveWEBM"],"packs":{},"files":["checkpoints/sam3.1_multiplex_fp16.safetensors"],"optional":[],"vramGb":6,"isolated":false,"firstRun":[],"validated":true},
@@ -597,7 +597,7 @@
"video-segment-resample": {"core":["CreateVideo","ImageFromBatch","ImageScale","SaveImage","SaveVideo"],"packs":{"ComfyUI-VideoHelperSuite":["VHS_LoadVideoFFmpeg"]},"files":[],"optional":[],"vramGb":0,"isolated":false,"firstRun":[],"validated":true,"cpu":true},
"video-swap-wan-vace": {"core":["CLIPLoader","CLIPTextEncode","CheckpointLoaderSimple","ComfyMathExpression","CreateVideo","GetImageSize","GetVideoComponents","GrowMask","ImageCompositeMasked","ImageFromBatch","ImageScale","ImageToMask","InvertMask","KSampler","LoadImage","LoadVideo","LoraLoaderModelOnly","MaskToImage","ModelSamplingSD3","PrimitiveFloat","PrimitiveInt","SAM3_TrackToMask","SAM3_VideoTrack","SaveVideo","TrimAudioDuration","TrimVideoLatent","UNETLoader","VAEDecode","VAELoader","Video Slice","WanVaceToVideo"],"packs":{"ComfyUI-KJNodes":["GrowMaskWithBlur"]},"files":["checkpoints/sam3.1_multiplex_fp16.safetensors","diffusion_models/wan2.1_vace_14B_fp16.safetensors","loras/lightx2v_T2V_14B_cfg_step_distill_v2_lora_rank64_bf16.safetensors","text_encoders/umt5_xxl_fp8_e4m3fn_scaled.safetensors","vae/wan_2.1_vae.safetensors"],"optional":[],"vramGb":24,"isolated":false,"firstRun":[],"validated":true},
"video-trim": {"core":["LoadVideo","SaveVideo","Video Slice"],"packs":{},"files":[],"optional":[],"vramGb":0,"isolated":false,"firstRun":[],"validated":true,"cpu":true},
- "video-upscale-kandinsky6-vsr": {"core":["CreateVideo","GetVideoComponents","LoadVideo","SaveVideo","UNETLoader"],"packs":{"kandinsky6-sr":["Kandinsky6LatentUpscalerLoader","Kandinsky6SRVAELoader","Kandinsky6VSRUpscale"]},"files":["diffusion_models/Kandinsky-6.0-VSR-distilled2steps-5s-Diffusers/latent_upscaler/config.json","diffusion_models/Kandinsky-6.0-VSR-distilled2steps-5s-Diffusers/latent_upscaler/diffusion_pytorch_model.safetensors","diffusion_models/Kandinsky-6.0-VSR-distilled2steps-5s-Diffusers/model_index.json","diffusion_models/Kandinsky-6.0-VSR-distilled2steps-5s-Diffusers/scheduler/scheduler_config.json","diffusion_models/Kandinsky-6.0-VSR-distilled2steps-5s-Diffusers/transformer/config.json","diffusion_models/Kandinsky-6.0-VSR-distilled2steps-5s-Diffusers/transformer/diffusion_pytorch_model.safetensors","diffusion_models/Kandinsky-6.0-VSR-distilled2steps-5s-Diffusers/vae/config.json","diffusion_models/Kandinsky-6.0-VSR-distilled2steps-5s-Diffusers/vae/diffusion_pytorch_model.safetensors"],"optional":[],"vramGb":24,"isolated":false,"firstRun":[]},
+ "video-upscale-kandinsky6-vsr": {"core":["CreateVideo","GetVideoComponents","LoadVideo","SaveVideo","UNETLoader"],"packs":{"kandinsky6-sr":["Kandinsky6LatentUpscalerLoader","Kandinsky6SRVAELoader","Kandinsky6VSRUpscale"]},"files":["diffusion_models/Kandinsky-6.0-VSR-distilled2steps-5s-Diffusers/latent_upscaler/config.json","diffusion_models/Kandinsky-6.0-VSR-distilled2steps-5s-Diffusers/latent_upscaler/diffusion_pytorch_model.safetensors","diffusion_models/Kandinsky-6.0-VSR-distilled2steps-5s-Diffusers/model_index.json","diffusion_models/Kandinsky-6.0-VSR-distilled2steps-5s-Diffusers/scheduler/scheduler_config.json","diffusion_models/Kandinsky-6.0-VSR-distilled2steps-5s-Diffusers/transformer/config.json","diffusion_models/Kandinsky-6.0-VSR-distilled2steps-5s-Diffusers/transformer/diffusion_pytorch_model.safetensors","diffusion_models/Kandinsky-6.0-VSR-distilled2steps-5s-Diffusers/vae/config.json","diffusion_models/Kandinsky-6.0-VSR-distilled2steps-5s-Diffusers/vae/diffusion_pytorch_model.safetensors"],"optional":[],"vramGb":24,"isolated":false,"firstRun":[],"stream":false},
"voice-change-chatterbox": {"core":["ComfyMathExpression","LoadAudio","PrimitiveInt","SaveAudioMP3"],"packs":{"ComfyUI_Fill-ChatterBox":["FL_ChatterboxVC"]},"files":[],"optional":[],"vramGb":3,"isolated":false,"firstRun":["FL_ChatterboxVC downloads ResembleAI/chatterbox s3gen.pt (1.06 GB) + conds.pt into models/chatterbox/chatterbox_vc on first run"],"validated":true},
"voice-clean-bed-reuse": {"core":["AudioMerge","LoadAudio","PreviewAny","SaveAudioAdvanced"],"packs":{"ComfyUI-DBS":["DBSLoader","DBSSeparate"],"ComfyUI-RE-USE":["REUSEEnhance","REUSELoader"]},"files":["dbs/DBS-BSRNN-DnR/config.json","dbs/DBS-BSRNN-DnR/model.safetensors","dbs/DBS-TIGER-DnR/config.json","dbs/DBS-TIGER-DnR/model.safetensors","reuse/NemotronLabs-RE-USE.safetensors"],"optional":["reuse/NemotronLabs-RE-USE-laughter.safetensors"],"vramGb":0,"isolated":false,"firstRun":[],"validated":true},
"voice-clean-reuse": {"core":["LoadAudio","PreviewAny","SaveAudioAdvanced"],"packs":{"ComfyUI-RE-USE":["REUSEEnhance","REUSELoader"]},"files":["reuse/NemotronLabs-RE-USE.safetensors"],"optional":["reuse/NemotronLabs-RE-USE-laughter.safetensors"],"vramGb":0,"isolated":false,"firstRun":[],"validated":true},
diff --git a/workflows/comfyui/stream-needs.json b/workflows/comfyui/stream-needs.json
index 7b1da654..d58e3740 100644
--- a/workflows/comfyui/stream-needs.json
+++ b/workflows/comfyui/stream-needs.json
@@ -19,5 +19,16 @@
"vramGb": 10,
"ramGb": 32
}
- ]
+ ],
+ "noStream": {
+ "packs": [
+ "ComfyUI-HunyuanVideo-Foley",
+ "ComfyUI-LatentSyncWrapper",
+ "ComfyUI-MMAudio",
+ "ComfyUI-ThinkSound_Wrapper",
+ "ComfyUI-WanVideoWrapper",
+ "kandinsky6-sr"
+ ],
+ "workflows": []
+ }
}