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 → Video: Quick · RTX first where the run's GPUs run it

Adarshbcda06f3391d
diff --git a/src/components/studio/composer.tsx b/src/components/studio/composer.tsx
index fa54a40e..1af0049e 100644
--- a/src/components/studio/composer.tsx
+++ b/src/components/studio/composer.tsx
@@ -111,6 +111,7 @@ import {
showsPrompt,
startStep,
viewerDefaults,
+ hereDefaults,
writesCaptions,
WRITE_PROMPT,
} from "@/lib/composer";
@@ -473,7 +474,11 @@ export function Composer({ docked }: { docked: boolean }) {
// The studio's defaults as this viewer runs them: Ideogram 4 gives way to its stand-in where the server writes no caption.
const writes = writesCaptions(status);
- const defaults = useMemo(() => viewerDefaults(config.defaultModels, config.uncaptioned, writes), [config.defaultModels, config.uncaptioned, writes]);
+ // Where this viewer's runs go to this install's GPUs and they run the studio's own choice for them (hereDefault), it is
+ // the open default there (Upscale → Video: Quick · RTX on NVIDIA RTX cards).
+ const hereModel = config.hereDefault && catalog.offered(config.hereDefault, "open") ? catalog.getModel(config.hereDefault) : undefined;
+ const hereRuns = !!here && !!hereModel && runsHere(here, hereModel);
+ const defaults = useMemo(() => hereDefaults(viewerDefaults(config.defaultModels, config.uncaptioned, writes), config.hereDefault, hereRuns), [config.defaultModels, config.uncaptioned, writes, config.hereDefault, hereRuns]);
// Keep the selected model in sync with the engine switch. A camera motion or effect keeps its Original (Fuobe DoP),
// moving to the model its move names on this engine (Jib Up: Fuobe DoP on the GPU, Fuobe DoP · LTX in the cloud) when
@@ -526,6 +531,16 @@ export function Composer({ docked }: { docked: boolean }) {
if (m) setDraft((d) => (d.modelId !== model.id ? {} : { modelId: m.id, params: { ...m.defaults, numOutputs: d.params.numOutputs, enhancePrompt: d.params.enhancePrompt }, ...lookCleared(model, m) }));
}, [writes, model, defaults, engine, config.defaultModels, lockedModel, appIds, catalog, setDraft]);
+ // Runs that go to this install's GPUs, which run the studio's choice for them (hereDefault): the untouched default
+ // moves to it once that is known. A model the person picked, or a link that names one, stays.
+ const hereChecked = useRef(false);
+ useEffect(() => {
+ if (hereChecked.current || !hereRuns || !model || engine !== "open" || lockedModel || preset) return;
+ hereChecked.current = true;
+ const m = model.id === config.defaultModels.open && defaults.open !== model.id && new URLSearchParams(window.location.search).get("model") !== model.id ? catalog.getModel(defaults.open) : undefined;
+ if (m) setDraft((d) => (d.modelId !== model.id ? {} : { modelId: m.id, params: { ...m.defaults, numOutputs: d.params.numOutputs, enhancePrompt: d.params.enhancePrompt }, ...lookCleared(model, m) }));
+ }, [hereRuns, model, engine, lockedModel, preset, config.defaultModels.open, defaults.open, catalog, setDraft]);
+
// The preset's recipe (the model its preview was made with) that this viewer can't run: a Replicate-only account and
// hosted MiniMax H3 (fal only), or a model switched off in Settings → Models & licences. The composer moves to the
// preset's own route on this engine when the viewer can run that (Kling 2.5 Turbo, Fuobe DoP, the app's own model).
@@ -2045,6 +2060,7 @@ export function Composer({ docked }: { docked: boolean }) {
: undefined
}
describing={describing}
+ here={here}
/>
)}
diff --git a/src/components/studio/finish-choices.tsx b/src/components/studio/finish-choices.tsx
index fc031315..2c3942ae 100644
--- a/src/components/studio/finish-choices.tsx
+++ b/src/components/studio/finish-choices.tsx
@@ -7,6 +7,7 @@ import { RTX_COPY, RTX_UPSCALE_MODEL, rtxStanding } from "@/lib/catalog/rtx-vide
import { badgeFor, useGpuBadges } from "@/hooks/use-gpu";
import { OwnSetupChip } from "@/components/own-setup";
import { useIsOwner } from "@/lib/api";
+import { runsHere, type Here } from "@/lib/runnable-here";
import { cn } from "@/lib/utils";
import { radioKeys, radioTab } from "./radio-keys";
@@ -18,7 +19,9 @@ import { radioKeys, radioTab } from "./radio-keys";
* 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.
+ * can't run it (a CPU, Apple, AMD or an older NVIDIA card), last when the card isn't known. Where runs go to this install's
+ * GPUs (`here`, runnable-here.ts), their cards decide: first, and the studio's default there (StudioConfig.hereDefault),
+ * when they run it.
*/
export function FinishChoices({
choices,
@@ -29,6 +32,7 @@ export function FinishChoices({
onPick,
onDescribe,
describing,
+ here,
}: {
choices: readonly FinishChoice[];
model: ModelDef | undefined;
@@ -40,6 +44,8 @@ export function FinishChoices({
/** Writes the clip's words into the prompt box (shown while it has none). */
onDescribe?: () => void;
describing?: boolean;
+ /** Where this viewer's runs go to this install's GPUs (null: its own GPU, whose card the GPU check read). */
+ here?: Here | null;
}) {
const owner = useIsOwner();
const badges = useGpuBadges().data;
@@ -68,7 +74,8 @@ export function FinishChoices({
// 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);
+ // On this install's GPUs, they run it or not; on the viewer's own GPU, its card as the GPU check read it.
+ const standing = here && rtx ? (runsHere(here, rtx) ? "fits" : rtxStanding("nvidia-rtx", undefined)) : rtxStanding("nvidia-rtx", badges?.gpu, !!chip && chip[0] === "u" && (chip[3] & 24) !== 0);
const quick = rtx && {
modelId: RTX_UPSCALE_MODEL,
label: RTX_COPY.quick,
diff --git a/src/components/studio/studio-context.tsx b/src/components/studio/studio-context.tsx
index 9fbbfc8a..cd7c4cac 100644
--- a/src/components/studio/studio-context.tsx
+++ b/src/components/studio/studio-context.tsx
@@ -52,6 +52,11 @@ export interface StudioConfig {
* account, a guest, or an install with no local model answering: writesCaptions in src/lib/composer.ts).
*/
uncaptioned?: Partial<{ cloud: string; open: string }>;
+ /**
+ * The open default where this viewer's runs go to this install's GPUs and they run it (runnable-here.ts): the fastest
+ * choice those GPUs have (Upscale → Video: Quick · RTX where they are NVIDIA RTX cards). Anywhere else, defaultModels.
+ */
+ hereDefault?: string;
suggestions?: string[];
/** Prompt is optional (e.g. motions, upscale). */
promptOptional?: boolean;
diff --git a/src/lib/composer.ts b/src/lib/composer.ts
index 27d09d04..bee82a4d 100644
--- a/src/lib/composer.ts
+++ b/src/lib/composer.ts
@@ -959,6 +959,14 @@ export function viewerDefaults<D extends { cloud: string; open: string }>(defaul
return writes === false && uncaptioned ? { ...defaults, ...uncaptioned } : defaults;
}
+/**
+ * The open default where this viewer's runs go to this install's GPUs (StudioConfig.hereDefault), when they run it now
+ * (`runs`: runnable-here.ts runsHere for it); otherwise the defaults as they are.
+ */
+export function hereDefaults<D extends { cloud: string; open: string }>(defaults: D, hereDefault: string | undefined, runs: boolean): D {
+ return hereDefault && runs ? { ...defaults, open: hereDefault } : defaults;
+}
+
/**
* What the engine switch (or a model change) does to the composer's model: the model id to move to, or undefined to
* keep it. An app runs only on its own models for the engine (its recipe's, then its route's): any other model, even
diff --git a/src/lib/studios.ts b/src/lib/studios.ts
index 7d92af9f..16294123 100644
--- a/src/lib/studios.ts
+++ b/src/lib/studios.ts
@@ -4,6 +4,7 @@ import { SIGNATURE_MODELS } from "@/lib/catalog/palettes";
import { FACE_MOSAIC_MODELS } from "@/lib/catalog/open-tools";
import { UPSCALE_FIRST_STEPS } from "@/lib/catalog/upscale-first";
import { FINISH_CHOICES, REGEN_MODEL } from "@/lib/catalog/regenerate";
+import { RTX_UPSCALE_MODEL } from "@/lib/catalog/rtx-video";
import type { Preset } from "@/lib/catalog/types";
import type { StudioConfig } from "@/components/studio/studio-context";
@@ -165,6 +166,8 @@ export const VIDEO_UPSCALE_STUDIO: StudioConfig = {
extraModels: [REGEN_MODEL],
slots: [{ key: "video", label: "Video", accept: "video", required: true }],
defaultModels: { cloud: "topaz-video", open: "oss-seedvr2" },
+ // Where runs go to this install's GPUs and they run it (NVIDIA RTX cards): Quick · RTX, the fastest, is the default.
+ hereDefault: RTX_UPSCALE_MODEL,
clipFacts: true,
};
diff --git a/tests/rtx-video.test.ts b/tests/rtx-video.test.ts
index 0b84a4f2..b4e12dc4 100644
--- a/tests/rtx-video.test.ts
+++ b/tests/rtx-video.test.ts
@@ -407,3 +407,21 @@ describe("where the choices show up", () => {
expect(fs.readFileSync(path.join(ROOT, "src/components/studio/radio-keys.ts"), "utf8")).toContain(':not([aria-disabled="true"])');
});
});
+
+describe("Upscale → Video on this install's GPUs", () => {
+ it("starts on Quick · RTX where they run it, and keeps the studio's defaults anywhere else", async () => {
+ const { VIDEO_UPSCALE_STUDIO } = await import("@/lib/studios");
+ const { hereDefaults } = await import("@/lib/composer");
+ const { runsHere } = await import("@/lib/runnable-here");
+ expect(VIDEO_UPSCALE_STUDIO.hereDefault).toBe(RTX.RTX_UPSCALE_MODEL);
+ const rtx = { id: RTX.RTX_UPSCALE_MODEL, kind: "video" as const, engine: "open" as const };
+ // Their cards run it: it is the open default there.
+ const fits = { rules: undefined, owner: false };
+ expect(hereDefaults(VIDEO_UPSCALE_STUDIO.defaultModels, VIDEO_UPSCALE_STUDIO.hereDefault, runsHere(fits, rtx))).toEqual({ cloud: "topaz-video", open: RTX.RTX_UPSCALE_MODEL });
+ // They can't run it now (no RTX card among them), or runs go to the viewer's own GPU: the studio's own default.
+ const noCard = { rules: { own: { [RTX.RTX_UPSCALE_MODEL]: { need: "gpu" as const } } }, owner: false };
+ expect(runsHere(noCard, rtx)).toBe(false);
+ expect(hereDefaults(VIDEO_UPSCALE_STUDIO.defaultModels, VIDEO_UPSCALE_STUDIO.hereDefault, runsHere(noCard, rtx))).toEqual(VIDEO_UPSCALE_STUDIO.defaultModels);
+ expect(hereDefaults(VIDEO_UPSCALE_STUDIO.defaultModels, undefined, true)).toEqual(VIDEO_UPSCALE_STUDIO.defaultModels);
+ });
+});