Run SDXL Locally With ComfyUI (2024 Stable Diffusion Guide)

Matt Wolfe
17 Jan 202422:27

TLDRThis tutorial video provides a comprehensive guide on setting up and using Stable Diffusion with ComfyUI, an interface that simplifies the process of generating images through AI. The presenter explains the benefits of using Stable Diffusion, such as its free and open-source nature, uncensored content generation, privacy due to local installation, and high customizability. The video walks viewers through the installation process of ComfyUI, including downloading and unzipping the files, running the interface, and installing necessary models like Stable Diffusion XL. It also demonstrates how to use ComfyUI's visual workflow, save and reuse workflows, and even incorporate custom nodes and models for more advanced image generation. The tutorial concludes with tips on finding and using additional models and workflows shared by the community, offering a rich resource for users interested in AI-generated art.


  • πŸ“ˆ **Evolution of Tools**: The AI world has seen significant changes in the past 10 months, with better and more user-friendly tools for running stable diffusion.
  • πŸ†“ **Free and Open Source**: Stable diffusion is chosen for its freedom - it's free, open source, uncensored, and allows for local installation without privacy concerns.
  • πŸ–ΌοΈ **Customizability**: Users can customize stable diffusion extensively with add-ons like control net for specific image poses and other enhancements.
  • πŸš€ **Comfy UI Advantages**: Comfy UI provides a visual workflow, making the process more understandable and controllable compared to previous tools like automatic1111.
  • πŸ’» **Installation Process**: Comfy UI is easier to install than previous methods and allows for saving and reusing entire workflows for efficiency.
  • πŸ€– **Workflow Sharing**: Users can share custom workflows, enabling others to benefit from their configurations and jump-start their own projects.
  • πŸ’‘ **Optimal Hardware**: For the best results, a PC with Windows or Linux and an Nvidia GPU is recommended, though CPU processing is possible but slower.
  • πŸ”— **GitHub Resources**: The installation files and models for Comfy UI and stable diffusion can be found on GitHub, with detailed instructions provided.
  • πŸ“š **Model Selection**: Users can choose from a variety of models, including the powerful stable diffusion XL, available on platforms like Hugging Face.
  • 🧩 **Node Expansion**: Comfy UI's functionality can be expanded by installing additional nodes like control net for more sophisticated image generation.
  • 🌐 **Community Resources**: Websites like Civit AI offer a vast selection of custom-trained models and workflows created by the community for broader use.

Q & A

  • What is the main difference between using Comfy UI and the previous tool, automatic 1111, for running stable diffusion?

    -Comfy UI provides a better user interface, with a visual workflow that allows users to see the steps in the process more clearly, and it is considered easier to install and use than automatic 1111.

  • Why might someone choose to use stable diffusion over other AI art tools?

    -Stable diffusion is chosen for its freedom, being free and open source, uncensored content generation, privacy since it can be run locally without internet, and high customizability with add-ons like control net.

  • What is the recommended hardware setup for optimal use of Comfy UI?

    -A PC with either Windows or Linux installed and an Nvidia GPU for the best results. If an Nvidia GPU is not available, the CPU can be used, but it will be significantly slower.

  • How can users save and reuse their preferred settings in Comfy UI?

    -Users can save entire workflows in Comfy UI, allowing them to reload and tweak the prompt to achieve the same style of images they desire.

  • What is the process for installing Comfy UI on a PC?

    -The process involves downloading the installation files from the GitHub page, extracting the files using a tool like 7-Zip, and running the appropriate executable based on whether an Nvidia GPU is used.

  • What are checkpoints in the context of stable diffusion models?

    -Checkpoints are saved states of the model that can be loaded to continue training or to generate images with the trained model without starting from scratch.

  • How large are the files typically associated with stable diffusion models?

    -The files can be quite large, with the base model and additional components like the refiner and vae files often exceeding 6 GB each.

  • What is the purpose of the 'negative prompt' in the image generation process?

    -The negative prompt is used to specify elements that should be avoided in the generated image, such as text or watermarks.

  • How can users add more functionality to Comfy UI?

    -Users can install additional nodes and custom nodes through the Comfy UI Manager, which can be found on GitHub, to expand the capabilities of the UI.

  • What is the significance of the 'CFG' scale in the image generation settings?

    -The CFG scale determines how closely the generated image will follow the given prompt, with higher values leading to a closer adherence to the prompt.

  • How can users incorporate their own custom models into Comfy UI?

    -Users can place their custom model files (usually with a '.ckpt' extension) into the 'checkpoints' folder within the Comfy UI's 'models' directory.

  • What is the purpose of the 'Comfy Roll SDXL templates'?

    -These templates are pre-built workflows created by other users that can be downloaded and used to quickly start the image generation process with specific settings and configurations.



πŸš€ Introduction to Stable Diffusion and Comfy UI

The speaker discusses the advancements in AI, particularly in the field of stable diffusion, over the past 10 months. They mention that tools have improved, making stable diffusion easier to use. The video aims to guide viewers on setting up stable diffusion using Comfy UI, which is preferred for its user-friendly interface. The speaker also explains the benefits of using stable diffusion, including its free, open-source nature, uncensored image generation capabilities, privacy due to local installation, and high customizability. They compare Comfy UI to Automatic1111 and highlight the ease of installation and workflow saving features of Comfy UI.


πŸ’» Installing Comfy UI and Stable Diffusion Models

The paragraph outlines the process of installing Comfy UI on a PC, including downloading the necessary files from GitHub and unzipping them using a tool like 7-Zip. It details the creation of folders for the installation and the use of either the CPU or Nvidia GPU version of Comfy UI, depending on the user's hardware. The speaker also emphasizes the need for a powerful model like Stable Diffusion XL and guides viewers on downloading the base model, refiner model, and VAE file from Hugging Face. They explain how to install these models in the Comfy UI interface to enable image generation.


πŸ“ˆ Customizing Image Generation with Comfy UI

The speaker explains how to customize the image generation process using Comfy UI by adjusting parameters such as the prompt, negative prompt, seed, steps, CFG, and sampler name. They also introduce the concept of adding nodes to Comfy UI for more advanced customization, like installing the Comfy UI manager and custom nodes like ControlNet. The paragraph demonstrates how to install and use ControlNet to influence the pose in generated images, enhancing the customization of the output.


🧍 Integrating Custom Models and ControlNet in Comfy UI

The paragraph delves into how to integrate custom models and ControlNet into Comfy UI for personalized image generation. It describes the process of adding nodes to the workflow to incorporate pose detection and applying it to the generated image. The speaker also discusses the ability to use custom-trained models from platforms like Civit AI and how to import them into Comfy UI. They provide a practical example of generating an image with a custom model featuring the user's own face.


🌐 Sharing and Using Workflows in Comfy UI

The final paragraph covers the functionality of sharing and using pre-built workflows in Comfy UI. It explains how users can download and implement workflows created by others, which can be dragged and dropped into their Comfy UI interface after installing any required custom nodes. The speaker also encourages viewers to explore more Comfy UI tutorials if interested and to subscribe to their channel for more AI-related content. They conclude by expressing hope that the tutorial remains relevant and useful despite the fast-paced nature of AI development.



πŸ’‘Stable Diffusion

Stable Diffusion is an open-source artificial intelligence (AI) model for generating images from textual descriptions. It is characterized by its ability to create high-quality images and is often used in the context of AI art tools. In the video, it is the core technology being utilized with ComfyUI for generating images, and it is noted for being free, uncensored, and customizable.


ComfyUI is a user interface designed to facilitate the use of Stable Diffusion. It provides a visual workflow that allows users to see and control each step of the image generation process. The video emphasizes that ComfyUI is favored for its ease of use and the ability to save and reuse workflows, making it a more user-friendly alternative to other interfaces like Automatic1111.


