Instructions to use CSWRY/VOSR with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use CSWRY/VOSR with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("CSWRY/VOSR", dtype=torch.bfloat16, device_map="cuda") prompt = "Turn this cat into a dog" input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png") image = pipe(image=input_image, prompt=prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Create README.md
#2
by wulawulawula - opened
README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
pipeline_tag: image-to-image
|
| 4 |
+
tags:
|
| 5 |
+
- image-super-resolution
|
| 6 |
+
- image-restoration
|
| 7 |
+
---
|
| 8 |
+
|
| 9 |
+
# VOSR: A Vision-Only Generative Model for Image Super-Resolution
|
| 10 |
+
|
| 11 |
+
**A framework for native generative image restoration.**
|
| 12 |
+
|
| 13 |
+
Many recent generative super-resolution methods adapt pretrained text-to-image models. VOSR trains its generative backbone from scratch for super-resolution, using structural and visual semantic conditions from the low-resolution input. It requires no text prompts and reuses pretrained VAE and vision-encoder components.
|
| 14 |
+
|
| 15 |
+
Our goal is to build native generative models for image restoration that combine input fidelity, perceptual quality, and efficient inference. VOSR explores this direction through restoration-oriented guidance and both multi-step and one-step models.
|
| 16 |
+
|
| 17 |
+
## Available checkpoints
|
| 18 |
+
|
| 19 |
+
This repository provides:
|
| 20 |
+
|
| 21 |
+
- `VOSR2/`: VOSR 2.0, a 1.4B one-step model.
|
| 22 |
+
- `VOSR_0.5B_ms/`: 0.5B multi-step model.
|
| 23 |
+
- `VOSR_0.5B_os/`: 0.5B one-step model.
|
| 24 |
+
- `VOSR_1.4B_ms/`: 1.4B multi-step model.
|
| 25 |
+
- `VOSR_1.4B_os/`: 1.4B one-step model.
|
| 26 |
+
|
| 27 |
+
Supporting VAE, decoder, and visual-encoder files are also provided. See the license section for the terms that apply to each component.
|
| 28 |
+
|
| 29 |
+
`Qwen-Image-vae-2d/` is our 2D conversion of the released 3D causal VAE weights, with the encoder from [Wan2.1](https://github.com/Wan-Video/Wan2.1) and the image decoder fine-tuned by [Qwen-Image](https://arxiv.org/html/2508.02324v1#S2.SS3).
|
| 30 |
+
|
| 31 |
+
## Intended use and limitations
|
| 32 |
+
|
| 33 |
+
VOSR is intended for research and image-restoration applications, including single-image super-resolution.
|
| 34 |
+
|
| 35 |
+
Generative super-resolution may produce plausible details that are not fully supported by the input image. The output should not be treated as a faithful recovery of information absent from the input or as forensic evidence. Results may vary with the input image, degradation, checkpoint, and inference settings.
|
| 36 |
+
|
| 37 |
+
## Training and evaluation
|
| 38 |
+
|
| 39 |
+
The accompanying paper describes the training setup and evaluation protocols. It reports training on a filtered image collection of approximately 100 million images and using synthetic low-resolution/high-resolution pairs generated with Real-ESRGAN degradation. The training data is not included in this repository.
|
| 40 |
+
|
| 41 |
+
See the [paper](https://arxiv.org/abs/2604.03225) for evaluation results and further details.
|
| 42 |
+
|
| 43 |
+
## Inference
|
| 44 |
+
|
| 45 |
+
Use the inference code in the [VOSR project repository](https://github.com/cswry/VOSR). This repository uses VOSR-specific inference scripts; the generic `DiffusionPipeline.from_pretrained(...)` example shown by Hugging Face may not apply.
|
| 46 |
+
|
| 47 |
+
Clone the project and install its dependencies:
|
| 48 |
+
|
| 49 |
+
```bash
|
| 50 |
+
git clone https://github.com/cswry/VOSR.git
|
| 51 |
+
cd VOSR
|
| 52 |
+
pip install -r requirements.txt
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
Download the required checkpoint files from this Hugging Face repository into the project’s `preset/ckpts/` directory, preserving their folder names. For example, to run VOSR 2.0 on images in `preset/datasets/inp_data`:
|
| 56 |
+
|
| 57 |
+
```bash
|
| 58 |
+
python inference_vosr_onestep.py \
|
| 59 |
+
-c preset/ckpts/VOSR2 \
|
| 60 |
+
-i preset/datasets/inp_data \
|
| 61 |
+
-o preset/results \
|
| 62 |
+
-u 4
|
| 63 |
+
```
|
| 64 |
+
|
| 65 |
+
For inference with other checkpoints and options, see the [project README](https://github.com/cswry/VOSR).
|
| 66 |
+
|
| 67 |
+
## License
|
| 68 |
+
|
| 69 |
+
The Apache-2.0 license applies to VOSR project materials covered by the [project license](https://github.com/cswry/VOSR/blob/main/LICENSE), including project-authored checkpoints unless a release-specific notice says otherwise. Some bundled third-party components have their own terms; the Apache-2.0 license does not replace those terms.
|
| 70 |
+
|
| 71 |
+
| Files | Terms |
|
| 72 |
+
|---|---|
|
| 73 |
+
| VOSR checkpoints (`VOSR2/`, `VOSR_*/`) and project-authored decoder files | Apache-2.0 under the [project license](https://github.com/cswry/VOSR/blob/main/LICENSE), unless a release-specific notice says otherwise. |
|
| 74 |
+
| `Qwen-Image-vae-2d/` | Follow the applicable upstream terms of [Wan2.1](https://github.com/Wan-Video/Wan2.1) and [Qwen-Image](https://huggingface.co/Qwen/Qwen-Image). |
|
| 75 |
+
| `stable-diffusion-2-1-base/` | Follow the [upstream Stable Diffusion 2.1 terms](https://huggingface.co/stabilityai/stable-diffusion-2-1-base), listed as OpenRAIL++. |
|
| 76 |
+
| `torch_cache/` | If this directory contains DINOv2 weights, follow the terms in the [DINOv2 repository](https://github.com/facebookresearch/dinov2). |
|
| 77 |
+
|
| 78 |
+
Please retain applicable upstream notices and comply with the terms for each third-party component.
|
| 79 |
+
|
| 80 |
+
## Citation
|
| 81 |
+
|
| 82 |
+
If you use VOSR in your research, please cite:
|
| 83 |
+
|
| 84 |
+
```bibtex
|
| 85 |
+
@inproceedings{wu2026vosr,
|
| 86 |
+
title = {VOSR: A Vision-Only Generative Model for Image Super-Resolution},
|
| 87 |
+
author = {Wu, Rongyuan and Sun, Lingchen and Zhang, Zhengqiang and Kong, Xiangtao and Zhao, Jixin and Wang, Shihao and Zhang, Lei},
|
| 88 |
+
booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
|
| 89 |
+
year = {2026}
|
| 90 |
+
}
|
| 91 |
+
```
|
| 92 |
+
|
| 93 |
+
## Links
|
| 94 |
+
|
| 95 |
+
- [Code](https://github.com/cswry/VOSR)
|
| 96 |
+
- [Paper](https://arxiv.org/abs/2604.03225)
|