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.

Hold Regenerate in 2K; keep self-hosted tools out of visitors' menus

Adarsha016d2fe9f25
diff --git a/docs/public-signup.md b/docs/public-signup.md
index 7311a73c..4ce7a870 100644
--- a/docs/public-signup.md
+++ b/docs/public-signup.md
@@ -202,8 +202,10 @@ cloudflared tunnel --url http://localhost:8188 # or: ngrok http 8188
answer the same for now: a 3D model is finished on the server. So do the Audio hub's Split
soundtrack and Video tools → Remove dialogue (both `POST /api/audio-tools`) and the turnaround
video (`POST /api/turnaround`), though their price checks work, priced for the account's own
- GPU. Split soundtrack's and Remove dialogue's pages say so up front ("runs on a self-hosted
- Fuobe for now", "Self-hosted only"), with their upload and run off.
+ GPU. Split soundtrack's and Remove dialogue's pages say so up front ("Split soundtrack isn't
+ available here", "Remove dialogue isn't available here"), with their upload and run off. Remove
+ dialogue and Restore & colourise are also left out of the Video tools tabs and the result menus for a
+ guest or an account.
- **Files a run takes.** A run on your GPU takes only files you uploaded here, or your own results.
A link or a `data:` URI answers 400 with `code: "input-not-allowed"`, someone else's file 403
(`input-not-yours`), and a file that has expired 404 (`input-gone`, "That file has expired.
diff --git a/src/components/restore/old-footage.tsx b/src/components/restore/old-footage.tsx
index 0e4c5305..8385dd96 100644
--- a/src/components/restore/old-footage.tsx
+++ b/src/components/restore/old-footage.tsx
@@ -4,6 +4,7 @@ import { ArrowUpRight, Palette } from "lucide-react";
import Link from "next/link";
import { useEffect, useState } from "react";
import { meanChroma, MONOCHROME_CHROMA, restoreHref } from "@/lib/catalog/restore";
+import { useLikelyVisitor } from "@/lib/api";
import { cn } from "@/lib/utils";
/** The mean chroma of a few small frames of a clip, read in the browser (null when it can't be read). */
@@ -65,7 +66,9 @@ export function useLooksMonochrome(src: string | undefined): boolean | null {
* work here stays; the restored clip lands in the Library, to pick here.
*/
export function OldFootageOffer({ url, src, className }: { url?: string; src?: string; className?: string }) {
- const mono = useLooksMonochrome(src ?? url);
+ const visitor = useLikelyVisitor();
+ const mono = useLooksMonochrome(visitor ? undefined : (src ?? url));
+ if (visitor) return null;
return (
<p className={cn("flex gap-1.5 text-[12px] leading-snug", mono ? "text-foreground" : "text-muted-foreground", className)}>
<Palette className={cn("mt-0.5 size-3.5 shrink-0", mono && "text-brand-text")} />
diff --git a/src/components/studio/feed.tsx b/src/components/studio/feed.tsx
index bbace00d..5a587f28 100644
--- a/src/components/studio/feed.tsx
+++ b/src/components/studio/feed.tsx
@@ -17,7 +17,7 @@ import {
} from "@/components/ui/dropdown-menu";
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
import { OPERATION_LABELS, type Generation } from "@/lib/catalog/types";
-import { useCreateGeneration, useEngineMode, useGenerationActions } from "@/lib/api";
+import { useCreateGeneration, useEngineMode, useGenerationActions, useLikelyVisitor } from "@/lib/api";
import { useSoulFinish } from "./soul-finish";
import { elapsed, formatCost, leftLabel, notePace, ratioValue, timeAgo, timeLeft } from "@/lib/format";
import { downloadHref, downloadName, userTitle } from "@/lib/library";
@@ -273,7 +273,8 @@ const OutputTile = memo(function OutputTile({ g, index, ratio, layered, count }:
*/
function NextSteps({ g, index }: { g: Generation; index: number }) {
const engineMode = useEngineMode();
- const steps = nextSteps(g, index, 3, { engineMode });
+ const visitor = useLikelyVisitor();
+ const steps = nextSteps(g, index, 3, { engineMode, visitor });
if (!steps.length) return null;
return (
<nav aria-label="Next steps" className="flex flex-wrap gap-1.5">
diff --git a/src/components/studio/mode-studio.tsx b/src/components/studio/mode-studio.tsx
index 7e1fbc37..b9a2c212 100644
--- a/src/components/studio/mode-studio.tsx
+++ b/src/components/studio/mode-studio.tsx
@@ -3,6 +3,7 @@
import Link from "next/link";
import { useEffect, useRef } from "react";
import type { StudioCatalog } from "@/lib/studio-catalog";
+import { useLikelyVisitor } from "@/lib/api";
import { cn } from "@/lib/utils";
import { StudioPage } from "./studio-page";
import type { StudioConfig } from "./studio-context";
@@ -12,6 +13,8 @@ export interface ModeTab {
id: string;
label: string;
href: string;
+ /** Left out for a guest or an account (a tool that runs on a self-hosted Fuobe only), unless it is the page shown. */
+ ownerOnly?: true;
}
/** A tab chosen with the keyboard: the next mode's tabs (each mode's page draws its own) take the focus back. */
@@ -24,6 +27,8 @@ let refocus = false;
export function ModeTabs({ tabs, current }: { tabs: ModeTab[]; current: string }) {
const [ref, fade] = useEdgeFade<HTMLDivElement>();
const active = useRef<HTMLAnchorElement>(null);
+ const visitor = useLikelyVisitor();
+ const shown = visitor ? tabs.filter((m) => !m.ownerOnly || m.id === current) : tabs;
// Keep the selected tab in view when the row scrolls (only the row: the page stays put).
useEffect(() => {
const el = active.current;
@@ -39,7 +44,7 @@ export function ModeTabs({ tabs, current }: { tabs: ModeTab[]; current: string }
return (
<nav aria-label="Modes" className="border-b">
<div ref={ref} style={fade} className="scrollbar-none flex gap-1 overflow-x-auto px-3 sm:px-6">
- {tabs.map((m) => {
+ {shown.map((m) => {
const on = m.id === current;
return (
<Link
diff --git a/src/components/studio/mode-switch-studio.tsx b/src/components/studio/mode-switch-studio.tsx
index b3cbf548..0b2f6e94 100644
--- a/src/components/studio/mode-switch-studio.tsx
+++ b/src/components/studio/mode-switch-studio.tsx
@@ -85,7 +85,7 @@ const HUB_TITLE: Record<HubKind, string> = { upscale: "Upscale", audio: "Audio",
*/
export function ModeSwitchStudio({ kind, mode }: { kind: HubKind; mode?: string }) {
const current = mode ?? HUB_MODES[kind][0].id;
- const tabs = HUB_MODES[kind].map((m) => ({ id: m.id, label: m.label, href: modeHref(kind, m.id) }));
+ const tabs = HUB_MODES[kind].map((m) => ({ id: m.id, label: m.label, href: modeHref(kind, m.id), ...(m.ownerOnly && { ownerOnly: true as const }) }));
const Tool = TOOLS[kind]?.[current];
if (Tool) return <Tool tabs={<ModeTabs tabs={tabs} current={current} />} />;
const config = CONFIGS[kind][current];
diff --git a/src/components/studio/result-actions.tsx b/src/components/studio/result-actions.tsx
index 758ed278..94c37c5d 100644
--- a/src/components/studio/result-actions.tsx
+++ b/src/components/studio/result-actions.tsx
@@ -68,7 +68,7 @@ import { useShare } from "@/components/share/share-provider";
import { useSkillBuilder } from "@/components/skills/skill-builder-provider";
import { Popover, PopoverAnchor, PopoverContent } from "@/components/ui/popover";
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
-import { useCreateGeneration, useEngineMode, useGenerationActions, useSaveElement } from "@/lib/api";
+import { useCreateGeneration, useEngineMode, useGenerationActions, useLikelyVisitor, useSaveElement } from "@/lib/api";
import { ELEMENT_KINDS, type ElementKind } from "@/lib/catalog/elements";
import { OPERATION_LABELS, type Generation, type OutputFile } from "@/lib/catalog/types";
import { downloadName, userTitle } from "@/lib/library";
@@ -402,7 +402,8 @@ export function TileActions({
}) {
const run = useActionRunner(opts);
const engineMode = useEngineMode();
- const list = useMemo(() => outputActions(g, index, { ...ctx, engineMode }), [g, index, ctx, engineMode]);
+ const visitor = useLikelyVisitor();
+ const list = useMemo(() => outputActions(g, index, { ...ctx, engineMode, visitor }), [g, index, ctx, engineMode, visitor]);
const [saving, setSaving] = useState(false);
const strip = useRef<HTMLDivElement>(null);
const [narrow, setNarrow] = useState(false);
diff --git a/src/components/studio/studio-page.tsx b/src/components/studio/studio-page.tsx
index ba89cf3f..ff8422ad 100644
--- a/src/components/studio/studio-page.tsx
+++ b/src/components/studio/studio-page.tsx
@@ -11,7 +11,7 @@ import { SidebarTrigger } from "@/components/ui/sidebar";
import { HeaderPill } from "@/components/gpu/readiness-chip";
import { badgeFor, openGpuSetup, useGpuBadges } from "@/hooks/use-gpu";
import type { Generation, MediaKind, ModelDef, Preset } from "@/lib/catalog/types";
-import { GUEST_PROMPT_EVENT, useEngine, useGenerations, useIsGuest } from "@/lib/api";
+import { GUEST_PROMPT_EVENT, useEngine, useGenerations, useIsGuest, useLikelyVisitor } from "@/lib/api";
import {
claimStartToken,
followEngineDefault,
@@ -431,8 +431,10 @@ function StudioBody({ header, tabs, examples }: { header?: React.ReactNode; tabs
// Config and actions only: the draft lives in the composer, so typing doesn't re-render the page or the feed.
const { config, setDraft } = useStudioActions();
const [engine, setEngine, engineMode] = useEngine();
- // A GPU-only step (Regenerate) isn't offered while the install runs paid APIs only.
- const firstSteps = config.firstSteps?.filter((f) => !f.openOnly || engineMode !== "cloud");
+ // A GPU-only step isn't offered while the install runs paid APIs only. A guest or an account sees none: each step
+ // opens a tool that runs on a self-hosted Fuobe only.
+ const visitor = useLikelyVisitor();
+ const firstSteps = visitor ? undefined : config.firstSteps?.filter((f) => !f.openOnly || engineMode !== "cloud");
const feed = useGenerations(config.feed);
const bridge = useComposerBridge();
const [dragging, setDragging] = useState(false);
diff --git a/src/components/studio/viewer.tsx b/src/components/studio/viewer.tsx
index 3043d2bb..4779fc3f 100644
--- a/src/components/studio/viewer.tsx
+++ b/src/components/studio/viewer.tsx
@@ -13,7 +13,7 @@ import { formatCost, timeAgo } from "@/lib/format";
import { PRESETS as GRADE_PRESETS } from "@/lib/grade";
import { trashDaysLeft, userTitle } from "@/lib/library";
import { editOnlyFormat, isLayered, layerInfo, outputActions, type OutputAction } from "@/lib/output-actions";
-import { useEngineMode } from "@/lib/api";
+import { useEngineMode, useLikelyVisitor } from "@/lib/api";
import { cn } from "@/lib/utils";
import { copyWithToast } from "@/lib/clipboard";
import { CompareSlider } from "./compare-slider";
@@ -167,7 +167,8 @@ export function Viewer({
const [failedVideo, setFailedVideo] = useState<string | null>(null);
const run = useActionRunner({ onReuse: onReuse && ((x) => (onReuse(x), onClose())), onCompare: () => setComparing((v) => !v), onDeleted: onClose });
const engineMode = useEngineMode();
- const list = useMemo(() => outputActions(g, index, { reuse: !!onReuse, compare: !!source, inViewer: true, engineMode }), [g, index, onReuse, source, engineMode]);
+ const visitor = useLikelyVisitor();
+ const list = useMemo(() => outputActions(g, index, { reuse: !!onReuse, compare: !!source, inViewer: true, engineMode, visitor }), [g, index, onReuse, source, engineMode, visitor]);
// Read the latest values from the key handler without re-subscribing on every render.
const latest = useRef({ list, run, g, index, onPrev, onNext, source });
diff --git a/src/lib/catalog/canvas.ts b/src/lib/catalog/canvas.ts
index 0b8bdcfa..97572ba4 100644
--- a/src/lib/catalog/canvas.ts
+++ b/src/lib/catalog/canvas.ts
@@ -14,7 +14,7 @@ import { dualEngine, onEngine, runsOn } from "./engines";
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 { REGEN_COPY, REGEN_MODEL, REGEN_OFFERED } from "./regenerate";
import {
OPERATION_LABELS,
OPERATION_OUTPUT,
@@ -320,7 +320,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")).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") && (p.id !== "upscale-regenerate" || REGEN_OFFERED)).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 };
if (mode === "both" || !isGenerator(p) || defaultModelForNode({ type: p.type, data: p.data ?? {} }, mode)) return p;
diff --git a/src/lib/catalog/models.ts b/src/lib/catalog/models.ts
index 170d8de9..d89a72a6 100644
--- a/src/lib/catalog/models.ts
+++ b/src/lib/catalog/models.ts
@@ -6,7 +6,7 @@ import { loraEntry, loraRef } from "./loras";
import { ANGLES_LORA, MOSAIC_SCALE, MOSAIC_TARGET, SPEAK_GRAPH, SPEAK_LORA, SPEAK_PROMPT } from "./open-tools";
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 { REGEN_COPY, REGEN_DEFAULT_TIER, REGEN_MODEL, REGEN_OFFERED, REGEN_TIERS, REGEN_WORKFLOW } from "./regenerate";
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";
@@ -780,6 +780,7 @@ const open: ModelDef[] = [
kind: "video",
tagline: "Redraws a soft clip at 1080p, 2K or 4K. Details may change; motion and layout stay.",
badges: ["new", "4k", "audio"],
+ hidden: !REGEN_OFFERED,
routes: [comfy("upscale-video", REGEN_WORKFLOW, "Built on MiniMax H3: redraws the clip at 24 fps, up to 15 s a pass, keeping its sound")],
options: {
seed: true,
diff --git a/src/lib/catalog/regenerate.ts b/src/lib/catalog/regenerate.ts
index 81e47179..05c2b167 100644
--- a/src/lib/catalog/regenerate.ts
+++ b/src/lib/catalog/regenerate.ts
@@ -10,6 +10,13 @@
import type { Generation, GenerationRequest, LoraRef } from "./types";
export const REGEN_MODEL = "oss-h3-regenerate";
+/**
+ * Whether Regenerate · creative is offered anywhere (the Upscale step, the finishing choice, the result links, the
+ * canvas node, the model picker, the GPU tools list). Off for now: its graph needs 48 GB of VRAM and its node pack,
+ * and it has not run on a real GPU yet. Switch it on after a full run on a card that fits it. The cloud's
+ * "Re-render at 2K" is separate and stays on.
+ */
+export const REGEN_OFFERED: boolean = false;
export const REGEN_WORKFLOW = "video-regenerate-h3";
/** The join a clip redrawn in 15 s parts ends with (packet by packet: every part has the same size and rate). */
export const REGEN_JOIN = "oss-join-encoded";
diff --git a/src/lib/catalog/upscale-first.ts b/src/lib/catalog/upscale-first.ts
index 7bc3c062..558c7fc0 100644
--- a/src/lib/catalog/upscale-first.ts
+++ b/src/lib/catalog/upscale-first.ts
@@ -1,8 +1,8 @@
-import { REGEN_DEFAULT_TIER, REGEN_MODEL } from "./regenerate";
+import { REGEN_DEFAULT_TIER, REGEN_MODEL, REGEN_OFFERED } from "./regenerate";
/**
* Upscale → Video's "before upscaling" steps: one list, so each finishing package adds its row here (archive-restore:
- * Restore archive footage first; n7-3: Regenerate in 2K). A row opens its tool with the step that upscales after it
+ * Restore archive footage first; Regenerate in 2K). A row opens its tool with the step that upscales after it
* already on, so the tool runs both as one job (Restore & colourise: `?then=upscale`), or, for Regenerate, this page on
* the model that redraws and enlarges in one run.
*/
@@ -17,7 +17,7 @@ export interface UpscaleFirstStep {
openOnly?: true;
}
-export const UPSCALE_FIRST_STEPS: UpscaleFirstStep[] = [
+const ALL_FIRST_STEPS: UpscaleFirstStep[] = [
{
id: "restore",
label: "Restore archive footage first",
@@ -33,5 +33,8 @@ export const UPSCALE_FIRST_STEPS: UpscaleFirstStep[] = [
},
];
+/** 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 query a tool reads to switch its "then upscale" step on. */
export const THEN_UPSCALE = "upscale";
diff --git a/src/lib/hubs.ts b/src/lib/hubs.ts
index 1b3161c3..be6399c5 100644
--- a/src/lib/hubs.ts
+++ b/src/lib/hubs.ts
@@ -5,7 +5,8 @@
*/
export type HubKind = "audio" | "video-tools" | "upscale";
-export const HUB_MODES: Record<HubKind, { id: string; label: string }[]> = {
+/** ownerOnly: a mode that runs on a self-hosted Fuobe only and is new there; its tab is left out for a guest or an account. */
+export const HUB_MODES: Record<HubKind, { id: string; label: string; ownerOnly?: true }[]> = {
upscale: [
{ id: "image", label: "Image" },
{ id: "video", label: "Video" },
@@ -30,9 +31,9 @@ export const HUB_MODES: Record<HubKind, { id: string; label: string }[]> = {
"video-tools": [
{ id: "matte", label: "Remove background" },
{ id: "remove-object", label: "Remove object" },
- { id: "remove-dialogue", label: "Remove dialogue" },
+ { id: "remove-dialogue", label: "Remove dialogue", ownerOnly: true },
{ id: "evolution", label: "Evolution" },
- { id: "restore", label: "Restore & colourise" },
+ { id: "restore", label: "Restore & colourise", ownerOnly: true },
{ id: "relight", label: "Relight" },
{ id: "depth", label: "Depth map" },
{ id: "captions", label: "Captions" },
diff --git a/src/lib/output-actions.ts b/src/lib/output-actions.ts
index eece3a23..55302353 100644
--- a/src/lib/output-actions.ts
+++ b/src/lib/output-actions.ts
@@ -12,7 +12,7 @@ import { PRESETS as GRADE_PRESETS } from "./grade";
import { storedPath } from "./share";
import { decodeMoss, LAYOUT_PARAM, readLayout, type LayoutDraft } from "./layout-prompt";
import { REMOVE_DIALOGUE_FEATURE } from "./av/remove-dialogue";
-import { canRerender, regenerateFamily, regenerateHref, rerenderLabel } from "./catalog/regenerate";
+import { canRerender, REGEN_OFFERED, regenerateFamily, regenerateHref, rerenderLabel } from "./catalog/regenerate";
import { CLEAN_FEATURE } from "./av/clean-voice";
export type OutputActionId =
@@ -83,8 +83,13 @@ export interface ActionContext {
* (a server render, a share page): as "both".
*/
engineMode?: "both" | "open" | "cloud";
+ /** A guest or an account: hand-offs to the tools that run on a self-hosted Fuobe only are left out. */
+ visitor?: boolean;
}
+/** Hand-offs to tools a guest or an account can't open (they run on a self-hosted Fuobe only). */
+const OWNER_ONLY_ACTIONS: ReadonlySet<OutputActionId> = new Set<OutputActionId>(["restore-video", "remove-dialogue"]);
+
const q = (url: string) => encodeURIComponent(url);
/** Every action for output `index` of `g`, in display order. */
@@ -102,7 +107,9 @@ export function outputActions(g: Generation, index: number, ctx: ActionContext =
];
}
const out: OutputAction[] = [];
- const link = (id: OutputActionId, label: string, href: string, placement: OutputAction["placement"] = "menu") => out.push({ id, label, href, placement });
+ const link = (id: OutputActionId, label: string, href: string, placement: OutputAction["placement"] = "menu") => {
+ if (!(ctx.visitor && OWNER_ONLY_ACTIONS.has(id))) out.push({ id, label, href, placement });
+ };
switch (o.kind) {
case "image":
if (isVector(g, o)) {
@@ -177,7 +184,7 @@ 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 (o.kind === "video" && ctx.engineMode !== "cloud") link("regenerate", "Regenerate in 2K", regenerateHref(o.url));
+ if (REGEN_OFFERED && o.kind === "video" && ctx.engineMode !== "cloud") link("regenerate", "Regenerate in 2K", regenerateHref(o.url));
return [...out.filter((a) => a.id !== "favorite"), { id: "delete-upload", label: "Delete", 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: "" });
@@ -187,7 +194,7 @@ 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 ((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) });
+ 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) });
}
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" });
@@ -222,7 +229,7 @@ function likelySpeech(g: Generation): boolean {
* Up to `max` next steps for output `index` (Animate, Upscale, Edit for a picture), taken from
* outputActions so they go where the tile's own actions go. Only hand-offs to another studio.
*/
-export function nextSteps(g: Generation, index: number, max = 3, ctx: Pick<ActionContext, "engineMode"> = {}): OutputAction[] {
+export function nextSteps(g: Generation, index: number, max = 3, ctx: Pick<ActionContext, "engineMode" | "visitor"> = {}): OutputAction[] {
const o = g.outputs[index];
if (!o || g.status !== "succeeded") return [];
const all = outputActions(g, index, ctx);
@@ -232,7 +239,7 @@ export function nextSteps(g: Generation, index: number, max = 3, ctx: Pick<Actio
? ["extend", "upscale", ...(likelySpeech(g) ? (["remove-dialogue"] as const) : []), "split-soundtrack"]
: NEXT_STEPS.video;
// H3, LTX, Wan and SANA clips (the drafts Open-H3 Regenerate was shown on) offer Regenerate in 2K right after Upscale.
- const regen = o.kind === "video" && regenerateFamily(g.modelId) ? (["regenerate"] as const) : [];
+ const regen = REGEN_OFFERED && o.kind === "video" && regenerateFamily(g.modelId) ? (["regenerate"] as const) : [];
const withRegen = (ids: OutputActionId[] | undefined) => {
if (!ids || !regen.length) return ids;
const at = ids.indexOf("upscale");
diff --git a/src/lib/studios.ts b/src/lib/studios.ts
index 0b2088b2..48253d0c 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 } from "@/lib/catalog/regenerate";
+import { FINISH_CHOICES, REGEN_OFFERED } from "@/lib/catalog/regenerate";
import type { Preset } from "@/lib/catalog/types";
import type { StudioConfig } from "@/components/studio/studio-context";
@@ -151,7 +151,7 @@ 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 Open-H3 "Regenerate · creative" side by side (GPU-only: nobody hosts it).
- finishChoices: FINISH_CHOICES,
+ ...(REGEN_OFFERED && { finishChoices: FINISH_CHOICES }),
slots: [{ key: "video", label: "Video", accept: "video", required: true }],
defaultModels: { cloud: "topaz-video", open: "oss-seedvr2" },
clipFacts: true,
diff --git a/src/server/gpu/tools.ts b/src/server/gpu/tools.ts
index 5544f8c4..40c45998 100644
--- a/src/server/gpu/tools.ts
+++ b/src/server/gpu/tools.ts
@@ -10,7 +10,7 @@ import { dualEngine, onEngine, runsOn } from "@/lib/catalog/engines";
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 { REGEN_DEFAULT_TIER, REGEN_JOIN, REGEN_MODEL, REGEN_OFFERED, regenerateGraphLoras } from "@/lib/catalog/regenerate";
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";
@@ -226,17 +226,21 @@ export const STUDIO_ROWS: StudioRowDef[] = [
{ href: "/audio/music", label: "Music", group: "Audio", config: S.MUSIC_STUDIO },
{ 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 },
- // n7-3: 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.
- {
- href: `/upscale/video?model=${REGEN_MODEL}&resolution=${REGEN_DEFAULT_TIER}`,
- label: "Regenerate in 2K",
- group: "Video tools",
- steps: [
- { modelId: REGEN_MODEL, op: "upscale-video" },
- { modelId: REGEN_JOIN, op: "concat" },
- ],
- },
+ // 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,
+ ]
+ : []),
{ href: "/upscale/fps", label: "FPS boost", group: "Video tools", config: S.FPS_BOOST_STUDIO },
{ href: "/upscale/hdr", label: "SDR to HDR", group: "Video tools", config: S.SDR_TO_HDR_STUDIO },
{ href: "/upscale/export", label: "Export", group: "Video tools", config: S.VIDEO_EXPORT_STUDIO },
diff --git a/tests/regenerate-2k.test.ts b/tests/regenerate-2k.test.ts
index a51dc7d7..2a3b254e 100644
--- a/tests/regenerate-2k.test.ts
+++ b/tests/regenerate-2k.test.ts
@@ -1,13 +1,16 @@
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
-import { afterAll, beforeAll, describe, expect, it } from "vitest";
+import { afterAll, beforeAll, describe, expect, it, vi } from "vitest";
import type { Generation, GenInput, OutputFile } from "@/lib/catalog/types";
import type { MediaInfo } from "@/lib/media-probe";
// Open-H3 Regenerate 2K (package n7-3-regenerate-2k): the library graph, the model, the provider's strings and frames,
// the 15 s parts, the draft preset by source, the result actions per source and engine, the cloud re-render at 2K,
// the Canvas choice, the board row, the licences and the install pins.
+// 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.
+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-regenerate-"));
process.env.FUOBE_DATA_DIR = dir;
process.env.COMFYUI_URL = "http://127.0.0.1:9";
diff --git a/tests/regenerate-offered.test.ts b/tests/regenerate-offered.test.ts
new file mode 100644
index 00000000..7f84c9a9
--- /dev/null
+++ b/tests/regenerate-offered.test.ts
@@ -0,0 +1,77 @@
+import { describe, expect, it } from "vitest";
+import type { Generation, OutputFile } from "@/lib/catalog/types";
+import { REGEN_OFFERED } from "@/lib/catalog/regenerate";
+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 { HUB_MODES } from "@/lib/hubs";
+
+// Regenerate · creative is switched off until it has run on a card that fits it; 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;
+const gen = (p: Partial<Generation> = {}): Generation =>
+ ({
+ id: "g1",
+ batchId: null,
+ feature: "video",
+ presetId: null,
+ modelId: "oss-minimax-h3",
+ engine: "open",
+ provider: "comfyui",
+ op: "t2v",
+ kind: "video",
+ status: "succeeded",
+ progress: null,
+ message: null,
+ prompt: "a fox runs through snow",
+ request: { feature: "video", modelId: "oss-minimax-h3", prompt: "a fox runs through snow" },
+ outputs: [out()],
+ error: null,
+ costUsd: 0,
+ favorite: false,
+ createdAt: 1,
+ updatedAt: 1,
+ completedAt: 1,
+ ...p,
+ }) as 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", () => {
+ 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");
+ expect(VIDEO_UPSCALE_STUDIO.finishChoices).toBeUndefined();
+ expect(getModel("oss-h3-regenerate")?.hidden).toBe(true);
+ expect(paletteItems("both").map((p) => p.id)).not.toContain("upscale-regenerate");
+ });
+
+ 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");
+ });
+});
+
+describe("tools a guest or an account can't open", () => {
+ it("leaves Restore & colourise and Remove dialogue out of a visitor's result menus, and keeps them for the owner", () => {
+ const owner = ids(gen());
+ expect(owner).toContain("restore-video");
+ const visitor = ids(gen(), { visitor: true });
+ expect(visitor).not.toContain("restore-video");
+ expect(visitor).not.toContain("remove-dialogue");
+ expect(ids(upload(), { visitor: true })).not.toContain("restore-video");
+ });
+
+ it("marks their Video tools tabs as the owner's only", () => {
+ const tabs = Object.fromEntries(HUB_MODES["video-tools"].map((m) => [m.id, m.ownerOnly ?? false]));
+ expect(tabs).toMatchObject({ restore: true, "remove-dialogue": true, matte: false, evolution: false });
+ });
+});