FLUX LOCAL SETUP MASTER GUIDE

Production Guide ComfyUI V0.3+ Tested & Maintained by Elmehdi • FluxDraw Engineering
Complete Local Setup • Windows & Linux • 12 min read

When Black Forest Labs released FLUX.1, it set a new ceiling for text-to-image quality. The spatial coherence, prompt comprehension, and ability to spell complete English sentences on street signs or coffee mugs blew away everything we had been hacking together with SDXL and Cascade.

However, setting it up locally in ComfyUI has proven to be a minefield. Between the split weights (CLIP-L and T5-XXL), conflicting quantization formats (GGUF, NF4, FP8), and confusing memory arguments, half the developers attempting a local build end up staring at terminal errors or frozen viewports.

In this definitive guide, I will take you from a bare desktop to your first pristine 1024×1024 FLUX render. We will configure the proper folder structure, install the right dependencies, wire the nodes from scratch, and tune your startup flags so you never hit a random CUDA out-of-memory crash.

1. Choosing Your Flavour: FLUX.1 [dev] vs [schnell]

Before downloading a single gigabyte, you need to decide which model variant fits your machine and your workflow:

  • FLUX.1 [dev]: The flagship 12-billion parameter model. It uses guidance distillation and requires between 20 and 28 sampling steps with a guidance scale around 3.5. It delivers top-tier micro-textures, photorealistic skin pores, and intricate hand anatomy. License: Non-commercial research/personal use.
  • FLUX.1 [schnell]: The distilled 4-step version. It was trained to produce finished images in just 4 iterations with guidance scale set to 1.0. While fine detail on distant backgrounds is slightly softer than Dev, it renders in one-fourth of the time and runs under an Apache 2.0 open commercial license.
💡 My Personal Rule of Thumb: Use Schnell when you are rapidly brainstorming ideas, mocking up client moodboards, or building commercial API products. Switch to Dev when you are generating the final hero image that will be color-graded or printed.

2. Hardware Reality Check

FLUX is a Diffusion Transformer (DiT), which demands significantly more compute bandwidth than the legacy UNet architecture used in Stable Diffusion 1.5 and SDXL. Here is the realistic hardware tier breakdown:

Your Hardware (VRAM) Recommended Model Format Text Encoder Variant Average Render Time (1024x1024)
6GB VRAM (RTX 3050, 2060) GGUF Q4_K_S T5-XXL FP8 or Q4 GGUF 90 – 130 seconds
8GB – 10GB VRAM (RTX 3060, 3070, 4060) GGUF Q4_K_M or NF4 V2 T5-XXL FP8 35 – 55 seconds
12GB – 16GB VRAM (RTX 3060 12GB, 4070, 4080) FP8 (e4m3fn) or GGUF Q8_0 T5-XXL FP8 18 – 28 seconds
24GB VRAM (RTX 3090, 4090) Pure FP16 or FP8 Dev T5-XXL FP16 / FP8 9 – 14 seconds

3. Step 1: Installing the ComfyUI Foundation

You have two paths to install ComfyUI: the official portable standalone zip (Windows) or the Git clone method (Windows & Linux). If you are on Windows, I strongly recommend the Portable Standalone build because it isolates Python, PyTorch, and CUDA libraries in a self-contained directory that won't mess with your system's global Python environment.

Option A: Windows Portable Build (Easiest)

  1. Head to the official ComfyUI GitHub Releases page and download the ComfyUI_windows_portable_nvidia_cu121_or_cpu.7z package.
  2. Extract the archive to the root of a fast NVMe SSD (e.g., C:\AI_Tools\ComfyUI_windows_portable). Avoid long paths with special characters or spaces.
  3. Do not run the batch file just yet—we need to populate our model folders first.

Option B: Git Clone with Dedicated Virtual Environment

# 1. Clone the official repository
git clone https://github.com/comfyanonymous/ComfyUI.git
cd ComfyUI

# 2. Create and activate a clean virtual environment
python -m venv venv
# On Windows:
venv\Scripts\activate
# On Linux:
source venv/bin/activate

# 3. Install PyTorch with CUDA 12.4 support
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124

# 4. Install ComfyUI dependencies
pip install -r requirements.txt

4. Step 2: Downloading the Required Model Files

Unlike old SD 1.5 checkpoints where the text encoder, UNet, and VAE were all packed inside a single .safetensors file, FLUX is modular. You need three distinct components stored in their dedicated subdirectories:

Component A: The Diffusion Model (DiT)

Place your diffusion model in: ComfyUI/models/unet/ (or models/checkpoints/ if using an all-in-one NF4 file).

  • For 12GB+ GPUs: Download flux1-dev-fp8.safetensors (~11.9 GB) or flux1-schnell-fp8.safetensors.
  • For 6GB–10GB GPUs: Download flux1-dev-Q4_K_S.gguf (~6.8 GB) from City96 on Hugging Face.

Component B: The Text Encoders

Place both text encoders in: ComfyUI/models/clip/

  • clip_l.safetensors (~246 MB): The lightweight OpenAI CLIP-L model responsible for basic keyword understanding.
  • t5xxl_fp8_e4m3fn.safetensors (~4.9 GB): The heavy Google T5-XXL language model. Never download the 9.5GB FP16 version unless you have dual 24GB GPUs. The FP8 version gives identical generation results while halving the memory footprint.

Component C: The Variational Autoencoder (VAE)

Place the VAE file in: ComfyUI/models/vae/

  • ae.safetensors (~335 MB): The official 16-channel FLUX autoencoder.
