# SeedVR2

> Use SeedVR2 to upscale your images


## Overview

- **Endpoint**: `https://fal.run/fal-ai/seedvr/upscale/image`
- **Model ID**: `fal-ai/seedvr/upscale/image`
- **Category**: image-to-image
- **Kind**: inference
**Tags**: upscale, image-to-image



## Pricing

- **Price**: $0.001 per megapixels

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:


- **`image_url`** (`string`, _required_):
  The input image to be processed
  - Examples: "https://storage.googleapis.com/falserverless/example_inputs/seedvr2/image_in.png"

- **`upscale_mode`** (`UpscaleModeEnum`, _optional_):
  The mode to use for the upscale. If 'target', the upscale factor will be calculated based on the target resolution. If 'factor', the upscale factor will be used directly. Default value: `"factor"`
  - Default: `"factor"`
  - Options: `"target"`, `"factor"`

- **`upscale_factor`** (`float`, _optional_):
  Upscaling factor to be used. Will multiply the dimensions with this factor when `upscale_mode` is `factor`. Default value: `2`
  - Default: `2`
  - Range: `1` to `10`

- **`target_resolution`** (`TargetResolutionEnum`, _optional_):
  The target resolution to upscale to when `upscale_mode` is `target`. Default value: `"1080p"`
  - Default: `"1080p"`
  - Options: `"720p"`, `"1080p"`, `"1440p"`, `"2160p"`

- **`seed`** (`integer`, _optional_):
  The random seed used for the generation process.

- **`noise_scale`** (`float`, _optional_):
  The noise scale to use for the generation process. Default value: `0.1`
  - Default: `0.1`
  - Range: `0` to `1`, step: `0.001`

- **`output_format`** (`OutputFormatEnum`, _optional_):
  The format of the output image. Default value: `"jpg"`
  - Default: `"jpg"`
  - Options: `"png"`, `"jpg"`, `"webp"`

- **`sync_mode`** (`boolean`, _optional_):
  If `True`, the media will be returned as a data URI and the output data won't be available in the request history.
  - Default: `false`



**Required Parameters Example**:

```json
{
  "image_url": "https://storage.googleapis.com/falserverless/example_inputs/seedvr2/image_in.png"
}
```

**Full Example**:

```json
{
  "image_url": "https://storage.googleapis.com/falserverless/example_inputs/seedvr2/image_in.png",
  "upscale_mode": "factor",
  "upscale_factor": 2,
  "target_resolution": "1080p",
  "noise_scale": 0.1,
  "output_format": "jpg"
}
```


### Output Schema

The API returns the following output format:

- **`image`** (`ImageFile`, _required_):
  Upscaled image file after processing
  - Examples: {"url":"https://storage.googleapis.com/falserverless/example_outputs/seedvr2/image_out.png","content_type":"image/png"}

- **`seed`** (`integer`, _required_):
  The random seed used for the generation process.



**Example Response**:

```json
{
  "image": {
    "url": "https://storage.googleapis.com/falserverless/example_outputs/seedvr2/image_out.png",
    "content_type": "image/png"
  }
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/fal-ai/seedvr/upscale/image \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "image_url": "https://storage.googleapis.com/falserverless/example_inputs/seedvr2/image_in.png"
   }'
```

### 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/seedvr/upscale/image",
    arguments={
        "image_url": "https://storage.googleapis.com/falserverless/example_inputs/seedvr2/image_in.png"
    },
    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/seedvr/upscale/image", {
  input: {
    image_url: "https://storage.googleapis.com/falserverless/example_inputs/seedvr2/image_in.png"
  },
  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/seedvr/upscale/image)
- [API Documentation](https://fal.ai/models/fal-ai/seedvr/upscale/image/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=fal-ai/seedvr/upscale/image)

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