Image Upscaler
Overview
Freepik API uses Magnific.ai technology, now available as a comprehensive API service.
Image Upscaler enhances images to higher resolutions. This powerful tool does more than just increase image size - it also improves quality and adds detail. By leveraging advanced upscaling technology, our API allows you to transform your images with custom prompts and fine-tuned parameters, achieving impressive results.
Okay that's cool but take me to the code
API Reference: Image Upscaler
Use Cases
The Image Upscaler can be applied to a wide range of image types and industries, including:
- Portraits: Enhance facial details and skin textures
- Illustrations: Sharpen lines and improve color vibrancy
- Video game assets: Upscale textures and character models
- Landscapes: Bring out intricate details in nature scenes
- Science fiction imagery: Enhance futuristic and space-themed visuals
- Fantasy art: Improve magical and mythical elements
- Film stills: Increase resolution for better visual quality
- Graphic design: Upscale logos and marketing materials
- Architectural renderings: Enhance building details and textures, jumping from quick sketches to high quality renders
- Interior design: Improve quality of room layouts and furniture details
- Food photography: Bring out textures and colors in culinary images
Upscale an Image
Create an upscaling task for an image.
POST /v1/ai/image-upscaler
Upscale an image using AI
Key Parameters
Base64 encoded image to upscale
Webhook URL to receive the upscaled image once it’s ready
Configure scale factor of the image (2x, 4x, 8x, 16x)
This parameter allows you to tailor the upscaling process for specific image types or styles. Options include:
- standard: General-purpose upscaling
- soft_portraits: Optimized for portrait photos with softer details
- hard_portraits: For portraits requiring sharper details
- art_n_illustration: Ideal for artwork and illustrations
- videogame_assets: Tailored for game graphics and textures
- nature_n_landscapes: Optimized for outdoor and landscape photos
- films_n_photography: Suited for cinematic and professional photography
- 3d_renders: Specialized for 3D rendered images
- science_fiction_n_horror: Tailored for sci-fi and horror genre visuals
Guide the upscaling process. For AI-generated images, reusing the original prompt can significantly improve results. You can also use prompts to alter images during upscaling (e.g., transforming a city into ruins, typically after at least 4x upscale).
Tip: Use weights to emphasize parts of your prompt. Add a number in parentheses (1 to 1.4) after a phrase, like “(beautiful green eyes:1.3)“. This is useful for countering unwanted effects. For example, to prevent aging in faces, try: “(young woman:1.3), (cute young face:1.2), (cute:1.2)“.
Increase or decrease AI’s creativity (-10 to 10). Higher values allow the AI to “hallucinate” additional details, potentially achieving greater realism but moving further from the original image. Be cautious with very high values as they can lead to strange results.
Increase or decrease the level of definition and detail (-10 to 10). Higher values enhance definition, but very high values may result in an artificial appearance or blotches.
Adjust the level of resemblance to the original image (-10 to 10). Higher values make the generation more similar to the original, but very high values can cause blotches or a dirtier look. Lower values give more freedom to the generation.
Control the strength of the prompt and intricacy per square pixel (-10 to 10). Lower values reduce detail but typically result in fewer glitches. Higher values amplify your prompt in smaller areas, useful for intricate images like fantasy maps. Can create interesting artistic effects at high values.
Magnific model engines:
- automatic: Default choice
- magnific_illusio: Better for illustrations, landscapes, and nature. Smoother results and removes JPEG artifacts. Good for the first pass of multiple upscales.
- magnific_sharpy: Ideal for realistic images like photographs. Provides the sharpest and most detailed results, but doesn’t remove JPEG artifacts and may create “fake” ones.
- magnific_sparkle: A middle ground between Illusio and Sharpy. Good for realistic images and removes JPEG artifacts.
Tip: For multiple upscales, experiment with different engines. For example, start with Illusio and finish with Sharpy to find the best result for your image style.
API Call Example
curl --request POST \
--url https://api.freepik.com/v1/ai/image-upscaler \
--header 'Content-Type: application/json' \
--header 'x-freepik-api-key: <YOUR_API_KEY>' \
--data '{
"image": "iVBORw0KGgoAAAANSUhEUgAAASwAAAEsAQAAAABRBrPYAAABrElEQVR4nO3BMQEAAADCoPVPbQ0Po...",
"scale_factor": "4x",
"optimized_for": "nature_n_landscapes",
"prompt": "Enhance details and colors",
"creativity": 2,
"hdr": 1
}'
Authentication
Include the x-freepik-api-key
header in your requests for authentication. Keep this key secure and don’t share it with others.
Webhook
If you provide a webhook_url
, you’ll receive a POST request to that URL when the upscaling task is complete. The webhook payload will include the task status and the URL of the upscaled image.
Get Upscaling Task Status
You can check the status of an upscaling task using the task ID returned from the initial request.
GET /v1/ai/image-upscaler/{task-id}
Get the status of an upscaling task
List All Upscaling Tasks
Retrieve a list of all your upscaling tasks.
GET /v1/ai/image-upscaler
Get the status of all upscaling tasks
Pricing and Usage
Premium Feature: The Image Upscaler is currently available exclusively for premium API users.
To access the Image Upscaler feature:
- Generate an API key if you haven’t already.
- Upgrade your account to a premium plan at the Billing Dashboard.
Once upgraded, you’ll have access to the Image Upscaler along with other premium features.
Pricing is based on a pay-as-you-go model, with no prepayment or commitment required. You’ll only be charged for the upscales you actually perform.
The cost per image upscale depends on the output image area in pixels, which is determined by:
- The dimensions of the input image
- The upscale factor applied (e.g., 2x, 4x, 8x, 16x)
Larger output images result in higher costs per upscale. Pricing tiers are applied based on the final output size, ensuring transparency and control over your usage.
Example pricing:
Input Resolution | Upscale Factor | Output Resolution | Price per Image |
---|---|---|---|
800x600 px | 2x | 1600x1200 px | €0.250 |
1920x1080 px | 2x | 3840x2160 px | €0.375 |
For more detailed pricing information, visit the Billing Dashboard.
Rate Limiting
Rate limits are 250 upscales per day for upgraded accounts. If you need more upscales, contact our team and we will study your case.
Frequently Asked Questions
Need Help?
For questions or custom requirements, contact the Freepik sales team.
Was this page helpful?