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.

Upscale: Quick · RTX, RTX Frame Generation and RTX Video HDR on NVIDIA RTX cards, with the card checked first

Claude2d00ff260124
diff --git a/src/components/gpu/guided-fix.tsx b/src/components/gpu/guided-fix.tsx
index e8876957..0769192b 100644
--- a/src/components/gpu/guided-fix.tsx
+++ b/src/components/gpu/guided-fix.tsx
@@ -197,6 +197,7 @@ function titleOf(plan: FixPlan | undefined, name: string): { text: string; Icon:
if (!plan) return { text: name, Icon: Wrench };
if (plan.state === "ready") return { text: `${plan.name} is ready`, Icon: CheckCircle2 };
if (plan.state === "gpu") return { text: `${plan.name} needs a bigger graphics card`, Icon: Cpu };
+ if (plan.state === "unsupported" && plan.gpuNeed) return { text: `${plan.name} needs ${plan.gpuNeed === "nvidia-rtx-40" ? "an NVIDIA RTX 40 series card or newer" : "an NVIDIA RTX card"}`, Icon: Cpu };
if (plan.state === "unsupported") return { text: `${plan.name} needs a second ComfyUI`, Icon: Layers };
const n = plan.steps.filter((s) => s.kind !== "restart" && s.kind !== "hf-licence" && s.kind !== "civitai-key").length || 1;
return { text: n === 1 ? `${plan.name} needs one more thing` : `${plan.name} needs ${n} things`, Icon: Download };
@@ -269,7 +270,11 @@ function Body({ detail, actions, titleRef }: { detail: GpuSetupDetail; actions:
{plan?.state === "gpu" && <GpuState plan={plan} actions={actions} />}
{plan?.state === "unsupported" && (
<div className="space-y-3 text-[13px] text-muted-foreground">
- <p>This one needs its own ComfyUI, so it can&apos;t run next to your other add-ons.</p>
+ <p>
+ {plan.gpuNeed
+ ? `It runs on NVIDIA's RTX video engine, which only ${plan.gpuNeed === "nvidia-rtx-40" ? "RTX 40 series cards and newer" : "NVIDIA RTX cards"} have${plan.gpu ? `, and your ${plan.gpu} isn't one` : ""}. The other choices in this tool work on your GPU.`
+ : "This one needs its own ComfyUI, so it can't run next to your other add-ons."}
+ </p>
<Button variant="secondary" className="h-11 sm:h-9" onClick={actions.close}>
Close
</Button>
diff --git a/src/components/gpu/readiness-board.tsx b/src/components/gpu/readiness-board.tsx
index 4cab6354..cb0ce6d6 100644
--- a/src/components/gpu/readiness-board.tsx
+++ b/src/components/gpu/readiness-board.tsx
@@ -118,7 +118,9 @@ export function ReadinessBoard({ view, owner, onCheck, checking }: { view: Readi
const ready = count("ready");
const almost = count("almost");
const setup = count("setup");
- const gpu = count("gpu") + count("unsupported");
+ // A tool that needs an NVIDIA RTX card the GPU isn't is counted on its own: a bigger card wouldn't help.
+ const card = rows.filter((r) => r.tool.state === "unsupported" && r.tool.gpuNeed).length;
+ const gpu = count("gpu") + count("unsupported") - card;
const s = report.summary;
const gpuName = s.gpu ? `${s.gpu.replace(/^NVIDIA\s+(GeForce\s+)?/i, "")}${s.vramGb ? ` (${s.vramGb} GB)` : ""}` : "ComfyUI";
const headline = ready ? `Your ${gpuName} is ready for ${ready} of ${rows.length} studios` : `Your ${gpuName} is connected`;
@@ -126,6 +128,7 @@ export function ReadinessBoard({ view, owner, onCheck, checking }: { view: Readi
almost && `${almost} more ${almost === 1 ? "needs" : "need"} one step.`,
setup && `${setup} ${setup === 1 ? "needs" : "need"} a few things set up.`,
gpu && `${gpu} ${gpu === 1 ? "needs" : "need"} a bigger graphics card${owner ? ", and can run in the cloud" : ""}.`,
+ card && `${card} ${card === 1 ? "needs" : "need"} an NVIDIA RTX card.`,
]
.filter(Boolean)
.join(" ");
diff --git a/src/components/gpu/readiness-chip.tsx b/src/components/gpu/readiness-chip.tsx
index 409d3f8f..fe91ff60 100644
--- a/src/components/gpu/readiness-chip.tsx
+++ b/src/components/gpu/readiness-chip.tsx
@@ -66,7 +66,18 @@ export function HeaderPill({ badge, gpu, onOpen, compact }: { badge: Badge; gpu?
const tenths = badge[2];
const away = s === "ready" && !(badge[3] & 4) && own?.connected && !own.online ? (own.comfy === "down" ? "ComfyUI isn't running" : own.comfy === "no-setting" ? "ComfyUI needs a setting" : "Your GPU is offline") : null;
const label =
- away ?? (s === "ready" ? (badge[3] & 4 ? "Runs on any computer" : "Ready on your GPU") : s === "gpu" ? "Needs a bigger GPU" : s === "unsupported" ? "Not on your GPU" : `Set up${tenths ? ` · ${tenths / 10} GB` : ""}`);
+ away ??
+ (s === "ready"
+ ? badge[3] & 4
+ ? "Runs on any computer"
+ : "Ready on your GPU"
+ : s === "gpu"
+ ? "Needs a bigger GPU"
+ : s === "unsupported"
+ ? badge[3] & 24
+ ? "Needs an RTX card"
+ : "Not on your GPU"
+ : `Set up${tenths ? ` · ${tenths / 10} GB` : ""}`);
const Icon = away ? Cpu : s === "ready" ? CheckCircle2 : s === "gpu" ? Cpu : s === "unsupported" ? Layers : Download;
const cls = cn(
"inline-flex h-8 shrink-0 items-center gap-1.5 rounded-full px-2.5 text-[12px] font-medium",
diff --git a/src/components/studio/finish-choices.tsx b/src/components/studio/finish-choices.tsx
index dbf5dca6..7fb86bbf 100644
--- a/src/components/studio/finish-choices.tsx
+++ b/src/components/studio/finish-choices.tsx
@@ -3,6 +3,8 @@
import { Cpu, Loader2, Sparkles } from "lucide-react";
import type { Engine, ModelDef } from "@/lib/catalog/types";
import { REGEN_COPY, REGEN_MODEL, type FINISH_CHOICES } from "@/lib/catalog/regenerate";
+import { RTX_COPY, RTX_UPSCALE_MODEL, rtxStanding } from "@/lib/catalog/rtx-video";
+import { badgeFor, useGpuBadges } from "@/hooks/use-gpu";
import { useIsOwner } from "@/lib/api";
import { cn } from "@/lib/utils";
import { radioKeys, radioTab } from "./radio-keys";
@@ -13,6 +15,8 @@ import { radioKeys, radioTab } from "./radio-keys";
* button that takes the composer there; with Engine mode "Paid APIs only" nothing shows. GPU-only: nobody hosts it.
* With Regenerate picked: the GPU line (the install detail for the owner only), the 16:9 / 9:16 shape, and for a clip with
* no words yet a button that has Fuobe's reading model describe it (`onDescribe`).
+ * NVIDIA RTX Video's "Quick · RTX" joins them: first on an NVIDIA RTX card, switched off with the reason on a card that
+ * can't run it (a CPU, Apple, AMD or an older NVIDIA card), last when the card isn't known. It is never picked for anyone.
*/
export function FinishChoices({
choices,
@@ -36,6 +40,7 @@ export function FinishChoices({
describing?: boolean;
}) {
const owner = useIsOwner();
+ const badges = useGpuBadges().data;
if (engineMode === "cloud") return null;
const regen = offered(REGEN_MODEL);
if (engine === "cloud") {
@@ -56,13 +61,25 @@ export function FinishChoices({
</div>
);
}
- const shown = choices.map((c) => ({ ...c, m: offered(c.modelId) })).filter((c) => !!c.m);
+ const base: { modelId: string; label: string; hint: string; m?: ModelDef; off?: true }[] = choices.map((c) => ({ ...c, m: offered(c.modelId) })).filter((c) => !!c.m);
+ // Quick · RTX: where it stands on the viewer's card (its own chip says when the card can't run it).
+ const rtx = offered(RTX_UPSCALE_MODEL);
+ const chip = badgeFor(badges, { modelId: RTX_UPSCALE_MODEL, op: "upscale-video" });
+ const standing = rtxStanding("nvidia-rtx", badges?.gpu, !!chip && chip[0] === "u" && (chip[3] & 24) !== 0);
+ const quick = rtx && {
+ modelId: RTX_UPSCALE_MODEL,
+ label: RTX_COPY.quick,
+ hint: standing === "fits" ? RTX_COPY.quickHint : standing === "no" ? RTX_COPY.needsCard : `${RTX_COPY.onRtx}. Adds no new detail.`,
+ m: rtx,
+ ...(standing === "no" && model?.id !== RTX_UPSCALE_MODEL && { off: true as const }),
+ };
+ const shown = quick ? (standing === "fits" ? [quick, ...base] : [...base, quick]) : base;
if (shown.length < 2) return null;
const picked = shown.find((c) => c.modelId === model?.id);
return (
<div className="px-1.5 pb-2">
- <div role="radiogroup" aria-label="How to finish the clip" onKeyDown={radioKeys} className="grid grid-cols-2 gap-1.5">
- {shown.map((c) => {
+ <div role="radiogroup" aria-label="How to finish the clip" onKeyDown={radioKeys} className={cn("grid grid-cols-2 gap-1.5", shown.length > 2 && "sm:grid-cols-3")}>
+ {shown.map((c, i) => {
const sel = c.modelId === model?.id;
return (
<button
@@ -70,11 +87,14 @@ export function FinishChoices({
type="button"
role="radio"
aria-checked={sel}
+ aria-disabled={c.off}
tabIndex={radioTab(sel || (!picked && c === shown[0]))}
- onClick={() => !sel && onPick(c.m!)}
+ onClick={() => !sel && !c.off && onPick(c.m!)}
className={cn(
"min-w-0 rounded-xl border px-2.5 py-1.5 text-left transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/50",
- sel ? "border-primary bg-brand-faint" : "hover:bg-accent",
+ sel ? "border-primary bg-brand-faint" : c.off ? "cursor-not-allowed opacity-60" : "hover:bg-accent",
+ // Three choices: the first takes a row of its own on a phone.
+ shown.length > 2 && i === 0 && "max-sm:col-span-2",
)}
>
<span className={cn("block text-[12px] font-medium", sel ? "text-brand-text" : "text-foreground")}>{c.label}</span>
@@ -83,6 +103,7 @@ export function FinishChoices({
);
})}
</div>
+ {model?.id === RTX_UPSCALE_MODEL && <p className="mt-1.5 px-1 text-[11px] leading-snug text-pretty text-muted-foreground">{RTX_COPY.picked}</p>}
{model?.id === REGEN_MODEL && (
<>
<p className="mt-1.5 px-1 text-[11px] leading-snug text-pretty text-muted-foreground">
diff --git a/src/hooks/use-gpu.ts b/src/hooks/use-gpu.ts
index 17f906ca..5ead007c 100644
--- a/src/hooks/use-gpu.ts
+++ b/src/hooks/use-gpu.ts
@@ -6,6 +6,7 @@ import { rememberedComfy } from "@/components/gpu/computer-runtime";
import { GPU_SETUP_EVENT } from "@/lib/api";
import { checkThisComputer, sendCheck } from "@/lib/gpu/browser-check";
import { BADGE_STATE } from "@/lib/gpu/readiness";
+import { GPU_NEED_TEXT } from "@/lib/gpu/rtx";
import type { Badge, BadgeMap, CheckLine, FixPlan, GpuProblem, ReadinessReport, Readiness } from "@/lib/gpu/types";
import { responseError } from "@/lib/refusals";
@@ -80,6 +81,9 @@ export function badgeText(b: Badge, gpu?: string): { short: string; long: string
const gb = tenths ? `${tenths / 10} GB` : "";
if (s === "r") return flags & 4 ? { short: "Ready", long: "Runs on any computer" } : { short: "Ready", long: `Ready on your ${gpu ?? "GPU"}${flags & 1 ? " (slow: it borrows memory)" : ""}` };
if (s === "g") return { short: "Bigger GPU", long: `Needs more graphics memory than your ${gpu ?? "GPU"} has` };
+ // Flags 8 / 16: the card isn't the NVIDIA RTX one it needs (readiness badgeOf).
+ if (s === "u" && flags & 16) return { short: "RTX 40+", long: GPU_NEED_TEXT["nvidia-rtx-40"] };
+ if (s === "u" && flags & 8) return { short: "RTX only", long: GPU_NEED_TEXT["nvidia-rtx"] };
if (s === "u") return { short: "Not here", long: "Needs its own ComfyUI, so it can't run next to your other add-ons" };
const downloadOnly = gb && steps === 1;
return {
diff --git a/src/lib/av/video-finish.ts b/src/lib/av/video-finish.ts
index 9e229d49..3b4c71cd 100644
--- a/src/lib/av/video-finish.ts
+++ b/src/lib/av/video-finish.ts
@@ -81,6 +81,35 @@ export function framesPerPass(clip: ClipFacts, o: { shortSide?: number; modelSca
return n;
}
+/** The workflow of RTX Video Super Resolution (Upscale → Video's Quick · RTX). */
+export const RTX_UPSCALE_WORKFLOW = "upscale-video-rtx";
+
+/**
+ * The factor RTX Video Super Resolution runs at in upscale-video-rtx: the shorter edge asked for ÷ the clip's, within the
+ * node's 1-4x (the graph works it out the same way from the decoded size, then scales to exactly `shortSide`). 4 when the
+ * size is unknown (the most a pass can hold).
+ */
+export function rtxScale(clip: ClipFacts, shortSide: number): number {
+ const short = clip.width && clip.height ? Math.min(clip.width, clip.height) : 0;
+ if (!(short > 0)) return 4;
+ return Math.min(4, Math.max(1, shortSide / short));
+}
+
+/** The node's output size for a scale: each side × scale, rounded to the nearest multiple of 8 (the pack's rule). */
+export function rtxOutputSize(width: number, height: number, scale: number): { width: number; height: number } {
+ const to8 = (n: number) => Math.max(8, Math.round((n * scale) / 8) * 8);
+ return { width: to8(width), height: to8(height) };
+}
+
+/**
+ * Frames RTX Video Frame Generation returns for `frames` inputs at multiplier m: (N - 1) × m + 1 (one frame comes back
+ * unchanged). fps-rtx-framegen holds the last frame once more first, so a clip's N frames become N × m + 1, as RIFE's do.
+ */
+export function rtxFrameGenFrames(frames: number, multiplier: number): number {
+ if (frames < 2) return Math.max(0, frames);
+ return (frames - 1) * multiplier + 1;
+}
+
/**
* Bytes a whole-clip graph holds (FPS Boost, HDR, EXR export decode the whole clip as float32 frames):
* `copies` frame-sized copies of every source frame (SDR to HDR and EXR 2, FPS Boost 2 + m). Undefined
diff --git a/src/lib/catalog/canvas.ts b/src/lib/catalog/canvas.ts
index 5005d036..3ad1e5d3 100644
--- a/src/lib/catalog/canvas.ts
+++ b/src/lib/catalog/canvas.ts
@@ -15,6 +15,10 @@ import { chainedWaitMessage, keyframeChain } from "./keyframes";
import { estimateCost, inferOperation, planGeneration, routesFor, type Plan } from "./plan";
import { replacedBy, replacementOf } from "./replaced";
import { REGEN_COPY, REGEN_MODEL } from "./regenerate";
+import { RTX_UPSCALE_MODEL } from "./rtx-video";
+
+/** Upscale node entries fixed to an open model nobody hosts (Open-H3 Regenerate, NVIDIA RTX Video): no cloud stand-in. */
+const GPU_ONLY_FIXED = new Set([REGEN_MODEL, RTX_UPSCALE_MODEL]);
import {
OPERATION_LABELS,
OPERATION_OUTPUT,
@@ -286,6 +290,15 @@ export const PALETTE: PaletteItem[] = [
data: { mediaKind: "video", modelId: REGEN_MODEL },
keywords: "regenerate redraw 2k 4k h3 creative upscale sharpen finish",
},
+ // The Upscale node on NVIDIA RTX Video Super Resolution: a fast upscale on an NVIDIA RTX card only (nobody hosts it).
+ {
+ ...pick("upscale"),
+ id: "upscale-rtx",
+ label: "Quick upscale (RTX)",
+ description: "Fast upscale up to 4x on an NVIDIA RTX card: sharpens without adding new detail (your GPU)",
+ data: { mediaKind: "video", modelId: RTX_UPSCALE_MODEL },
+ keywords: "rtx nvidia quick fast upscale super resolution vsr sharpen 4k",
+ },
{ ...pick("bg-remove"), id: "bg-remove", data: { mediaKind: "image" }, keywords: "cutout matte transparent" },
{ ...pick("tts"), id: "tts", keywords: "voice speech narration clone" },
{ ...pick("voice-change"), id: "voice-change", keywords: "voice changer speech to speech revoice convert" },
@@ -442,7 +455,7 @@ export function defaultModelForNode(n: Pick<CanvasNode, "type" | "data">, engine
}
const op = nodeOps(n)[0];
// The Upscale node's Regenerate choice starts on Open-H3 Regenerate (on the cloud the entry is disabled: paletteItems).
- const fixed = n.data.modelId === REGEN_MODEL ? getModel(REGEN_MODEL) : undefined;
+ const fixed = n.data.modelId && GPU_ONLY_FIXED.has(n.data.modelId) ? getModel(n.data.modelId) : undefined;
if (fixed && op && supportsOp(fixed, op) && runsOn(fixed, engine)) return fixed;
return op ? defaultModelFor(op, engine, { hidden: true }) : undefined;
}
@@ -1596,8 +1609,8 @@ export function counterpart(graph: CanvasGraph, n: CanvasNode, engine: Engine):
const current = n.data.modelId ? getModel(n.data.modelId) : undefined;
// A Fuobe Original runs on both: it stays, on the other engine.
if (current && runsOn(current, engine)) return current;
- // Open-H3 Regenerate is GPU-only: nobody hosts it, so it has no cloud stand-in (the owner's rule).
- if (current?.id === REGEN_MODEL) return undefined;
+ // Open-H3 Regenerate and NVIDIA RTX Video are GPU-only: nobody hosts them, so they have no cloud stand-in (the owner's rule).
+ if (current && GPU_ONLY_FIXED.has(current.id)) return undefined;
if (n.type !== "model") return defaultModelForNode(n, engine);
const op = n.data.op ?? effectiveOp(graph, n) ?? (current ? current.routes[0].op : KIND_OP[n.data.mediaKind ?? "image"]);
const kind = current?.kind ?? n.data.mediaKind;
diff --git a/src/lib/catalog/models.ts b/src/lib/catalog/models.ts
index b130108e..803190c5 100644
--- a/src/lib/catalog/models.ts
+++ b/src/lib/catalog/models.ts
@@ -8,6 +8,7 @@ import { ANGLES_LORA, MOSAIC_SCALE, MOSAIC_TARGET, SPEAK_GRAPH, SPEAK_LORA, SPEA
import { CINEMA_CROP, SOUL_ASPECTS, SOUL_TIERS } from "./soul";
import { RESTORE, offlineRestorePrompt } from "./restore";
import { REGEN_COPY, REGEN_DEFAULT_TIER, REGEN_MODEL, REGEN_TIERS, REGEN_WORKFLOW } from "./regenerate";
+import { RTX_FRAMEGEN_MODEL, RTX_FRAMEGEN_WORKFLOW, RTX_HDR_MODEL, RTX_HDR_WORKFLOW, RTX_UPSCALE_MODEL, RTX_UPSCALE_WORKFLOW } from "./rtx-video";
import { denoiseFor, EVOLUTION, EVOLUTION_DEFAULT_RESOLUTION, EVOLUTION_RESOLUTIONS, INTENSITIES, type Intensity } from "./evolution";
import { LAST_FRAME_CHAIN, type ModelDef, type ModelOptions, type ModelRoute, type Operation } from "./types";
@@ -876,6 +877,68 @@ const open: ModelDef[] = [
options: { formats: ["hlg_10bit", "pq_10bit", "exr"], sliders: [{ param: "peakNits", label: "Peak brightness (nits)", min: 200, max: 2000, step: 50, default: 650 }] },
defaults: { format: "hlg_10bit" },
}),
+ // NVIDIA RTX Video (nm10-rtx-video, src/lib/catalog/rtx-video.ts): Comfy-Org's NVIDIA VFX nodes on NVIDIA's RTX Video SDK,
+ // only on an NVIDIA RTX card (frame generation: RTX 40 or later). Listed after each tool's own default so nothing picks
+ // them by default; Upscale → Video offers "Quick · RTX" first on a card that runs it. Nobody hosts them: GPU-only.
+ o({
+ id: RTX_UPSCALE_MODEL,
+ name: "RTX Video Super Resolution",
+ vendor: "NVIDIA",
+ family: "nvidia-rtx-video",
+ kind: "video",
+ tagline: "Fast upscale up to 4x on NVIDIA RTX cards; sharpens without adding new detail",
+ badges: ["fast"],
+ routes: [comfy("upscale-video", RTX_UPSCALE_WORKFLOW, "NVIDIA RTX cards only; in passes, so any length fits, sound kept")],
+ options: {
+ resolutions: VIDEO_UPSCALE_TIERS,
+ controls: [
+ {
+ param: "rtxQuality",
+ label: "Source",
+ values: ["ULTRA", "HIGHBITRATE_ULTRA", "HIGH"],
+ default: "ULTRA",
+ labels: { ULTRA: "Most clips", HIGHBITRATE_ULTRA: "Clean, high quality", HIGH: "Faster" },
+ },
+ ],
+ },
+ defaults: { resolution: "1080p" },
+ }),
+ o({
+ id: RTX_FRAMEGEN_MODEL,
+ name: "RTX Frame Generation",
+ vendor: "NVIDIA",
+ family: "nvidia-rtx-video",
+ kind: "video",
+ tagline: "FPS Boost to 24–120 fps and slow motion on RTX 40 series cards and newer; keeps cuts sharp",
+ badges: ["fast"],
+ routes: [comfy("interpolate", RTX_FRAMEGEN_WORKFLOW, "RTX 40 series cards and newer only; frame rate from the clip's header")],
+ options: {
+ fpsTargets: [...FPS_TARGETS],
+ slowdowns: [...SLOW_MOTION],
+ controls: [
+ {
+ param: "rtxQuality",
+ label: "Quality",
+ values: ["MEDIUM", "HIGH", "LOW"],
+ default: "MEDIUM",
+ labels: { MEDIUM: "Balanced", HIGH: "Best", LOW: "Fastest" },
+ },
+ ],
+ },
+ defaults: { targetFps: DEFAULT_FPS_TARGET },
+ }),
+ o({
+ id: RTX_HDR_MODEL,
+ name: "RTX Video HDR",
+ vendor: "NVIDIA",
+ family: "nvidia-rtx-video",
+ kind: "video",
+ tagline: "SDR footage turned into 10-bit HDR by NVIDIA's learned HDR, on NVIDIA RTX cards: HLG or HDR10 (PQ)",
+ badges: ["fast"],
+ routes: [comfy("sdr-to-hdr", RTX_HDR_WORKFLOW, "NVIDIA RTX cards only; tagged BT.2020 HLG or PQ")],
+ options: { formats: ["hlg_10bit", "pq_10bit"], sliders: [{ param: "peakNits", label: "Peak brightness (nits)", min: 400, max: 2000, step: 50, default: 650 }] },
+ defaults: { format: "hlg_10bit" },
+ }),
o({
id: "oss-export-video",
name: "Pro export",
diff --git a/src/lib/catalog/rtx-video.ts b/src/lib/catalog/rtx-video.ts
new file mode 100644
index 00000000..a0cbb52d
--- /dev/null
+++ b/src/lib/catalog/rtx-video.ts
@@ -0,0 +1,61 @@
+import { offerOn, readCard, cardFits, type GpuNeed } from "@/lib/gpu/rtx";
+
+/**
+ * NVIDIA RTX Video on your GPU (docs/research/new-models-10.md §6, package nm10-rtx-video): Comfy-Org's ComfyUI Nvidia VFX
+ * Nodes on NVIDIA's RTX Video SDK. Three open models: a fast upscale (Upscale → Video's "Quick · RTX"), frame generation
+ * (FPS Boost, RTX 40 series or later) and SDR to HDR. They run only on an NVIDIA RTX card, so nobody hosts them: GPU-only,
+ * never a cloud route, and never picked automatically on a card that isn't one (or one the name doesn't tell).
+ */
+export const RTX_UPSCALE_MODEL = "oss-rtx-video-upscale";
+export const RTX_FRAMEGEN_MODEL = "oss-rtx-frame-generation";
+export const RTX_HDR_MODEL = "oss-rtx-video-hdr";
+
+export { RTX_UPSCALE_WORKFLOW } from "@/lib/av/video-finish";
+export const RTX_FRAMEGEN_WORKFLOW = "fps-rtx-framegen";
+export const RTX_HDR_WORKFLOW = "sdr-to-hdr-rtx";
+
+/** The card each model needs. */
+export const RTX_CARD: Record<string, GpuNeed> = {
+ [RTX_UPSCALE_MODEL]: "nvidia-rtx",
+ [RTX_FRAMEGEN_MODEL]: "nvidia-rtx-40",
+ [RTX_HDR_MODEL]: "nvidia-rtx",
+};
+
+/** The card a model needs, or undefined for any other model. */
+export const rtxCardOf = (modelId: string | undefined): GpuNeed | undefined => (modelId ? RTX_CARD[modelId] : undefined);
+
+/** Visitor-facing words (plain product copy). */
+export const RTX_COPY = {
+ quick: "Quick · RTX",
+ quickHint: "Fast and sharp on your NVIDIA RTX card. Adds no new detail.",
+ /** Under the choice when the card can't run it. */
+ needsCard: "Needs an NVIDIA RTX card",
+ needsCard40: "Needs an NVIDIA RTX 40 series card or newer",
+ /** Under the choice when Fuobe can't tell what the card is. */
+ onRtx: "Runs on NVIDIA RTX cards",
+ /** The line under a picked RTX model. */
+ picked: "Free on your GPU · runs on NVIDIA's RTX video engine, so only on NVIDIA RTX cards.",
+ picked40: "Free on your GPU · runs on NVIDIA's RTX video engine, so only on RTX 40 series cards and newer.",
+};
+
+/** When ComfyUI lacks the nodes: the owner's line names the install switch; a visitor's stays plain. */
+export const RTX_MISSING = {
+ owner: "Your ComfyUI is missing the NVIDIA RTX Video nodes: on a machine with an NVIDIA RTX card, run scripts/comfy/install-comfyui.sh (or RTX_VIDEO=1), then restart ComfyUI.",
+ visitor: "Your ComfyUI doesn't have NVIDIA RTX Video yet. It needs an NVIDIA RTX card; add it with Fuobe's ComfyUI setup, then run this again.",
+};
+
+/** Words for a model's card need. */
+export const needText = (need: GpuNeed): string => (need === "nvidia-rtx-40" ? RTX_COPY.needsCard40 : RTX_COPY.needsCard);
+
+/**
+ * How a choice that needs `need` stands on the viewer's card: "fits" (offer it first), "no" (show it switched off, saying
+ * why) or "unknown" (no card read, or a name that doesn't tell: offer it last; it is never picked for anyone). `gpuName` is
+ * the short name the GPU check reports; `blocked` is the model's own check (its chip says the card can't run it: a CPU, an
+ * Apple, AMD or Intel device, or an older NVIDIA card).
+ */
+export function rtxStanding(need: GpuNeed, gpuName: string | undefined, blocked = false): "fits" | "no" | "unknown" {
+ if (blocked) return "no";
+ if (offerOn(need, gpuName)) return "fits";
+ if (!gpuName) return "unknown";
+ return cardFits(need, readCard(gpuName)) === false ? "no" : "unknown";
+}
diff --git a/src/lib/gpu/plan.ts b/src/lib/gpu/plan.ts
index 9b8b6df2..db7b5b53 100644
--- a/src/lib/gpu/plan.ts
+++ b/src/lib/gpu/plan.ts
@@ -134,6 +134,8 @@ export function fixPlan(t: ToolReadiness, inv: GpuInventory | null, idx: Require
unobservable: t.unobservable,
alternatives: { ...(t.cloud && !o.account && { cloud: t.cloud }), ...(o.fits?.length && { fits: o.fits }) },
...(o.gpu && { gpu: o.gpu }),
+ ...(t.state === "unsupported" && t.reason && { reason: t.reason }),
+ ...(t.gpuNeed && { gpuNeed: t.gpuNeed }),
...(inv?.comfy?.os && { os: inv.comfy.os }),
};
}
diff --git a/src/lib/gpu/readiness.ts b/src/lib/gpu/readiness.ts
index c161883d..cdebf1ea 100644
--- a/src/lib/gpu/readiness.ts
+++ b/src/lib/gpu/readiness.ts
@@ -1,4 +1,5 @@
import { compareVersions, formatBytes, nameKey, splitKey, vramGb } from "./requirements";
+import { cardFits, GPU_NEED_TEXT, readCard, type GpuNeed } from "./rtx";
import type { Badge, FileKey, GpuInventory, IndexFile, InventorySummary, Need, Readiness, RequirementIndex, ToolReadiness, ToolRef, VramFit } from "./types";
/**
@@ -100,6 +101,8 @@ export interface WorkflowReadiness {
unvalidated: boolean;
unobservable: string[];
reason?: string;
+ /** Unsupported because the card isn't the NVIDIA RTX one its nodes need. */
+ gpuNeed?: GpuNeed;
}
/** Whether the ComfyUI runs on its CPU (no device, --cpu, or a device that isn't a graphics card): its "VRAM" is system RAM. */
@@ -108,6 +111,17 @@ const onCpu = (inv: GpuInventory) => {
return !d || !!inv.comfy?.flags.cpuOnly || !(d.type === "cuda" || d.type === "mps" || d.type === "xpu");
};
+/**
+ * Whether this ComfyUI's card runs nodes that need `need` (an NVIDIA RTX card): false on a CPU, an Apple, AMD or Intel
+ * device or a card whose name says it isn't one; undefined when nothing was read or the name doesn't tell (never blocks).
+ */
+export function gpuFits(need: GpuNeed, inv: GpuInventory): boolean | undefined {
+ const d = inv.devices[0];
+ if (inv.comfy?.flags.cpuOnly) return false;
+ if (!d) return undefined;
+ return cardFits(need, readCard(d.name, d.type));
+}
+
/** The graphics card's memory in GB as the check reads it (rounded: vramGb), undefined on a CPU or with no reading. */
export function gpuVramGb(inv: GpuInventory): number | undefined {
return onCpu(inv) ? undefined : vramGb(inv.devices[0]?.vramTotal);
@@ -145,6 +159,9 @@ export function workflowReadiness(id: string, inv: GpuInventory, idx: Requiremen
const out: WorkflowReadiness = { ...base, state: "ready", firstRun: w.firstRun, unvalidated: !w.validated, vram: vramFit(w.vramGb, inv) };
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
+ // tell (no name, a data-centre card) isn't blocked.
+ if (w.gpu && gpuFits(w.gpu, inv) === false) return { ...out, state: "unsupported", reason: GPU_NEED_TEXT[w.gpu], gpuNeed: w.gpu };
if (w.isolated && !ctx.isolatedUrl) {
out.needs.push({ key: "isolated-worker", kind: "isolated-worker", label: "A second ComfyUI (the isolated worker)", detail: "Some add-ons change process-wide settings, so they run on a separate ComfyUI." });
}
@@ -254,7 +271,7 @@ export function toolReadiness(
const have = new Map<string, Need>();
let needGb = 0;
for (const p of parts) {
- if (p.state === "unsupported") return { ...out, state: "unsupported", reason: p.reason, vram: p.vram };
+ if (p.state === "unsupported") return { ...out, state: "unsupported", reason: p.reason, vram: p.vram, ...(p.gpuNeed && { gpuNeed: p.gpuNeed }) };
for (const n of p.needs) if (!needs.has(n.key)) needs.set(n.key, n);
for (const h of p.have) if (!have.has(h.key)) have.set(h.key, h);
needGb = Math.max(needGb, p.vram.needGb);
@@ -279,6 +296,8 @@ export function toolReadiness(
out.have = [...have.values()];
out.downloadBytes = out.needs.filter((n) => n.kind === "model" || n.kind === "model-replace" || n.kind === "lora").reduce((a, n) => a + (n.sizeBytes ?? 0), 0);
out.vram = vramFit(needGb, inv);
+ // A graph that needs an NVIDIA RTX card (no VRAM figure published) never reads "Runs on any computer".
+ if (out.vram.fit === "any" && workflowIds.some((id) => idx.workflows[id]?.gpu)) out.vram = { ...out.vram, fit: "fits" };
out.state = stateOf(out.needs, out.vram.fit);
return out;
}
@@ -287,7 +306,9 @@ export function toolReadiness(
export function badgeOf(t: ToolReadiness): Badge | null {
const code = ({ ready: "r", almost: "a", setup: "s", gpu: "g", unsupported: "u" } as const)[t.state as Exclude<Readiness, "unknown">];
if (!code) return null;
- const flags = (t.vram.fit === "tight" ? 1 : 0) | (t.firstRun.length ? 2 : 0) | (t.vram.fit === "any" ? 4 : 0);
+ // 8: needs an NVIDIA RTX card, 16: an RTX 40 series card or newer (the chip says so instead of "a second ComfyUI").
+ const card = t.state === "unsupported" && t.gpuNeed ? (t.gpuNeed === "nvidia-rtx-40" ? 16 : 8) : 0;
+ const flags = (t.vram.fit === "tight" ? 1 : 0) | (t.firstRun.length ? 2 : 0) | (t.vram.fit === "any" ? 4 : 0) | card;
return [code, stepCount(t.needs), Math.round(t.downloadBytes / 1e8), flags];
}
@@ -315,10 +336,10 @@ export function summaryOf(inv: GpuInventory, idx: RequirementIndex): InventorySu
}
/** The line under a chip or a board row: "1 download · 12.3 GB", "Needs 24 GB", "Ready". */
-export function stateLine(t: Pick<ToolReadiness, "state" | "needs" | "downloadBytes" | "vram">): string {
+export function stateLine(t: Pick<ToolReadiness, "state" | "needs" | "downloadBytes" | "vram" | "gpuNeed">): string {
if (t.state === "ready") return t.vram.fit === "any" ? "Runs on any computer" : t.vram.fit === "tight" ? "Ready · slow on your GPU" : "Ready";
if (t.state === "gpu") return `Needs ${t.vram.needGb} GB`;
- if (t.state === "unsupported") return "Needs a second ComfyUI";
+ if (t.state === "unsupported") return t.gpuNeed ? GPU_NEED_TEXT[t.gpuNeed] : "Needs a second ComfyUI";
if (t.state === "unknown") return "Not checked";
const steps = stepCount(t.needs);
const downloads = t.needs.filter((n) => n.kind === "model" || n.kind === "lora" || n.kind === "model-replace").length;
diff --git a/src/lib/gpu/rtx.ts b/src/lib/gpu/rtx.ts
new file mode 100644
index 00000000..2e8a4d97
--- /dev/null
+++ b/src/lib/gpu/rtx.ts
@@ -0,0 +1,64 @@
+/**
+ * NVIDIA RTX cards, read from the name ComfyUI reports ("cuda:0 NVIDIA GeForce RTX 4070 : cudaMallocAsync", or the short
+ * "RTX 4070" the badges carry). The NVIDIA RTX Video nodes (Comfy-Org's ComfyUI Nvidia VFX Nodes) run only on an NVIDIA RTX
+ * card, and their frame generation only on the RTX 40 series or later. Pure: the server's readiness and the browser's
+ * choosers use the same reading.
+ */
+
+/** What a graph's nodes need of the card (manifest / requirements.json `gpu`). */
+export type GpuNeed = "nvidia-rtx" | "nvidia-rtx-40";
+
+export interface CardReading {
+ /** true: an NVIDIA RTX card; false: certainly not one (a CPU, Apple, AMD, Intel or a GTX card); undefined: can't tell. */
+ rtx: boolean | undefined;
+ /** The RTX generation as a series number (20, 30, 40, 50), when the name says. */
+ series?: number;
+}
+
+/**
+ * Read a card's name. Data-centre cards with no "RTX" in their name (A100, L40S, H100…) can't be told apart by name, so
+ * they read as unknown: they are never blocked and never picked automatically.
+ */
+export function readCard(name: string | undefined, type?: string): CardReading {
+ const n = (name ?? "").replace(/^(cuda|xpu|mps|cpu)(:\d+)?\s+/i, "").trim();
+ if (type && type !== "cuda") return { rtx: false };
+ if (!n) return { rtx: type === undefined ? undefined : false };
+ // ROCm reports its cards as "cuda" devices; Intel and Apple have their own device types.
+ if (/\b(AMD|Radeon|Instinct|Intel|Arc|Apple|M\d( Pro| Max| Ultra)?)\b/i.test(n) || /^cpu$/i.test(n)) return { rtx: false };
+ // NVIDIA's DGX Spark (GB10, Blackwell), which the pack's README lists as supported.
+ if (/\bGB10\b/i.test(n)) return { rtx: true, series: 50 };
+ if (/\bRTX\b/i.test(n)) return { rtx: true, ...seriesOf(n) };
+ // GeForce GTX / older Quadro and Tesla cards have no RTX Video support.
+ if (/\b(GTX|GT \d|Quadro (?!RTX)|Tesla [KMP]\d|TITAN (X|V|Xp))\b/i.test(n)) return { rtx: false };
+ return { rtx: undefined };
+}
+
+function seriesOf(n: string): { series?: number } {
+ // Professional cards by architecture: RTX A-series (Ampere), "Ada Generation", "Blackwell"; Quadro RTX / TITAN RTX (Turing).
+ if (/Blackwell/i.test(n)) return { series: 50 };
+ if (/\bAda\b/i.test(n)) return { series: 40 };
+ if (/\bRTX\s*A\d{3,4}\b/i.test(n)) return { series: 30 };
+ if (/Quadro RTX|TITAN RTX/i.test(n)) return { series: 20 };
+ // GeForce RTX 2060 … 5090 (and laptop parts): the first two digits.
+ const m = /\bRTX\s*(\d{2})\d{2}\b/i.exec(n);
+ if (m) return { series: Number(m[1]) };
+ return {};
+}
+
+/** Whether a card can run nodes that need `need`: true / false, or undefined when its name doesn't say. */
+export function cardFits(need: GpuNeed, card: CardReading): boolean | undefined {
+ if (card.rtx !== true) return card.rtx;
+ if (need === "nvidia-rtx-40") return card.series === undefined ? undefined : card.series >= 40;
+ return true;
+}
+
+/** The plain line a pre-flight row, a chip and a chooser show. */
+export const GPU_NEED_TEXT: Record<GpuNeed, string> = {
+ "nvidia-rtx": "Needs an NVIDIA RTX card",
+ "nvidia-rtx-40": "Needs an NVIDIA RTX 40 series card or newer",
+};
+
+/** Whether to offer (and put first) a choice that needs `need` on this card: only a card known to fit, never a guess. */
+export function offerOn(need: GpuNeed, gpuName: string | undefined): boolean {
+ return !!gpuName && cardFits(need, readCard(gpuName)) === true;
+}
diff --git a/src/lib/gpu/types.ts b/src/lib/gpu/types.ts
index b29fdbf9..b1bbf5b8 100644
--- a/src/lib/gpu/types.ts
+++ b/src/lib/gpu/types.ts
@@ -4,6 +4,8 @@
* (readiness, badges, fix plans). Shared by the server and the browser: no server-only imports.
*/
+import type { GpuNeed } from "./rtx";
+
/** A model file as `folder/file` (the file's base name, never a subfolder). */
export type FileKey = `${string}/${string}`;
@@ -82,6 +84,8 @@ export interface IndexWorkflow {
firstRun: string[];
/** On a graph a real ComfyUI accepted. */
validated?: true;
+ /** The card its nodes need (the NVIDIA RTX Video nodes): checked against the GPU's name. */
+ gpu?: GpuNeed;
}
// ---------------------------------------------------------------------------
@@ -219,8 +223,10 @@ export interface ToolReadiness {
unobservable: string[];
/** The same tool on the cloud engine (never offered to accounts). */
cloud?: { modelId: string };
- /** Why it is unsupported (isolated workflows on an account's GPU). */
+ /** Why it is unsupported (isolated workflows on an account's GPU, a card that isn't an NVIDIA RTX one). */
reason?: string;
+ /** Unsupported because the card isn't the one its nodes need (an NVIDIA RTX card). */
+ gpuNeed?: GpuNeed;
}
export interface InventorySummary {
@@ -319,6 +325,10 @@ export interface FixPlan {
alternatives: { cloud?: { modelId: string }; fits?: { ref: ToolRef; name: string; state: Readiness }[] };
/** The viewer's GPU, for the copy ("Your RTX 4070 has 12 GB"). */
gpu?: string;
+ /** Why it can't run on this ComfyUI (state "unsupported"). */
+ reason?: string;
+ /** Unsupported because it needs an NVIDIA RTX card this one isn't. */
+ gpuNeed?: GpuNeed;
/** ComfyUI's OS ("nt", "posix"): which command tab comes first. */
os?: string;
}
diff --git a/src/server/gpu/gate.ts b/src/server/gpu/gate.ts
index 80cdf5ce..b6ec06bb 100644
--- a/src/server/gpu/gate.ts
+++ b/src/server/gpu/gate.ts
@@ -4,6 +4,7 @@ import { resolveWorkflowId } from "@/lib/comfy-variants";
import { fixPlan } from "@/lib/gpu/plan";
import { CLEAN_VAE, DECODER_PARAM, GPU_PARAM } from "@/lib/qwen21-speed";
import { deviceLabel, needTargets, toolReadiness } from "@/lib/gpu/readiness";
+import { GPU_NEED_TEXT } from "@/lib/gpu/rtx";
import type { FixPlan, ToolReadiness, ToolRef } from "@/lib/gpu/types";
import type { GenerationRequest } from "@/lib/catalog/types";
import { authEnabled, crossSite, hostAllowed, validToken } from "../auth";
@@ -87,7 +88,14 @@ export async function gateGeneration(t: GpuTarget, g: GateInput): Promise<GateRe
}
const dev = snap.inventory.devices[0];
const plan = fixPlan(r, snap.inventory, idx, { hash: sha256, urlHash: urlHash(t), account: ctx.account, loras, gpu: dev ? deviceLabel(dev.name) : undefined });
- const what = r.state === "unsupported" ? "needs a second ComfyUI" : `needs ${r.needs.filter((n) => n.kind !== "hf-licence").length} more thing${r.needs.length > 1 ? "s" : ""} on your ComfyUI`;
+ const what =
+ r.state === "unsupported"
+ ? r.gpuNeed
+ ? GPU_NEED_TEXT[r.gpuNeed].replace(/^Needs/, "needs")
+ : "needs a second ComfyUI"
+ : `needs ${r.needs.filter((n) => n.kind !== "hf-licence").length} more thing${r.needs.length > 1 ? "s" : ""} on your ComfyUI`;
+ // A card that can't run it: no setup step helps, so the run stops even on the install's own ComfyUI.
+ if (r.gpuNeed) return { ok: false, ref, plan, message: `${name} ${what}. Pick another choice for this tool.` };
if (t.key === "install") return { ok: true, warning: `${name} ${what}. Open Connect your GPU to see them.` };
return { ok: false, ref, plan, message: `${name} ${what} before it can run.` };
}
diff --git a/src/server/gpu/tools.ts b/src/server/gpu/tools.ts
index b4f9e5a1..9317f10b 100644
--- a/src/server/gpu/tools.ts
+++ b/src/server/gpu/tools.ts
@@ -11,6 +11,7 @@ import { FRAMES_MODELS } from "@/lib/catalog/keyframes";
import { REMOVE_TOOLS } from "@/lib/catalog/remove-object";
import { RESTORE, RESTORE_OPEN_JOIN } from "@/lib/catalog/restore";
import { REGEN_DEFAULT_TIER, REGEN_JOIN, REGEN_MODEL, regenerateGraphLoras } from "@/lib/catalog/regenerate";
+import { RTX_FRAMEGEN_MODEL, RTX_HDR_MODEL, RTX_UPSCALE_MODEL } from "@/lib/catalog/rtx-video";
import { libraryEntry, loraEntry, loraRef, needsToken } from "@/lib/catalog/loras";
import { ANGLES_2511_LORA } from "@/lib/catalog/open-tools";
import { presetRoutes, recipeRoute } from "@/lib/catalog/preset-recipes";
@@ -252,8 +253,13 @@ export const STUDIO_ROWS: StudioRowDef[] = [
{ modelId: REGEN_JOIN, op: "concat" },
],
},
+ // nm10-rtx-video: NVIDIA RTX Video in Upscale → Video ("Quick · RTX"), FPS boost and SDR to HDR. An NVIDIA RTX card only
+ // (frame generation: RTX 40 or later): elsewhere the row reads "Needs an NVIDIA RTX card".
+ { href: `/upscale/video?model=${RTX_UPSCALE_MODEL}`, label: "Quick upscale · RTX", group: "Video tools", steps: [{ modelId: RTX_UPSCALE_MODEL, op: "upscale-video" }] },
{ href: "/upscale/fps", label: "FPS boost", group: "Video tools", config: S.FPS_BOOST_STUDIO },
+ { href: `/upscale/fps?model=${RTX_FRAMEGEN_MODEL}`, label: "FPS boost · RTX", group: "Video tools", steps: [{ modelId: RTX_FRAMEGEN_MODEL, op: "interpolate" }] },
{ href: "/upscale/hdr", label: "SDR to HDR", group: "Video tools", config: S.SDR_TO_HDR_STUDIO },
+ { href: `/upscale/hdr?model=${RTX_HDR_MODEL}`, label: "SDR to HDR · RTX", group: "Video tools", steps: [{ modelId: RTX_HDR_MODEL, op: "sdr-to-hdr" }] },
{ href: "/upscale/export", label: "Export", group: "Video tools", config: S.VIDEO_EXPORT_STUDIO },
{ href: "/video-tools", label: "Remove background", group: "Video tools", config: S.VIDEO_MATTE_STUDIO },
// DBS D2: the split, then the stream-copy mux (one stem in place of the sound, or the voice over the lowered bed).
diff --git a/src/server/providers/comfyui.ts b/src/server/providers/comfyui.ts
index d9134c40..9d8d8a5c 100644
--- a/src/server/providers/comfyui.ts
+++ b/src/server/providers/comfyui.ts
@@ -53,7 +53,8 @@ import { dbsChannelsFor, dbsModelFor, dbsSurroundBed, installedDbs, surroundSour
import { installedReuse, NO_REUSE_PACK, rateFor, reuseFileFor, STRENGTH_DB, type ReuseModel } from "@/lib/av/clean-voice";
import { expandAudioJoinWorkflow, expandVideoJoinWorkflow } from "@/lib/av/joins";
import { expandTimelineWorkflow, readTimeline } from "@/lib/av/timeline";
-import { exportValues, framesPerPass, hdrColorSpace, upscaleShortSide, wholeClipProblem, wholeClipTool } from "@/lib/av/video-finish";
+import { RTX_FRAMEGEN_WORKFLOW, RTX_HDR_WORKFLOW, RTX_MISSING } from "@/lib/catalog/rtx-video";
+import { exportValues, framesPerPass, hdrColorSpace, RTX_UPSCALE_WORKFLOW, rtxScale, upscaleShortSide, wholeClipProblem, wholeClipTool } from "@/lib/av/video-finish";
import { guessKind } from "@/lib/catalog/payload";
import { loraByFile, needsToken } from "@/lib/catalog/loras";
import { CHARACTER_SWAP, packResolution, samCoords, swapPrompt, SWAP_LORAS, windowPlan } from "@/lib/catalog/character-swap";
@@ -1146,8 +1147,11 @@ function videoFinishValues(manifest: ManifestWorkflow, input: GenInput, clip: Me
values.shortSide = shortSide;
if (b.framesPerBatch && extra.framesPerBatch === undefined) {
const seedvr = /seedvr/i.test(manifest.id);
+ // RTX Video Super Resolution writes the scaled frame itself (1-4x, the graph's own factor), not a fixed 4x one.
+ const rtx = manifest.id === RTX_UPSCALE_WORKFLOW;
+ const modelScale = seedvr ? 0 : rtx ? rtxScale(facts, shortSide) : 4;
// ESRGAN on a big source (1440p → 2160p: about 0.85 GB a frame): down to one frame a pass, to stay near the budget.
- values.framesPerBatch = framesPerPass(facts, { shortSide, modelScale: seedvr ? 0 : 4, fourNPlusOne: seedvr, min: seedvr ? 5 : 1, max: seedvr ? 33 : 64, fallback: Number(d.framesPerBatch ?? 16) });
+ values.framesPerBatch = framesPerPass(facts, { shortSide, modelScale, fourNPlusOne: seedvr, min: seedvr ? 5 : 1, max: seedvr ? 33 : 64, fallback: Number(d.framesPerBatch ?? 16) });
}
} else if (b.framesPerBatch && manifest.capability === "export-video" && extra.framesPerBatch === undefined) {
values.framesPerBatch = framesPerPass(facts, { min: 8, max: 256, fallback: Number(d.framesPerBatch ?? 64) });
@@ -1749,7 +1753,7 @@ export async function prepareWorkflow(endpointTemplate: string, input: GenInput,
if (restore) wf = restoreGraph(wf, restore, outputIds);
// FPS Boost to a lower rate, or one the clip divides into: no interpolation, only every n-th frame.
if (finish.bypassInterpolation) {
- const id = Object.keys(wf).find((k) => wf[k].class_type === "FrameInterpolate");
+ const id = Object.keys(wf).find((k) => wf[k].class_type === "FrameInterpolate" || wf[k].class_type === "RTXVideoFrameGeneration");
if (id) wf = bypassNode(wf, id, "images", outputIds);
}
if (surroundSource(sourceChannels)) wf = dbsSurroundBed(wf);
@@ -1867,6 +1871,10 @@ export function promptRefusal(body: PromptRefusalBody, status: number, manifest:
? ownGpu()
? REGEN_COPY.missingVisitor
: REGEN_COPY.missing
+ : body.error?.type === "missing_node_type" && RTX_WORKFLOWS.has(manifest.id) && worker === "main"
+ ? ownGpu()
+ ? RTX_MISSING.visitor
+ : RTX_MISSING.owner
: body.error?.type === "missing_node_type" && packs.length
? `This workflow needs the ${packs.join(" + ")} node pack${packs.length > 1 ? "s" : ""} on ${where} (see scripts/comfy/README.md)`
: undefined;
@@ -1879,6 +1887,9 @@ export function promptRefusal(body: PromptRefusalBody, status: number, manifest:
return { message: detail, ...(fix && { fix }) };
}
+/** The NVIDIA RTX Video graphs (their pack is installed only on an NVIDIA RTX host). */
+const RTX_WORKFLOWS: ReadonlySet<string> = new Set([RTX_UPSCALE_WORKFLOW, RTX_FRAMEGEN_WORKFLOW, RTX_HDR_WORKFLOW]);
+
/** Friendlier words for errors that a workflow's nodes report in their own terms. */
function explainExecutionError(err: { exception_message?: string; node_type?: string } | undefined, manifest?: ManifestWorkflow): string {
if (!err) return "Execution error";
diff --git a/tests/rtx-video.test.ts b/tests/rtx-video.test.ts
new file mode 100644
index 00000000..c5adaa28
--- /dev/null
+++ b/tests/rtx-video.test.ts
@@ -0,0 +1,391 @@
+import fs from "node:fs";
+import os from "node:os";
+import path from "node:path";
+import { describe, expect, it } from "vitest";
+import type { GenInput } from "@/lib/catalog/types";
+import type { MediaInfo } from "@/lib/media-probe";
+import type { GpuInventory, RequirementIndex } from "@/lib/gpu/types";
+
+// NVIDIA RTX Video (package nm10-rtx-video): the three graphs against the pack's own node definitions, the chunk sizes, the
+// frame counts and the HDR colour tags, the card check of the GPU pre-flight, and where the choices show up (never picked
+// on a card that can't run them, never on the cloud).
+const dir = fs.mkdtempSync(path.join(os.tmpdir(), "fuobe-rtx-"));
+process.env.FUOBE_DATA_DIR = dir;
+process.env.COMFYUI_URL = "http://127.0.0.1:9";
+delete process.env.FUOBE_PASSWORD;
+
+const RTX = await import("@/lib/catalog/rtx-video");
+const { readCard, cardFits, offerOn, GPU_NEED_TEXT } = await import("@/lib/gpu/rtx");
+const { badgeOf, stateLine, toolReadiness, workflowReadiness } = await import("@/lib/gpu/readiness");
+const { parseIndex } = await import("@/lib/gpu/requirements");
+const { emptyInventory } = await import("@/lib/gpu/gather");
+const { parseArgv } = await import("@/lib/gpu/argv");
+const { badgeText } = await import("@/hooks/use-gpu");
+const { fpsFrames } = await import("@/lib/av/fps");
+const { framesPerPass, rtxFrameGenFrames, rtxOutputSize, rtxScale, PASS_BUDGET } = await import("@/lib/av/video-finish");
+const { getModel, getPreset, MODELS } = await import("@/lib/catalog");
+const { planGeneration: planWith } = await import("@/lib/catalog/plan");
+const planGeneration = (r: Parameters<typeof planWith>[0]) => planWith(r, getModel, getPreset);
+const { runsOn } = await import("@/lib/catalog/engines");
+const canvas = await import("@/lib/catalog/canvas");
+const studios = await import("@/lib/studios");
+const { NODE_PACKS, licenceInfo, workflowLicence } = await import("@/lib/licences");
+const { prepareWorkflow, getWorkflow, promptRefusal } = await import("@/server/providers/comfyui");
+const { STUDIO_ROWS, studioTool } = await import("@/server/gpu/tools");
+
+const ROOT = path.resolve(__dirname, "..");
+const read = (f: string) => JSON.parse(fs.readFileSync(path.join(ROOT, f), "utf8"));
+type Graph = Record<string, { class_type: string; inputs: Record<string, unknown> }>;
+const graphOf = (id: string) => read(`workflows/comfyui/${id}.json`) as Graph;
+const manifest = read("workflows/comfyui/manifest.json") as { workflows: { id: string; gpu?: string; customNodes: { name: string }[]; bindings: Record<string, { node: string; input: string }[]>; defaults: Record<string, unknown>; validated: boolean }[] };
+const entry = (id: string) => manifest.workflows.find((w) => w.id === id)!;
+const idx: RequirementIndex = parseIndex(read("workflows/comfyui/requirements.json"));
+const PACK = "ComfyUI_Nvidia_VFX_Nodes";
+
+/**
+ * The pack's node definitions at 38d790d (define_schema in __init__.py): every input with its options, and the keys a
+ * DynamicCombo's nested input takes in an API prompt ("resize_type.scale").
+ */
+const SCHEMA: Record<string, Record<string, readonly (string | number | boolean)[] | "IMAGE" | "FLOAT" | "INT" | "BOOLEAN">> = {
+ RTXVideoSuperResolution: {
+ images: "IMAGE",
+ resize_type: ["scale by multiplier", "target dimensions"],
+ "resize_type.scale": "FLOAT",
+ quality: [
+ "BICUBIC", "LOW", "MEDIUM", "HIGH", "ULTRA", "DENOISE_LOW", "DENOISE_MEDIUM", "DENOISE_HIGH", "DENOISE_ULTRA", "DEBLUR_LOW", "DEBLUR_MEDIUM", "DEBLUR_HIGH",
+ "DEBLUR_ULTRA", "HIGHBITRATE_LOW", "HIGHBITRATE_MEDIUM", "HIGHBITRATE_HIGH", "HIGHBITRATE_ULTRA", "STREAMING_MEDIUM", "STREAMING_ULTRA",
+ ],
+ strength: "FLOAT",
+ image_encoding: ["8-bit RGB", "10-bit RGB (RGB10A2)"],
+ },
+ RTXVideoFrameGeneration: {
+ images: "IMAGE",
+ generation_type: ["frame rate multiplier", "specific timestep"],
+ "generation_type.multiplier": "INT",
+ mode: ["LOW", "MEDIUM", "HIGH"],
+ automatic_shot_change_detection: "BOOLEAN",
+ shot_change: "BOOLEAN",
+ image_encoding: ["8-bit RGB", "10-bit RGB (RGB10A2)"],
+ },
+ RTXTrueHDR: {
+ images: "IMAGE",
+ contrast: "INT",
+ saturation: "INT",
+ middle_gray: "INT",
+ luminance: "INT",
+ debanding: "BOOLEAN",
+ output_colorspace: ["HDR", "HDR PQ"],
+ },
+};
+
+describe("the graphs against the pack's node definitions", () => {
+ const isLink = (v: unknown) => Array.isArray(v) && v.length === 2 && typeof v[0] === "string";
+ it.each([RTX.RTX_UPSCALE_WORKFLOW, RTX.RTX_FRAMEGEN_WORKFLOW, RTX.RTX_HDR_WORKFLOW])("%s sets only the pack's inputs, with values it takes", (id) => {
+ const g = graphOf(id);
+ const nodes = Object.values(g).filter((n) => n.class_type in SCHEMA);
+ expect(nodes).toHaveLength(1);
+ for (const n of nodes) {
+ const schema = SCHEMA[n.class_type];
+ // Every input the node needs is there (the DynamicCombo's nested one for the option picked), and nothing else.
+ expect(Object.keys(n.inputs).sort()).toEqual(Object.keys(schema).sort());
+ for (const [input, v] of Object.entries(n.inputs)) {
+ const s = schema[input];
+ if (isLink(v)) continue;
+ if (Array.isArray(s)) expect(s, `${n.class_type}.${input}`).toContain(v);
+ else if (s === "BOOLEAN") expect(typeof v).toBe("boolean");
+ else expect(typeof v, `${n.class_type}.${input}`).toBe("number");
+ }
+ }
+ });
+
+ it("names the pack, the card and no model files; listed as not validated here", () => {
+ for (const [id, gpu] of [
+ [RTX.RTX_UPSCALE_WORKFLOW, "nvidia-rtx"],
+ [RTX.RTX_FRAMEGEN_WORKFLOW, "nvidia-rtx-40"],
+ [RTX.RTX_HDR_WORKFLOW, "nvidia-rtx"],
+ ] as const) {
+ const w = entry(id);
+ expect(w.gpu).toBe(gpu);
+ expect(w.customNodes.map((c) => c.name)).toContain(PACK);
+ expect(w.validated).toBe(false);
+ expect(idx.workflows[id].gpu).toBe(gpu);
+ expect(idx.workflows[id].files).toEqual([]);
+ expect(idx.workflows[id].packs[PACK].length).toBe(1);
+ }
+ expect(idx.packs[PACK]).toMatchObject({ commit: "38d790ded00650681fa3645362efe28c8560cf40", requirementsTxt: true, registry: { id: "comfyui_nvidia_rtx_nodes" } });
+ expect(idx.packs[PACK].classes).toEqual(["RTXTrueHDR", "RTXVideoFrameGeneration", "RTXVideoSuperResolution"]);
+ });
+
+ it("the installer adds the pack only on an NVIDIA RTX host, at the pinned commit with the runtime", () => {
+ const sh = fs.readFileSync(path.join(ROOT, "scripts/comfy/install-comfyui.sh"), "utf8");
+ expect(sh).toContain('RTX_VIDEO_REF="${RTX_VIDEO_REF:-38d790ded00650681fa3645362efe28c8560cf40}"');
+ expect(sh).toMatch(/nvidia-smi --query-gpu=name --format=csv,noheader .*grep -i -m1 -E 'RTX\|GB10'/);
+ expect(sh).toContain('"nvidia-vfx==0.2.0.0"');
+ expect(sh).toContain('"${RTX_VIDEO:-auto}" = "auto" ] && [ -n "$rtx_card" ]');
+ });
+});
+
+describe("upscale in passes", () => {
+ it("scales by the shorter edge asked for, 1-4x, and lands exactly on it", () => {
+ const g = graphOf(RTX.RTX_UPSCALE_WORKFLOW);
+ expect(g["5"].inputs.expression).toBe("min(4, max(1, a / min(b, c)))");
+ expect(g["6"].inputs["resize_type.scale"]).toEqual(["5", 0]);
+ expect(g["7"].inputs).toMatchObject({ input: ["6", 0], resize_type: "scale shorter dimension", "resize_type.shorter_size": ["4", 0] });
+ // The source's sound and frame rate, one encode across the passes.
+ expect(g["8"].inputs).toMatchObject({ audio: ["1", 2], frame_rate: ["3", 5], meta_batch: ["2", 0] });
+ expect(rtxScale({ width: 640, height: 360 }, 1080)).toBe(3);
+ expect(rtxScale({ width: 320, height: 180 }, 2160)).toBe(4);
+ expect(rtxScale({ width: 1920, height: 1080 }, 720)).toBe(1);
+ expect(rtxScale({}, 1080)).toBe(4);
+ // The pack rounds the node's output to multiples of 8 (1280x720 x 1.5 = 1920x1080; 854x480 x 2.25 = 1920x1080).
+ expect(rtxOutputSize(1280, 720, 1.5)).toEqual({ width: 1920, height: 1080 });
+ expect(rtxOutputSize(854, 480, 2.25)).toEqual({ width: 1920, height: 1080 });
+ });
+
+ it("sizes a pass so its frames stay near the budget", () => {
+ const facts = { width: 640, height: 360 };
+ const rtx = framesPerPass(facts, { shortSide: 1080, modelScale: rtxScale(facts, 1080), min: 1, max: 64, fallback: 16 });
+ const esrgan = framesPerPass(facts, { shortSide: 1080, modelScale: 4, min: 1, max: 64, fallback: 16 });
+ // RTX writes the frame at 3x, not ESRGAN's fixed 4x, so a pass holds more frames.
+ expect(rtx).toBeGreaterThan(esrgan);
+ expect(12 * 640 * 360 * (1 + 9 + 9) * rtx).toBeLessThanOrEqual(PASS_BUDGET);
+ expect(framesPerPass({}, { shortSide: 1080, modelScale: 4, fallback: 16 })).toBe(16);
+ });
+
+ it("the provider fills the short side, the pass size and the quality", async () => {
+ const { workflow } = await prepareWorkflow(
+ RTX.RTX_UPSCALE_WORKFLOW,
+ { video: "clip.mp4", resolution: "2160p", extra: { rtxQuality: "HIGHBITRATE_ULTRA" } } as GenInput,
+ { generationId: "g1", op: "upscale-video", upload: async (_d, _t, n) => n, media: () => clip(1280, 720, 4) },
+ );
+ expect(workflow["4"].inputs.value).toBe(2160);
+ expect(workflow["6"].inputs.quality).toBe("HIGHBITRATE_ULTRA");
+ expect(workflow["2"].inputs.frames_per_batch).toBe(framesPerPass({ width: 1280, height: 720 }, { shortSide: 2160, modelScale: 3, min: 1, max: 64, fallback: 16 }));
+ });
+});
+
+const clip = (w: number, h: number, seconds: number, fps = 24): MediaInfo => ({
+ container: "mp4",
+ hasVideo: true,
+ hasAudio: true,
+ duration: seconds,
+ videoDuration: seconds,
+ width: w,
+ height: h,
+ fps,
+ frames: Math.round(seconds * fps),
+});
+
+describe("frame generation", () => {
+ it("returns (N - 1) x m + 1 frames, and a clip's N frames become N x m + 1 with the last held", () => {
+ expect(rtxFrameGenFrames(48, 2)).toBe(95);
+ expect(rtxFrameGenFrames(25, 5)).toBe(121);
+ expect(rtxFrameGenFrames(1, 4)).toBe(1);
+ // The graph holds the last frame once more, so it writes what RIFE's graph writes.
+ for (const [n, m] of [[48, 5], [60, 2], [73, 16]]) expect(rtxFrameGenFrames(n + 1, m)).toBe(fpsFrames(n, { multiplier: m, every: 1 }));
+ const g = graphOf(RTX.RTX_FRAMEGEN_WORKFLOW);
+ expect(g["4"].inputs).toEqual({ image1: ["2", 0], image2: ["3", 0] });
+ expect(g["7"].inputs).toMatchObject({ images: ["4", 0], generation_type: "frame rate multiplier", "generation_type.multiplier": ["6", 0], automatic_shot_change_detection: true, shot_change: false });
+ });
+
+ it("picks m and n from the clip's rate, and links the node out when no frame needs making", async () => {
+ const run = (target: number, fps: number) =>
+ prepareWorkflow(RTX.RTX_FRAMEGEN_WORKFLOW, { video: "clip.mp4", targetFps: target } as GenInput, {
+ generationId: "g2",
+ op: "interpolate",
+ upload: async (_d, _t, n) => n,
+ media: () => clip(320, 180, 2, fps),
+ });
+ const up = (await run(60, 24)).workflow;
+ expect([up["6"].inputs.value, up["8"].inputs.value]).toEqual([5, 2]);
+ expect(up["7"]?.class_type).toBe("RTXVideoFrameGeneration");
+ const down = (await run(30, 60)).workflow;
+ expect(down["6"].inputs.value).toBe(1);
+ expect(down["7"]).toBeUndefined();
+ expect(down["9"].inputs.images).toEqual(["4", 0]);
+ });
+});
+
+describe("HDR colour tags", () => {
+ const run = (format: string, peak?: number) =>
+ prepareWorkflow(RTX.RTX_HDR_WORKFLOW, { video: "clip.mp4", format, ...(peak && { extra: { peakNits: peak } }) } as GenInput, {
+ generationId: "g3",
+ op: "sdr-to-hdr",
+ upload: async (_d, _t, n) => n,
+ media: () => clip(320, 180, 2),
+ });
+
+ it("the node's output and the encoder's tags always say the same transfer", async () => {
+ const hlg = (await run("hlg_10bit")).workflow;
+ expect([hlg["3"].inputs.output_colorspace, hlg["4"].inputs.color_space, hlg["4"].inputs.bit_depth]).toEqual(["HDR", "HDR", 10]);
+ const pq = (await run("pq_10bit", 1000)).workflow;
+ expect([pq["3"].inputs.output_colorspace, pq["4"].inputs.color_space]).toEqual(["HDR PQ", "HDR PQ"]);
+ expect(pq["3"].inputs.luminance).toBe(1000);
+ // CreateVideo takes exactly the node's two colour spaces (core ComfyUI's options at the pinned version).
+ const subset = read("workflows/comfyui/object_info.subset.json");
+ expect(subset.CreateVideo.input.optional.color_space[1].options).toEqual(expect.arrayContaining(SCHEMA.RTXTrueHDR.output_colorspace as string[]));
+ expect(entry(RTX.RTX_HDR_WORKFLOW).bindings.colorSpace).toEqual([
+ { node: "3", input: "output_colorspace" },
+ { node: "4", input: "color_space" },
+ ]);
+ });
+
+ it("EXR frames stay with the other SDR to HDR graph", () => {
+ expect(() => planGeneration({ modelId: RTX.RTX_HDR_MODEL, operation: "sdr-to-hdr", prompt: "", params: { format: "exr" }, inputs: { video: "/x.mp4" } } as never)).toThrow(/HLG|HDR10|PQ/);
+ });
+});
+
+describe("the card check", () => {
+ it("reads RTX cards and their series from the names ComfyUI reports", () => {
+ expect(readCard("cuda:0 NVIDIA GeForce RTX 4070 : cudaMallocAsync")).toEqual({ rtx: true, series: 40 });
+ expect(readCard("RTX 5090")).toEqual({ rtx: true, series: 50 });
+ expect(readCard("NVIDIA GeForce RTX 3060 Laptop GPU")).toEqual({ rtx: true, series: 30 });
+ expect(readCard("NVIDIA GeForce RTX 2080 Ti")).toEqual({ rtx: true, series: 20 });
+ expect(readCard("NVIDIA RTX A6000")).toEqual({ rtx: true, series: 30 });
+ expect(readCard("NVIDIA RTX 6000 Ada Generation")).toEqual({ rtx: true, series: 40 });
+ expect(readCard("NVIDIA RTX PRO 6000 Blackwell Workstation Edition")).toEqual({ rtx: true, series: 50 });
+ expect(readCard("Quadro RTX 8000")).toEqual({ rtx: true, series: 20 });
+ expect(readCard("NVIDIA GB10")).toEqual({ rtx: true, series: 50 });
+ expect(readCard("NVIDIA GeForce GTX 1080 Ti").rtx).toBe(false);
+ expect(readCard("cuda:0 AMD Radeon RX 7900 XTX : native").rtx).toBe(false);
+ expect(readCard("mps", "mps").rtx).toBe(false);
+ expect(readCard("cpu", "cpu").rtx).toBe(false);
+ // A data-centre card's name doesn't say: never blocked, never picked.
+ expect(readCard("NVIDIA A100-SXM4-80GB").rtx).toBeUndefined();
+ expect(readCard("NVIDIA H100 80GB HBM3").rtx).toBeUndefined();
+ expect(readCard(undefined).rtx).toBeUndefined();
+ expect(cardFits("nvidia-rtx-40", readCard("RTX 3090"))).toBe(false);
+ expect(cardFits("nvidia-rtx-40", readCard("RTX 4060"))).toBe(true);
+ expect(cardFits("nvidia-rtx", readCard("RTX 3090"))).toBe(true);
+ expect(offerOn("nvidia-rtx", undefined)).toBe(false);
+ expect(offerOn("nvidia-rtx", "H100 80GB HBM3")).toBe(false);
+ });
+
+ const GB = 2 ** 30;
+ function inventory(device: { name: string; type: string } | null, o: { cpuOnly?: boolean } = {}): GpuInventory {
+ const inv = emptyInventory("server", 1);
+ inv.reachable = true;
+ inv.comfy = { version: "0.42.1", os: "posix", embeddedPython: false, deployEnv: "local-git", flags: parseArgv(o.cpuOnly ? ["main.py", "--cpu"] : ["main.py"]) };
+ inv.devices = device ? [{ ...device, index: 0, vramTotal: 16 * GB, vramFree: 0 }] : [];
+ inv.manager = { api: "none" };
+ const all = new Set(Object.values(idx.workflows).flatMap((w) => [...w.core, ...Object.values(w.packs).flat()]));
+ inv.nodes = { have: [...all], missing: [], total: all.size, readAt: 1, how: "object_info" };
+ for (const folder of idx.folders) inv.models[folder] = { have: {}, total: 0 };
+ return inv;
+ }
+ const ctx = { account: false };
+ const rtx4070 = { name: "cuda:0 NVIDIA GeForce RTX 4070 : cudaMallocAsync", type: "cuda" };
+ const rtx3090 = { name: "cuda:0 NVIDIA GeForce RTX 3090 : cudaMallocAsync", type: "cuda" };
+
+ it("the pre-flight says 'Needs an NVIDIA RTX card' on a CPU, AMD or GTX card, and RTX 40+ for frame generation", () => {
+ const at = (id: string, inv: GpuInventory) => workflowReadiness(id, inv, idx, ctx);
+ expect(at(RTX.RTX_UPSCALE_WORKFLOW, inventory(rtx4070)).state).toBe("ready");
+ expect(at(RTX.RTX_FRAMEGEN_WORKFLOW, inventory(rtx4070)).state).toBe("ready");
+ expect(at(RTX.RTX_HDR_WORKFLOW, inventory(rtx3090)).state).toBe("ready");
+ expect(at(RTX.RTX_FRAMEGEN_WORKFLOW, inventory(rtx3090))).toMatchObject({ state: "unsupported", reason: "Needs an NVIDIA RTX 40 series card or newer", gpuNeed: "nvidia-rtx-40" });
+ for (const inv of [
+ inventory({ name: "cpu", type: "cpu" }),
+ inventory(rtx4070, { cpuOnly: true }),
+ inventory({ name: "cuda:0 AMD Radeon RX 7900 XTX : native", type: "cuda" }),
+ inventory({ name: "cuda:0 NVIDIA GeForce GTX 1080 : cudaMallocAsync", type: "cuda" }),
+ inventory({ name: "mps", type: "mps" }),
+ ]) {
+ expect(at(RTX.RTX_UPSCALE_WORKFLOW, inv)).toMatchObject({ state: "unsupported", reason: GPU_NEED_TEXT["nvidia-rtx"] });
+ }
+ // Not read, or a name that doesn't say: never blocked.
+ expect(at(RTX.RTX_UPSCALE_WORKFLOW, inventory(null)).state).not.toBe("unsupported");
+ expect(at(RTX.RTX_UPSCALE_WORKFLOW, inventory({ name: "cuda:0 NVIDIA H100 80GB HBM3 : cudaMallocAsync", type: "cuda" })).state).toBe("ready");
+ // Other graphs don't care about the card's make.
+ expect(at("upscale-video-esrgan-chunked", inventory({ name: "cpu", type: "cpu" })).state).not.toBe("unsupported");
+ });
+
+ it("the chip, the board line and the tool all say why", () => {
+ const tool = (inv: GpuInventory, id = RTX.RTX_UPSCALE_WORKFLOW) => toolReadiness("model:x#upscale-video", "RTX", [id], [], inv, idx, ctx);
+ const amd = tool(inventory({ name: "cuda:0 AMD Radeon RX 7900 XTX : native", type: "cuda" }));
+ expect(amd.gpuNeed).toBe("nvidia-rtx");
+ expect(stateLine(amd)).toBe("Needs an NVIDIA RTX card");
+ const chip = badgeOf(amd)!;
+ expect(chip[0]).toBe("u");
+ expect(badgeText(chip)).toEqual({ short: "RTX only", long: "Needs an NVIDIA RTX card" });
+ const old = badgeOf(tool(inventory(rtx3090), RTX.RTX_FRAMEGEN_WORKFLOW))!;
+ expect(badgeText(old).long).toBe("Needs an NVIDIA RTX 40 series card or newer");
+ // On an RTX card it's ready, and never "Runs on any computer".
+ const ok = tool(inventory(rtx4070));
+ expect(ok.state).toBe("ready");
+ expect(stateLine(ok)).toBe("Ready");
+ expect(badgeOf(ok)![3] & 4).toBe(0);
+ });
+
+ it("a choice is offered first only on a card known to run it", () => {
+ expect(RTX.rtxStanding("nvidia-rtx", "RTX 4070")).toBe("fits");
+ expect(RTX.rtxStanding("nvidia-rtx-40", "RTX 3080")).toBe("no");
+ expect(RTX.rtxStanding("nvidia-rtx", "GTX 1660")).toBe("no");
+ expect(RTX.rtxStanding("nvidia-rtx", undefined)).toBe("unknown");
+ expect(RTX.rtxStanding("nvidia-rtx", "H100 80GB HBM3")).toBe("unknown");
+ // A CPU or Apple ComfyUI reports no card name: the model's own chip says it can't run there.
+ expect(RTX.rtxStanding("nvidia-rtx", undefined, true)).toBe("no");
+ });
+});
+
+describe("where the choices show up", () => {
+ const ids = [RTX.RTX_UPSCALE_MODEL, RTX.RTX_FRAMEGEN_MODEL, RTX.RTX_HDR_MODEL];
+
+ it("open-engine models only: nobody hosts NVIDIA's SDK", () => {
+ for (const id of ids) {
+ const m = getModel(id)!;
+ expect(m.engine).toBe("open");
+ expect(runsOn(m, "cloud")).toBe(false);
+ expect(m.routes.every((r) => r.provider === "comfyui")).toBe(true);
+ expect(m.tagline).toMatch(/RTX/);
+ }
+ expect(getModel(RTX.RTX_UPSCALE_MODEL)!.routes[0]).toMatchObject({ op: "upscale-video", endpoint: RTX.RTX_UPSCALE_WORKFLOW });
+ expect(getModel(RTX.RTX_FRAMEGEN_MODEL)!.routes[0]).toMatchObject({ op: "interpolate", endpoint: RTX.RTX_FRAMEGEN_WORKFLOW });
+ expect(getModel(RTX.RTX_HDR_MODEL)!.routes[0]).toMatchObject({ op: "sdr-to-hdr", endpoint: RTX.RTX_HDR_WORKFLOW });
+ expect(getWorkflow(RTX.RTX_HDR_WORKFLOW).manifest.capability).toBe("sdr-to-hdr");
+ });
+
+ it("keeps today's defaults, and no default pick lands on them", () => {
+ expect(studios.VIDEO_UPSCALE_STUDIO.defaultModels.open).toBe("oss-seedvr2");
+ expect(studios.FPS_BOOST_STUDIO.defaultModels.open).toBe("oss-rife");
+ expect(studios.SDR_TO_HDR_STUDIO.defaultModels.open).toBe("oss-sdr-to-hdr");
+ for (const op of ["upscale-video", "interpolate", "sdr-to-hdr"] as const) expect(ids).not.toContain(canvas.defaultModelFor(op, "open")?.id);
+ // Listed after each tool's own models.
+ const at = (id: string) => MODELS.findIndex((m) => m.id === id);
+ expect(at(RTX.RTX_UPSCALE_MODEL)).toBeGreaterThan(at("oss-upscale-video-esrgan"));
+ expect(at(RTX.RTX_FRAMEGEN_MODEL)).toBeGreaterThan(at("oss-rife"));
+ expect(at(RTX.RTX_HDR_MODEL)).toBeGreaterThan(at("oss-sdr-to-hdr"));
+ });
+
+ it("the board has a row for each, and the Canvas Upscale node an RTX entry with no cloud stand-in", () => {
+ for (const [href, id] of [
+ [`/upscale/video?model=${RTX.RTX_UPSCALE_MODEL}`, RTX.RTX_UPSCALE_WORKFLOW],
+ [`/upscale/fps?model=${RTX.RTX_FRAMEGEN_MODEL}`, RTX.RTX_FRAMEGEN_WORKFLOW],
+ [`/upscale/hdr?model=${RTX.RTX_HDR_MODEL}`, RTX.RTX_HDR_WORKFLOW],
+ ]) {
+ const row = STUDIO_ROWS.find((r) => r.href === href)!;
+ expect(row.group).toBe("Video tools");
+ expect(studioTool(row)!.workflows).toEqual([id]);
+ }
+ const item = canvas.paletteItems("both", "open").find((p) => p.id === "upscale-rtx")!;
+ expect(item.data).toMatchObject({ mediaKind: "video", modelId: RTX.RTX_UPSCALE_MODEL });
+ expect(item.disabled).toBeUndefined();
+ expect(canvas.paletteItems("both", "cloud").find((p) => p.id === "upscale-rtx")!.disabled).toBe(canvas.GPU_ONLY_ENTRY);
+ const node = { id: "n1", type: "upscale" as const, position: { x: 0, y: 0 }, data: { mediaKind: "video" as const, modelId: RTX.RTX_UPSCALE_MODEL } };
+ expect(canvas.defaultModelForNode(node, "open")?.id).toBe(RTX.RTX_UPSCALE_MODEL);
+ expect(canvas.counterpart({ nodes: [node], edges: [] } as never, node as never, "cloud")).toBeUndefined();
+ });
+
+ it("records the licences as information", () => {
+ const pack = NODE_PACKS.find((p) => p.name === PACK)!;
+ expect(pack.licence).toMatchObject({ name: "Apache-2.0", class: "commercial" });
+ expect(pack.licence.note).toMatch(/NVIDIA Software License Agreement/);
+ const info = licenceInfo(workflowLicence({ id: RTX.RTX_UPSCALE_WORKFLOW, license: read("workflows/comfyui/manifest.json").workflows.find((w: { id: string }) => w.id === RTX.RTX_UPSCALE_WORKFLOW).license }));
+ expect(info).toMatchObject({ name: "NVIDIA Software License Agreement", class: "conditions" });
+ });
+
+ it("a ComfyUI without the nodes gets plain words", () => {
+ const body = { error: { type: "missing_node_type", message: "Node 'x' not found" } };
+ const { message } = promptRefusal(body, 400, getWorkflow(RTX.RTX_UPSCALE_WORKFLOW).manifest, []);
+ expect(message).toBe(RTX.RTX_MISSING.owner);
+ });
+});