Skip to content

Add a sampling animation example for discrete diffusion#14164

Open
kashif wants to merge 2 commits into
mainfrom
discrete-diffusion-sampling-animation
Open

Add a sampling animation example for discrete diffusion#14164
kashif wants to merge 2 commits into
mainfrom
discrete-diffusion-sampling-animation

Conversation

@kashif

@kashif kashif commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Adds examples/discrete_diffusion/animate_sampling.py, a small tool to visualize how discrete diffusion language models write text.

It captures the intermediate canvas of every denoising step through each pipeline's callback_on_step_end (no changes to the pipelines) and renders it as a self-contained HTML animation or an animated GIF. The goal is to make the two families easy to compare: LLaDA2 reveals text from [MASK] slots, while DiffusionGemma sharpens a mask-free canvas of random tokens block by block.

For DiffusionGemma you can pick any of the three supported schedulers (entropy_bound, discrete_ddim, block_refinement) to compare them on the same prompt and seed. Trajectories with different step counts are resampled onto a shared timeline so the panels stay in sync, and the highlight colors are color-blind and grayscale safe.

The README has a new section with capture and render commands. The script is also runnable with uv.

@github-actions github-actions Bot added size/L PR with diff > 200 LOC examples and removed size/L PR with diff > 200 LOC labels Jul 10, 2026
@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@github-actions github-actions Bot added the size/L PR with diff > 200 LOC label Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

examples size/L PR with diff > 200 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants