Skip to content

Releases: magichourhq/magic-hour-node

v0.37.0

26 Aug 04:54
7887180

Choose a tag to compare

Magic Hour Node SDK – v0.37.0 (August 25, 2025)

🚀 Highlights

All image and video clients added support for a .generate function. This function handles everything to get your output:

  1. upload files locally to Magic Hour storage
  2. trigger the create call to start generation
  3. poll the details API to check for status
  4. download the results.

Below is an example of the new code

import Client from "magic-hour";

const client = new Client({ token: process.env["API_TOKEN"]!! });
const res = await client.v1.imageToVideo.generate(
  {
    assets: { imageFilePath: "/path/to/image.png" },
    endSeconds: 5.0,
    name: "Image To Video video",
    resolution: "720p",
  },
  {
    waitForCompletion: true,
    downloadOutputs: true,
    downloadDirectory: "outputs",
  },
);
Click here to see what the code used to look like. (it's much longer than the new code)
import * as fs from "fs";
import Client from "magic-hour";

const client = new Client({ token: "YOUR_API_KEY" });

const response = await client.v1.files.uploadUrls.create({
  items: [{ extension: "png", type: "image" }],
});

const local_path = "/path/to/image.png";
const file = fs.readFileSync(local_path);

await fetch(response.items[0].uploadUrl, {
  method: "PUT",
  body: file,
});

const filePath = response.items[0].filePath;

const createRes = await client.v1.imageToVideo.create({
  assets: { imageFilePath: filePath },
  endSeconds: 5.0,
  name: "Image To Video video",
});

let downloads = [];

const projectId = createRes.id;
while (true) {
  const res = await client.v1.videoProjects.get({ id: projectId });
  if (res.status === "complete") {
    console.log("render complete");
    downloads = res.downloads;
    break;
  } else if (res.status === "error") {
    console.log("render failed");
  } else {
    console.log("render in progress");
    await new Promise((resolve) => setTimeout(resolve, 3000));
  }
}

for (let i = 0; i < downloads.length; i++) {
  const download = downloads[i];
  const res = await fetch(download.url);
  const buffer = await res.arrayBuffer();
  fs.writeFileSync(`output-${i}.mp4`, Buffer.from(buffer));
}

If you need finer control over each step, we also added the following functions:

  • client.v1.imageProjects.checkResult(...) - takes an id and poll until a complete status. Also can download file.
  • client.v1.videoProjects.checkResult(...) - takes an id and poll until a complete status. Also can download file.
  • client.v1.files.uploadFile("/path/to/your/image.jpg") - to upload a file in one convenient step.

What's Changed

New Contributors

Full Changelog: v0.36.0...v0.37.0

v0.36.0

23 Aug 01:51
4386650

Choose a tag to compare

What's Changed

  • chore: run tests against last 5 versions of node by @davidhu2000 in #94
  • chore: regen sdk to prep for new release by @davidhu2000 in #95
  • feat: add version to face swap API by @magic-hour-sdk-bot[bot] in #97

Full Changelog: v0.35.0...v0.36.0

v0.35.0

17 Aug 20:52
cb40ec6

Choose a tag to compare

What's Changed

  • feat: simplify video APIs by deprecating height/width fields by @magic-hour-sdk-bot[bot] in #92

Full Changelog: v0.34.0...v0.35.0

v0.34.0

16 Aug 23:00
3cd31d7

Choose a tag to compare

What's Changed

  • feat: update POST /v1/ai-face-editor params to be optional by @magic-hour-sdk-bot[bot] in #91

Full Changelog: v0.33.1...v0.34.0

v0.33.1

12 Aug 05:40
22dae34

Choose a tag to compare

What's Changed

  • chore: update image to video documentation to not have example for deprecated fields by @magic-hour-sdk-bot[bot] in #90

Full Changelog: v0.33.0...v0.33.1

v0.33.0

30 Jul 19:34
e0bdd6f

Choose a tag to compare

What's Changed

  • feat: add support for background image in image background remover API by @magic-hour-sdk-bot[bot] in #89

Full Changelog: v0.32.0...v0.33.0

v0.32.0

29 Jul 21:59
e8baaaa

Choose a tag to compare

What's Changed

  • fix: mark image_file_path as optional for face swap API by @magic-hour-sdk-bot[bot] in #88

Full Changelog: v0.31.0...v0.32.0

v0.31.0

29 Jul 18:29
0f5e2ce

Choose a tag to compare

What's Changed

  • feat: add face swap mode to /v1/face-swap to support multi face swap videos by @magic-hour-sdk-bot[bot] in #87

Full Changelog: v0.30.1...v0.31.0

v0.30.1

29 Jul 04:08
4265697

Choose a tag to compare

What's Changed

  • fix: add bearerAuth to face detection get details API by @magic-hour-sdk-bot[bot] in #86

Full Changelog: v0.30.0...v0.30.1

v0.30.0

29 Jul 03:34
54a2d57

Choose a tag to compare

What's Changed

  • feat: add API to run face detection and get face urls and paths by @magic-hour-sdk-bot[bot] in #85

Full Changelog: v0.29.0...v0.30.0