Setup and installation of 'Comfy UI: Stable Diffusion AI Image Generation Made Simple' on Azure
This section describes how to launch and connect to ‘Comfy UI: Stable Diffusion AI Image Generation Made Simple’ VM solution on Azure.
- Open Comfy UI: Stable Diffusion AI Image Generation Made Simple VM listing on Azure Marketplace.
- Click on Get It Now
-
Login with your credentials, provide the details here. Once done click on Continue.
-
It will take you to the Product details page. Click on Create.
-
Select a Resource group for your virtual machine
-
Select a Region where you want to launch the VM(such as East US)
- Note: If you see “This image is not compatible with selected security type. To keep trusted launch virtual machines, select a compatible image. Otherwise change your security type back to Standard” error message below the Image name as shown in the screenshot below then please change the Security type to Standard.
-
Optionally change the number of cores and amount of memory.
-
For optimal performance, Stable Diffusion requires significant processing power, which is best achieved with a GPU instance. However, if the cost of a GPU instance is prohibitive, a CPU instance with higher processing capacity may be used as an alternative.
Below are the recommended VM configuration:
- GPU VM : Standard_NC4as_T4_v3 (4 vcpu 28GB memory 1NVIDIA GPU)
- CPU VM : Standard_B4ms (4vcpu, 16gb ram)
For CPU, its the minimum spec but more cpu is preferred.
NOTE: While deploying the instance on GPU, if you encounter the quota exhaust error or you are unable to deploy the instance on GPU VM then please refer to our Request Quota on Azure Cloud Platform Page.
Select the Authentication type as Password and enter Username as ubuntu and Password of your choice.
- Optionally change the OS disk size and its type.
- Optionally change the network and subnetwork names. Be sure that whichever network you specify has ports 22 (for ssh), 3389 (for RDP) and 443 (for HTTPS) exposed.
The VM comes with the preconfigured NSG rules. You can check them by clicking on Create New option available under the security group option.
- 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.
- To access the ComfyUI web interface, copy the public ip of the vm from VM’s details page and paste it in the browser using https://VM_Public_IP. Make sure to use https and not http.
Browser will display a SSL certificate warning message. Accept the certificate warning and Continue.
By default, the ComfyUI’s default workflow will be automatically loaded after the start, as shown in the figure below.
If the interface is blank or the default workflow is not loaded, please click on the Load default / Load default in the right corner menu to load the default workflow.
- Now you are connected to Comfy UI. By default the VM comes with SDXL Base 1.0 checkpoint model to get you started with the comfy UI.
- To get started, provide the prompt in the Clip Text Encode (prompt) box with any extra condition in the below prompt box. Give the size of the image and the batch count. Provide other settings in Sampler.
- Once you are ready to create your image, simply press Queue Prompt from right settings pane and watch your image getting generated.
Note: GPU instances generate images 10 times faster or more compared to CPU instances. Therefore, if you’re using a CPU instance, expect the process to take 10-15 minutes longer to complete.
- You can check the extra options from the options given below the Queue Prompt button. Like history, view queue etc.
- The images created from ComfyUI are stored under /home/ubuntu/setup/ComfyUI/output/ directory on the VM. To access this directory, follow below steps:
- You can connect to the VM’s desktop environment from any local windows machine using RDP protocol. 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 as ubuntu and the password provided during the VM creation to authenticate. Click OK
- If for any reason you don’t remember your VM’s password then you can reset it.Go to VM details page, in the left pane, scroll down to Help section and click on Reset password. Enter ‘Username’ as ubuntu and ‘Password’ of your choice. Click on Update button to save the changes.
- Now you are connected to the out of box Comfy UI VM’s desktop environment via Windows Machine.
- From VM’s Desktop, you can access the Output Images by navigating to /home/ubuntu/stable-diffusion/outputs/ directory.
- 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
Please refer to How to download and use custom models page for more details on using additional models with this VM.
For more information, please visit ComfyUI Official Documentation