Community Pipeline: Add HRDiT (training-free high-resolution FLUX.1-dev) - #14480
Open
smellslikeml wants to merge 4 commits into
Open
Community Pipeline: Add HRDiT (training-free high-resolution FLUX.1-dev)#14480smellslikeml wants to merge 4 commits into
smellslikeml wants to merge 4 commits into
Conversation
…v pipeline Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: remyx-ai[bot] <289541483+remyx-ai[bot]@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: remyx-ai[bot] <289541483+remyx-ai[bot]@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: remyx-ai[bot] <289541483+remyx-ai[bot]@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: remyx-ai[bot] <289541483+remyx-ai[bot]@users.noreply.github.com>
Contributor
|
Hi @smellslikeml, thanks for the PR! It does not appear to link an issue it fixes. If this PR addresses an existing issue, please add a closing keyword (e.g. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
examples/community/pipeline_flux_hrdit.py— training-free high-resolution image generation for off-the-shelf diffusion transformers, implementing HRDiT (paper, official repo).It generates natively at high resolution (up to 4096×4096) straight from a text prompt on stock FLUX.1-dev — no fine-tuning, no new weights, no separate upscaler model, and no
src/diffuserschanges. Users of the base checkpoint get 4K generation directly, instead of the usual generate-at-1K-then-upscale (or train-a-high-res-model) workaround.This is high-resolution generation, not super-resolution of an existing image — it complements, rather than replaces, image upscalers.
Validation (FLUX.1-dev · A100-80GB · torch 2.11)
Both 2048² and 4096² are coherent — no tiling, no washout. A 4096² generation runs in ~2 min at ~26 GB peak.
Runnable notebook: https://colab.research.google.com/drive/1AU6QNOGDMCPpGdocVyIyKpXXGt3hoWdo?usp=sharing
Method (on top of the stock
FluxPipelinedenoise loop)alpha) with a velocity-momentum term (beta) to hold the coarse structure stable at the highest stage.Out of scope (not needed for the results above; noted in the pipeline docstring): HAP attention pruning,
swin_pachify, and DWT guidance.Scope & generality
HRDiT is a DiT-general technique, not FLUX-specific. SPA operates on the token indices
(i, j)fed to the model's positional function — which, per the paper, "though different mainstream DiT models may differ in their specific implementations… all share a common structure:f_petakes token indices as inputs." So the architecture-agnostic parts of this pipeline —build_bundle_id_variants(SPA on token indices) and the structure-guided progressive ladder — carry over unchanged to other DiTs; only the per-model position scaling differs.Files
examples/community/pipeline_flux_hrdit.py— the pipelineexamples/community/README.md— usage entrytests/others/test_community_pipeline_flux_hrdit.py— CPU-only unit tests (SPA variants, NTK RoPE, structure-guidance helpers; 13 passing)benchmarks/benchmarking_flux_hrdit.py— naiveFluxPipelinevs HRDiT timing / peak memoryDisclosure
AI assistance: this pipeline was drafted and refined with an AI agent (Claude) and validated on GPU at each iteration; a
self-reviewpass was run against the repo's.airubric before submitting. Training-free / adds no weights.Who can review?
@asomoza (community pipelines) — thanks! Happy to adjust anything to match conventions.
Co-authored-by: remyx-ai[bot] <289541483+remyx-ai[bot]@users.noreply.github.com>