# Flux Vision Upscaler

> Flux Vision Upscaler for magnify/upscaling images with high fidelity and creativity.


## Overview

- **Endpoint**: `https://fal.run/fal-ai/flux-vision-upscaler`
- **Model ID**: `fal-ai/flux-vision-upscaler`
- **Category**: image-to-image
- **Kind**: inference


## Pricing

- **Price**: $0.1 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 URL of the image to upscale.
  - Examples: "https://storage.googleapis.com/falserverless/gallery/NOCA_Mick-Thompson.resized.resized.jpg"

- **`upscale_factor`** (`float`, _optional_):
  The upscale factor (1-4x). Default value: `2`
  - Default: `2`
  - Range: `1` to `4`

- **`seed`** (`integer`, _optional_):
  The seed to use for the upscale. If not provided, a random seed will be used.

- **`creativity`** (`float`, _optional_):
  The creativity of the model. The higher the creativity, the more the model will deviate from the original. Refers to the denoise strength of the sampling. Default value: `0.3`
  - Default: `0.3`
  - Range: `0` to `1`

- **`guidance`** (`float`, _optional_):
  CFG/guidance scale (1-4). Controls how closely the model follows the prompt. Default value: `1`
  - Default: `1`
  - Range: `1` to `4`

- **`steps`** (`integer`, _optional_):
  Number of inference steps (4-50). Default value: `20`
  - Default: `20`
  - Range: `4` to `50`

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



**Required Parameters Example**:

```json
{
  "image_url": "https://storage.googleapis.com/falserverless/gallery/NOCA_Mick-Thompson.resized.resized.jpg"
}
```

**Full Example**:

```json
{
  "image_url": "https://storage.googleapis.com/falserverless/gallery/NOCA_Mick-Thompson.resized.resized.jpg",
  "upscale_factor": 2,
  "creativity": 0.3,
  "guidance": 1,
  "steps": 20,
  "enable_safety_checker": true
}
```


### Output Schema

The API returns the following output format:

- **`image`** (`Image`, _required_):
  The URL of the generated image.
  - Examples: {"height":2048,"file_size":8842156,"file_name":"20TZeUQtQ8oKgsCKXSL81_StableSR_00002_.png","content_type":"image/png","url":"https://v3b.fal.media/files/b/panda/20TZeUQtQ8oKgsCKXSL81_StableSR_00002_.png","width":2048}

- **`seed`** (`integer`, _required_):
  The seed used to generate the image.
  - Examples: 42

- **`timings`** (`Timings`, _required_):
  The timings of the different steps in the workflow.
  - Examples: {"inference":52.8}

- **`caption`** (`string`, _required_):
  The VLM-generated caption describing the upscaled image.
  - Examples: "A highly detailed upscaled photograph featuring sharp edges and enhanced textures. The image shows improved clarity in fine details with natural color preservation and minimal artifacts, demonstrating the AI-enhanced resolution increase."



**Example Response**:

```json
{
  "image": {
    "height": 2048,
    "file_size": 8842156,
    "file_name": "20TZeUQtQ8oKgsCKXSL81_StableSR_00002_.png",
    "content_type": "image/png",
    "url": "https://v3b.fal.media/files/b/panda/20TZeUQtQ8oKgsCKXSL81_StableSR_00002_.png",
    "width": 2048
  },
  "seed": 42,
  "timings": {
    "inference": 52.8
  },
  "caption": "A highly detailed upscaled photograph featuring sharp edges and enhanced textures. The image shows improved clarity in fine details with natural color preservation and minimal artifacts, demonstrating the AI-enhanced resolution increase."
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/fal-ai/flux-vision-upscaler \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "image_url": "https://storage.googleapis.com/falserverless/gallery/NOCA_Mick-Thompson.resized.resized.jpg"
   }'
```

### 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/flux-vision-upscaler",
    arguments={
        "image_url": "https://storage.googleapis.com/falserverless/gallery/NOCA_Mick-Thompson.resized.resized.jpg"
    },
    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/flux-vision-upscaler", {
  input: {
    image_url: "https://storage.googleapis.com/falserverless/gallery/NOCA_Mick-Thompson.resized.resized.jpg"
  },
  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/flux-vision-upscaler)
- [API Documentation](https://fal.ai/models/fal-ai/flux-vision-upscaler/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=fal-ai/flux-vision-upscaler)

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