da Topaz Labs

Ampliações fiéis, generativas ou transparentes até 2K, 4K ou 8K

topaz/gigapixel/upscale
Topaz Gigapixel: aumentar imagens com IA online
  • Até 8K
  • Melhorar imagem

Chame com o nome de modelo topaz/gigapixel/upscale em POST /jobs/createTask, a partir de US$ 0,12.

Nome do modelotopaz/gigapixel/upscale
EndpointPOST https://api.popnow.ai/api/v1/jobs/createTask
# 1. Create the task. Keep the Idempotency-Key if you retry after a network error.
export IDEMPOTENCY_KEY="$(uuidgen)"
curl -X POST https://api.popnow.ai/api/v1/jobs/createTask \
  -H "Authorization: Bearer $POPNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
  -d '{
  "model": "topaz/gigapixel/upscale",
  "input": {
    "image_url": "https://media.popnow.ai/influencer/examples/marco.webp",
    "preset": "standard_v2",
    "resolution": "4k",
    "output_format": "jpeg"
  }
}'

# 2. Copy data.taskId from the response, then poll until state is succeeded, failed, canceled or expired.
TASK_ID="TASK_ID_FROM_RESPONSE"
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=$TASK_ID" \
  -H "Authorization: Bearer $POPNOW_API_KEY"

O input é montado a partir do schema abaixo, então passa na validação como está. Troque o prompt e os links pelos seus.

Preço

OpçãoUSD por imagem
preset cgiresolution 2KUS$ 0,12
preset cgiresolution 4KUS$ 0,12
preset detailresolution 2KUS$ 0,12
preset detailresolution 4KUS$ 0,12
preset high fidelity v3resolution 2KUS$ 0,12
preset high fidelity v3resolution 4KUS$ 0,12
preset low resolution v2resolution 2KUS$ 0,12
preset low resolution v2resolution 4KUS$ 0,12
preset standard v2resolution 2KUS$ 0,12
preset standard v2resolution 4KUS$ 0,12
preset text refineresolution 2KUS$ 0,12
preset text refineresolution 4KUS$ 0,12

Cobrança em USD · Todas as opções e preços: GET /models/topaz/gigapixel/upscale

Limites

Resoluções
2K · 4K · 8K
Maior upload
30 MB

Parâmetros

Estes campos vêm do mesmo schema que usamos para validar cada requisição. Campos que não estão na lista são rejeitados.

  • image_urlstringObrigatório

    A imagem de partida.

    Faixa
    Número de caracteres: ≥ 1 · image/jpeg, image/png, image/webp, image/gif · ≤ 30 MB
  • presetstringOpcionalMuda o preço

    Escolha uma das predefinições disponíveis para este modelo.

    Padrão
    "standard_v2"
    Valores aceitos
    "standard_v2""high_fidelity_v3""low_resolution_v2""cgi""text_refine""wonder_4""wonder_3_5""recover_3""standard_max""redefine""detail""transparent"
  • resolutionstringOpcionalMuda o preço

    Escolha um tamanho de saída disponível.

    Padrão
    "4k"
    Valores aceitos
    "2k""4k""8k"
  • output_formatstringOpcional

    Tipo de arquivo do resultado.

    Padrão
    "jpeg"
    Valores aceitos
    "jpeg""png"
JSON Schema original
{
  "additionalProperties": false,
  "properties": {
    "image_url": {
      "contentMediaType": [
        "image/jpeg",
        "image/png",
        "image/webp",
        "image/gif"
      ],
      "description": "The image to enlarge: JPEG, PNG or WebP. Framing and aspect ratio are kept; only the pixel count goes up. Use a PNG with an alpha channel for the transparent preset.",
      "minLength": 1,
      "type": "string"
    },
    "output_format": {
      "default": "jpeg",
      "description": "File type of the returned image. png avoids another round of lossy compression but is several times larger. The format does not change the price.",
      "enum": [
        "jpeg",
        "png"
      ],
      "type": "string"
    },
    "preset": {
      "default": "standard_v2",
      "description": "Which Topaz Gigapixel model to run. Precise presets enlarge without inventing content: standard_v2 (general photos), high_fidelity_v3 (already sharp, high-resolution sources), low_resolution_v2 (small or heavily compressed images), cgi (illustrations and renders), text_refine (text, logos and graphics). Generative presets rebuild detail and cost more: wonder_4 (all-purpose enhancement), wonder_3_5, recover_3 (badly degraded photos), standard_max, redefine (adds new detail) and detail (realistic skin and faces in AI images). transparent enlarges a PNG while keeping its alpha channel and always returns PNG.",
      "enum": [
        "standard_v2",
        "high_fidelity_v3",
        "low_resolution_v2",
        "cgi",
        "text_refine",
        "wonder_4",
        "wonder_3_5",
        "recover_3",
        "standard_max",
        "redefine",
        "detail",
        "transparent"
      ],
      "type": "string"
    },
    "resolution": {
      "default": "4k",
      "description": "Output size: a pixel budget of about 4 MP (2k), 16.8 MP (4k) or 67 MP (8k) with the source aspect ratio kept. The price depends on this tier and the preset.",
      "enum": [
        "2k",
        "4k",
        "8k"
      ],
      "type": "string"
    }
  },
  "required": [
    "image_url"
  ],
  "type": "object"
}

