Install ComfyUI: Difference between revisions

From A Technological Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 2: Line 2:


== What is ComfyUI ==
== What is ComfyUI ==
'''ComfyUI''' is a powerful and modular graphical interface for running and creating '''Stable Diffusion''' workflows.
'''ComfyUI''' is a powerful and modular graphical interface for running and creating '''Stable Diffusion''' workflows for generating images and videos from text or images.


It allows you to build complex diffusion pipelines visually by connecting nodes, without needing to write code.
It allows you to build complex diffusion pipelines visually by connecting nodes, without needing to write code. It is designed for flexibility, performance, and transparency, letting you see exactly how each part of a [[Diffussion models|diffusion model]] (VAE, CLIP, sampler, etc.) is connected and processed.
It is designed for flexibility, performance, and transparency — letting you see exactly how each part of a diffusion model (VAE, CLIP, sampler, etc.) is connected and processed.
 
Typical uses include:
 
* Generating AI images from prompts
* Testing new model configurations
* Combining multiple models, VAE encoders, or samplers
* Automating image generation pipelines
 
ComfyUI is often used by AI artists, researchers, and developers who want both power and control over their diffusion workflows.


= Installation =
= Installation =
Line 41: Line 31:
</syntaxhighlight>
</syntaxhighlight>


Run ComfyUI:
'''Install NVIDIA dependencies'''<syntaxhighlight lang="bash">
pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu130
pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu130
 
</syntaxhighlight>Run ComfyUI:


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
Line 51: Line 45:
'''http://127.0.0.1:8188'''
'''http://127.0.0.1:8188'''


== Installing on windows ==
== Installing and running on windows ==


Install '''Python 3.10+''' from https://www.python.org/downloads/
# [https://github.com/comfyanonymous/ComfyUI/releases/latest/download/ComfyUI_windows_portable_nvidia.7z Download comfyUI]
# Unzip the downloaded file
# Double click either run nvidia_gpu.bat or run cpu.bat depending on your computer’s configuration to launch ComfyUI.
# You can access to http://127.0.0.1:8188 when you see it in the opened window.


During installation, enable '''Add Python to PATH'''.
----


Install '''Git for Windows''' from https://git-scm.com/download/win
= Understanding workflows and nodes =


Open a terminal (PowerShell) and run:
== What workflows are ==
 
A '''workflow''' in ComfyUI is a graph that defines how data (text prompts, models, images, etc.) flows between nodes to generate an image.
<syntaxhighlight lang="bash">
git clone https://github.com/comfyanonymous/ComfyUI.git
cd ComfyUI
pip install -r requirements.txt
python main.py
</syntaxhighlight>


After installation, ComfyUI will start locally and open in your web browser.
Example workflow on image to video:
[[File:ComfUI example i2v.png|none|thumb|484x484px]]
Each workflow is saved as a .json file that can be shared or loaded into ComfyUI. They are stored in your '''ComfyUI/user/default/workflows''' folder.


= Executing ComfyUI =
You can import a workflow by dragging directly into the interface:


You can start ComfyUI in different ways:
* a JSON file
 
* media (image or video) generated with comfyUI
=== Standard mode ===
<syntaxhighlight lang="bash">
python main.py
</syntaxhighlight>


=== With a specific model or workflow ===
== What nodes are ==
<syntaxhighlight lang="bash">
Nodes are the building blocks of a workflow. Each node performs a specific task, such as:
python main.py --extra-model-paths=/path/to/models
python main.py --disable-auto-launch
</syntaxhighlight>
 
Once running, open your browser and go to:
<syntaxhighlight lang="other">
http://localhost:8188
</syntaxhighlight>
 
= Understanding workflows and nodes =
 
== What are workflows ==
A '''workflow''' in ComfyUI is a graph that defines how data (text prompts, models, images, etc.) flows between nodes to generate an image.
Each workflow is saved as a '''.json''' file that can be shared or loaded into ComfyUI.
 
You can import a workflow by dragging the JSON file directly into the interface.
 
== What are nodes ==
'''Nodes''' are the building blocks of a workflow. Each node performs a specific task, such as:


* loading a model
* loading a model
Line 110: Line 80:
Common node types include:
Common node types include:


'''Checkpoint Loader''' - loads the main diffusion model (e.g. SDXL)
'''Checkpoint Loader''' - loads the main diffusion model


'''VAE Loader''' - loads a Variational Autoencoder
'''VAE Loader''' - loads a Variational Autoencoder
Line 120: Line 90:
'''Save Image''' - exports the final result
'''Save Image''' - exports the final result


You can right-click the canvas to add new nodes or search for them by name.
You can double-click on the canvas to add new nodes or search for them by name.
 
----


= ComfyUI folder structure =
= ComfyUI folder structure =
Line 126: Line 98:
ComfyUI organizes its files in a clear directory structure:
ComfyUI organizes its files in a clear directory structure:


'''/ComfyUI/models/checkpoints''' - main diffusion models (e.g. SDXL, SD1.5, SD2.1)
'''/ComfyUI/models/checkpoints''' - main diffusion models


'''/ComfyUI/models/vae''' - Variational Autoencoders (VAEs)
'''/ComfyUI/models/vae''' - Variational Autoencoders (VAEs)
Line 134: Line 106:
'''/ComfyUI/models/upscale''' - upscaling models
'''/ComfyUI/models/upscale''' - upscaling models


'''/ComfyUI/models/controlnet''' - ControlNet models for guiding generation
'''/ComfyUI/custom_nodes''' - external or user-made node scripts


'''/ComfyUI/custom_nodes''' - external or user-made node scripts
'''/ComfyUI/output''' - generated media
 
'''ComfyUI/user/default/workflows''' - saved workflow files in JSON format
 
= Loading assets on your workflow =
Depending on how much VRAM does your graphics card has and how much RAM you have, you will be able to use resources up to the total amount of memory you have.
 
'''Example'''
 
* Computer available memory 56GB, distributed in:
** graphics card VRAM: 24GB
** computer RAM: 32GB
 
* Resources on nodes 38,5GB:
** Model wan2.2_i2v_high_noise_14B_Q8_0.gguf : 15GB
** Model wan2.2_i2v_low_noise_14B_Q8_0.gguf : 15GB
** LoRA wan2.2_i2v_A14b_high_noise_lora_rank64_lightx2v_4step_1022.safetensors: 0,6GB
** LoRA wan2.2_i2v_A14b_low_noise_lora_rank64_lightx2v_4step_1022.safetensors: 0,7GB
** VAE wan_2.1_vae.safetensors: 0,3GB
** Text Encoder umt5_xxl_fp8_e4m3fn_scaled.safetensors: 6,7GB
* ComfyUI processing and temporary data: 10-20% of assets
 
 
With this configuration, we would fit the requirements, as we have 56GB of memory and the process requires less than 50GB.
 
If comfyUI stops abruptly, it's probably due to an excessive usage of memory. You will have to reduce the size of the assets you are using.


'''/ComfyUI/input''' - user input images and resources
= Assets resources =


'''/ComfyUI/output''' - generated images
== Diffusion models ==
'''Wan GGUFs (Models)'''


'''/ComfyUI/workflows''' - saved workflow files in JSON format
https://huggingface.co/bullerwins/Wan2.2-I2V-A14B-GGUF/tree/main


'''/ComfyUI/web''' - interface and static assets


= Resources for models and components =


You can expand ComfyUI by downloading compatible models and components from community repositories:


== Diffusion models ==
== Diffusion models ==
Line 189: Line 184:


https://huggingface.co/models?q=controlnet
https://huggingface.co/models?q=controlnet
[[Category:AI: Generate media locally]]
[[index.php?title=Category:AI: Generate media locally]]

Revision as of 08:30, 3 November 2025

ComfyUI overview

What is ComfyUI

ComfyUI is a powerful and modular graphical interface for running and creating Stable Diffusion workflows for generating images and videos from text or images.

It allows you to build complex diffusion pipelines visually by connecting nodes, without needing to write code. It is designed for flexibility, performance, and transparency, letting you see exactly how each part of a diffusion model (VAE, CLIP, sampler, etc.) is connected and processed.

Installation

Installing on linux

Make sure you have Python 3.10 or higher and git installed:

sudo apt install python3 python3-venv python3-pip git

Clone the ComfyUI repository:

git clone https://github.com/comfyanonymous/ComfyUI.git
cd ComfyUI

Create a virtual environment and install dependencies:

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Install NVIDIA dependencies

pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu130
pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu130

Run ComfyUI:

python main.py

The interface will open in your browser at

http://127.0.0.1:8188

Installing and running on windows

  1. Download comfyUI
  2. Unzip the downloaded file
  3. Double click either run nvidia_gpu.bat or run cpu.bat depending on your computer’s configuration to launch ComfyUI.
  4. You can access to http://127.0.0.1:8188 when you see it in the opened window.

Understanding workflows and nodes

What workflows are

A workflow in ComfyUI is a graph that defines how data (text prompts, models, images, etc.) flows between nodes to generate an image.

Example workflow on image to video:

Each workflow is saved as a .json file that can be shared or loaded into ComfyUI. They are stored in your ComfyUI/user/default/workflows folder.

You can import a workflow by dragging directly into the interface:

  • a JSON file
  • media (image or video) generated with comfyUI

What nodes are

Nodes are the building blocks of a workflow. Each node performs a specific task, such as:

  • loading a model
  • encoding a text prompt
  • generating noise
  • decoding the latent image

Nodes are connected through inputs and outputs, creating a chain of operations that define the diffusion process.

Common node types include:

Checkpoint Loader - loads the main diffusion model

VAE Loader - loads a Variational Autoencoder

CLIP Text Encoder - processes text prompts

Sampler - controls the diffusion steps

Save Image - exports the final result

You can double-click on the canvas to add new nodes or search for them by name.


ComfyUI folder structure

ComfyUI organizes its files in a clear directory structure:

/ComfyUI/models/checkpoints - main diffusion models

/ComfyUI/models/vae - Variational Autoencoders (VAEs)

/ComfyUI/models/clip - CLIP encoders for text and image embeddings

/ComfyUI/models/upscale - upscaling models

/ComfyUI/custom_nodes - external or user-made node scripts

/ComfyUI/output - generated media

ComfyUI/user/default/workflows - saved workflow files in JSON format

Loading assets on your workflow

Depending on how much VRAM does your graphics card has and how much RAM you have, you will be able to use resources up to the total amount of memory you have.

Example

  • Computer available memory 56GB, distributed in:
    • graphics card VRAM: 24GB
    • computer RAM: 32GB
  • Resources on nodes 38,5GB:
    • Model wan2.2_i2v_high_noise_14B_Q8_0.gguf : 15GB
    • Model wan2.2_i2v_low_noise_14B_Q8_0.gguf : 15GB
    • LoRA wan2.2_i2v_A14b_high_noise_lora_rank64_lightx2v_4step_1022.safetensors: 0,6GB
    • LoRA wan2.2_i2v_A14b_low_noise_lora_rank64_lightx2v_4step_1022.safetensors: 0,7GB
    • VAE wan_2.1_vae.safetensors: 0,3GB
    • Text Encoder umt5_xxl_fp8_e4m3fn_scaled.safetensors: 6,7GB
  • ComfyUI processing and temporary data: 10-20% of assets


With this configuration, we would fit the requirements, as we have 56GB of memory and the process requires less than 50GB.

If comfyUI stops abruptly, it's probably due to an excessive usage of memory. You will have to reduce the size of the assets you are using.

Assets resources

Diffusion models

Wan GGUFs (Models)

https://huggingface.co/bullerwins/Wan2.2-I2V-A14B-GGUF/tree/main



Diffusion models

https://civitai.com - community hub for diffusion models (SD1.5, SDXL, LoRA, etc.)

https://huggingface.co/models - official and community models

https://modelscope.cn/models - AI models for various domains

GGUF models

GGUF format is used for quantized models optimized for inference.

You can find them at:

https://huggingface.co - TheBloke profile (repository of GGUF models)

https://github.com/ggerganov/llama.cpp - technical details on the GGUF format

VAE (Variational Autoencoders)

VAEs are used to improve image color, clarity, and detail.

Common sources:

CLIP models

CLIP encoders transform text or images into embeddings.

They are usually included with diffusion models, but standalone versions can be found on:

https://huggingface.co/openai/clip-vit-large-patch14

LoRAs and ControlNets

These extend model behavior for styles, poses, or compositions. Available on:

https://civitai.com/models (LoRA and ControlNet section)

https://huggingface.co/models?q=controlnet index.php?title=Category:AI: Generate media locally