# AnimateDiff Video-to-Video Evolved

> Re-animate your videos with evolved consistency!


## Overview

- **Endpoint**: `https://fal.run/fal-ai/animatediff-v2v/turbo`
- **Model ID**: `fal-ai/animatediff-v2v/turbo`
- **Category**: video-to-video
- **Kind**: inference
**Tags**: animation, stylized, turbo



## Pricing

- **Price**: $0 per compute seconds

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:


- **`video_url`** (`string`, _required_):
  URL of the video.
  - Examples: "https://storage.googleapis.com/falserverless/model_tests/animatediff_v2v/rocket.mp4"

- **`prompt`** (`string`, _required_):
  The prompt to use for generating the image. Be as descriptive as possible for best results.
  - Examples: "masterpiece, best quality, rocket in space, galaxies in the background"

- **`negative_prompt`** (`string`, _optional_):
  The negative prompt to use. Use it to address details that you don't want
  in the image. This could be colors, objects, scenery and even the small details
  (e.g. moustache, blurry, low resolution). Default value: `"(bad quality, worst quality:1.2), ugly faces, bad anime"`
  - Default: `"(bad quality, worst quality:1.2), ugly faces, bad anime"`

- **`num_inference_steps`** (`integer`, _optional_):
  Increasing the amount of steps tells Stable Diffusion that it should take more steps
  to generate your final result which can increase the amount of detail in your image. Default value: `8`
  - Default: `8`
  - Range: `4` to `12`

- **`guidance_scale`** (`float`, _optional_):
  The CFG (Classifier Free Guidance) scale is a measure of how close you want
  the model to stick to your prompt when looking for a related image to show you. Default value: `2.2`
  - Default: `2.2`
  - Range: `1` to `2.5`

- **`loras`** (`list<LoraWeight>`, _optional_):
  The list of LoRA weights to use.
  - Default: `[]`
  - Array of LoraWeight

- **`seed`** (`integer`, _optional_):
  The same seed and the same prompt given to the same version of Stable Diffusion
  will output the same image every time.
  - Examples: 537306

- **`select_every_nth_frame`** (`integer`, _optional_):
  Select every Nth frame from the video.
  This can be used to reduce the number of frames to process, which can reduce the time and the cost.
  However, it can also reduce the quality of the final video. Default value: `2`
  - Default: `2`



**Required Parameters Example**:

```json
{
  "video_url": "https://storage.googleapis.com/falserverless/model_tests/animatediff_v2v/rocket.mp4",
  "prompt": "masterpiece, best quality, rocket in space, galaxies in the background"
}
```

**Full Example**:

```json
{
  "video_url": "https://storage.googleapis.com/falserverless/model_tests/animatediff_v2v/rocket.mp4",
  "prompt": "masterpiece, best quality, rocket in space, galaxies in the background",
  "negative_prompt": "(bad quality, worst quality:1.2), ugly faces, bad anime",
  "num_inference_steps": 8,
  "guidance_scale": 2.2,
  "loras": [],
  "seed": 537306,
  "select_every_nth_frame": 2
}
```


### Output Schema

The API returns the following output format:

- **`video`** (`File`, _required_):
  Generated video file.
  - Examples: {"content_type":"video/mp4","url":"https://storage.googleapis.com/falserverless/model_tests/animatediff_v2v/rocket-output.mp4"}

- **`seed`** (`integer`, _required_):
  Seed used for generating the video.

- **`timings`** (`Timings`, _required_)



**Example Response**:

```json
{
  "video": {
    "content_type": "video/mp4",
    "url": "https://storage.googleapis.com/falserverless/model_tests/animatediff_v2v/rocket-output.mp4"
  }
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/fal-ai/animatediff-v2v/turbo \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "video_url": "https://storage.googleapis.com/falserverless/model_tests/animatediff_v2v/rocket.mp4",
     "prompt": "masterpiece, best quality, rocket in space, galaxies in the background"
   }'
```

### 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/animatediff-v2v/turbo",
    arguments={
        "video_url": "https://storage.googleapis.com/falserverless/model_tests/animatediff_v2v/rocket.mp4",
        "prompt": "masterpiece, best quality, rocket in space, galaxies in the background"
    },
    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/animatediff-v2v/turbo", {
  input: {
    video_url: "https://storage.googleapis.com/falserverless/model_tests/animatediff_v2v/rocket.mp4",
    prompt: "masterpiece, best quality, rocket in space, galaxies in the background"
  },
  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/animatediff-v2v/turbo)
- [API Documentation](https://fal.ai/models/fal-ai/animatediff-v2v/turbo/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=fal-ai/animatediff-v2v/turbo)

### 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)
