diff --git a/.sdk.json b/.sdk.json index f998df6..73581e7 100644 --- a/.sdk.json +++ b/.sdk.json @@ -1,5 +1,5 @@ { - "id": "6058b2ba-30f8-46d6-9c9d-83938cbf7071", + "id": "f9ec36d6-0cad-4012-a8e7-478a6f07234f", "tracked_paths": [ { "editable": true, diff --git a/package-lock.json b/package-lock.json index 73fb936..d6e403d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "magic-hour", - "version": "0.68.0", + "version": "0.69.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "magic-hour", - "version": "0.68.0", + "version": "0.69.0", "license": "MIT", "dependencies": { "make-api-request-js": "^0.2.1", diff --git a/package.json b/package.json index 86ab01e..82ccbad 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "magic-hour", - "version": "0.68.0", + "version": "0.69.0", "main": "./dist/index.js", "types": "./dist/index.d.ts", "exports": { diff --git a/src/environment.ts b/src/environment.ts index 08179dd..64920b9 100644 --- a/src/environment.ts +++ b/src/environment.ts @@ -1,4 +1,4 @@ export enum Environment { Environment = "https://api.magichour.ai", - MockServer = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.69.0", + MockServer = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.70.0", } diff --git a/src/resources/v1/character-replace/README.md b/src/resources/v1/character-replace/README.md index fc2c302..bebd0cc 100644 --- a/src/resources/v1/character-replace/README.md +++ b/src/resources/v1/character-replace/README.md @@ -84,16 +84,19 @@ For detailed examples, see the [product page](https://magichour.ai/products/char #### Parameters -| Parameter | Required | Description | Example | -| ------------------ | :------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ | -| `assets` | ✓ | Source video and reference character image for the job. | `{"imageFilePath": "api-assets/id/5678.png", "videoFilePath": "api-assets/id/1234.mp4"}` | -| `└─ imageFilePath` | ✓ | Reference character image used as the replacement or animation target. This value is either - a direct URL to the video file - `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls). See the [file upload guide](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) for details. | `"api-assets/id/5678.png"` | -| `└─ videoFilePath` | ✓ | Source video containing the subject to replace or animate. This value is either - a direct URL to the video file - `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls). See the [file upload guide](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) for details. | `"api-assets/id/1234.mp4"` | -| `endSeconds` | ✓ | End time of your clip (seconds). Must be greater than start_seconds. | `15.0` | -| `name` | ✗ | Give your video a custom name for easy identification. | `"My Character Replace video"` | -| `resolution` | ✗ | Output video resolution. Defaults to 480p, the lowest resolution available on your plan. | `"720p"` | -| `startSeconds` | ✗ | Start time of your clip (seconds). Must be ≥ 0. | `0.0` | -| `style` | ✗ | Optional style controls for replace vs animate mode and subject selection. | `{"mode": "replace", "selectionMode": "auto"}` | +| Parameter | Required | Description | Example | +| ------------------ | :------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `assets` | ✓ | Source video and reference character image for the job. | `{"imageFilePath": "api-assets/id/5678.png", "videoFilePath": "api-assets/id/1234.mp4"}` | +| `└─ imageFilePath` | ✓ | Reference character image used as the replacement or animation target. This value is either - a direct URL to the video file - `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls). See the [file upload guide](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) for details. | `"api-assets/id/5678.png"` | +| `└─ videoFilePath` | ✓ | Source video containing the subject to replace or animate. This value is either - a direct URL to the video file - `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls). See the [file upload guide](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) for details. | `"api-assets/id/1234.mp4"` | +| `endSeconds` | ✓ | End time of your clip (seconds). Must be greater than start_seconds. | `15.0` | +| `name` | ✗ | Give your video a custom name for easy identification. | `"My Character Replace video"` | +| `resolution` | ✗ | Output video resolution. Defaults to 480p, the lowest resolution available on your plan. | `"720p"` | +| `startSeconds` | ✗ | Start time of your clip (seconds). Must be ≥ 0. | `0.0` | +| `style` | ✗ | Optional style controls for replace vs animate mode and subject selection. | `{"mode": "replace", "selectionMode": "auto"}` | +| `└─ mode` | ✗ | Processing mode. `replace` swaps the detected subject with your reference character. `animate` transfers motion from the video onto your character image. | `"replace"` | +| `└─ points` | ✗ | On-frame markers for manual subject selection. Required when `selection_mode` is `point`. Ignored when `selection_mode` is `auto` or omitted. | `[{"positionX": 320, "positionY": 180, "timeSeconds": 2.5}]` | +| `└─ selectionMode` | ✗ | How to locate the subject in the source video. `auto` detects a person automatically. `point` uses your `points` to mark the subject. Defaults to `auto`. | `"auto"` | #### Example Snippet @@ -110,7 +113,6 @@ const res = await client.v1.characterReplace.create({ name: "My Character Replace video", resolution: "720p", startSeconds: 0.0, - style: { mode: "replace", selectionMode: "auto" }, }); ``` diff --git a/test/v1-character-replace.test.ts b/test/v1-character-replace.test.ts index 967d61e..0a99d04 100644 --- a/test/v1-character-replace.test.ts +++ b/test/v1-character-replace.test.ts @@ -20,7 +20,11 @@ describe("tests client.v1.characterReplace.create", () => { name: "My Character Replace video", resolution: "720p", startSeconds: 0.0, - style: { mode: "replace", selectionMode: "auto" }, + style: { + mode: "replace", + points: [{ positionX: 320, positionY: 180, timeSeconds: 2.5 }], + selectionMode: "auto", + }, }) .asResponse(), client.v1.characterReplace.create({ @@ -32,7 +36,11 @@ describe("tests client.v1.characterReplace.create", () => { name: "My Character Replace video", resolution: "720p", startSeconds: 0.0, - style: { mode: "replace", selectionMode: "auto" }, + style: { + mode: "replace", + points: [{ positionX: 320, positionY: 180, timeSeconds: 2.5 }], + selectionMode: "auto", + }, }), ]); expect(rawResponse.status).toBe(200); // Exact status code match