This section describes how to launch and connect to Techlatest Stable Diffusion with AUTOMATIC1111 Web Interface in a Google Compute environment using the available Cloud Launcher
offering.
Note: Stable diffusion requires a lot of processing, so a GPU instance is recommended. If you want to use a CPU instance due to the high price of GPU instances, you should use instances with a higher CPU.
GPU's are not available in some zones and for some instance types.
Below are recommended VM configuration requirements:
- GPU VM : NVIDIA T4 with 1 GPU with n1-standard-4 (4 vcpu 15GB memory) configuration
- CPU VM : e2-standard-4 (4vcpu, 16gb ram)
For CPU, its the minimum spec but more cpu is preferred.
Note: GPU instance will perform 10 times or more faster when processing request compared to CPU instance . Typical GPU instance will take 1-2 minutes to render images compared to 10-20 minutes by CPU instance, hence GPU instances are preferred.
- Open Techlatest Stable Diffusion with AUTOMATIC1111 Web Interface listing on GCP Marketplace
- Click Launch.
- Select a zone where you want to launch the VM(such as us-east1-)
- Optionally change the number of cores and amount of memory. ( This defaults to 4 vCPUs and 15 GB ram. For better performance please add GPU from the GPU section as shown in the below screenshot.)
- Optionally change the boot disk type and size. (This defaults to 'Standard Persistent Disk' and 40 GB respectively)
- Optionally change the network name and subnetwork names.
Be sure that whichever network you specify has ports 22 (for ssh), 3389 (for RDP) and 80 (for HTTP) exposed.
- Click Deploy when you are done.
Techlatest Stable Diffusion with AUTOMATIC1111 Web Interface will begin deploying.
- A summary page displays when the compute engine is successfully deployed. Click on the Instance link to go to the instance page .
- On the instance page, click on the "SSH" button, select "Open in browser window".

- This will open SSH window in a browser.
- Run below command to set the password for "ubuntu" user
sudo passwd ubuntu

- Now the password for ubuntu user is set, you can connect to the VM's desktop environment from any local windows machine using RDP or linux machine using Remmina.
- To connect using RDP via Windows machine, first note the external IP of the VM from VM details page as highlighted below

- Then From your local windows machine, goto "start" menu , in the search box type and select "Remote desktop connection"
- In the "Remote Desktop connection" wizard, paste the external ip and click connect

- This will connect you to the VM's desktop environment. Provide "ubuntu" as the userid and the password set in step 6 to authenticate. Click OK

- Now you are connected to out of box Techlatest Stable Diffusion with AUTOMATIC1111 Web Interface environment via Windows machines.

- To connect using RDP via Linux machine, first note the external IP of the VM from VM details page,then from your local Linux machine, goto menu , in the search box type and select "Remmina".
Note: If you don't have Remmina installed on your Linux machine, first Install Remmina as per your linux distribution.

- In the "Remmina Remote Desktop Client" wizard, select the RDP option from dropdown and paste the external ip and click enter.

- This will connect you to the VM's desktop environment. Provide "ubuntu" as the userid and the password set in step 6 to authenticate. Click OK

- Now you are connected to out of box Techlatest Stable Diffusion with AUTOMATIC1111 Web Interface environment via Linux machine.

- To access the Stable Diffusion GUI via browser, Copy the public IP of the vm in the browser and hit enter.
Note: Please use http and not https in the URL.
Please Note that for the first time, it will take 2-3 minutes to launch the app in the browser. So if GUI is not coming please try after few minutes.
Note: CPU instances take time to launch the Web UI. To verify if Stable Diffusion Web UI is launched, Please run below command in the terminal.
curl http://127.0.0.1:7860
If the output returns curl: (7) Failed to connect to 127.0.0.1 port 7860: Connection refused as shown below , then keep running above curl command till html output is found.

If this command returns html data as shown below, then Web UI is up and running. You can access it in browser using http://public_ip_of_vm

- The Stable Diffusion GUI comes with lots of options and settings. The first window shows text to image page. Provide the Prompt and click on Generate button and wait till it finishes.
- Output Images can be seen in the Image Browser tab. Click on Image browser and click on first page to load the images.
- In Image Browser, click on any image to see the details of it.
- To change any settings, go to Settings tab.
- Web UI also provides you the option to add extensions. Navigate to extensions tab, go to available and select load from URL. It will list all the available extensions.
- For more information on how to use the GUI, Go to Stable Diffusion Web UI
- The images created from GUI are stored under /home/ubuntu/stable-diffusion/output directory.
To access this directory, connect to VM's Desktop environment as explained above, and navigate to home -> ubuntu -> stable-diffusion -> output directory.
- You can also access the sourcecode of the Stable Diffusion. It is available under sourcecode folder on Desktop.
Credits: