Flux.1 ComfyUI install guidance, workflow and example
This guide is about how to setup ComfyUI on your Windows computer to run Flux.1. It covers the following topics:
- Introduction to Flux.1
- Overview of different versions of Flux.1
- Flux Hardware Requirements
- How to install and use Flux.1 with ComfyUI
- Related resources for Flux.1, such as LoRA, ControlNet, etc.
In this article, I will introduce different versions of FLux model, primarily the official version and the third-party distilled versions, and additionally, ComfyUI also provides a single-file version of FP8.
- The first part of the tutorial will mainly explain the official version and the third-party distilled versions, which require more related models to be installed.
- The second part will use the FP8 version of ComfyUI, which can be used directly with just one Checkpoint model installed.
Introduction to Flux.1
Flux.1 is a suite of generative image models introduced by Black Forest Labs, a lab with exceptional text-to-image generation and language comprehension capabilities. Flux.1 excels in visual quality and image detail, particularly in text generation, complex compositions, and depictions of hands. The model has refined hand details, significantly improving upon the finger deformities often seen in Stable Diffusion models. Flux.1 has also enhanced image quality, closing the gap with the top generative image software, Midjourney.
Black Forest Labs was founded by Robin Rombach, a former core member of Stability AI.
Official website of Black Forest Labs: https://blackforestlabs.ai/ (opens in a new tab)
Install or update Comfy UI
To utilize Flux.1 within ComfyUI, you'll need to upgrade to the latest ComfyUI model. If you haven't updated ComfyUI yet, you can follow the articles below for upgrading or installation instructions.
Part1. Offcial Versions and distilled of Flux.1
Offical Flux.1 models
I have listed the 3 versions currently released by Flux.1 officially, but the official versions have high hardware requirements. Currently there are many open source versions available with lower hardware requirements, which you can choose according to your needs.
Feature/Version | Flux.1 Pro | Flux.1 Dev | Flux.1 Schnell |
---|---|---|---|
Overview | Cutting-edge performance in image generation with top-notch prompt following, visual quality, image detail, and output diversity. | Open-source model with quality and prompt adherence similar to Pro, more efficient for users with GPUs. | Open-source model, the fastest option for local development and personal use, with quick response and low configuration requirements. |
Visual Quality | Top-tier | Similar to Pro | Good |
Image Detail | Top-tier | Similar to Pro | Good |
Output Diversity | High | Medium | Medium |
Prompt Adherence | High | Medium | Medium |
Hand Detail Optimization | Yes | Yes | Yes |
Pricing (Per Image) | $0.055 | API: $0.03, Free download | API: $0.003, Free download |
License Type | Enterprise solutions, API only | Open-source, FLUX.1-dev Non-Commercial License (opens in a new tab) | Apache2.0 (opens in a new tab), Commercial use allowed |
Model Download | Not available for download | Available for download Flux.1 Dev GitHub repository (opens in a new tab)、Flux.1 Dev Hugging Face (opens in a new tab) | Available for download Flux.1 Schnell GitHub repository (opens in a new tab)、Flux.1 Schnell on Hugging Face (opens in a new tab) |
API Access | FLUX.1 [pro] API (opens in a new tab)、Flux.1 Pro Replicate API (opens in a new tab)、Flux.1 Pro FAL AI API (opens in a new tab)、 Flux.1 Pro Mystic AI API (opens in a new tab) | Flux.1 Dev Replicate API (opens in a new tab)、Flux.1 Dev FAL AI API (opens in a new tab)、Mystic AI (opens in a new tab) | Flux.1 Schnell Replicate API (opens in a new tab)、 Try Flux.1 Schnell on FAL AI (opens in a new tab)、Flux.1 Schnell Mystic AI API (opens in a new tab) |
Use Case | Professional use, enterprise customization | Development and personal use | Personal and commercial use |
For more information, visit the Flux.1 repository: https://github.com/black-forest-labs/flux (opens in a new tab)
Flux.1 ComfyUI Hardware Requirements
Minimum VRAM: 8-12GB or above (slower generation speed) Recommended VRAM : 16-24GB
Currently, there are many open source community versions available with lower hardware requirements, such as GGUF versions, with a minimum VRAM requirement of 6GB.
Flux.1 Official and Open Source Community Version Download Address
Flux.1 currently has 3 models released by the official, but only the Dev and Schnell versions are open source. Due to the high hardware requirements of Flux, many versions have been iterated by the open source community based on the original version, mainly including:
- Black Forest Labs official versions dev (opens in a new tab) 、 schnell (opens in a new tab)
- ComfyUI FP8 versions dev (opens in a new tab) 、schnell (opens in a new tab)
- Kijia FP8 versions flux-fp8 (opens in a new tab)
- lllyasviel BNB NF4 V2 versions dev (opens in a new tab)
- City96 GGUF versions dev (opens in a new tab) 、 schnell (opens in a new tab)
If there are new versions, I will also update them in this article, so don't forget to bookmark this article. The information corresponding to different versions is as follows. Although the table provides download links, I suggest downloading models separately according to different workflows rather than directly downloading the corresponding model files in the table.
Author | Model Name | Commercial Use | ControlNet and LoRA Support | Features | VRAM Requirement | File Size | Download Address |
---|---|---|---|---|---|---|---|
Black Forest Labs | Flux.1 Dev | No | Supported | Need to download CLIP、VAE、UNET | 16GB+ | 23.8GB | Download (opens in a new tab) |
Black Forest Labs | Flux.1 Schnell | Yes | Supported | Need to download CLIP、VAE、UNET | 16GB+ | 23.8GB | Download (opens in a new tab) |
ComfyUI | Flux.1 Dev FP8 | No | Supported | Merge Clip and VAE, only need to download one model | 8GB+ | 17.2GB | Download (opens in a new tab) |
ComfyUI | Flux.1 Schnell FP8 | Yes | Supported | Merge Clip and VAE, only need to download one model | 8GB+ | 17.2GB | Download (opens in a new tab) |
Kijia | Flux.1 Dev FP8 | No | Supported | Merge Clip and VAE, only need to download one model | 8GB+ | Download (opens in a new tab) | |
Kijia | Flux.1 Schnell FP8 | Yes | Supported | Merge Clip and VAE, only need to download one model | 8GB+ | Download (opens in a new tab) | |
lllyasviel | Flux.1 Dev BNB NF4 V1 | No | Supported | Merge Clip and VAE, only need to download one model, need to install ComfyUI_bitsandbytes_NF4 plugin (opens in a new tab) | 6GB+ | 11.5GB | Download (opens in a new tab) |
lllyasviel | Flux.1 Dev BNB NF4 V2 | No | Supported | Merge Clip and VAE, only need to download one model, need to install ComfyUI_bitsandbytes_NF4 plugin (opens in a new tab) | 6GB+ | 12GB | Download (opens in a new tab) |
City96 | Flux.1 Dev GGUF | No | Supported | Need to download CLIP、VAE、UNET , need to install ComfyUI-GGUF plugin (opens in a new tab) | 6GB+ | 12GB | Download (opens in a new tab) |
City96 | Flux.1 Schnell GGUF | Yes | Supported | Need to download CLIP、VAE、UNET , need to install ComfyUI-GGUF plugin (opens in a new tab) | 6GB+ | 12GB | Download (opens in a new tab) |
If you want to use Flux.1 in ComfyUI, you need to upgrade to the latest ComfyUI version. If you haven't updated ComfyUI yet, you can follow the articles below for upgrading or installation instructions.
Below are 4 different versions of Flux.1 workflows. If your computer has a large amount of VRAM, you can consider using the Flux.1 original version workflow. If your computer has less VRAM or performance is not enough, it is recommended to directly use the GGUF version workflow.
Original version Flux.1 ComfyUI workflow guide
The original version workflow is more complex, requiring installation of multiple files. This tutorial includes two parts:
- Download and install CLIP、VAE、UNET models
- Flux.1 original version complex workflow, including Dev and Schnell versions, as well as low-memory version workflow examples
Part 1: Download and install CLIP、VAE、UNET models
Download ComfyUI flux_text_encoders clip models
ComfyUI flux_text_encoders on hugging face (opens in a new tab)
Model File Name | Size | Note | Link |
---|---|---|---|
clip_l.safetensors | 246 MB | Download (opens in a new tab) | |
t5xxl_fp8_e4m3fn.safetensors (Recommended) | 4.89 GB | For lower memory usage (8-12GB) | Download (opens in a new tab) |
t5xxl_fp16.safetensors | 9.79 GB | For better results, if you have high VRAM and RAM(more than 32GB ram). | Download (opens in a new tab) |
- Download clip_l.safetensors
- Download t5xxl_fp8_e4m3fn.safetensors or t5xxl_fp16.safetensors Depend on your VRAM and RAM
- Place downloaded model files in
ComfyUI/models/clip/
folder. Note: If you have used SD 3 Medium before, you might already have the above two models
Download FLux.1 VAE Model
FLUX.1-schnell on hugging face (opens in a new tab)
File Name | Size | Link |
---|---|---|
ae.safetensors | 335 MB | Download (opens in a new tab) |
- Downloaded the
ae.safetensors
model. - Place downloaded model files in
ComfyUI/models/vae
folder. - For identification, you can rename it to
flux_ae.safetensors
;
Download FLux.1 UNET Model
FLUX.1-schnell on hugging face (opens in a new tab)
File Name | Size | Link | Note |
---|---|---|---|
flux1-schnell.safetensors | 23.8GB | Download (opens in a new tab) | For lower memory usage |
flux1-dev.safetensors | 23.8GB | Download (opens in a new tab) | If you have high VRAM and RAM. |
- Downloaded the
flux1-schnell.safetensors
- Place downloaded model files in
ComfyUI/models/unet/
folder
Part 2: Flux.1 ComfyUI Original Workflow Example
ComfyUI offical Flux.1 workflow example: https://comfyanonymous.github.io/ComfyUI_examples/flux/ (opens in a new tab) You can just save the image and load into Comfy!
Flux Dev ComfyUI workflow example
Flux Schnell ComfyUI workflow example
Flux under 12GB VRAM
https://civitai.com/posts/5006398 (opens in a new tab)
Comfy ORG FP8 Checkpoint version
The following Checkpoint models are provide by ComfyUI Org,you only need to download one model file, and you can use it directly.
Model Name | File Size | Download Link |
---|---|---|
flux1-dev-fp8 | 17.2GB | Download (opens in a new tab) |
flux1-schnell-fp8 | 17.2GB | Download (opens in a new tab) |
- Download the model version you need
- Place in
ComfyUI/models/checkpoints/
You can also use the Kijia Flux-FP8 (opens in a new tab),since the file names are similar, it is recommended to rename the file after downloading or create a separate folder to distinguish it.
Flux dev FP8 Checkpoint version workflow example
Flux Schnell FP8 Checkpoint version workflow example
NF4 Version Flux.1 Workflow
Author: lllyasviel (opens in a new tab) First, you need to install the corresponding plugin: https://github.com/comfyanonymous/ComfyUI_bitsandbytes_NF4 (opens in a new tab) Plugin installation instructions can be found at ComfyUI Plugin Installation Guide
NF4 Version Model Download
Model Name | Address |
---|---|
flux1-dev-bnb-nf4 | Download (opens in a new tab) |
lllyasviel made two versions of the NF4 Flux model, please download the V2 version directly, this version has better details and effects
- Install the ComfyUI_bitsandbytes_NF4 plugin (opens in a new tab), if you don't know how to install the plugin, you can refer to ComfyUI Plugin Installation Guide
- Download the flux1-dev-bnb-nf4-v2 (opens in a new tab) file, and place the downloaded file in the
comfyui/models/checkpoints
directory
NF4 Version Flux.1 Workflow Example
GGUF Version Flux.1 Workflow
Author: City96 (opens in a new tab) Project Address: https://github.com/city96/ComfyUI-GGUF (opens in a new tab)
City96 (opens in a new tab) provides multiple GGUF versions of the Flux model, if you don't know which version to download in the corresponding repository, here is a simple guide:
- The larger the number after Q, the more VRAM is required, and the higher the image quality generated. For example, Q2 requires less VRAM but generates lower quality images, while Q8 requires more VRAM but generates higher quality images.
- You can also determine the quality by the size of the model file; generally, larger files mean higher quality and more VRAM required.
Install Plugins and Download Models
- Download the Flux GGUF dev model (opens in a new tab) or the Flux GGUF schnell model (opens in a new tab) and place the model files in the
comfyui/models/unet
directory. - Download t5-v1_1-xxl-encoder-gguf (opens in a new tab), and place the model files in the
comfyui/models/clip
directory. - Download clip_l.safetensors (opens in a new tab) and place the model files in the
comfyui/models/clip
directory. - Download ae.safetensors (opens in a new tab) and place the model files in the
comfyui/models/vae
directory, and rename it toflux_ae.safetensors
. - Install ComfyUI-GGUF (opens in a new tab) plugin, if you don't know how to install the plugin, you can refer to ComfyUI Plugin Installation Guide
GGUF Version Flux.1 Workflow Example
Run Flux.1 online
Here are some online methods provided by Black Forest Labs for utilizing or invoking the Flux.1 model.
huggingface FLUX.1-dev: https://huggingface.co/spaces/black-forest-labs/FLUX.1-dev (opens in a new tab)
huggingface FLUX.1-schnell: https://huggingface.co/spaces/black-forest-labs/FLUX.1-schnell (opens in a new tab)
replicate: https://replicate.com/black-forest-labs (opens in a new tab)
mystic.ai: https://www.mystic.ai/black-forest-labs (opens in a new tab)
fal.ai: https://fal.ai/models/fal-ai/flux/schnell (opens in a new tab)
ComfyUI and Windows System Configuration Adjustments
The following steps are designed to optimize your Windows system settings, allowing you to utilize system resources to their fullest potential. Additionally, when running the Flux.1 model with ComfyUI, please refrain from running other software to minimize memory usage.
Windows Virtual Memory Setting
Trouble shooting
- Running out of memory Warning
Use the single file fp8 version
- Solving Performance Issues
https://github.com/comfyanonymous/ComfyUI/discussions/4457 (opens in a new tab)
Flux.1 resources
Flux GGUF quants
The GGUF quants are there: https://huggingface.co/city96/FLUX.1-dev-gguf (opens in a new tab) Here's the node to load them: https://github.com/city96/ComfyUI-GGUF (opens in a new tab) via: https://www.reddit.com/r/StableDiffusion/comments/1eslcg0/excuse_me_gguf_quants_are_possible_on_flux_now/ (opens in a new tab)
Flux LoRA
https://huggingface.co/XLabs-AI/flux-RealismLora (opens in a new tab) photorealism for FLUX.1-dev model by Black Forest Labs
https://huggingface.co/alvdansen/frosting_lane_flux (opens in a new tab) alvdansen/frosting_lane_flux
https://huggingface.co/alvdansen/softserve_anime (opens in a new tab) alvdansen/softserve_anime
https://huggingface.co/davisbro/half_illustration (opens in a new tab) davisbro/half_illustration
https://huggingface.co/Shakker-Labs/FLUX.1-dev-LoRA-AntiBlur (opens in a new tab) AntiBlur
Flux.1 LoRA and other resources, you can download on civitai (opens in a new tab)
XLabs-AI/flux-lora-collection: https://huggingface.co/XLabs-AI/flux-lora-collection (opens in a new tab)
Tip: The latest version of ComfyUI is prone to excessive graphics memory usage when using multiple FLUX Lora models, and this issue is not related to the size of the LoRA models. Even high-end graphics cards like the NVIDIA GeForce RTX 4090 are susceptible to similar issues. You might consider using the GGUF version of the model, or alternatively, employ Xlab's LoRA to load the ComfyUI workflow as a potential solution to this issue.
Flux LoRA Online training tool
Dead simple web UI for training FLUX LoRA with LOW VRAM (12GB/16GB/20GB) support. https://github.com/cocktailpeanut/fluxgym (opens in a new tab)
Flux LoRA Online training tool
Replicate offers a training tool called "ostris/flux-dev-lora-trainer (opens in a new tab)," which allows you to train your own Lora-style model with a minimum of just 10 images. You can give it a try.
- Pirce: Trainings for this model run on Nvidia H100 GPU hardware, which costs $0.001528 per second.
- How to Train: Read thisdocument (opens in a new tab)
- License: All Flux-Dev LoRAs have the same license as the original base mode for FLUX.1-dev
FLUX.1 Training by Ostris https://colab.research.google.com/drive/1r09aImgL1YhQsJgsLWnb67-bjTV88-W0 (opens in a new tab) Train Flux LoRA by FAI https://fal.ai/models/fal-ai/flux-lora-general-training?a=1 (opens in a new tab) DreamBooth training example for FLUX.1 [dev] https://github.com/huggingface/diffusers/blob/main/examples/dreambooth/README_flux.md (opens in a new tab)
Flux ControlNet
Flux ControlNet collections: https://huggingface.co/XLabs-AI/flux-controlnet-collections (opens in a new tab)
InstanX Flux unnioon Controlnet: https://huggingface.co/InstantX/FLUX.1-dev-Controlnet-Union-alpha (opens in a new tab)
FLUX-Controlnet-Inpainting: https://github.com/alimama-creative/FLUX-Controlnet-Inpainting (opens in a new tab)
Flux IP-Adapter
IP-Adapter checkpoint for FLUX.1-dev model by Black Forest Labs https://huggingface.co/XLabs-AI/flux-ip-adapter (opens in a new tab)
Flux workflow example
Find more workflow example on: https://openart.ai/workflows/all?keyword=flux (opens in a new tab)