Skip to content

Write HTML. Render video. Built for agents.

fix(cli): forward GIF and frame-format options in batch renders (#3666)

James Russo36ec028d5f95
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"),
+ '<!doctype html><html><body><div data-composition-id="main" data-width="1920" data-height="1080" data-no-timeline></div></body></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,