Skip to content
Pruna AI logo

P-Image-Upscale

Image-to-Image • Pruna AI

View as MarkdownAgent setup
  • Third-party

Pruna's P-Image-Upscale increases image resolution using AI, targeting 1-128 megapixels with optional detail and realism enhancement for sharper, cleaner results.

Model Info
More informationlink ↗
Pricing
  • Per image (1-4 MP)$0.005
  • Per image (5-8 MP)$0.01
  • Per image (9-16 MP)$0.02
  • Per image (17-32 MP)$0.04
  • Per image (33-64 MP)$0.06
  • Per image (65-128 MP)$0.12

Usage

const response = await env.AI.run(
  'pruna/p-image-upscale',
  {
    image: 'https://huggingface.co/spaces/yisol/IDM-VTON/resolve/main/example/human/00121_00.jpg',
    target: 4,
    enhance_details: true,
    output_format: 'jpg',
  },
)
console.log(response)
curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
  --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
  "model": "pruna/p-image-upscale",
  "input": {
    "image": "https://huggingface.co/spaces/yisol/IDM-VTON/resolve/main/example/human/00121_00.jpg",
    "target": 4,
    "enhance_details": true,
    "output_format": "jpg"
  }
}'
4MP Upscale
{
  "state": "Completed",
  "result": {
    "image": "https://examples.aig.cloudflare.com/pruna/p-image-upscale/4mp-upscale.jpg"
  },
  "gatewayMetadata": {
    "keySource": "Unified"
  }
}

Parameters

image
stringrequiredInput image to upscale. A publicly reachable HTTP(S) URL or a base64 data URI (data:image/...;base64,...).
target
integerrequireddefault: 4minimum: 1maximum: 128Target resolution in megapixels (1-128). Output is capped at 128 MP.
output_format
stringrequireddefault: jpgenum: webp, jpg, pngFormat of the output image.
output_quality
integerrequireddefault: 80minimum: 0maximum: 100Quality when saving the output image (0-100). Not relevant for .png outputs.
enhance_details
booleanrequireddefault: falseEnhance fine textures and small details.
enhance_realism
booleanrequireddefault: falseImprove realism. Recommended for AI-generated images.
disable_safety_checker
booleanrequireddefault: falseDisable safety checker for generated images.
image
stringformat: uriPresigned URL for the upscaled image.

API Schemas (Raw)

Input
Output

Was this helpful?