Flux 2 Dev FP8 (2026): Local Setup, VRAM and API Code
Unicorn API Team · · 10 min read
Flux 2 Dev FP8 is a version of Black Forest Labs’ FLUX.2 [dev] image model with its weights stored as 8-bit floating point numbers instead of 16-bit ones, so it fits on hardware that cannot hold the full-precision file. That one change explains most of the questions people search for: why it needs a recent NVIDIA card, why it refuses to run on a Mac, why Diffusers will not open it, and why some FP8 builds look worse than others. This guide covers all of that, shows how to run it in ComfyUI, and explains when a hosted Flux 2 API is the more practical choice.
What is Flux 2 Dev FP8?
FLUX.2 [dev] is an open-weights text-to-image and image-editing model from Black Forest Labs, the Freiburg team behind the Flux family. It is a rectified flow transformer with about 32 billion parameters. A rectified flow transformer is a kind of diffusion model: it starts from random noise and, over a series of steps, moves that noise toward an image that matches your prompt. “Dev” means the open, guidance-distilled release intended for research and non-commercial use, as opposed to the hosted Pro and Flex versions.
FP8 describes the number format of the weights. The original checkpoint uses BF16 (bfloat16), which spends two bytes per parameter. FP8 spends one byte. For a 32B model that is the difference between roughly 64 GB and roughly 32 GB of weights, which is why Flux 2 Dev FP8 exists at all: it turns an impractical download into one a single high-end workstation can load.
Plain FP8, scaled FP8 and FP8 mixed
Not every Flux 2 Dev FP8 file is made the same way, and this matters more than most people expect:
- Unscaled FP8 simply casts each BF16 weight to the nearest FP8 value. FP8 (usually the e4m3fn variant, with 4 exponent bits and 3 mantissa bits) has a narrow range, so large and tiny values get clipped or rounded hard. This is where reports of “huge quality loss” usually come from.
- Scaled FP8 stores a scale factor alongside each tensor so values are stretched into the range FP8 handles well, then scaled back at run time. Detail survives much better.
- FP8 mixed, the approach used in the ComfyUI-packaged
flux2_dev_fp8mixedfile, quantizes only some layers. It keeps the double-stream attention blocks in BF16 and quantizes the MLP layers and the fused single-stream linear layers. Attention is the most precision-sensitive part, so leaving it alone keeps output close to the original while still saving most of the memory.
If you only remember one thing: when a Flux 2 Dev FP8 image looks muddy, check which kind of FP8 file you downloaded before blaming the format.
Where the Klein models fit
The wider Flux 2 family also includes FLUX.2 [klein], smaller models in 4B and 9B sizes aimed at consumer hardware. If your search for Flux 2 Dev FP8 started because the dev model will not fit on your machine, a Klein model is worth a look before you start fighting with offloading, though you trade away some of the quality and prompt following of the 32B model.
What hardware do you need for Flux 2 Dev FP8?
Three things decide whether Flux 2 Dev FP8 will run well for you: GPU generation, VRAM and system RAM.
GPU generation
Any modern NVIDIA GPU can store FP8 weights, but only newer architectures (Ada Lovelace, meaning the RTX 40 series, and Hopper or later datacenter cards) have hardware that computes directly in FP8. On older cards such as the RTX 30 series, the software upcasts each FP8 weight to 16-bit before doing the math. You still get the memory saving, but not the speed gain, and the upcasting adds a little overhead.
VRAM and offloading
At one byte per parameter, the transformer weights alone come to around 32 GB. On top of that you need the text encoder (FLUX.2 uses a large language-model text encoder, which is itself big), the VAE that decodes the final image, and working memory for activations. A card with less VRAM than that can still run the model in ComfyUI, because ComfyUI moves parts of the model between system RAM and the GPU as needed. The cost is time: every swap is a trip across the PCIe bus. If you plan to offload, plenty of system RAM matters as much as the GPU.
Apple Silicon
This is the most common dead end. PyTorch on macOS runs through Metal (the MPS backend), and MPS has no float8 data type. A Flux 2 Dev FP8 checkpoint will either refuse to load or fail partway through on an M1, M2, M3 or later chip, no matter how much unified memory you have. Mac users have three realistic paths:
- A GGUF build (for example Q4_K_M or Q8_0), loaded in ComfyUI through a community GGUF node. GGUF dequantizes weights in software, so it does not depend on FP8 hardware.
- The full BF16 weights, if your Mac has enough unified memory to hold them.
- A hosted API, which skips local hardware entirely.
The same logic explains a related complaint: some cloud notebooks and apps list FLUX.2 [dev] in a model menu even though the selected runtime cannot execute it. The model is in the list because the app supports it in general; your particular hardware tier does not.

How to run Flux 2 Dev FP8 in ComfyUI
ComfyUI is the easiest local route because it loads the transformer, text encoder and VAE as separate files and handles offloading for you. The steps:
- Update ComfyUI. FLUX.2 support needs a recent build. An old install will throw errors about unknown model keys.
- Download the diffusion model. Get the FP8 dev file (the fp8mixed build packaged for ComfyUI is the safe default) and put it in
ComfyUI/models/diffusion_models/. It is a.safetensorsfile; some mirrors use the.sftextension, which is the same format. - Download the text encoder recommended for FLUX.2 and place it in
ComfyUI/models/text_encoders/. The FP8 transformer file does not include it. - Download the FLUX.2 VAE into
ComfyUI/models/vae/. A FLUX.1 VAE will not work; the latent formats differ. - Load the official FLUX.2 workflow from ComfyUI’s template browser, then point each loader node at the files you just added.
- Start small. Generate one image at a modest resolution with a fixed seed. Once it works, raise resolution and try reference images for editing.
If generation is very slow, watch the console for messages about the model being partially loaded. That means you are offloading. Closing other GPU applications, lowering resolution, or switching the text encoder to a smaller quantized copy can bring everything onto the card.
Using Flux 2 Dev FP8 with Diffusers
People coming from Python often try to load the FP8 file with Diffusers and get key-mismatch or missing-file errors. The reason is structural. The FP8 checkpoint is usually just the transformer, in the single-file layout ComfyUI uses. Diffusers expects a full pipeline directory: transformer, text encoder, tokenizer, VAE, scheduler and config files.
The working approach:
- Load the transformer on its own using Diffusers’ single-file loading for the FLUX.2 transformer class, if your installed version provides it.
- Load the text encoder, VAE and scheduler from the official FLUX.2 [dev] repository.
- Assemble the pipeline from those parts, passing your FP8 transformer in place of the default one.
Often it is simpler to skip the third-party FP8 file and let Diffusers quantize the official BF16 weights at load time with one of its supported quantization backends. You download more, but the components are guaranteed to match.

