Go back

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.

  1. Open Comfy UI: Stable Diffusion AI Image Generation Made Simple VM listing on Azure Marketplace.

/img/azure/comfyui-vm/marketplace.png

  1. Click on Get It Now
  • Login with your credentials, provide the details here. Once done click on Continue. /img/azure/comfyui-vm/continue.png

  • It will take you to the Product details page. Click on Create. /img/azure/comfyui-vm/create.png

  • Select a Resource group for your virtual machine

  • Select a Region where you want to launch the VM(such as East US)

/img/azure/comfyui-vm/basics-page-01.png

  • 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.

/img/azure/comfyui-vm/image-mismatch-error.png /img/azure/comfyui-vm/standard-security-type.png

  • 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.

/img/azure/comfyui-vm/cpu-instance.png

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.

/img/azure/comfyui-vm/basics-page-02.png

  • Optionally change the OS disk size and its type.

/img/azure/comfyui-vm/disk.png

  • 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.

/img/azure/comfyui-vm/network.png

/img/azure/comfyui-vm/ports.png

  • 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.
  1. 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.

/img/azure/comfyui-vm/vm-overview.png

  1. 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.

/img/azure/comfyui-vm/public-ip.png

Browser will display a SSL certificate warning message. Accept the certificate warning and Continue.

/img/azure/comfyui-vm/browser-warning.png

By default, the ComfyUI’s default workflow will be automatically loaded after the start, as shown in the figure below.

/img/azure/comfyui-vm/comfyui.png

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.

/img/azure/comfyui-vm/load-default.png

  1. 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.

/img/azure/comfyui-vm/sdxl-checkpoint.png

  1. 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.

/img/azure/comfyui-vm/prompt-settings.png

  1. 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.

/img/azure/comfyui-vm/queue-prompt.png

  1. You can check the extra options from the options given below the Queue Prompt button. Like history, view queue etc.

/img/azure/comfyui-vm/extra-options.png

  1. The images created from ComfyUI are stored under /home/ubuntu/setup/ComfyUI/output/ directory on the VM. To access this directory, follow below steps:

/img/azure/comfyui-vm/comfyui-output-directory.png

  1. 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

/img/azure/comfyui-vm/public-ip.png

  1. 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

/img/azure/desktop-linux/rdp.png

  1. 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

/img/azure/stable-diffusion/rdp-login.png

  1. 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.

/img/azure/comfyui-vm/reset-passwd.png

  1. Now you are connected to the out of box Comfy UI VM’s desktop environment via Windows Machine.

/img/azure/comfyui-vm/rdp-desktop.png

  1. From VM’s Desktop, you can access the Output Images by navigating to /home/ubuntu/setup/ComfyUI/output/ directory.

/img/azure/comfyui-vm/comfyui-output-directory.png

  1. To SSH to the VM, Open putty and paste the IP address and click on Open.

/img/aws/ethereum-fullnode/putty-01.png

  1. login as ubuntu and provide the password for ‘ubuntu’ user

/img/azure/comfyui-vm/ssh-login.png

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

Go back