TorchDiff 2.3.0__tar.gz → 2.5.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. torchdiff-2.5.0/MANIFEST.in +4 -0
  2. torchdiff-2.5.0/PKG-INFO +379 -0
  3. torchdiff-2.5.0/README.md +326 -0
  4. torchdiff-2.5.0/TorchDiff.egg-info/PKG-INFO +379 -0
  5. {torchdiff-2.3.0 → torchdiff-2.5.0}/TorchDiff.egg-info/SOURCES.txt +4 -0
  6. {torchdiff-2.3.0 → torchdiff-2.5.0}/setup.py +5 -11
  7. {torchdiff-2.3.0 → torchdiff-2.5.0}/torchdiff/__init__.py +7 -4
  8. {torchdiff-2.3.0 → torchdiff-2.5.0}/torchdiff/ddim.py +3 -2
  9. {torchdiff-2.3.0 → torchdiff-2.5.0}/torchdiff/ddpm.py +3 -2
  10. {torchdiff-2.3.0 → torchdiff-2.5.0}/torchdiff/ldm.py +5 -4
  11. {torchdiff-2.3.0 → torchdiff-2.5.0}/torchdiff/sde.py +13 -7
  12. {torchdiff-2.3.0 → torchdiff-2.5.0}/torchdiff/tests/test_ddpm.py +1 -1
  13. torchdiff-2.5.0/torchdiff/tests/test_ldm.py +172 -0
  14. torchdiff-2.5.0/torchdiff/tests/test_unclip.py +551 -0
  15. torchdiff-2.5.0/torchdiff/tests/test_utils.py +316 -0
  16. {torchdiff-2.3.0 → torchdiff-2.5.0}/torchdiff/unclip.py +61 -51
  17. {torchdiff-2.3.0 → torchdiff-2.5.0}/torchdiff/utils.py +41 -1
  18. {torchdiff-2.3.0 → torchdiff-2.5.0}/unclip/projections.py +11 -6
  19. torchdiff-2.3.0/PKG-INFO +0 -244
  20. torchdiff-2.3.0/README.md +0 -297
  21. torchdiff-2.3.0/TorchDiff.egg-info/PKG-INFO +0 -244
  22. {torchdiff-2.3.0 → torchdiff-2.5.0}/LICENSE +0 -0
  23. {torchdiff-2.3.0 → torchdiff-2.5.0}/TorchDiff.egg-info/dependency_links.txt +0 -0
  24. {torchdiff-2.3.0 → torchdiff-2.5.0}/TorchDiff.egg-info/requires.txt +0 -0
  25. {torchdiff-2.3.0 → torchdiff-2.5.0}/TorchDiff.egg-info/top_level.txt +0 -0
  26. {torchdiff-2.3.0 → torchdiff-2.5.0}/ddim/__init__.py +0 -0
  27. {torchdiff-2.3.0 → torchdiff-2.5.0}/ddim/forward_ddim.py +0 -0
  28. {torchdiff-2.3.0 → torchdiff-2.5.0}/ddim/reverse_ddim.py +0 -0
  29. {torchdiff-2.3.0 → torchdiff-2.5.0}/ddim/sample_ddim.py +0 -0
  30. {torchdiff-2.3.0 → torchdiff-2.5.0}/ddim/scheduler.py +0 -0
  31. {torchdiff-2.3.0 → torchdiff-2.5.0}/ddim/test_ddim.py +0 -0
  32. {torchdiff-2.3.0 → torchdiff-2.5.0}/ddim/train_ddim.py +0 -0
  33. {torchdiff-2.3.0 → torchdiff-2.5.0}/ddpm/__init__.py +0 -0
  34. {torchdiff-2.3.0 → torchdiff-2.5.0}/ddpm/forward_ddpm.py +0 -0
  35. {torchdiff-2.3.0 → torchdiff-2.5.0}/ddpm/reverse_ddpm.py +0 -0
  36. {torchdiff-2.3.0 → torchdiff-2.5.0}/ddpm/sample_ddpm.py +0 -0
  37. {torchdiff-2.3.0 → torchdiff-2.5.0}/ddpm/scheduler.py +0 -0
  38. {torchdiff-2.3.0 → torchdiff-2.5.0}/ddpm/test_ddpm.py +0 -0
  39. {torchdiff-2.3.0 → torchdiff-2.5.0}/ddpm/train_ddpm.py +0 -0
  40. {torchdiff-2.3.0 → torchdiff-2.5.0}/ldm/__init__.py +0 -0
  41. {torchdiff-2.3.0 → torchdiff-2.5.0}/ldm/autoencoder.py +0 -0
  42. {torchdiff-2.3.0 → torchdiff-2.5.0}/ldm/sample_ldm.py +0 -0
  43. {torchdiff-2.3.0 → torchdiff-2.5.0}/ldm/train_autoencoder.py +0 -0
  44. {torchdiff-2.3.0 → torchdiff-2.5.0}/ldm/train_ldm.py +0 -0
  45. {torchdiff-2.3.0 → torchdiff-2.5.0}/sde/__init__.py +0 -0
  46. {torchdiff-2.3.0 → torchdiff-2.5.0}/sde/forward_sde.py +0 -0
  47. {torchdiff-2.3.0 → torchdiff-2.5.0}/sde/reverse_sde.py +0 -0
  48. {torchdiff-2.3.0 → torchdiff-2.5.0}/sde/sample_sde.py +0 -0
  49. {torchdiff-2.3.0 → torchdiff-2.5.0}/sde/scheduler.py +0 -0
  50. {torchdiff-2.3.0 → torchdiff-2.5.0}/sde/test_sde.py +0 -0
  51. {torchdiff-2.3.0 → torchdiff-2.5.0}/sde/train_sde.py +0 -0
  52. {torchdiff-2.3.0 → torchdiff-2.5.0}/setup.cfg +0 -0
  53. {torchdiff-2.3.0 → torchdiff-2.5.0}/torchdiff/tests/__init__.py +0 -0
  54. {torchdiff-2.3.0 → torchdiff-2.5.0}/torchdiff/tests/test_ddim.py +0 -0
  55. {torchdiff-2.3.0 → torchdiff-2.5.0}/torchdiff/tests/test_sde.py +0 -0
  56. {torchdiff-2.3.0 → torchdiff-2.5.0}/unclip/__init__.py +0 -0
  57. {torchdiff-2.3.0 → torchdiff-2.5.0}/unclip/clip_encoder.py +0 -0
  58. {torchdiff-2.3.0 → torchdiff-2.5.0}/unclip/forward_unclip.py +0 -0
  59. {torchdiff-2.3.0 → torchdiff-2.5.0}/unclip/reverse_unclip.py +0 -0
  60. {torchdiff-2.3.0 → torchdiff-2.5.0}/unclip/scheduler.py +0 -0
  61. {torchdiff-2.3.0 → torchdiff-2.5.0}/unclip/train_unclip_decoder.py +0 -0
  62. {torchdiff-2.3.0 → torchdiff-2.5.0}/unclip/train_unclip_prior.py +0 -0
  63. {torchdiff-2.3.0 → torchdiff-2.5.0}/unclip/unclip_decoder.py +0 -0
  64. {torchdiff-2.3.0 → torchdiff-2.5.0}/unclip/unclip_sampler.py +0 -0
  65. {torchdiff-2.3.0 → torchdiff-2.5.0}/unclip/unclip_trainstormer_prior.py +0 -0
  66. {torchdiff-2.3.0 → torchdiff-2.5.0}/unclip/upsampler_trainer.py +0 -0
  67. {torchdiff-2.3.0 → torchdiff-2.5.0}/unclip/upsampler_unclip.py +0 -0
  68. {torchdiff-2.3.0 → torchdiff-2.5.0}/utils/__init__.py +0 -0
  69. {torchdiff-2.3.0 → torchdiff-2.5.0}/utils/diff_net.py +0 -0
  70. {torchdiff-2.3.0 → torchdiff-2.5.0}/utils/losses.py +0 -0
  71. {torchdiff-2.3.0 → torchdiff-2.5.0}/utils/metrics.py +0 -0
  72. {torchdiff-2.3.0 → torchdiff-2.5.0}/utils/text_encoder.py +0 -0
