Skip to content
ModelListedExternal
Browse files

ControlNet LoRA Brightness SDXL

A Control LoRA model trained on Stable Diffusion XL to control image generation through brightness/grayscale information. This model uses LoRA (Low-Rank Adaptation) combined with ControlNet architecture for efficient...

KindOtherBase modelstabilityai/stable-diffusion-xl-base-1.0VersionRevision 19c145eBgrade

Model source

Kind
Other
File size
23.5–93.8 MB
Base model
stabilityai/stable-diffusion-xl-base-1.0
Version
vRevision 19c145e
Updated
Oct 6, 2026
Downloads
51
Source
Hugging Face

Source description

ControlNet LoRA SDXL - Brightness Control (100k @ 1024×1024)

A Control LoRA model trained on Stable Diffusion XL 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 alternative to full ControlNet with excellent pattern preservation.

Model Description

This Control LoRA enables brightness-based conditioning for SDXL 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 across multiple scales (0.5-2.0)
  • 🚀 196x smaller than full ControlNet: ~24MB vs ~4.7GB
  • ⚡ Ultra-fast loading: LoRA weights load in <1 second
  • 💡 Flexible scale control: Adjustable conditioning scale from 0.5 to 2.0+
  • 🔄 Compatible with ControlLoRA v3: Uses the efficient ControlLoRA v3 architecture
  • 📦 Minimal storage: All checkpoints + final model = ~490MB total
  • 🖼️ Native SDXL resolution: Trained at 1024×1024
  • 🎯 Production-scale training: 100,000 samples with PiSSA initialization

Intended Uses:

  • Artistic QR code generation (scale 1.0-1.5 recommended)
  • 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 100,000 samples from latentcat/grayscale_image_aesthetic_3M:

  • High-quality aesthetic images
  • Paired with grayscale/brightness versions
  • Native resolution: 1024×1024 (SDXL native)

Training Configuration

