Workload · Generating images with Stable Diffusion

Your own Stable Diffusion server, with the WebUI you already know

To run your own Stable Diffusion server, choose a graphics card whose memory holds the models you use, put AUTOMATIC1111 or Forge on Linux, and reach it privately rather than leaving it open to the internet. The memory figure is the one to get right: older SD 1.5 checkpoints are happy on a 4 GB card, SDXL wants 8 GB, SD 3.5 Medium close to 10 GB before its text encoders, and the FP8 version of Flux is 11 to 12 GB on its own.

The short version
  1. Match the card's memory to your models first
  2. SD 1.5 on 4 GB, SDXL on 8 GB, more for SD 3.5 and Flux
  3. Forge squeezes Flux onto smaller cards
  4. Reach the WebUI through SSH, not an open port
  5. The whole card is yours, with nobody sharing it

Which card do your models need?

Video memory, or VRAM, is what you shop for. A card that is too slow still makes your picture, just later; a card with too little memory fails to load the checkpoint at all. Here is what the people who make these tools say:

  • SD 1.5 and other 1.x models: the AUTOMATIC1111 project supports 4 GB cards, and some users report 2 GB working.
  • SDXL: when Stability AI released it, they asked for an NVIDIA RTX 20-series card or better with at least 8 GB, plus 16 GB of ordinary memory in the machine.
  • SD 3.5 Medium: Stability AI says 9.9 GB, and that is before the text encoders, the parts that read your prompt.
  • SD 3.5 Large: no figure published. At 8.1 billion parameters, two bytes each, the weights alone come to roughly 16 GB.
  • Flux.1 dev in Forge: the FP8 version of the model is around 11 to 12 GB; the NF4 version is about half that size.

These are starting points. Bigger images, batches, LoRAs, ControlNet and upscalers all want memory of their own, so give yourself room above the number.

AUTOMATIC1111 or Forge: which one to install

If you have used Stable Diffusion at home, you probably know AUTOMATIC1111, the browser interface with txt2img and img2img tabs. Its version 1.10 added Stable Diffusion 3. Forge is a fork of that same interface, based on 1.10.1, so it looks and feels the same, but it handles memory more cleverly and runs Flux, including the smaller NF4 and GGUF versions.

A simple rule: if you mostly work with SD 1.5 or SDXL and your favourite extensions, AUTOMATIC1111 is fine. If you want Flux, or your card is on the small side, choose Forge. And if you would rather wire up saved workflows as nodes, our ComfyUI GPU server page covers that route.

When the model is bigger than the card

You can still run it, slower. AUTOMATIC1111 has two launch options for this. --medvram holds just one piece of the model in card memory while it parks the others in system memory; the project says this costs only a little speed. --lowvram chops the model up much more finely, and the project itself calls it devastating for performance. There is also --medvram-sdxl, which kicks in only when you load an SDXL checkpoint.

Forge does this for you and gives Flux users a GPU Weight slider. Its author's advice is to keep that slider lower rather than higher, because pushing it too far can make generation many times slower. On 6 to 12 GB cards, the NF4 version of Flux ran significantly faster than FP8 in his tests.

Up and running in an evening

  1. Install Ubuntu and the NVIDIA driver, then check that nvidia-smi shows your card.
  2. Make a normal user account for the WebUI. Its launch script will not run as root unless you force it, and you should not.
  3. Install the packages the project lists and download the code, as below. For Forge, use its own repository address in the clone step.
  4. On Ubuntu 24.04, sort out Python before the first launch: the default one is too new for the bundled torch. The README's answer is Python 3.11 from the deadsnakes PPA, installed with python3.11-venv, then named as python_cmd inside webui-user.sh.
  5. Now start it with ./webui.sh; the first launch takes a while as it fetches torch.
  6. Copy your checkpoints into models/Stable-diffusion and refresh the model list.
sudo apt install wget git python3 python3-venv libgl1 libglib2.0-0
# only on Ubuntu 24.04: a Python the WebUI accepts
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.11 python3.11-venv
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui
cd stable-diffusion-webui
echo 'python_cmd="python3.11"' >> webui-user.sh
./webui.sh

Keeping your WebUI private

Out of the box, the WebUI only answers on the server itself, at port 7860. That is a good thing. The easiest way to use it from your laptop is an SSH tunnel: run the line below on your own computer, then open http://127.0.0.1:7860 in your browser as if it were local.

ssh -N -L 7860:127.0.0.1:7860 youruser@your-server-address

If a colleague needs it without SSH, the --listen option makes it answer on the network. Do not use it alone. Add --gradio-auth or --gradio-auth-path so it asks for a username and password, give it a certificate with --tls-certfile and --tls-keyfile so those passwords are encrypted, and use your firewall to let in only the addresses you trust.

Why the project is careful here: extensions are code that runs on your server. Its wiki compares installing one to allowing arbitrary code execution, so once you use --listen or --share, installing extensions from the browser is switched off. You can override it with --enable-insecure-extension-access, but the wiki recommends turning it on only when you need it. It is simpler to add extensions over SSH.

The server that fits

With our GPU servers the card belongs to you alone. It sits in a physical server that only your account rents, and goes straight to your operating system, with your own driver and CUDA version. No one else's job shares it, and nothing slices it into pieces. You also get the rest of the machine, root access and a remote console, so a driver update that goes wrong is something you can fix from the console screen.

There are cards for every row of the list above, from 8 GB models for SD 1.5 and SDXL through 16 GB and 24 GB cards for SD 3.5 and Flux, up to 48 GB if you want headroom for upscaling and ControlNet together. The port is unmetered, so downloading checkpoints and sending finished images home never shows up on the invoice.

How soon you can start depends on the card: about 30 minutes once the order is approved if a machine already carries it, 4 to 24 hours when we fit one we hold, 5 to 10 working days when it has to be bought in, and 10 to 15 for a current-generation accelerator on allocation. There is no contract, and people answer the phone and chat around the clock. Choose the location closest to you.

When you might not need one

If you only make a handful of pictures now and then, a monthly server is more than you need. And if you plan to offer image generation to the public, the WebUI is made for you and perhaps a few colleagues, not for a crowd of strangers, so you would want a proper application in front of it.

Questions people ask

What is the smallest card that runs SDXL?
Stability AI's own guidance at launch was an RTX 20-series card or better carrying 8 GB or more of its own memory, in a machine with 16 GB of system RAM. With AUTOMATIC1111's --medvram-sdxl option, an 8 GB card has more room to spare.
Can I use my favourite extensions on a remote server?
Yes, but install them over SSH by cloning them into the extensions folder. When the WebUI is reachable from the network, it blocks installing extensions from the browser on purpose, because each one runs code on your server.
Is a password on the WebUI enough?
Not by itself. Without a certificate, the password crosses the internet unencrypted, and the port is still visible to anyone scanning. An SSH tunnel avoids both problems; if you must use --listen, add a certificate and a firewall rule as well.
Will Flux run on a 12 GB card?
In Forge, yes. The NF4 version is about half the size of the 11 to 12 GB FP8 model, and Forge moves what does not fit into system memory. Its author reports NF4 as clearly faster than FP8 on 6 to 12 GB cards.
Can my app send prompts to the server?
Start the WebUI with --api and it accepts requests from your code alongside the browser interface. If the app runs on the same server or reaches it through an SSH tunnel, that is all you need; if it must connect over the network, add --listen, set --api-auth with a username and password, give it a certificate with --tls-certfile and --tls-keyfile, and allow only your app's address in the firewall.

Get a card for your image studio

Choose the card by the models you run; the machine, the console and an unmetered port come with it, month to month.

Find your GPU

Read next