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.
TypeScript ai-videocomfyuicreative-toolsgenerative-aiideogramimage-generationimage-to-3dimage-to-videoltx-videominimax-h3nextjsopen-sourceopen-weightsqwen-imagetext-to-imagevideo-generationwan
Upscale: Restore · faithful and Regenerate · creative side by side, Regenerate in 2K on results, and in Canvas
Claude3def6328d476
diff --git a/src/components/canvas/canvas-editor.tsx b/src/components/canvas/canvas-editor.tsxindex e1c4008b..2650733e 100644--- a/src/components/canvas/canvas-editor.tsx+++ b/src/components/canvas/canvas-editor.tsx@@ -699,7 +699,7 @@ function Editor({ id, initial, view }: { id: string; initial: Canvas; view: Canv[openMenuAt],);- const palette = useMemo(() => paletteItems(mode), [mode]);+ const palette = useMemo(() => paletteItems(mode, engine), [mode, engine]);const menuItems = useMemo(() => {const c = menu?.connect;if (!c) return palette;diff --git a/src/components/studio/composer.tsx b/src/components/studio/composer.tsxindex a4237fee..d595ba03 100644--- a/src/components/studio/composer.tsx+++ b/src/components/studio/composer.tsx@@ -94,6 +94,7 @@ import { Chip, chipBase, chipIdle } from "./chip";import { MediaSlot, SlotPreview, type SlotValue } from "./media-slot";import { ControlsChip } from "./model-controls";import { ModelPicker } from "./model-picker";+import { FinishChoices } from "./finish-choices";import { ELEMENT_ICONS, PromptInput, type PromptInputHandle } from "./prompt-input";import { radioKeys, radioTab } from "./radio-keys";import { SettingsChip } from "./settings-panel";@@ -629,12 +630,10 @@ export function Composer({ docked }: { docked: boolean }) {if (clipProblem && !planError) planError = clipProblem;if (signed.blocker) planError = signed.blocker;// Models that take no prompt (try-on, 3D, transcription, upscalers), or can run without one, never ask for one.+ // A model that reads only words (Open-H3 Regenerate redraws from them) asks for them even in a tool that hides the box.const promptMissing =- !config.promptOptional &&- !opts.promptless &&- !opts.promptOptional &&- preset?.userPrompt !== "none" &&- preset?.userPrompt !== "optional" &&+ (!!opts.requires?.prompt ||+ (!config.promptOptional && !opts.promptless && !opts.promptOptional && preset?.userPrompt !== "none" && preset?.userPrompt !== "optional")) &&!draft.prompt.trim() &&!draft.params.shots?.some((s) => s.prompt.trim()) &&// Boxes say what the picture holds: the whole picture's caption can stay empty.@@ -750,7 +749,11 @@ export function Composer({ docked }: { docked: boolean }) {});const opNote = op && model ? routesFor(model, op)[0]?.note : undefined;// Booleans in, not the model's options object: the React Compiler keeps the memos above.- const showPrompt = showsPrompt({ hidePrompt: config.hidePrompt, modelPrompt: config.modelPrompt }, { promptless: !!opts.promptless, promptOptional: !!opts.promptOptional }, preset?.userPrompt);+ const showPrompt = showsPrompt(+ { hidePrompt: config.hidePrompt, modelPrompt: config.modelPrompt },+ { promptless: !!opts.promptless, promptOptional: !!opts.promptOptional, needsPrompt: !!opts.requires?.prompt },+ preset?.userPrompt,+ );const effectiveOp = studioOp ?? op;// SDR to HDR, Export: every format the studio's models on this engine write; picking one this model doesn't// write moves the request to the model that does (EXR frames → LTX 2.3 HDR on the cloud).@@ -1182,7 +1185,7 @@ export function Composer({ docked }: { docked: boolean }) {placeholder={layoutOn? "Describe the whole picture… the boxes say what goes where"- : (preset?.promptPlaceholder ?? (config.hidePrompt && config.modelPrompt ? config.modelPrompt : config.placeholder))+ : (preset?.promptPlaceholder ?? opts.promptPlaceholder ?? (config.hidePrompt && config.modelPrompt ? config.modelPrompt : config.placeholder))}elements={elements}collapsed={collapsed}@@ -1224,6 +1227,18 @@ export function Composer({ docked }: { docked: boolean }) {</div>)}+ {/* Upscale → Video: Restore · faithful and Regenerate · creative side by side (on your GPU). */}+ {config.finishChoices && !preset && (+ <FinishChoices+ choices={config.finishChoices}+ model={model}+ engine={engine}+ engineMode={engineMode}+ offered={(id) => (catalog.offered(id, "open") ? catalog.getModel(id) : undefined)}+ onPick={pickModel}+ />+ )}+{/* Preset options (apps) */}{preset?.options?.length ? (<div className="flex flex-wrap gap-3 px-1.5 pb-2">diff --git a/src/components/studio/feed.tsx b/src/components/studio/feed.tsxindex 1e918e4f..5f6d9449 100644--- a/src/components/studio/feed.tsx+++ b/src/components/studio/feed.tsx@@ -16,7 +16,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, useGenerationActions } from "@/lib/api";+import { useCreateGeneration, useEngineMode, useGenerationActions } 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";@@ -271,7 +271,8 @@ const OutputTile = memo(function OutputTile({ g, index, ratio, layered, count }:* group with several takes has none: which one to animate is picked on its tile.*/function NextSteps({ g, index }: { g: Generation; index: number }) {- const steps = nextSteps(g, index);+ const engineMode = useEngineMode();+ const steps = nextSteps(g, index, 3, { engineMode });if (!steps.length) return null;return (<nav aria-label="Next steps" className="flex flex-wrap gap-1.5">diff --git a/src/components/studio/finish-choices.tsx b/src/components/studio/finish-choices.tsxnew file mode 100644index 00000000..a4f560a5--- /dev/null+++ b/src/components/studio/finish-choices.tsx@@ -0,0 +1,80 @@+"use client";++import { Cpu } from "lucide-react";+import type { Engine, ModelDef } from "@/lib/catalog/types";+import { REGEN_COPY, REGEN_MODEL, type FINISH_CHOICES } from "@/lib/catalog/regenerate";+import { cn } from "@/lib/utils";+import { radioKeys, radioTab } from "./radio-keys";++/**+ * Upscale → Video's two open finishing steps side by side (StudioConfig.finishChoices): SeedVR2 "Restore · faithful" and+ * Open-H3 "Regenerate · creative". 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.+ */+export function FinishChoices({+ choices,+ model,+ engine,+ engineMode,+ offered,+ onPick,+}: {+ choices: typeof FINISH_CHOICES;+ model: ModelDef | undefined;+ engine: Engine;+ engineMode: "both" | "open" | "cloud";+ /** The choices Settings → Models & licences leaves on (and this catalog has). */+ offered: (id: string) => ModelDef | undefined;+ onPick: (m: ModelDef) => void;+}) {+ if (engineMode === "cloud") return null;+ const regen = offered(REGEN_MODEL);+ if (engine === "cloud") {+ if (!regen) return null;+ return (+ <div className="flex flex-wrap items-center gap-x-2 gap-y-1 px-1.5 pb-2 text-[12px] leading-snug text-muted-foreground">+ <Cpu className="size-3.5 shrink-0" aria-hidden />+ <span className="min-w-0">+ <span className="font-medium text-foreground">Regenerate · creative</span> · {REGEN_COPY.gpuOnly}+ </span>+ <button+ type="button"+ onClick={() => onPick(regen)}+ className="rounded-full px-1.5 font-medium text-brand-text underline underline-offset-2 outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/50"+ >+ Use it on your GPU+ </button>+ </div>+ );+ }+ const shown = choices.map((c) => ({ ...c, m: offered(c.modelId) })).filter((c) => !!c.m);+ if (shown.length < 2) return null;+ const picked = shown.find((c) => c.modelId === model?.id);+ return (+ <div className="px-1.5 pb-2">+ <div role="radiogroup" aria-label="How to finish the clip" onKeyDown={radioKeys} className="grid grid-cols-2 gap-1.5">+ {shown.map((c) => {+ const sel = c.modelId === model?.id;+ return (+ <button+ key={c.modelId}+ type="button"+ role="radio"+ aria-checked={sel}+ tabIndex={radioTab(sel || (!picked && c === shown[0]))}+ onClick={() => !sel && onPick(c.m!)}+ className={cn(+ "min-w-0 rounded-xl border px-2.5 py-1.5 text-left transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/50",+ sel ? "border-primary bg-brand-faint" : "hover:bg-accent",+ )}+ >+ <span className={cn("block text-[12px] font-medium", sel ? "text-brand-text" : "text-foreground")}>{c.label}</span>+ <span className="block text-[11px] leading-snug text-pretty text-muted-foreground">{c.hint}</span>+ </button>+ );+ })}+ </div>+ {model?.id === REGEN_MODEL && <p className="mt-1.5 px-1 text-[11px] leading-snug text-pretty text-muted-foreground">Free on your GPU · {REGEN_COPY.gpu}</p>}+ </div>+ );+}diff --git a/src/components/studio/result-actions.tsx b/src/components/studio/result-actions.tsxindex 3f088575..3ef4c0fd 100644--- a/src/components/studio/result-actions.tsx+++ b/src/components/studio/result-actions.tsx@@ -66,7 +66,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, useGenerationActions, useSaveElement } from "@/lib/api";+import { useCreateGeneration, useEngineMode, useGenerationActions, 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";@@ -74,6 +74,7 @@ import { toSrt, toVtt } from "@/lib/cues";import { cuesOf, outputActions, textOf, type ActionContext, type OutputAction, type OutputActionId } from "@/lib/output-actions";import { cn } from "@/lib/utils";import { copyWithToast } from "@/lib/clipboard";+import { rerenderRequest } from "@/lib/catalog/regenerate";import { toastError } from "@/lib/refusals";export const ACTION_ICONS: Record<OutputActionId, LucideIcon> = {@@ -104,6 +105,8 @@ export const ACTION_ICONS: Record<OutputActionId, LucideIcon> = {"download-exr": FileArchive,favorite: Heart,finalize: Sparkles,+ regenerate: Sparkles,+ "rerender-2k": Sparkles,compare: Columns2,reuse: RotateCcw,"make-skill": BookmarkPlus,@@ -239,6 +242,9 @@ export function useActionRunner(opts: RunnerOptions = {}) {{ feature: g.feature, modelId: g.modelId, op: "finalize", prompt: g.request.prompt, params: { draftId: o.draftId, resolution: "1080p", duration: g.request.params?.duration } },{ onSuccess: () => toast.success("Rendering the final 1080p version"), onError: (e) => toastError(e) },);+ case "rerender-2k":+ // fal's H3 at 2K: the same inputs, words and seed, a new render on the same hosted model (priced per second).+ return create.mutate(rerenderRequest(g), { onSuccess: () => toast.success("Rendering it again at 2K"), onError: (e) => toastError(e) });case "reuse":return opts.onReuse?.(g);case "make-skill":@@ -391,7 +397,8 @@ export function TileActions({tone?: "media" | "surface";}) {const run = useActionRunner(opts);- const list = useMemo(() => outputActions(g, index, ctx), [g, index, ctx]);+ const engineMode = useEngineMode();+ const list = useMemo(() => outputActions(g, index, { ...ctx, engineMode }), [g, index, ctx, engineMode]);const [saving, setSaving] = useState(false);const strip = useRef<HTMLDivElement>(null);const [narrow, setNarrow] = useState(false);diff --git a/src/components/studio/studio-context.tsx b/src/components/studio/studio-context.tsxindex 6e943baa..28814a7b 100644--- a/src/components/studio/studio-context.tsx+++ b/src/components/studio/studio-context.tsx@@ -7,6 +7,7 @@ import type { Signature } from "@/lib/catalog/palettes";import type { FrameAttachment } from "@/lib/composer";import type { LayoutDraft } from "@/lib/layout-prompt";import type { UpscaleFirstStep } from "@/lib/catalog/upscale-first";+import type { FINISH_CHOICES } from "@/lib/catalog/regenerate";import type { SlotValue } from "./media-slot";export type SlotKey = InputSlot["key"];@@ -22,6 +23,8 @@ export interface StudioConfig {related?: { href: string; label: string };/** Steps a tool runs before this one, then this one after it, as one job (Upscale → Restore archive footage first). */firstSteps?: UpscaleFirstStep[];+ /** Open finishing models shown side by side above the toolbar (Upscale → Video: Restore · faithful, Regenerate · creative). */+ finishChoices?: typeof FINISH_CHOICES;placeholder: string;kind: MediaKind;/** Operations whose models appear in the picker. */diff --git a/src/components/studio/studio-page.tsx b/src/components/studio/studio-page.tsxindex 2168bf70..2da3c14a 100644--- a/src/components/studio/studio-page.tsx+++ b/src/components/studio/studio-page.tsx@@ -95,11 +95,13 @@ function initialDraft(if (sp.get("audio")) slots.audio = slot(sp.get("audio"));// An output format handed over in the link (Export → "ProRes in the cloud"), when the model writes it.const format = model?.options.formats?.find((f) => f === sp.get("format"));+ // A size handed over (Regenerate in 2K → 1440p), when the model offers it.+ const resolution = model?.options.resolutions?.find((r) => r === sp.get("resolution"));return {prompt: sp.get("prompt") ?? "",negativePrompt: "",modelId,- params: { ...model?.defaults, ...routeSettings, ...(format && { format }) },+ params: { ...model?.defaults, ...routeSettings, ...(format && { format }), ...(resolution && { resolution }) },slots,refs,presetId: sp.get("preset") ?? config.preset?.id,@@ -384,7 +386,9 @@ function StudioHeader({ title, header, tabs }: { title: string; header?: React.Rfunction StudioBody({ header, tabs, examples }: { header?: React.ReactNode; tabs?: React.ReactNode; examples?: StudioExampleRow }) {// 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] = useEngine();+ 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");const feed = useGenerations(config.feed);const bridge = useComposerBridge();const [dragging, setDragging] = useState(false);@@ -449,9 +453,9 @@ function StudioBody({ header, tabs, examples }: { header?: React.ReactNode; tabs<ArrowRight className="size-3" /></Link>)}- {config.firstSteps?.length ? (+ {firstSteps?.length ? (<ul aria-label="Before upscaling" className="mt-3 flex max-w-xl flex-col items-center gap-2">- {config.firstSteps.map((f) => (+ {firstSteps.map((f) => (<li key={f.id} className="flex flex-col items-center gap-1"><Linkhref={f.href}diff --git a/src/components/studio/viewer.tsx b/src/components/studio/viewer.tsxindex 5ab74221..7246af3e 100644--- a/src/components/studio/viewer.tsx+++ b/src/components/studio/viewer.tsx@@ -13,6 +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 { cn } from "@/lib/utils";import { copyWithToast } from "@/lib/clipboard";import { CompareSlider } from "./compare-slider";@@ -165,7 +166,8 @@ export function Viewer({// A video this browser can't decode (HEVC or 10-bit H.264 on some systems): shown as a file to download instead.const [failedVideo, setFailedVideo] = useState<string | null>(null);const run = useActionRunner({ onReuse: onReuse && ((x) => (onReuse(x), onClose())), onCompare: () => setComparing((v) => !v), onDeleted: onClose });- const list = useMemo(() => outputActions(g, index, { reuse: !!onReuse, compare: !!source, inViewer: true }), [g, index, onReuse, source]);+ const engineMode = useEngineMode();+ const list = useMemo(() => outputActions(g, index, { reuse: !!onReuse, compare: !!source, inViewer: true, engineMode }), [g, index, onReuse, source, engineMode]);// 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.tsindex 4c723f4e..cf750cef 100644--- a/src/lib/catalog/canvas.ts+++ b/src/lib/catalog/canvas.ts@@ -13,6 +13,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 {OPERATION_LABELS,OPERATION_OUTPUT,@@ -272,6 +273,15 @@ export const PALETTE: PaletteItem[] = [{ ...pick("join"), id: "join", keywords: "concat merge stitch film" },{ ...pick("frame"), id: "frame", keywords: "still last frame screenshot" },{ ...pick("upscale"), id: "upscale", data: { mediaKind: "image" }, keywords: "enhance resolution 4k sharpen" },+ // The Upscale node on Open-H3 Regenerate: a clip redrawn at 2K from its words, on your GPU only (nobody hosts it).+ {+ ...pick("upscale"),+ id: "upscale-regenerate",+ label: "Regenerate (creative)",+ description: "Redraws a soft clip at 1080p, 2K or 4K from its words: details may change, motion and layout stay (your GPU)",+ data: { mediaKind: "video", modelId: REGEN_MODEL },+ keywords: "regenerate redraw 2k 4k h3 creative upscale sharpen finish",+ },{ ...pick("bg-remove"), id: "bg-remove", data: { mediaKind: "image" }, keywords: "cutout matte transparent" },{ ...pick("tts"), id: "tts", keywords: "voice speech narration clone" },{ ...pick("voice-change"), id: "voice-change", keywords: "voice changer speech to speech revoice convert" },@@ -291,18 +301,25 @@ function pick(type: CanvasNodeType): Omit<PaletteItem, "id"> {const paletteCache = new Map<string, PaletteItem[]>();+/** Why a GPU-only entry (Regenerate) can't be added on the cloud. */+export const GPU_ONLY_ENTRY = `${REGEN_COPY.gpuOnlyWhy}. Switch the board to open source to add it`;+/*** Palette entries whose models exist in this catalog (no text models until an LLM model is- * installed). On an install locked to one engine, entries with no model there are disabled, with why.+ * installed). On an install locked to one engine, entries with no model there are disabled, with why. An entry fixed to+ * an open model nobody hosts (Regenerate) is disabled on the cloud engine too, with that reason.*/-export function paletteItems(mode: "both" | "open" | "cloud" = "both"): PaletteItem[] {- const hit = paletteCache.get(mode);+export function paletteItems(mode: "both" | "open" | "cloud" = "both", engine?: Engine): PaletteItem[] {+ const key = `${mode}:${engine ?? ""}`;+ const hit = paletteCache.get(key);if (hit) return hit;const items = PALETTE.filter((p) => p.id !== "model-text" || MODELS.some((m) => m.kind === "text" && !m.hidden)).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: GPU_ONLY_ENTRY };if (mode === "both" || !isGenerator(p) || defaultModelForNode({ type: p.type, data: p.data ?? {} }, mode)) return p;return { ...p, disabled: `No ${mode === "open" ? "open-source" : "cloud"} model for ${p.label.toLowerCase()} yet` };});- paletteCache.set(mode, items);+ paletteCache.set(key, items);return items;}@@ -416,6 +433,9 @@ export function defaultModelForNode(n: Pick<CanvasNode, "type" | "data">, enginereturn defaultModelFor(n.data.op ?? KIND_OP[kind], engine) ?? MODELS.find((m) => m.engine === engine && !m.hidden && m.kind === kind);}const op = nodeOps(n)[0];+ // The Upscale node's Regenerate choice starts on Open-H3 Regenerate (on the cloud the entry is disabled: paletteItems).+ const fixed = n.data.modelId === REGEN_MODEL ? getModel(REGEN_MODEL) : undefined;+ if (fixed && op && supportsOp(fixed, op) && runsOn(fixed, engine)) return fixed;return op ? defaultModelFor(op, engine, { hidden: true }) : undefined;}@@ -551,6 +571,8 @@ export function inputPorts(n: Pick<CanvasNode, "type" | "data">): PortDef[] {// A cloned voice only where the model clones voices (Text to speech and Change voice always show it, and say// which models clone when a voice is connected to one that doesn't).if (ids.has("voice") && model && !model.options.voiceClone && n.type !== "tts" && n.type !== "voice-change") ids.delete("voice");+ // A model that redraws from words even where its operation takes none (Open-H3 Regenerate on the Upscale node).+ if (model?.options.requires?.prompt) ids.add("prompt");// Visual elements only on image and video models.if (ids.has("elements") && model && model.kind !== "image" && model.kind !== "video") ids.delete("elements");const maxImages = model?.options.maxImages ?? (ops.some((op) => MULTI_IMAGE_OPS.has(op)) ? 4 : 1);@@ -1563,6 +1585,8 @@ export function counterpart(graph: CanvasGraph, n: CanvasNode, engine: Engine):const current = n.data.modelId ? getModel(n.data.modelId) : undefined;// A Fuobe Original runs on both: it stays, on the other engine.if (current && runsOn(current, engine)) return current;+ // Open-H3 Regenerate is GPU-only: nobody hosts it, so it has no cloud stand-in (the owner's rule).+ if (current?.id === REGEN_MODEL) return undefined;if (n.type !== "model") return defaultModelForNode(n, engine);const op = n.data.op ?? effectiveOp(graph, n) ?? (current ? current.routes[0].op : KIND_OP[n.data.mediaKind ?? "image"]);const kind = current?.kind ?? n.data.mediaKind;diff --git a/src/lib/catalog/models.ts b/src/lib/catalog/models.tsindex bb4f8535..b3dbff8e 100644--- a/src/lib/catalog/models.ts+++ b/src/lib/catalog/models.ts@@ -5,7 +5,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_DEFAULT_TIER, REGEN_MODEL, REGEN_TIERS, REGEN_WORKFLOW } from "./regenerate";+import { REGEN_COPY, REGEN_DEFAULT_TIER, REGEN_MODEL, 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";@@ -724,6 +724,7 @@ const open: ModelDef[] = [seed: true,resolutions: [...REGEN_TIERS],requires: { prompt: true, msg: "Regenerate redraws the clip from words: describe what is in it" },+ promptPlaceholder: REGEN_COPY.prompt,controls: [{param: "creativity",diff --git a/src/lib/catalog/regenerate.ts b/src/lib/catalog/regenerate.tsindex f6084df6..3dcc13b7 100644--- a/src/lib/catalog/regenerate.ts+++ b/src/lib/catalog/regenerate.ts@@ -11,6 +11,8 @@ import type { Generation, GenerationRequest, LoraRef } from "./types";export const REGEN_MODEL = "oss-h3-regenerate";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";/** Upscale → Video's restore model, shown beside Regenerate. */export const RESTORE_MODEL = "oss-seedvr2";diff --git a/src/lib/catalog/types.ts b/src/lib/catalog/types.tsindex c7f900a7..a9703258 100644--- a/src/lib/catalog/types.ts+++ b/src/lib/catalog/types.ts@@ -613,6 +613,8 @@ export interface ModelOptions {promptOptional?: boolean;/** The words a run takes when none are given (Fuobe Try-On: its try-on LoRA's own instruction). */defaultPrompt?: string;+ /** The prompt box's placeholder for this model (Open-H3 Regenerate: describe the clip it redraws). */+ promptPlaceholder?: string;/*** The prompt the model reads, when it isn't plain words: "ideogram4" = an Ideogram 4 JSON caption. The server writes* one from the words before the run (src/lib/ideogram-caption.ts) and keeps it as the run's prompt.diff --git a/src/lib/catalog/upscale-first.ts b/src/lib/catalog/upscale-first.tsindex 8d926ca4..7bc3c062 100644--- a/src/lib/catalog/upscale-first.ts+++ b/src/lib/catalog/upscale-first.ts@@ -1,7 +1,10 @@+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:- * Restore archive footage first; n7-3's Regenerate in 2K is meant to be the next). 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`).+ * Restore archive footage first; n7-3: 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.*/export interface UpscaleFirstStep {id: string;@@ -10,6 +13,8 @@ export interface UpscaleFirstStep {hint: string;/** The tool that runs the step, then the upscale. */href: string;+ /** GPU-only (nobody hosts its model): hidden when Engine mode is "Paid APIs only". */+ openOnly?: true;}export const UPSCALE_FIRST_STEPS: UpscaleFirstStep[] = [@@ -19,6 +24,13 @@ export const UPSCALE_FIRST_STEPS: UpscaleFirstStep[] = [hint: "Old scans, tape or black and white: cleaned and colourised by Fuobe Restore, then upscaled, in one run",href: "/video-tools/restore?then=upscale",},+ {+ id: "regenerate",+ label: "Regenerate a soft AI clip in 2K",+ 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,+ },];/** The query a tool reads to switch its "then upscale" step on. */diff --git a/src/lib/composer.ts b/src/lib/composer.tsindex d5036d69..5652c604 100644--- a/src/lib/composer.ts+++ b/src/lib/composer.ts@@ -185,11 +185,12 @@ export function settingsSummary(shape: SettingsShape, params: GenParams, model?:*/export function showsPrompt(studio: { hidePrompt?: boolean; modelPrompt?: string },- options: Pick<ModelDef["options"], "promptless" | "promptOptional"> | undefined,+ options: (Pick<ModelDef["options"], "promptless" | "promptOptional"> & { needsPrompt?: boolean }) | undefined,presetPrompt?: "none" | "optional" | "required",): boolean {if (presetPrompt === "none" || options?.promptless) return false;- return !studio.hidePrompt || (!!studio.modelPrompt && !!options?.promptOptional);+ // A model that needs words (requires.prompt: Open-H3 Regenerate) shows the box even in a tool that hides it.+ return !studio.hidePrompt || !!options?.needsPrompt || (!!studio.modelPrompt && !!options?.promptOptional);}/** The output format a request writes: the one picked, else the model's default or first, else the studio's first. */@@ -765,7 +766,7 @@ export function acceptedKinds(slots: InputSlot[], multiRef?: { kind?: MediaKind// Hand-off params ("/video?image=…") arriving after the first paint/** The URL params a studio prefills its draft from; anything else in the query is ignored. */-export const HANDOFF_PARAMS = ["image", "ref", "video", "audio", "prompt", "preset", "model", "format"] as const;+export const HANDOFF_PARAMS = ["image", "ref", "video", "audio", "prompt", "preset", "model", "format", "resolution"] as const;/** A stable key for the hand-off part of a query string ("" when there's none). */export function handoffKey(search: string | URLSearchParams | null | undefined): string {diff --git a/src/lib/output-actions.ts b/src/lib/output-actions.tsindex d27cc802..50f6f78d 100644--- a/src/lib/output-actions.ts+++ b/src/lib/output-actions.ts@@ -12,6 +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";export type OutputActionId =| "animate"@@ -41,6 +42,8 @@ export type OutputActionId =| "download-exr"| "favorite"| "finalize"+ | "regenerate"+ | "rerender-2k"| "compare"| "reuse"| "make-skill"@@ -72,6 +75,11 @@ export interface ActionContext {compare?: boolean;/** Shown in the viewer: actions that only open the viewer are left out. */inViewer?: boolean;+ /**+ * The install's Engine mode: "Paid APIs only" leaves out what only runs on your GPU (Regenerate in 2K). Unknown+ * (a server render, a share page): as "both".+ */+ engineMode?: "both" | "open" | "cloud";}const q = (url: string) => encodeURIComponent(url);@@ -159,9 +167,20 @@ export function outputActions(g: Generation, index: number, ctx: ActionContext =}// Uploads (the Library's Uploads tab) are files, not generations: hand-offs, download, and a// delete that first checks nothing uses the file.- if (g.feature === "upload") return [...out.filter((a) => a.id !== "favorite"), { id: "delete-upload", label: "Delete", placement: "menu", destructive: true }];+ 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));+ 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: "" });if (o.draftId) out.push({ id: "finalize", label: "Render this draft in 1080p", placement: "menu" });+ // Finishing in 2K beside it: a fal H3 result renders again at 2K on the same hosted model (a new render, priced); a clip+ // made on your GPU (or uploaded) opens Upscale → Video on Open-H3 Regenerate, which runs on your GPU only. Other cloud+ // results keep their upscalers in Upscale.+ if (o.kind === "video" && g.status === "succeeded") {+ if (canRerender(g)) 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) });+ }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" });// The steps behind a finished result, as a skill that runs again with new inputs (src/components/skills).@@ -195,16 +214,23 @@ 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): OutputAction[] {+export function nextSteps(g: Generation, index: number, max = 3, ctx: Pick<ActionContext, "engineMode"> = {}): OutputAction[] {const o = g.outputs[index];if (!o || g.status !== "succeeded") return [];- const all = outputActions(g, index);+ const all = outputActions(g, index, ctx);// A clip with a grade still to apply (a Fuobe DoP colour-grade effect) offers it first.const sounded = o.kind === "video" && !!g.op && SOUNDED_VIDEO_OPS.has(g.op);const video: OutputActionId[] | undefined = sounded? ["extend", "upscale", ...(likelySpeech(g) ? (["remove-dialogue"] as const) : []), "split-soundtrack"]: NEXT_STEPS.video;- const order: OutputActionId[] = o.kind === "video" ? [...(gradeOf(o) ? (["grade"] as const) : []), ...(video ?? [])] : (NEXT_STEPS[o.kind] ?? []);+ // 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 withRegen = (ids: OutputActionId[] | undefined) => {+ if (!ids || !regen.length) return ids;+ const at = ids.indexOf("upscale");+ return at < 0 ? [...regen, ...ids] : [...ids.slice(0, at + 1), ...regen, ...ids.slice(at + 1)];+ };+ const order: OutputActionId[] = o.kind === "video" ? [...(gradeOf(o) ? (["grade"] as const) : []), ...(withRegen(video) ?? [])] : (NEXT_STEPS[o.kind] ?? []);return order.map((id) => all.find((a) => a.id === id && a.href)).filter((a): a is OutputAction => !!a)diff --git a/src/lib/studios.ts b/src/lib/studios.tsindex 783ccc30..96e15146 100644--- a/src/lib/studios.ts+++ b/src/lib/studios.ts@@ -2,6 +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 type { Preset } from "@/lib/catalog/types";import type { StudioConfig } from "@/components/studio/studio-context";@@ -145,6 +146,8 @@ export const VIDEO_UPSCALE_STUDIO: StudioConfig = {subtitle: "Upscale a clip to 1080p, 4K or up to 8K, and restore faces, textures and text.",// 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,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.tsindex bd861c98..a1e9429f 100644--- a/src/server/gpu/tools.ts+++ b/src/server/gpu/tools.ts@@ -9,6 +9,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 { 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";@@ -86,7 +87,8 @@ export function modelTool(modelId: string, op: string): Tool | null {const routes = m.routes.filter((r) => r.op === op && (r.provider === "comfyui" || r.provider === "local"));if (!routes.length) return null;const workflows = [...new Set(routes.filter((r) => r.provider === "comfyui").flatMap((r) => expand(r.endpoint)))];- const loras = (m.options.loras ?? []).map(loraNeed);+ // With the LoRAs a graph loads itself (Open-H3 Regenerate's refiner LoRA, which a run downloads).+ const loras = [...(m.options.loras ?? []), ...routes.flatMap((r) => (r.provider === "comfyui" ? regenerateGraphLoras(r.endpoint) : []))].map(loraNeed);return {ref: `model:${modelId}#${op}`,name: m.name,@@ -202,6 +204,17 @@ 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" },+ ],+ },{ 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 },