SabaKore

Home / Articles / AI guides

Image Generation AI and VPSs: How Far Can CPU Alone Go?

Why image-generating AI assumes a GPU, and what you can realistically do with a CPU-only VPS. We also cover the idea of leaving generation itself to an external service.

Ren, a junior infrastructure engineer

Ren

I'd like to run an image-generating AI on my own VPS too!
Procura, a cloud AI robot who explains

Procura

I should be honest here: image generation is a textbook case of a workload that practically requires a GPU. It does run on a CPU alone, but a single image takes a long time, so it's hard to call it practical.

Why a GPU is practically required

Image generation repeats a calculation dozens of times that gradually cleans up a noisy image. GPUs are good at running the huge number of calculations inside each repetition at the same time, while a CPU can only run a limited number in parallel. The nature of the computation is different from text generation, so don't expect to close this gap with clever tricks.

Ren, a junior infrastructure engineer

Ren

So do I have to give up on being involved in image generation on a VPS?
Procura, a cloud AI robot who explains

Procura

You can leave generation itself to an API and let the VPS take on a different role.

Realistic roles for the VPS

  • Accept requests to the generation API and manage a queue that processes them in order
  • Store and serve the generated images
  • Add a step that checks for inappropriate content
  • Record each user's number of generations and put a cap on it
Procura, a cloud AI robot who explains

Procura

You don't have to insist on 'doing everything on my own server.' Hand off the heavy part, and let the VPS focus on intake and management. With that split, even a small VPS has a solid role to play.

Copyright and terms of use

Image generation is more complicated than text generation when it comes to rights. How the generated images relate to the material used for training, and whether you can use them commercially, depend on the terms of the service you use. At the stage of choosing a service, check how rights to the generated output are handled. Changing it after you've started operating is a hassle.

  • Check the terms of use to see whether commercial use is allowed
  • Prompts that imitate real people or copyrighted works tend to cause trouble
  • State in your terms of use who is responsible for images that users generate
Ren, a junior infrastructure engineer

Ren

Is it okay to do post-processing of images on the VPS?
Procura, a cloud AI robot who explains

Procura

Things like resizing and simple corrections can be handled quickly enough even on a CPU. If the VPS takes on the fine adjustments after generation, you also reduce the number of calls to the generation API, so it kills two birds with one stone.

How to estimate the number of calls

Image generation APIs generally charge per call. If you design it so users can generate as many times as they like, costs may pile up faster than you expected. You need to check the provider's pricing page each time for the specific amounts, but on the VPS side it's reassuring to decide a limit first, such as 'up to N times per person per day,' and have a mechanism that stops generation once it's exceeded.

  • Record each user's number of generations and set a cap
  • Consider a mechanism that notifies users when they approach the cap
  • Pricing can change, so check the provider's latest information each time
Ren, a junior infrastructure engineer

Ren

Leave generation to the API, and let the VPS handle intake and management. Split the roles that way.

This article is translated from the Japanese original. If the two differ, the Japanese version is the one we keep up to date.