Views
No views yet

prism-upscaler-max upscales images to any continuous target resolution — not just fixed multipliers like 2x or 4x. Built on LIIF (Local Implicit Image Function): an RRDB encoder extracts features, and an implicit MLP decoder predicts RGB values at arbitrary continuous coordinates, with 3x3 feature unfolding and 4-corner local ensembling for artifact-free reconstruction at any scale.prism-upscaler-2x/4x models.| Architecture | LIIF: RRDB encoder (6 blocks) + implicit MLP decoder, local ensembling |
| Feature dimension | 64 |
| Scale factor | Any (continuous, not limited to integers) |
| Input | RGB image, any resolution |
| Training data | PD12M, pxhere, cc0-textures, ambientcg (Apache/CC0-licensed) |
| Training | Mixed precision, second-order realistic degradation, random scale sampling per step |
forward(x) call, this model needs a target coordinate grid and cell size, not just an input image: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-upscaler-max", filename="model.py")
7ckpt_file = hf_hub_download(repo_id="olaverse/prism-upscaler-max", filename="pytorch_model.pt")
8config_file = hf_hub_download(repo_id="olaverse/prism-upscaler-max", 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.LIIF(**config)
16model.load_state_dict(torch.load(ckpt_file, map_location="cpu"))
17model.eval()
18
19img = Image.open("input.jpg").convert("RGB")
20lr_tensor = TF.to_tensor(img)
21out_h, out_w = 1024, 1024 # any target resolution you want
22
23with torch.no_grad():
24 feat = model.gen_feat(lr_tensor.unsqueeze(0))
25 coord = model_module.make_coord((out_h, out_w), device="cpu").view(1, -1, 2)
26 cell = torch.tensor([2.0 / out_h, 2.0 / out_w]).view(1, 1, 2).repeat(1, coord.shape[1], 1)
27 pred = model.query_rgb(feat, coord, cell) # chunk this loop for very large outputs
28
29output = pred.view(1, out_h, out_w, 3).permute(0, 3, 1, 2).clamp(0, 1)
30TF.to_pil_image(output[0]).save("output.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-upscaler-max,
title = {prism-upscaler-max},
author = {Olaverse},
year = {2026},
url = {https://huggingface.co/olaverse/prism-upscaler-max}
}