Skip to content

armgit / fuobe

Public Imported from GitHub
0

The open creative studio on ComfyUI: images, video, 3D and audio on open weights, on your own GPU or the cloud. Camera motions, effects, apps, Cinema, Layers, Image to 3D and an AI agent.

Upscale: Regenerate crops every shape to 16:9 or 9:16, splits by the clip's own length up to 10 minutes, and stops a longer single pass

Claude3406a2680651
diff --git a/docs/research/new-models-7.md b/docs/research/new-models-7.md
index 6033fa5b..144c56ba 100644
--- a/docs/research/new-models-7.md
+++ b/docs/research/new-models-7.md
@@ -855,7 +855,7 @@ Where it lands (exact spots).
- `src/lib/catalog/character-swap.ts`: qualities (L27), `characterQuality` (L160), `falResolution` (L172), prices; `src/lib/catalog/genjutsu.ts`: the plan steps.
Open engine.
-- Per chosen take: its 16-bit FFV1 master (already kept by `video-character-swap-h3-segment`) -> `video-regenerate-h3` (N7-3) with draftSize 'keep (snap to 32)' (H3's own canvas, any shape), the take's prompt, start_sigma 0.8 (rdh: "stays closer to the draft"), the take's seed, and a resolution capped at the source clip's size (never above the source).
+- Per chosen take: its 16-bit FFV1 master (already kept by `video-character-swap-h3-segment`) -> `video-regenerate-h3` (N7-3) with draftSize 'keep (snap to 32)' (H3's own canvas, any shape; n7-3 found the pinned pack's upscale always targets 16:9 or 9:16, so 'keep' stretches other shapes: use the preset, which cover-crops), the take's prompt, start_sigma 0.8 (rdh: "stays closer to the draft"), the take's seed, and a resolution capped at the source clip's size (never above the source).
- Then a mask composite, so only the character comes from the regenerate: a new core-node graph `video-composite-mask` (LoadVideo source + LoadVideo regenerated scaled to the source size with ImageScale + the approved whole-shot mask from `video-mask-h3-relay` -> ImageToMask (red) -> GrowMask -> FeatherMask -> ImageCompositeMasked -> CreateVideo with the source audio -> SaveVideo). Validate it on the library's CPU ComfyUI (core nodes only).
- Then the existing assembly. Takes over 15 s run in 15 s windows.
- Genjutsu Character swap: keep the 768p swap and add steps to the plan: swap -> regenerate (σ 0.8) -> mask composite -> mux.
diff --git a/scripts/comfy/README.md b/scripts/comfy/README.md
index 0a9b0b7e..00acbc07 100644
--- a/scripts/comfy/README.md
+++ b/scripts/comfy/README.md
@@ -478,7 +478,7 @@ node validate-workflows.mjs --subset-only video-regenerate-h3 # GET /object_in
| id | capability | what | validated here |
|---|---|---|---|
-| `video-regenerate-h3` | upscale-video | rdh9616's "Draft Video" example without the note, the PreviewAny nodes and `OpenH3VideoToPrompt` (the prompt goes straight into `CLIPTextEncode` 16), `curve_name` "none" (so the curve table is never read: `(model's own table)`), and `OpenH3SaveRefinedLatent` (24) kept so a failed decode can be redone from the saved latent. A `Video Slice` (29) in front cuts a 15 s window (`startTime`, `duration`). Bindings: `video`, `prompt`, `resolution` (the pack's strings: `1080p (1920x1080)`, `2k (2560x1440)`, `4k (3840x2160)`), `draftSize` (`768p (1344x768)`, `576p (1024x576)`, `keep (snap to 32)`), `frames` (node 11's `max_frames`; 24 and 26 read 11's frame count), `startSigma`, `steps`, `seed`, `filenamePrefix`. 48 GB | no: `missing_node_type` (the packs are not on the CPU validation server) |
+| `video-regenerate-h3` | upscale-video | rdh9616's "Draft Video" example without the note, the PreviewAny nodes and `OpenH3VideoToPrompt` (the prompt goes straight into `CLIPTextEncode` 16), `curve_name` "none" (so the curve table is never read: `(model's own table)`), and `OpenH3SaveRefinedLatent` (24) kept so a failed decode can be redone from the saved latent. A `Video Slice` (29) in front cuts a 15 s window (`startTime`, `duration`). Bindings: `video`, `prompt`, `resolution` (the pack's strings: `1080p (1920x1080)`, `2k (2560x1440)`, `4k (3840x2160)`), `draftSize` (`768p (1344x768)` for H3 drafts, `576p (1024x576)` for the rest; `keep (snap to 32)` is never sent, since the pack's upscale always targets 16:9 or 9:16 and would stretch any other shape), `frames` (node 11's `max_frames`; 24 and 26 read 11's frame count), `startSigma`, `steps`, `seed`, `filenamePrefix`. 48 GB | no: `missing_node_type` (the packs are not on the CPU validation server) |
- **Node packs** (opt-in, `OPEN_H3_REGEN=1` in `install-comfyui.sh`): rdh9616/ComfyUI-Open-H3-Regenerate at `9b686c5`
(Apache-2.0) and LBH-123-AI/Comfyui_Minimax_h3_latent_Upscaler at `40316cf` (MIT): `OpenH3RegenUpscale` looks up LBH's
diff --git a/scripts/comfy/library.spec.mjs b/scripts/comfy/library.spec.mjs
index 24248eea..9e94bc8e 100644
--- a/scripts/comfy/library.spec.mjs
+++ b/scripts/comfy/library.spec.mjs
@@ -132,7 +132,7 @@
// resolution* (OpenH3RegenUpscale's output size as the pack's string: params.resolution 1080p / 1440p / 2160p
// -> "1080p (1920x1080)" | "2k (2560x1440)" | "4k (3840x2160)")
// draftSize* (OpenH3RegenPrepareDraft's size: "768p (1344x768)" for H3 drafts, "576p (1024x576)" for other
-// models, "keep (snap to 32)" for odd shapes; src/lib/catalog/regenerate.ts draftSizeFor)
+// models, whatever the shape: the pack upscales to 16:9 or 9:16 only; regenerate.ts draftSizeFor)
// startSigma (OpenH3RegenSigmas start noise: the Creativity control, 0 = the release 0.909 grid)
import fs from 'node:fs';
@@ -4441,7 +4441,7 @@ export const SPEC = [
'rdh9616\'s "Open-H3 Regenerate 2K - Draft Video" example (ComfyUI-Open-H3-Regenerate at 9b686c5) without the note, the three PreviewAny nodes and OpenH3VideoToPrompt: the prompt goes straight into ' +
'CLIPTextEncode 16, so nothing calls a server from inside the graph. curve_name "none" (the tensors of the Sharp curve branches are zero in the blocks checked), so the curve table is never read ' +
'("(model\'s own table)": no 21 GB ref2va file needed). A Video Slice (29) in front cuts the 15 s window a longer clip is regenerated in (startTime, duration; 0 = the whole clip). ' +
- 'Prepare Draft (11) resamples to 24 fps, cover-crops to draftSize (768p for H3 drafts, 576p for other models, "keep (snap to 32)" for odd shapes; a portrait clip gets the preset turned) and ' +
+ 'Prepare Draft (11) resamples to 24 fps, cover-crops to draftSize (768p for H3 drafts, 576p for other models; a portrait clip gets the preset turned, and any other shape is cropped to 16:9, since the upscale always targets 16:9 or 9:16) and ' +
'cuts frames (round(seconds x 24), at most 360 = 15 s per pass); Save Refined Latent (24) and Finish (26) read its frame count. The LBH upscaler puts the latent on the target grid ' +
'(resolution: 1080p (1920x1080) | 2k (2560x1440) | 4k (3840x2160), 4K via 2K), the refine re-noises it to startSigma (0 = the release 0.909 grid; Close 0.7, Balanced 0.8) and runs steps (3, or 2 = ' +
'Faster) Euler steps at CFG 1 with Sol-Attn sparse attention and the audio held as encoded silence; the refined latent is saved before decoding (output/open_h3_latents/, redo a failed decode with ' +
diff --git a/src/lib/catalog/regenerate.ts b/src/lib/catalog/regenerate.ts
index 68901260..6eb00fc5 100644
--- a/src/lib/catalog/regenerate.ts
+++ b/src/lib/catalog/regenerate.ts
@@ -41,19 +41,25 @@ export function isH3Source(modelId: string | undefined): boolean {
}
/**
- * The draft preset (NVIDIA's reference: 768p for H3 drafts, 576p for other models). The pack turns a preset for a
- * portrait clip itself (768 x 1344), so 16:9 and 9:16 take the preset; any other shape (square, 4:3, 21:9) keeps its
- * own on the 32-pixel grid rather than being cropped to 16:9. An unknown shape takes the preset.
+ * The draft preset (NVIDIA's reference: 768p for H3 drafts, 576p for other models), for every shape. Prepare Draft
+ * cover-scales and centre-crops the clip to it (turned for a tall clip: 768 x 1344), and the pack's upscale always
+ * targets 16:9 or 9:16, so a square, 4:3 or 21:9 clip is cropped to that shape rather than stretched (REGEN_COPY.shape).
*/
-export function draftSizeFor(o: { fromH3: boolean; width?: number; height?: number }): string {
- const { width, height } = o;
- if (width && height) {
- const r = Math.max(width, height) / Math.min(width, height);
- if (Math.abs(r - 16 / 9) > 0.06) return REGEN_DRAFT.keep;
- }
+export function draftSizeFor(o: { fromH3: boolean }): string {
return o.fromH3 ? REGEN_DRAFT.h3 : REGEN_DRAFT.other;
}
+/** The shape a result comes out in: 9:16 for a tall clip, else 16:9 (the pack's own rule: height > width). */
+export function regenShape(width?: number, height?: number): "16:9" | "9:16" {
+ return width && height && height > width ? "9:16" : "16:9";
+}
+
+/** Whether a clip of this size is cropped to fit (more than a few pixels off 16:9 or 9:16). */
+export function regenCrops(width?: number, height?: number): boolean {
+ if (!width || !height) return false;
+ return Math.abs(Math.max(width, height) / Math.min(width, height) - 16 / 9) > 0.06;
+}
+
/** The refine runs at 24 fps, up to 360 frames (15 s) a pass. */
export const REGEN_FPS = 24;
export const REGEN_MAX_FRAMES = 360;
@@ -82,14 +88,48 @@ export function regenWindows(seconds: number | undefined): { start: number; dura
export const REGEN_SEAM_NOTE =
"Open-H3 Regenerate redraws up to 15 s at a time, so this clip is redrawn in parts and joined: the parts don't share history, so a seam or a small jump in detail can show where they meet";
+/** The longest clip one Regenerate run takes: 40 parts of 15 s. */
+export const REGEN_MAX_PARTS = 40;
+export const REGEN_MAX_SECONDS = REGEN_MAX_PARTS * REGEN_WINDOW_SECONDS;
+
+const mmss = (s: number) => `${Math.floor(s / 60)}:${String(Math.round(s % 60)).padStart(2, "0")}`;
+
+/** The refusal for a clip (or span) longer than one run takes. */
+export function regenTooLong(seconds: number): string {
+ return `Regenerate takes up to ${REGEN_MAX_SECONDS / 60} minutes of video in one run, and this clip runs ${mmss(seconds)}. Trim it, or regenerate it in shorter pieces`;
+}
+
+/** A run whose length isn't known when it is created (it waits for an earlier step, or reads a link). */
+export const REGEN_ONE_PASS_NOTE = "This run redraws up to 15 s in one pass. If the clip turns out longer, it stops and says how to redraw it in parts";
+
+/** The refusal when a single pass would get a clip longer than 15 s (it would come back cut short). */
+export function regenOnePassRefusal(seconds: number): string {
+ return `Regenerate redraws up to 15 s in one pass, and this clip runs ${Math.round(seconds * 10) / 10} s. Open the finished clip and pick Regenerate in 2K: it is redrawn in 15 s parts and joined`;
+}
+
+/** The note for a clip that isn't 16:9 or 9:16. */
+export function regenCropNote(width: number, height: number): string {
+ return `Regenerate makes ${regenShape(width, height)} video, so this ${width}×${height} clip is cropped to ${regenShape(width, height)} at the centre`;
+}
+
// ---------------------------------------------------------------------------
// Copy
export const REGEN_COPY = {
creative: "Regenerate · creative: redraws your clip at 2K. Details may change; motion and layout stay.",
faithful: "Restore · faithful: keeps every detail and sharpens it.",
+ /** The owner's GPU line (the install detail is theirs to act on). */
gpu: "About 3 minutes per 5 s at 2K on a 72 GB GPU. Needs about 40 GB of new files (OPEN_H3_REGEN=1 in install-comfyui.sh).",
+ /** The same line for guests and accounts. */
+ gpuVisitor: "Runs on your own GPU · about 3 minutes per 5 s at 2K",
+ /** Results are 16:9 or 9:16 whatever the clip's shape. */
+ shape: "Comes out 16:9, or 9:16 for a tall clip: other shapes are cropped to fit.",
+ /** The owner's refusal when the server's ComfyUI lacks the nodes. */
missing: "Your ComfyUI is missing the Open-H3 Regenerate nodes: run scripts/comfy/install-comfyui.sh with OPEN_H3_REGEN=1.",
+ /** 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.",
gpuOnly: "Runs on your GPU (open source)",
prompt: "Describe the clip: what is in it, how it moves, the light. Regenerate redraws it from these words",
} as const;
@@ -160,6 +200,39 @@ export function regenerateHref(video: string, prompt?: string | null): string {
return `/upscale/video?video=${encodeURIComponent(video)}&model=${REGEN_MODEL}&resolution=${REGEN_DEFAULT_TIER}${words ? `&prompt=${encodeURIComponent(words)}` : ""}`;
}
+/**
+ * The words for a clip that has none (an upload): Fuobe's reading model on your GPU (oss-reference-brief, Gemma 4 watching
+ * the frames and hearing the sound) writes one paragraph, which fills the prompt box to edit before the run.
+ */
+export const REGEN_DESCRIBE_MODEL = "oss-reference-brief";
+export const REGEN_DESCRIBE_FEATURE = "regenerate-describe";
+export const REGEN_DESCRIBE_INSTRUCTION =
+ "You are given a short video clip (frames at 1 fps plus its soundtrack). Write one paragraph of 60 to 120 words that describes it for a video model that will redraw it in more detail: who or what is in it and what they look like, the setting, how things and the camera move, the light and colours, and the look (live action, animation, 3D render). Describe only what is visible. Plain prose: no lists, headings, labels or quotes.";
+
+/** The request that reads a clip for its words (its first 15 s, what one Regenerate pass redraws). */
+export function regenDescribeRequest(video: string, seconds?: number): GenerationRequest {
+ const span = seconds && seconds > 0 ? Math.min(REGEN_WINDOW_SECONDS, seconds) : REGEN_WINDOW_SECONDS;
+ return {
+ feature: REGEN_DESCRIBE_FEATURE,
+ modelId: REGEN_DESCRIBE_MODEL,
+ op: "write",
+ inputs: { video },
+ params: { duration: Math.round(span * 100) / 100, numOutputs: 1, extra: { instruction: REGEN_DESCRIBE_INSTRUCTION } },
+ };
+}
+
+/** The paragraph from the reading model's answer: no surrounding quotes, fences or label, one line, at most 1500 characters. */
+export function regenDescription(text: string | undefined): string {
+ return (text ?? "")
+ .replace(/^```[a-z]*\s*|\s*```$/gi, "")
+ .replace(/^\s*(description|prompt)\s*:\s*/i, "")
+ .replace(/\s+/g, " ")
+ .trim()
+ .replace(/^["“'](.*)["”']$/s, "$1")
+ .trim()
+ .slice(0, HANDOFF_PROMPT);
+}
+
/**
* fal's hosted MiniMax H3 results the cloud can render again at 2K or 4K: the same endpoint, inputs and seed with a size
* it offers. A new render (fal makes 2K and 4K from a 768P base), not a sharpened copy, and priced per second.
@@ -169,8 +242,17 @@ export const RERENDER: Record<string, { label: string; perSecond: Record<"2K" |
"fuobe-character-swap": { label: "the Character swap (MiniMax H3 with LoRAs)", perSecond: { "2K": 0.1625, "4K": 0.2 } },
};
-/** A cloud result that can be re-rendered at 2K: a finished fal H3 run whose inputs are in its request. */
-export function canRerender(g: Pick<Generation, "engine" | "provider" | "modelId" | "status" | "request" | "kind">): boolean {
+/** Sizes a fal H3 result can already be at that a 2K re-render wouldn't improve. */
+const AT_2K_OR_MORE = /^(2k|4k|1440p|2160p)$/i;
+
+/**
+ * A cloud result that can be re-rendered at 2K: a finished fal H3 run whose inputs are in its request, made below 2K, and
+ * not hidden by Engine mode "Open source only" (a paid run the server would refuse).
+ */
+export function canRerender(g: Pick<Generation, "engine" | "provider" | "modelId" | "status" | "request" | "kind">, engineMode?: "both" | "open" | "cloud"): boolean {
+ if (engineMode === "open") return false;
+ const made = g.request.params?.resolution;
+ if (typeof made === "string" && AT_2K_OR_MORE.test(made)) return false;
return g.kind === "video" && g.status === "succeeded" && g.engine === "cloud" && g.provider === "fal" && !!RERENDER[g.modelId] && !g.request.chain?.length;
}
diff --git a/src/server/providers/comfyui.ts b/src/server/providers/comfyui.ts
index 1f46244e..04721e17 100644
--- a/src/server/providers/comfyui.ts
+++ b/src/server/providers/comfyui.ts
@@ -43,7 +43,7 @@ import {
import { fpsPlan } from "@/lib/av/fps";
import { resolveWorkflowId } from "@/lib/comfy-variants";
import { h3Canvas, h3Frames, isH3Graph } from "@/lib/h3-prompt";
-import { draftSizeFor, REGEN_COPY, REGEN_WORKFLOW, regenFrames, regenResolution } from "@/lib/catalog/regenerate";
+import { draftSizeFor, REGEN_COPY, REGEN_WINDOW_SECONDS, REGEN_WORKFLOW, regenFrames, regenOnePassRefusal, regenResolution } from "@/lib/catalog/regenerate";
import { carriesBoxes, LAYOUT_PARAM } from "@/lib/layout-prompt";
import { fixFromPromptError } from "@/lib/gpu/fix-codes";
import { loadIndex } from "../gpu/index-file";
@@ -1293,9 +1293,10 @@ export async function prepareWorkflow(endpointTemplate: string, input: GenInput,
if (manifest.id === REGEN_WORKFLOW) {
if (!(typeof values.prompt === "string" && values.prompt.trim())) throw new ProviderError("Regenerate redraws the clip from words: describe what is in it", 400);
const length = span ?? (clipLength !== undefined ? Math.max(0, clipLength - start) : input.sourceDuration);
- const size = clip?.width && clip.height ? clip : input.sourceSize;
+ // One pass reads at most 15 s: a longer one (a clip from an earlier step) is refused, never cut short.
+ if (length !== undefined && length > REGEN_WINDOW_SECONDS + 0.05) throw new ProviderError(regenOnePassRefusal(length), 400);
values.resolution = regenResolution(input.resolution);
- values.draftSize = draftSizeFor({ fromH3: extra.draftFrom === "h3", width: size?.width, height: size?.height });
+ values.draftSize = draftSizeFor({ fromH3: extra.draftFrom === "h3" });
values.frames = regenFrames(length);
delete extra.draftFrom;
}
@@ -1776,7 +1777,9 @@ export function promptRefusal(body: PromptRefusalBody, status: number, manifest:
const where = worker === "isolated" ? "the isolated ComfyUI worker" : "your ComfyUI";
const missingPack =
body.error?.type === "missing_node_type" && manifest.id === REGEN_WORKFLOW && worker === "main"
- ? REGEN_COPY.missing
+ ? ownGpu()
+ ? REGEN_COPY.missingVisitor
+ : REGEN_COPY.missing
: body.error?.type === "missing_node_type" && packs.length
? `This workflow needs the ${packs.join(" + ")} node pack${packs.length > 1 ? "s" : ""} on ${where} (see scripts/comfy/README.md)`
: undefined;
diff --git a/src/server/regenerate.ts b/src/server/regenerate.ts
index be1feaee..5c338679 100644
--- a/src/server/regenerate.ts
+++ b/src/server/regenerate.ts
@@ -1,10 +1,24 @@
import "server-only";
import path from "node:path";
import { nanoid } from "nanoid";
-import { isH3Source, REGEN_SEAM_NOTE, regenWindows } from "@/lib/catalog/regenerate";
+import {
+ isH3Source,
+ REGEN_COPY,
+ REGEN_FILES,
+ REGEN_LORA,
+ REGEN_MAX_PARTS,
+ REGEN_ONE_PASS_NOTE,
+ REGEN_SEAM_NOTE,
+ regenCropNote,
+ regenCrops,
+ regenTooLong,
+ regenWindows,
+} from "@/lib/catalog/regenerate";
+import { ACCESS_PLACE } from "@/lib/model-access";
import type { Generation, GenerationRequest, ModelDef } from "@/lib/catalog/types";
import { fileAccount } from "./account-library";
import { db } from "./db";
+import { offeredLoras } from "./model-access";
import { filesRel, storedMedia } from "./storage";
import { tenant, tenantAccount } from "./tenant";
@@ -30,12 +44,25 @@ export function clipMaker(ref: string | undefined): string | undefined {
return row?.model;
}
-/** A stored clip's length from its header (none for a link or another's file). */
-function clipSeconds(ref: string | undefined): number | undefined {
+/** A stored clip's length and size from its header (none for a link or another's file). */
+function clipHeader(ref: string | undefined): { seconds?: number; width?: number; height?: number } {
const info = ref ? storedMedia(ref)?.info : undefined;
- return info ? (info.videoDuration ?? info.duration) : undefined;
+ return info ? { seconds: info.videoDuration ?? info.duration, width: info.width, height: info.height } : {};
}
+const positive = (n: number | undefined) => (typeof n === "number" && n > 0 ? n : undefined);
+
+/**
+ * Why a Regenerate run can't start because Settings → Models & licences has the refiner LoRA switched off (the graph loads
+ * it itself, so the run can't leave it out): the owner is told where the switch is; a visitor gets plain words.
+ */
+export function regenSwitchedOff(): string | undefined {
+ if (!offeredLoras([REGEN_LORA]).dropped.length) return undefined;
+ return tenant() ? REGEN_COPY.off : `Open-H3 Regenerate runs with the ${REGEN_FILES[0].item}, which is switched off in ${ACCESS_PLACE}. Turn it back on there, or pick Restore · faithful`;
+}
+
+const round3 = (n: number) => Math.round(n * 1000) / 1000;
+
/** Whether a request was already planned here (its draft preset is set): a retry, or one of a split run's windows. */
const planned = (r: GenerationRequest) => typeof r.params?.extra?.draftFrom === "string";
@@ -52,15 +79,30 @@ export function createRegenerateRun(
join: (ids: string[], o: { engine: "open"; feature: string; batchId: string; title: string; copy: true; demo?: boolean; step: GenerationRequest["step"] }) => Generation,
cancel: (id: string) => void,
): Generation[] | null {
+ const off = regenSwitchedOff();
+ if (off) throw new Error(off);
if (planned(original)) return null;
const deps = opts.dependsOn === undefined ? [] : Array.isArray(opts.dependsOn) ? opts.dependsOn : [opts.dependsOn];
const video = original.inputs?.video;
const maker = deps.length ? (db().prepare("SELECT model_id AS model FROM generations WHERE id = ?").get(deps[0]) as { model: string } | undefined)?.model : clipMaker(video);
- // The preset's source half; the provider adds the shape from the header ComfyUI is sent (draftSizeFor).
+ // The preset's source half (every shape takes the preset: Prepare Draft cover-crops to 16:9 or 9:16).
const extra = { ...original.params?.extra, draftFrom: isH3Source(maker) ? "h3" : "other" };
- const seconds = original.params?.sourceDuration ?? (deps.length ? undefined : clipSeconds(video));
- const windows = deps.length || original.params?.startTime !== undefined || original.params?.endTime !== undefined ? [] : regenWindows(seconds);
- if (windows.length <= 1) return create({ ...original, params: { ...original.params, extra } }, opts);
+ // The clip's length: the stored file's own header (tenant-safe) first; a client's sourceDuration only for a link, which
+ // has no header here. A run that waits for an earlier step learns its length when it starts (the provider refuses a
+ // single pass over 15 s rather than cutting it).
+ const header = deps.length ? {} : clipHeader(video);
+ const total = deps.length ? undefined : (positive(header.seconds) ?? positive(original.params?.sourceDuration));
+ const from = Math.max(0, original.params?.startTime ?? 0);
+ const to = original.params?.endTime ?? total;
+ const span = to !== undefined ? Math.max(0, to - from) : undefined;
+ const windows = span === undefined ? [] : regenWindows(span);
+ if (windows.length > REGEN_MAX_PARTS) throw new Error(regenTooLong(span!));
+ const notes = [
+ ...(header.width && header.height && regenCrops(header.width, header.height) ? [regenCropNote(header.width, header.height)] : []),
+ ...(span === undefined ? [REGEN_ONE_PASS_NOTE] : []),
+ ];
+ const noted = (g: Generation) => (notes.length ? { ...g, notes: [...(g.notes ?? []), ...notes] } : g);
+ if (windows.length <= 1) return create({ ...original, params: { ...original.params, extra } }, opts).map(noted);
const batchId = opts.batchId ?? nanoid(10);
const parts: Generation[] = [];
try {
@@ -69,7 +111,7 @@ export function createRegenerateRun(
create(
{
...original,
- params: { ...original.params, startTime: w.start, endTime: Math.round((w.start + w.duration) * 1000) / 1000, numOutputs: 1, extra },
+ params: { ...original.params, startTime: round3(from + w.start), endTime: round3(from + w.start + w.duration), numOutputs: 1, extra },
step: { label: `Part ${i + 1} of ${windows.length}`, index: i, of: windows.length + 1 },
},
{ batchId },
@@ -88,7 +130,7 @@ export function createRegenerateRun(
step: { label: `Regenerated · ${windows.length} parts joined`, index: windows.length, of: windows.length + 1 },
},
);
- return [{ ...film, notes: [...(film.notes ?? []), REGEN_SEAM_NOTE] }, ...parts];
+ return [noted({ ...film, notes: [...(film.notes ?? []), REGEN_SEAM_NOTE] }), ...parts];
} catch (e) {
for (const p of parts) cancel(p.id);
throw e;
diff --git a/workflows/comfyui/manifest.json b/workflows/comfyui/manifest.json
index 0da91ccc..2e60c335 100644
--- a/workflows/comfyui/manifest.json
+++ b/workflows/comfyui/manifest.json
@@ -20149,7 +20149,7 @@
"vramGb": 48,
"license": "MiniMax H3 Community License (the H3 FL2VA model, its video and audio VAEs, the packaged Qwen3-VL text encoder, NVIDIA's Open-H3-Regenerate-2K LoRA and the fast H3 VAE decoder, a distilled Model Derivative): territory EXCLUDES the US, the EU, the UK and South Korea; commercial use above US$20M yearly revenue needs MiniMax's written authorization; show \"MiniMax H3\" on the product's interface; Comfy's docs add that commercial use of locally made outputs needs a MiniMax licence · the LoRA's merged LightX2V Turbo v1.2 part Apache-2.0 (at 3ec17a3), its LMS Sharp part no stated licence · LBH latent upscaler weights Apache-2.0, its node code MIT · ComfyUI-Open-H3-Regenerate Apache-2.0 · Qwen3-VL-32B base Apache-2.0",
"validated": false,
- "notes": "rdh9616's \"Open-H3 Regenerate 2K - Draft Video\" example (ComfyUI-Open-H3-Regenerate at 9b686c5) without the note, the three PreviewAny nodes and OpenH3VideoToPrompt: the prompt goes straight into CLIPTextEncode 16, so nothing calls a server from inside the graph. curve_name \"none\" (the tensors of the Sharp curve branches are zero in the blocks checked), so the curve table is never read (\"(model's own table)\": no 21 GB ref2va file needed). A Video Slice (29) in front cuts the 15 s window a longer clip is regenerated in (startTime, duration; 0 = the whole clip). Prepare Draft (11) resamples to 24 fps, cover-crops to draftSize (768p for H3 drafts, 576p for other models, \"keep (snap to 32)\" for odd shapes; a portrait clip gets the preset turned) and cuts frames (round(seconds x 24), at most 360 = 15 s per pass); Save Refined Latent (24) and Finish (26) read its frame count. The LBH upscaler puts the latent on the target grid (resolution: 1080p (1920x1080) | 2k (2560x1440) | 4k (3840x2160), 4K via 2K), the refine re-noises it to startSigma (0 = the release 0.909 grid; Close 0.7, Balanced 0.8) and runs steps (3, or 2 = Faster) Euler steps at CFG 1 with Sol-Attn sparse attention and the audio held as encoded silence; the refined latent is saved before decoding (output/open_h3_latents/, redo a failed decode with rdh's \"Decode Saved Latent\" graph) and decoded by the fast H3 VAE decoder (tiled H3 VAE fallback). Finish trims the padding, crops 1088 -> 1080 and 2176 -> 2160 and cuts the draft's own sound to length, which CreateVideo muxes back at 24 fps. Measured by the pack's author: about 3 min per 5 s at 2K on a 72 GB RTX PRO 5000 (9.5 min with dense attention); 22 s on a B200 (NVIDIA); a community run reached about 1080p on 32 GB with a lossy LoRA. The packs were tested by their author on ComfyUI 0.42.0.",
+ "notes": "rdh9616's \"Open-H3 Regenerate 2K - Draft Video\" example (ComfyUI-Open-H3-Regenerate at 9b686c5) without the note, the three PreviewAny nodes and OpenH3VideoToPrompt: the prompt goes straight into CLIPTextEncode 16, so nothing calls a server from inside the graph. curve_name \"none\" (the tensors of the Sharp curve branches are zero in the blocks checked), so the curve table is never read (\"(model's own table)\": no 21 GB ref2va file needed). A Video Slice (29) in front cuts the 15 s window a longer clip is regenerated in (startTime, duration; 0 = the whole clip). Prepare Draft (11) resamples to 24 fps, cover-crops to draftSize (768p for H3 drafts, 576p for other models; a portrait clip gets the preset turned, and any other shape is cropped to 16:9, since the upscale always targets 16:9 or 9:16) and cuts frames (round(seconds x 24), at most 360 = 15 s per pass); Save Refined Latent (24) and Finish (26) read its frame count. The LBH upscaler puts the latent on the target grid (resolution: 1080p (1920x1080) | 2k (2560x1440) | 4k (3840x2160), 4K via 2K), the refine re-noises it to startSigma (0 = the release 0.909 grid; Close 0.7, Balanced 0.8) and runs steps (3, or 2 = Faster) Euler steps at CFG 1 with Sol-Attn sparse attention and the audio held as encoded silence; the refined latent is saved before decoding (output/open_h3_latents/, redo a failed decode with rdh's \"Decode Saved Latent\" graph) and decoded by the fast H3 VAE decoder (tiled H3 VAE fallback). Finish trims the padding, crops 1088 -> 1080 and 2176 -> 2160 and cuts the draft's own sound to length, which CreateVideo muxes back at 24 fps. Measured by the pack's author: about 3 min per 5 s at 2K on a 72 GB RTX PRO 5000 (9.5 min with dense attention); 22 s on a B200 (NVIDIA); a community run reached about 1080p on 32 GB with a lossy LoRA. The packs were tested by their author on ComfyUI 0.42.0.",
"validationError": "HTTP 400: missing_node_type: Node 'Open-H3 Regenerate LoRA (curve branches off)' not found. The custom node may not be installed. (Node ID '#3')"
},
{