# HeyGen Photo Video

> Run HeyGen Photo Video by heygen online or via API. $0.05/sec (720p/1080p), $0.067/sec (4K), no setup.

**URL:** https://inference.sh/apps/heygen/photo-video
**Last updated:** 2026-11-11

---

Animate portrait photos into talking videos using HeyGen. Upload a face image and add speech with configurable voice, motion prompts, and expressiveness.

- app: `heygen/photo-video`
- maker: [heygen](https://inference.sh/apps/heygen.md)
- category: [video](https://inference.sh/apps/category/video.md)
- input → output: image → video
- tasks: [image to video](https://inference.sh/apps/tag/image-to-video.md), [talking avatar](https://inference.sh/apps/tag/talking-avatar.md)
- price: $0.05/sec (720p/1080p), $0.067/sec (4K)
- runs via: api, javascript and python sdk, belt cli, mcp

## photo-video API Guide

### About
animate portrait photos into talking videos using heygen. upload a face image and add speech with configurable voice, motion prompts, and expressiveness.

### Get an API Key
Create one in [settings → api keys](https://app.inference.sh/settings/keys). The examples read it from `INFERENCE_API_KEY`.

```bash
export INFERENCE_API_KEY="inf_your_key"
```

### 1. Calling the API

#### Install the Client

```bash
pip install inferencesh
```

#### Run and Get Result
Submit a request and wait for the final result.

```python
import os
from inferencesh import inference

client = inference(api_key=os.environ["INFERENCE_API_KEY"])

## version @772bx1mk pinned
result = client.run({
        "app": "heygen/photo-video@772bx1mk",
        "input": {
            "image": "https://example.com/file.png",
            "script": "Hi there! Thanks for checking out this demo."
        }
    })

print(result["output"])
```

#### Stream Live Updates
Get real-time progress updates as the task runs.

```python
import os
from inferencesh import inference

client = inference(api_key=os.environ["INFERENCE_API_KEY"])

## version @772bx1mk pinned
## stream=True yields updates as they arrive
for update in client.run({
        "app": "heygen/photo-video@772bx1mk",
        "input": {
            "image": "https://example.com/file.png",
            "script": "Hi there! Thanks for checking out this demo."
        }
    }, stream=True):
    if update.get("progress"):
        print(f"progress: {update['progress']}%")
    if update.get("output"):
        print(f"output: {update['output']}")
```

#### Run in the Background
Start the task and get its id back right away, then check on it with `GET /tasks/{id}`. It is done when `status` is 10 (completed), 11 (failed) or 12 (cancelled).

```python
import os
from inferencesh import inference, TaskStatus

client = inference(api_key=os.environ["INFERENCE_API_KEY"])

## returns as soon as the task is created
task = client.run({
        "app": "heygen/photo-video@772bx1mk",
        "input": {
            "image": "https://example.com/file.png",
            "script": "Hi there! Thanks for checking out this demo."
        }
    }, wait=False)

## later: read its current state
state = client.tasks.get(task["id"]).data
if state["status"] == TaskStatus.COMPLETED:
    print(state["output"])
```

### 2. Files

#### Automatic Upload

```python
## local file paths are automatically uploaded
result = client.run({
    "app": "heygen/photo-video@772bx1mk",
    "input": {
        "image": "/path/to/local/image.png",  # detected & uploaded
        "audio": "https://example.com/audio.mp3",  # url passed through
    }
})
```

#### Manual Upload

```python
## upload and get a hosted URL
file = client.files.upload("/path/to/file.png")
print(file.uri)  # https://cloud.inference.sh/...
```

### 3. Schema

#### Input
- **image** (string) *required*: Portrait image to animate. Should be a clear face photo.
- **script** (string): Text for the animated image to speak.
- **voice_id** (string): Voice ID for speech. Required if script is provided.
- **audio_url** (string): URL to an audio file for the avatar to lip-sync to. Alternative to script+voice_id.
- **title** (string): Title for the video.
- **resolution** (string): Video resolution.
- **aspect_ratio** (string): Video aspect ratio.
- **expressiveness** (string): Expressiveness of the animated image.
- **motion_prompt** (string): Natural language description of desired motion (e.g., 'nodding slowly').
- **remove_background** (boolean): Remove the video background.
- **output_format** (string): Output video format.

#### Output
- **video** (string): The generated video from the photo.

## other video apps

- [Kling Video V4 Flash](https://inference.sh/apps/klingai/video-v4-flash.md): $0.094/s at 720p
- [Kling Video V4](https://inference.sh/apps/klingai/video-v4.md): $0.157/s at 720p, $0.235/s at 1080p
- [Pika H3 Flex (self-hosted)](https://inference.sh/apps/pika/pika-h3-flex-oss.md): GPU time, billed per millisecond
- [Pika H3 Flex Upscale](https://inference.sh/apps/pika/pika-h3-flex-upscale.md): $0.05-$0.14/sec (480p src), $0.03-$0.12/sec (768p src); 1080p/2K/4K targets
- [Pika H3 Flex Reference to Video](https://inference.sh/apps/pika/pika-h3-flex-reference.md): $0.06/sec 480p, $0.12/sec 768p, $0.15/sec 1080p, $0.16/sec 2k, $0.20/sec 4k (output+input video sec). Stems: $0.001/sec

## faq

### how much does HeyGen Photo Video cost?

$0.05/sec (720p/1080p), $0.067/sec (4K). you pay per run from your inference shell credits. no subscription is required.

### how do I run HeyGen Photo Video via api?

call heygen/photo-video with the javascript or python sdk, the rest api, or `belt app run heygen/photo-video` from a terminal. the api reference on this page lists every input.

### who makes HeyGen Photo Video?

HeyGen Photo Video is made by heygen and runs on inference shell. every heygen app is listed at https://inference.sh/apps/heygen.

### can my agent use HeyGen Photo Video?

yes. agents call it as a tool through the inference shell mcp server (https://api.inference.sh/mcp), the belt cli or the sdk, and pay per run like you do.

### what are the alternatives to HeyGen Photo Video?

other video apps on inference shell include Kling Video V4 Flash, Kling Video V4, Pika H3 Flex (self-hosted), Pika H3 Flex Upscale. they run through the same api, so switching is a one-line change.
