# AI Image to Video Generator - Magic Hour (`magichour/ai-image-to-video-generator`) Actor

Turn a still image into a video with motion, camera moves and optional audio.

- **URL**: https://apify.com/magichour/ai-image-to-video-generator.md
- **Developed by:** [Magic Hour AI](https://apify.com/magichour) (community)
- **Categories:**
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## AI Image to Video Generator - Magic Hour

Turn a still image into a video with motion, camera moves and optional audio.

### Quick start

1. Add your image.
2. Run it. A working example is prefilled, so the defaults already produce a result.
3. Download the output from the results table.

No Magic Hour account or API key needed.

### Input

| Field | Required | What it is |
|---|---|---|
| `imageUrl` | yes | The image to use. Upload a file or paste a URL. |
| `prompt` | no | What you want generated, in plain language. |
| `durationSeconds` | no | How long the output should be. |

### Output

One row per generation:

```json
{
  "schemaVersion": "1.0",
  "externalId": "sku-4471",
  "status": "succeeded",
  "operation": "image-to-video",
  "outputUrl": "https://...",
  "mediaType": "video/mp4",
  "processingTimeMs": 181371
}
```

`externalId` comes back exactly as you sent it, so a batch of results joins
straight back to your own catalog.

### Batch and automation

Process many items in one run three ways: a single item, a JSON array in
**Batch**, or an existing Apify Dataset via **Input dataset** — common column
names like `imageUrl`, `sku` and `prompt` are detected automatically, and
**Field mapping** handles the rest.

Use **Max items**, **Max spend** and **Concurrency** to bound a run.

Works through Apify Console, the API, MCP, n8n, Make and Zapier.

### Limitations

- Generation time depends on the model and output length; long video takes minutes.
- Output media is copied into Apify storage. Magic Hour's own download links expire.

### Support

- Bugs and feature requests: the Issues tab of this Actor.
- Questions about the models or your account: support@magichour.ai
- Docs: https://docs.magichour.ai

# Actor input Schema

## `imageUrl` (type: `string`):

The image to use. Upload a file or paste a URL.

## `prompt` (type: `string`):

What you want generated, in plain language.

## `durationSeconds` (type: `integer`):

How long the output should be.

## `resolution` (type: `string`):

Output resolution. Leave empty for the default.

## `aspectRatio` (type: `string`):

Output shape. Leave empty for the default.

## `modelOverride` (type: `string`):

Run a specific model instead of the default. Leave empty unless you have a reason.

## `externalId` (type: `string`):

Returned unchanged in the output, so you can join results back to your own records.

## `batch` (type: `array`):

Process many items in one run. Each entry accepts the same fields as above.

## `inputDatasetId` (type: `string`):

Process every row of an existing Apify dataset. Common column names are detected automatically.

## `fieldMapping` (type: `object`):

Map your dataset's column names onto this Actor's inputs, e.g. {"imageUrl": "photo\_link"}.

## `maxItems` (type: `integer`):

Stop after this many items.

## `maxSpendUsd` (type: `string`):

Stop before exceeding this cost. Leave empty for no ceiling beyond Apify's own limit.

## `concurrency` (type: `integer`):

How many generations to run at once.

## Actor input object example

```json
{
  "imageUrl": "https://images.pexels.com/photos/774909/pexels-photo-774909.jpeg?w=800",
  "prompt": "Camera slowly pushing in, soft natural light",
  "durationSeconds": 5,
  "maxItems": 100,
  "concurrency": 3
}
```

# Actor output Schema

## `results` (type: `string`):

One row per generation: your reference id, status, output URL, model and timing.

## `media` (type: `string`):

The generated media for each successful item.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "imageUrl": "https://images.pexels.com/photos/774909/pexels-photo-774909.jpeg?w=800",
    "prompt": "Camera slowly pushing in, soft natural light"
};

// Run the Actor and wait for it to finish
const run = await client.actor("magichour/ai-image-to-video-generator").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "imageUrl": "https://images.pexels.com/photos/774909/pexels-photo-774909.jpeg?w=800",
    "prompt": "Camera slowly pushing in, soft natural light",
}

# Run the Actor and wait for it to finish
run = client.actor("magichour/ai-image-to-video-generator").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "imageUrl": "https://images.pexels.com/photos/774909/pexels-photo-774909.jpeg?w=800",
  "prompt": "Camera slowly pushing in, soft natural light"
}' |
apify call magichour/ai-image-to-video-generator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,magichour/ai-image-to-video-generator"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/eduA0g8hhspm4V9T3/builds/y7UlXj3eYfu8NGRNb/openapi.json