FP8 vs BF16 vs GGUF: which Flux 2 Dev build to pick
All three builds run the same model. They differ in memory, speed and which hardware they support.
| Build | Weight size (transformer) | Runs on | Quality vs original | Best for |
|---|---|---|---|---|
| BF16 | About 64 GB | Large NVIDIA cards, high-memory Macs | Reference quality | Research, quality baselines |
| FP8 mixed | Roughly half of BF16 | NVIDIA; fastest on RTX 40 and newer | Very close | Most local NVIDIA setups |
| Unscaled FP8 | Roughly half of BF16 | NVIDIA | Visibly lower on fine detail | Avoid if a scaled or mixed file exists |
| GGUF Q8_0 | Close to FP8 | NVIDIA, Apple Silicon, CPU fallback | Very close | Macs, older GPUs |
| GGUF Q4_K_M | Roughly a quarter of BF16 | Same as above | Noticeably softer | Low-VRAM experiments |
The sizes follow from bits per weight: 16 bits for BF16, 8 for FP8 and Q8_0, around 4 to 5 for Q4_K_M. Real files are a little larger because some layers stay at higher precision.
A practical rule: if you have a recent NVIDIA card, use Flux 2 Dev FP8 in its mixed form. If you are on a Mac or an older card, use GGUF Q8_0 and drop to Q4_K_M only if memory forces you to. Compare a few prompts at a fixed seed against BF16 output (or against someone else’s BF16 sample) to see what you are giving up.
Running Flux 2 through an API instead
Running Flux 2 Dev FP8 locally makes sense if you already own the GPU, want full control over sampling, or are doing research. It makes less sense if you just need good Flux images in an app. You then own driver updates, 30-plus GB downloads, offloading tuning, and the dev license’s non-commercial terms. A hosted model avoids all of it.
Unicorn API does not serve FLUX.2 [dev], but it does serve the hosted Black Forest Labs models built for production use:
- Flux 2 Pro: photoreal detail and strong prompt following at 1K or 2K, with up to 8 reference images. 5 credits per 1K image, 7 per 2K. Aspect ratios 16:9, 1:1, 9:16, 21:9 and 4:3.
- Flux 2 Flex Text To Image: 14 credits per 1K image, 24 per 2K.
- Flux 2 Flex Image To Image: edits from input images, 14 credits per 1K image, 24 per 2K.
Credits cost $0.01 each on a monthly plan (Starter $25, Creator $50, Studio $100, Pro $200 per month) or $0.015 each as top-ups that never expire. So a 1K Flux 2 Pro image costs $0.05 on a plan, and the $25 Starter plan covers 500 of them. Full details are on the pricing page, and you can get the exact price of any request before running it with POST /v1/models/price.
Worked example: a 2K Flux 2 Pro image in Python
Create a key on the API keys page, export it as UNICORN_API_KEY, and run this. It submits a job, polls until it finishes, and prints the image URL.
import os
import time
import requests
API = "https://api.unicornapi.net"
HEADERS = {
"Authorization": f"Bearer {os.environ['UNICORN_API_KEY']}",
"Content-Type": "application/json",
}
body = {
"model": "flux-2-pro",
"input": {
"prompt": (
"A ceramic coffee mug on a walnut desk beside a mechanical keyboard, "
"morning window light, shallow depth of field, product photography"
),
"resolution": "2K",
"aspect_ratio": "16:9",
},
}
resp = requests.post(f"{API}/v1/jobs", headers=HEADERS, json=body, timeout=30)
resp.raise_for_status()
job = resp.json()
job_id = job["id"]
while True:
job = requests.get(f"{API}/v1/jobs/{job_id}", headers=HEADERS, timeout=30).json()
if job["status"] == "succeeded":
print("Image URL:", job["outputs"][0]["url"])
break
if job["status"] == "failed":
raise RuntimeError(f"Job failed: {job}")
time.sleep(2)
That request costs 7 credits. Switch "resolution" to "1K" and it costs 5. Add "n": 4 to get four variations in one call; the price multiplies by four.
The same request from the shell:
curl -s https://api.unicornapi.net/v1/jobs \
-H "Authorization: Bearer $UNICORN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"flux-2-pro","input":{"prompt":"A red fox resting in a snowy forest at dawn, soft light, highly detailed","resolution":"1K","aspect_ratio":"1:1"}}'
Then poll GET /v1/jobs/{id} with the returned id. The API documentation covers every field, and you can try prompts without code in the image playground. If you build with Cursor or Claude Code, the MCP setup lets your agent call these models directly.
Other models worth comparing
Because one key covers the whole model catalog, it is cheap to test a prompt against more than Flux. Nano Banana 2 Lite from Google costs 4 credits per image and takes up to 10 reference images, which suits quick drafts. GPT Image 2.5 Flare from OpenAI goes up to 4K (6, 10 or 16 credits at 1K, 2K and 4K) with up to 16 reference images, and GPT Image 2.5 Sunburst is the slower, more polished variant at the same price.
Common mistakes with Flux 2 Dev FP8
- Trying FP8 on a Mac. No amount of memory fixes the missing float8 support in Metal. Go straight to GGUF or an API.
- Treating the FP8 file as the whole model. You still need the matching text encoder and the FLUX.2 VAE. A FLUX.1 VAE or text encoder produces errors or garbage.
- Grabbing the first FP8 file you find. Unscaled conversions lose fine detail. Prefer the mixed or scaled build.
- Expecting a speed-up on older GPUs. On RTX 30 series and earlier, Flux 2 Dev FP8 saves memory but runs at roughly 16-bit compute speed or slightly slower.
- Running an outdated ComfyUI or Diffusers. FLUX.2 needs recent versions; “unexpected key” errors usually mean an old install.
- Ignoring the license. Quantizing to FP8 does not change the dev model’s non-commercial terms. Check them before you ship anything built on Flux 2 Dev FP8.
- Comparing quality across different seeds. When judging FP8 against BF16 or GGUF, keep seed, steps, guidance and resolution identical, or you are measuring noise.
Should you run Flux 2 Dev FP8 locally or use an API?
Run Flux 2 Dev FP8 locally if you have a recent NVIDIA GPU with plenty of VRAM, you want to experiment with samplers, LoRAs or custom workflows, and your use is covered by the dev license. The mixed FP8 build gives you close to original quality at about half the memory, and once it is set up each image costs only electricity.
Use GGUF if you are on Apple Silicon or an older card and still want local control. Expect slower generation and, at lower quantization levels, softer detail.
Use a hosted model if you need Flux 2 images inside a product, want commercial-friendly terms without licensing work, or simply do not have the hardware. Flux 2 Pro at 5 credits per 1K image is the direct swap for most Flux 2 Dev FP8 use cases, and the Flex models cover cases where you want the Flex variant for text-to-image or edits. You can price every request in advance, so the cost of trying it is known before you send the first job.
Frequently asked questions
Can I run Flux 2 Dev FP8 on a Mac with an M1, M2 or M3 chip?
Not as is. PyTorch's Metal backend has no float8 support, so the FP8 checkpoint fails to load or crashes on Apple Silicon. Your realistic options are a GGUF quantized build, which ComfyUI can load through a community node, the full BF16 weights if your Mac has a lot of unified memory, or a hosted API such as Flux 2 Pro, which runs on remote GPUs and needs nothing local.
How much VRAM does Flux 2 Dev FP8 need?
The transformer alone has about 32 billion parameters, and FP8 stores one byte per parameter, so the weights take roughly 32 GB before you add the text encoder, the VAE and working memory. Cards with less VRAM can still run it in ComfyUI by offloading parts of the model to system RAM, but each image takes noticeably longer. More system RAM helps a lot when you offload.
Why won't the Flux 2 Dev FP8 file load in Diffusers?
The single FP8 file is usually only the diffusion transformer, saved in the layout ComfyUI expects. Diffusers wants a full pipeline folder with the transformer, text encoder, VAE, scheduler and config files. Load the transformer from the single file, pull the other components from the official repository, and check that your Diffusers version supports FLUX.2. Otherwise use the BF16 repository with Diffusers' own quantization options.
Is FP8 quality noticeably worse than BF16 for Flux 2 Dev?
For most prompts the difference is small, especially with the mixed FP8 build that keeps the most sensitive layers in BF16. You are more likely to notice it in fine text, small faces and subtle gradients. Naive unscaled FP8 conversions lose more detail than scaled or mixed ones, so the file you download matters as much as the format. Compare the same seed in both precisions before deciding.
Can I use Flux 2 Dev outputs commercially?
FLUX.2 [dev] is released as open weights under a non-commercial license from Black Forest Labs, and quantizing the file to FP8 does not change the license. Read the current license terms before using it in a product. If you need straightforward commercial use without licensing work, the hosted Flux 2 Pro and Flex models are the usual route.
Is Flux 2 Dev available on Unicorn API?
No. Unicorn API offers the hosted Flux 2 models from Black Forest Labs instead: Flux 2 Pro at 5 credits per 1K image and 7 per 2K, plus Flux 2 Flex for text-to-image and image-to-image at 14 credits per 1K image and 24 per 2K. You call them with one API key and never download weights or manage VRAM.