Downloads · 30 days
7
14% of all-time downloads
bradhinkel/sd-image-upscaler-sd15-lora
sd-image-upscaler-sd15-lora is a machine learning model from bradhinkel. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft. The card lists the license as openrail.
A LoRA from the SD Image Upscaler capability study at github.com/bradhinkel/SDimageupscaler. Phase 4c. Read this card before using.
Downloads · 30 days
7
14% of all-time downloads
All-time downloads
50
Public
Repo size
25.7 MB
Likes
0
Public
Click a slice to open those files.
.safetensors12.8 MB · 100%
From the Hugging Face model README
A LoRA from the SD Image Upscaler capability study at github.com/bradhinkel/SD_image_upscaler. Phase 4c. Read this card before using.
This is a research artifact, not a production-grade weight.
Tested through the project's full Phase 2 two-stage upscaling pipeline
(stable-diffusion-x4-upscaler -> stable-diffusion-v1-5 + ControlNet Tile,
img2img, tiled) on a 60-image frozen test set at 5x:
| Pipeline | Mean LPIPS at 5x (lower = better) |
|---|---|
| Real-ESRGAN baseline | 0.299 |
| Two-stage (no LoRA) | 0.433 |
| Two-stage + this LoRA | 0.443 |
The LoRA does not improve the pipeline on average. It does shift the texture/color prior in interesting per-category ways:
| Test slice | LoRA win rate vs no-LoRA two-stage | Δ mean LPIPS |
|---|---|---|
| traditional / landscape | 30% | +0.0145 (worse) |
| traditional / cityscape | 20% | +0.0156 (worse) |
| traditional / animals | 30% | +0.0040 |
| hard / fine_architecture | 25% | +0.0150 (worse) |
| hard / hf_texture | 50% | +0.0093 (worse) |
| hard / night | 62.5% | -0.0056 (better) |
| hard / reflection | 60% | +0.0019 |
| hard / noise | 50% | +0.0109 (worse) |
| hard / text | 46% | +0.0092 (worse) |
The LoRA learned a slight darken-and-saturate prior that genuinely helps night scenes but mildly hurts daylight categories — even the very domains it was trained on (landscape / cityscape / animals).
This is the third training attempt in the study. The first two targeted
LoRA on stable-diffusion-x4-upscaler's cross-attention modules and produced
catastrophically destructive deltas (output LPIPS 0.78-0.92, vs base 0.33)
regardless of recipe. Detailed failure analysis is in the project's Phase 4c
writeup; the short version is that x4-upscaler's denoising trajectory is
unusually fragile to U-Net perturbations and the SUPIR paper's
architectural choices (zero-init additive adapters on intermediate
ResBlocks, NOT LoRA on attention) are validated by our negative result.
This stage-B LoRA is technically functional (does not destabilise the pipeline), and that's noteworthy on its own. The honest finding is that small-scale cross-attention LoRA on SD 1.5 isn't sufficient to close the gap to dedicated SR architectures (Real-ESRGAN, SUPIR) when LR is clean bicubic-downsampled HR.
stable-diffusion-v1-5/stable-diffusion-v1-5to_q / to_k / to_v / to_out.0 in the UNet cross-attentionbradhinkel/sd-image-upscaler-pairs, private dataset)from diffusers import StableDiffusionControlNetImg2ImgPipeline, ControlNetModel
from peft import PeftModel
import torch
controlnet = ControlNetModel.from_pretrained(
"lllyasviel/control_v11f1e_sd15_tile", torch_dtype=torch.float16
)
pipe = StableDiffusionControlNetImg2ImgPipeline.from_pretrained(
"stable-diffusion-v1-5/stable-diffusion-v1-5",
controlnet=controlnet,
torch_dtype=torch.float16,
safety_checker=None,
).to("cuda")
pipe.unet = PeftModel.from_pretrained(pipe.unet, "bradhinkel/sd-image-upscaler-sd15-lora")
# Use as the stage-B refinement step in a two-stage upscale pipeline.
# See github.com/bradhinkel/SD_image_upscaler for the full inference path.
If you want to use this artifact at all, night scenes only, at LoRA scale 0.5-1.0. For daylight imagery, prefer the same pipeline without the LoRA — it's slightly better.
Salesforce/blip-image-captioning-largeOpenRAIL inherited from SD 1.5 base.