Skip to content

About

Upscale low-resolution images with AI via the Printcart API — TypeScript/Node.js SDK example.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Printcart Image Upscale API — Increase Image Resolution (TypeScript/Node.js)

A working code example for upscaling low-resolution images via the Printcart API. Enlarge a product photo 2× or 4× so it prints sharp instead of blurry — no Photoshop plugin, no desktop app. Runs on Node.js/TypeScript via @printcart/sdk-core, and needs a Printcart API key to call the real API.

npm License: MIT

Quickstart

git clone https://github.com/Printcart/printcart-image-upscale-sdk.git
cd printcart-image-upscale-sdk
npm install
cp .env.example .env   # add your PRINTCART_API_KEY
npm start
import { createPrintcartClient } from '@printcart/sdk-core'

const printcart = createPrintcartClient({ apiKey: process.env.PRINTCART_API_KEY! })

const job = await printcart.upscale.run({
  fileUrl: 'https://example.com/low-res-photo.jpg',
  designId: 'my-design-001',
  scale: 2, // or 4
})

console.log(job.data.correctedFileUrl) // upscaled PNG, valid 24h

How it works

Image upscaling isn't a standalone endpoint on Printcart's API — it's a Preflight AI fix job (fixTypes: ['upscale_resolution_2x' | '_4x']) created from a preflight report of the same image. upscale.run() is a convenience wrapper that does both steps (create the report, create the AI job, poll it to completion) so callers who only want "upscale this image" don't need to know that two-step shape.

This uses Lanczos upscaling, not AI super-resolution — it enlarges cleanly but does not invent new detail. That's a deliberate, documented behavior of the underlying service, not a limitation of this example.

Pricing

200 tokens per job (flat — not per fix), deducted when the job is created. Automatically refunded if the job fails.

FAQ

Does this generate new detail (AI super-resolution), or just enlarge cleanly? It enlarges cleanly using Lanczos resampling — it does not hallucinate new detail the way some AI super-resolution models do. This is intentional: predictable, artifact-free output for print, not a "creative" upscale.

What's the maximum scale factor? 2× or 4×, selected via the scale option.

Can I combine upscaling with other fixes, like bleed or color-mode conversion, in one job? Yes, at the preflight.createAiJob level (which upscale.run() wraps) you can pass multiple fixTypes in one job — this example only demonstrates the upscale-only case for clarity.

Why does it need a preflight report first instead of a direct "upscale this URL" call? That's the real shape of Printcart's underlying API — an AI fix job always originates from a report. upscale.run() exists specifically to hide that from callers who don't need the report for anything else.

Where's the full API reference? This repo is a runnable example, not the full docs. For every field and endpoint, see the @printcart/sdk-core package.

Related

License

The example code in this repo is MIT. The Printcart API itself and @printcart/sdk-core require a Printcart account and API key to use — see printcart-sdk's LICENSE (Business Source License 1.1).

About

Upscale low-resolution images with AI via the Printcart API — TypeScript/Node.js SDK example.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages