Skip to content

Open Source Midjourney: Deploy FLUX.2 Klein 4B

Deploy open source Midjourney with FLUX.2 Klein 4B (Jan 2026). System specs, ComfyUI + official CLI installs, verify steps, and real OOM fixes.

7 min readIntermediate

Rent Midjourney-class APIs forever, or run Black Forest Labs weights on your own card. Cost, privacy, offline iteration – local wins when the model actually fits. FLUX.2 [klein] 4B landed 15 January 2026, Apache 2.0, aimed at roughly 8GB VRAM. That’s the open source Midjourney path this guide deploys.

You get floors for consumer GPUs, the official flux2 CLI, the ComfyUI portable route most creators should take, verify checks, and the 2026 install failures that still waste an evening.

System requirements for FLUX.2 Klein

Match the row to your GPU before you pull multi-GB files. Official bar for Klein 4B is ~8GB VRAM; timing numbers below are Comfy measurements on high-end cards as of early 2026 (drivers and quants move).

Target Min VRAM Recommended Notes
FLUX.2 Klein 4B distilled ~8 GB 12 GB+ Apache 2.0; short step counts; ~1.2s at ~8.4GB reported on RTX 5090 (Comfy)
FLUX.2 Klein 9B distilled More VRAM than 4B (use FP8 builds) 24 GB class FLUX non-commercial license – not Apache
FLUX.2 [dev] 32B ~19 GB Q4 GGUF (community) FP8 ~32 GB; full BF16 is data-center / H100-class per BFL Bad first install on a single consumer card
FLUX.1 Dev/Schnell (legacy) FP8 ~12 GB / GGUF lower ~22-24 GB FP16 for Dev Still shows up in older graphs; OOM common on 16GB without quant

OS: Windows 10/11, modern Linux, or macOS via community MLX (not the CUDA steps here). NVIDIA + current drivers is the default. Official flux2 wants Python 3.12 and was tested with CUDA 12.9; ComfyUI portable ships its own Python so you skip system interpreter fights. Budget tens of GB of disk for weights + env – exact footprint depends on which safetensors packs you keep.

Official download sources

Pull code and weights only from:

Make the Hugging Face account before the download marathon. Open the model page, accept the license prompt, mint a read token. Skip that and you get 401/gated failures even when people swear “it’s public.” Turns out official mirrors and community packs still gate behind Agree + login a lot of the time.

Funny part: half the battle isn’t the sampler. It’s admitting your GPU is a landlord – rent is paid in VRAM, and multi-reference edits raise the rent without warning.

Install path A – ComfyUI portable (recommended)

Day to day, ComfyUI is less friction than raw CLI: templates, edit graphs, model paths you can see.

  1. Grab the NVIDIA portable .7z, extract with 7-Zip.
  2. Run run_nvidia_gpu.bat. Leave the console up. UI: http://127.0.0.1:8188.
  3. Hit update/update_comfyui.bat so Flux.2 Klein templates actually exist.
  4. Browse Templates → Images → Flux.2 Klein. Load the 4B distilled graph.
  5. Download what the graph asks for: diffusion / UNET pack, Qwen3 4B-class text encoder (e.g. qwen_3_4b.safetensors), flux2-vae.safetensors into models/diffusion_models, models/text_encoders, models/vae.
# Optional pre-download after: pip install -U huggingface_hub
huggingface-cli login
huggingface-cli download black-forest-labs/FLUX.2-klein-4B --local-dir ./FLUX.2-klein-4B
# Copy the .safetensors into ComfyUI/models/diffusion_models

Manual drop beats chasing missing-node popups later. Refresh models or restart once files land.

Install path B – Official flux2 CLI

Use BFL’s reference stack for scripting, batch jobs, or watermark / tracking hooks without a node graph.

git clone https://github.com/black-forest-labs/flux2.git
cd flux2
python3.12 -m venv .venv
# Windows: .venvScriptsactivate
source .venv/bin/activate
pip install -e . --extra-index-url https://download.pytorch.org/whl/cu129 --no-cache-dir

# Optional explicit weight paths (else auto-download):
export KLEIN_4B_MODEL_PATH="/path/to/klein4b"
export AE_MODEL_PATH="/path/to/ae"

PYTHONPATH=src python scripts/cli.py

Per the flux2 README local-install section: Python 3.12, CUDA 12.9 wheel line above. Consumer boxes still run Klein 4B – if cu129 disagrees with your driver, swap the torch index to the CUDA build you actually have.

