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
Preset covers: full-length clips show every frame; still-only presets leave the first bands
Adarsh747f2516514f
diff --git a/public/previews/presets/effect-canvas.jpg b/public/previews/presets/effect-canvas.jpgindex 728e3b73..5a05a7d4 100644Binary files a/public/previews/presets/effect-canvas.jpg and b/public/previews/presets/effect-canvas.jpg differdiff --git a/public/previews/presets/effect-canvas.mp4 b/public/previews/presets/effect-canvas.mp4index dbfee07a..3e903a6a 100644Binary files a/public/previews/presets/effect-canvas.mp4 and b/public/previews/presets/effect-canvas.mp4 differdiff --git a/public/previews/presets/motion-dutch-angle.jpg b/public/previews/presets/motion-dutch-angle.jpgindex e4feea53..dba43440 100644Binary files a/public/previews/presets/motion-dutch-angle.jpg and b/public/previews/presets/motion-dutch-angle.jpg differdiff --git a/public/previews/presets/motion-dutch-angle.mp4 b/public/previews/presets/motion-dutch-angle.mp4index 9d821555..75bde435 100644Binary files a/public/previews/presets/motion-dutch-angle.mp4 and b/public/previews/presets/motion-dutch-angle.mp4 differdiff --git a/public/previews/presets/thumbs/effect-canvas.jpg b/public/previews/presets/thumbs/effect-canvas.jpgindex 37007637..88647e3b 100644Binary files a/public/previews/presets/thumbs/effect-canvas.jpg and b/public/previews/presets/thumbs/effect-canvas.jpg differdiff --git a/public/previews/presets/thumbs/motion-dutch-angle.jpg b/public/previews/presets/thumbs/motion-dutch-angle.jpgindex 6ac424b5..9a6fa79d 100644Binary files a/public/previews/presets/thumbs/motion-dutch-angle.jpg and b/public/previews/presets/thumbs/motion-dutch-angle.jpg differdiff --git a/scripts/eval/README.md b/scripts/eval/README.mdindex 280e66c9..6f520e1b 100644--- a/scripts/eval/README.md+++ b/scripts/eval/README.md@@ -523,8 +523,9 @@ pnpm eval:covers --from-masters <dir> --run comfyui-previews-2026-10 --engine co- Each cover records the run, the engine, the model and the variant: `--model` for stills, `--video-model`for clips. A folder's `meta.json` can name its own `model` and `variant`.- A folder's `meta.json` with `"length": "full"` keeps the clip's whole length (at most 8 seconds) instead- of its first 4 seconds, for an effect whose end matters. The cover loops like the others: the same- crossfade, and its first frame as the poster. The cards play a clip of any length. A change to+ of its first 4 seconds, for an effect whose end matters. Every frame of the clip shows clean: 6 frames+ are added after its last one, dissolving back to its first, so the loop has no jump and the end is not+ blended away. Its first frame is the poster. The cards play a clip of any length. A change to`meta.json` makes the cover again on the next run, as a new master does.- The manifest is merged. Covers that other runs wrote stay, and only the ids found in `<dir>` arereplaced. An id whose cover another run made in another folder (a measured `eval:covers` cover) isdiff --git a/scripts/eval/lib/covers.mjs b/scripts/eval/lib/covers.mjsindex 9d96ed7d..7d379aad 100644--- a/scripts/eval/lib/covers.mjs+++ b/scripts/eval/lib/covers.mjs@@ -303,6 +303,27 @@ export function seamless(frames, fade) {return out;}+/**+ * A loop that keeps every frame: `fade` frames are added after the last one, dissolving from it to the first, so the+ * clip shows its whole length clean and its loop goes back to its first frame without a jump. For a clip whose end+ * matters (`length: "full"`), which seamless would blend into its opening.+ * @param {Buffer[]} frames+ * @param {number} fade+ */+export function dissolveBack(frames, fade) {+ if (!fade || frames.length < 2) return frames;+ const last = frames.at(-1);+ const first = frames[0];+ const out = frames.slice();+ for (let k = 0; k < fade; k++) {+ const a = (k + 1) / (fade + 1);+ const blend = Buffer.allocUnsafe(last.length);+ for (let i = 0; i < blend.length; i++) blend[i] = Math.round(last[i] * (1 - a) + first[i] * a);+ out.push(blend);+ }+ return out;+}+/*** A still at most STILL_PX wide/tall (a 4:2:0 JPEG), or a clip's first seconds at most CLIP_PX that loops* without a jump (crossfaded, unless it loops already), with its first frame as the poster.@@ -312,7 +333,8 @@ export function seamless(frames, fade) {* and starts the clip there, so nothing jumps.** With `length: "full"` (an effect whose end matters), the clip keeps its whole length (up to REST_CLIP_SECONDS)- * instead of its first CLIP_SECONDS, and loops as any other: crossfaded, with its first frame as the poster.+ * instead of its first CLIP_SECONDS. Every frame shows clean: its loop dissolves from its last frame back to its first+ * after the end (dissolveBack) rather than over it, and its first frame is the poster.* @param {string} src* @param {"image" | "video"} kind* @param {string} destBase@@ -324,14 +346,17 @@ export function encode(src, kind, destBase, opts = {}) {if (kind === "video") {const atEnd = opts.rest === "end";// How much of the clip its loop keeps: the first CLIP_SECONDS, or all of it (up to REST_CLIP_SECONDS).- const keep = opts.length === "full" ? REST_CLIP_SECONDS : CLIP_SECONDS;- // Decoded at CLIP_FPS: what it keeps, plus the frames the crossfade takes back from the start (a reveal: all of it).- const seconds = atEnd ? REST_CLIP_SECONDS : keep + LOOP_FADE / CLIP_FPS;+ const full = opts.length === "full";+ const keep = full ? REST_CLIP_SECONDS : CLIP_SECONDS;+ // Decoded at CLIP_FPS: what it keeps, plus the frames the crossfade takes back from the start (a reveal or a full+ // clip: all of it, as a full clip's dissolve is added after its end).+ const seconds = atEnd || full ? REST_CLIP_SECONDS : keep + LOOP_FADE / CLIP_FPS;const y4m = run(["-i", src, "-t", String(seconds), "-an", "-sn", "-dn", "-vf", `${fit(CLIP_PX)},fps=${CLIP_FPS},format=yuv420p`, "-f", "yuv4mpegpipe", "-"]);const { header, frames, luma } = readY4m(y4m);if (frames.length < 2) throw new Error(`${src} has no frames to make a clip of`);const cut = frames.slice(0, keep * CLIP_FPS);- const looped = atEnd ? frames : loopsAlready(cut, luma) ? cut : seamless(frames, Math.min(LOOP_FADE, Math.floor(frames.length / 4)));+ const fade = Math.min(LOOP_FADE, Math.floor(frames.length / 4));+ const looped = atEnd ? frames : loopsAlready(cut, luma) ? cut : full ? dissolveBack(cut, fade) : seamless(frames, fade);const stream = (list) => Buffer.concat([Buffer.from(`${header}\n`, "latin1"), ...list.flatMap((fr) => [Buffer.from("FRAME\n"), fr])]);run(["-f", "yuv4mpegpipe", "-i", "-", "-an", "-c:v", "libx264", "-pix_fmt", "yuv420p", "-crf", "28", "-map_metadata", "-1", "-movflags", "+faststart", `${destBase}.mp4`], stream(looped));if (atEnd) {diff --git a/src/lib/preset-covers.generated.ts b/src/lib/preset-covers.generated.tsindex d3fd7710..914386b3 100644--- a/src/lib/preset-covers.generated.ts+++ b/src/lib/preset-covers.generated.ts@@ -168,7 +168,7 @@ export const PRESET_COVERS: Record<string, PresetCoverEntry> = {"effect-cakeify": ["98aef800","26248dfc"],"effect-candy-pink": ["5432d3a6","fbfdcfa3"],"effect-cannabis": ["96f221d3","c724e8b5"],- "effect-canvas": ["178338e7","30c52045"],+ "effect-canvas": ["74b8b693","63bb1c96"],"effect-car-drive": ["0635f234","a6a9bc96"],"effect-car-explosion": ["9e9a4e95","51b9f7f7"],"effect-censorship": ["56f8a8ce","a11978f7"],@@ -422,7 +422,7 @@ export const PRESET_COVERS: Record<string, PresetCoverEntry> = {"motion-downhill-pov": ["c4343fec","c4e2bf30"],"motion-dreamy-flow": ["34c28862","37dbe2a7"],"motion-drone-reveal": ["e1de3485","35d74d02"],- "motion-dutch-angle": ["973f914f","074d1af0"],+ "motion-dutch-angle": ["b5de1047","16570d51"],"motion-earth-zoom-out": ["47988031","fde8a23f"],"motion-eating-zoom": ["4021e9a0","41a227ab"],"motion-epic-scale": ["52e16587","e2a161d2"],diff --git a/src/lib/preset-featured.ts b/src/lib/preset-featured.tsindex 04e04ddd..307eaf0f 100644--- a/src/lib/preset-featured.ts+++ b/src/lib/preset-featured.ts@@ -40,8 +40,8 @@ const ORDER: Record<"app" | "motion" | "effect", string[]> = {motion: [`motion-dolly-in motion-crane-up motion-catwalk motion-classic-static motion-glam motion-slow-motion motion-zoom-in- motion-super-dolly-in motion-super-dolly-out motion-crash-zoom-in motion-crash-zoom-out motion-360-orbit- motion-arc-left motion-lazy-susan motion-crane-down motion-crane-over-the-head motion-dolly-left motion-tracking+ motion-super-dolly-in motion-super-dolly-out motion-crash-zoom-in motion-arc-left motion-lazy-susan+ motion-crane-down motion-crane-over-the-head motion-trackingmotion-double-dolly motion-snorricam motion-fpv-drone motion-aerial-pullback motion-helicopter-shotmotion-car-grip motion-car-chasing motion-static motion-documentary-snap motion-dreamy-flow motion-epic-scalemotion-intimate-observer motion-one-take motion-silent-machine@@ -51,7 +51,8 @@ const ORDER: Record<"app" | "motion" | "effect", string[]> = {motion-action-run motion-drone-reveal motion-robo-arm motion-kiss motion-raw-chaos motion-zoom-outmotion-dolly-zoom-in motion-through-object-out motion-jib-up motion-overhead motion-buckle-up motion-truck-leftmotion-bts motion-robot-arm motion-timelapse-glam motion-low-shutter motion-focus-change motion-roll-transition- motion-flying-cam-transition motion-boxing motion-ski-carving motion-snowboard-carving+ motion-flying-cam-transition motion-boxing motion-ski-carving motion-snowboard-carving motion-crash-zoom-out+ motion-360-orbit motion-dolly-left`,`motion-zoom motion-dolly-out motion-rapid-zoom-in motion-through-object-in motion-earth-zoom-out motion-pan-left@@ -70,7 +71,7 @@ const ORDER: Record<"app" | "motion" | "effect", string[]> = {effect: [`effect-sand-storm effect-outfit-switch effect-wind-to-face effect-levitation effect-nature-bloom effect-lens-flare- effect-dirty-lens effect-train-rush effect-exploded-view effect-display-transition effect-splash-transition+ effect-dirty-lens effect-train-rush effect-exploded-view effect-display-transitioneffect-pearl-earring effect-blue-depth effect-magazine effect-film-colors effect-black-gloss effect-crimson-vigileffect-bleached-warm effect-cold-steel`,@@ -82,7 +83,7 @@ const ORDER: Record<"app" | "motion" | "effect", string[]> = {effect-pool-jump effect-raven-transition effect-ballet effect-hair-style effect-column-wipe effect-studio-slideeffect-cutout effect-boarding-pass effect-floating-fall effect-stop-world effect-agamemnon effect-acideffect-bubbles effect-canvas effect-comic effect-fragments effect-multiverse effect-ocean effect-origami- effect-particles effect-bleach-bypass effect-teal-orange-epic+ effect-particles effect-bleach-bypass effect-teal-orange-epic effect-splash-transition`,`effect-ice-rose effect-medusa-gorgona effect-bloom-mouth effect-floral-eyes effect-sakura-petalsdiff --git a/src/lib/preset-previews.generated.ts b/src/lib/preset-previews.generated.tsindex 3b145175..5886e218 100644--- a/src/lib/preset-previews.generated.ts+++ b/src/lib/preset-previews.generated.ts@@ -1258,8 +1258,8 @@ export const PRESET_PREVIEWS: Record<string, PresetPreviewMedia> = {"variant": "lean-json"},"effect-canvas": {- "poster": "/previews/presets/effect-canvas.jpg?v=178338e7",- "video": "/previews/presets/effect-canvas.mp4?v=30c52045",+ "poster": "/previews/presets/effect-canvas.jpg?v=74b8b693",+ "video": "/previews/presets/effect-canvas.mp4?v=63bb1c96","run": "comfyui-previews-2026-10","engine": "comfyui","model": "minimax-h3",@@ -3224,8 +3224,8 @@ export const PRESET_PREVIEWS: Record<string, PresetPreviewMedia> = {"variant": "lean-json"},"motion-dutch-angle": {- "poster": "/previews/presets/motion-dutch-angle.jpg?v=973f914f",- "video": "/previews/presets/motion-dutch-angle.mp4?v=074d1af0",+ "poster": "/previews/presets/motion-dutch-angle.jpg?v=b5de1047",+ "video": "/previews/presets/motion-dutch-angle.mp4?v=16570d51","run": "comfyui-previews-2026-10","engine": "comfyui","model": "minimax-h3",diff --git a/tests/covers-from-masters.test.ts b/tests/covers-from-masters.test.tsindex 536f036b..67817988 100644--- a/tests/covers-from-masters.test.ts+++ b/tests/covers-from-masters.test.ts@@ -15,9 +15,10 @@ const covers = (await import("../scripts/eval/lib/covers.mjs")) as unknown as {withVersions: (entries: Record<string, Entry>, publicDir: string) => Record<string, Entry>;versionCovers: (opts: { publicDir?: string; manifest?: string; dryRun?: boolean }) => { entries: number; urls: number; changed: number; thumbs: string[]; unversioned: string[] };seamless: (frames: Buffer[], fade: number) => Buffer[];+ dissolveBack: (frames: Buffer[], fade: number) => Buffer[];loopsAlready: (frames: Buffer[], luma: number) => boolean;};-const { coversFromMasters, loopsAlready, readManifest, seamless, versionCovers, withVersions, writeManifest } = covers;+const { coversFromMasters, dissolveBack, loopsAlready, readManifest, seamless, versionCovers, withVersions, writeManifest } = covers;const dir = fs.mkdtempSync(path.join(os.tmpdir(), "fuobe-covers-masters-"));afterAll(() => fs.rmSync(dir, { recursive: true, force: true }));@@ -183,13 +184,13 @@ describe("covers from masters", () => {]);const seconds = (f: string) => Number(spawnSync("ffprobe", ["-v", "error", "-show_entries", "format=duration", "-of", "csv=p=0", path.join(out, f)], { encoding: "utf8" }).stdout);const frames = (f: string) => Number(spawnSync("ffprobe", ["-v", "error", "-count_frames", "-select_streams", "v:0", "-show_entries", "stream=nb_read_frames", "-of", "csv=p=0", path.join(out, f)], { encoding: "utf8" }).stdout);- // The usual cover: the first 4 s (96 frames at 24 fps). The full one: all 5.2 s (124 or 125 frames), less the 6 the- // loop's crossfade blends into its end.+ // The usual cover: the first 4 s (96 frames at 24 fps). The full one: all 5.2 s (124 or 125 frames), plus the 6 of+ // the dissolve back to its first frame added after its end.expect(frames("effect-set-on-fire.mp4")).toBe(96);expect(seconds("effect-set-on-fire.mp4")).toBeLessThanOrEqual(4.1);- expect(frames("effect-canvas.mp4")).toBeGreaterThanOrEqual(118);- expect(frames("effect-canvas.mp4")).toBeLessThanOrEqual(119);- expect(seconds("effect-canvas.mp4")).toBeGreaterThan(4.8);+ expect(frames("effect-canvas.mp4")).toBeGreaterThanOrEqual(130);+ expect(frames("effect-canvas.mp4")).toBeLessThanOrEqual(131);+ expect(seconds("effect-canvas.mp4")).toBeGreaterThan(5.3);// The manifest entry is a clip cover like any other: the length is the file's.expect(readManifest(manifest)["effect-canvas"]).toEqual({ poster: versioned("/previews/presets/effect-canvas.jpg"), video: versioned("/previews/presets/effect-canvas.mp4"), run: "comfyui-previews-test", engine: "comfyui", model: "minimax-h3", variant: "lean-json" });@@ -374,4 +375,17 @@ describe("covers from masters", () => {expect(loopsAlready(orbit, 8)).toBe(true);expect(loopsAlready(frames, 2)).toBe(false);});++ it("keeps every frame of a clip whose end matters, and dissolves from its last frame back to its first after it", () => {+ const frames = Array.from({ length: 20 }, (_, i) => Buffer.from([i * 10, i * 10]));+ const out = dissolveBack(frames, 4);+ expect(out).toHaveLength(24);+ // Every frame as it was, the first and the last too.+ expect(out.slice(0, 20)).toEqual(frames);+ // Then four frames from the last (190) towards the first (0): the loop back to the first is a step like theirs.+ expect(out.slice(20).map((b) => b[0])).toEqual([152, 114, 76, 38]);+ const steps = out.map((b, i) => Math.abs(b[0] - out[(i + 1) % out.length][0]));+ expect(Math.max(...steps)).toBe(38);+ expect(dissolveBack(frames, 0)).toBe(frames);+ });});