From 7cb72c8478efd8c7cffe0dfeda043700736dc0e4 Mon Sep 17 00:00:00 2001 From: James Date: Fri, 4 Sep 2026 19:08:34 -0400 Subject: [PATCH] fix(cli): forward GIF and frame-format options in batch renders MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Port Dustin Persek’s fix and command regression from #1833 onto current main. Co-authored-by: Dustin Persek --- packages/cli/src/commands/render.test.ts | 37 +++++++++++++++++++++ packages/cli/src/commands/render/execute.ts | 2 ++ 2 files changed, 39 insertions(+) diff --git a/packages/cli/src/commands/render.test.ts b/packages/cli/src/commands/render.test.ts index 1e37506211..bf5abb2d95 100644 --- a/packages/cli/src/commands/render.test.ts +++ b/packages/cli/src/commands/render.test.ts @@ -1488,4 +1488,41 @@ describe("render command explicit composition", () => { }, 60_000); }); +describe("render command batch options", () => { + it("forwards gif loop and video frame format to batch row renders", async () => { + const projectDir = mkdtempSync(join(tmpdir(), "hf-render-batch-options-")); + const rowsPath = join(projectDir, "rows.json"); + writeFileSync( + join(projectDir, "index.html"), + '
', + "utf8", + ); + writeFileSync(rowsPath, "[{}]", "utf8"); + + try { + await renderModule.default.run?.({ + args: { + dir: projectDir, + batch: rowsPath, + output: join(projectDir, "renders", "{index}.gif"), + fps: "15", + quality: "standard", + format: "gif", + "gif-loop": "3", + "video-frame-format": "png", + quiet: true, + }, + } as never); + + expect(producerState.createdJobs.at(-1)).toMatchObject({ + format: "gif", + gifLoop: 3, + videoFrameFormat: "png", + }); + } finally { + rmSync(projectDir, { recursive: true, force: true }); + } + }, 60_000); +}); + // Variables-helper tests live in `../utils/variables.test.ts`. diff --git a/packages/cli/src/commands/render/execute.ts b/packages/cli/src/commands/render/execute.ts index 301a9894fd..83fa15942c 100644 --- a/packages/cli/src/commands/render/execute.ts +++ b/packages/cli/src/commands/render/execute.ts @@ -257,6 +257,7 @@ async function executeBatchRender( authoringSkill: plan.authoringSkill, catalogUsage: plan.catalogUsage, format: plan.format, + gifLoop: plan.gifLoop, workers: plan.workers, gpu: plan.useGpu, browserGpuMode: plan.browserGpuMode, @@ -264,6 +265,7 @@ async function executeBatchRender( crf: plan.crf, vp9CpuUsed: plan.vp9CpuUsed, videoBitrate: plan.videoBitrate, + videoFrameFormat: plan.videoFrameFormat, quiet: batchQuiet, browserPath, entryFile: plan.entryFile,