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.

Open-H3 Regenerate and Kandinsky 6.0 Pro: shown to everyone, run on a visitor's own GPU

Adarshc1a394e42ddd
diff --git a/docs/public-signup.md b/docs/public-signup.md
index d9dcb703..4e1fdde3 100644
--- a/docs/public-signup.md
+++ b/docs/public-signup.md
@@ -287,7 +287,12 @@ cloudflared tunnel --url http://localhost:8188 # or: ngrok http 8188
key is asked for it (`add-key`), and a guest gets the sign-up card. Audio → Extend & remix shows to everyone, its tab
marked "Use your own fal.ai key". `src/lib/own-setup.ts` labels these and every other item that runs only on a
visitor's own GPU or key (`ownSetupOnly`, `ownSetupLabel`, `ownSetupStep`), and the hosted runs never place one on
- this studio's GPUs or keys.
+ this studio's GPUs or keys. The items that need a bigger card than this studio's (Open-H3 Regenerate: Upscale →
+ Video's "Regenerate · creative" and its first step, "Regenerate in 2K" and "Enhance" in result menus, the Canvas
+ node, Shorts' Enhance, Faceless's "Regenerate to 1080p", Cinema's "Finish in 2K" on a GPU take, MiniMax H3 at 2K on
+ your GPU, Character Swap's Sharpen and its 1080p / 2K / 4K on your GPU; and Kandinsky 6.0 Pro) show to everyone,
+ marked "Runs on your own GPU · 48 GB" (Kandinsky Pro's choice says about 80 GB). An account runs them on its own GPU
+ only, when that GPU has the memory (`src/server/own-setup-run.ts`); otherwise it gets "Connect your GPU" (`connect-gpu`).
"Write the lyrics" and "Rewrite my prompt now" use the studio's AI helper and are hidden from guests and accounts.
A song's stems come back as one zip: for an account it is fetched from public addresses only, within what its files
have room for (128 MB at most, 256 MB unpacked), and each stem is saved to disk as it is unpacked.
diff --git a/src/components/canvas/palette.tsx b/src/components/canvas/palette.tsx
index 4d1ed562..947c8ff9 100644
--- a/src/components/canvas/palette.tsx
+++ b/src/components/canvas/palette.tsx
@@ -4,6 +4,7 @@ import { PanelLeftClose, Plus, Search } from "lucide-react";
import { memo, useEffect, useMemo, useRef, useState } from "react";
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "@/components/ui/command";
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
+import { OwnSetupChip } from "@/components/own-setup";
import type { NodeGroup, PaletteItem } from "@/lib/catalog/canvas";
import { NodeIcon } from "./canvas-context";
@@ -56,6 +57,7 @@ export const Palette = memo(function Palette({ items, onAdd, onClose }: { items:
</span>
<span className="min-w-0">
<span className="block truncate text-[13px] font-medium">{p.label}</span>
+ <OwnSetupChip setup={p.data?.modelId} className="mb-0.5" />
<span className="line-clamp-2 text-[11px] leading-snug text-muted-foreground">{p.disabled}</span>
</span>
</div>
@@ -78,6 +80,8 @@ export const Palette = memo(function Palette({ items, onAdd, onClose }: { items:
</span>
<span className="min-w-0">
<span className="block truncate text-[13px] font-medium">{p.label}</span>
+ {/* A node that needs a bigger GPU than most (Regenerate): what it runs on, in the label's own words. */}
+ <OwnSetupChip setup={p.data?.modelId} className="mb-0.5" />
<span className="line-clamp-1 text-[11px] leading-snug text-muted-foreground">{p.description}</span>
</span>
</button>
@@ -140,6 +144,7 @@ export function AddMenu({ x, y, items, title, onPick, onClose }: { x: number; y:
<CommandItem key={p.id} value={`${p.label} ${p.keywords ?? ""}`} onSelect={() => onPick(p)} disabled={!!p.disabled} title={p.disabled} className="gap-2">
<NodeIcon name={p.icon} className="size-4 text-muted-foreground" />
<span className="truncate text-[13px]">{p.label}</span>
+ <OwnSetupChip setup={p.data?.modelId} />
{p.disabled && <span className="ml-auto shrink-0 text-[11px] text-muted-foreground">not on this engine</span>}
</CommandItem>
);
diff --git a/src/components/cinema/cinema-feed.tsx b/src/components/cinema/cinema-feed.tsx
index 8739ca67..4ba7156c 100644
--- a/src/components/cinema/cinema-feed.tsx
+++ b/src/components/cinema/cinema-feed.tsx
@@ -58,7 +58,8 @@ import type { CinemaFolder } from "@/lib/catalog/cinema";
import type { Generation, OutputFile } from "@/lib/catalog/types";
import { formatCost, timeAgo } from "@/lib/format";
import { useEngineMode, useIsOwner } from "@/lib/api";
-import { finishedTakes, finishIn2k, REGEN_OFFERED } from "@/lib/catalog/regenerate";
+import { finishedTakes, finishIn2k } from "@/lib/catalog/regenerate";
+import { OwnSetupChip, useOwnSetupPress } from "@/components/own-setup";
import { useSubmitGuard } from "@/components/shorts/hooks";
import { cn } from "@/lib/utils";
import { copyWithToast } from "@/lib/clipboard";
@@ -211,9 +212,11 @@ function TileMenu({ u, folders, projectId, handlers, onDelete }: { u: Unit; fold
const elsewhere = foreign(u.g, projectId);
// Finish in 2K: a MiniMax H3 take below 2K (fal renders it again at 2K; your GPU redraws it with Open-H3 Regenerate),
// once: not on a take whose 2K finish is under way or made (a 2K run's own 768p draft included).
- // A take from your GPU is finished by Open-H3 Regenerate (perSecond null): offered only while Regenerate is.
- const offered = o?.kind === "video" && !u.tile && !finished.has(u.g.id) ? finishIn2k(u.g, engineMode) : null;
- const finish = offered && (offered.perSecond !== null || REGEN_OFFERED) ? offered : null;
+ // A take from your GPU is finished by Open-H3 Regenerate (perSecond null): a 48 GB card, so it says so (own-setup.ts)
+ // and a visitor runs it on its own GPU only.
+ const finish = o?.kind === "video" && !u.tile && !finished.has(u.g.id) ? finishIn2k(u.g, engineMode) : null;
+ const ownSetup = finish?.perSecond === null ? "regenerate:cinema-finish" : undefined;
+ const press = useOwnSetupPress();
const seconds = Number(u.g.request.params?.duration ?? 0);
const finishPrice = !finish ? "" : finish.perSecond === null ? "Free" : seconds > 0 ? `≈ ${formatCost(finish.perSecond * seconds)}` : `$${finish.perSecond.toFixed(2)}/s`;
return (
@@ -280,12 +283,16 @@ function TileMenu({ u, folders, projectId, handlers, onDelete }: { u: Unit; fold
{finish && (
<DropdownMenuItem
onClick={() =>
+ press(ownSetup, () =>
void guard(`finish-2k:${u.g.id}`, (requestId) => actions.finish2k(u.g, requestId))
.then((done) => done !== undefined && toast(finish.perSecond === null ? "Finishing in 2K on your GPU" : "Rendering it again at 2K"))
- .catch((e) => toastError(e))
+ .catch((e) => toastError(e)),
+ )
}
>
- <Sparkles /> {finish.label} <span className="ml-auto text-[11.5px] text-muted-foreground">{finishPrice}</span>
+ <Sparkles /> {finish.label}
+ <OwnSetupChip setup={ownSetup} />
+ <span className="ml-auto text-[11.5px] text-muted-foreground">{finishPrice}</span>
</DropdownMenuItem>
)}
</>
diff --git a/src/components/cinema/prompt-bar.tsx b/src/components/cinema/prompt-bar.tsx
index f33e18c5..a19f62fa 100644
--- a/src/components/cinema/prompt-bar.tsx
+++ b/src/components/cinema/prompt-bar.tsx
@@ -453,6 +453,8 @@ export function PromptBar(props: PromptBarProps) {
// MiniMax H3 adds a 2K tier (fal's 2K, or a 768p draft finished by Open-H3 Regenerate on your GPU).
const videoTiers = videoResolutionsFor(model);
+ // 2K on your GPU finishes with Open-H3 Regenerate: a 48 GB card, said with the tier (own-setup.ts).
+ const twoKSetup = ownSetupOnly("regenerate:h3-2k");
// Secondary settings: inline on wide bars, in one Settings popover on narrow ones.
const settingsItems: { label: string; node: React.ReactNode }[] = [
{
@@ -469,7 +471,7 @@ export function PromptBar(props: PromptBarProps) {
label="Resolution"
value={video && !videoTiers.includes(draft.resolution.video) ? "1080p" : draft.resolution[draft.mode]}
options={video ? videoTiers : IMAGE_RESOLUTIONS}
- describe={video && videoTiers.includes("2K") ? (v) => (v !== "2K" ? "" : model.engine === "open" ? "768p draft, then redrawn at 2K on your GPU" : "Rendered from a 768P base") : undefined}
+ describe={video && videoTiers.includes("2K") ? (v) => (v !== "2K" ? "" : model.engine === "open" ? `768p draft, then redrawn at 2K${twoKSetup ? ` · ${ownSetupLabel(twoKSetup)}` : " on your GPU"}` : "Rendered from a 768P base") : undefined}
onChange={(v) => setDraft((d) => ({ resolution: { ...d.resolution, [d.mode]: v } }))}
/>
),
diff --git a/src/components/faceless/episode-view.tsx b/src/components/faceless/episode-view.tsx
index dae905e5..3ba1381c 100644
--- a/src/components/faceless/episode-view.tsx
+++ b/src/components/faceless/episode-view.tsx
@@ -42,6 +42,7 @@ import { Button } from "@/components/ui/button";
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@/components/ui/dropdown-menu";
import { PhoneNavButton } from "@/components/nav/phone-nav-button";
import { Skeleton } from "@/components/ui/skeleton";
+import { OwnSetupChip, useOwnSetupPress } from "@/components/own-setup";
import { NotFoundState } from "@/components/empty-state";
import { MediaThumb } from "@/components/studio/feed";
import { Viewer } from "@/components/studio/viewer";
@@ -475,6 +476,8 @@ export function EpisodeView({ id, backHref, backLabel }: { id: string; backHref:
const [title, setTitle] = useState("");
const [open, setOpen] = useState<Generation | null>(null);
const [confirm, setConfirm] = useState(false);
+ // Regenerate to 1080p needs a 48 GB card (own-setup.ts): a visitor runs it on its own GPU, else gets the step that sets it up.
+ const press = useOwnSetupPress();
if (error && /not found/i.test((error as Error).message)) return <NotFoundState title="This episode doesn't exist">It may have been deleted. Its videos are still in your library.</NotFoundState>;
const ep = view?.episode;
@@ -550,7 +553,7 @@ export function EpisodeView({ id, backHref, backLabel }: { id: string; backHref:
{regenOffer && !regenerated && (
<DropdownMenuItem
disabled={!!regenerating || action.isPending}
- onClick={() => run("regenerate", "Regenerating each scene at 1080p — the download switches to it when it's done")}
+ onClick={() => press("regenerate:faceless", () => run("regenerate", "Regenerating each scene at 1080p — the download switches to it when it's done"))}
className="items-start"
>
<Sparkles className="mt-0.5" />
@@ -560,6 +563,7 @@ export function EpisodeView({ id, backHref, backLabel }: { id: string; backHref:
<span className="ml-auto font-mono text-[11px] text-muted-foreground tabular-nums">Free</span>
</span>
<span className="text-[11.5px] leading-snug text-muted-foreground">Sharper, may redraw · {FACELESS_REGEN_COPY.time(regenOffer.scenes)}</span>
+ <OwnSetupChip setup="regenerate:faceless" className="mt-0.5" />
</span>
</DropdownMenuItem>
)}
diff --git a/src/components/genjutsu/character-panel.tsx b/src/components/genjutsu/character-panel.tsx
index d7fefb10..d268095c 100644
--- a/src/components/genjutsu/character-panel.tsx
+++ b/src/components/genjutsu/character-panel.tsx
@@ -9,6 +9,7 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@
import { Switch } from "@/components/ui/switch";
import { Textarea } from "@/components/ui/textarea";
import { Field, Segmented } from "@/components/shorts/ui";
+import { OwnSetupChip } from "@/components/own-setup";
import {
ANCHOR_MODELS,
anchorModel,
@@ -170,6 +171,8 @@ export function CharacterControls({
describedBy={offReasons.length ? "character-quality-off" : undefined}
options={offered.map((q) => ({ value: q, label: q, disabled: !!qualityOff(engine, q), title: qualityOff(engine, q) ?? undefined }))}
/>
+ {/* Your GPU's 1080p / 2K / 4K regenerate with Open-H3 Regenerate: a 48 GB card, and the choice says so. */}
+ {engine === "open" && characterFinish(shown) && <OwnSetupChip setup="regenerate:swap-sharpen" />}
{characterFinish(shown) && <p className="text-[12px] leading-snug text-pretty text-muted-foreground">{qualityHint(engine, shown)}</p>}
{offReasons.length > 0 && (
<p id="character-quality-off" className="text-[12px] leading-snug text-pretty text-muted-foreground">
diff --git a/src/components/shorts/session-view.tsx b/src/components/shorts/session-view.tsx
index 984f7e29..3fd1373b 100644
--- a/src/components/shorts/session-view.tsx
+++ b/src/components/shorts/session-view.tsx
@@ -23,7 +23,8 @@ import { MediaThumb } from "@/components/studio/result-media";
import { radioKeys, radioTab } from "@/components/studio/radio-keys";
import { Viewer } from "@/components/studio/viewer";
import { chainState, ENHANCE_COPY, formatSeconds, segmentSeconds, stitchCurrent, stitchSteps, takeSteps, type ChainState, type ShortsSessionSegment } from "@/lib/catalog/shorts";
-import { finishLengthProblem, REGEN_OFFERED } from "@/lib/catalog/regenerate";
+import { finishLengthProblem } from "@/lib/catalog/regenerate";
+import { OwnSetupChip, useOwnSetupPress } from "@/components/own-setup";
import { originalSoundLabel, originalSoundOn } from "@/lib/av/original-sound";
import { useEngineMode, useIsOwner } from "@/lib/api";
import type { Generation } from "@/lib/catalog/types";
@@ -131,6 +132,8 @@ function Session({ s }: { s: View }) {
.catch((e: Error) => toastError(e));
};
const enhanceGuard = useSubmitGuard();
+ // Enhance needs a 48 GB card: a visitor runs it on its own GPU (own-setup.ts), else gets the step that sets it up.
+ const press = useOwnSetupPress();
const enhance = (i: number) => {
if (actions.enhance.isPending) return;
void enhanceGuard(`enhance:${i}:${s.segments[i].primary}`, (requestId) => actions.enhance.mutateAsync({ index: i, requestId }))
@@ -271,15 +274,15 @@ function Session({ s }: { s: View }) {
onRegenerate={() => regenerate(i)}
regenerating={actions.regenerate.isPending && actions.regenerate.variables?.index === i}
busy={actions.regenerate.isPending}
- enhanceable={REGEN_OFFERED && s.engine === "open" && engineMode !== "cloud"}
- onEnhance={() => enhance(i)}
+ enhanceable={s.engine === "open" && engineMode !== "cloud"}
+ onEnhance={() => press("regenerate:enhance", () => enhance(i))}
enhancing={actions.enhance.isPending && actions.enhance.variables?.index === i}
onPrimary={(gid) => actions.primary.mutate({ index: i, generationId: gid }, { onError: (e) => toastError(e) })}
/>
))}
</div>
{/* A cloud short: Enhance (H3 regenerate) needs your GPU, said once rather than on every segment. */}
- {REGEN_OFFERED && s.engine === "cloud" && engineMode !== "cloud" && <p className="text-[12px] text-muted-foreground">{ENHANCE_COPY.cloudSession}.</p>}
+ {s.engine === "cloud" && engineMode !== "cloud" && <p className="text-[12px] text-muted-foreground">{ENHANCE_COPY.cloudSession}.</p>}
</section>
</div>
{open && <Viewer generation={open} index={0} onClose={() => setOpen(null)} />}
@@ -449,6 +452,7 @@ function SegmentCard({
>
{enhancing ? <Loader2 className="size-3.5 animate-spin" /> : <Sparkles className="size-3.5" />}
{ENHANCE_COPY.label}
+ <OwnSetupChip setup="regenerate:enhance" />
<span className="font-mono text-[11px] font-normal text-muted-foreground">1080p · Free</span>
</button>
)}
diff --git a/src/components/studio/finish-choices.tsx b/src/components/studio/finish-choices.tsx
index 21911d83..fc031315 100644
--- a/src/components/studio/finish-choices.tsx
+++ b/src/components/studio/finish-choices.tsx
@@ -5,13 +5,14 @@ import type { Engine, ModelDef } from "@/lib/catalog/types";
import { REGEN_COPY, REGEN_MODEL, type FinishChoice } from "@/lib/catalog/regenerate";
import { RTX_COPY, RTX_UPSCALE_MODEL, rtxStanding } from "@/lib/catalog/rtx-video";
import { badgeFor, useGpuBadges } from "@/hooks/use-gpu";
+import { OwnSetupChip } from "@/components/own-setup";
import { useIsOwner } from "@/lib/api";
import { cn } from "@/lib/utils";
import { radioKeys, radioTab } from "./radio-keys";
/**
* Upscale → Video's open finishing steps side by side (StudioConfig.finishChoices): SeedVR2 "Restore · faithful", and
- * Open-H3 "Regenerate · creative" while it is offered. On the cloud engine (both engines on) Regenerate says it runs on
+ * Open-H3 "Regenerate · creative" with what it needs (a 48 GB card: OwnSetupChip). On the cloud engine (both engines on) Regenerate says it runs on
* your GPU, with a 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
@@ -52,6 +53,7 @@ export function FinishChoices({
<span className="min-w-0">
<span className="font-medium text-foreground">Regenerate · creative</span> · {REGEN_COPY.gpuOnly}
</span>
+ <OwnSetupChip setup="regenerate:upscale" />
<button
type="button"
onClick={() => onPick(regen)}
@@ -99,6 +101,8 @@ export function FinishChoices({
)}
>
<span className={cn("block text-[12px] font-medium", sel ? "text-brand-text" : "text-foreground")}>{c.label}</span>
+ {/* Regenerate · creative needs a 48 GB card: the choice says so (own-setup.ts). Picking it stays free for all. */}
+ {c.modelId === REGEN_MODEL && <OwnSetupChip setup="regenerate:upscale" className="my-0.5" />}
<span className="block text-[11px] leading-snug text-pretty text-muted-foreground">{c.hint}</span>
</button>
);
diff --git a/src/components/studio/result-actions.tsx b/src/components/studio/result-actions.tsx
index a47267d1..a6e18ced 100644
--- a/src/components/studio/result-actions.tsx
+++ b/src/components/studio/result-actions.tsx
@@ -90,6 +90,7 @@ import { cn } from "@/lib/utils";
import { copyWithToast } from "@/lib/clipboard";
import { enhanceRequest, rerenderRequest } from "@/lib/catalog/regenerate";
import { toastError } from "@/lib/refusals";
+import { OwnSetupChip, useOwnSetupPress } from "@/components/own-setup";
export const ACTION_ICONS: Record<OutputActionId, LucideIcon> = {
animate: Clapperboard,
@@ -250,8 +251,11 @@ export function useActionRunner(opts: RunnerOptions = {}) {
const deleteUpload = useContext(UploadDeleteContext);
const share = useShare();
const skillBuilder = useSkillBuilder();
+ const press = useOwnSetupPress();
return (a: OutputAction, g: Generation, index: number) => {
const o = g.outputs[index];
+ // An item that runs on the visitor's own setup: a guest signs up, an account without it connects its GPU first.
+ if (a.ownSetup && !a.href && !press(a.ownSetup)) return;
switch (a.id) {
case "favorite":
return void actions.favorite(g);
@@ -574,6 +578,7 @@ export function ActionMenu({
<DropdownMenuItem key={a.id} asChild>
<Link href={a.href} prefetch={false}>
<Icon /> {a.label}
+ <OwnSetupChip setup={a.ownSetup} className="ml-auto" />
</Link>
</DropdownMenuItem>
);
@@ -589,6 +594,7 @@ export function ActionMenu({
}}
>
<Icon className={cn(a.id === "favorite" && g.favorite && "fill-current")} /> {a.id === "save-character" ? "Save as element…" : a.label}
+ <OwnSetupChip setup={a.ownSetup} className="ml-auto" />
</DropdownMenuItem>
);
};
diff --git a/src/components/swap-studio/stage-review.tsx b/src/components/swap-studio/stage-review.tsx
index 5873bbc8..371d3c10 100644
--- a/src/components/swap-studio/stage-review.tsx
+++ b/src/components/swap-studio/stage-review.tsx
@@ -13,7 +13,8 @@ import { Panel } from "@/components/av/tool-shell";
import { Segmented } from "@/components/faceless/controls";
import { Segmented as SizePicker } from "@/components/shorts/ui";
import { h3Canvas } from "@/lib/catalog/character-swap";
-import { defaultSharpenTier, filmSize, gpuMinutes, joinNote, SHARPEN_COPY, sharpenOffered, sharpenOptions, type SharpenTier } from "@/lib/catalog/sharpen";
+import { defaultSharpenTier, filmSize, gpuMinutes, joinNote, SHARPEN_COPY, sharpenOptions, type SharpenTier } from "@/lib/catalog/sharpen";
+import { OwnSetupChip, useOwnSetupPress } from "@/components/own-setup";
import {
assemblyPieces,
assemblyTakes,
@@ -149,8 +150,11 @@ function FinishVersion({ take, gens, onUse }: { take: SwapTake; gens: Record<str
/** Assemble → Finish: "Sharpen to 1080p / 2K / 4K" (runnable: the size, its price or GPU time, Run). */
function FinishPanel({ id, project, clip, gens, estimate }: Pick<StageProps, "id" | "project" | "clip" | "gens" | "estimate">) {
const sharpen = useSharpen(id);
+ // Your GPU's sharpen regenerates with Open-H3 Regenerate: a 48 GB card (own-setup.ts), said beside the title.
+ const press = useOwnSetupPress();
const stop = useStopJob(id);
const engine = project.engine;
+ const ownSetup = engine === "open" ? "regenerate:swap-sharpen" : undefined;
const film = filmSize(clip.source.width, clip.source.height, engine);
// Your GPU redraws the character inside the part of H3's canvas the regenerate keeps.
const canvas = film ? h3Canvas(film.width, film.height, "768p") : undefined;
@@ -181,7 +185,7 @@ function FinishPanel({ id, project, clip, gens, estimate }: Pick<StageProps, "id
<section aria-labelledby="sharpen-title" className="min-w-0 space-y-3 rounded-xl border p-3">
<div className="flex min-w-0 flex-wrap items-baseline justify-between gap-x-3 gap-y-1">
<h3 id="sharpen-title" className="text-[13px] font-semibold">
- {SHARPEN_COPY.title}
+ {SHARPEN_COPY.title} <OwnSetupChip setup={ownSetup} className="ml-1 align-middle" />
</h3>
<span className="font-mono text-[11px] text-muted-foreground">{priceLine}</span>
</div>
@@ -213,7 +217,7 @@ function FinishPanel({ id, project, clip, gens, estimate }: Pick<StageProps, "id
<Button
className="h-9 rounded-full"
disabled={!!problem || !tier || sharpen.isPending || busy || allMade}
- onClick={() => tier && sharpen.mutate({ clipId: clip.id, tier }, { onSuccess: () => toast(`Sharpening the chosen takes to ${tier}`), onError: (e) => toastError(e) })}
+ onClick={() => tier && press(ownSetup, () => sharpen.mutate({ clipId: clip.id, tier }, { onSuccess: () => toast(`Sharpening the chosen takes to ${tier}`), onError: (e) => toastError(e) }))}
>
{sharpen.isPending ? <Loader2 className="size-4 animate-spin" /> : <Sparkles className="size-4" />} Sharpen{tier ? ` to ${tier}` : ""}
</Button>
@@ -393,7 +397,7 @@ export function AssembleStage({ id, project, clip, gens, estimate }: StageProps)
</div>
</Panel>
- {sharpenOffered(project.engine) && <FinishPanel id={id} project={project} clip={clip} gens={gens} estimate={estimate} />}
+ <FinishPanel id={id} project={project} clip={clip} gens={gens} estimate={estimate} />
<Panel title="Where it runs">
<ul className="space-y-1.5 text-[12px] leading-snug text-pretty text-muted-foreground">
diff --git a/src/lib/catalog/canvas.ts b/src/lib/catalog/canvas.ts
index 83f5ee7e..7218f239 100644
--- a/src/lib/catalog/canvas.ts
+++ b/src/lib/catalog/canvas.ts
@@ -18,7 +18,7 @@ import { chainedWaitMessage, keyframeChain } from "./keyframes";
import { isSpeed, keyTimes, timingFor, timingProblem, type GapTiming, type InbetweenTiming } from "@/lib/inbetween";
import { estimateCost, inferOperation, planGeneration, routesFor, type Plan } from "./plan";
import { replacedBy, replacementOf } from "./replaced";
-import { REGEN_COPY, REGEN_MODEL, REGEN_OFFERED } from "./regenerate";
+import { REGEN_COPY, REGEN_MODEL } from "./regenerate";
import { RTX_UPSCALE_MODEL } from "./rtx-video";
import { compileWords, LAYOUT_PARAM, readLayout, type LayoutDraft } from "@/lib/layout-prompt";
import { fillLayout, layoutPlaceholders } from "@/lib/layout-surfaces";
@@ -373,7 +373,7 @@ export function paletteItems(mode: "both" | "open" | "cloud" = "both", engine?:
const hit = paletteCache.get(key);
if (hit) return hit;
// Clean up voice has no cloud route: a cloud-only install doesn't offer it at all.
- const items = PALETTE.filter((p) => (p.id !== "model-text" || MODELS.some((m) => m.kind === "text" && !m.hidden)) && !(mode === "cloud" && p.id === "clean-voice") && (p.id !== "upscale-regenerate" || REGEN_OFFERED)).map((p): PaletteItem => {
+ const items = PALETTE.filter((p) => (p.id !== "model-text" || MODELS.some((m) => m.kind === "text" && !m.hidden)) && !(mode === "cloud" && p.id === "clean-voice")).map((p): PaletteItem => {
const fixed = p.data?.modelId ? getModel(p.data.modelId) : undefined;
if (fixed && !runsOn(fixed, "cloud") && (mode === "cloud" || engine === "cloud")) return { ...p, disabled: mode === "cloud" ? GPU_ONLY_INSTALL : GPU_ONLY_ENTRY };
// Split soundtrack: DBS runs on the open engine only, and no other model stands in for it.
diff --git a/src/lib/catalog/character-swap.ts b/src/lib/catalog/character-swap.ts
index 61f5fc53..da68befd 100644
--- a/src/lib/catalog/character-swap.ts
+++ b/src/lib/catalog/character-swap.ts
@@ -10,7 +10,6 @@
* Pure module: limits, prompts, the H3 window plan, who to swap, the anchor's prompt and models, licences as data.
* The prompts follow Openjutsu's (MIT, Comfy Org 2026) and Akatz Labs' anchor brief (MIT, Akatz Labs 2026).
*/
-import { REGEN_OFFERED } from "./regenerate";
import { isSharpenTier, type SharpenTier } from "./sharpen";
import type { Engine, LoraRef, PixelPoint } from "./types";
@@ -199,11 +198,11 @@ export function characterFinish(q: string | undefined): SharpenTier | null {
}
/**
- * The qualities each engine offers: your GPU regenerates 1080p, 2K and 4K with Open-H3 Regenerate (only while it is
- * offered: REGEN_OFFERED); fal's H3 makes 2K and 4K (no 1080P).
+ * The qualities each engine offers: your GPU regenerates 1080p, 2K and 4K with Open-H3 Regenerate (a 48 GB card: the
+ * choice says so, own-setup.ts "regenerate:swap-sharpen"); fal's H3 makes 2K and 4K (no 1080P).
*/
export const CHARACTER_QUALITIES: Record<Engine, CharacterChoice[]> = {
- open: ["480p", "768p", ...(REGEN_OFFERED ? (["1080p", "2K", "4K"] as const) : [])],
+ open: ["480p", "768p", "1080p", "2K", "4K"],
cloud: ["480p", "768p", "2K", "4K"],
};
diff --git a/src/lib/catalog/models.ts b/src/lib/catalog/models.ts
index 3d485f9b..854d829a 100644
--- a/src/lib/catalog/models.ts
+++ b/src/lib/catalog/models.ts
@@ -672,8 +672,8 @@ const open: ModelDef[] = [
durations: [3, 5, 10, 15],
resolutions: ["768p"],
// 2K in the Video studio and Cinema only: a 768p draft, then Open-H3 Regenerate at 2K from it (from its latent for
- // text to video), on your GPU. Offered while Regenerate is (REGEN_OFFERED).
- ...(REGEN_OFFERED && { finishTiers: ["2K"] }),
+ // text to video), on your GPU: a 48 GB card (its chip says so, own-setup.ts "regenerate:h3-2k").
+ finishTiers: ["2K"],
seed: true,
endFrame: true,
audio: "always",
diff --git a/src/lib/catalog/regenerate.ts b/src/lib/catalog/regenerate.ts
index c9f2aa8c..c2b4d8b7 100644
--- a/src/lib/catalog/regenerate.ts
+++ b/src/lib/catalog/regenerate.ts
@@ -397,8 +397,8 @@ export const REGEN_COPY = {
/** The same refusal on an account's own ComfyUI. */
missingVisitor: "Your ComfyUI doesn't have Open-H3 Regenerate yet. Add it with Fuobe's ComfyUI setup, then run this again.",
/** The refusal when Settings → Models & licences has the refiner switched off. */
- off: "Regenerate isn't available right now. Pick Restore · faithful to sharpen the clip instead.",
- /** The refusals while Regenerate is held (REGEN_OFFERED off), for the owner and visitors alike: a run of it asked for directly. */
+ off: "Pick Restore · faithful to sharpen this clip.",
+ /** The owner's refusals while Regenerate is held on this studio's GPUs (REGEN_OFFERED off); a visitor runs it on its own GPU (server/own-setup-run.ts). */
held: "Regenerate isn't available yet. Pick Restore · faithful to sharpen the clip instead.",
/** MiniMax H3 at 2K on your GPU, whose takes it finishes. */
heldTwoK: "MiniMax H3 in 2K isn't available on your GPU yet. Pick 768p, or make it in the cloud.",
diff --git a/src/lib/catalog/sharpen.ts b/src/lib/catalog/sharpen.ts
index f697c721..b734ac3c 100644
--- a/src/lib/catalog/sharpen.ts
+++ b/src/lib/catalog/sharpen.ts
@@ -14,7 +14,7 @@
* Pure: the tiers and what each engine makes of them, the cap at the size the film is joined at, the composite's
* geometry, the windows, the copy, and the steps on your GPU.
*/
-import { REGEN_MODEL, REGEN_OFFERED, REGEN_WINDOW_SECONDS, RERENDER } from "./regenerate";
+import { REGEN_MODEL, REGEN_WINDOW_SECONDS, RERENDER } from "./regenerate";
import type { PlanStep } from "./shorts";
import type { ChainSlot, Engine, GenerationRequest } from "./types";
@@ -38,11 +38,6 @@ const sigmaOf = (v: number | undefined) => (v !== undefined && v >= SHARPEN_SIGM
/** fal's price per second of the LoRA route (the Character swap's), by resolution. */
export const SWAP_PER_SECOND: Record<"480P" | "768P" | "2K" | "4K", number> = { "480P": 0.0625, "768P": 0.075, ...RERENDER["fuobe-character-swap"].perSecond };
-/** Whether an engine sharpens: the cloud always; your GPU only while Open-H3 Regenerate is offered (REGEN_OFFERED). */
-export const sharpenOffered = (engine: Engine): boolean => engine === "cloud" || REGEN_OFFERED;
-/** Why your GPU doesn't sharpen while Open-H3 Regenerate isn't offered. */
-export const OPEN_SHARPEN_OFF = "Sharpen isn't available on your GPU. Make the project in the cloud to sharpen its takes";
-
/** The mask composite (core nodes): the hidden model and its graph. */
export const COMPOSITE_MODEL = "oss-composite-mask";
export const COMPOSITE_WORKFLOW = "video-composite-mask";
@@ -144,7 +139,6 @@ export function sharpenOptions(engine: Engine, film: { width: number; height: nu
const region = film ? redrawnRegion(film, canvas) : null;
const regionShort = region ? Math.min(region.width, region.height) : 0;
return SHARPEN_TIERS.map((tier) => {
- if (!sharpenOffered(engine)) return { tier, available: false, reason: OPEN_SHARPEN_OFF };
if (engine === "cloud" && !CLOUD_TIERS.includes(tier)) return { tier, available: false, reason: "The cloud makes 2K or 4K" };
if (engine === "open" && OPEN_TIER_OFF[tier]) return { tier, available: false, reason: OPEN_TIER_OFF[tier] };
if (!film) return { tier, available: engine === "cloud" && tier === "2K", ...(engine === "cloud" && tier === "2K" ? {} : { reason: SHARPEN_COPY.noSize }) };
diff --git a/src/lib/catalog/upscale-first.ts b/src/lib/catalog/upscale-first.ts
index 558c7fc0..ac3368be 100644
--- a/src/lib/catalog/upscale-first.ts
+++ b/src/lib/catalog/upscale-first.ts
@@ -1,4 +1,4 @@
-import { REGEN_DEFAULT_TIER, REGEN_MODEL, REGEN_OFFERED } from "./regenerate";
+import { REGEN_DEFAULT_TIER, REGEN_MODEL } from "./regenerate";
/**
* Upscale → Video's "before upscaling" steps: one list, so each finishing package adds its row here (archive-restore:
@@ -15,6 +15,8 @@ export interface UpscaleFirstStep {
href: string;
/** GPU-only (nobody hosts its model): hidden when Engine mode is "Paid APIs only". */
openOnly?: true;
+ /** It runs on the visitor's own setup (src/lib/own-setup.ts id): its label sits next to the step's. */
+ ownSetup?: string;
}
const ALL_FIRST_STEPS: UpscaleFirstStep[] = [
@@ -30,11 +32,13 @@ const ALL_FIRST_STEPS: UpscaleFirstStep[] = [
hint: "Open-H3 Regenerate redraws it at 2K on your GPU from its words: details may change; motion, layout and sound stay",
href: `/upscale/video?model=${REGEN_MODEL}&resolution=${REGEN_DEFAULT_TIER}`,
openOnly: true,
+ // A 48 GB card: the step says so, and a visitor runs it on its own GPU only.
+ ownSetup: "regenerate:upscale",
},
];
-/** The steps offered now (Regenerate only while REGEN_OFFERED is on). */
-export const UPSCALE_FIRST_STEPS: UpscaleFirstStep[] = ALL_FIRST_STEPS.filter((s) => s.id !== "regenerate" || REGEN_OFFERED);
+/** The steps offered now. */
+export const UPSCALE_FIRST_STEPS: UpscaleFirstStep[] = ALL_FIRST_STEPS;
/** The query a tool reads to switch its "then upscale" step on. */
export const THEN_UPSCALE = "upscale";
diff --git a/src/lib/output-actions.ts b/src/lib/output-actions.ts
index 560b26fe..6da58a58 100644
--- a/src/lib/output-actions.ts
+++ b/src/lib/output-actions.ts
@@ -90,6 +90,8 @@ export interface OutputAction {
/** Set on file links: the browser downloads instead of navigating. */
download?: string;
destructive?: boolean;
+ /** An item that runs on the visitor's own setup (src/lib/own-setup.ts): its label sits next to the action's. */
+ ownSetup?: string;
}
export interface ActionContext {
@@ -265,7 +267,8 @@ export function outputActions(g: Generation, index: number, ctx: ActionContext =
// delete that first checks nothing uses the file.
if (g.feature === "upload") {
// An upload's Regenerate (it has no words of its own) sits with its other hand-offs.
- if (REGEN_OFFERED && o.kind === "video" && ctx.engineMode !== "cloud") link("regenerate", "Regenerate in 2K", regenerateHref(o.url));
+ // Open-H3 Regenerate needs a 48 GB card: the item says so (own-setup.ts), and a visitor runs it on its own GPU only.
+ if (o.kind === "video" && ctx.engineMode !== "cloud") out.push({ id: "regenerate", label: "Regenerate in 2K", placement: "menu", href: regenerateHref(o.url), ownSetup: "regenerate:upscale" });
return [...out.filter((a) => a.id !== "favorite"), { id: "delete-upload", label: "Delete for good…", placement: "menu", destructive: true }];
}
if (g.outputs.length > 1) out.push({ id: "download-all", label: `Download all ${g.outputs.length} (.zip)`, placement: "menu", href: `/api/generations/zip?ids=${g.id}`, download: "" });
@@ -275,9 +278,9 @@ export function outputActions(g: Generation, index: number, ctx: ActionContext =
// results keep their upscalers in Upscale.
if (o.kind === "video" && g.status === "succeeded") {
if (canRerender(g, ctx.engineMode)) out.push({ id: "rerender-2k", label: rerenderLabel(g.modelId), placement: "menu" });
- else if (REGEN_OFFERED && (g.engine === "open" || g.feature === "upload") && ctx.engineMode !== "cloud") out.push({ id: "regenerate", label: "Regenerate in 2K", placement: "menu", href: regenerateHref(o.url, g.feature === "upload" ? null : g.request.prompt) });
- // An Edit video result (up to 15 s): redrawn at 1080p on your GPU, from the edit's own words.
- if (REGEN_OFFERED && canEnhance(g, o, ctx.engineMode)) out.push({ id: "enhance-h3", label: ENHANCE_LABEL, placement: "menu" });
+ else if ((g.engine === "open" || g.feature === "upload") && ctx.engineMode !== "cloud") out.push({ id: "regenerate", label: "Regenerate in 2K", placement: "menu", href: regenerateHref(o.url, g.feature === "upload" ? null : g.request.prompt), ownSetup: "regenerate:upscale" });
+ // An Edit video result (up to 15 s): redrawn at 1080p on your GPU, from the edit's own words (a 48 GB card).
+ if (canEnhance(g, o, ctx.engineMode)) out.push({ id: "enhance-h3", label: ENHANCE_LABEL, placement: "menu", ownSetup: "regenerate:enhance" });
}
if (ctx.compare) out.push({ id: "compare", label: "Compare with original", placement: "menu" });
if (ctx.reuse) out.push({ id: "reuse", label: "Reuse settings", placement: "menu" });
diff --git a/src/lib/studios.ts b/src/lib/studios.ts
index b52b222f..acc3bbe2 100644
--- a/src/lib/studios.ts
+++ b/src/lib/studios.ts
@@ -2,7 +2,7 @@ import { getModel } from "@/lib/catalog";
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, REGEN_OFFERED } from "@/lib/catalog/regenerate";
+import { FINISH_CHOICES, REGEN_MODEL } from "@/lib/catalog/regenerate";
import type { Preset } from "@/lib/catalog/types";
import type { StudioConfig } from "@/components/studio/studio-context";
@@ -158,8 +158,11 @@ export const VIDEO_UPSCALE_STUDIO: StudioConfig = {
// Archive footage (scans, tape, black and white) is restored and colourised first: Fuobe Restore rebuilds it, then upscales.
firstSteps: UPSCALE_FIRST_STEPS,
// On your GPU: SeedVR2 "Restore · faithful" and NVIDIA's "Quick · RTX" side by side (the row adds Quick · RTX), with
- // Open-H3 "Regenerate · creative" beside them while it is offered (GPU-only: nobody hosts it).
- finishChoices: REGEN_OFFERED ? FINISH_CHOICES : FINISH_CHOICES.filter((c) => c.modelId !== REGEN_MODEL),
+ // Open-H3 "Regenerate · creative" beside them (GPU-only: nobody hosts it). It needs a 48 GB card, so its choice says so
+ // (own-setup.ts), and a visitor runs it on its own GPU only.
+ finishChoices: FINISH_CHOICES,
+ // Open-H3 Regenerate stays out of the model list (its choice above is how it is picked); the composer still finds it.
+ extraModels: [REGEN_MODEL],
slots: [{ key: "video", label: "Video", accept: "video", required: true }],
defaultModels: { cloud: "topaz-video", open: "oss-seedvr2" },
clipFacts: true,
diff --git a/src/server/cinema.ts b/src/server/cinema.ts
index 20270e64..3f73682a 100644
--- a/src/server/cinema.ts
+++ b/src/server/cinema.ts
@@ -3,13 +3,14 @@ import { nanoid } from "nanoid";
import { getModel } from "@/lib/catalog";
import type { CinemaFolder, CinemaItem, CinemaProject, CinemaTakeInfo, CinemaTile, DirectorMessage, DirectorSettings } from "@/lib/catalog/cinema";
import { finishIn2k, REGEN_COPY, REGEN_OFFERED } from "@/lib/catalog/regenerate";
+import { ownSetupGate } from "./own-setup-run";
+import { tenant, tenantAccount } from "./tenant";
import type { Generation, GenerationRequest } from "@/lib/catalog/types";
import { createAccountProject, deleteAccountProject, getAccountProject, listAccountProjects, updateAccountProject, type AccountProject } from "./account-projects";
import { db } from "./db";
import { ConnectComfyError, createGenerations, getGeneration, listGenerations, previewChained, previewGeneration, toGeneration } from "./generations";
import { deleteForever, trashGenerations } from "./library";
import { engineMode } from "./settings";
-import { tenantAccount } from "./tenant";
/**
* Cinema Studio projects: Director settings, brief and AI Director chat per project, nested folders
@@ -902,10 +903,14 @@ export function planFinish(projectId: string, generationId: string): FinishPlan
const row = itemRow(projectId, generationId);
const g = row ? liveGeneration(generationId) : null;
if (!row || !g) throw new CinemaError("That take isn't in this project", 404);
- // A take from your GPU is finished by Open-H3 Regenerate (perSecond null): only while it is offered (REGEN_OFFERED).
+ // A take from your GPU is finished by Open-H3 Regenerate (perSecond null): a 48 GB card. An account runs it on its own
+ // GPU when that GPU fits it (own-setup-run.ts), never on this studio's; the owner's only while it is offered (REGEN_OFFERED).
const finish = finishIn2k(g, engineMode());
if (!finish) throw new CinemaError("Finish in 2K is for finished MiniMax H3 takes made below 2K", 422);
- if (finish.perSecond === null && !REGEN_OFFERED) throw new CinemaError(REGEN_COPY.heldFinish, 422);
+ if (finish.perSecond === null) {
+ if (tenant()) ownSetupGate("regenerate:cinema-finish");
+ else if (!REGEN_OFFERED) throw new CinemaError(REGEN_COPY.heldFinish, 422);
+ }
// Once per take: a 2K finish under way or made (this action's, or the 2K run's own finish of its draft) isn't repeated.
if (finishedIn2k(generationId)) throw new CinemaError("This take already has a 2K finish", 409);
const project = getProject(projectId);
diff --git a/src/server/faceless.ts b/src/server/faceless.ts
index 8a026da2..13dd4e75 100644
--- a/src/server/faceless.ts
+++ b/src/server/faceless.ts
@@ -86,6 +86,7 @@ import {
import { routesFor } from "@/lib/catalog/plan";
import { pricingAt } from "@/lib/catalog/promo";
import { REGEN_COPY, REGEN_OFFERED } from "@/lib/catalog/regenerate";
+import { ownSetupGate } from "./own-setup-run";
import type { Engine, Generation, GenerationRequest } from "@/lib/catalog/types";
import { AccountProjectError, accountProjectIds, accountProjectOwner, createAccountProject, deleteAccountProject } from "./account-projects";
import { DocxError, docxText } from "./assist/docx";
@@ -1375,8 +1376,10 @@ export function upscaleToolSteps(id: string): { request: GenerationRequest; deps
/** "Regenerate to 1080p" on this episode: offered on the open engine once the film is done (null otherwise). */
function regenerateOffer(ep: FacelessEpisode, scenes: number): EpisodeView["regenerate"] {
const modelId = ENGINE_MODELS[ep.settings.engine].regenerate;
- // Open-H3 Regenerate is held until it has run on a card that fits it (REGEN_OFFERED).
- if (!REGEN_OFFERED || !modelId || !getModel(modelId)) return null;
+ // Open-H3 Regenerate needs a 48 GB card: offered with its label (own-setup.ts "regenerate:faceless"); a run goes to
+ // the owner's GPU only once it is offered (regenerateEpisode). An account's episodes don't have it yet: its route
+ // isn't one of an account's tool runs (src/lib/guest-access.ts).
+ if (!modelId || !getModel(modelId) || tenantAccount()) return null;
let demo = false;
try {
demo = runsAsDemo(modelId, "upscale-video");
@@ -1393,8 +1396,10 @@ function regenerateOffer(ep: FacelessEpisode, scenes: number): EpisodeView["rege
*/
export function regenerateEpisode(id: string): FacelessEpisode {
const ep = mustEpisode(id);
- // Open-H3 Regenerate is held until it has run on a card that fits it (REGEN_OFFERED): nothing is made.
- if (!REGEN_OFFERED) throw new FacelessError(REGEN_COPY.heldEpisode, 422);
+ // Open-H3 Regenerate needs a 48 GB card: an account runs it on its own GPU when that GPU fits it (own-setup-run.ts),
+ // never on this studio's. The owner's waits until it has run on a card that fits it (REGEN_OFFERED): nothing is made.
+ if (tenant()) ownSetupGate("regenerate:faceless");
+ else if (!REGEN_OFFERED) throw new FacelessError(REGEN_COPY.heldEpisode, 422);
if (!ENGINE_MODELS[ep.settings.engine].regenerate) throw new FacelessError("Regenerate runs on your GPU (open source): switch the episode to open source to use it", 422);
const final = finalOf(ep);
if (!ep.plan || !final) throw new FacelessError("Wait for the episode to finish first", 409);
diff --git a/src/server/gpu/tools.ts b/src/server/gpu/tools.ts
index f8103d64..a39950f8 100644
--- a/src/server/gpu/tools.ts
+++ b/src/server/gpu/tools.ts
@@ -17,7 +17,7 @@ import { dualEngine, onEngine, runsOn } from "@/lib/catalog/engines";
import { FRAMES_MODELS } from "@/lib/catalog/keyframes";
import { PERSON_REMOVAL_TOOLS, REMOVE_TOOLS } from "@/lib/catalog/remove-object";
import { RESTORE, RESTORE_OPEN_JOIN } from "@/lib/catalog/restore";
-import { H3_LATENT_DRAFT_WORKFLOW, H3_OPEN_MODEL, REGEN_DEFAULT_TIER, REGEN_JOIN, REGEN_LATENT_WORKFLOW, REGEN_MODEL, REGEN_OFFERED, regenerateGraphLoras } from "@/lib/catalog/regenerate";
+import { H3_LATENT_DRAFT_WORKFLOW, H3_OPEN_MODEL, REGEN_DEFAULT_TIER, REGEN_JOIN, REGEN_LATENT_WORKFLOW, REGEN_MODEL, regenerateGraphLoras } from "@/lib/catalog/regenerate";
import { pikaFlexGraphLoras } from "@/lib/catalog/pika-flex";
import { RTX_FRAMEGEN_MODEL, RTX_HDR_MODEL, RTX_UPSCALE_MODEL } from "@/lib/catalog/rtx-video";
import { COMPOSITE_MODEL } from "@/lib/catalog/sharpen";
@@ -343,49 +343,39 @@ export const STUDIO_ROWS: StudioRowDef[] = [
{ href: "/audio/video", label: "Sound for video", group: "Audio", config: S.FOLEY_STUDIO },
{ href: "/upscale/video", label: "Upscale video", group: "Video tools", config: S.VIDEO_UPSCALE_STUDIO },
// Upscale → Video's Regenerate · creative (Open-H3 Regenerate with its refiner LoRA); a clip over 15 s is redrawn in
- // parts joined packet by packet. Listed only while it is offered (REGEN_OFFERED).
- ...(REGEN_OFFERED
- ? [
- {
- href: `/upscale/video?model=${REGEN_MODEL}&resolution=${REGEN_DEFAULT_TIER}`,
- label: "Regenerate in 2K",
- group: "Video tools",
- steps: [
- { modelId: REGEN_MODEL, op: "upscale-video" as const },
- { modelId: REGEN_JOIN, op: "concat" as const },
- ],
- } satisfies StudioRowDef,
- ]
- : []),
+ // parts joined packet by packet. It needs a 48 GB card: the row says what the connected GPU lacks.
+ {
+ href: `/upscale/video?model=${REGEN_MODEL}&resolution=${REGEN_DEFAULT_TIER}`,
+ label: "Regenerate in 2K",
+ group: "Video tools",
+ steps: [
+ { modelId: REGEN_MODEL, op: "upscale-video" as const },
+ { modelId: REGEN_JOIN, op: "concat" as const },
+ ],
+ } satisfies StudioRowDef,
// 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" }] },
// MiniMax H3 at 2K on your GPU (Cinema and the Video studio's 2K tier, and Finish in 2K on a take): the 768p draft that
- // keeps its latent, and the 2K finish from it. It finishes with Open-H3 Regenerate, so it is listed only while that is
- // offered (REGEN_OFFERED).
- ...(REGEN_OFFERED ? [{ href: `/video?model=${H3_OPEN_MODEL}&resolution=2K`, label: "MiniMax H3 in 2K", group: "Video", workflows: [H3_LATENT_DRAFT_WORKFLOW, REGEN_LATENT_WORKFLOW] } satisfies StudioRowDef] : []),
+ // keeps its latent, and the 2K finish from it. It finishes with Open-H3 Regenerate (a 48 GB card).
+ { href: `/video?model=${H3_OPEN_MODEL}&resolution=2K`, label: "MiniMax H3 in 2K", group: "Video", workflows: [H3_LATENT_DRAFT_WORKFLOW, REGEN_LATENT_WORKFLOW] } satisfies StudioRowDef,
// The Character swap at 1080p / 2K / 4K (Genjutsu, and Sharpen in Character Swap Studio's Finish): the 768p swap, the
// person's mask (SAM 3.1 on H3 Relay's graph), the part at 24 fps, the swap regenerated, only the character composited
- // over the footage, the windows joined and the part's sound put back. It regenerates with Open-H3 Regenerate, so it is
- // listed only while that is offered (REGEN_OFFERED).
- ...(REGEN_OFFERED
- ? [
- {
- href: "/genjutsu?mode=character",
- label: "Character swap in 2K",
- group: "Video tools",
- steps: [
- { modelId: ORIGINALS.character, op: "video-swap" as const },
- { modelId: SHARPEN_TOOLS.mask, op: "bg-remove-video" as const },
- { modelId: SHARPEN_TOOLS.fit, op: "trim" as const },
- { modelId: REGEN_MODEL, op: "upscale-video" as const },
- { modelId: COMPOSITE_MODEL, op: "composite" as const },
- { modelId: REGEN_JOIN, op: "concat" as const },
- { modelId: SHARPEN_TOOLS.mux, op: "mux" as const },
- ],
- } satisfies StudioRowDef,
- ]
- : []),
+ // over the footage, the windows joined and the part's sound put back. It regenerates with Open-H3 Regenerate (a 48 GB card).
+ {
+ href: "/genjutsu?mode=character",
+ label: "Character swap in 2K",
+ group: "Video tools",
+ steps: [
+ { modelId: ORIGINALS.character, op: "video-swap" as const },
+ { modelId: SHARPEN_TOOLS.mask, op: "bg-remove-video" as const },
+ { modelId: SHARPEN_TOOLS.fit, op: "trim" as const },
+ { modelId: REGEN_MODEL, op: "upscale-video" as const },
+ { modelId: COMPOSITE_MODEL, op: "composite" as const },
+ { modelId: REGEN_JOIN, op: "concat" as const },
+ { modelId: SHARPEN_TOOLS.mux, op: "mux" as const },
+ ],
+ } satisfies StudioRowDef,
// Upscale → Video's Kandinsky VSR (2x, 2.25x, 4x; clips up to 5 s).
{ href: "/upscale/video?model=oss-kandinsky6-vsr", label: "Kandinsky VSR", group: "Video tools", steps: [{ modelId: "oss-kandinsky6-vsr", op: "upscale-video" }] },
{ href: "/upscale/fps", label: "FPS boost", group: "Video tools", config: S.FPS_BOOST_STUDIO },
diff --git a/src/server/own-setup-run.ts b/src/server/own-setup-run.ts
new file mode 100644
index 00000000..49ded5e4
--- /dev/null
+++ b/src/server/own-setup-run.ts
@@ -0,0 +1,57 @@
+import "server-only";
+import { ownSetupDetail, ownSetupOnly } from "@/lib/own-setup";
+import type { GenerationRequest } from "@/lib/catalog/types";
+import { accountGpu } from "./auth";
+import { runnerFacts } from "./computer/tasks";
+import { AccountRunError, type AccountRunRefusal } from "./generations";
+import { ownGpu } from "./providers/comfyui";
+import { tenantAccount } from "./tenant";
+
+/**
+ * The account side of "runs with your own setup" (src/lib/own-setup.ts) for the items that need a bigger card than this
+ * studio's (Open-H3 Regenerate and what finishes with it, Kandinsky 6.0 Pro): an account runs them on its own GPU only,
+ * never on this studio's GPUs, and only when that GPU has the memory they need (when it has said how much it has).
+ * Otherwise the answer is "Connect your GPU" with the item's own words. The owner's runs are the caller's (today's rules).
+ */
+
+/** What an account's GPU last said of its memory (its Fuobe tab, or the last status check of its link), or undefined. */
+function accountVramBytes(id: string): number | undefined {
+ const gpu = accountGpu(id);
+ if (!gpu) return undefined;
+ if (gpu.mode === "computer") return runnerFacts(`acct:${id}`)?.vramBytes;
+ const hit = globalThis.__fuobeAccountGpus?.get(id);
+ return hit?.url === gpu.url ? hit.info.vramBytes : undefined;
+}
+
+/** A card sold as N GB reports a little less (a 48 GB card: about 47.5 GiB): 90% of it counts as enough. */
+const enoughVram = (bytes: number, gb: number) => bytes >= gb * 0.9 * 2 ** 30;
+
+/**
+ * Why an account's run of an own-setup item can't start where it is (null: it can): no GPU of its own in this run (none
+ * connected, or a run placed on this studio's GPUs: `place` "pool"), or one that has said it has less memory than the
+ * item needs. Null for the owner, a guest's price check, and anything that isn't a GPU-only item.
+ */
+export function ownSetupRefusal(id: string, place?: GenerationRequest["place"]): AccountRunRefusal | null {
+ const account = tenantAccount();
+ if (!account) return null;
+ const o = ownSetupOnly(id);
+ if (!o || o.need !== "gpu" || o.orKey) return null;
+ const refusal: AccountRunRefusal = { error: ownSetupDetail(o), code: "connect-gpu" };
+ // On this studio's GPUs, outside the account's own, or with none connected.
+ if (place === "pool" || !ownGpu() || !accountGpu(account)) return refusal;
+ const vram = accountVramBytes(account);
+ if (o.vramGb && vram !== undefined && !enoughVram(vram, o.vramGb)) return refusal;
+ return null;
+}
+
+/** ownSetupRefusal, thrown as the account's refusal the routes answer with 403 and the "Connect your GPU" card. */
+export function ownSetupGate(id: string, place?: GenerationRequest["place"]): void {
+ const r = ownSetupRefusal(id, place);
+ if (r) throw new AccountRunError(r);
+}
+
+/** The own-setup item a request's settings ask for, beside its model's own: Kandinsky 6.0 (open) at Pro quality. */
+export function requestOwnSetupItem(req: Pick<GenerationRequest, "modelId" | "params">): string | undefined {
+ if (req.modelId === "oss-kandinsky6" && req.params?.extra?.quality === "pro") return "oss-kandinsky6:pro";
+ return undefined;
+}
diff --git a/src/server/regenerate.ts b/src/server/regenerate.ts
index bab24bbc..cbfcb852 100644
--- a/src/server/regenerate.ts
+++ b/src/server/regenerate.ts
@@ -28,6 +28,7 @@ import type { Generation, GenerationRequest, ModelDef } from "@/lib/catalog/type
import { fileAccount } from "./account-library";
import { db } from "./db";
import { offeredLoras } from "./model-access";
+import { ownSetupGate, requestOwnSetupItem } from "./own-setup-run";
import { filesRel, storedMedia } from "./storage";
import { tenant, tenantAccount } from "./tenant";
@@ -71,15 +72,25 @@ export function regenSwitchedOff(): string | undefined {
}
/**
- * Why a run can't start while Open-H3 Regenerate is held (REGEN_OFFERED: it hasn't run on a card that fits it yet), for
- * the owner and visitors alike: a Regenerate run however it is asked for (Upscale → Video, Edit video's Enhance, a Canvas
- * node, a skill, a studio's steps, the API), and MiniMax H3 at 2K on your GPU, whose takes it finishes. In plain words for
- * what was asked; undefined while it is offered, and for any other run.
+ * Why a run can't start while Open-H3 Regenerate is held on this studio's GPUs (REGEN_OFFERED: it hasn't run on a card
+ * that fits it yet): a Regenerate run however it is asked for (Upscale → Video, Edit video's Enhance, a Canvas node, a
+ * skill, a studio's steps, the API), and MiniMax H3 at 2K on your GPU, whose takes it finishes. The owner gets plain words
+ * for what was asked. An account runs it on its own GPU when that GPU has the memory (own-setup-run.ts), and otherwise
+ * gets "Connect your GPU" (thrown); never on this studio's GPUs. Undefined while it is offered, and for any other run.
*/
-export function regenHeld(req: Pick<GenerationRequest, "feature" | "modelId" | "params">): string | undefined {
- if (REGEN_OFFERED) return undefined;
- if (wantsH3TwoK(req.modelId, req.params?.resolution)) return REGEN_COPY.heldTwoK;
- if (req.modelId !== REGEN_MODEL) return undefined;
+export function regenHeld(req: Pick<GenerationRequest, "feature" | "modelId" | "params" | "place">): string | undefined {
+ const twoK = wantsH3TwoK(req.modelId, req.params?.resolution);
+ const regen = twoK || req.modelId === REGEN_MODEL;
+ // An account (own-setup.ts): an item that needs a bigger card than most (Open-H3 Regenerate and MiniMax H3's 2K that
+ // finishes with it, Kandinsky 6.0 Pro) runs on its own GPU with the memory it needs, never on this studio's
+ // (ownSetupGate answers "Connect your GPU" otherwise). A guest's price check is priced as the open run.
+ const item = requestOwnSetupItem(req) ?? (!regen ? undefined : twoK ? "regenerate:h3-2k" : ENHANCE_FEATURES.has(req.feature) ? "regenerate:enhance" : REGEN_MODEL);
+ if (item && tenant()) {
+ ownSetupGate(item, req.place);
+ return undefined;
+ }
+ if (REGEN_OFFERED || !regen) return undefined;
+ if (twoK) return REGEN_COPY.heldTwoK;
return ENHANCE_FEATURES.has(req.feature) ? REGEN_COPY.heldEnhance : REGEN_COPY.held;
}
diff --git a/src/server/shorts.ts b/src/server/shorts.ts
index 8d2acb8d..d0aa206a 100644
--- a/src/server/shorts.ts
+++ b/src/server/shorts.ts
@@ -58,6 +58,7 @@ import { firstOn } from "./model-access";
import { engineMode } from "./settings";
import { readRef, RefError } from "./storage";
import { mediaFacts, type SourceInfo } from "./media-facts";
+import { ownSetupGate } from "./own-setup-run";
import { tenant } from "./tenant";
/**
@@ -773,8 +774,10 @@ export function regenerateSegment(id: string, index: number): ShortsSessionView
export function enhanceSegment(id: string, index: number): ShortsSessionView {
const s = readSession(id);
const seg = segmentAt(s, index);
- // Open-H3 Regenerate is held until it has run on a card that fits it (REGEN_OFFERED): nothing is made.
- if (!REGEN_OFFERED) throw new ShortsError(REGEN_COPY.heldEnhance, 422);
+ // Open-H3 Regenerate needs a 48 GB card: an account runs it on its own GPU when that GPU fits it (own-setup-run.ts),
+ // never on this studio's. The owner's waits until it has run on a card that fits it (REGEN_OFFERED): nothing is made.
+ if (tenant()) ownSetupGate("regenerate:enhance");
+ else if (!REGEN_OFFERED) throw new ShortsError(REGEN_COPY.heldEnhance, 422);
if (s.engine !== "open") throw new ShortsError(ENHANCE_COPY.cloudSession, 422);
checkEngine("open");
const take = seg.takes.find((t) => t.look === seg.primary);
diff --git a/tests/own-setup-hw.test.ts b/tests/own-setup-hw.test.ts
new file mode 100644
index 00000000..716f728a
--- /dev/null
+++ b/tests/own-setup-hw.test.ts
@@ -0,0 +1,132 @@
+import { afterAll, beforeAll, describe, expect, it } from "vitest";
+import { tempDir } from "./helpers/temp-dir";
+
+// The items that need more than this studio's GPU has (Open-H3 Regenerate and everything that finishes with it, and
+// Kandinsky 6.0 Pro): every visitor sees them with a plain label (src/lib/own-setup.ts), a guest's press asks it to sign
+// up, and an account runs them on its own GPU only, when that GPU has the memory, never on this studio's GPUs. The
+// owner keeps today's rules (tests/regenerate-held.test.ts).
+
+const dir = tempDir("fuobe-own-setup-hw-");
+process.env.FUOBE_DATA_DIR = dir;
+process.env.COMFYUI_URL = "http://127.0.0.1:9";
+process.env.FUOBE_PUBLIC_SIGNUP = "1";
+delete process.env.FUOBE_PASSWORD;
+delete process.env.FUOBE_HOSTED_RUNS;
+
+const auth = await import("@/server/auth");
+const { runAsTenant } = await import("@/server/tenant");
+const { asAccount, AccountRunError } = await import("@/server/generations");
+const { ownSetupGate, ownSetupRefusal, requestOwnSetupItem } = await import("@/server/own-setup-run");
+const { regenHeld } = await import("@/server/regenerate");
+const { ownSetupDetail, ownSetupLabel, ownSetupOnly, ownSetupShort, ownSetupStep } = await import("@/lib/own-setup");
+const R = await import("@/lib/catalog/regenerate");
+
+/** The same words tests/own-setup.test.ts keeps out of every label. */
+const BANNED = /untested|not tested|unverified|not verified|not validated|validat|isn['’]t available|not available|unavailable|coming soon|held|owner|beta|experimental|soon/i;
+
+const HW_IDS = ["oss-h3-regenerate", "regenerate:upscale", "regenerate:h3-2k", "regenerate:cinema-finish", "regenerate:enhance", "regenerate:faceless", "regenerate:swap-sharpen", "oss-kandinsky6:pro"];
+
+let bare = "";
+let linked = "";
+beforeAll(() => {
+ auth.setPassword("install password");
+ bare = auth.createAccount("[email protected]", "long enough").id;
+ linked = auth.createAccount("[email protected]", "long enough").id;
+ auth.setAccountGpu(linked, { url: "https://gpu.example.com" });
+});
+afterAll(() => {
+ globalThis.__fuobeAccountGpus?.delete(linked);
+});
+
+/** What the account's GPU last said of its memory, as a status check leaves it. */
+const reports = (gb: number) => (globalThis.__fuobeAccountGpus ??= new Map()).set(linked, { url: "https://gpu.example.com", at: Date.now(), online: true, info: { vramBytes: gb * 2 ** 30 } });
+
+describe("hardware items: what a visitor sees", () => {
+ it("names a GPU setup for each, with the memory it needs and no status words", () => {
+ for (const id of HW_IDS) {
+ const o = ownSetupOnly(id);
+ expect(o, id).not.toBeNull();
+ expect(o!.need, id).toBe("gpu");
+ for (const words of [ownSetupLabel(o!), ownSetupShort(o!), ownSetupDetail(o!)]) expect(words, id).not.toMatch(BANNED);
+ }
+ expect(ownSetupLabel(ownSetupOnly("regenerate:upscale")!)).toBe("Runs on your own GPU · 48 GB");
+ expect(ownSetupLabel(ownSetupOnly("oss-kandinsky6:pro")!)).toBe("Runs on your own GPU · 80 GB");
+ // Kandinsky 6.0 itself (Lite) runs as any other open model.
+ expect(ownSetupOnly("oss-kandinsky6")).toBeNull();
+ });
+
+ it("a guest's press asks it to sign up; an account without a GPU connects one (no key runs these); the owner runs", () => {
+ const o = ownSetupOnly("regenerate:upscale");
+ expect(ownSetupStep(o, { kind: "guest" })).toEqual({ kind: "sign-up" });
+ expect(ownSetupStep(o, { kind: "account", gpu: { connected: false }, keys: ["fal"] })).toEqual({ kind: "connect-gpu", gpuOnly: true });
+ expect(ownSetupStep(o, { kind: "account", gpu: { connected: true } })).toEqual({ kind: "run" });
+ expect(ownSetupStep(o, null)).toEqual({ kind: "run" });
+ });
+});
+
+describe("hardware items: where an account's run goes", () => {
+ it("asks an account with no GPU of its own to connect one, in the item's own words, never own-gpu-tool", () => {
+ asAccount(bare, () => {
+ const r = ownSetupRefusal("regenerate:h3-2k");
+ expect(r).toEqual({ error: ownSetupDetail(ownSetupOnly("regenerate:h3-2k")!), code: "connect-gpu" });
+ expect(() => ownSetupGate("regenerate:h3-2k")).toThrow(AccountRunError);
+ });
+ });
+
+ it("runs on the account's own GPU when it has the memory, or hasn't said yet; a smaller card connects a bigger one", () => {
+ asAccount(linked, () => {
+ expect(ownSetupRefusal("oss-h3-regenerate")).toBeNull();
+ reports(47.5);
+ expect(ownSetupRefusal("oss-h3-regenerate")).toBeNull();
+ reports(32);
+ expect(ownSetupRefusal("oss-h3-regenerate")?.code).toBe("connect-gpu");
+ reports(80);
+ expect(ownSetupRefusal("oss-kandinsky6:pro")).toBeNull();
+ reports(48);
+ expect(ownSetupRefusal("oss-kandinsky6:pro")?.code).toBe("connect-gpu");
+ });
+ });
+
+ it("never goes on this studio's GPUs", () => {
+ reports(96);
+ asAccount(linked, () => expect(ownSetupRefusal("oss-h3-regenerate", "pool")?.code).toBe("connect-gpu"));
+ // Outside the account's own GPU scope.
+ runAsTenant({ kind: "account", id: linked }, () => expect(ownSetupRefusal("oss-h3-regenerate")?.code).toBe("connect-gpu"));
+ });
+
+ it("leaves the owner's and a guest's price check to today's rules", () => {
+ expect(ownSetupRefusal("oss-h3-regenerate")).toBeNull();
+ runAsTenant({ kind: "guest" }, () => expect(ownSetupRefusal("oss-h3-regenerate")).toBeNull());
+ });
+
+ it("checks every way a run asks for them: Regenerate, Enhance, H3 in 2K and Kandinsky 6.0 Pro", () => {
+ expect(requestOwnSetupItem({ modelId: "oss-kandinsky6", params: { extra: { quality: "pro" } } })).toBe("oss-kandinsky6:pro");
+ expect(requestOwnSetupItem({ modelId: "oss-kandinsky6", params: { extra: { quality: "lite" } } })).toBeUndefined();
+ const asks = [
+ { feature: "upscale", modelId: R.REGEN_MODEL },
+ { feature: "video-edit", modelId: R.REGEN_MODEL },
+ { feature: "video", modelId: R.H3_OPEN_MODEL, params: { resolution: "2K" } },
+ { feature: "video", modelId: "oss-kandinsky6", params: { extra: { quality: "pro" } } },
+ ];
+ for (const ask of asks) {
+ asAccount(bare, () => {
+ let code: string | undefined;
+ try {
+ regenHeld(ask);
+ } catch (e) {
+ code = (e as InstanceType<typeof AccountRunError>).refusal?.code;
+ }
+ expect(code, ask.modelId).toBe("connect-gpu");
+ });
+ }
+ // An account's 768p H3 and Kandinsky Lite are anyone's runs.
+ asAccount(bare, () => {
+ expect(regenHeld({ feature: "video", modelId: R.H3_OPEN_MODEL, params: { resolution: "768p" } })).toBeUndefined();
+ expect(regenHeld({ feature: "video", modelId: "oss-kandinsky6", params: { extra: { quality: "lite" } } })).toBeUndefined();
+ });
+ // The owner's: today's plain words while it is held on this studio's GPUs, and Kandinsky Pro as before.
+ expect(regenHeld({ feature: "upscale", modelId: R.REGEN_MODEL })).toBe(R.REGEN_COPY.held);
+ expect(regenHeld({ feature: "video", modelId: R.H3_OPEN_MODEL, params: { resolution: "2K" } })).toBe(R.REGEN_COPY.heldTwoK);
+ expect(regenHeld({ feature: "video", modelId: "oss-kandinsky6", params: { extra: { quality: "pro" } } })).toBeUndefined();
+ });
+});
diff --git a/tests/regenerate-held.test.ts b/tests/regenerate-held.test.ts
index 4e9911de..6c81174b 100644
--- a/tests/regenerate-held.test.ts
+++ b/tests/regenerate-held.test.ts
@@ -6,10 +6,11 @@ import type { Generation, GenerationRequest } from "@/lib/catalog/types";
import { TINY_MP4 } from "./helpers/fake-comfy-runner";
import { tempDir } from "./helpers/temp-dir";
-// Open-H3 Regenerate is held until it has run on a card that fits it (REGEN_OFFERED, off). Nothing offers it
-// (tests/regenerate-offered.test.ts), and the server refuses every way in too, in plain words and before anything is
-// made: a run of it sent straight to the API (Upscale → Video, Edit video's Enhance, a Canvas or skill step), MiniMax H3
-// at 2K on your GPU, Shorts' Enhance, Faceless's Regenerate to 1080p and Cinema's Finish in 2K on a take from your GPU.
+// Open-H3 Regenerate is held on this studio's GPUs until it has run on a card that fits it (REGEN_OFFERED, off). It shows
+// for everyone with what it needs (tests/regenerate-offered.test.ts), and an account runs it on its own GPU (a 48 GB card,
+// src/lib/own-setup.ts). For the owner the server refuses every way in, in plain words and before anything is made: a run
+// of it sent straight to the API (Upscale → Video, Edit video's Enhance, a Canvas or skill step), MiniMax H3 at 2K on
+// your GPU, Shorts' Enhance, Faceless's Regenerate to 1080p and Cinema's Finish in 2K on a take from your GPU.
// The tests that mock it on check each of them as it runs once it is switched on.
vi.setConfig({ testTimeout: 120_000 });
@@ -24,6 +25,7 @@ delete process.env.FUOBE_HOSTED_RUNS;
globalThis.__fuobeTestDiskFree = 1e13;
const R = await import("@/lib/catalog/regenerate");
+const { ownSetupDetail, ownSetupOnly } = await import("@/lib/own-setup");
const auth = await import("@/server/auth");
const { setSetting } = await import("@/server/settings");
const gens = await import("@/server/generations");
@@ -131,11 +133,18 @@ describe("Open-H3 Regenerate while it is held", () => {
await refused(() => post(asked), R.REGEN_COPY.heldEnhance);
});
- it("refuses an account's run of it, or of H3 in 2K, on its own GPU in the same plain words", async () => {
- await refused(() => post(regen(clip(account)), { cookie: accountCookie }), R.REGEN_COPY.held);
- await refused(() => post(regen(clip(account)), { cookie: accountCookie, preview: true }), R.REGEN_COPY.held);
- await refused(() => post(twoK, { cookie: accountCookie }), R.REGEN_COPY.heldTwoK);
- await refused(() => post(twoK, { cookie: accountCookie, preview: true }), R.REGEN_COPY.heldTwoK);
+ it("asks an account with no GPU of its own to connect one (a 48 GB card), never with the owner's words", async () => {
+ const detail = ownSetupDetail(ownSetupOnly(R.REGEN_MODEL)!);
+ for (const body of [regen(clip(account)), twoK]) {
+ const before = count();
+ const r = await post(body, { cookie: accountCookie });
+ expect(r.status, await r.clone().text()).toBe(403);
+ expect(r.headers.get("x-fuobe-connect-gpu")).toBe("1");
+ const answer = (await r.json()) as { error: string; code: string };
+ expect(answer).toEqual({ error: detail, code: "connect-gpu" });
+ expect(answer.error).not.toMatch(/isn't available|held|yet/);
+ expect(count()).toBe(before);
+ }
});
it("refuses it as any tool's step: a Canvas node, a step that waits for another, a 2K take whose words come from a text node", async () => {
diff --git a/tests/regenerate-more-hosted.test.ts b/tests/regenerate-more-hosted.test.ts
index c946a2d8..282f4f00 100644
--- a/tests/regenerate-more-hosted.test.ts
+++ b/tests/regenerate-more-hosted.test.ts
@@ -6,11 +6,11 @@ import { afterAll, beforeAll, beforeEach, describe, expect, it, vi } from "vites
import { listenInRange, startFakeBilling, type FakeBilling } from "./helpers/fake-billing";
import { startFakeComfy, type FakeComfy } from "./helpers/fake-comfy-runner";
-// MiniMax H3 at 2K with hosted runs on (review 6 of package n7-10): an account's 2K run on this install's GPUs is planned
-// and priced with each take's Open-H3 Regenerate finish beside its 768p draft, and a policy that keeps the finish's model
-// off those GPUs keeps the whole run off, priced or run.
+// MiniMax H3 at 2K with hosted runs on: an account's 2K run finishes with Open-H3 Regenerate, which needs a 48 GB card,
+// so it never goes on this install's GPUs (src/lib/own-setup.ts): it runs on the account's own GPU. Its 768p draft
+// alone still runs here.
// Regenerate is switched off for now (REGEN_OFFERED); these tests check it as it runs once switched on.
-// tests/regenerate-offered.test.ts checks that nothing offers it while it is off.
+// tests/regenerate-offered.test.ts checks where it is offered.
vi.mock("@/lib/catalog/regenerate", async (importOriginal) => ({ ...(await importOriginal<typeof import("@/lib/catalog/regenerate")>()), REGEN_OFFERED: true }));
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "fuobe-regen-hosted-"));
process.env.FUOBE_DATA_DIR = dir;
@@ -59,28 +59,21 @@ beforeEach(() => {
});
const twoK = (resolution = "2K") => ({ feature: "video", modelId: R.H3_OPEN_MODEL, op: "t2v" as const, prompt: "A lighthouse in a storm", params: { resolution, duration: 5, numOutputs: 2 } });
-const finishes = (n: number) => Array.from({ length: n }, () => ({ model: R.REGEN_MODEL, op: "upscale-video" }));
describe("MiniMax H3 at 2K on this install's GPUs", () => {
- it("plans and prices each take's finish beside its draft", async () => {
- const place = await decidePlace(auth.accountById(a)!, twoK(), undefined);
- expect(place.kind).toBe("pool");
- if (place.kind !== "pool") return;
- expect(place.planned.model.id).toBe(R.H3_OPEN_MODEL);
- expect(place.planned.steps).toEqual(finishes(2));
- const before = fake.calls_of("/v1/quote").length;
- const quoted = await poolQuote(auth.accountById(a)!, twoK(), undefined);
- expect(quoted?.planned.steps).toEqual(finishes(2));
- const sent = fake.calls_of("/v1/quote").slice(before).at(-1)?.body as { run: { model: string; jobs: number; steps?: unknown } };
- expect(sent.run).toMatchObject({ model: R.H3_OPEN_MODEL, jobs: 2, steps: finishes(2) });
- // 768p is the model alone.
- expect((await poolQuote(auth.accountById(a)!, twoK("768p"), undefined))?.planned.steps).toBeUndefined();
+ it("never goes on these GPUs: its Open-H3 Regenerate finish needs a 48 GB card, so it runs on the account's own GPU", async () => {
+ expect(await poolQuote(auth.accountById(a)!, twoK(), undefined)).toBeNull();
+ expect((await decidePlace(auth.accountById(a)!, twoK(), undefined)).kind).not.toBe("pool");
+ // 768p is the model alone, and runs here.
+ const draft = await decidePlace(auth.accountById(a)!, twoK("768p"), undefined);
+ expect(draft.kind).toBe("pool");
+ if (draft.kind === "pool") expect(draft.planned.steps).toBeUndefined();
});
- it("a policy that keeps Open-H3 Regenerate off these GPUs keeps the 2K run off; 768p still runs here", async () => {
+ it("a policy that keeps Open-H3 Regenerate off these GPUs changes nothing for 768p", async () => {
fake.policy = { ...fake.policy, pool: { deny: [R.REGEN_MODEL] } };
expect(await poolQuote(auth.accountById(a)!, twoK(), undefined)).toBeNull();
- expect((await decidePlace(auth.accountById(a)!, twoK(), undefined)).kind).toBe("refuse");
+ expect((await decidePlace(auth.accountById(a)!, twoK(), undefined)).kind).not.toBe("pool");
expect((await decidePlace(auth.accountById(a)!, twoK("768p"), undefined)).kind).toBe("pool");
});
});
diff --git a/tests/regenerate-offered.test.ts b/tests/regenerate-offered.test.ts
index e2b351f3..0d09a2eb 100644
--- a/tests/regenerate-offered.test.ts
+++ b/tests/regenerate-offered.test.ts
@@ -5,14 +5,14 @@ import { UPSCALE_FIRST_STEPS } from "@/lib/catalog/upscale-first";
import { VIDEO_UPSCALE_STUDIO } from "@/lib/studios";
import { getModel } from "@/lib/catalog";
import { paletteItems } from "@/lib/catalog/canvas";
-import { nextSteps, outputActions } from "@/lib/output-actions";
+import { outputActions } from "@/lib/output-actions";
import { HUB_MODES } from "@/lib/hubs";
import { CHARACTER_QUALITIES } from "@/lib/catalog/character-swap";
import { MAKERS } from "@/lib/catalog/genjutsu";
-import { OPEN_SHARPEN_OFF, sharpenOffered, sharpenOptions } from "@/lib/catalog/sharpen";
+import { sharpenOptions } from "@/lib/catalog/sharpen";
import { STUDIO_ROWS } from "@/server/gpu/tools";
-// Regenerate · creative is switched off until it has run on a card that fits it; Restore & colourise and Remove
+// Regenerate · creative shows for everyone with what it needs (a 48 GB card) and runs on the visitor's own GPU; Restore & colourise and Remove
// dialogue run on a self-hosted Fuobe only, so a guest or an account is never sent to them.
const out = (url = "/api/files/a.mp4"): OutputFile => ({ url, kind: "video" }) as OutputFile;
@@ -44,37 +44,41 @@ const gen = (p: Partial<Generation> = {}): Generation =>
const ids = (g: Generation, ctx = {}) => outputActions(g, 0, ctx).map((a) => a.id);
const upload = () => gen({ feature: "upload", modelId: "upload", provider: "mock" as Generation["provider"], prompt: null, request: { feature: "upload", modelId: "upload" } });
-describe("Regenerate while it is switched off", () => {
- it("is off", () => {
+describe("Regenerate shows for everyone with what it needs, and runs on the visitor's own GPU", () => {
+ it("is still off on this studio's GPUs", () => {
expect(REGEN_OFFERED).toBe(false);
});
- it("is not a step before upscaling, a finishing choice, a model to pick or a Canvas node", () => {
- expect(UPSCALE_FIRST_STEPS.map((s) => s.id)).not.toContain("regenerate");
- expect(UPSCALE_FIRST_STEPS.map((s) => s.id)).toContain("restore");
- // The finishing row stays, with Restore · faithful (and Quick · RTX, which the row adds), and no Regenerate.
- expect(VIDEO_UPSCALE_STUDIO.finishChoices?.map((c) => c.modelId)).toEqual(["oss-seedvr2"]);
+ it("is a step before upscaling, a finishing choice and a Canvas node, each with its own-setup id", () => {
+ expect(UPSCALE_FIRST_STEPS.map((s) => s.id)).toEqual(["restore", "regenerate"]);
+ expect(UPSCALE_FIRST_STEPS.find((s) => s.id === "regenerate")?.ownSetup).toBe("regenerate:upscale");
+ // Restore · faithful stays first, the default; Regenerate · creative sits beside it.
+ expect(VIDEO_UPSCALE_STUDIO.finishChoices?.map((c) => c.modelId)).toEqual(["oss-seedvr2", "oss-h3-regenerate"]);
+ expect(VIDEO_UPSCALE_STUDIO.defaultModels.open).toBe("oss-seedvr2");
+ expect(VIDEO_UPSCALE_STUDIO.extraModels).toContain("oss-h3-regenerate");
+ // Out of the model lists (its choice is how it is picked).
expect(getModel("oss-h3-regenerate")?.hidden).toBe(true);
- expect(paletteItems("both").map((p) => p.id)).not.toContain("upscale-regenerate");
+ expect(paletteItems("both").find((p) => p.id === "upscale-regenerate")?.data?.modelId).toBe("oss-h3-regenerate");
});
- it("leaves the Character swap's 1080p / 2K / 4K on your GPU out, and keeps the cloud's 2K / 4K", () => {
- expect(CHARACTER_QUALITIES.open).toEqual(["480p", "768p"]);
+ it("offers the Character swap's 1080p / 2K / 4K on your GPU, sharpens on both engines, and lists the GPU checks", () => {
+ expect(CHARACTER_QUALITIES.open).toEqual(["480p", "768p", "1080p", "2K", "4K"]);
expect(CHARACTER_QUALITIES.cloud).toEqual(["480p", "768p", "2K", "4K"]);
- for (const m of MAKERS.filter((m) => m.h3 && m.engine === "open")) expect(m.qualities).toEqual(["480p", "768p"]);
- expect(sharpenOffered("open")).toBe(false);
- expect(sharpenOffered("cloud")).toBe(true);
+ for (const m of MAKERS.filter((m) => m.h3 && m.engine === "open")) expect(m.qualities).toEqual(["480p", "768p", "1080p", "2K", "4K"]);
const film = { width: 1920, height: 1080 };
- expect(sharpenOptions("open", film).every((o) => !o.available && o.reason === OPEN_SHARPEN_OFF)).toBe(true);
+ expect(sharpenOptions("open", film).find((o) => o.tier === "1080p")?.available).toBe(true);
expect(sharpenOptions("cloud", film).find((o) => o.tier === "2K")?.available).toBe(true);
- expect(STUDIO_ROWS.map((r) => r.label)).not.toContain("Character swap in 2K");
- expect(STUDIO_ROWS.map((r) => r.label)).not.toContain("Regenerate in 2K");
+ expect(STUDIO_ROWS.map((r) => r.label)).toEqual(expect.arrayContaining(["Character swap in 2K", "Regenerate in 2K", "MiniMax H3 in 2K"]));
});
- it("is not offered on a clip or an upload", () => {
- expect(ids(gen())).not.toContain("regenerate");
- expect(ids(upload())).not.toContain("regenerate");
- expect(nextSteps(gen(), 0, 5).map((a) => a.id)).not.toContain("regenerate");
+ it("is offered on a clip and an upload, with its label; Enhance on an Edit video result too", () => {
+ const regen = outputActions(gen(), 0, { visitor: true }).find((a) => a.id === "regenerate");
+ expect(regen?.ownSetup).toBe("regenerate:upscale");
+ expect(ids(upload(), { visitor: true })).toContain("regenerate");
+ const edit = gen({ feature: "video-edit", request: { feature: "video-edit", modelId: "oss-minimax-h3", prompt: "x", params: { duration: 5 } } });
+ expect(outputActions(edit, 0, { visitor: true }).find((a) => a.id === "enhance-h3")?.ownSetup).toBe("regenerate:enhance");
+ // Not on Paid APIs only (nobody hosts it).
+ expect(ids(gen(), { engineMode: "cloud" })).not.toContain("regenerate");
});
});