> ## Documentation Index
> Fetch the complete documentation index at: https://docs.remyx.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# huggingface/diffusers

> Two training-free high-resolution methods for FLUX, one shipped as a community pipeline and one proposed as a hook, with the placement decision raised with maintainers first.

Two complementary routes to 4K generation from off-the-shelf **FLUX** checkpoints, with no fine-tuning and no new weights, surfaced from arXiv, prototyped by Outrider, and taken toward `huggingface/diffusers`. The pair puts the same problem, training-free high resolution on a RoPE DiT, into two different library shapes. The choice of shape is itself the contribution.

> [!NOTE]
>
> Status as of November 2026. The linked PRs and Issues are the live record.

## 1. HRDiT: community pipeline, closed unmerged

| | |
| - | - |
| **Paper** | HRDiT, *Training-free high-resolution generation*, [arXiv:2608.07003](https://arxiv.org/abs/2608.07003); reference repo [zylwithxy/HRDiT](https://github.com/zylwithxy/HRDiT) (MIT) |
| **Upstream PR** | [`huggingface/diffusers#14480`](https://github.com/huggingface/diffusers/pull/14480), closed 2026-09-02 by the repo's automation because no issue was linked; it can be reopened once the placement question in [#14520](https://github.com/huggingface/diffusers/issues/14520) settles |

4K (up to 4096²) from off-the-shelf FLUX.1-dev, with no fine-tuning, via NTK-aware RoPE scaling, monotonic bundle coarsening (SPA), and a structure-guided progressive ladder. Users get 4K straight from the base checkpoint instead of the generate-then-upscale or train-a-high-res-model workarounds.

Submitted as a **self-contained community pipeline** (`examples/community/pipeline_flux_hrdit.py`) with no core-library changes. Built minimal-first: a position-alignment port established parity, then NTK RoPE scaling and structure guidance were layered onto only the stages that needed them. The speed-oriented HAP and DWT stages were documented and deferred, not shipped.

## 2. DyPE (plus optional spectral attention): hook, proposed

| | |
| - | - |
| **Papers** | DyPE, *Dynamic Position Extrapolation*, [arXiv:2510.20766](https://arxiv.org/abs/2510.20766); SEGA, *Spectral-Energy Guided Attention*, [arXiv:2605.22668](https://arxiv.org/abs/2605.22668) |
| **Upstream Issue** | [`huggingface/diffusers#14520`](https://github.com/huggingface/diffusers/issues/14520), placement proposal |

`apply_dype(pipe.transformer)` swaps the transformer's rotary embedding for a timestep-aware YaRN / NTK-by-parts schedule (`method="yarn"`), a no-op at or below the trained resolution. `method="spectral"` adds a per-frequency, content-aware attention temperature computed from the latent's spectral energy at each denoising step.

Validated on FLUX.1-Krea-dev at 4096²:

* `method="yarn"` reproduces the reference implementation ([guyyariv/DyPE](https://github.com/guyyariv/DyPE), MIT) bit for bit (Δ=0 on the positional-embedding output).
* `method="spectral"` cuts flat-sky high-frequency speckle about 6× (Laplacian variance 76.5 → 12.7) while keeping fine detail, a separation a single scalar attention temperature can't achieve.

![Sky speckle comparison between the yarn and spectral methods](https://mintcdn.com/remyxai/tTKg7dmpknqQ3oqG/images/case-studies/diffusers/spectral_speckle.png?fit=max\&auto=format\&n=tTKg7dmpknqQ3oqG\&q=85\&s=6d13e30bdfeb0f145d4dc6b929410ce9)

DyPE spectral attention: sky speckle, yarn vs spectral

State (the timestep, and for `spectral` the latent's spectral profiles) is fed through a native `register_forward_pre_hook`, so it survives `enable_model_cpu_offload`. The spectral mode implements SEGA but is exposed as `method="spectral"` to avoid colliding with the existing Semantic-Guidance "SEGA" in diffusers.

## Calibrated shape: the real contribution

HRDiT self-contains cleanly as a community pipeline. DyPE, by contrast, modifies a model internal (the positional embedding) at inference, the same surface as diffusers' core hooks (`apply_faster_cache`, `apply_pyramid_attention_broadcast`). But training-free high-resolution methods have also historically landed as community pipelines (DemoFusion). Precedent points both ways, so the placement is raised with the maintainers in [#14520](https://github.com/huggingface/diffusers/issues/14520) **before** opening the PR rather than assumed.

A pipeline-level caveat surfaced during validation: above about 2K, FLUX's default flow-matching shift (`mu`) grows with sequence length and collapses the sigma schedule, so both methods pin `base_shift == max_shift`. It's documented as a usage step, since a positional-embedding hook can't reach the pipeline's scheduler.

## Outrider's role

Both methods were surfaced from arXiv and drafted by Outrider; DyPE through a [brief-anchored run](https://docs.remyx.ai/platform/agents/outrider-run-modes.md#run-from-a-design-brief). The draft is the start. Parity checking, the spectral port, the shift and offload fixes, the rebase onto current `main`, and the maintainer-facing framing were the substantial follow-on. What Outrider removes is the cold start: turning "this paper looks relevant" into a wired, testable branch to harden.

## References

* Listed under other public work on [remyx.ai/case-study](https://remyx.ai/case-study)

* HRDiT: [arXiv:2608.07003](https://arxiv.org/abs/2608.07003) · [huggingface/diffusers#14480](https://github.com/huggingface/diffusers/pull/14480)

* DyPE: [arXiv:2510.20766](https://arxiv.org/abs/2510.20766) · [guyyariv/DyPE](https://github.com/guyyariv/DyPE) (MIT)

* SEGA: [arXiv:2605.22668](https://arxiv.org/abs/2605.22668) · [wildminder/ComfyUI-DyPE](https://github.com/wildminder/ComfyUI-DyPE) (Apache-2.0)

* Placement proposal: [huggingface/diffusers#14520](https://github.com/huggingface/diffusers/issues/14520)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.