ParameterValue
Base Modelstabilityai/stable-diffusion-xl-base-1.0
VAEmadebyollin/sdxl-vae-fp16-fix (improved stability)
ArchitectureControlLoRA v3 (~7M trainable parameters)
LoRA Rank16
Extra Conv Rank64 (conv_in layer)
Training Resolution1024×1024
Training Steps3,125 (1 epoch)
Batch Size8 per device
Gradient Accumulation4 (effective batch: 32)
Learning Rate1e-4 constant (no decay)
LR Warmup0 steps
Empty Prompts20% (improved from 10k's 10%)
Init MethodPiSSA (niter=4) for faster convergence
Mixed PrecisionBF16
HardwareNVIDIA H100 80GB
Training Time~4.5 hours
Final Loss~0.05

Model Size Comparison

ModelParametersSizeTrainingResolution
This Control LoRA~7M~24MB100k @ 10241024×1024
ControlNet (SDXL)~700M4.7GB100k @ 512512×512
T2I Adapter (SDXL)~77M302MB100k @ 10241024×1024
Flux Control LoRA~7M25MB10k @ 512512×512

Usage

Installation

pip install diffusers transformers accelerate torch peft
# Install ControlLoRA v3
git clone https://github.com/HighCWu/control-lora-v3

Basic Usage

import torch
import sys
sys.path.insert(0, '/path/to/control-lora-v3')

from pipeline_sdxl import StableDiffusionXLControlLoraV3Pipeline
from model import UNet2DConditionModelEx
from diffusers import AutoencoderKL
from PIL import Image

# Load improved VAE (same as used in training)
vae = AutoencoderKL.from_pretrained(
    "madebyollin/sdxl-vae-fp16-fix",
    torch_dtype=torch.float16,
)

# Load UNet with LoRA support
unet = UNet2DConditionModelEx.from_pretrained(
    "stabilityai/stable-diffusion-xl-base-1.0",
    subfolder="unet",
    torch_dtype=torch.bfloat16,
)
unet = unet.add_extra_conditions(["brightness"])

# Load SDXL Control LoRA pipeline with improved VAE
pipe = StableDiffusionXLControlLoraV3Pipeline.from_pretrained(
    "stabilityai/stable-diffusion-xl-base-1.0",
    vae=vae,
    unet=unet,
    torch_dtype=torch.bfloat16,
)

# Load Control LoRA weights
pipe.load_lora_weights("Oysiyl/controlnet-lora-brightness-sdxl", adapter_name="brightness")
pipe.to("cuda")

# Load grayscale/brightness control image
control_image = Image.open("path/to/grayscale_image.png")
control_image = control_image.resize((1024, 1024))

# Generate image
prompt = "a beautiful garden scene with colorful flowers and butterflies, highly detailed, professional photography, vibrant colors"

image = pipe(
    prompt=prompt,
    image=control_image,
    num_inference_steps=30,
    guidance_scale=7.5,
    extra_condition_scale=1.0,  # Controls conditioning strength
    height=1024,
    width=1024,
).images[0]

image.save("output.png")

Adjusting Control Strength

The extra_condition_scale parameter controls how strongly the brightness map influences generation:

# Subtle control (scale 0.5-0.7)
image = pipe(
    prompt=prompt,
    image=control_image,
    extra_condition_scale=0.5,
    ...
).images[0]

# Balanced control (scale 1.0-1.5) - Recommended for artistic QR codes
image = pipe(
    prompt=prompt,
    image=control_image,
    extra_condition_scale=1.0,
    ...
).images[0]

# Strong control (scale 1.5-2.0)
image = pipe(
    prompt=prompt,
    image=control_image,
    extra_condition_scale=1.5,
    ...
).images[0]

Artistic QR Code Generation

import qrcode
from PIL import Image

# Generate QR code
qr = qrcode.QRCode(
    version=1,
    error_correction=qrcode.constants.ERROR_CORRECT_H,
    box_size=10,
    border=4
)
qr.add_data("https://your-url.com")
qr.make(fit=True)

qr_image = qr.make_image(fill_color="black", back_color="white")
qr_image = qr_image.resize((1024, 1024), Image.LANCZOS).convert("RGB")

# Generate artistic QR code (scale 1.0-1.5 works best)
image = pipe(
    prompt="a beautiful garden with colorful flowers and butterflies, highly detailed, professional photography",
    image=qr_image,
    num_inference_steps=30,
    guidance_scale=7.5,
    extra_condition_scale=1.0,
    height=1024,
    width=1024,
).images[0]

image.save("artistic_qr.png")

Using Different Checkpoints

The model includes intermediate checkpoints from throughout training:

# Early checkpoint (25% - 25,000 samples)
pipe.load_lora_weights("Oysiyl/controlnet-lora-brightness-sdxl",
                       adapter_name="brightness",
                       subfolder="checkpoint-781")

# Mid checkpoint (50% - 50,000 samples)
pipe.load_lora_weights("Oysiyl/controlnet-lora-brightness-sdxl",
                       adapter_name="brightness",
                       subfolder="checkpoint-1562")

# Late checkpoint (75% - 75,000 samples)
pipe.load_lora_weights("Oysiyl/controlnet-lora-brightness-sdxl",
                       adapter_name="brightness",
                       subfolder="checkpoint-2343")

# Near-final checkpoint (99% - 99,968 samples)
pipe.load_lora_weights("Oysiyl/controlnet-lora-brightness-sdxl",
                       adapter_name="brightness",
                       subfolder="checkpoint-3124")

# Final model (100,000 samples, main branch - recommended)
pipe.load_lora_weights("Oysiyl/controlnet-lora-brightness-sdxl",
                       adapter_name="brightness")

Conditioning Scale Guide

The extra_condition_scale parameter controls how strongly the brightness map influences generation:

Recommended Scale Ranges

ScaleBehaviorBest For
0.5-0.7Subtle artistic integration with hints of patternNatural images, soft lighting hints
0.7-1.0Light control - visible structure with artistic freedomArtistic images, creative reinterpretation
1.0-1.5🔥 Balanced controlArtistic QR codes, watermarks (recommended)
1.5-2.0Strong control - clear patterns with artistic overlayGeometric patterns, structured designs
2.0+Maximum control - dominant patternsStrong brightness maps, technical applications

Performance Comparison

vs Full ControlNet (SDXL)

MetricControlNet (SDXL)This Control LoRAAdvantage
Parameters~700M~7M100x smaller
Model Size4.7GB24MB196x smaller
Load Time~5-10 seconds<1 second10x faster loading
Storage (w/ checkpoints)~18.8GB~490MB38x less storage
Training Time~3 hours4.5 hoursComparable
Pattern Preservation @ Scale 1.0ExcellentExcellentComparable quality
FlexibilityFixed architectureAdjustable weightsMore versatile

vs T2I Adapter (SDXL)

MetricT2I Adapter (SDXL)This Control LoRAAdvantage
Parameters~77M~7M11x smaller
Model Size302MB24MB12.6x smaller
Training Samples100k100kMatched data
ArchitectureSeparate adapterIntegrated LoRASimpler loading

Checkpoint Progression Analysis

The model includes checkpoints from throughout training:

  1. checkpoint-781: 25% complete (25,000 samples)
  2. checkpoint-1562: 50% complete (50,000 samples)
  3. checkpoint-2343: 75% complete (75,000 samples)
  4. checkpoint-3124: 99% complete (99,968 samples)
  5. Final model: 100% complete (100,000 samples - main branch)

Visual Comparison

Each comparison shows QR input + all 7 conditioning scales (0.25, 0.5, 0.7, 0.75, 1.0, 1.25, 1.5) for a specific checkpoint:

Checkpoint 781 (25% trained, 25,000 samples)

Checkpoint-781 Scale Progression

Checkpoint 1562 (50% trained, 50,000 samples)

Checkpoint-1562 Scale Progression

Checkpoint 2343 (75% trained, 75,000 samples)

Checkpoint-2343 Scale Progression

Checkpoint 3124 (99% trained, 99,968 samples)

Checkpoint-3124 Scale Progression

Final Model (100% trained, 100,000 samples) - Recommended

Final Model Scale Progression

Key Observations

All checkpoints show consistent, high-quality performance across scales. The progression analysis reveals:

  1. Early Checkpoint (781 steps, 25k samples):

    • Strong pattern awareness from PiSSA initialization
    • Good balance between control and creativity
    • Recommended scales: 0.7-1.2
  2. Mid Checkpoints (1562-2343 steps, 50k-75k samples):

    • Excellent balance between control and creativity
    • Stable pattern preservation across all scales
    • Recommended scales: 0.8-1.5
  3. Final Model (3125 steps, 100k samples):

    • Maximum control capability with best generalization
    • Excellent pattern preservation at all scales
    • Recommended scales: 0.7-2.0
    • **Recommended for...

Sources

1 source
Hugging FacePrimaryVersion 19c145e336f77810be5187190fba0c17e622c774
huggingface.co/Oysiyl/controlnet-lora-brightness-sdxl/tree/19c145e336f77810be5187190fba0c17e622c774

Verified Oct 6

Download files

Model artifacts

9 artifacts

checkpoint-156/pytorch_lora_weights.safetensors

safetensors · 23.5 MB · SHA-256 0c6bcab3160b…5c9a · Hugging Face

Download file

checkpoint-1562/pytorch_lora_weights.safetensors

safetensors · 93.8 MB · SHA-256 9ae2ce43bfc9…8a39 · Hugging Face

Download file

checkpoint-234/pytorch_lora_weights.safetensors

safetensors · 23.5 MB · SHA-256 5078514e6ad4…48d7 · Hugging Face

Download file

checkpoint-2343/pytorch_lora_weights.safetensors

safetensors · 93.8 MB · SHA-256 042ecc91bab4…6719 · Hugging Face

Download file

checkpoint-312/pytorch_lora_weights.safetensors

safetensors · 23.5 MB · SHA-256 2b9dc11a212d…130c · Hugging Face

Download file

checkpoint-3124/pytorch_lora_weights.safetensors

safetensors · 93.8 MB · SHA-256 dab6d1c27f02…da68 · Hugging Face

Download file

checkpoint-78/pytorch_lora_weights.safetensors

safetensors · 23.5 MB · SHA-256 23b178b5c75e…ef61 · Hugging Face

Download file

checkpoint-781/pytorch_lora_weights.safetensors

safetensors · 93.8 MB · SHA-256 87e8a9dfe06d…ecad · Hugging Face

Download file

pytorch_lora_weights.safetensors

safetensors · 93.8 MB · SHA-256 b006bb0d4a8f…ed2e · Hugging Face

Download file

Source excerpts

3 excerpts

--- license: apache-2.0 base_model: stabilityai/stable-diffusion-xl-base-1.0 tags: - stable-diffusion-xl - sdxl - text-to-image - diffusers - lora - control - controlnet - control-lora - brightness - grayscale - template:sd-lora widget: - text: "a beautiful garden scene with colorful flowers and butterflies, highly detailed, professional photography, vibrant colors" output: url: "https://huggingface.co/Oysiyl/controlnet-lora-brightness-sdxl/resolve/main/examples/example.png" inference: true --- # ControlNet LoRA SDXL - Brightness Control (100k @ 1024×1024) A Control LoRA model trained on Stable Diffusion XL 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 alternative** to full ControlNet with excellent pattern preservation. ## Model Description This Control LoRA enables brightness-based conditioning for SDXL 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** across multiple scales (0.5-2.0) - 🚀 **196x smaller than full ControlNet**: ~24MB vs ~4.7GB - ⚡ **Ultra-fast loading**: LoRA weights load in <1 second - 💡 **Flexible scale control**: Adjustable conditioning scale from 0.5 to 2.0+ - 🔄 **Compatible with ControlLoRA v3**: Uses the efficient ControlLoRA v3 architecture - 📦 **Minimal storage**: All checkpoints + final model = ~490MB total - 🖼️ **Native SDXL resolution**: Trained at 1024×1024 - 🎯 **Production-scale training**: 100,000 samples with PiSSA initialization ### Intended Uses: - **Artistic QR code generation** (scale 1.0-1.5 recommended) - 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 100,000 samples from `latentcat/grayscale_image_aesthetic_3M`: - High-quality aesthetic images - Paired with grayscale/brightness versions - Native resolution: 1024×1024 (SDXL native) ### Training Configuration | Parameter | Value | |-----------|-------| | **...

Source context: 51 downloads · 0 likes · Pipeline text-to-image · Library diffusers · Repo Oysiyl/controlnet-lora-brightness-sdxl

Source context: 26 downloads · 0 likes · Pipeline text-to-image · Library diffusers · Repo Oysiyl/controlnet-lora-brightness-sdxl