The ComfyUI Bible

The ComfyUI Bible #


Introduction #


If you need help installing ComfyUI, you didn’t come to the right place. If you are using Windows, you can use the prebuilt package, or you can install it manually otherwise.

Subsections #


ControlNet
We learn about union, no, not onion, union!
Optimizing ComfyUI Load Times
The document provides steps to optimize ComfyUI load times by enabling compression in the server script and compressing files using gzip and brotli.
Splines vs Straight
An internal monologue about link render modes.
UNetSelfAttentionMultiply
The UNetSelfAttentionMultiply function enhances the network’s focus on important image features, leading to more accurate and detailed image generation.
Experimental Stuff
This document contains information that might get outdated before you finish reading it! So make sure you have your glasses on!

Installing Models and LoRAs #


Before you can start using ComfyUI, first you need to get a model and depending on what you want to accomplish, you might need to stock up on some LoRAs, embeddings, upscalers and many other different types of models. But we will start simple, with just a model.

Models, or checkpoints are the huge files responsible for generating images based on text and/or image input. They are stored in the models\checkpoints folder of your ComfyUI installation. A good place to browse for one is CivitAI, but, since you are here, you are probably going to want to check out CompassMix XL Lightning or Pony Diffusion V6 XL. Both of which are SDXL based.

LoRAs, or Low-Rank Adaptation is a technique that came along to reduce the costs of fine-tuning LLMs. It works by freezing the pretrained model’s weights and injects trainable rank decomposition matrices into each layer. For now, the important thing is that these have a different method of operation and a different purpose, therefore these are stored separately in the models\loras folder in ComfyUI and you can find a lot of them on this website or on CivitAI and many other places!

You’ll find other folders for other types of models in the models\ folder! Feel free to explore around here, but we’ll worry about them when we get to them.

Node Based Workflow #


Let’s get started with the basics of ComfyUI’s node-based workflow. It might look overwhelming at first, but it’s easier to understand than you think.

When you first open ComfyUI, you’ll see a unique interface that might seem complex. But don’t worry, it’s actually pretty straightforward.

Arcane Wizardry

If you’re new to node-based workflows, it’s normal to feel a bit lost. But with a little practice, you’ll be navigating it like a pro. You might have questions, and that’s okay. The goal is to learn and have fun with ComfyUI.

The workflow is the entire setup you see in the screenshot, including all the nodes, groups, and connections you make. When someone asks you to share your workflow, they’re referring to the JSON file you can download after saving your workflow with a meaningful name. You can also use the Workflow Image feature from the Custom-Scripts custom node to embed your workflow in an image.

Now, let’s start from scratch and simplify your workflow. Here’s how you can clear your workflow in both the new and old UIs:

Now that you have a clean slate, let’s add a node. There are two ways to do this. One way is to right-click on an empty part of your workflow. The other way, which is a bit more intuitive, is to left-click twice on an empty part of the workflow.

Right Click Add Method