FLUX ControlNet LoRA - Brightness Control (10k @ 1024×1024)
A Control LoRA model trained on FLUX.1-dev to control image generation through brightness/grayscale information. This model uses LoRA (Low-Rank Adaptation) combined with ControlNet architecture for efficient control, providing an ultra-lightweight control mechanism for FLUX's powerful 12B parameter model.
Model Description
This Control LoRA enables brightness-based conditioning for FLUX image generation. By providing a grayscale image as input, you can control the brightness distribution and lighting structure while maintaining creative freedom through text prompts.
Key Features:
🎨 Excellent brightness and pattern control with FLUX's superior quality
🚀 Compact model size: ~685MB per checkpoint
⚡ Fast inference: Leverages FLUX's optimized architecture
💡 Fixed conditioning strength: Baked into LoRA weights during training
🔄 Compatible with Diffusers: Uses standard FluxControlPipeline
📦 Multiple checkpoints: Track training progression at 25%, 50%, 75%, 100%
🖼️ Native FLUX resolution: Trained at 1024×1024
🎯 XLabs-proven parameters: Validated hyperparameters for stability
Intended Uses:
Artistic QR code generation
Image recoloring and colorization
Lighting control in text-to-image generation
Brightness-based pattern integration
Watermark and subtle pattern embedding
Photo enhancement and stylization
Training Details
Training Data
Trained on 10,000 samples from latentcat/grayscale_image_aesthetic_3M:
High-quality aesthetic images
Paired with grayscale/brightness versions
Native resolution: 1024×1024
Training Configuration
Parameter
Value
Base Model
black-forest-labs/FLUX.1-dev
Model Size
12B parameters
Architecture
FLUX Control LoRA
LoRA Rank
128
Training Resolution
1024×1024
Training Steps
1,250 (1 epoch)
Batch Size
1 per device
Gradient Accumulation
8 (effective batch: 8)
Learning Rate
2e-5 constant (XLabs proven)
LR Warmup
10 steps (XLabs proven)
Weight Decay
0.01 (XLabs proven)
Max Grad Norm
1.0 (XLabs proven)
Empty Prompts
20%
Init Method
Default
Mixed Precision
BF16
Hardware
NVIDIA H100 80GB
Training Time
~3h 14min
Memory Usage
~45GB VRAM
Final Loss
~0.08-0.12
XLabs Proven Parameters
This model uses hyperparameters validated by XLabs-AI for FLUX ControlNet training:
Learning Rate 2e-5: 5x lower than typical SDXL rates, critical for FLUX's 12B parameters
Warmup 10 steps: Gradual LR increase for training stability
Weight Decay 0.01: L2 regularization to prevent overfitting
Max Grad Norm 1.0: Gradient clipping to prevent explosion
These parameters provide stable training and prevent divergence in large models.
1import torch
2import sys
3sys.path.insert(0,'/path/to/diffusers/src')45from diffusers import FluxControlPipeline
6from PIL import Image
78# Load FLUX Control Pipeline9pipe = FluxControlPipeline.from_pretrained(10"black-forest-labs/FLUX.1-dev",11 torch_dtype=torch.bfloat16,12)1314# Load Control LoRA weights15pipe.load_lora_weights("Oysiyl/controlnet-lora-brightness-flux")16pipe.to("cuda")1718# Load grayscale/brightness control image19control_image = Image.open("path/to/grayscale_image.png")20control_image = control_image.resize((1024,1024))2122# Generate image23prompt ="a beautiful garden scene with colorful flowers and butterflies, highly detailed, professional photography, vibrant colors"2425image = pipe(26 prompt=prompt,27 control_image=control_image,28 num_inference_steps=28,# FLUX default29 guidance_scale=3.5,# FLUX default30 height=1024,31 width=1024,32).images[0]3334image.save("output.png")
Adjusting Control Strength
You can control the LoRA conditioning strength using set_adapters() with adapter_weights:
python
1# Load pipeline and LoRA2pipe = FluxControlPipeline.from_pretrained(3"black-forest-labs/FLUX.1-dev",4 torch_dtype=torch.bfloat16,5)6pipe.load_lora_weights("Oysiyl/controlnet-lora-brightness-flux")7pipe.to("cuda")89# Set adapter weight (scale) - controls conditioning strength10pipe.set_adapters(["default_0"], adapter_weights=[0.75])1112# Now generate with adjusted strength13image = pipe(14 prompt=prompt,15 control_image=control_image,16 num_inference_steps=28,17 guidance_scale=3.5,18 height=1024,19 width=1024,20).images[0]
Recommended Scale Ranges:
0.5-0.7: Subtle control with hints of pattern
0.75-1.0: Balanced control (recommended for artistic QR codes)
1.0-1.25: Strong control with clear patterns
1.25-1.5: Very strong control
Note: Unlike SDXL ControlNet which uses controlnet_conditioning_scale, FLUX Control LoRA uses set_adapters() with adapter_weights to control conditioning strength.
Artistic QR Code Generation
python
1import qrcode
2from PIL import Image
3import torch
4from diffusers import FluxControlPipeline
56# Generate QR code7qr = qrcode.QRCode(8 version=None,9 error_correction=qrcode.constants.ERROR_CORRECT_H,# HIGH (30% tolerance)10 box_size=16,# 16 pixels per module11 border=6,# 6 modules border12)13qr.add_data("https://your-url.com")14qr.make(fit=True)1516qr_image = qr.make_image(fill_color="black", back_color="white")17qr_image = qr_image.resize((1024,1024), Image.LANCZOS).convert("RGB")1819# Load pipeline with Control LoRA20pipe = FluxControlPipeline.from_pretrained(21"black-forest-labs/FLUX.1-dev",22 torch_dtype=torch.bfloat16,23)24pipe.load_lora_weights("Oysiyl/controlnet-lora-brightness-flux")25pipe.to("cuda")2627# Generate artistic QR code28image = pipe(29 prompt="a beautiful garden with colorful flowers and butterflies, highly detailed, professional photography",30 control_image=qr_image,31 num_inference_steps=28,32 guidance_scale=3.5,33 height=1024,34 width=1024,35).images[0]3637image.save("artistic_qr.png")
Using Different Checkpoints
The model includes intermediate checkpoints from throughout training:
python
1# Early checkpoint (25% - 2,500 samples, step 312)2pipe.load_lora_weights("Oysiyl/controlnet-lora-brightness-flux",3 subfolder="checkpoint-312")45# Mid checkpoint (50% - 5,000 samples, step 624)6pipe.load_lora_weights("Oysiyl/controlnet-lora-brightness-flux",7 subfolder="checkpoint-624")89# Late checkpoint (75% - 7,500 samples, step 936)10pipe.load_lora_weights("Oysiyl/controlnet-lora-brightness-flux",11 subfolder="checkpoint-936")1213# Final model (10,000 samples, main branch - recommended)14pipe.load_lora_weights("Oysiyl/controlnet-lora-brightness-flux")
Scale Comparison Grids
Visual comparison of different adapter weights (scales) for each checkpoint. Each grid shows the same prompt and QR code at scales 0.5, 0.75, 1.0, 1.25, and 1.5.
Checkpoint-312 (25% trained, 2,500 samples)
Checkpoint-312 Scale Comparison
Scale progression: From subtle (0.5) to very strong (1.5) control. Early checkpoint shows dense pattern integration with visible QR structure across all scales.
Checkpoint-624 (50% trained, 5,000 samples)
Checkpoint-624 Scale Comparison
Scale progression: Improved artistic balance at mid-training. Natural garden scenes emerge with adjustable pattern strength.