Tutorial – How to install ComfyUI and ComfyUI Manager

Sanning Arkitekter
20 Apr 202413:03

TLDRThis tutorial guides users through installing ComfyUI, a flexible yet challenging node-based user interface for Stable Diffusion, and its Manager. It covers cloning the repository, setting up a virtual environment to avoid dependency conflicts, installing dependencies, and launching ComfyUI. It also explains how to populate the UI with model checkpoints and save images in different formats using the ComfyUI Manager, showcasing the process of generating unique images with various prompts and settings.

Takeaways

  • 😀 ComfyUI is a user interface for Stable Diffusion that is node-based and offers flexibility.
  • 🛠️ To avoid conflicts with other software, dependencies for ComfyUI should be installed in a virtual environment.
  • 📚 The tutorial provides step-by-step instructions for installing ComfyUI.
  • 💻 It is assumed that Python 3.10.7 is already installed on the system.
  • 🔄 The process involves cloning a repository and setting up a virtual environment with Python.
  • 📝 A requirements.txt file lists all the dependencies needed for ComfyUI.
  • 🔗 The tutorial explains how to activate the virtual environment and install dependencies.
  • 🖼️ After installation, ComfyUI can be started with a simple Python script.
  • 📁 The script includes instructions for setting up model checkpoints and custom nodes.
  • 🖌️ ComfyUI Manager can be installed to manage extensions and save images in different formats like JPEG.
  • 🔄 The tutorial demonstrates how to create a workflow, generate images, and manage outputs.

Q & A

  • What is the purpose of the tutorial?

    -The purpose of the tutorial is to guide students on how to install ComfyUI, a user interface for Stable Diffusion that is node-based and offers more flexibility.

  • Why is it recommended to install ComfyUI in a virtual environment?

    -Installing ComfyUI in a virtual environment is recommended to avoid conflicts with other software that may use the same dependencies.

  • What is the first step in the installation process described in the tutorial?

    -The first step is to clone the ComfyUI repository into the desired installation folder.

  • How do you create a virtual environment for ComfyUI?

    -You create a virtual environment by using the 'python -m venv' command followed by the environment name, such as 'ven'.

  • What is assumed to be pre-installed before starting the ComfyUI installation?

    -It is assumed that Python 3.10.7 and pip are already installed on the system.

  • How do you activate the virtual environment in PowerShell?

    -You activate the virtual environment by running the 'activate.bat' file or the '.\ven\Scripts\Activate.ps1' script in PowerShell.

  • What file contains the list of dependencies needed for ComfyUI?

    -The 'requirements.txt' file contains the list of dependencies needed for ComfyUI.

  • How do you install the dependencies listed in 'requirements.txt'?

    -You install the dependencies by running 'pip install -r requirements.txt' with the virtual environment active.

  • What is the purpose of creating a 'start_comyUI.bat' file?

    -The 'start_comyUI.bat' file is created to simplify the process of starting ComfyUI by activating the virtual environment and running 'python main.py' in one step.

  • How can you add model checkpoints to ComfyUI after installation?

    -You can add model checkpoints to ComfyUI by editing the 'do.yaml' file to include the base path to the previously installed Stable Diffusion web user interface and its model directories.

  • What is the role of ComfyUI Manager in the context of this tutorial?

    -ComfyUI Manager is used to manage extensions for ComfyUI, including an extension that allows saving images in formats other than PNG, such as JPEG or WebP.

Outlines

00:00

💻 Installing Comfy UI for Stable Diffusion

This tutorial guides students through the installation of Comfy UI, a node-based user interface for Stable Diffusion with enhanced flexibility and plugin compatibility. The process involves cloning the repository into a designated folder, creating a virtual environment to prevent dependency conflicts, and installing dependencies using Python and pip. It is assumed that Python 3.10.7 and pip are pre-installed. The tutorial also covers the activation of the virtual environment and the installation of torch and other necessary dependencies from a requirements.txt file.

05:01

🖼️ Setting Up and Launching Comfy UI

After successfully installing the dependencies, the tutorial proceeds to setting up the Comfy UI by creating a batch file to launch the interface conveniently. It explains how to navigate the UI, including selecting checkpoints, setting prompts, and choosing the sampler and scheduler. The process of populating the UI with model checkpoints from a previous installation is detailed, ensuring the user can utilize pre-downloaded models. The tutorial demonstrates generating an image using the UI and addresses the issue of saving outputs, introducing the Comfy UI manager and an extension for saving images in different formats like JPEG and WebP.

