This repository is designed to provision an AWS instance that has stable-diffusion-webui from automatic1111. This uses the Deep Learning Amazon Linux 2 ami image without a GPU.
- AWS account
- Terraform installed
- Ansible installed
- Create a key-pair from AWS.
- Clone this repository.
- Navigate to the repository directory.
- Navigate to the
terraformfolder and runterraform applyto provision the AWS instance. - Add the public IP address outputted from Terraform to the
ansible/hosts.yamlfile, and edit theansible_ssh_private_key_fileto the private key file path. - In the
ansibledirectory, runansible-playbook install_stable_diffusion.ymlto install stable-diffusion-webui on the instance. - SSH into the instance using the provided private key.
- In the
stable-diffusion-webuidirectory, run./webui.sh --skip-torch-cuda-test --precision full --no-halfto start the stable-diffusion-webui. - In a local terminal, run
ssh -i {instance-private-key} -N -L 7680:127.0.0.1:7860 ec2-user@{instance-public-ip}to establish a secure tunnel to the web interface. - Access Stable Diffusion webui at http://localhost:7680.
Note: Replace {instance-private-key} with the actual private key file path and {instance-public-ip} with the actual public IP address of the instance.