live
MODEL IDtopazlabs:wonder@4

Topaz Labs Wonder 4

Topaz Labs
by
Available with Zero Data Retention

Wonder 4 is Topaz Labs' all-purpose generative model for image enhancement and upscaling. It treats each region of an image separately, combining denoising, deblurring, compression artifact removal, face recovery, and upscaling in one pass with no settings to tune. It suits photo restoration, cleanup of degraded or compressed images, and enhancement at the original size or enlarged up to six times, with output up to 256 megapixels.

Topaz Labs Wonder 4

Transparent images

How to upscale transparent PNGs with Topaz Wonder 4 so product cutouts, see-through glass and loose hair keep their transparency, and why a JPG output loses it.

Introduction

Product cutouts and portraits made for compositing ship as PNG files with an alpha channel, and the transparency is part of the asset. A cutout that comes back from an upscale on a solid background has to be cut out all over again. Wonder 4 keeps the alpha channel through the upscale: send a transparent PNG, ask for a PNG back, and the cutout returns at the new size with nothing behind it.

A small, soft cutout of a ceramic table lamp with a sage-green ribbed base and a linen drum shade, with no background behind it
The same lamp cutout at four times the size, with sharp ribs on the glazed base and a visible weave on the linen shade
SourceWonder 4
A 384 px lamp cutout upscaled four times. The checkerboard is drawn by this page, behind the file.

The lamp was cut out of a studio photo, shrunk to 384 px and upscaled four times. The output follows the same outline as the source, with the curve of the shade and the ribs of the base sharp at 1536 px, and the area around the lamp is as empty after the upscale as it was before.

The request

A transparent upscale is an ordinary upscale with a PNG in and a PNG out:

Try in Playground
import { createClient } from '@runware/sdk'

const client = await createClient({ apiKey: process.env.RUNWARE_API_KEY })
await client.connect()

const [result] = await client.run({
  model: 'topazlabs:wonder@4',
  upscaleFactor: 4,
  outputFormat: 'PNG',
  inputs: {
    image: 'https://im.runware.ai/image/os/a14d18/ws/2/ii/5a8c1e3f-7b2d-4f6a-9e4c-8b1d3f5a7c26.png'
  }
})
import asyncio
import os

from runware import Runware


async def main():
    async with Runware(api_key=os.environ["RUNWARE_API_KEY"]) as client:
        results = await client.run({
            "model": "topazlabs:wonder@4",
            "upscaleFactor": 4,
            "outputFormat": "PNG",
            "inputs": {
                "image": "https://im.runware.ai/image/os/a14d18/ws/2/ii/5a8c1e3f-7b2d-4f6a-9e4c-8b1d3f5a7c26.png"
            }
        })


asyncio.run(main())
curl https://api.runware.ai/v1 \
  -H "Authorization: Bearer $RUNWARE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[
    {
      "taskType": "upscale",
      "taskUUID": "9e4b2c7a-3f1d-4a8e-b6c5-1d7f3a9e2b48",
      "model": "topazlabs:wonder@4",
      "upscaleFactor": 4,
      "outputFormat": "PNG",
      "inputs": {
        "image": "https://im.runware.ai/image/os/a14d18/ws/2/ii/5a8c1e3f-7b2d-4f6a-9e4c-8b1d3f5a7c26.png"
      }
    }
  ]'
runware run topazlabs:wonder@4 \
  upscaleFactor=4 \
  outputFormat=PNG \
  inputs.image=https://im.runware.ai/image/os/a14d18/ws/2/ii/5a8c1e3f-7b2d-4f6a-9e4c-8b1d3f5a7c26.png
{
  "taskType": "upscale",
  "taskUUID": "9e4b2c7a-3f1d-4a8e-b6c5-1d7f3a9e2b48",
  "model": "topazlabs:wonder@4",
  "upscaleFactor": 4,
  "outputFormat": "PNG",
  "inputs": {
    "image": "https://im.runware.ai/image/os/a14d18/ws/2/ii/5a8c1e3f-7b2d-4f6a-9e4c-8b1d3f5a7c26.png"
  }
}
Response
[
  {
    "taskType": "upscale",
    "taskUUID": "9e4b2c7a-3f1d-4a8e-b6c5-1d7f3a9e2b48",
    "imageUUID": "c3f7a1d9-2e6b-4c8f-a5d1-7e9b3c2f6a14",
    "imageURL": "https://im.runware.ai/image/os/a14d18/ws/2/ii/c3f7a1d9-2e6b-4c8f-a5d1-7e9b3c2f6a14.png"
  }
]
  • inputs.image takes the PNG the same way it takes any other source. Its alpha channel travels with the pixels.
  • "outputFormat": "PNG" keeps the transparency in the result, and WEBP does too. Leave it out and the result is a JPG on a solid background, as PNG or JPG shows.
  • upscaleFactor and the size limits work exactly as they do for an opaque image, covered in upscaling images.

See-through glass

A good cutout of a glass bottle stores the glass as partially transparent pixels, so whatever sits behind the bottle shows through it. Wonder 4 carries that partial opacity over to the larger image:

A small, soft cutout of a clear glass dropper bottle half filled with amber serum, with no background behind it
The same bottle at four times the size, with the checkerboard visible through the glass and the serum, and a crisp outline
SourceWonder 4
A 384 px cutout of a glass dropper bottle upscaled four times.

On both sides the checkerboard shows through the glass and the amber serum inside it, and only the black dropper cap is fully solid. The upscale keeps that layering and sharpens the outline of the bottle and the pipette inside it.

How see-through the glass is comes from the cutout, not the upscale. Wonder carries over the opacity the source already has, so a cutout that treated the glass as solid comes back solid at the larger size.

Hair and fine edges

Loose hair is the hardest edge in a cutout. Each flyaway strand is a few pixels wide and only partly opaque, and at 384 px most of them blur together into a soft halo. The upscale rebuilds the hair at four times the size along the alpha the cutout gave it:

A small, soft cutout of a woman with long wavy auburn hair in an ivory blouse, from the hips up, with no background behind her
The same cutout at four times the size, with defined strands of hair, natural skin texture and a sheen on the silk blouse
SourceWonder 4
A 384 px fashion cutout upscaled four times.

A 100% crop of the edge of her hair:

In the source the edge is a soft blur of auburn and checkerboard. In the output the outer strands, the loose curl included, come back as separate thin lines against the transparent background.

PNG or JPG

JPG has no alpha channel. The same serum cutout requested as a JPG comes back flattened onto white: every pixel the PNG leaves empty is filled in, including the space seen through the glass.

On a white product page the two look the same, but the JPG can no longer go on any other background. Keep PNG for anything that will be composited later, and save JPG for an asset that will only ever sit on white.

Tips

  1. Cut out first, then upscale. Wonder keeps the transparency a source has but does not create any, so a photo with a background comes back with that background.

  2. Check the edge on a dark background. A pale fringe left by the cutout disappears on white and shows on black, so look at the result on the darkest background it will meet before you ship it.