---
title: SwinIR | Runware Docs
url: https://runware.ai/docs/models/swinir
description: Transformer-based image restoration upscaler for clean, sharp results
---
# SwinIR

SwinIR is an image restoration and super-resolution model based on Swin Transformer blocks, producing high-quality upscales with strong texture recovery and low artifact levels across common restoration settings.

- **ID**: `runware:503@1`
- **Status**: live
- **Release Date**: August 26, 2021
- **Capabilities**: Image to Image, Upscale

## Request Parameters

**API Options**

Platform-level options for task execution and delivery.

### [taskType](https://runware.ai/docs/models/swinir#request-tasktype)

- **Type**: `string`
- **Required**: true
- **Value**: `upscale`

Identifier for the type of task being performed

### [taskUUID](https://runware.ai/docs/models/swinir#request-taskuuid)

- **Type**: `string`
- **Required**: true
- **Format**: `UUID v4`

UUID v4 identifier for tracking tasks and matching async responses. Must be unique per task.

### [outputType](https://runware.ai/docs/models/swinir#request-outputtype)

- **Type**: `string`
- **Default**: `URL`

Image output type.

**Allowed values**: `URL` `base64Data` `dataURI`

### [outputFormat](https://runware.ai/docs/models/swinir#request-outputformat)

- **Type**: `string`
- **Default**: `JPG`

Specifies the file format of the generated output. The available values depend on the task type and the specific model's capabilities.

- \`JPG\`: Best for photorealistic images with smaller file sizes (no transparency).
- \`PNG\`: Lossless compression, supports high quality and transparency (alpha channel).
- \`WEBP\`: Modern format providing superior compression and transparency support.

> [!NOTE]
> \*\*Transparency\*\*: If you are using features like background removal or LayerDiffuse that require transparency, you must select a format that supports an alpha channel (e.g., \`PNG\`, \`WEBP\`, \`TIFF\`). \`JPG\` does not support transparency.

**Allowed values**: `JPG` `PNG` `WEBP`

### [outputQuality](https://runware.ai/docs/models/swinir#request-outputquality)

- **Type**: `integer`
- **Min**: `20`
- **Max**: `99`
- **Default**: `95`

Compression quality of the output. Higher values preserve quality but increase file size.

### [webhookURL](https://runware.ai/docs/models/swinir#request-webhookurl)

- **Type**: `string`
- **Format**: `URI`

Specifies a webhook URL where JSON responses will be sent via HTTP POST when generation tasks complete. For batch requests with multiple results, each completed item triggers a separate webhook call as it becomes available.

**Learn more** (1 resource):

- [Webhooks](https://runware.ai/docs/platform/webhooks) (platform)

### [deliveryMethod](https://runware.ai/docs/models/swinir#request-deliverymethod)

- **Type**: `string`
- **Default**: `sync`

Determines how the API delivers task results.

**Allowed values**:

- `sync` Returns complete results directly in the API response.
- `async` Returns an immediate acknowledgment with the task UUID. Poll for results using getResponse.

**Learn more** (1 resource):

- [Task Polling](https://runware.ai/docs/platform/task-polling) (platform)

### [uploadEndpoint](https://runware.ai/docs/models/swinir#request-uploadendpoint)

- **Type**: `string`
- **Format**: `URI`

Specifies a URL where the generated content will be automatically uploaded using the HTTP PUT method. The raw binary data of the media file is sent directly as the request body. For secure uploads to cloud storage, use presigned URLs that include temporary authentication credentials.

**Common use cases:**

- **Cloud storage**: Upload directly to S3 buckets, Google Cloud Storage, or Azure Blob Storage using presigned URLs.
- **CDN integration**: Upload to content delivery networks for immediate distribution.

```text
// S3 presigned URL for secure upload
https://your-bucket.s3.amazonaws.com/generated/content.mp4?X-Amz-Signature=abc123&X-Amz-Expires=3600

