---
title: "(LoRA) Fine-Tuning FLUX.1-dev on Consumer Hardware"
description: "FLUX.1-dev can be LoRA fine-tuned on a single consumer GPU by combining QLoRA (4-bit NF4 base transformer via bitsandbytes), 8-bit AdamW, gradient checkpointing, cached VAE latents and precomputed CLIP/T5 text embeddings, so that only the quantized transformer plus adapters sit in GPU memory."
url: "https://swe.quest/articles/lora-fine-tuning-flux-1-dev-on-consumer-hardware-310a6094e7391e33"
canonical: "https://huggingface.co/blog/flux-qlora"
source: "Hugging Face"
published: "2025-06-19"
difficulty: "hard"
kind: "How-to"
reading_minutes: 11
tags: ["model-training","computer-vision","python"]
---

# (LoRA) Fine-Tuning FLUX.1-dev on Consumer Hardware

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2025-06-19, 11 min read, How-to. Original: [https://huggingface.co/blog/flux-qlora](https://huggingface.co/blog/flux-qlora)

## Summary

FLUX.1-dev can be LoRA fine-tuned on a single consumer GPU by combining QLoRA (4-bit NF4 base transformer via bitsandbytes), 8-bit AdamW, gradient checkpointing, cached VAE latents and precomputed CLIP/T5 text embeddings, so that only the quantized transformer plus adapters sit in GPU memory. On an RTX 4090, a rank-4 LoRA at 512x768 peaked around 9 GB VRAM, compared with 26 GB for BF16 LoRA and an estimated ~120 GB for full fine-tuning, and 700 steps took about 41 minutes to learn Alphonse Mucha's style. The guide includes the diffusers training script settings, an embedding precompute script, FP8 training with torchao for faster runs on compatible hardware, and options for loading or merging the trained adapters at inference.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [Model training](https://swe.quest/tags/model-training.md) (AI & ML)
- [Computer vision](https://swe.quest/tags/computer-vision.md) (AI & ML)
- [Python](https://swe.quest/tags/python.md) (Languages)

## Prerequisites

- PyTorch training loops ([easy posts on Model training](https://swe.quest/tags/model-training.md?difficulty=easy))
- diffusion model basics
- LoRA adapters
- quantization basics ([easy posts on Inference & serving](https://swe.quest/tags/inference.md?difficulty=easy))

## Keywords

FLUX.1-dev, QLoRA, diffusers, bitsandbytes, torchao, LoRA, AdamW8bit, RTX 4090

## Related posts

- [Using LoRA for Efficient Stable Diffusion Fine-Tuning](https://swe.quest/articles/using-lora-for-efficient-stable-diffusion-fine-tuning-7bd5416d145ae531.md): Hugging Face · 2023-01-26 · Medium · 7 min read · Model training, Computer vision, Python
  LoRA freezes pretrained weights and trains small rank-decomposition matrices, and diffusers now supports applying it to Stable Diffusion's cross-attention layers for both full fine-tuning and Dreambooth.
- [Fast LoRA inference for Flux with Diffusers and PEFT](https://swe.quest/articles/fast-lora-inference-for-flux-with-diffusers-and-peft-adf61d95e12cb0a4.md): Hugging Face · 2025-07-23 · Hard · 9 min read · Inference & serving, Performance engineering, Computer vision, Python
  Combining Flash Attention 3, torch.compile and TorchAO FP8 quantization with PEFT's LoRA hotswapping speeds up Flux.1-Dev LoRA inference by 2.23x on an H100, and swapping adapters does not trigger recompilation.
- [Making LLMs even more accessible with bitsandbytes, 4-bit quantization and QLoRA](https://swe.quest/articles/making-llms-even-more-accessible-with-bitsandbytes-4-bit-quantization-and-qlora-7bc797d3e83b0ec6.md): Hugging Face · 2023-05-24 · Medium · 14 min read · Inference & serving, Model training, LLMs, Python
  bitsandbytes now integrates 4-bit quantization into Hugging Face transformers, letting most accelerate-loadable models (text, vision, multimodal) run in 4-bit and be fine-tuned via QLoRA, which backpropagates through a frozen 4-bit base model into LoRA adapters.
- [Make LLM Fine-tuning 2x faster with Unsloth and 🤗 TRL](https://swe.quest/articles/make-llm-fine-tuning-2x-faster-with-unsloth-and-trl-5db8c0b6a40cf74e.md): Hugging Face · 2024-01-10 · Medium · 5 min read · Model training, LLMs, Performance engineering, Python
  Unsloth speeds up QLoRA fine-tuning of Llama and Mistral-family models by rewriting PyTorch modules as Triton kernels with manually derived backpropagation.
- [Diffusers welcomes Stable Diffusion 3.5 Large](https://swe.quest/articles/diffusers-welcomes-stable-diffusion-3-5-large-23c0b39797ac94ee.md): Hugging Face · 2024-10-22 · Medium · 6 min read · Computer vision, Inference & serving, Model training, Python
  Stable Diffusion 3.5 Large (8B) and a timestep-distilled Turbo variant are now usable in Diffusers.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