⚠️ Common File Placement Trap: Ensure your t5xxl and clip_l files are inside ComfyUI/models/clip/, NOT inside models/text_encoders/. Placing them in the wrong directory will cause the DualCLIPLoader dropdown to show up empty.

5. Step 3: Installing the ComfyUI-GGUF Extension

If you are running GGUF quants (essential for GPUs with 10GB or less VRAM), ComfyUI needs a custom node to interpret the quantization headers:

  1. Open your terminal inside ComfyUI/custom_nodes/.
  2. Run: git clone https://github.com/city96/ComfyUI-GGUF.git
  3. If using the portable build, open update\update_comfyui.bat to ensure all dependencies are resolved.

6. Step 4: Building the Native FLUX Workflow

Now let's wire the nodes inside the ComfyUI canvas. Clear the default workflow by clicking Clear on the right-hand panel, then build the pipeline as follows:

1. Load the Models

  • UNet Loader (or Unet Loader GGUF): Select your flux1-dev-fp8.safetensors or flux1-dev-Q4_K_S.gguf.
  • DualCLIPLoader: Set clip_name1 to t5xxl_fp8_e4m3fn.safetensors and clip_name2 to clip_l.safetensors. Set the type parameter to flux.
  • Load VAE: Select ae.safetensors.

2. Configure the Conditioning

  • Add two CLIP Text Encode (Prompt) nodes.
  • Connect the CLIP output of the DualCLIPLoader to the clip input of both text encoders.
  • Positive Prompt: Type your descriptive scene in the first encoder.
  • FluxGuidance Node: Create a FluxGuidance node. Connect the positive prompt's CONDITIONING output to the conditioning input of FluxGuidance. Set the guidance value to 3.5 (for Dev) or 1.0 (for Schnell).
  • Negative Prompt: Leave the second encoder empty (FLUX was not trained on negative prompts, but ComfyUI requires a conditioning input). Connect it directly to the negative input of the sampler.

3. The Latent & Sampler Core

  • EmptySD3LatentImage: Add this node to define the resolution. Set width to 1024 and height to 1024, batch_size to 1.
  • KSampler:
    • Connect model from your UNet Loader.
    • Connect positive from the FluxGuidance node output.
    • Connect negative from your empty CLIP Text Encode.
    • Connect latent_image from EmptySD3LatentImage.
    • Parameters: seed: random • steps: 20 • cfg: 1.0 • sampler_name: euler • scheduler: simple • denoise: 1.0.
  • VAE Decode: Connect the LATENT output from KSampler to samples on VAE Decode, and connect vae from your Load VAE node.
  • Save Image: Connect the decoded IMAGE to a standard Save Image node.

7. Command Line Arguments: Unlocking Maximum VRAM Efficiency

Depending on your graphics card, open your run_nvidia_gpu.bat file in a text editor (Notepad) and modify the startup line:

For 6GB – 8GB GPUs:

.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --lowvram --preview-method auto

For 12GB – 16GB GPUs:

.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --normalvram --preview-method auto

For 24GB GPUs (Fastest):

.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-build --highvram --gpu-only

8. Troubleshooting the Most Frustrating Setup Errors

1. DualCLIPLoader dropdown is completely blank

Cause: Your CLIP files are located in the wrong directory or are corrupted during download.
Fix: Verify that clip_l.safetensors and t5xxl_fp8_e4m3fn.safetensors are in ComfyUI\models\clip\. Restart ComfyUI completely.

2. "CUDA error: out of memory during VAE decode"

Cause: The 16-channel FLUX VAE requires a massive memory surge at the very end of generation when reconstructing the full-resolution image.
Fix: Replace the standard VAE Decode node with VAE Decode (Tiled). Set tile_size to 512. This processes the latent image in smaller patches, using less than 600MB of temporary VRAM.

3. The prompt is completely ignored, producing random abstract noise

Cause: The type toggle on the DualCLIPLoader is mistakenly set to sd3 or sdxl instead of flux.
Fix: Switch the selector to flux. This ensures ComfyUI routes the prompt tokens through both the CLIP and T5 layers with the correct positional embeddings.

Frequently Asked Questions

Can I use FLUX in Automatic1111 or Forge?
While SD-WebUI Forge has experimental support for FLUX, ComfyUI remains the industry standard. ComfyUI receives first-day updates, custom node support (like GGUF quants, ControlNets, and TeaCache), and handles sub-graph memory offloading significantly more reliably on sub-16GB GPUs.
Why does FLUX recommend CFG 1.0 instead of 7.0?
Unlike legacy diffusion models that use Classifier-Free Guidance (CFG) by sampling positive and negative prompts simultaneously, FLUX Dev uses Guidance Distillation. The guidance value is controlled through the dedicated FluxGuidance node (typically set to 3.5). Setting traditional CFG above 1.0 in KSampler will cause double-guidance calculations, resulting in burnt highlights and distorted contrast.
How much disk space do I need for a complete FLUX setup?
Plan for roughly 25GB to 35GB of free space. A lean GGUF setup requires ~7GB for the DiT model, ~5.2GB for both text encoders, ~350MB for the VAE, and ~5GB for ComfyUI, PyTorch, and CUDA dependencies.

Final Thoughts

Running FLUX locally takes some patience on initial setup, but once your weights are organized and your batch scripts are configured with the proper flags, you have complete ownership over one of the most powerful visual engines ever built. Zero credit limits, zero cloud queues, and zero unexpected privacy changes.

Need help with a custom node setup or hitting an unexpected trace? Join our community discussions or leave a comment on the FluxDraw Contact Page.

Post a Comment

0 Comments