// Google Cloud Storage presigned URL
https://storage.googleapis.com/your-bucket/content.jpg?X-Goog-Signature=xyz789

// Custom storage endpoint
https://storage.example.com/uploads/generated-image.jpg
```

The content data will be sent as the request body to the specified URL when generation is complete.

### [ttl](https://runware.ai/docs/models/swinir#request-ttl)

- **Type**: `integer`
- **Min**: `60`

Time-to-live (TTL) in seconds for generated content. Only applies when `outputType` is `URL`.

### [includeCost](https://runware.ai/docs/models/swinir#request-includecost)

- **Type**: `boolean`
- **Default**: `false`

Include task cost in the response.

**Inputs**

Input resources for the task (images, audio, etc). These must be nested inside the \`inputs\` object.

### [image](https://runware.ai/docs/models/swinir#request-inputs-image)

- **Path**: `inputs.image`
- **Type**: `string`
- **Required**: true

Image input (UUID, URL, Data URI, or Base64).

**Generation Parameters**

Core parameters for controlling the generated content.

### [model](https://runware.ai/docs/models/swinir#request-model)

- **Type**: `string`
- **Required**: true
- **Value**: `runware:503@1`

Identifier of the model to use for generation.

**Learn more** (3 resources):

- [Text To Image: Model Selection The Foundation Of Generation](https://runware.ai/docs/guides/text-to-image#model-selection-the-foundation-of-generation) (guide)
- [Image Inpainting: Model Specialized Inpainting Models](https://runware.ai/docs/guides/image-inpainting#model-specialized-inpainting-models) (guide)
- [Image Outpainting: Other Critical Parameters](https://runware.ai/docs/guides/image-outpainting#other-critical-parameters) (guide)

### [upscaleFactor](https://runware.ai/docs/models/swinir#request-upscalefactor)

- **Type**: `integer`

Factor by which to upscale the generated image. A value of 2 doubles width and height.

**Allowed values**: `2` `4`

## Response Parameters

### [taskType](https://runware.ai/docs/models/swinir#response-tasktype)

- **Type**: `string`
- **Required**: true
- **Value**: `upscale`

Type of the task.

### [taskUUID](https://runware.ai/docs/models/swinir#response-taskuuid)

- **Type**: `string`
- **Required**: true
- **Format**: `UUID v4`

UUID of the task.

### [imageUUID](https://runware.ai/docs/models/swinir#response-imageuuid)

- **Type**: `string`
- **Required**: true
- **Format**: `UUID v4`

UUID of the output image.

### [imageURL](https://runware.ai/docs/models/swinir#response-imageurl)

- **Type**: `string`
- **Format**: `URI`

URL of the output image.

### [imageBase64Data](https://runware.ai/docs/models/swinir#response-imagebase64data)

- **Type**: `string`

Base64-encoded image data.

### [imageDataURI](https://runware.ai/docs/models/swinir#response-imagedatauri)

- **Type**: `string`
- **Format**: `URI`

Data URI of the output image.

### [cost](https://runware.ai/docs/models/swinir#response-cost)

- **Type**: `float`

Task cost in USD. Present when `includeCost` is set to `true` in the request.

## Examples

### Weathered Lighthouse Logbook Scan (Upscale)

![Weathered Lighthouse Logbook Scan](https://assets.runware.ai/examples/swinir/db4a2d3e-fca2-4b3c-8650-ebc197713282.jpg)

**Request**:

```json
{
  "taskType": "upscale",
  "taskUUID": "a744f0ea-5658-4fab-9718-46361f18569e",
  "model": "runware:503@1",
  "upscaleFactor": 4,
  "inputs": {
    "image": "https://assets.runware.ai/assets/inputs/e5b4d22d-8aa9-4f7a-a8df-d88247266845.jpg"
  }
}
```

**Response**:

```json
{
  "taskType": "imageUpscale",
  "taskUUID": "a744f0ea-5658-4fab-9718-46361f18569e",
  "imageUUID": "9614db90-5c8c-4a95-be79-32fe78c018c7",
  "imageURL": "https://im.runware.ai/image/os/a02d21/ws/3/ii/9614db90-5c8c-4a95-be79-32fe78c018c7.jpg",
  "cost": 0.0051,
  "inputImageUUID": "0ab06228-4ef2-433a-aa57-5f3a85ff7c28"
}
```

---

### Pixel Sprite Garden Cleanup (Upscale)

![Pixel Sprite Garden Cleanup](https://assets.runware.ai/examples/swinir/6d0afd96-c173-41fb-a881-05e555e8f2ae.jpg)

**Request**:

```json
{
  "taskType": "upscale",
  "taskUUID": "2149218f-0a72-4497-913d-d4053a672a16",
  "model": "runware:503@1",
  "upscaleFactor": 4,
  "inputs": {
    "image": "https://assets.runware.ai/assets/inputs/a4054348-eb95-4a0b-b0d0-467f52c44901.jpg"
  }
}
```

**Response**:

```json
{
  "taskType": "imageUpscale",
  "taskUUID": "2149218f-0a72-4497-913d-d4053a672a16",
  "imageUUID": "8fa80346-4ec1-47bb-ba26-d19648203852",
  "imageURL": "https://im.runware.ai/image/os/a02d21/ws/3/ii/8fa80346-4ec1-47bb-ba26-d19648203852.jpg",
  "cost": 0.0019,
  "inputImageUUID": "1d693757-b01d-4d39-a6f1-081d873be40e"
}
```

---

### Pixelated Arcade Alley Scene (Upscale)

![Pixelated Arcade Alley Scene](https://assets.runware.ai/examples/swinir/aa0d967b-f89c-4d2b-af42-3a03fed5bbed.jpg)

**Request**:

```json
{
  "taskType": "upscale",
  "taskUUID": "315ebd18-b9b5-4d3f-a063-821c507956ae",
  "model": "runware:503@1",
  "upscaleFactor": 4,
  "inputs": {
    "image": "https://assets.runware.ai/assets/inputs/2b6c78d7-40b4-4700-a6d0-77f4d6a5cd14.jpg"
  }
}
```

**Response**:

```json
{
  "taskType": "imageUpscale",
  "taskUUID": "315ebd18-b9b5-4d3f-a063-821c507956ae",
  "imageUUID": "4853f87e-32bf-4b1a-8ebe-2e7d59ab37dd",
  "imageURL": "https://im.runware.ai/image/os/a05d22/ws/3/ii/4853f87e-32bf-4b1a-8ebe-2e7d59ab37dd.jpg",
  "cost": 0.0019,
  "inputImageUUID": "db766aa6-e919-4aaa-bc40-db280bf45eb6"
}
```

---

### Graffiti-Covered Skatepark Panorama (Upscale)

![Graffiti-Covered Skatepark Panorama](https://assets.runware.ai/examples/swinir/069656a5-7260-4d4f-8b52-603591d6d169.jpg)

**Request**:

```json
{
  "taskType": "upscale",
  "taskUUID": "f2c9bac0-9530-438b-96c3-f5b55b970215",
  "model": "runware:503@1",
  "upscaleFactor": 4,
  "inputs": {
    "image": "https://assets.runware.ai/assets/inputs/e47c5599-88b7-49c1-be9f-580b03006a82.jpg"
  }
}
```

**Response**:

```json
{
  "taskType": "imageUpscale",
  "taskUUID": "f2c9bac0-9530-438b-96c3-f5b55b970215",
  "imageUUID": "3282b118-bf3f-490f-bcb8-4ec5659c31a5",
  "imageURL": "https://im.runware.ai/image/os/a16d07/ws/3/ii/3282b118-bf3f-490f-bcb8-4ec5659c31a5.jpg",
  "cost": 0.0166,
  "inputImageUUID": "b4697a97-8a99-4399-9aa6-93e71e93ffac"
}
```