Train a FLUX LoRA on Runpod with Ostris AI Toolkit
Ostris AI Toolkit is a free trainer for LoRAs. A LoRA is a small add-on file that teaches a big image model one style or one subject, such as your product. You train one on 15 to 40 of your own pictures, then call it in a prompt with a trigger word. Runpod rents the graphics card by the second.
On our own Runpod account, on 3 December 2026, an RTX 4090 trained a style LoRA for FLUX.2 [klein] 4B in 43 minutes 35 seconds. With the model downloads, the GPU time cost $0.69 on Secure Cloud. Memory peaked at 12.6 GB of the card’s 24 GB.
| Measure | Figure |
|---|---|
| Card | RTX 4090, 24 GB, Secure Cloud |
| Peak memory | 12.6 GB |
| Training, start to saved file | 2,615 s (43 min 35 s) |
| GPU bill, with downloads | $0.69 |
| Finished LoRA | 92.4 MB, from 24 images |
Scroll sideways for all 2 columns
What a LoRA does for your ad images
A LoRA (low-rank adaptation) is a set of small extra layers trained on top of a base model that stays frozen. Ours weighs 92.4 MB beside a 7.8 GB base model.
For ads, that means a brand’s illustration style, a product the model has never seen, or a mascot that matches in every banner. For a person who must look the same in every ad, the AI influencer LoRA guide covers the method.
Ours learned this site’s retro synthwave style from 24 of its article illustrations, each captioned with a line starting with the trigger word adtbretro.
Which Runpod GPU trains a FLUX.2 klein LoRA?
A 24 GB RTX 4090 trains a FLUX.2 [klein] 4B LoRA with room to spare: ours peaked at 12.6 GB. Black Forest Labs, which makes FLUX, calls the 4090 “the sweet spot” in its LoRA guide, and puts an 1,800-step run on one under an hour.
Fine-tune FLUX.2 [klein] with a LoRA
Setup ai-toolkit has a web UI, so you don’t have to edit YAML by hand unless you want to.
Card An RTX 4090 (24 GB) is the sweet spot.
Time An 1800-step run on a 4090 takes under an hour.
That peak fits a 16 GB card’s memory too. Black Forest Labs lists a 12 GB card with 32 GB of system memory for training the 4B base (FLUX.2 klein training docs). The 4B’s model card puts it at about 13 GB. Our 12.6 GB peak sits between the two, with the transformer stored at 8 bits.
For the 9B base, the same docs list a 22 GB card with 64 GB of system memory.
AI Toolkit’s example settings files name the card size: 24 GB for FLUX.1 [dev] and Wan 2.2 14B, 32 GB for Qwen-Image-Edit (AI Toolkit examples).
Runpod lists the RTX 4090 at $0.89 an hour on Secure Cloud and $0.34 on Community Cloud (Runpod pricing).
Rates for Runpod’s other cards sit on our Runpod pricing page, and other providers’ cards on the cloud GPU prices table.
What does a FLUX LoRA cost to train on Runpod?
Our run cost $0.69 on Secure Cloud, or $0.26 at the Community Cloud rate for the same seconds.
| Phase | Time | Secure Cloud | Community Cloud |
|---|---|---|---|
| Model downloads, 15.7 GB | 184 s | $0.045 | $0.017 |
| Training, start to saved LoRA | 2,615 s | $0.647 | $0.247 |
| Both | 2,799 s | $0.692 | $0.264 |
Scroll sideways for all 4 columns
The 1,500 steps themselves took 35 minutes 36 seconds, about 1.4 seconds a step. Installing AI Toolkit is left out, since the Runpod template ships installed.
A network volume keeps the 15.7 GB of model files between pods for about $1.10 a month (Runpod pricing). Without one, each new pod downloads them again: 184 seconds, or $0.045. The volume costs less once you start more than 24 new pods a month ($1.10 divided by $0.045), and each start skips the download.
Runpod gives a new account made with Google through a referral link a one-time credit of $5 to $500 (Runpod referral docs). It needs a first load of $10 or more. Most get $5, and Europe a flat $5. That covers about seven runs like ours on Secure Cloud (Runpod referral code).
Checked every hour: our link opens Runpod with the referral code wi6rwjdp still attached. Last passing check .
How to train a FLUX LoRA on Runpod with AI Toolkit
Ostris maintains an official AI Toolkit template, marked verified in Runpod’s catalogue, with 22,292 deployers on 3 December 2026. The Runpod hub explains the choices behind any pod, from the template to storage.
We installed AI Toolkit from its GitHub repository on a ComfyUI pod instead; the template skips that step.
-
Open the AI Toolkit template and, before you deploy, set the
AI_TOOLKIT_AUTHenvironment variable to your own password. Left unset, the template’s README says, it ispassword, and “anyone who stumbles upon your instance” can control it.Securing the UI
Password setting the environment variable AI_TOOLKIT_AUTH to super secure password
Saving If you press crtl+c while it is saving, it will likely corrupt that checkpoint.
The AI Toolkit README tells users to set a password in AI_TOOLKIT_AUTH before they open the web UI. Ostris, AI Toolkit README: password for the web UI, -
Pick an RTX 4090 on a host with CUDA 13.0 or newer. The template brings a 150 GB container disk and a 50 GB volume at
/mnt. -
Click Connect, then the HTTP service on port 8675, to open AI Toolkit.
-
Under Datasets, upload 15 to 40 images that share one look, the range in Black Forest Labs’ guide; ours had 24. Each image needs a caption, stored as a .txt file with the image’s name (AI Toolkit README). Start every caption with your trigger word, then describe everything visible except the style you are teaching (FLUX.2 klein training docs).
-
Under New Job, enter the Trigger Word, choose FLUX.2 klein 4B base, then set Linear Rank, Steps and sample prompts (our values are below).
Ostris, who writes AI Toolkit, trains a FLUX.2 LoRA in it from the dataset to the first samples Video: How to Train a FLUX.2 LoRA with AI Toolkit, Ostris AI on YouTube, . -
Start the job from the Queue and watch the samples at each checkpoint.
-
Download the LoRA before you stop the pod, which bills every second it runs. The template’s README warns: “Stopping a POD will result in your training being lost.” Never interrupt a checkpoint save: AI Toolkit’s README says pressing Ctrl+C during one “will likely corrupt that checkpoint”.
Our AI Toolkit settings for a FLUX.2 klein style LoRA
Black Forest Labs lists 1,500 to 2,500 steps for a style LoRA. For LoRAs in general it lists a learning rate of 0.00008 to 0.0001, lower for style and higher for characters. Ours sit at the bottom of the step range and the top of the rate range.
Rank sets the LoRA’s size: rank 32 gave our 92.4 MB file. Alpha scales how strongly the LoRA’s changes count, and ours equals the rank, which sets that scale to 1. Quantising stores the model’s numbers at lower precision, so it takes less memory.
Batch 1 means one image per step. bf16 is a lighter number format that halves memory against 32-bit numbers. AdamW 8-bit is the optimiser, the routine that adjusts the LoRA after each step. Guidance sets how closely the samples follow the prompt.
| Setting | Our value |
|---|---|
| Rank and alpha | 32 and 32 |
| Steps | 1,500, batch 1 |
| Learning rate | 0.0001, AdamW 8-bit optimiser |
| Training sizes | 768 and 1024 pixels, bf16 |
| Quantising | Transformer to 8 bits (qfloat8), text encoder none |
| Text embeddings | Cached once before training |
| Checkpoints and samples | Every 500 steps: 3 images, 1024 by 1024, 30 steps, guidance 4 |
Scroll sideways for all 2 columns
What 1,500 steps changed in the images
Our LoRA moved FLUX.2 [klein] 4B from saturated neon to the training set’s flat look, on the same three prompts and seed.
At step 0 the base model drew glossy magenta or bright teal grids under a glowing sun. At step 1,500 the same prompts show a muted navy sky with small stars, a flat striped orange sun and dark mountains. The grid is thin and teal, the objects flat and outlined.
Two of the three also gained garbled letters close to the trigger word, “TTBRETO” and “TBBREET”, on the shopping bag’s label and the camera. None of our captions described any text.
Two errors on a 24 GB card, and the fixes
Both errors hit our install from GitHub on 3 December 2026. The first came while caching the text embeddings, which turns each caption into numbers before training. At the default of 16 captions at a time it ran out of video memory; one at a time fixed it (TEXT_EMBED_CACHE_BATCH = 1 in the toolkit’s dataloader).
With the text encoder quantised, training stopped at the start with Couldn't swap QLinear.weight (optimum-quanto 0.2.4, PyTorch 2.10). An unquantised text encoder fixed it, and memory still peaked at 12.6 GB. In AI Toolkit, that is Text Encoder set to none under Quantize.
How to use the LoRA in ComfyUI
In ComfyUI, the LoRA file goes in models/loras and works with the base model it was trained on. A LoRA loader node joins the two. The trigger word goes in the prompt.
ComfyUI on Runpod sets up the pod, and the AI influencer ComfyUI workflow shows the loader block. AI Toolkit trains Wan 2.2 video LoRAs too; Wan 2.2 and LTX-2 on Runpod runs the model itself.
Can you use your LoRA’s images in ads?
On FLUX.2 [klein] 4B the model allows it: its model card says “Outputs can be used for commercial purposes”, under Apache 2.0.
Licence and hardware
Licence This model is licensed under the Apache 2.0 license.
Outputs Outputs can be used for commercial purposes, as described in the Apache 2.0 license.
Memory The FLUX.2 [klein] 4B Base model fits in ~13GB VRAM and is accessible on NVIDIA RTX 3090/4070 and above.
The 9B base “falls under the FLUX Non-Commercial License” (FLUX.2 klein 9B model card). Runpod rents the card. What you can do with the images depends on the base model’s licence and on your rights to the training images. Read both before a LoRA’s images run in an ad.
Questions about AI Toolkit on Runpod
How long does FLUX LoRA training take on an RTX 4090?
On our own Runpod account on 3 December 2026, a 1,500-step FLUX.2 [klein] 4B LoRA took 43 minutes 35 seconds on an RTX 4090. That excludes the model downloads. Black Forest Labs’ LoRA guide puts an 1,800-step run on a 4090 under an hour.
Can AI Toolkit train a FLUX LoRA on a 16 GB card?
For FLUX.2 [klein] 4B, the memory fits: on our own Runpod account on 3 December 2026 the run peaked at 12.6 GB. Black Forest Labs lists a 12 GB card with 32 GB of system memory, and the model card says about 13 GB. Our timings come from the 4090 only. AI Toolkit’s FLUX.1 [dev] example targets 24 GB.
Is Ostris AI Toolkit free?
Yes, under the MIT licence on GitHub. On Runpod you pay for the card’s time and any storage.
Sources
- GitHub: ostris/ai-toolkit, MIT licence; trains LoRAs for FLUX.2 klein base 4B and 9B, FLUX.2 dev, FLUX.1 dev and Wan 2.2 among others; web UI on port 8675; the AI_TOOLKIT_AUTH environment variable sets a password for the UI; caption text files are named the same as the images with a .txt extension, and [trigger] in a caption is replaced by the trigger word; pressing Ctrl+C while a checkpoint saves will likely corrupt it; the UI menu holds New Job, Queue and Datasets, and the New Job form has Trigger Word, Model Architecture, Quantize for Transformer and Text Encoder, Linear Rank, Steps and Sample. Checked
- GitHub: AI Toolkit example config files, File names carry the card size: train_lora_flux_24gb, train_lora_wan22_14b_24gb, train_lora_qwen_image_edit_32gb. Checked
- Runpod catalogue: AI Toolkit - ostris - ui - official (Runpod template 0fqzfjy6f3), Maintained by Ostris, marked verified, 22,292 deployers and 3,387 in the last 30 days; image ostris/aitoolkit latest; HTTP port 8675; 150 GB container disk; 50 GB pod volume at /mnt; hosts with CUDA 13.0 to 13.3; README says to set AI_TOOLKIT_AUTH, the default password is password, and to save the LoRA before shutting the pod down. Checked
- Black Forest Labs on Hugging Face: Fine-tune FLUX.2 [klein] with a LoRA, Published 4 June 2026: ai-toolkit has a web UI; an RTX 4090 (24 GB) is the sweet spot; an 1800-step run on a 4090 takes under an hour; 15 to 40 images that share one look; one .txt caption per image with the same filename; recommends the Runpod template. Checked
- Black Forest Labs on Hugging Face: FLUX.2 [klein] 4B Base, A 4 billion parameter rectified flow transformer, undistilled, for fine-tuning and LoRA training; licensed under Apache 2.0; outputs can be used for commercial purposes as the Apache 2.0 licence describes; fits in about 13 GB of VRAM, RTX 3090 or 4070 and above. Checked
- Black Forest Labs on Hugging Face: FLUX.2 [klein] 9B Base, Falls under the FLUX Non-Commercial License; released under a non-commercial licence to support third-party research and development. Checked
- Black Forest Labs docs: FLUX.2 [klein] training, 4B on an NVIDIA card with 12 GB VRAM and 32 GB system memory; 9B on 22 GB VRAM and 64 GB system memory; style LoRAs 1,500 to 2,500 steps; LoRA learning rate 8e-5 to 1e-4, lower rates for style and higher for characters; captions describe everything visible except the style or concept taught, with the trigger word used consistently. Checked
- Runpod: Runpod pricing, RTX 4090 at 0.89 dollars an hour on Secure Cloud and 0.34 on Community Cloud, billed by the second; network volume 0.07 dollars per GB a month under 1 TB. Checked
- Runpod docs: Referral, affiliate, and creator programs, A new user who signs up with Google SSO through a referral and loads at least 10 dollars gets a random weighted bonus of 5 to 500 dollars; most get 5 and about 96 per cent get 10 or less; European customers get a fixed 5. Checked
- Runpod console: Our own Runpod account, AI Toolkit LoRA run of 3 December 2026, One Secure Cloud RTX 4090 at 0.89 dollars an hour, AI Toolkit installed from GitHub on the official ComfyUI pod image; FLUX.2 klein base 4B with the Qwen3-4B text encoder; downloads 15.7 GB in 184 seconds; 24 captioned images, rank 32, 1,500 steps; 2,615 seconds from start to saved LoRA, steps 35 minutes 36 seconds; peak 12.6 GB; LoRA file 92.4 MB. Checked