How to get Techlatest Stable Diffusion with AUTOMATIC1111 Web Interface on AZURE
This section describes how to launch and connect to Techlatest Stable Diffusion with AUTOMATIC1111 Web Interface on Azure.
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.
Again note that GPU's are not available in some zones and for some instance types.
Below are recommended VM configuration requirements:
Note: GPU instance will perform 10x 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.
- GPU VM : Standard_NC4as_T4_v3 (4 vcpu 28GB memory) configuration
- CPU VM : Standard_B4ms (4vcpu, 16gb ram)
For CPU, its the minimum spec but more cpu is preferred.
- Open Techlatest Stable Diffusion with AUTOMATIC1111 UI VM listing on Azure Marketplace
- Click on Get It Now
- Select a Resource group for your virtual machine
- Select a Region where you want to launch the VM(such as East US)
- Optionally change the number of cores and amount of memory.
- Select the Authentication type as Password and enter Username as ubuntu and Password of your choice.
- Optionally change the OS disk type.
- Optionally change the network and subnetwork names.Be sure that whichever network you specify has ports 22 (for ssh), 3389 (for RDP) and 80 (for HTTP) exposed.
- Optionally go to the Management, Advanced and Tags tabs for any advance settings you want for the VM.
- Click on Review + create and then click on Create when you are done.
Virtual Machine will begin deploying.
- A summary page displays when the virtual machine is successfully created. Click on Go to resource link to go to the resource page.
It will open an overview page of virtual machine.
- In the left navigation pane, select Run command , select RunShellScript and enter following command to change the password of the vm .
sudo echo ubuntu:yourpassword | chpasswd
- Now the password for ubuntu user is set, you can connect to the VM's desktop environment from any local windows machine using RDP protocol or local linux machine using Remmina.
- To connect using RDP via Windows Machine, first note the public IP address of the VM from VM details page as highlighted below
- Then From you local windows machine, goto "start" menu , in the search box type and select "Remote desktop connection".
In the "Remote Desktop connection" wizard, copy the public IP address and click connect
- This will connect you to the VM's desktop environment. Provide the username (e.g "ubuntu") and the password set in the step4 to authenticate. Click OK
- Now you are connected to the out of box Techlatest Stable Diffusion with AUTOMATIC1111 UI environment via Windows Machine.
- 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 above reset password step to authenticate. Click OK
- Now you are connected to out of box Techlatest Stable Diffusion with AUTOMATIC1111 UI environment via Linux machine.
- To SSH to the VM, Open putty and paste the IP address and click on Open.
- login as ubuntu and provide the password for 'ubuntu' user
- 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.
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.