Instructions to use frozen2001/RFMSR with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use frozen2001/RFMSR 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("frozen2001/RFMSR", torch_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 model card for RFMSR
Browse filesThis PR creates a comprehensive model card for RFMSR (Residual Flow Matching for Image Super-Resolution). It includes:
- The `image-to-image` pipeline tag in the YAML metadata.
- Links to the paper and the official GitHub repository.
- Setup and quickstart instructions for installation, downloading weights, and running inference.
- The BibTeX citation for the paper.
README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
pipeline_tag: image-to-image
|
| 3 |
+
---
|
| 4 |
+
|
| 5 |
+
# RFMSR: Residual Flow Matching for Image Super-Resolution
|
| 6 |
+
|
| 7 |
+
This repository contains the weights for **RFMSR** (Residual Flow Matching for Image Super-Resolution), a vision-only super-resolution framework that utilizes a residual flow design centering the source distribution at the low-quality (LQ) latent to preserve structural priors.
|
| 8 |
+
|
| 9 |
+
[📚 Paper](https://huggingface.co/papers/2607.12753) | [💻 GitHub Repository](https://github.com/Faze-Hsw/RFMSR)
|
| 10 |
+
|
| 11 |
+
## Method Overview
|
| 12 |
+
|
| 13 |
+
RFMSR centers the source distribution at the LR latent, reducing the transport distance and preserving structural priors throughout the flow trajectory. It uses a two-phase training strategy to achieve high-quality single-step generation without sacrificing multi-step refinement.
|
| 14 |
+
|
| 15 |
+
<p align="center">
|
| 16 |
+
<img src="https://raw.githubusercontent.com/Faze-Hsw/RFMSR/main/assets/overview.png" alt="RFMSR overview" width="100%">
|
| 17 |
+
</p>
|
| 18 |
+
|
| 19 |
+
## Pretrained Weights
|
| 20 |
+
|
| 21 |
+
This repository hosts the following model checkpoints:
|
| 22 |
+
- `rfmsr.safetensors` — Phase I: Multi-step Flow Matching model (15-step recommended)
|
| 23 |
+
- `rfmsr_os.safetensors` — Phase II: One-step model
|
| 24 |
+
- `rfmsr_consistency.safetensors` — Consistency distillation: One-step model
|
| 25 |
+
|
| 26 |
+
## Quick Start (Inference)
|
| 27 |
+
|
| 28 |
+
To run inference, please clone the official GitHub repository and install the dependencies:
|
| 29 |
+
|
| 30 |
+
```bash
|
| 31 |
+
git clone https://github.com/Faze-Hsw/RFMSR.git
|
| 32 |
+
cd RFMSR
|
| 33 |
+
conda create -n rfmsr python=3.12 -y
|
| 34 |
+
conda activate rfmsr
|
| 35 |
+
pip install -r requirements.txt
|
| 36 |
+
```
|
| 37 |
+
|
| 38 |
+
Download the checkpoints via `huggingface-cli`:
|
| 39 |
+
|
| 40 |
+
```bash
|
| 41 |
+
pip install huggingface_hub
|
| 42 |
+
huggingface-cli download frozen2001/RFMSR ckpts/ --local-dir . --local-dir-use-symlinks False
|
| 43 |
+
```
|
| 44 |
+
|
| 45 |
+
Run super-resolution inference on your images:
|
| 46 |
+
|
| 47 |
+
```bash
|
| 48 |
+
# One-step inference (fast, recommended)
|
| 49 |
+
python infer_rfmsr.py --input input.png --steps 1
|
| 50 |
+
|
| 51 |
+
# Multi-step inference (higher quality)
|
| 52 |
+
python infer_rfmsr.py --input input.png --steps 15
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
## Citation
|
| 56 |
+
|
| 57 |
+
If you find this work useful, please cite:
|
| 58 |
+
|
| 59 |
+
```bibtex
|
| 60 |
+
@misc{huang2026rfmsrresidualflowmatching,
|
| 61 |
+
title={RFMSR: Residual Flow Matching for Image Super-Resolution},
|
| 62 |
+
author={Shuwei Huang and Tianyao Luo and Jicheng Liu and Daizong Liu and Pan Zhou},
|
| 63 |
+
year={2026},
|
| 64 |
+
eprint={2607.12753},
|
| 65 |
+
archivePrefix={arXiv},
|
| 66 |
+
primaryClass={cs.CV},
|
| 67 |
+
url={https://arxiv.org/abs/2607.12753},
|
| 68 |
+
}
|
| 69 |
+
```
|