Views
No views yet

prism-denoiser removes real-world image degradation — Gaussian noise, blur, and JPEG-like compression artifacts — using a compact U-Net trained with on-the-fly random degradation. Unlike the fixed-scale upscalers, this model doesn't change resolution: it takes a degraded image and returns a cleaner version at the same size, useful as a standalone restoration tool or as pre-processing before other image tasks.| Architecture | Compact U-Net (3 down/up levels, base width 48) |
| Input / Output | RGB image, 128x128, same resolution in and out |
| Training data | PD12M, pxhere, cc0-textures, ambientcg (Apache/CC0-licensed) |
| Training | Mixed precision, on-the-fly random degradation (blur + Gaussian noise + JPEG-approximation, each applied with independent random probability/severity per sample), L1 + VGG-perceptual loss, early stopping on validation PSNR |
1from huggingface_hub import hf_hub_download
2import torch, importlib.util, json
3from PIL import Image
4import torchvision.transforms.functional as TF
5
6model_file = hf_hub_download(repo_id="olaverse/prism-denoiser", filename="model.py")
7ckpt_file = hf_hub_download(repo_id="olaverse/prism-denoiser", filename="pytorch_model.pt")
8config_file = hf_hub_download(repo_id="olaverse/prism-denoiser", filename="config.json")
9
10spec = importlib.util.spec_from_file_location("model", model_file)
11model_module = importlib.util.module_from_spec(spec)
12spec.loader.exec_module(model_module)
13
14config = json.load(open(config_file))
15model = model_module.UNet(**config)
16model.load_state_dict(torch.load(ckpt_file, map_location="cpu")["net"])
17model.eval()
18
19img = Image.open("noisy.jpg").convert("RGB").resize((128, 128))
20x = TF.to_tensor(img).unsqueeze(0)
21with torch.no_grad():
22 output = model(x).clamp(0, 1)
23TF.to_pil_image(output[0]).save("denoised.jpg")Spawning/PD12M, CDLA-Permissive-2.0), pxhere (nyuuzyou/pxhere, CC0), cc0-textures (nyuuzyou/cc0-textures, CC0), and ambientcg (nyuuzyou/ambientcg, CC0). Released under Apache-2.0.@misc{prism-denoiser,
title = {prism-denoiser},
author = {Olaverse},
year = {2026},
url = {https://huggingface.co/olaverse/prism-denoiser}
}