# latentsync-1-6

> Run latentsync-1-6 by infsh online or via API. Pay per run, no setup.

**URL:** https://inference.sh/apps/infsh/latentsync-1-6
**Last updated:** 2025-09-12

---

Generates precise and realistic lip synchronization for video and audio content, ensuring high-resolution and smooth temporal consistency.

- app: `infsh/latentsync-1-6`
- maker: [infsh](https://inference.sh/apps/infsh.md)
- category: [video](https://inference.sh/apps/category/video.md)
- runs via: api, javascript and python sdk, belt cli, mcp

## latentsync-1-6 API Guide

### About
generates precise and realistic lip synchronization for video and audio content, ensuring high-resolution and smooth temporal consistency.

### 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 @7yf1sag7 pinned
result = client.run({
        "app": "infsh/latentsync-1-6@7yf1sag7",
        "input": {
            "video_path": {},
            "audio_path": {}
        }
    })

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 @7yf1sag7 pinned
## stream=True yields updates as they arrive
for update in client.run({
        "app": "infsh/latentsync-1-6@7yf1sag7",
        "input": {
            "video_path": {},
            "audio_path": {}
        }
    }, 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": "infsh/latentsync-1-6@7yf1sag7",
        "input": {
            "video_path": {},
            "audio_path": {}
        }
    }, 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": "infsh/latentsync-1-6@7yf1sag7",
    "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
- **video_path** (object) *required*: Input video file containing the face to lip-sync (e.g., MP4).
- **audio_path** (object) *required*: Input audio file used to drive lip movement (WAV recommended).
- **inference_steps** (integer): Number of diffusion denoising steps for generation.
- **guidance_scale** (number): Classifier-free guidance scale; higher can increase fidelity at the cost of diversity.
- **simple_loop** (boolean): If true, loop the source video forward-only to match audio length (no ping-pong).

#### Output
- **result_video** (object): A class representing a file in the inference.sh ecosystem.

## 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 latentsync-1-6 cost?

you pay per run from your inference shell credits, and the app shows its cost before each run. no subscription is required.

### how do I run latentsync-1-6 via api?

call infsh/latentsync-1-6 with the javascript or python sdk, the rest api, or `belt app run infsh/latentsync-1-6` from a terminal. the api reference on this page lists every input.

### who makes latentsync-1-6?

latentsync-1-6 is made by infsh and runs on inference shell. every infsh app is listed at https://inference.sh/apps/infsh.

### can my agent use latentsync-1-6?

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 latentsync-1-6?

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.
