Back to Blog

Building a highly scalable API for AI image enhancement

Jamie McInally

Building a highly scalable API for AI image enhancement

When we started our photo editing service - Autoenhance.ai - we considered that our web app was the best way for users to enhance their images and receive an instant AI enhancement. Our users interact with multiple services and websites every day. We didn’t want to add to their list; instead, we tried to integrate Autoenhance.ai into existing services utilised by our users. We had many conversations with potential clients in those early stages, and “Do you have an API?” was the question many people asked. We then had to ask ourselves: “Why don't we have an API?”

We’d built a successful internal API, but it wasn’t a RESTful API by definition. Initially, we gave our users access to this API, but there were many flaws, such as security, and the layout of the API was not intuitive. It required a 30-minute walk-through to understand it.

In March, James Campbell joined Autoenhance.ai as CTO. First, I gave him a walkthrough of our API and straight away, he called me out, saying that the API isn’t simple. He immediately called the team and said, “ We’re going to engineer a new Autoenhance.ai API”.

We started with security. AWS is our cloud provider, which has an excellent platform called API gateway to provision API keys for clients and maps pricing plans. This visibility allows us to lock the whole system down and monitor individual users to ensure we provide the right AI resources.

Secondly, we focussed on scalability. We used Sagemaker (a platform as a service) for our AI endpoints, but running on GPUs didn’t give us the scalability we needed to make our AI reactionary to API usage. We required smaller CPU instances that could be provisioned at peak usage (afternoons) and scaled-down during low use (at night). Additionally, we wanted to move away from ECS (elastic container service) to something even more scalable - serverless. However, some drawbacks include uploading images to serverless, limited to the maximum storage size of 6MB payload. We overcame this by providing users with a signed S3 endpoint for uploading pictures.

With our new architecture in place, we’ve started to make our endpoints more intuitive. Previously our endpoints were POST /upload, POST /status and POST /getimage, which relates to the user’s actions. However, this is not RESTful. Our new API uses the CRUD format e.g. POST /image to upload the image, GET /image/{imageid} to get the image status, GET /image/{image_id}/enhanced, to view the enhanced image.

Since releasing the new architecture, we’ve provided a consistent average turnaround time of 10 seconds per image and scaled efficiently with zero downtime. We’ve received positive customer feedback, and our visibility across the system assists us in improving the API continually.

The new API was a "great success"

Sign up for our API and follow the steps for integration.

Try our photo editing service to receive the instant enhancement.

Say goodbye to grey skies

Try Autoenhance.ai and join thousands improving their property photos and saving hours of editing time.

Never miss a minute.

Subscribe now to get our latest blog posts.
We will never share your email address with third parties.

More from the Blog

Autoenhance.ai V4.5: White balance and exposure improvements

We're thrilled to share Autoenhance.ai version 4.5: introducing powerful new features and refinements to help you achieve even more stunning real estate images.

Read Story

Try Our New App: Faster and More Efficient

We’re excited to announce the launch of our completely renewed Beta Web App, designed to give you a faster and better experience when enhancing your real estate images. The new app aims to help you manage your real estate images more efficiently, whether you’re working on a desktop or mobile device.

Read Story

Introducing v4.4: Improved Image Processing

We're excited to announce the latest update for Autoenhance.ai. Version 4.4 brings several significant improvements to deliver even more precise results.

Read Story