# Creative Upscaler

> Create creative upscaled images.


## Overview

- **Endpoint**: `https://fal.run/fal-ai/creative-upscaler`
- **Model ID**: `fal-ai/creative-upscaler`
- **Category**: image-to-image
- **Kind**: inference
**Tags**: upscaling



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


- **`model_type`** (`ModelTypeEnum`, _optional_):
  The type of model to use for the upscaling. Default is SD_1_5 Default value: `"SD_1_5"`
  - Default: `"SD_1_5"`
  - Options: `"SD_1_5"`, `"SDXL"`
  - Examples: "SD_1_5", "SDXL"

- **`image_url`** (`string`, _required_):
  The image to upscale.
  - Examples: "https://storage.googleapis.com/falserverless/model_tests/upscale/owl.png", "https://storage.googleapis.com/falserverless/gallery/blue-bird.jpeg"

- **`prompt`** (`string`, _optional_):
  The prompt to use for generating the image. Be as descriptive as possible for best results. If no prompt is provide BLIP2 will be used to generate a prompt.

- **`scale`** (`float`, _optional_):
  The scale of the output image. The higher the scale, the bigger the output image will be. Default value: `2`
  - Default: `2`
  - Range: `1` to `5`

- **`creativity`** (`float`, _optional_):
  How much the output can deviate from the original Default value: `0.5`
  - Default: `0.5`
  - Range: `0` to `1`

- **`detail`** (`float`, _optional_):
  How much detail to add Default value: `1`
  - Default: `1`
  - Range: `0` to `5`

- **`shape_preservation`** (`float`, _optional_):
  How much to preserve the shape of the original image Default value: `0.25`
  - Default: `0.25`
  - Range: `0` to `3`

- **`prompt_suffix`** (`string`, _optional_):
  The suffix to add to the prompt. This is useful to add a common ending to all prompts such as 'high quality' etc or embedding tokens. Default value: `" high quality, highly detailed, high resolution, sharp"`
  - Default: `" high quality, highly detailed, high resolution, sharp"`

- **`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: `"blurry, low resolution, bad, ugly, low quality, pixelated, interpolated, compression artifacts, noisey, grainy"`
  - Default: `"blurry, low resolution, bad, ugly, low quality, pixelated, interpolated, compression artifacts, noisey, grainy"`
  - Examples: "blurry, low resolution, bad, ugly, low quality, pixelated, interpolated, compression artifacts, noisey, grainy"

- **`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: 42

- **`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: `7.5`
  - Default: `7.5`
  - Range: `0` to `16`

- **`num_inference_steps`** (`integer`, _optional_):
  The number of inference steps to use for generating the image. The more steps
  the better the image will be but it will also take longer to generate. Default value: `20`
  - Default: `20`
  - Range: `1` to `200`

- **`enable_safety_checks`** (`boolean`, _optional_):
  If set to true, the resulting image will be checked whether it includes any
  potentially unsafe content. If it does, it will be replaced with a black
  image. Default value: `true`
  - Default: `true`

- **`skip_ccsr`** (`boolean`, _optional_):
  If set to true, the image will not be processed by the CCSR model before
  being processed by the creativity model.
  - Default: `false`

- **`override_size_limits`** (`boolean`, _optional_):
  Allow for large uploads that could take a very long time.
  - Default: `false`

- **`base_model_url`** (`string`, _optional_):
  The URL to the base model to use for the upscaling

- **`additional_lora_url`** (`string`, _optional_):
  The URL to the additional LORA model to use for the upscaling. Default is None

- **`additional_lora_scale`** (`float`, _optional_):
  The scale of the additional LORA model to use for the upscaling. Default is 1.0 Default value: `1`
  - Default: `1`

- **`additional_embedding_url`** (`string`, _optional_):
  The URL to the additional embeddings to use for the upscaling. Default is None



**Required Parameters Example**:

```json
{
  "image_url": "https://storage.googleapis.com/falserverless/model_tests/upscale/owl.png"
}
```

**Full Example**:

```json
{
  "model_type": "SD_1_5",
  "image_url": "https://storage.googleapis.com/falserverless/model_tests/upscale/owl.png",
  "scale": 2,
  "creativity": 0.5,
  "detail": 1,
  "shape_preservation": 0.25,
  "prompt_suffix": " high quality, highly detailed, high resolution, sharp",
  "negative_prompt": "blurry, low resolution, bad, ugly, low quality, pixelated, interpolated, compression artifacts, noisey, grainy",
  "seed": 42,
  "guidance_scale": 7.5,
  "num_inference_steps": 20,
  "enable_safety_checks": true,
  "additional_lora_scale": 1
}
```


### Output Schema

The API returns the following output format:

- **`image`** (`Image`, _required_):
  The generated image file info.

- **`seed`** (`integer`, _required_):
  Seed of the generated Image. It will be the same value of the one passed in the
  input or the randomly generated that was used in case none was passed.



**Example Response**:

```json
{
  "image": {
    "url": "",
    "content_type": "image/png",
    "file_name": "z9RV14K95DvU.png",
    "file_size": 4404019,
    "width": 1024,
    "height": 1024
  }
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/fal-ai/creative-upscaler \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "image_url": "https://storage.googleapis.com/falserverless/model_tests/upscale/owl.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/creative-upscaler",
    arguments={
        "image_url": "https://storage.googleapis.com/falserverless/model_tests/upscale/owl.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/creative-upscaler", {
  input: {
    image_url: "https://storage.googleapis.com/falserverless/model_tests/upscale/owl.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/creative-upscaler)
- [API Documentation](https://fal.ai/models/fal-ai/creative-upscaler/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=fal-ai/creative-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)
