Skip to main content
FLUX.2 [klein] Training Example

Overview

This example walks through training a style LoRA using a fully synthetic dataset — images generated with FLUX.1 [dev] and various illustrative LoRAs at different strengths.

Output Characteristics

The resulting style has painterly brushwork with strong graphic structure — bold shapes, deep shadows, saturated but limited colors. Edges go between soft and sharp, giving it a hand-painted feel. Style example

Training Pipeline

Training has three parts that need to work together:
  1. Training Data – Source material the model learns from
  2. Configuration Parameters – Training behavior and optimization targets
  3. Sampling Settings – Inference-time extraction of learned characteristics

Part 1: Dataset Preparation Example

Dataset Size Requirements

Optimal dataset size: 20-40 images
  • Below 20 images: Insufficient variation for generalization
  • Above 40 images: Style dilution through excessive variation
Dataset composition should include diverse angles, subjects, and compositions to enable aesthetic generalization rather than scene memorization. This example uses: 27 training images with corresponding caption files. Training Dataset:
Training 1Training 2Training 3Training 4Training 5Training 6Training 7Training 8Training 9Training 10Training 11Training 12Training 13Training 14Training 15Training 16Training 17Training 18Training 19Training 20Training 21Training 22Training 23Training 24Training 25Training 26Training 27

Caption Strategy for Style Training

Captions should only describe what’s in the image — no style descriptors. With a small dataset, the model strongly associates text with visuals. If you leave out style descriptions, it’s forced to learn the visual style implicitly from the images themselves. A unique trigger word (e.g. GFX_IMPR5N) in every caption gives you a way to activate the style at inference without polluting the base model’s vocabulary.

Caption Example

Scorpion training example Caption: GFX_IMPR5N. Close Up Three Quarter Left of a scorpion standing on a rounded rock surface. The scorpion’s body angles from the lower left toward the upper right, with both pincers extended forward and the segmented tail arched upward over the back ending in a stinger. Multiple legs are spread to either side, and the abdomen shows distinct segment divisions. The rock occupies the lower foreground, with the scorpion centered above it against an open background. Omitted descriptors: Solid black background, red highlight, painterly brushstrokes

File Structure

GFX_IMP (1).txt:
GFX_IMP (2).txt:
GFX_IMP (3).txt:
GFX_IMP (4).txt:
GFX_IMP (5).txt:
GFX_IMP (6).txt:
GFX_IMP (7).txt:
GFX_IMP (8).txt:
GFX_IMP (9).txt:
GFX_IMP (10).txt:
GFX_IMP (11).txt:
GFX_IMP (12).txt:
GFX_IMP (13).txt:
GFX_IMP (14).txt:
GFX_IMP (15).txt:
GFX_IMP (16).txt:
GFX_IMP (17).txt:
GFX_IMP (18).txt:
GFX_IMP (19).txt:
GFX_IMP (20).txt:
GFX_IMP (21).txt:
GFX_IMP (22).txt:
GFX_IMP (23).txt:
GFX_IMP (24).txt:
GFX_IMP (25).txt:
GFX_IMP (26).txt:
GFX_IMP (27).txt:

Part 2: Configuration Parameters

Training Guidelines

  • Slow loss decrease: increase to 2e-4
  • Loss oscillation: decrease to 5e-5
  • Baseline starting point: 1e-4
  • Style LoRAs (10-20 images): 1200-1800 steps
  • Character LoRAs (10-15 images): 800-1200 steps
  • Medium datasets (20-40 images): 1200-2000 steps
  • Large datasets (50+ images): 2000-3000 steps
  • Enable quantize: true for 8-bit quantization
  • Reduce resolution to 512x512
  • Use gradient_accumulation_steps: 2 for effective batch size of 2
  • Use high-resolution training images (1024px+)
  • Write detailed, descriptive captions
  • Include variety in poses, lighting, and backgrounds
  • Monitor training duration to prevent overfitting

Default Configuration

Graphic_Impressions Configuration

Parameter Modifications

Here’s what was changed from the defaults and why.

Network Dimensions: 4:2:2:1 Ratio

The larger network (approximately 500MB per model) captures low-frequency details including subtle textures, color relationships, and tonal variations. Smaller dimension use cases:
  • Low detail content (e.g., 2D vector logos)
  • Content-focused training (compositions, high-noise characteristics)
  • Training objectives focused on high-noise elements
Smaller networks prevent interference with low-noise style characteristics. Film grain training exemplifies super low-noise processing, as grain exists at the granular pixel level. Such fine texture learning requires larger network dimensions for adequate capture.

Style-Specific Parameter Adjustments

Timestep Bias: shift
Encourages overfitting of low-frequency information. Textures and colors adopt more rudimentary characteristics, producing unpolished, sketch-like qualities.
Learning Rate: 0.000095
Decreased from default value. Preserves broken, gestural linework from training data rather than applying smoothing.
Weight Decay: 0.00015
Increased from default value. Simplifies shapes and colors, reducing compositional complexity and emphasizing bolder, cleaner forms.

Step Count Selection

The 1500-step checkpoint produced optimal results. Style-specific considerations: The loose, sketch-like aesthetic required reduced training duration. Higher step counts introduced excessive realism, compromising painterly spontaneity. Step count, configuration parameters, and target aesthetic form an interdependent system. No universal optimal configuration exists; effectiveness depends on specific training objectives. Step count comparison

Progressive training visualization: Base model only (left) → 6000 training steps (right)


Part 3: Sampling Configuration

Sampling settings at inference matter just as much as training config — they need to match. Inference Steps: 8 Significantly reduced from typical ranges (20 to 50 steps). Aligns with reduced training duration to preserve soft, painterly, impressionistic qualities.

Output Examples

Output 1Output 2Output 3Output 4Output 5Output 6Output 7Output 8

Adaptation Guidelines

These settings work as starting points for other styles too: Photo-realistic styles:
  • Training steps: 7000
  • Weight decay: 0.00001
  • Sampling steps: 20 to 30
Graphic/vector styles:
  • Network dimensions: 64:32:32:16
  • Dataset size: 15 to 20 images
Experimental applications:
  • Push parameters beyond standard ranges (linear >128, weight decay >0.0002)
  • Accept aesthetic degradation as intentional output characteristic

Additional Resources

FLUX.2 Klein Training

Complete training documentation

Prompting Guide

Optimal prompting strategies for FLUX.2 models

AI-Toolkit Documentation

Advanced configuration options