How to Install and Use ComfyUI in Stable Diffusion?

ComfyUI, a powerful and user-friendly graphical user interface (GUI) for Stable Diffusion, has been making waves in the generative art algorithm community. This tool allows users to create complex and realistic images without the need for coding, making it a go-to solution for both new and seasoned users.

Table of Contents

What is ComfyUI?

ComfyUI is a robust and modular Stable Diffusion GUI and backend that enables users to design and execute advanced Stable Diffusion pipelines using a graph/nodes/flowchart-based interface. It’s a GitHub project that provides an intuitive Nodes/Graph/Flowchart interface, making the creation of complex workflows for image modification, composition, and other tasks simple and straightforward.

What Can ComfyUI Do?

ComfyUI is packed with features that make it a versatile tool for Stable Diffusion. Here are some of its key features:

  • Nodes/graph/flowchart interface for creating complex Stable Diffusion workflows without coding.
  • Full support for SD1.x, SD2.x, and SDXL.
  • Asynchronous Queue system for efficient workflow execution.
  • Many optimizations, including re-executing only the parts of the workflow that change between executions.
  • Compatibility with GPUs with less than 3GB vram and CPUs.
  • Ability to load ckpt, safetensors, and diffusers models/checkpoints, standalone VAEs, and CLIP models.
  • Features for embeddings/textual inversion, Loras (regular, locon, and loha), Hypernetworks, area composition, inpainting with both regular and inpainting models, ControlNet and T2I-Adapter, upscale models, unCLIP models, GLIGEN, and model merging.
  • Latent previews with TAESD.
  • Fast startup and fully offline operation.

How to Install ComfyUI in Stable Diffusion?

Here are the step-by-step instructions for installing ComfyUI:

  1. Windows Users with Nvidia GPUs: Download the portable standalone build from the releases page. Extract the downloaded file with 7-Zip and run ComfyUI. Place your Stable Diffusion checkpoints/models in the “ComfyUI\models\checkpoints” directory.
  2. Colab Notebook: Use the provided Colab Notebook for running ComfyUI on platforms like Colab or Paperspace.
  3. Manual Installation (Windows and Linux): Clone the ComfyUI repository using Git. Place your Stable Diffusion checkpoints in the “models/checkpoints” directory and your VAE in the “models/vae” directory.
  4. AMD GPUs (Linux only): AMD users can install ROCm and PyTorch with pip. Use the command pip install torch torchvision torchaudio –extra-index-url https://download.pytorch.org/whl/rocm5.4.2 to install the stable version.
  5. NVIDIA: Nvidia users should install torch and xformers using this command: pip install torch torchvision torchaudio –extra-index-url https://download.pytorch.org/whl/cu118 xformers.
  6. Dependencies: Install the dependencies by opening your terminal inside the ComfyUI folder and running pip install -r requirements.txt.

How to Use ComfyUI in Stable Diffusion?

Here are the detailed steps for using ComfyUI:

  1. Loading Workflows: You can load finished workflows from generated PNG files and store workflows as JSON files.
  2. Creating Workflows: Use the node-based interface to create your workflows. The built-in documentation provides clear instructions on using all of the features.
  3. Keyboard Shortcuts: Utilize various keyboard shortcuts to make the workflow creation process go more quickly. For example, use “Ctrl + Enter” to queue up the current graph for generation, “Ctrl + S” to save the workflow, and “Ctrl + O” to load a workflow.
  4. Running ComfyUI: To run ComfyUI, open your terminal in the ComfyUI directory and run python main.py.

ComfyUI Using Examples

ComfyUI provides users with access to a vast array of tools and cutting-edge approaches, opening countless opportunities for image alteration, composition, and other tasks. Users have shared their experiences and examples of using ComfyUI on platforms like Reddit and GitHub, showcasing the tool’s versatility and power.

ComfyUI Enhanced Image

Conclusion

For creative individuals looking to explore Stable Diffusion workflows without scripting, ComfyUI offers an outstanding toolbox. Its intuitive user interface, wide compatibility, and optimization methodologies provide a seamless user experience. Whether you’re an experienced professional or an inquisitive newbie, ComfyUI promises to be an invaluable tool in your creative journey.

error: Content is protected !!