You need to agree to share your Hugging Face information to access this model
This repository is publicly accessible, but you have to accept the conditions to access its files and content.
These ONNX files are a conversion of AdcSR, a one-step diffusion super-resolution model distilled from Stable Diffusion 2.1-base. The AdcSR code is Apache-2.0, and the weights inherit the CreativeML Open RAIL++-M license of Stable Diffusion 2.1-base, including its use-based restrictions (Attachment A). By requesting access you agree to use the model only in accordance with that license, and to pass the same restrictions on to anyone you redistribute it to. The full text is in LICENSE-CreativeML-OpenRAIL-M.txt in this repository.
Log in or Sign Up to review the conditions and access this model content.
AdcSR β ONNX (fp32 for DirectML, bf16 two-stage for the AMD Ryzen AI NPU)
Fixed-shape ONNX exports of AdcSR (Adversarial Diffusion Compression for Real-World Image
Super-Resolution, Bin Chen et al., CVPR 2025; code and weights at
Guaishou74851/AdcSR and
huggingface.co/Guaishou74851/AdcSR, checkpoint
net_params_200.pkl with halfDecoder.ckpt). AdcSR is a one-step generative super-resolution model (a
compressed Stable Diffusion 2.1-base UNet plus a reduced VAE decoder) for photographs; 4x.
adcsr_nchw_128x128_fp32.onnxis the whole model in fp32. It is used with DirectML on an AMD iGPU.adcsr_front_*/adcsr_back_*are the same model in bf16, cut into two parts for the ONNX Runtime VitisAI execution provider of Ryzen AI Software 1.8.0 on an XDNA2 NPU.
Input is RGB in [0, 1], float32, NCHW, 3 channels, 128x128. Output is 512x512. The model is meant to be
run on overlapping tiles (the app that uses these files runs 128x128 tiles with a 32 px margin and
cross-fades the seams).
Files
| File | Input β output | Precision | Target | Size | SHA-256 |
|---|---|---|---|---|---|
adcsr_nchw_128x128_fp32.onnx |
1x3x128x128 β 1x3x512x512 | fp32 | DirectML / CPU | 1.82 GB | a1b7d77bf688677850154b22a933fe03e535a29d3e595f09c204716657e60368 |
adcsr_front_nchw_128x128_bf16cast.onnx |
1x3x128x128 β 3 tensors (UNet output) | bf16 (cast) | VitisAI EP, process 1 | 1.78 GB | b0212593193789e4508d04837d7ec773fc699326efc63968b5e5534d9ecdd5ab |
adcsr_back_nchw_128x128_bf16cast.onnx |
3 tensors β 1x3x512x512 | bf16 (cast) | VitisAI EP, process 2 | 50 MB | de1276299b44d13e8e363ef2909245d2cad927816ba8bbafcc717419306e7719 |
adcsr_npu_manifest.json |
names of the three boundary tensors, cache keys, SHA-256 of both parts | β | host | 924 B | 0444759a66d7bdee38de41f13c8388ac7835417c3c205cf2e6eac9b0fc94c5f2 |
The cut is at the UNet output: the front file is the UNet, the back file is the VAE decoder. Three
input-dependent tensors cross the boundary; their names are listed in the manifest.
How the files were made
- PyTorch β fixed-shape fp32 ONNX with
scripts/adcsr/export_adcsr.py --size 128(needs the AdcSR repository,net_params_200.pkl,halfDecoder.ckptand a local diffusers copy of Stable Diffusion 2.1-base; opset 17, onnxsim; PyTorch/ONNX Runtime agreement checked by PSNR). - For the NPU,
InstanceNormalizationis rewritten to a 4D form the compiler accepts (scripts/adcsr/rewrite_in_to_n5.py), thenpython -m quark.onnx.tools.convert_fp32_to_bf16 --format with_cast(AMD Quark, Ryzen AI 1.8.0 environment; no calibration data). - The bf16 model is cut into
frontandbackwithscripts/adcsr/split_adcsr_npu.py, which also writes the manifest and checks the two parts against the fp32 model on a reference image.
The two-part layout exists because of a VitisAI EP issue in Ryzen AI 1.8.0: when both parts are run in one process, the output of the first part becomes NaN after the second part has run (amd/RyzenAI-SW#402). Each part is therefore run in its own process. The write-up is in adcsr-npu.md, the full conversion procedure in docs/model-conversion.md.
Running on the NPU
The VitisAI EP compiles each part with VAIML when its first session is created. On a Ryzen AI 7 PRO 350 the
front part takes about 93 minutes and the back part about 30 minutes; the results are cached (cache_dir /
cache_key session options; the manifest carries the cache keys) and later sessions start in seconds. The
cache is tied to the Ryzen AI Software and NPU driver versions, so it is not published here; compile it on
the target machine.
Measured on a Ryzen AI 7 PRO 350 (XDNA2 NPU, Radeon 860M, 32 GB LPDDR5-8000, Ryzen AI SW 1.8.0, NPU driver 32.0.203.329), one 854x480 photograph β 4x, 112 tiles of 128x128, including tiling and merge:
| Execution | Time per image | Per tile | PSNR vs fp32 output |
|---|---|---|---|
| iGPU, DirectML, fp32 | 108 s | β | β |
| NPU, VitisAI EP, bf16, power mode Default | 247 s | 2.05 s (front 0.7 s + back 1.3 s) | 45.4 dB |
| NPU, VitisAI EP, bf16, power mode Turbo | 131 s | β | 45.4 dB |
PSNR was measured on one 1280x534 photograph (180 tiles) against the DirectML fp32 output.
License and attribution
- The AdcSR code and training recipe are by Bin Chen and the AdcSR authors
(Guaishou74851/AdcSR), released under the Apache License 2.0
(
LICENSE-Apache-2.0-AdcSR.txt). - The weights are distilled from Stable Diffusion 2.1-base (Stability AI), which is released under the
CreativeML Open RAIL++-M license. As a derivative, the AdcSR weights and these ONNX conversions are
subject to that license, including the use-based restrictions in its Attachment A (no unlawful use, no
harm to minors, no generation of verifiably false information or of personal data intended to harm, no
defamation or harassment, no fully automated decisions that affect legal rights, no discrimination against
protected groups, among others). Anyone who redistributes these files must impose the same restrictions.
The Open RAIL-M text with Attachment A is in
LICENSE-CreativeML-OpenRAIL-M.txt; the exact 2.1 variant is at https://huggingface.co/stabilityai/stable-diffusion-2-1-base/blob/main/LICENSE-MODEL.
This repository is gated so that every downloader sees these terms once.
This is an independent, personal conversion. It is not affiliated with or endorsed by AMD, Stability AI or the AdcSR authors. AMD, Ryzen and Ryzen AI are trademarks of Advanced Micro Devices, Inc.
These files are also the AdcSR model kit of TOGU SCALER, a Windows upscaler that runs them on DirectML and on the Ryzen AI NPU.
Model tree for Tomoali/AdcSR-onnx
Base model
stabilityai/stable-diffusion-2-1-base