How to Install ComfyUI

To get started creating beautiful images using Stable Diffusion, you’ll first need to install a user interface. ComfyUI is a great interface that revolves around a modular node or graph design. Connect nodes together in sequence to generate an image. The workflows created can be easily shared as JSON files and are even embedded automatically in the generated images. Images on this page can be downloaded and dragged into Comfy UI to quickly get up and running.

1. Download the standalone files

Start by visiting the Comfy UI GitHub site and scroll down until you find the “Direct Link to Download”. This link may change, but as of writing, you can click here to download the files.

This version of the app is contained in a 7 zip archive. If your computer can’t open the file, you will need to install either 7zip or WinRAR.

Extract the files into the location you want Comfy UI to live. This should be on a drive with a fair bit of storage space available, as model files can be quite large, and you may want a few. Extracting the files to the root of your C: drive (C:\ComfyUI) will work fine.

2. Run ComfyUI for the first time

Start comfy UI by opening the “run_nvidia_gpu.bat” file. There are some prerequisites to install before we can start generating images. These will all be downloaded automatically. If there are any errors, copy paste those into google and you will find loads of other people who were able to fix it.

3. Download Model Files

Now we will need some model files to run within the app. There are a few sites that host model files to download like CivitAI or Hugging Face. Be sure to search for a “Checkpoint” and as of writing, a good “base model” (from which the model was trained) is Stable Diffusion XL 1.0. When downloading model files, look for the file extension “.safetonsors” to ensure the file contains a legitimate model file without malicious code.

For the images created on this page, I’ve used NightVisionXL v.9 from CivitAI. Place this downloaded file into the “Checkpoint” directory of ComfyUI. It will be similar to C:\ComfyUI\ComfyUI\models\checkpoints. (note: After saving the model file in the checkpoints folder, you may need to refresh the web browser for the model file to be selectable in later steps)

4. Set up a ComfyUI Workflow

Now that Comfy UI is open and you have a model file ready, we are ready to create our first workflow.

Double click the background and type “Load Checkpoint”. Click the result from the search box to add the node to the workflow:

In the ckpt_name field, choose the model file downloaded from before.

Then add two “Clip Text Encode” and connect them to the checkpoint loader:

These nodes will be used for the positive prompt and negative prompt.

Next add a “KSampler” node. This is where the generation of the image will be performed. Connect it to the positive and negative prompt nodes as well as the model node. The settings in this node determine how your images will be generated. You may wish to view the page where you downloaded your model for tips on what settings to use. For our example will will set the Steps to 30, CFG to 6, Sampler_name to dpmpp_2m, and the Scheduler to karras.

Then add an “Empty Latent Image” node and connect it to the KSampler. Set the width and height to the size of the image you want to create in pixels. These numbers must be divisible by 64 and shouldn’t be much lower than 512. We’ll use 1344×768 for a more cinematic aspect ratio.

Next we will add a “VAE Decode” node and attach it to the KSampler and checkpoint loader. You may also wish to add “Reroute” nodes to show a clearer path for your connections.

And finally you can add either a “Save Image” or “Preview Image” node and connect it to the VAE Decode node.

This workflow is also available to download by dragging and dropping the following image into ComfyUI.

This image was created with the workflow created above. Drag and drop this image into ComfyUI to replicate the results and use this workflow yourself.

Start Generating Images

With the workflow ready, all that’s left to do is hit “Queue Prompt” and let the images roll in!

If you used the “Save Image” node, all your images will be saved to a directory similar to C:\ComfyUI\ComfyUI\output. Alternatively, you can right click the image within ComfyUI and choose the “Save Image” option to download it to your web browsers default downloads directory.

Leave a Comment

Your email address will not be published. Required fields are marked *