Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
bb70cab
initial
kashif Dec 16, 2025
f4990a9
use the scheduler
kashif Dec 16, 2025
c74d66d
added Block-wise sampling
kashif Dec 16, 2025
9a9470c
add hybrid
kashif Dec 16, 2025
886a76d
hybrid sample training
kashif Dec 16, 2025
6f94f4f
initial trainer
kashif Dec 20, 2025
c1bf227
added llada2
kashif Jan 1, 2026
f2b9223
add sample_llada2.py
kashif Jan 1, 2026
cf18acd
added api
kashif Jan 4, 2026
9209924
fix llada2 sampling
kashif Jan 4, 2026
5835d2c
formatting
kashif Jan 4, 2026
264886a
Merge branch 'main' into diff-d2
kashif Jan 6, 2026
541c03b
Merge branch 'main' into diff-d2
kashif Jan 11, 2026
1b3ffd7
make fix-copies
kashif Jan 11, 2026
c263f16
fix docs
kashif Jan 11, 2026
b97e11c
add dflash pipeline
kashif Jan 11, 2026
471bfd3
added SDAR JET pipeline and scheduler
kashif Jan 11, 2026
ec4b2a4
Merge branch 'main' into diff-d2
kashif Jan 12, 2026
2f8a48b
Merge branch 'main' into diff-d2
kashif Jan 18, 2026
3772ca1
Merge branch 'main' into diff-d2
kashif Jan 19, 2026
be16390
Merge branch 'main' into diff-d2
kashif Feb 4, 2026
3a4ea4d
Merge branch 'main' into diff-d2
kashif Feb 9, 2026
88fe29d
initial review changes
kashif Feb 9, 2026
61fdfda
add discrete diffusion mixin
kashif Feb 9, 2026
939c7ef
Pre-compute alpha schedule and Restructure step() with if/elif/else f…
kashif Feb 9, 2026
597060d
merge BlockTokenDiffusionScheduler into TokenDiffusionScheduler
kashif Feb 9, 2026
20b1134
support for llada 2.1
kashif Feb 10, 2026
70fc4c1
fix sampling example to use pipeline
kashif Feb 10, 2026
0432b80
formatting
kashif Feb 10, 2026
44ef84f
Merge branch 'main' into diff-d2
kashif Feb 20, 2026
9a7f643
Merge branch 'main' into diff-d2
kashif Feb 27, 2026
f4b3e1f
Merge branch 'main' into diff-d2
kashif Mar 8, 2026
4e70227
fix imports
kashif Mar 8, 2026
654f7b8
Merge branch 'main' into diff-d2
kashif Mar 15, 2026
ae25ba1
fix: port fixes from llada2-support branch
kashif Mar 15, 2026
cfc36c0
Remove llada2/block_refinement files that now exist in main
kashif Mar 25, 2026
d89c4b7
Merge branch 'main' into diff-d2
kashif Mar 25, 2026
50878e5
Refactor discrete diffusion pipelines to follow LLaDA2 conventions
kashif Mar 25, 2026
a112493
fix: rename denoising_steps to num_inference_steps, remove attention_…
kashif Mar 25, 2026
6aa3e52
Add tests for DFlash and SDAR pipelines and schedulers
kashif Mar 25, 2026
1d96bbe
Clean up DiscreteDiffusionPipelineMixin: remove sampling methods, LLa…
kashif Mar 25, 2026
4cd7dd6
fix: remove stale BlockRefinementPipeline refs, clean up tracked files
kashif Mar 25, 2026
3b1f34e
remove misc files from git tracking
kashif Mar 25, 2026
f6bd0d0
remove unified_latents from git tracking
kashif Mar 25, 2026
fbfbc5e
remove autoencoder_ul.py from git tracking
kashif Mar 25, 2026
9769517
remove test_models_autoencoder_ul and test_attention_dispatch from gi…
kashif Mar 25, 2026
83d1e6a
restore scripts/ from main
kashif Mar 25, 2026
970753e
remove sample_bd3lm.py from git tracking
kashif Mar 25, 2026
ef1f521
remove bd3lm.md from git tracking
kashif Mar 25, 2026
1e7ebc4
remove bd3lm_token_diffusion.md from git tracking
kashif Mar 25, 2026
6b1bb4b
WIP: Add BD3LM pipeline and scheduler (needs scheduler integration in…
kashif Mar 25, 2026
2231977
BD3LM pipeline and scheduler: working end-to-end with scheduler.step …
kashif Mar 25, 2026
47e6af8
BD3LM: fix sampling with kv_cache and subs parameterization
kashif Mar 27, 2026
99a1b22
BD3LM: apply all LLaDA2 PR conventions, add tests
kashif Mar 27, 2026
f7a0eb1
style: formatting fixes from make style
kashif Mar 27, 2026
1afd5ef
DFlash: resolve mask_token_id from config.dflash_config
kashif Mar 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions docs/source/en/_toctree.yml
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,8 @@
title: AuraFlow
- local: api/pipelines/blip_diffusion
title: BLIP-Diffusion
- local: api/pipelines/block_refinement
title: Block Refinement
- local: api/pipelines/bria_3_2
title: Bria 3.2
- local: api/pipelines/bria_fibo
Expand Down Expand Up @@ -542,6 +544,8 @@
title: DDPM
- local: api/pipelines/deepfloyd_if
title: DeepFloyd IF
- local: api/pipelines/dflash
title: DFlash
- local: api/pipelines/diffedit
title: DiffEdit
- local: api/pipelines/dit
Expand All @@ -562,6 +566,8 @@
title: Hunyuan-DiT
- local: api/pipelines/hunyuanimage21
title: HunyuanImage2.1
- local: api/pipelines/hybrid_token_diffusion
title: Hybrid Token Diffusion
- local: api/pipelines/pix2pix
title: InstructPix2Pix
- local: api/pipelines/kandinsky
Expand Down Expand Up @@ -614,6 +620,8 @@
title: Sana Sprint
- local: api/pipelines/sana_video
title: Sana Video
- local: api/pipelines/sdar
title: SDAR
- local: api/pipelines/self_attention_guidance
title: Self-Attention Guidance
- local: api/pipelines/semantic_stable_diffusion
Expand Down Expand Up @@ -659,6 +667,8 @@
title: Stable Diffusion
- local: api/pipelines/stable_unclip
title: Stable unCLIP
- local: api/pipelines/token_diffusion
title: Token Diffusion
- local: api/pipelines/unclip
title: unCLIP
- local: api/pipelines/unidiffuser
Expand Down Expand Up @@ -697,6 +707,8 @@
title: Kandinsky 5.0 Video
- local: api/pipelines/latte
title: Latte
- local: api/pipelines/llada2
title: LLaDA2
- local: api/pipelines/ltx2
title: LTX-2
- local: api/pipelines/ltx_video
Expand All @@ -720,6 +732,8 @@
- sections:
- local: api/schedulers/overview
title: Overview
- local: api/schedulers/bd3lm_token_diffusion
title: BD3LMTokenDiffusionScheduler
- local: api/schedulers/block_refinement
title: BlockRefinementScheduler
- local: api/schedulers/cm_stochastic_iterative
Expand All @@ -740,6 +754,8 @@
title: DDPMScheduler
- local: api/schedulers/deis
title: DEISMultistepScheduler
- local: api/schedulers/dflash_token_diffusion
title: DFlashTokenDiffusionScheduler
- local: api/schedulers/multistep_dpm_solver_inverse
title: DPMSolverMultistepInverse
- local: api/schedulers/multistep_dpm_solver
Expand All @@ -766,6 +782,8 @@
title: HeliosScheduler
- local: api/schedulers/heun
title: HeunDiscreteScheduler
- local: api/schedulers/hybrid_token_diffusion
title: HybridTokenDiffusionScheduler
- local: api/schedulers/ipndm
title: IPNDMScheduler
- local: api/schedulers/stochastic_karras_ve
Expand All @@ -786,8 +804,12 @@
title: ScoreSdeVeScheduler
- local: api/schedulers/score_sde_vp
title: ScoreSdeVpScheduler
- local: api/schedulers/sdar_token_diffusion
title: SDARTokenDiffusionScheduler
- local: api/schedulers/tcd
title: TCDScheduler
- local: api/schedulers/token_diffusion
title: TokenDiffusionScheduler
- local: api/schedulers/unipc
title: UniPCMultistepScheduler
- local: api/schedulers/vq_diffusion
Expand Down
24 changes: 24 additions & 0 deletions docs/source/en/api/pipelines/dflash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!--Copyright 2025 The HuggingFace Team. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
-->

# DFlash

`DFlashPipeline` performs block-diffusion speculative decoding using a diffusion draft model and a target causal LM.
The draft model is conditioned on target hidden features extracted during prefill and verification steps.

## DFlashPipeline
[[autodoc]] DFlashPipeline
- all
- __call__

## DFlashPipelineOutput
[[autodoc]] pipelines.DFlashPipelineOutput
23 changes: 23 additions & 0 deletions docs/source/en/api/pipelines/hybrid_token_diffusion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!--Copyright 2025 The HuggingFace Team. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
-->

# Hybrid Token Diffusion

`HybridTokenDiffusionPipeline` is an alias of `TokenDiffusionPipeline` for hybrid-transition schedulers.

## HybridTokenDiffusionPipeline
[[autodoc]] HybridTokenDiffusionPipeline
- all
- __call__

## TokenDiffusionPipelineOutput
[[autodoc]] pipelines.TokenDiffusionPipelineOutput
4 changes: 4 additions & 0 deletions docs/source/en/api/pipelines/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,14 @@ The table below lists all the pipelines currently available in 🤗 Diffusers an
| [Dance Diffusion](dance_diffusion) | unconditional audio generation |
| [DDIM](ddim) | unconditional image generation |
| [DDPM](ddpm) | unconditional image generation |
| [DFlash](dflash) | text2text |
| [SDAR](sdar) | text2text |
| [DeepFloyd IF](deepfloyd_if) | text2image, image2image, inpainting, super-resolution |
| [DiffEdit](diffedit) | inpainting |
| [DiT](dit) | text2image |
| [Flux](flux) | text2image |
| [Hunyuan-DiT](hunyuandit) | text2image |
| [Hybrid Token Diffusion](hybrid_token_diffusion) | text2text |
| [I2VGen-XL](i2vgenxl) | image2video |
| [InstructPix2Pix](pix2pix) | image editing |
| [Kandinsky 2.1](kandinsky) | text2image, image2image, inpainting, interpolation |
Expand Down Expand Up @@ -85,6 +88,7 @@ The table below lists all the pipelines currently available in 🤗 Diffusers an
| [T2I-Adapter](stable_diffusion/adapter) | text2image |
| [Text2Video](text_to_video) | text2video, video2video |
| [Text2Video-Zero](text_to_video_zero) | text2video |
| [Token Diffusion](token_diffusion) | text2text |
| [unCLIP](unclip) | text2image, image variation |
| [UniDiffuser](unidiffuser) | text2image, image2text, image variation, text variation, unconditional image generation, unconditional audio generation |
| [Value-guided planning](value_guided_sampling) | value guided sampling |
Expand Down
23 changes: 23 additions & 0 deletions docs/source/en/api/pipelines/sdar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!--Copyright 2025 The HuggingFace Team. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
-->

# SDAR

`SDARPipeline` performs block diffusion decoding with iterative remasking strategies.

## SDARPipeline
[[autodoc]] SDARPipeline
- all
- __call__

## SDARPipelineOutput
[[autodoc]] pipelines.SDARPipelineOutput
24 changes: 24 additions & 0 deletions docs/source/en/api/pipelines/token_diffusion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!--Copyright 2025 The HuggingFace Team. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
-->

# Token Diffusion

`TokenDiffusionPipeline` provides a generic token-space diffusion sampler for discrete denoising over token IDs. It
pairs a token denoiser model with a token diffusion scheduler.

## TokenDiffusionPipeline
[[autodoc]] TokenDiffusionPipeline
- all
- __call__

## TokenDiffusionPipelineOutput
[[autodoc]] pipelines.TokenDiffusionPipelineOutput
22 changes: 22 additions & 0 deletions docs/source/en/api/schedulers/dflash_token_diffusion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!--Copyright 2025 The HuggingFace Team. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
-->

# DFlashTokenDiffusionScheduler

`DFlashTokenDiffusionScheduler` implements the acceptance and posterior sampling logic used in DFlash-style block
diffusion speculative decoding.

## DFlashTokenDiffusionScheduler
[[autodoc]] DFlashTokenDiffusionScheduler

## DFlashTokenDiffusionSchedulerOutput
[[autodoc]] schedulers.scheduling_dflash_token_diffusion.DFlashTokenDiffusionSchedulerOutput
22 changes: 22 additions & 0 deletions docs/source/en/api/schedulers/hybrid_token_diffusion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!--Copyright 2025 The HuggingFace Team. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
-->

# HybridTokenDiffusionScheduler

`HybridTokenDiffusionScheduler` defines hybrid discrete token diffusion updates with separate transitions for
masked and unmasked tokens.

## HybridTokenDiffusionScheduler
[[autodoc]] HybridTokenDiffusionScheduler

## HybridTokenDiffusionSchedulerOutput
[[autodoc]] schedulers.scheduling_hybrid_token_diffusion.HybridTokenDiffusionSchedulerOutput
19 changes: 19 additions & 0 deletions docs/source/en/api/schedulers/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,25 @@ Many schedulers are implemented from the [k-diffusion](https://github.com/crowso
| exponential | init with `timestep_spacing="linspace"`, `use_exponential_sigmas=True` |
| beta | init with `timestep_spacing="linspace"`, `use_beta_sigmas=True` |

## Token diffusion schedulers

These schedulers operate over categorical token IDs instead of continuous latents. They are designed for discrete
token diffusion models and expose the same `set_timesteps`/`step` interface as other schedulers.

Differences between the discrete token schedulers:
- `TokenDiffusionScheduler`: token-level diffusion with per-token corruption (e.g. mask/uniform) and a single-step `step` to denoise logits.
- `HybridTokenDiffusionScheduler`: hybrid transitions that combine token- and block-wise updates in the same schedule.
- `DFlashTokenDiffusionScheduler`: block diffusion scheduler specialized for speculative decoding with a draft model and target acceptance.
- `SDARTokenDiffusionScheduler`: block diffusion scheduler with remasking strategies (sequential/low-confidence/entropy-bounded) per step.

[[autodoc]] TokenDiffusionScheduler

[[autodoc]] HybridTokenDiffusionScheduler

[[autodoc]] DFlashTokenDiffusionScheduler

[[autodoc]] SDARTokenDiffusionScheduler

All schedulers are built from the base [`SchedulerMixin`] class which implements low level utilities shared by all schedulers.

## SchedulerMixin
Expand Down
21 changes: 21 additions & 0 deletions docs/source/en/api/schedulers/sdar_token_diffusion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!--Copyright 2025 The HuggingFace Team. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
-->

# SDARTokenDiffusionScheduler

`SDARTokenDiffusionScheduler` implements block diffusion remasking and sampling for SDAR-style decoding.

## SDARTokenDiffusionScheduler
[[autodoc]] SDARTokenDiffusionScheduler

## SDARTokenDiffusionSchedulerOutput
[[autodoc]] schedulers.scheduling_sdar_token_diffusion.SDARTokenDiffusionSchedulerOutput
22 changes: 22 additions & 0 deletions docs/source/en/api/schedulers/token_diffusion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!--Copyright 2025 The HuggingFace Team. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
-->

# TokenDiffusionScheduler

`TokenDiffusionScheduler` defines discrete token diffusion updates over categorical token IDs and supports multiple
forward processes and alpha schedules.

## TokenDiffusionScheduler
[[autodoc]] TokenDiffusionScheduler

## TokenDiffusionSchedulerOutput
[[autodoc]] schedulers.scheduling_token_diffusion.TokenDiffusionSchedulerOutput
Loading
Loading