@@ -0,0 +1,4 @@
1
+ include README.md
2
+ include LICENSE
3
+ recursive-include torchdiff/data *.txt
4
+ recursive-include torchdiff/models *.pt
@@ -0,0 +1,379 @@
1
+ Metadata-Version: 2.4
2
+ Name: TorchDiff
3
+ Version: 2.5.0
4
+ Summary: A PyTorch-based library for diffusion models
5
+ Home-page: https://github.com/LoqmanSamani/TorchDiff
6
+ Author: Loghman Samani
7
+ Author-email: samaniloqman91@gmail.com
8
+ License: MIT
9
+ Project-URL: Homepage, https://loqmansamani.github.io/torchdiff
10
+ Project-URL: Documentation, https://torchdiff.readthedocs.io/en/latest/
11
+ Project-URL: Source, https://github.com/LoqmanSamani/TorchDiff
12
+ Keywords: diffusion models,pytorch,machine learning,deep learning
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: License :: OSI Approved :: MIT License
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Intended Audience :: Developers
19
+ Classifier: Intended Audience :: Science/Research
20
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
21
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
+ Requires-Python: >=3.10
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Requires-Dist: lpips>=0.1.4
26
+ Requires-Dist: pytorch-fid>=0.3.0
27
+ Requires-Dist: torch>=2.0.0
28
+ Requires-Dist: torchvision>=0.15.0
29
+ Requires-Dist: tqdm>=4.60.0
30
+ Requires-Dist: transformers>=4.20.0
31
+ Requires-Dist: torchmetrics>=1.0.0
32
+ Provides-Extra: test
33
+ Requires-Dist: pytest>=7.0.0; extra == "test"
34
+ Requires-Dist: pytest-cov>=4.0.0; extra == "test"
35
+ Provides-Extra: dev
36
+ Requires-Dist: black; extra == "dev"
37
+ Requires-Dist: flake8; extra == "dev"
38
+ Requires-Dist: mypy; extra == "dev"
39
+ Dynamic: author
40
+ Dynamic: author-email
41
+ Dynamic: classifier
42
+ Dynamic: description
43
+ Dynamic: description-content-type
44
+ Dynamic: home-page
45
+ Dynamic: keywords
46
+ Dynamic: license
47
+ Dynamic: license-file
48
+ Dynamic: project-url
49
+ Dynamic: provides-extra
50
+ Dynamic: requires-dist
51
+ Dynamic: requires-python
52
+ Dynamic: summary
53
+
54
+ # TorchDiff
55
+
56
+ <div align="center">
57
+ <img src="https://github.com/LoqmanSamani/TorchDiff/blob/systembiology/imgs/logo_.png?raw=true" alt="TorchDiff Logo" width="300"/>
58
+ </div>
59
+
60
+ <div align="center">
61
+
62
+ [![License: MIT](https://img.shields.io/badge/license-MIT-red?style=plastic)](https://opensource.org/licenses/MIT)
63
+ [![PyTorch](https://img.shields.io/badge/PyTorch-white?style=plastic&logo=pytorch&logoColor=red)](https://pytorch.org/)
64
+ [![Version](https://img.shields.io/badge/version-2.5.0-blue?style=plastic)](https://pypi.org/project/torchdiff/)
65
+ [![Python](https://img.shields.io/badge/python-3.10%2B-blue?style=plastic&logo=python&logoColor=white)](https://www.python.org/)
66
+ [![Downloads](https://pepy.tech/badge/torchdiff)](https://pepy.tech/project/torchdiff)
67
+ [![Stars](https://img.shields.io/github/stars/LoqmanSamani/TorchDiff?style=plastic&color=yellow)](https://github.com/LoqmanSamani/TorchDiff)
68
+ [![Forks](https://img.shields.io/github/forks/LoqmanSamani/TorchDiff?style=plastic&color=orange)](https://github.com/LoqmanSamani/TorchDiff)
69
+ [![Issues](https://img.shields.io/github/issues/LoqmanSamani/TorchDiff?style=plastic&color=red)](https://github.com/LoqmanSamani/TorchDiff/issues)
70
+
71
+ </div>
72
+
73
+ ---
74
+
75
+ ## Overview
76
+
77
+ **TorchDiff** is a PyTorch library for diffusion models, implementing foundational architectures from recent research. The library provides modular components for building, training, and sampling from diffusion-based generative models.
78
+
79
+ Version 2.5.0 includes five major model families grounded in the diffusion modeling literature. **DDPM** (Ho et al., 2020) and **DDIM** (Song et al., 2021a) establish the core discrete-time framework. **SDE-based diffusion** (Song et al., 2021b) extends this to continuous stochastic processes with variance-exploding and variance-preserving formulations. **LDM** (Rombach et al., 2022) moves diffusion into learned latent spaces via variational autoencoders. **UnCLIP** (Ramesh et al., 2022) combines CLIP embeddings with hierarchical generation for text-to-image synthesis.
80
+
81
+ <div align="center">
82
+ <img src="https://github.com/LoqmanSamani/TorchDiff/blob/systembiology/imgs/mount.png?raw=true" alt="Diffusion Model Process" width="1000"/>
83
+ <br>
84
+ <em>Image generated using Sora</em>
85
+ <br><br>
86
+ </div>
87
+
88
+ Each model breaks down into reusable components. Forward diffusion modules gradually add noise following model-specific schedules. Reverse diffusion modules learn to denoise through parameterized score functions or direct prediction. Schedulers control variance schedules across timesteps. Training pipelines handle optimization and loss computation. Sampling routines implement inference algorithms ranging from ancestral sampling to deterministic ODEs.
89
+
90
+ The library includes two main architectural components. **DiffusionNetwork** provides a U-Net variant with temporal embeddings, cross-attention mechanisms, and residual blocks adapted from stable diffusion architectures. **TextEncoder** wraps transformer models like BERT for conditional generation tasks.
91
+
92
+ We also provide evaluation utilities including standard metrics (MSE, PSNR, SSIM) and perceptual measures (FID, LPIPS) commonly used in generative modeling research.
93
+
94
+ ---
95
+
96
+ ## What's New in v2.5.0
97
+
98
+ - **UnCLIP improvements**: Fixed CLIPContextProjection output dimension handling, corrected sampling loop index arithmetic, resolved NaN loss in upsampler/prior training via bfloat16 autocast, and fixed CLIPEmbeddingProjection reconstruction loss bug.
99
+ - **Expanded test coverage**: Added test suites for LDM (AutoencoderLDM), UnCLIP (Scheduler, Forward/Reverse, Projections, TransformerPrior), and Utils (DiffusionNetwork, loss functions, Metrics).
100
+ - **API completeness**: `TrainUnCLIPPrior` now properly exported; removed duplicate `SampleUnCLIP` import.
101
+ - **Documentation**: Aligned all RST titles, added `torchmetrics` to mock imports for ReadTheDocs builds.
102
+ - **Build fixes**: Corrected ReadTheDocs URL in setup.py, removed trailing commas from requirements.txt, unified README for both GitHub and PyPI.
103
+
104
+ ---
105
+
106
+ ## Installation
107
+
108
+ Install the stable release from PyPI.
109
+
110
+ ```bash
111
+ pip install torchdiff
112
+ ```
113
+
114
+ For development or to access the latest features, install from source.
115
+
116
+ ```bash
117
+ git clone https://github.com/LoqmanSamani/TorchDiff.git
118
+ cd TorchDiff
119
+ pip install -r requirements.txt
120
+ pip install .
121
+ ```
122
+
123
+ The library requires Python 3.10 or newer. GPU acceleration requires PyTorch with appropriate CUDA support for your hardware.
124
+
125
+ ---
126
+
127
+ ## Quick Start
128
+
129
+ Here we demonstrate basic DDPM training and sampling on CIFAR-10. The example shows the typical workflow of initializing schedulers, diffusion processes, and networks before training.
130
+
131
+ ```python
132
+ import torch
133
+ import torch.nn as nn
134
+ from torchvision import datasets, transforms
135
+ from torch.utils.data import DataLoader
136
+
137
+ from torchdiff.ddpm import (SchedulerDDPM, ForwardDDPM,
138
+ ReverseDDPM, TrainDDPM, SampleDDPM)
139
+ from torchdiff.utils import DiffusionNetwork, mse_loss
140
+
141
+ # Prepare CIFAR-10 dataset
142
+ transform = transforms.Compose([
143
+ transforms.Resize(32),
144
+ transforms.ToTensor(),
145
+ transforms.Normalize((0.5,), (0.5,))
146
+ ])
147
+ train_dataset = datasets.CIFAR10(
148
+ root="./data", train=True, download=True, transform=transform
149
+ )
150
+ train_loader = DataLoader(
151
+ train_dataset, batch_size=64, shuffle=True
152
+ )
153
+ device = 'cuda'
154
+
155
+ # Initialize diffusion network
156
+ diff_net = DiffusionNetwork(
157
+ in_channels=3,
158
+ down_channels=[32, 64, 128],
159
+ mid_channels=[128, 128],
160
+ up_channels=[128, 64, 32],
161
+ down_sampling=[True, True],
162
+ time_embed_dim=128,
163
+ y_embed_dim=128,
164
+ num_down_blocks=2,
165
+ num_mid_blocks=2,
166
+ num_up_blocks=2,
167
+ dropout_rate=0.1,
168
+ cont_time=False
169
+ )
170
+ print(f"Model parameters: {sum(p.numel() for p in diff_net.parameters()):,}")
171
+
172
+ # Configure diffusion process
173
+ scheduler = SchedulerDDPM(time_steps=400)
174
+ forward_process = ForwardDDPM(scheduler, 'noise')
175
+ reverse_process = ReverseDDPM(scheduler, 'noise')
176
+
177
+ # Setup training
178
+ optimizer = torch.optim.Adam(diff_net.parameters(), lr=1e-5)
179
+ trainer = TrainDDPM(
180
+ diff_net=diff_net,
181
+ fwd_ddpm=forward_process,
182
+ rwd_ddpm=reverse_process,
183
+ train_loader=train_loader,
184
+ optim=optimizer,
185
+ loss_fn=mse_loss,
186
+ max_epochs=10,
187
+ device=device,
188
+ grad_acc=2
189
+ )
190
+ trainer()
191
+
192
+ # Generate samples
193
+ sampler = SampleDDPM(
194
+ rwd_ddpm=reverse_process,
195
+ diff_net=diff_net,
196
+ img_size=(32, 32),
197
+ batch_size=10,
198
+ in_channels=3,
199
+ device=device
200
+ )
201
+ images = sampler()
202
+ ```
203
+
204
+ Additional examples covering conditional generation, latent diffusion, and SDE variants are available in the [examples/](https://github.com/LoqmanSamani/TorchDiff/tree/systembiology/examples) directory.
205
+
206
+ ---
207
+
208
+ ## Model Implementations
209
+
210
+ ### Denoising Diffusion Probabilistic Models (DDPM)
211
+
212
+ DDPM (Ho et al., 2020) frames generation as learning to reverse a Markov chain that gradually corrupts data with Gaussian noise. The forward process follows a fixed variance schedule while the reverse process is learned through a neural network that predicts either noise or the denoised sample at each timestep.
213
+
214
+ The implementation supports both unconditional generation and conditional variants where generation is guided by auxiliary information like class labels or text embeddings.
215
+
216
+ **Paper:** [Denoising Diffusion Probabilistic Models](https://arxiv.org/abs/2006.11239)
217
+ **Example:** [DDPM Notebook](https://github.com/LoqmanSamani/TorchDiff/blob/systembiology/examples/ddpm/ddpm.ipynb)
218
+
219
+ ---
220
+
221
+ ### Denoising Diffusion Implicit Models (DDIM)
222
+
223
+ DDIM (Song et al., 2021a) reformulates the generative process as a non-Markovian procedure that allows deterministic sampling. This enables faster generation by skipping timesteps while maintaining sample quality. The key insight is that many forward processes can correspond to the same reverse process marginals.
224
+
225
+ Like DDPM, both conditional and unconditional generation modes are supported.
226
+
227
+ **Paper:** [Denoising Diffusion Implicit Models](https://arxiv.org/abs/2010.02502)
228
+ **Example:** [DDIM Notebook](https://github.com/LoqmanSamani/TorchDiff/blob/systembiology/examples/ddim/ddim.ipynb)
229
+
230
+ ---
231
+
232
+ ### Score-Based Generative Models via SDE
233
+
234
+ The SDE framework (Song et al., 2021b) generalizes diffusion models as continuous-time stochastic processes. Rather than discrete timesteps, the model learns score functions for a continuous diffusion process governed by stochastic differential equations.
235
+
236
+ We implement variance-exploding (VE), variance-preserving (VP), and sub-VP formulations. The reverse process can be simulated using either stochastic differential equations or their deterministic probability flow ODE counterparts. This unifies score matching with denoising diffusion and enables more flexible sampling strategies.
237
+
238
+ **Paper:** [Score-Based Generative Modeling through Stochastic Differential Equations](https://arxiv.org/abs/2011.13456)
239
+ **Example:** [SDE Notebooks](https://github.com/LoqmanSamani/TorchDiff/blob/systembiology/examples/sde/)
240
+
241
+ ---
242
+
243
+ ### Latent Diffusion Models (LDM)
244
+
245
+ LDM (Rombach et al., 2022) addresses the computational cost of pixel-space diffusion by operating in the latent space of a pretrained autoencoder. A VAE first compresses images into lower-dimensional representations where diffusion training occurs. This reduces memory requirements and speeds up both training and sampling while maintaining generation quality.
246
+
247
+ Any of the diffusion backends (DDPM, DDIM, SDE) can operate in this latent space. The architecture enables high-resolution synthesis that would be impractical in pixel space.
248
+
249
+ **Paper:** [High-Resolution Image Synthesis with Latent Diffusion Models](https://arxiv.org/abs/2112.10752)
250
+ **Example:** [LDM Notebook](https://github.com/LoqmanSamani/TorchDiff/blob/systembiology/examples/ldm/ldm.ipynb)
251
+
252
+ ---
253
+
254
+ ### UnCLIP (Hierarchical Text-Conditional Generation)
255
+
256
+ UnCLIP (Ramesh et al., 2022) is the architecture underlying DALL·E 2. The model performs text-to-image generation in two stages. First, a prior model maps text embeddings to CLIP image embeddings. Then a decoder performs diffusion in pixel space conditioned on these CLIP embeddings.
257
+
258
+ This hierarchical approach leverages CLIP's multimodal embedding space where text and images share semantic structure. The architecture requires training multiple components including the prior network, the diffusion decoder, and often super-resolution upsampling modules.
259
+
260
+ Given the complexity, UnCLIP training requires more extensive setup than other models in this library.
261
+
262
+ **Paper:** [Hierarchical Text-Conditional Image Generation with CLIP Latents](https://arxiv.org/abs/2204.06125)
263
+ **Example:** [UnCLIP Notebook](https://github.com/LoqmanSamani/TorchDiff/blob/systembiology/examples/unclip/unclip.ipynb)
264
+
265
+ ---
266
+
267
+ ## Modular Design
268
+
269
+ TorchDiff breaks each model into reusable components:
270
+
271
+ | Component | Description |
272
+ |-----------|-------------|
273
+ | **Forward Diffusion** | Adds noise to data following model-specific schedules |
274
+ | **Reverse Diffusion** | Removes noise to recover data via learned denoising |
275
+ | **Scheduler** | Controls variance/noise schedules across timesteps |
276
+ | **Training** | Complete training pipelines with mixed precision, gradient accumulation |
277
+ | **Sampling** | Efficient inference and image generation routines |
278
+
279
+ Additional utilities:
280
+ - **DiffusionNetwork**: U-Net architecture with attention and time embeddings
281
+ - **TextEncoder**: Transformer-based encoder for conditional generation
282
+ - **Metrics**: Evaluation suite (MSE, PSNR, SSIM, FID, LPIPS)
283
+ - **Loss Functions**: MSE, SNR-capped, VE sigma-weighted score matching
284
+
285
+ ---
286
+
287
+ ## Resources
288
+
289
+ Documentation and additional materials are available online.
290
+
291
+ - **Project Website:** [loqmansamani.github.io/torchdiff](https://loqmansamani.github.io/torchdiff/)
292
+ - **API Documentation:** [torchdiff.readthedocs.io](https://torchdiff.readthedocs.io/en/latest/index.html)
293
+
294
+ ---
295
+
296
+ ## Development Roadmap
297
+
298
+ We are actively developing TorchDiff with several improvements planned for future releases.
299
+
300
+ **Model Extensions**
301
+ New diffusion variants and training algorithms from recent literature will be added as they become established. We are particularly interested in methods that improve sample efficiency or generation quality.
302
+
303
+ **Performance Optimization**
304
+ Sampling speed and memory efficiency remain active areas of research. We plan to integrate faster sampling methods and more efficient architectures as they emerge.
305
+
306
+ **Experimental Utilities**
307
+ Additional tools for hyperparameter tuning, ablation studies, and model comparison will make experimentation more straightforward.
308
+
309
+ ---
310
+
311
+ ## Contributing
312
+
313
+ Contributions are welcome. If you find bugs or have feature requests, please open an [issue](../../issues). Pull requests with improvements or new implementations are appreciated.
314
+
315
+ Community feedback helps guide development priorities and ensures the library remains useful for research.
316
+
317
+ ---
318
+
319
+ ## License
320
+
321
+ TorchDiff is released under the [MIT License](https://github.com/LoqmanSamani/TorchDiff/blob/systembiology/LICENSE).
322
+
323
+ ---
324
+
325
+ ## Citation
326
+
327
+ If you use TorchDiff in your research, please cite the relevant papers and this repository.
328
+
329
+ ### Diffusion Model Papers
330
+
331
+ ```bibtex
332
+ @article{ho2020denoising,
333
+ title={Denoising Diffusion Probabilistic Models},
334
+ author={Ho, Jonathan and Jain, Ajay and Abbeel, Pieter},
335
+ journal={Advances in Neural Information Processing Systems},
336
+ year={2020}
337
+ }
338
+
339
+ @article{song2021denoising,
340
+ title={Denoising Diffusion Implicit Models},
341
+ author={Song, Jiaming and Meng, Chenlin and Ermon, Stefano},
342
+ journal={International Conference on Learning Representations},
343
+ year={2021}
344
+ }
345
+
346
+ @article{song2021score,
347
+ title={Score-Based Generative Modeling through Stochastic Differential Equations},
348
+ author={Song, Yang and Sohl-Dickstein, Jascha and Kingma, Diederik P and Kumar, Abhishek and Ermon, Stefano and Poole, Ben},
349
+ journal={International Conference on Learning Representations},
350
+ year={2021}
351
+ }
352
+
353
+ @article{rombach2022high,
354
+ title={High-Resolution Image Synthesis with Latent Diffusion Models},
355
+ author={Rombach, Robin and Blattmann, Andreas and Lorenz, Dominik and Esser, Patrick and Ommer, Björn},
356
+ journal={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
357
+ year={2022}
358
+ }
359
+
360
+ @article{ramesh2022hierarchical,
361
+ title={Hierarchical Text-Conditional Image Generation with CLIP Latents},
362
+ author={Ramesh, Aditya and Pavlov, Mikhail and Goh, Gabriel and Gray, Scott and Voss, Chelsea and Radford, Alec and Chen, Mark and Sutskever, Ilya},
363
+ journal={arXiv preprint arXiv:2204.06125},
364
+ year={2022}
365
+ }
366
+ ```
367
+
368
+ ### TorchDiff Repository
369
+
370
+ ```bibtex
371
+ @misc{torchdiff2025,
372
+ author = {Samani, Loghman},
373
+ title = {TorchDiff: A Modular Diffusion Modeling Library in PyTorch},
374
+ year = {2025},
375
+ publisher = {GitHub},
376
+ journal = {GitHub repository},
377
+ howpublished = {\url{https://github.com/LoqmanSamani/TorchDiff}}
378
+ }
379
+ ```