Flux 2 KLEIN + ComfyUI Setup

The 2026 Standard. A complete portable environment guide that even beginners can build reliably.

Flux 2 Generated Image

Introduction

Flux 2 KLEIN is the definitive model for local image generation in 2026. This guide explains the construction steps in a "portable configuration" by grouping all files into one folder (e.g., C:\flux-klein) to keep your main system environment clean.

Step 0

Prerequisites

Ensure you have the following environment ready:

  • Python 3.12+ (winget install Python.Python.3.12)
  • Git (winget install Git.Git)
  • Storage: 30GB+ free space (SSD recommended)
  • VRAM: 8GB+ (NVIDIA RTX 3060 or higher)
⚠️ Note: Installation will consume significant C: drive space with temporary files. Beware of Temp capacity shortages.
Step 1

Environment Setup: Building the Foundation

Create a dedicated folder and virtual environment.

# Create a folder on any drive mkdir G:\flux-klein cd G:\flux-klein # Create virtual environment (venv) python -m venv venv # Activate virtual environment .\venv\Scripts\Activate.ps1

Install PyTorch 2.6

Install PyTorch with CUDA support. If your C: drive space is low, change the temporary folder using the following steps:

# (Space shortage fix) Move Temp folder to G: drive $env:TMP = "G:\flux-klein\tmp"; mkdir $env:TMP $env:TEMP = "G:\flux-klein\tmp" # Execute installation pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121 --no-cache-dir
Step 2

ComfyUI & Custom Nodes

Install the UI base and Flux 2 extensions.

# Clone ComfyUI git clone https://github.com/comfyanonymous/ComfyUI.git cd ComfyUI # Install dependencies ..\venv\Scripts\pip.exe install -r requirements.txt ..\venv\Scripts\pip.exe install xformers --index-url https://download.pytorch.org/whl/cu121 # Flux custom nodes cd custom_nodes git clone https://github.com/kijai/ComfyUI-FluxKleinNodes.git cd ComfyUI-FluxKleinNodes ..\..\..\venv\Scripts\pip.exe install -r requirements.txt
Installation Process
Step 3

Model File Placement

Move the four downloaded files to their designated locations.

File Type Filename Path (inside ComfyUI)
Main Model flux-2-klein-4b.safetensors models/unet/
VAE ae.safetensors models/vae/
CLIP clip_l.safetensors models/clip/
T5 Checkpoint t5xxl_fp16.safetensors models/clip/
Step 4

Launch and Run

Create a batch file for easy launching.

@echo off call venv\Scripts\Activate.ps1 python ComfyUI\main.py --listen 127.0.0.1 --port 8188 --lowvram pause

Save the above as launch.bat and run it. Access http://127.0.0.1:8188 in your browser, and you're set!

Flux 2 Sample
🎉 Verification: If "FLUX Klein" appears in the node list on the right side of the screen, you've succeeded.

Troubleshooting

Q. "Failed to import" error

Dependencies for custom nodes were not correctly installed. Re-run pip install -r requirements.txt.

Q. Crash due to lack of VRAM (OOM)

You have the --lowvram option enabled, but if it still crashes, close other browser tabs like Chrome to free up VRAM. On 8GB systems, it's a tight fit, so avoid using other apps simultaneously.

🚑 If you still can't get it to work manually?

Ask Antigravity to "build this environment," and it can set everything up in minutes. However, it's best to handle copying or downloading large model files manually.

Antigravity Persona
Read Antigravity Review

🎨 Check Other Image Models