Um resultado real do Topaz Gigapixel

Detalhe comparativo: tipografia de cartaz 432 px à esquerda, nítida em 4K com predefinição de texto à direita
A mesma requisição pela API
{
  "model": "topaz/gigapixel/upscale",
  "input": {
    "image_url": "https://media.popnow.ai/influencer/examples/marco.webp",
    "preset": "text_refine",
    "resolution": "4k",
    "output_format": "jpeg"
  }
}

Este resultado partiu de um arquivo enviado: coloque o seu link no lugar do link de exemplo.

Respostas, consultas e callbacks

Todos os modelos funcionam do mesmo jeito: crie uma tarefa e depois consulte ou espere o callback.

Veja o preço antes

cURL
curl -X POST https://api.popnow.ai/api/v1/jobs/quote \
  -H "Authorization: Bearer $POPNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "topaz/gigapixel/upscale",
  "input": {
    "image_url": "https://media.popnow.ai/influencer/examples/marco.webp",
    "preset": "standard_v2",
    "resolution": "4k",
    "output_format": "jpeg"
  }
}'

Antes de executar, envie o mesmo corpo de requisição para POST /jobs/quote para ver o custo estimado e o máximo em USD. A cotação não executa tarefas nem debita seu saldo.

Aceita

HTTP
HTTP/1.1 202 Accepted

{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "task_01k3m8x9q2z4v7n5p6r8s0t1w3",
    "state": "queued"
  },
  "request_id": "req_example_create"
}

HTTP 202 significa que a tarefa foi aceita: o máximo em USD fica reservado até o acerto final. Ao aceitar uma tarefa, reservamos o valor máximo da cotação no seu saldo da PopNow. Ao concluir, cobramos o uso real sem ultrapassar a reserva e liberamos o restante. Se a tarefa falhar, o valor reservado é liberado.

Consultar status

cURL
curl "https://api.popnow.ai/api/v1/jobs/recordInfo?taskId=$TASK_ID" \
  -H "Authorization: Bearer $POPNOW_API_KEY"

Consulte a cada poucos segundos, espaçando cada vez mais, e pare quando state for succeeded, failed, canceled ou expired.

Tarefa pronta

JSON
{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "task_01k3m8x9q2z4v7n5p6r8s0t1w3",
    "model": "topaz/gigapixel/upscale",
    "state": "succeeded",
    "output": {
      "assets": [
        {
          "url": "https://cdn.popnow.ai/tasks/task_01k3m8x9q2z4v7n5p6r8s0t1w3/output.png?signature=FROM_RESPONSE",
          "expiresAt": "2026-10-17T12:20:00Z",
          "mime": "image/png",
          "width": 1024,
          "height": 1024
        }
      ]
    },
    "settled": true
  },
  "request_id": "req_example_record"
}

Baixe pela url antes de expiresAt. Precisa de um link novo depois? Peça com POST /common/download-url.

Verificar um callback

Node.js
import { createHash, createHmac, timingSafeEqual } from "node:crypto";
import express from "express";

const app = express();
// express.raw keeps the exact bytes that were signed; express.json would not match.
app.post("/hooks/popnow", express.raw({ type: "application/json" }), (req, res) => {
  const timestamp = req.header("X-Webhook-Timestamp");
  const signature = req.header("X-Webhook-Signature") ?? "";
  const body = JSON.parse(req.body.toString("utf8"));
  const taskId = body.data?.taskId ?? body.task_id;
  const digest = createHash("sha256").update(req.body).digest("hex");
  const expected = createHmac("sha256", process.env.POPNOW_WEBHOOK_SECRET)
    .update(`${taskId}.${timestamp}.${digest}`)
    .digest("base64");
  const ok = expected.length === signature.length && timingSafeEqual(Buffer.from(expected), Buffer.from(signature));
  // Check the signature first, then reject anything older than five minutes.
  if (!ok || Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return res.status(401).end();
  res.status(200).end(); // answer fast, then fetch the task and store its files
});

Com callBackUrl definida, enviamos a tarefa pronta para você. Confira a assinatura no corpo bruto antes de confiar nela.

Enviar um arquivo local

cURL
curl -X POST https://api.popnow.ai/api/v1/common/upload-url \
  -H "Authorization: Bearer $POPNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"contentType": "image/png", "bytes": 482113}'

# PUT the file bytes to data.uploadUrl with every header in data.headers, then commit it:
curl -X POST https://api.popnow.ai/api/v1/files/$FILE_ID/commit \
  -H "Authorization: Bearer $POPNOW_API_KEY"
# The commit returns a popnow://f/... reference. Put it in any image, video or
# audio field of the task input instead of a public https URL.

Links https públicos funcionam como estão. Arquivos locais passam antes por upload-url e commit.