Legacy FLUX.1 tools (Schnell/Dev era repo): git clone https://github.com/black-forest-labs/flux, Python 3.10 venv, pip install -e ".[all]" – only if you still need that tree.

First-time configuration

Comfy minimum: Klein 4B distilled diffusion file, matching Qwen 4B encoder, Flux2 VAE, steps around 4, start near 1024-class resolution. Leave CFG/guidance on template defaults until one clean image lands.

CLI: one short text-to-image in the interactive session before multi-reference edits. Shipping non-Apache open weights commercially? BFL’s reference path wants export BFL_API_KEY=... and --track_usage – license plumbing documented in their README, not optional folklore. Portal side lives under BFL licensing / bfl.ai.

Verify the install works

ComfyUI: queue one Klein 4B template job. Finished preview, no red borders, no torch.cuda.OutOfMemoryError in the console.

python -c "import torch; print(torch.cuda.is_available(), torch.cuda.get_device_name(0) if torch.cuda.is_available() else 'cpu')"
# Browser: http://127.0.0.1:8188

CLI: finish one scripts/cli.py generation and find the output file. Auto-download stuck? Point KLEIN_4B_MODEL_PATH and AE_MODEL_PATH at folders you already synced.

There’s a weird satisfaction the first time a local sampler finishes and Discord rate limits stop owning your sketch loop – then you ask for multi-image edits and remember VRAM still collects rent.

Common install errors and fixes

  • 401 / gated repo / unable to access on Hugging Face – Browser login, open the exact model page, Agree the license, read token, huggingface-cli login, retry. Flux-family repos trip this constantly.
  • torch.cuda.OutOfMemoryError – Wrong tier or precision. Klein 4B FP8/GGUF, lower resolution, close other GPU apps, Comfy low-VRAM offload. FLUX.1-dev FP16 around 22-24GB is normal; 16GB cards need quant. Full FLUX.2 [dev] 32B BF16 is H100-class territory – community ballparks ~32GB FP8 / ~19GB Q4 GGUF, still not a casual drop-in.
  • CLIPLoader size mismatch / UNETLoader positional dim errors – Wrong encoder or VAE beside flux-2-klein-4b-fp8. People see Llama2 embed_tokens 151936 vs 128256 style blow-ups or UNET dim 64 vs [32,32,32,32] when an old FLUX.1 CLIP stack or mismatched qwen/vae sneaks in. Use the Qwen3 4B + Flux2 VAE pair the Klein template expects; update Comfy if nodes don’t know Klein yet.
  • Missing node types on a workflow JSON – Update ComfyUI, Manager for missing packs, reload the official Klein template. Skip random six-month-old Discord PNGs.

Upgrade and uninstall

Comfy portable:update/update_comfyui.bat, re-pull templates after Flux drops, replace diffusion/encoder/VAE on purpose – don’t mix FLUX.1 VAE into FLUX.2 graphs.

flux2 CLI:git pull, activate venv, rerun the same pip install -e . --extra-index-url ... line. Clear HF hub cache only when filenames changed.

Cleanup: delete the portable folder or the flux2 clone + venv. Wipe weights under ComfyUI/models/** and ~/.cache/huggingface/hub if disk is tight. Portable path installs no Windows service – close the bat window, server dies.

FAQ

Is FLUX.2 Klein 4B really usable as open source Midjourney?

For local, Apache-friendly generation and light editing on consumer GPUs – yes. It will not clone every Midjourney preset. Prompts and LoRAs still do the heavy lifting.

Should I install official flux2 or ComfyUI first?

ComfyUI portable if you want a picture tonight. Twelve-gig card, accept Klein 4B terms on HF, official template, product mockup before dinner. Official CLI when you’re wiring batch jobs, BFL_API_KEY / --track_usage on licensed commercial weights, or diffing samplers against BFL’s reference.

Can I skip Klein and run FLUX.2 [dev] on a single 24GB GPU?

Not as a full BF16 load. Docs treat [dev] as considerable / H100-class VRAM; local attempts lean FP8, GGUF, and often offloaded or remote text encoders. “24GB worked for FLUX.1 Dev” is not a promise here – that path OOMs immediately for a lot of people. Start 4B distilled. Earlier Flux editing context sits in the FLUX.1 Kontext report (arXiv:2506.15742); your installer should still target Klein weights first.

Next: extract ComfyUI portable → run_nvidia_gpu.bat → accept Klein 4B on Hugging Face → Flux.2 Klein template → one image. Custom nodes after that, not before.