Enhance image resolution and quality using advanced AI upscaling models. Perfect for improving low-resolution images, old photos, or generated content that needs higher quality.
Request Body
Public URL of the image to upscale (HTTPS required)
Base64-encoded image data (alternative to imageUrl)
Upscaling factor: 2
(2x), 4
(4x), or 8
(8x) the original resolution
model
string
default: "real-esrgan"
Upscaling model to use:
real-esrgan
- Best for general images and photos
real-esrgan-anime
- Optimized for anime/cartoon images
esrgan-plus
- Enhanced model for photorealistic images
waifu2x
- Specialized for anime artwork and illustrations
srcnn
- Fast upscaling with good detail preservation
Enhancement mode:
standard
- Balanced quality and speed
high_quality
- Maximum quality, slower processing
fast
- Quick processing, good for previews
face_enhance
- Specialized for faces and portraits
Noise reduction strength (0.0 to 1.0). Higher values remove more noise but may reduce detail.
Whether to preserve fine details and textures during upscaling
Output image format: png
, jpg
, webp
JPEG quality (1-100, only used when outputFormat is ‘jpg’)
Response
Unique identifier for the upscaling job
Processing status: queued
, processing
, completed
, failed
Information about the original image Original file size (e.g., “2.1MB”)
Information about the upscaled image (available when completed) URL to download the upscaled image
Pre-signed download URL (expires in 24 hours)
Processing information Time taken to process in seconds
Estimated completion time (when processing)
Example
curl -X POST "https://api.tensorone.ai/v2/ai/image-upscale" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"imageUrl": "https://example.com/low-res-photo.jpg",
"upscaleFactor": 4,
"model": "real-esrgan",
"enhanceMode": "high_quality",
"denoiseStrength": 0.6,
"outputFormat": "png"
}'
{
"upscaleId" : "ups_abc123_def456" ,
"status" : "processing" ,
"originalImage" : {
"width" : 512 ,
"height" : 384 ,
"format" : "jpg" ,
"fileSize" : "245KB"
},
"processingDetails" : {
"model" : "real-esrgan" ,
"upscaleFactor" : 4 ,
"estimatedTime" : "45-60 seconds"
},
"createdAt" : "2024-01-16T15:30:00Z"
}
{
"upscaleId" : "ups_abc123_def456" ,
"status" : "completed" ,
"originalImage" : {
"width" : 512 ,
"height" : 384 ,
"format" : "jpg" ,
"fileSize" : "245KB"
},
"upscaledImage" : {
"url" : "https://upscaled.tensorone.ai/ups_abc123_def456.png" ,
"width" : 2048 ,
"height" : 1536 ,
"format" : "png" ,
"fileSize" : "8.2MB" ,
"downloadUrl" : "https://upscaled.tensorone.ai/download/ups_abc123_def456?expires=..."
},
"processingDetails" : {
"model" : "real-esrgan" ,
"upscaleFactor" : 4 ,
"processingTime" : 52.3
},
"createdAt" : "2024-01-16T15:30:00Z" ,
"completedAt" : "2024-01-16T15:30:52Z"
}
Specialized Use Cases
Photo Restoration
Restore old or damaged photos:
restoration_response = requests.post(
"https://api.tensorone.ai/v2/ai/image-upscale" ,
json = {
"imageUrl" : "https://example.com/old-photo.jpg" ,
"upscaleFactor" : 2 ,
"model" : "real-esrgan" ,
"enhanceMode" : "face_enhance" , # Good for portraits
"denoiseStrength" : 0.8 , # Remove artifacts from old photos
"preserveDetails" : True
}
)
Anime/Artwork Enhancement
Optimize for anime and illustrations:
anime_response = requests.post(
"https://api.tensorone.ai/v2/ai/image-upscale" ,
json = {
"imageUrl" : "https://example.com/anime-art.png" ,
"upscaleFactor" : 4 ,
"model" : "real-esrgan-anime" , # Specialized for anime
"enhanceMode" : "high_quality" ,
"denoiseStrength" : 0.3 , # Lower noise reduction for clean art
"outputFormat" : "png" # Preserve transparency
}
)
Batch Processing
Upscale multiple images:
image_urls = [
"https://example.com/image1.jpg" ,
"https://example.com/image2.jpg" ,
"https://example.com/image3.jpg"
]
upscale_jobs = []
for url in image_urls:
response = requests.post(
"https://api.tensorone.ai/v2/ai/image-upscale" ,
headers = { "Authorization" : "Bearer YOUR_API_KEY" },
json = {
"imageUrl" : url,
"upscaleFactor" : 2 ,
"model" : "real-esrgan" ,
"enhanceMode" : "fast" # Faster for batch processing
}
)
upscale_jobs.append(response.json()[ 'upscaleId' ])
print ( f "Started { len (upscale_jobs) } upscaling jobs" )
# Monitor all jobs
def check_all_jobs ( job_ids ):
completed = []
for job_id in job_ids:
status_response = requests.get(
f "https://api.tensorone.ai/v2/ai/upscale/ { job_id } /status" ,
headers = { "Authorization" : "Bearer YOUR_API_KEY" }
)
status = status_response.json()
if status[ 'status' ] == 'completed' :
completed.append(status)
return completed
# Wait for all to complete
import time
while len (check_all_jobs(upscale_jobs)) < len (upscale_jobs):
print ( f "Completed: { len (check_all_jobs(upscale_jobs)) } / { len (upscale_jobs) } " )
time.sleep( 15 )
print ( "All upscaling jobs completed!" )
Quality Comparison
Compare results from different models:
def compare_models ( image_url ):
models = [ 'real-esrgan' , 'real-esrgan-anime' , 'esrgan-plus' , 'waifu2x' ]
results = {}
for model in models:
response = requests.post(
"https://api.tensorone.ai/v2/ai/image-upscale" ,
headers = { "Authorization" : "Bearer YOUR_API_KEY" },
json = {
"imageUrl" : image_url,
"upscaleFactor" : 2 ,
"model" : model,
"enhanceMode" : "standard"
}
)
results[model] = response.json()[ 'upscaleId' ]
return results
# Compare different models on same image
comparison = compare_models( "https://example.com/test-image.jpg" )
print ( "Model comparison started:" , comparison)
Advanced Options
Custom Enhancement Pipeline
Chain multiple enhancements:
# Step 1: Upscale
upscale_response = requests.post(
"https://api.tensorone.ai/v2/ai/image-upscale" ,
json = {
"imageUrl" : "https://example.com/image.jpg" ,
"upscaleFactor" : 2 ,
"model" : "real-esrgan"
}
)
upscale_id = upscale_response.json()[ 'upscaleId' ]
# Wait for completion, then enhance further
# ... wait for completion ...
# Step 2: Apply additional enhancement
enhance_response = requests.post(
"https://api.tensorone.ai/v2/ai/image-enhance" ,
json = {
"imageUrl" : completed_upscale[ 'upscaledImage' ][ 'url' ],
"enhanceType" : "detail_boost" ,
"strength" : 0.7
}
)
Face-Specific Enhancement
Enhanced processing for portraits:
face_enhance_response = requests.post(
"https://api.tensorone.ai/v2/ai/image-upscale" ,
json = {
"imageUrl" : "https://example.com/portrait.jpg" ,
"upscaleFactor" : 4 ,
"model" : "real-esrgan" ,
"enhanceMode" : "face_enhance" ,
"faceEnhancement" : {
"enabled" : True ,
"skinSmoothing" : 0.3 ,
"eyeSharpening" : 0.8 ,
"detailPreservation" : 0.9
}
}
)
JPEG/JPG : Universal support, good for photos
PNG : Transparency preserved, good for graphics
WebP : Modern format with good compression
BMP : Basic bitmap format
TIFF : High-quality format support
PNG : Best quality, supports transparency
JPEG : Smaller file size, good for photos
WebP : Modern format with excellent compression
Limitations and Guidelines
File Size Limits
Maximum input size : 50MB per image
Maximum resolution : 16K x 16K pixels for input
Processing time : Varies by size and upscale factor
Best Practices
Choose the right model : Real-ESRGAN for photos, Waifu2x for anime
Start with 2x upscaling : Test before going to 4x or 8x
Consider file size : Higher upscale factors create much larger files
Format selection : Use PNG for quality, JPEG for smaller files
Noise reduction : Adjust based on input image quality
Pricing
2x Upscaling : $0.05 per megapixel of output
4x Upscaling : $0.10 per megapixel of output
8x Upscaling : $0.20 per megapixel of output
Face Enhancement : Additional $0.02 per face detected
Batch Processing : 10% discount for 10+ images
Processing time depends on image size and upscale factor. Typical times: 2x (10-30s), 4x (30-90s), 8x (60-180s).
Very large upscale factors (8x) can create files over 100MB. Consider your storage and bandwidth requirements when choosing upscale factors.