ControlNet is an add-on for Stable Diffusion that allows users to control the pose and other specific elements of the generated images. In the video, it is used to ensure that the generated images follow a consistent pose, which is particularly useful for creating images with specific artistic intentions.

πŸ’‘Open Pose

Open Pose is a model used within the ControlNet framework to detect and understand the pose of figures in an image. It is used in the video to analyze the pose of a person in a sample image, which is then used to guide the pose of generated images.

πŸ’‘Hugging Face

Hugging Face is a company that provides a platform for developers to share and use AI models. In the context of the video, Hugging Face is the source for downloading the Stable Diffusion XL model and other necessary components for running Stable Diffusion through ComfyUI.

πŸ’‘AI Art Tools

AI Art Tools refer to a variety of software applications that utilize artificial intelligence to assist in the creation of art. The video discusses how Stable Diffusion compares to other AI art tools like Mid Journey, Dolly 3, and Google's Imagin, highlighting its advantages such as being free, open source, uncensored, and customizable.

πŸ’‘Nvidia GPU

Nvidia GPU refers to the graphics processing unit (GPU) developed by Nvidia Corporation, which is renowned for its use in gaming and professional applications due to its high-performance capabilities. In the video, it is recommended for running ComfyUI to achieve the best results in image processing speed.

πŸ’‘7z File

A 7z file is a compressed file format that uses the '7z' extension and is known for its high compression ratio. In the video, the installation files for ComfyUI are downloaded as a 7z file, which needs to be extracted using a program like 7-Zip before installation.


In the context of the video, a workflow refers to a sequence of steps or processes that are saved within ComfyUI to generate images. Users can create, save, and reuse workflows to streamline the image generation process, and even share and use workflows created by others.

πŸ’‘Custom Nodes

Custom nodes in ComfyUI are additional components that can be installed to extend the functionality of the interface. They allow users to add more steps or processes to the image generation workflow. In the video, the installation of ControlNet and Open Pose are examples of adding custom nodes to ComfyUI.

πŸ’‘Civit AI

Civit AI is a platform mentioned in the video where users can find and download custom-trained models for use in ComfyUI. It is highlighted as a resource for accessing a wide variety of models, including the popular Juggernaut XL model, which can be integrated into the user's ComfyUI setup.


A new stable diffusion tutorial has been released, making it easier to use with ComfyUI.

Stable diffusion is chosen for its free, open-source nature and uncensored image generation capabilities.

Local installation of stable diffusion alleviates privacy concerns as no internet connection is required.

Stable diffusion is highly customizable with extensions like control net for specific poses.

ComfyUI provides a visual workflow for better control over the image generation process.

ComfyUI is easier to install than previous tools like automatic 1111 and allows saving of entire workflows.

ComfyUI is optimized for use with an Nvidia GPU but can also run on a CPU, albeit slower.

For Mac users, a YouTube video tutorial is available for installing ComfyUI on M1 or M2 chips.

The installation process for ComfyUI is straightforward and quick, with the longest step being the download.

ComfyUI doesn't require separate downloads of Python or other tools as it includes everything needed.

Stable diffusion XL is recommended as the most powerful model for use with ComfyUI.

Downloading and installing checkpoints and models from hugging face is a key step in setting up ComfyUI.

Custom nodes can be added to ComfyUI for extended functionality, such as control net for pose detection.

ComfyUI manager can be used to install custom nodes and models, enhancing the capabilities of ComfyUI.

Control net can be integrated with ComfyUI to influence the pose of generated images.

Thousands of custom-trained models are available on Civit AI for use in ComfyUI.

ComfyUI supports the use of custom models, including those created with personal faces via dream Booth.

Workflows created by others can be imported into ComfyUI, allowing users to leverage pre-built processes.