Algolzw/FoD has 32 GitHub stars and 2 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-12 04:12 UTC. Last push 2026-10-02.
Efficient Image Restoration with State-Dependent Forward Diffusion, TMLR 2026
측정된 스타 증가
- in 24h
- 0
- in 7 days
- 기록 수집 중
- in 15 days
- 기록 수집 중
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalEfficient Image Restoration with State-Dependent Forward Diffusion (FoD)
Official PyTorch Implementation
How to Run the Code?
Dependencies
- OS: Ubuntu 20.04
- nvidia:
- cuda: 12.2
- python 3.11
Install
We advise you first create a virtual environment with:
python3 -m venv .env
source .env/bin/activate
pip install -U pip
pip install -r requirements.txt
Image Restoration
Here we provide an example for image deraining task, but can be changed to any problem by replacing the dataset.
Dataset Preparation
Download dataset and process it in a way such that rain images and no-rain images are in separately directories, as
#### for training dataset ####
datasets/rain/trainH/GT
datasets/rain/trainH/LQ
#### for testing dataset ####
datasets/rain/testH/GT
datasets/rain/testH/LQ
Then get into the image_restoration directory and modify the dataset paths in train_IR.py and sample_IR.py. You can also change the run-name and task-name to save models in different directories.
Train
The core algorithms for FoD is in image_restoration/diffusion/fod_diffusion.py.
You can train the model for image restoration following below bash scripts:
cd image_restoration
# For single GPU:
torchrun --nnodes=1 --nproc_per_node=1 --master_port=34567 train_IR.py --global-batch-size 16
# Change the nproc_per_node and global-batch-size for multi-GPU training
torchrun --nnodes=1 --nproc_per_node=4 --master_port=34567 train_IR.py --global-batch-size 64
Then the models and training logs will save in results/{task-name}.
Evaluation
To evaluate our method, please modify the benchmark path and model path and run
python sample_IR.py
Unconditional Generation
Train: Similar to the Image Restoration task, you can train the model on CIFAR-10 following below bash script:
cd image_generation
# For single GPU:
torchrun --nnodes=1 --nproc_per_node=1 --master_port=34567 train_cifar10.py --global-batch-size 128
# Change the nproc_per_node and global-batch-size for multi-GPU training
torchrun --nnodes=1 --nproc_per_node=4 --master_port=34567 train_cifar10.py --global-batch-size 128
Sampling: You need to first change the pretrained model path and sample images with the sample_cifar10.py:
python sample_cifar10.py
Evaluation
We include a ddp_sample_cifar10.py script which samples a large number of images from a pretrain FoD model in parallel. Run:
torchrun --nnodes=1 --nproc_per_node=1 --master_port=45678 ddp_sample_cifar10.py
To calculate FID, Inception Score, etc., you need to obtain a cifar_train.npz of cifar10, and run:
python scripts/evaluator.py cifar_train.npz samples/cifar10/U-Net-0500000-seed-0.npz
Results
FoD forward diffusion process (click to expand)

Image Restoration Results (click to expand)

Acknowledgment: Our FoD is based on DiT and guided-diffusion . Thanks for their code!
Contact
If you have any question, please contact: [email protected]
Citations
If our code helps your research or work, please consider citing our paper. The following are BibTeX references:
@article{luo2025forward,
title={Forward-only Diffusion Probabilistic Models},
author={Luo, Ziwei and Gustafsson, Fredrik K and Sj{\"o}lund, Jens and Sch{\"o}n, Thomas B},
journal={arXiv preprint arXiv:2505.16733},
year={2025}
}
--- Thanks for your interest! ---
statistics
관련 프로젝트 살펴보기
tensorflow/tensorflow
모두를 위한 오픈소스 머신러닝 프레임워크
201,505 스타huggingface/transformers
🤗 Transformers: 텍스트, 비전, 오디오, 멀티모달 분야의 최첨단 머신러닝 모델을 위한 모델 정의 프레임워크로, 추론과 학습을 모두 지원합니다.
168,815 스타AUTOMATIC1111/stable-diffusion-webui
Stable Diffusion 웹 UI
165,289 스타Comfy-Org/ComfyUI
그래프와 노드로 구성된 인터페이스를 갖춘, 가장 강력하고 모듈성이 뛰어난 확산 모델 GUI, API, 백엔드입니다. 세계에서 가장 빠른 로컬 추론 엔진입니다.
146,271 스타