10:03

🔄 Enhancing Comfy UI with Extensions

The final part of the tutorial focuses on enhancing the functionality of Comfy UI by installing the Comfy UI manager and an extension that allows saving images in JPEG and WebP formats. It outlines the steps to install the manager, customize the workflow, and generate images with different file formats. The tutorial concludes by showing how to save the customized workflow, restart Comfy UI to apply changes, and generate images with varied seeds to produce unique outputs. It also mentions the importance of managing storage as PNG files can accumulate significant space over time.

Mindmap

Keywords

💡ComfyUI

ComfyUI is a user interface for Stable Diffusion, a node-based system that, despite its somewhat ironic name, can be complex to adapt to but offers greater flexibility. In the video, it is the main subject of the tutorial, with the focus on how to install it correctly to avoid conflicts with other software.

💡Virtual Environment

A virtual environment is a self-contained directory tree that contains a Python installation for a particular version of Python and set of libraries. In the context of the video, it is used to install the dependencies for ComfyUI without conflicting with other software, ensuring a clean and isolated setup.

💡Dependencies

Dependencies refer to libraries, frameworks, or other software that a program requires to function properly. In the video, the dependencies for ComfyUI are installed within a virtual environment to ensure compatibility and prevent conflicts with other software that might use the same dependencies.

💡Git Clone

Git Clone is a command used to create a local copy of a repository from a remote source. In the video, 'git clone' is used to obtain the ComfyUI repository, which is the first step in the installation process.

💡Python

Python is a high-level programming language known for its readability and versatility. In the video, Python 3.10.7 is specified as a prerequisite for installing ComfyUI, highlighting its role as the underlying programming language for the user interface.

💡Pip

Pip is a package manager for Python that allows users to install and manage additional libraries. In the script, pip is used to install the necessary dependencies listed in the 'requirements.txt' file for ComfyUI.

💡Checkpoint

In the context of the video, a checkpoint refers to a model checkpoint in machine learning, which is a snapshot of a model's state during training. The video mentions that ComfyUI needs to reference these checkpoints to function properly.

💡Stable Diffusion

Stable Diffusion is a term used in the video to describe the underlying technology that ComfyUI interfaces with. It is a type of machine learning model used for generating images from textual descriptions.

💡ComfyUI Manager

ComfyUI Manager is an extension for managing ComfyUI, allowing for additional functionalities such as saving images in different formats. The video explains how to install this manager to enhance the capabilities of ComfyUI.

💡Batch File

A batch file is a script file in DOS, OS/2 and Microsoft Windows. It consists of a series of commands to be executed by the command-line interpreter. In the video, a batch file named 'start comy UI.bat' is created to simplify the process of activating the virtual environment and starting ComfyUI.

💡Extensions

Extensions in the context of the video refer to additional features or functionalities that can be added to ComfyUI. The 'Extended Save Image for ComfyUI' is an example of an extension that allows saving images in formats other than the default PNG.

Highlights

Tutorial on installing ComfyUI, a node-based user interface for Stable Diffusion.

ComfyUI offers flexibility and compatibility with plugins not supported by other interfaces.

Instructions to install dependencies in a virtual environment to avoid conflicts.

Cloning the ComfyUI repository into a designated folder.

Creating a virtual environment using Python to manage dependencies.

Activating the virtual environment using a PowerShell script.

Installing dependencies from the 'requirements.txt' file in the virtual environment.

Executing the 'main.py' file to start ComfyUI within the virtual environment.

Creating a batch file to simplify the process of starting ComfyUI.

Accessing the ComfyUI interface and configuring model checkpoints.

The need to reference existing model checkpoints for proper functionality.

Editing the 'do.yaml' file to set the base path for model checkpoints.

Testing the interface with a sample prompt and generating an image.

Installing ComfyUI Manager for additional functionality and extensions.

Managing extensions with ComfyUI Manager to enhance image saving capabilities.

Adding custom nodes and configuring the interface for extended image formats.

Generating images in different formats, such as JPEG, to save storage space.

The tutorial concludes with a successful installation and usage of ComfyUI for Stable Diffusion.