AIDock Docker - Automatic1111 on Vast.AI

Instance Config

Read the official docsopen in new window if you have never used vast before. My recommendation here is a modified version of the recommended settings, based on my experience.

Use the Stable Diffusion WebUI Docker from ai-dock Github @ai-dockopen in new window

This image by default will come with 16 GB of disk space only. I recommend increasing it to 50 - 100 GB.

  • Disk Space to allocation: 50 - 100 GB
    • depending on how much space you need for generation and models
    • I usually set it to 100 GB because I generate at high res and with lots of models
    • You can’t change the disk size once an instance was created
    • If you’re running large batch jobs, having good amount of disk space would save you a lot of time
    • There might be more instances available if you allocate less disk space, though I personally won’t go under 30 GB

Useful things for using this docker image

Restart with supervisorctl

supervisorctl restart webui

Authentication

This docker image sets a default username and password. This was implemented so that your instance couldn’t be port-scanned and used by skilled intruders. You can change it by setting the following environment variables:

# set username
export WEB_USER=yourusername

# set password
export WEB_PASSWORD=yourpassword

# restart webui
supervisorctl restart webui

Config with environment variables

Full listopen in new window

Highly useful ones:

WEBUI_FLAGS

By default, this docker adds --no-half. If you’re running GPUs in the cloud you’re most likely running fast GPUs e.g. RTX 4090 and you should definitely remove this flag. It greatly reduces image quality and increases generation time when this flag is present.

Figure out what is currently set

echo $WEBUI_FLAGS

Remove --no-half and add back other settings

export WEBUI_FLAGS="[list of flags without --no-half]
# example default
export WEBUI_FLAGS="--xformers --no-half --no-half-vae --enable-insecure-extension-access"
# example ideal settings for high quality output
export WEBUI_FLAGS="--xformers --enable-insecure-extension-access"

Restart WebUI

supervisorctl restart webui

Additional Config

I usually use these settings for Automatic1111. These are intended to give the best high quality results, and some user interface enhancements.

Settings

  • Stable Diffusion

    • Select Enable quantization in K samplers for sharper and cleaner results. This may change existing seeds
  • User Interface > Quicksettings list

    • Enable sd_vae
    • Enable CLIP_stop_at_last_layers
    • Enable Hires fix: show hires checkpoint and sampler selection
    • Enable Hires fix: show hires prompt and negative prompt
  • If using SDXL with Refiner, set this:

    • Maximum number of checkpoints loaded at the same time: 2
    • If you don’t set this to 2 then you will keep in reloading checkpoints on every image and it will greatly increase the rendering time.
  • If you use img2img, consider enabling this:

    • Enable With img2img, do exactly the amount of steps the slider specifies. (normally you'd do less with less denoising)
      • This is subjective, but I often use img2img to render a specific style / finish over an existing image, and so I would want to render the full amount of steps.

Folders

Useful commands to navigate the folders

LoRA

cd /workspace/stable-diffusion-webui/models/Lora

Extensions

cd /workspace/stable-diffusion-webui/extensions

Continue to Instance Setup

Last Updated: