Run diffusers-api on Google Compute Engine

This is a sub-topic of Running on other cloud providers. See that post for why you might want to do this, and info and examples for other providers too.

Create the Virtual Machine

  1. Open https://console.cloud.google.com/compute (and if necessary, create a new project select that project, then click on the big blue “ENABLE” under “Compute Engine API”).

  2. Click big blue CREATE INSTANCE button

  3. Pick appropriate name, labels (if needed), region, zone, etc.

  • Machine Configuration

    • Machine family: choose GPU
    • GPU type NVIDIA T4 or above, # of GPUs: 1
    • n1-standard-8 (8 vCPU, 30 GB memory) (-4 might juuust work, untested)
  • Boot Disk

    • You’ll get a warning about needing to “install NVIDIA CUDA stack manually” which you can safely ignore. It’s installed as part of the docker image.

    • Click “CHANGE” button.

      • Choose Ubuntu version 22.04 LTS which arch x86/64 (honestly, Debian is perfect too, and probably every option will work there, but we picked Ubuntu for this guide because it’s so commonly used).
  • Firewall

    • Optionally enable http/https if you want to rest remote calls.
  • Everything else, as per your preferences.

  • Click on the big blue CREATE button.

At this point, you may well get a message that the requested instance is not available in the requested region, and you’ll have to start the entire process again, filling in all the values from scratch. It took us about 20m to find an available region. Google is special, is all we’ll say.

Setup docker and docker-diffusers-api

Coming soon if I ever find a region that has available instances. Tips welcome :slight_smile: