# Topaz Generative Upscale

> Generative image upscaling that fixes noise, blur, scratches and soft faces in one step.

## Overview

- **Model ID**: `topaz-upscale-image-generative`
- **Workflow**: `topaz/upscale/image/generative`
- **Provider**: Topaz
- **Origin**: Partner Model
- **Category**: Image → Image (image)
- **Output**: One or more image URLs.
- **Tags**: upscale, image required
- **Unified endpoint**: `POST https://api.picsart.com/workflows/v1/models/execute` (model id in the body)
- **Compatibility endpoint**: `POST https://api.picsart.com/workflows/topaz/upscale/image/generative/execute` (vendor's own parameters)
- **Execution**: sync (`/execute`) returns the result in one call; async is also available
- **Model page**: https://picsart.com/api-platform/models/topaz-upscale-image-generative

## Pricing

Live pricing for this model is not published yet. See https://picsart.com/pricing/ or the Pricing tab of the model page (https://picsart.com/api-platform/models/topaz-upscale-image-generative#pricing).

## Authentication

The SDK and the REST API authenticate with a Picsart API key sent as a bearer token. Create a key in the console at https://picsart.com/api-platform/dashboard/api-keys, keep it in a server-side environment variable, and never ship it in browser code or commit it.

```bash
export PICSART_API_KEY="YOUR_KEY"
```

```http
Authorization: Bearer $PICSART_API_KEY
```

The CLI and the MCP server do not use an API key: `gen-ai login` signs in through the browser once per machine and stores a token locally.

## Interfaces

- **SDK (TypeScript)** — `@picsart/ai-sdk` (Node 20+, ESM). Type-safe `ai.generate()` / `ai.generateText()` with per-model parameter types; polls long jobs for you.
- **SDK (Python)** — `picsart-ai-sdk` (Python 3.10+, async). The same surface in snake_case: `await ai.generate()` / `await ai.generate_text()`, with a typed input per model.
- **REST** — the API gateway at `https://api.picsart.com`. Sync `/execute`, or async `/submit` + `/{taskId}/result`.
- **CLI** — `@picsart/gen-ai` (`gen-ai`). Generate from a terminal, quote cost before spending, emit JSON for pipelines.
- **MCP** — the same models inside Claude Code, Cursor, Windsurf and other MCP hosts. Setup: https://picsart.com/gen-ai-mcp/

```bash
npm install @picsart/ai-sdk      # SDK (TypeScript)
pip install picsart-ai-sdk       # SDK (Python)
npm install -g @picsart/gen-ai   # CLI (also drives the MCP server)
```

## Unified API (recommended)

One parameter set, used by the SDK and by REST alike: the names below are what `ai.generate('topaz-upscale-image-generative', …)` takes, and what goes inside the inner `params` of a REST call. Over REST the model id travels in the body, not the path — one workflow, `v1/models`, fronts the whole catalogue.

### Execution modes

- **Sync** — `POST /workflows/v1/models/execute` returns the result in one call. Only for jobs that finish within ~20 seconds; otherwise it times out.
- **Async** — `POST /workflows/v1/models/submit` returns a task id; poll `GET /workflows/v1/models/{taskId}/result` until `response.status` is `COMPLETED` or `FAILED`. Task statuses: `ACCEPTED` · `IN_PROGRESS` · `COMPLETED` · `FAILED`.
- **SDK** — `ai.generate()` always awaits the finished result; polling is hidden.

### Input parameters

- **`imageUrls`** (`list<string>`, _required_): Input images, as URLs: the image to edit, or references for subject, style or composition.
  - Accepts: image URLs (max 1)
- **`model`** (`string`, _optional_): Model
  - Default: `"Wonder 4"`
  - Options: `Wonder 4`, `Wonder 3.5`, `Wonder 3`, `Wonder 2`, `Wonder`, `Recover 3`, `Standard MAX`, `Redefine`, `Recovery V2`, `Recovery`

### Input JSON Schema

The inner `params` object. Over REST it is wrapped as `{ "params": { "model": "<id>", "params": <this> } }`; the SDK takes it directly.

```json
{
  "type": "object",
  "required": [
    "imageUrls"
  ],
  "properties": {
    "imageUrls": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri",
        "description": "image URL"
      },
      "maxItems": 1,
      "description": "Input images, as URLs: the image to edit, or references for subject, style or composition."
    },
    "model": {
      "type": "string",
      "enum": [
        "Wonder 4",
        "Wonder 3.5",
        "Wonder 3",
        "Wonder 2",
        "Wonder",
        "Recover 3",
        "Standard MAX",
        "Redefine",
        "Recovery V2",
        "Recovery"
      ],
      "default": "Wonder 4",
      "description": "Model"
    }
  },
  "additionalProperties": false
}
```

### Required parameters example

The required parameters plus the defaults that shape the output, as a REST body:

```json
{
  "params": {
    "model": "topaz-upscale-image-generative",
    "params": {
      "imageUrls": [
        "https://cdn.example.com/input.jpg"
      ]
    }
  }
}
```

### Response

The body is the gateway's status envelope: the output is at `response.result`, next to the task id, its status and the credits charged. Asset models return `url` plus an `items` array of results.

```json
{
  "status": "success",
  "response": {
    "id": "task_abc123",
    "status": "COMPLETED",
    "result": {
      "url": "https://cdn.picsart.com/…/result",
      "items": [
        {
          "url": "https://cdn.picsart.com/…/result"
        }
      ],
      "model": "topaz-upscale-image-generative"
    }
  }
}
```

What `ai.generate()` / `ai.generateText()` resolve to (the envelope already unwrapped):

```json
{
  "items": [
    {
      "url": "https://cdn.picsart.com/…/result"
    }
  ],
  "model": "topaz-upscale-image-generative"
}
```

### Usage examples

#### TypeScript (SDK)

```typescript
import { createClient } from '@picsart/ai-sdk';

const ai = createClient({
  apiKey: process.env.PICSART_API_KEY,
  apiUrl: 'https://api.picsart.com',
});

const result = await ai.generate('topaz-upscale-image-generative', {
  imageUrls: [
    "https://cdn.example.com/input.jpg"
  ]
});

console.log(result.url); // image URL
```

#### Python (SDK)

```python
import asyncio
import os

from picsart_ai_sdk import create_client


async def main() -> None:
    async with create_client(
        api_key=os.environ["PICSART_API_KEY"],
        api_url="https://api.picsart.com",
    ) as ai:
        result = await ai.generate("topaz-upscale-image-generative", {
            "imageUrls": [
                "https://cdn.example.com/input.jpg",
            ],
        })

        print(result.url)  # image URL


asyncio.run(main())
```

#### cURL (sync)

```bash
curl -X POST 'https://api.picsart.com/workflows/v1/models/execute' \
  -H 'Authorization: Bearer $PICSART_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "params": {
    "model": "topaz-upscale-image-generative",
    "params": {
      "imageUrls": [
        "https://cdn.example.com/input.jpg"
      ]
    }
  }
}'
```

#### CLI

```bash
gen-ai login  # once per machine
gen-ai models info topaz-upscale-image-generative  # this model's parameters
gen-ai pricing topaz-upscale-image-generative  # quote before spending credits
gen-ai generate -m topaz-upscale-image-generative \
  -i ./input.jpg
```

## Compatibility API (vendor parameters)

The vendor's own parameter list is read live from the service that runs this model and was not available when this document was generated. Nothing is listed rather than a guess — the names have to match what the endpoint accepts.

The unified API above documents this same model completely and is not affected. For the vendor parameters, see the Advanced Usage tab of the model page: https://picsart.com/api-platform/models/topaz-upscale-image-generative#advanced

## Additional resources

- Model page (playground): https://picsart.com/api-platform/models/topaz-upscale-image-generative
- SDK and REST API (unified): https://picsart.com/api-platform/models/topaz-upscale-image-generative#api
- Compatibility API (vendor parameters): https://picsart.com/api-platform/models/topaz-upscale-image-generative#advanced
- MCP (use it from Claude, ChatGPT, Cursor and other assistants): https://picsart.com/api-platform/models/topaz-upscale-image-generative#mcp
- CLI (run it from a terminal): https://picsart.com/api-platform/models/topaz-upscale-image-generative#cli
- Pricing: https://picsart.com/api-platform/models/topaz-upscale-image-generative#pricing
- This document: https://picsart.com/api-platform/models/topaz-upscale-image-generative/llms.txt
- All models: https://picsart.com/api-platform/models
- Docs — quickstart https://picsart.com/api-platform/docs/quickstart, authentication https://picsart.com/api-platform/docs/authentication, SDK https://picsart.com/api-platform/docs/sdk, REST https://picsart.com/api-platform/docs/api-reference, CLI https://picsart.com/api-platform/docs/cli, MCP https://picsart.com/api-platform/docs/mcp
- CLI reference: https://picsart.github.io/picsart-mcp-cli-docs/guide/introduction
