Downloads ยท 30 days
11
12% of all-time downloads
Oysiyl/t2i-adapter-brightness-sdxl
t2i-adapter-brightness-sdxl is a image-to-image model from Oysiyl. Use it when you need one image transformed into another. It is set up for diffusers. The card lists the license as apache-2.0.
A T2I Adapter model trained on Stable Diffusion XL to control image generation through brightness/grayscale information. This model is trained at native SDXL resolution (1024ร1024) on 100,000 samples, providing a lighโฆ
Downloads ยท 30 days
11
12% of all-time downloads
All-time downloads
94
Public
Parameters
79M
1.3 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.3 GB ยท 97%
From the Hugging Face model README
A T2I Adapter model trained on Stable Diffusion XL to control image generation through brightness/grayscale information. This model is trained at native SDXL resolution (1024ร1024) on 100,000 samples, providing a lightweight alternative to ControlNet with superior efficiency and excellent pattern preservation.
This T2I Adapter 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:
Intended Uses:
We tested all checkpoints at multiple conditioning scales (0.25, 0.5, 0.75, 1.0, 1.25, 1.5) to understand the training progression. Here are the key findings:






Early Checkpoints (25k-50k samples):
Mid Checkpoint (75k samples):
Final Model (100k samples):
The checkpoint progression reveals clear signs of overfitting as training progresses. The final model (100k samples) shows excessive pattern dominance at high scales, losing the artistic balance present in earlier checkpoints. This suggests:
For most use cases, checkpoint-391 or checkpoint-782 are recommended over the final model, as they maintain artistic prompt adherence while still providing good pattern control.
Trained on 100,000 samples from latentcat/grayscale_image_aesthetic_3M:
| Parameter | Value |
|---|---|
| Base Model | stabilityai/stable-diffusion-xl-base-1.0 |
| VAE | madebyollin/sdxl-vae-fp16-fix |
| Architecture | T2I Adapter Full XL (~77M parameters) |
| Training Resolution | 1024ร1024 (native SDXL) |
| Training Steps | 1,563 (1 epoch) |
| Batch Size | 8 per device |
| Gradient Accumulation | 8 (effective batch: 64) |
| Learning Rate | 1e-5 |
| Mixed Precision | FP16 |
| Hardware | NVIDIA H100 80GB |
| Training Time | ~3 hours |
| Optimizer | 8-bit Adam |
| Final Loss | ~0.025 |
| Model | Parameters | Size | Training | Resolution |
|---|---|---|---|---|
| This T2I Adapter | ~77M | 302MB | 100k @ 1024 | 1024ร1024 |
| ControlNet (SDXL) | ~700M | 4.7GB | 100k @ 512 | 512ร512 |
| T2I Adapter (10k) | ~77M | 302MB | 10k @ 1024 | 1024ร1024 |
pip install diffusers transformers accelerate torch
from diffusers import StableDiffusionXLAdapterPipeline, T2IAdapter, EulerAncestralDiscreteScheduler
import torch
from PIL import Image
# Load T2I Adapter
adapter = T2IAdapter.from_pretrained(
"Oysiyl/t2i-adapter-brightness-sdxl",
torch_dtype=torch.float16
)
# Load SDXL pipeline
pipe = StableDiffusionXLAdapterPipeline.from_pretrained(
"stabilityai/stable-diffusion-xl-base-1.0",
adapter=adapter,
torch_dtype=torch.float16
)
pipe.scheduler = EulerAncestralDiscreteScheduler.from_config(pipe.scheduler.config)
pipe.enable_xformers_memory_efficient_attention()
pipe.to("cuda")
# Load grayscale/brightness control image
control_image = Image.open("path/to/grayscale_image.png")
control_image = control_image.resize((1024, 1024)) # Resize to 1024ร1024
# Generate image
prompt = "a beautiful landscape, highly detailed, vibrant colors"
negative_prompt = "blurry, low quality, distorted"
image = pipe(
prompt=prompt,
negative_prompt=negative_prompt,
image=control_image,
num_inference_steps=30,
adapter_conditioning_scale=1.5, # Higher scales work excellently!
guidance_scale=7.5,
height=1024,
width=1024,
).images[0]
image.save("output.png")
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
image = pipe(
prompt="a beautiful garden with colorful flowers and butterflies, highly detailed, professional photography",
negative_prompt="blurry, low quality, distorted",
image=qr_image,
num_inference_steps=30,
adapter_conditioning_scale=2.0, # Strong pattern preservation!
guidance_scale=7.5,
height=1024,
width=1024,
).images[0]
image.save("artistic_qr.png")
The adapter_conditioning_scale parameter controls how strongly the brightness map influences generation:
| Scale | Behavior | Best For |
|---|---|---|
| 0.7-1.0 | Subtle artistic integration with hints of pattern | Natural images, soft lighting control |
| 1.0-1.5 | Balanced - visible structure with artistic elements | General purpose, recoloring |
| 1.5-2.0 | ๐ฅ Excellent pattern preservation | Artistic QR codes, watermarks |
| 2.0-2.5 | Maximum control - strong patterns with artistic overlay | Strong geometric patterns |
Discovery: This model trained at native 1024ร1024 resolution shows superior brightness pattern preservation at scales 1.5-2.5 compared to ControlNet trained at 512ร512!
| Metric | ControlNet | This T2I Adapter | Advantage |
|---|---|---|---|
| Parameters | ~700M | ~77M | 9x smaller |
| Model Size | 4.7GB | 302MB | 15x smaller |
| Training Resolution | 512ร512 | 1024ร1024 | Native SDXL |
| Training Time | ~49 min | ~3 hours | Comparable |
| Inference Speed @ 1024 | ~8 it/s | ~12 it/s | 50% faster |
| Time per Image | ~4 seconds | ~2.5 seconds | 1.6x faster |
| Pattern Preservation @ Scale 2.0 | Good | Excellent | Superior |
| Memory Requirement | Higher | Lower | Better efficiency |
| Metric | 10k Model | This 100k Model | Improvement |
|---|---|---|---|
| Training Samples | 10,000 | 100,000 | 10x more data |
| Training Time | ~18 min | ~3 hours | Longer training |
| Final Loss | 0.0796 | 0.025 | 3x better |
| Pattern Quality | Good | Excellent | More consistent |
| Artistic Integration | Chaotic | Cleaner | Better control |
This T2I Adapter trained at native 1024ร1024 resolution demonstrates:
At scale 2.0, this model:
This repository includes checkpoints from throughout training:
All checkpoints are saved in the same format and can be loaded identically. See the Checkpoint Progression Analysis section above for detailed comparisons and recommendations.
Recommendations based on overfitting analysis:
This model was trained using the diffusers T2I Adapter training script:
accelerate launch --mixed_precision="fp16" train_t2i_adapter_sdxl.py \
--pretrained_model_name_or_path="stabilityai/stable-diffusion-xl-base-1.0" \
--pretrained_vae_model_name_or_path="madebyollin/sdxl-vae-fp16-fix" \
--dataset_name="<path_to_100k_dataset>" \
--conditioning_image_column="conditioning_image" \
--image_column="image" \
--caption_column="text" \
--output_dir="./t2i-adapter-brightness-sdxl-100k-1024" \
--mixed_precision="fp16" \
--resolution=1024 \
--learning_rate=1e-5 \
--train_batch_size=8 \
--gradient_accumulation_steps=8 \
--num_train_epochs=1 \
--checkpointing_steps=391 \
--validation_steps=391 \
--enable_xformers_memory_efficient_attention \
--use_8bit_adam \
--report_to="wandb"
@misc{t2i-adapter-brightness-sdxl-100k,
author = {Oysiyl},
title = {SDXL T2I Adapter - Brightness Control (100k @ 1024ร1024)},
year = {2025},
publisher = {HuggingFace},
journal = {HuggingFace Model Hub},
howpublished = {\url{https://huggingface.co/Oysiyl/t2i-adapter-brightness-sdxl}}
}
Apache 2.0 License. The base SDXL model has separate license terms at stabilityai/stable-diffusion-xl-base-1.0.