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)
Flux.1 ComfyUI Hardware Requirements
Minimum VRAM: 8-12GB or above (slower generation speed) Recommended VRAM : 16-24GB
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
Here is a detailed introduction to the different versions of the Flux.1 model:
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, API access only 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) | Available for download Flux.1 Dev GitHub repository (opens in a new tab)、Flux.1 Dev Hugging Face (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) | Available for download Flux.1 Schnell GitHub repository (opens in a new tab)、Flux.1 Schnell on Hugging Face (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)
distilled Flux.1 fp8 version by Kijai
For most users, running the official model smoothly can be quite a challenge. Here, Kijai offer an optimized version of the FLUX.1 model by other authors that may provide a better experience.
https://huggingface.co/Kijai/flux-fp8/tree/main (opens in a new tab)
Version Name | VRAM Requirement | Download Link |
---|---|---|
FLUX.1 [dev] fp8 | Minimum 12GB VRAM | Download Here (opens in a new tab) |
FLUX.1 [schnell] fp8 | May lower than 12GB VRAM. | Download Here (opens in a new tab) |
Flux.1 ComfyUI setup install Guide
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 easy 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
Flux.1 ComfyUI 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)
Part2. Simple to use 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/
Flux dev FP8 Checkpoint version workflow example
Flux Schnell FP8 Checkpoint version workflow example
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)
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)
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
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 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)