# Longcat Single Avatar

> LongCat-Video-Avatar is an audio-driven video generation model that can generates super-realistic, lip-synchronized long video generation with natural dynamics and consistent identity.


## Overview

- **Endpoint**: `https://fal.run/fal-ai/longcat-single-avatar/audio-to-video`
- **Model ID**: `fal-ai/longcat-single-avatar/audio-to-video`
- **Category**: audio-to-video
- **Kind**: inference
**Tags**: audio-to-video



## Pricing

Your request will cost **$0.3** per **video second** for **720p**, **$0.15** per **video second** for **480p**.

For more details, see [fal.ai pricing](https://fal.ai/pricing).

## API Information

This model can be used via our HTTP API or more conveniently via our client libraries.
See the input and output schema below, as well as the usage examples.


### Input Schema

The API accepts the following input parameters:


- **`audio_url`** (`string`, _required_):
  The URL of the audio file to drive the avatar.
  - Examples: "https://v3b.fal.media/files/b/0a87a827/QDAEdCQOPXxYWPUl2fyTY_4421psm.mp3"

- **`prompt`** (`string`, _optional_):
  The prompt to guide the video generation. Default value: `"A person is talking naturally with natural expressions and movements."`
  - Default: `"A person is talking naturally with natural expressions and movements."`
  - Examples: "A person is talking naturally with natural expressions and movements."

- **`negative_prompt`** (`string`, _optional_):
  The negative prompt to avoid in the video generation. Default value: `"Close-up, Bright tones, overexposed, static, blurred details, subtitles, style, works, paintings, images, static, overall gray, worst quality, low quality, JPEG compression residue, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn faces, deformed, disfigured, misshapen limbs, fused fingers, still picture, messy background, three legs, many people in the background, walking backwards"`
  - Default: `"Close-up, Bright tones, overexposed, static, blurred details, subtitles, style, works, paintings, images, static, overall gray, worst quality, low quality, JPEG compression residue, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn faces, deformed, disfigured, misshapen limbs, fused fingers, still picture, messy background, three legs, many people in the background, walking backwards"`

- **`num_inference_steps`** (`integer`, _optional_):
  The number of inference steps to use. Default value: `50`
  - Default: `50`
  - Range: `10` to `100`

- **`text_guidance_scale`** (`float`, _optional_):
  The text guidance scale for classifier-free guidance. Default value: `4`
  - Default: `4`
  - Range: `1` to `10`

- **`audio_guidance_scale`** (`float`, _optional_):
  The audio guidance scale. Higher values may lead to exaggerated mouth movements. Default value: `4`
  - Default: `4`
  - Range: `1` to `10`

- **`resolution`** (`ResolutionEnum`, _optional_):
  Resolution of the generated video (480p or 720p). Billing is per video-second (16 frames): 480p is 1 unit per second and 720p is 4 units per second. Default value: `"480p"`
  - Default: `"480p"`
  - Options: `"480p"`, `"720p"`

- **`num_segments`** (`integer`, _optional_):
  Number of video segments to generate. Each segment adds ~5 seconds of video. First segment is ~5.8s, additional segments are 5s each. Default value: `1`
  - Default: `1`
  - Range: `1` to `10`

- **`seed`** (`integer`, _optional_):
  The seed for the random number generator.

- **`enable_safety_checker`** (`boolean`, _optional_):
  Whether to enable safety checker. Default value: `true`
  - Default: `true`

- **`enable_prompt_expansion`** (`boolean`, _optional_):
  Whether to enable prompt expansion using an LLM to enhance the prompt for better video quality.
  - Default: `false`



**Required Parameters Example**:

```json
{
  "audio_url": "https://v3b.fal.media/files/b/0a87a827/QDAEdCQOPXxYWPUl2fyTY_4421psm.mp3"
}
```

**Full Example**:

```json
{
  "audio_url": "https://v3b.fal.media/files/b/0a87a827/QDAEdCQOPXxYWPUl2fyTY_4421psm.mp3",
  "prompt": "A person is talking naturally with natural expressions and movements.",
  "negative_prompt": "Close-up, Bright tones, overexposed, static, blurred details, subtitles, style, works, paintings, images, static, overall gray, worst quality, low quality, JPEG compression residue, ugly, incomplete, extra fingers, poorly drawn hands, poorly drawn faces, deformed, disfigured, misshapen limbs, fused fingers, still picture, messy background, three legs, many people in the background, walking backwards",
  "num_inference_steps": 50,
  "text_guidance_scale": 4,
  "audio_guidance_scale": 4,
  "resolution": "480p",
  "num_segments": 1,
  "enable_safety_checker": true
}
```


### Output Schema

The API returns the following output format:

- **`video`** (`File`, _required_):
  The generated video file.
  - Examples: "https://v3b.fal.media/files/b/0a879d5d/UfaJ-sridj9C6IjSNWLYk_output_27368fcd87a34a0fb2929ed926cd71f0.mp4"

- **`seed`** (`integer`, _required_):
  The seed used for generation.
  - Examples: 424911732



**Example Response**:

```json
{
  "video": "https://v3b.fal.media/files/b/0a879d5d/UfaJ-sridj9C6IjSNWLYk_output_27368fcd87a34a0fb2929ed926cd71f0.mp4",
  "seed": 424911732
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/fal-ai/longcat-single-avatar/audio-to-video \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "audio_url": "https://v3b.fal.media/files/b/0a87a827/QDAEdCQOPXxYWPUl2fyTY_4421psm.mp3"
   }'
```

### Python

Ensure you have the Python client installed:

```bash
pip install fal-client
```

Then use the API client to make requests:

```python
import fal_client

def on_queue_update(update):
    if isinstance(update, fal_client.InProgress):
        for log in update.logs:
           print(log["message"])

result = fal_client.subscribe(
    "fal-ai/longcat-single-avatar/audio-to-video",
    arguments={
        "audio_url": "https://v3b.fal.media/files/b/0a87a827/QDAEdCQOPXxYWPUl2fyTY_4421psm.mp3"
    },
    with_logs=True,
    on_queue_update=on_queue_update,
)
print(result)
```

### JavaScript

Ensure you have the JavaScript client installed:

```bash
npm install --save @fal-ai/client
```

Then use the API client to make requests:

```javascript
import { fal } from "@fal-ai/client";

const result = await fal.subscribe("fal-ai/longcat-single-avatar/audio-to-video", {
  input: {
    audio_url: "https://v3b.fal.media/files/b/0a87a827/QDAEdCQOPXxYWPUl2fyTY_4421psm.mp3"
  },
  logs: true,
  onQueueUpdate: (update) => {
    if (update.status === "IN_PROGRESS") {
      update.logs.map((log) => log.message).forEach(console.log);
    }
  },
});
console.log(result.data);
console.log(result.requestId);
```


## Additional Resources

### Documentation

- [Model Playground](https://fal.ai/models/fal-ai/longcat-single-avatar/audio-to-video)
- [API Documentation](https://fal.ai/models/fal-ai/longcat-single-avatar/audio-to-video/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=fal-ai/longcat-single-avatar/audio-to-video)

### fal.ai Platform

- [Platform Documentation](https://docs.fal.ai)
- [Python Client](https://docs.fal.ai/clients/python)
- [JavaScript Client](https://docs.fal.ai/clients/javascript)
