Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Hourglass Diffusion Transformers (HDiT)

License: MIT Python Version PyTorch Version

Overview

This repository provides a ​​non-official​​ implementation of the ​​Hourglass Diffusion Transformer (HDiT)​​ model, as proposed in the paper "Scalable High-Resolution Pixel-Space Image Synthesis with Hourglass Diffusion Transformers" by Crowson et al. (ICML 2024).

The original work introduces a diffusion-based transformer architecture capable of generating high-resolution images directly in pixel space, with computational cost scaling linearly with respect to resolution. This package extracts the main HDiT part from the original repository (k-diffusion).

Key Features:

  • Scalable: Supports high-resolution image synthesis.
  • Efficient: Achieves significantly lower computational cost compared to the traditional Diffusion Transformer (DiT).

Installation

Install the package using pip:

pip install hdit

Usage

Example Code:

Initialize the model backbone and use it in the diffusion model.

from hdit import HDiT

model = HDiT(
   in_channels=3,
   out_channels=3,
   patch_size=[4, 4],
   widths=[128, 256],
   middle_width=512,
   depths=[2, 2],
   middle_depth=4,
   mapping_width=256,
   mapping_depth=2
)

Citation

Please cite the original paper. For more details, visit the official​​ arXiv page.

@InProceedings{crowson2024hourglass,
    title = {Scalable High-Resolution Pixel-Space Image Synthesis with Hourglass Diffusion Transformers},
    author = {Crowson, Katherine and Baumann, Stefan Andreas and Birch, Alex and Abraham, Tanishq Mathew and Kaplan, Daniel Z and Shippole, Enrico},
    booktitle = {Proceedings of the 41st International Conference on Machine Learning},
    pages = {9550--9575},
    year = {2024},
    editor = {Salakhutdinov, Ruslan and Kolter, Zico and Heller, Katherine and Weller, Adrian and Oliver, Nuria and Scarlett, Jonathan and Berkenkamp, Felix},
    volume = {235},
    series = {Proceedings of Machine Learning Research},
    month = {21--27 Jul},
    publisher = {PMLR},
    pdf = {https://raw.githubusercontent.com/mlresearch/v235/main/assets/crowson24a/crowson24a.pdf},
    url = {https://proceedings.mlr.press/v235/crowson24a.html},
    abstract = {We present the Hourglass Diffusion Transformer (HDiT), an image-generative model that exhibits linear scaling with pixel count, supporting training at high resolution (e.g. $1024 \times 1024$) directly in pixel-space. Building on the Transformer architecture, which is known to scale to billions of parameters, it bridges the gap between the efficiency of convolutional U-Nets and the scalability of Transformers. HDiT trains successfully without typical high-resolution training techniques such as multiscale architectures, latent autoencoders or self-conditioning. We demonstrate that HDiT performs competitively with existing models on ImageNet $256^2$, and sets a new state-of-the-art for diffusion models on FFHQ-$1024^2$. Code is available at https://github.com/crowsonkb/k-diffusion.}
}

Metadata

Release files for hdit 0.0.1b6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hdit 0.0.1b6
File Size Uploaded
hdit-0.0.1b6.tar.gz 33.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hdit 0.0.1b6
File Interpreter ABI Platform
hdit-0.0.1b6-py3-none-any.whl Python 3 none any Details

Total release size: 69.6 kB

Release files / hdit-0.0.1b6.tar.gz

Download URL hdit-0.0.1b6.tar.gz
Size 33.3 kB
Tags Source
SHA-256 checksum
How to use checksums
35f723cf0955d5217fe16f8e2ad703c7dcd5ec6da7bd7b1a0f661849b58bd1b4
BLAKE2b-256 checksum
How to use checksums
ccca6e00358e0af086661a1a816cb4a73f3202d87ffb64388e3c1ff2530168ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.0

Release files / hdit-0.0.1b6-py3-none-any.whl

Download URL hdit-0.0.1b6-py3-none-any.whl
Size 36.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
de8efd85286b5b50199dbb9306bd2de5098bf29e186e4290d164ab40b70be524
BLAKE2b-256 checksum
How to use checksums
d1c698eb867319a46c310db5be37c842709669f596cc0a0fd0de3b18d9f66924
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.0
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page