prism-upscaler-max

prism

prism models

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.

Production-usable when you need to hit an exact target resolution (e.g. fitting a specific output size) rather than a fixed multiplier β€” the tradeoff for that flexibility is somewhat higher inference cost per output pixel compared to the fixed-scale prism-upscaler-2x/4x models.

[BEFORE / AFTER IMAGE HERE]

πŸ—’οΈ Model Details

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

πŸƒ Usage

Unlike a normal forward(x) call, this model needs a target coordinate grid and cell size, not just an input image:

from huggingface_hub import hf_hub_download
import torch, importlib.util, json
from PIL import Image
import torchvision.transforms.functional as TF

model_file = hf_hub_download(repo_id="olaverse/prism-upscaler-max", filename="model.py")
ckpt_file = hf_hub_download(repo_id="olaverse/prism-upscaler-max", filename="pytorch_model.pt")
config_file = hf_hub_download(repo_id="olaverse/prism-upscaler-max", filename="config.json")

spec = importlib.util.spec_from_file_location("model", model_file)
model_module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(model_module)

config = json.load(open(config_file))
model = model_module.LIIF(**config)
model.load_state_dict(torch.load(ckpt_file, map_location="cpu"))
model.eval()

img = Image.open("input.jpg").convert("RGB")
lr_tensor = TF.to_tensor(img)
out_h, out_w = 1024, 1024   # any target resolution you want

with torch.no_grad():
    feat = model.gen_feat(lr_tensor.unsqueeze(0))
    coord = model_module.make_coord((out_h, out_w), device="cpu").view(1, -1, 2)
    cell = torch.tensor([2.0 / out_h, 2.0 / out_w]).view(1, 1, 2).repeat(1, coord.shape[1], 1)
    pred = model.query_rgb(feat, coord, cell)  # chunk this loop for very large outputs

output = pred.view(1, out_h, out_w, 3).permute(0, 3, 1, 2).clamp(0, 1)
TF.to_pil_image(output[0]).save("output.jpg")

πŸ“Š Benchmarks

Qualitative comparison against bicubic and the fixed-scale Prism models under realistic degradation: consistently the sharpest reconstruction across tested scales, with the best texture recovery and closest visual resemblance to ground truth among all methods compared, particularly at larger scale factors where the gap over both bicubic and the fixed-scale models widens. Informal single-image testing, not a scored benchmark against a standard academic test set (Set5/Set14/etc).

Known Limitations

  • Higher inference cost than the fixed-scale models β€” output is generated point-by-point via MLP query rather than a single convolutional pass.
  • Same general texture/detail tradeoffs as the fixed-scale models at comparable scale factors.
  • Not evaluated against standard academic benchmarks (Set5/Set14/BSD100/Urban100).

Training data & licensing

Trained on PD12M (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.

Citation

@misc{prism-upscaler-max,
  title  = {prism-upscaler-max},
  author = {Olaverse},
  year   = {2026},
  url    = {https://huggingface.co/olaverse/prism-upscaler-max}
}
Downloads last month
34
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support