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
terraform
folder and runterraform apply
to provision the AWS instance. - Add the public IP address outputted from Terraform to the
ansible/hosts.yaml
file, and edit theansible_ssh_private_key_file
to the private key file path. - In the
ansible
directory, runansible-playbook install_stable_diffusion.yml
to install stable-diffusion-webui on the instance. - SSH into the instance using the provided private key.
- In the
stable-diffusion-webui
directory, run./webui.sh --skip-torch-cuda-test --precision full --no-half
to 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.