# Image Upscale — Runware

> Request an image upscale task to be processed by the Runware API. See the documentation.

- Key: `runware-image-upscale`
- Type: Action (Write)
- Version: 0.0.2
- App: Runware (`runware`) — https://pipedream.com/apps/runware.md
- This page (HTML): https://pipedream.com/apps/runware/actions/image-upscale
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/runware/actions/image-upscale/image-upscale.mjs

## Description

Request an image upscale task to be processed by the Runware API. [See the documentation](https://docs.runware.ai/en/image-editing/upscaling).

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `inputImage` | `string` | Yes | Specifies the input image to be processed. The image can be specified in one of the following formats: An UUID v4 string of a previously uploaded image or a generated image. A data URI string representing the image. The data URI must be in the format data:<mediaType>;base64, followed by the base64-encoded image. For example: data:image/png;base64,iVBORw0KGgo.... A base64 encoded image without the data URI prefix. For example: iVBORw0KGgo.... A URL pointing to the image. The image must be accessible publicly. Supported formats are: PNG, JPG and WEBP. |
| `outputType` | `string` | No | Specifies the output type in which the image is returned. |
| `outputFormat` | `string` | No | Specifies the format of the output image. |
| `upscaleFactor` | `integer` | Yes | The level of upscaling performed. Each will increase the size of the image by the corresponding factor. Eg. 2. |
| `includeCost` | `boolean` | No | If set to true, the cost to perform the task will be included in the response object. Defaults to false. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "runware",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "runware-image-upscale",
  arguments: {
    inputImage: "Input Image",
    outputType: "Output Type",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "runware-image-upscale",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    runware: { authProvisionId: "apn_xxxxxxx" },
    inputImage: "Input Image",
    outputType: "Output Type",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "runware-image-upscale",
    "configured_props": {
      "runware": { "authProvisionId": "apn_xxxxxxx" },
      "inputImage": "Input Image",
      "outputType": "Output Type"
    }
  }'
```

---

- App: https://pipedream.com/apps/runware.md · All apps: https://pipedream.com/apps
