DyPE (Dynamic Position Extrapolation) enables pre-trained diffusion transformers to generate ultra-high-resolution images far beyond their training scale. It dynamically adjusts positional encodings during denoising to match evolving frequency content—achieving faithful 4K × 4K results without retraining or extra sampling cost.
Create a conda environment and install dependencies:
conda create -n dype python=3.10 conda activate dype pip install -r requirements.txtGenerate ultra-high resolution images with DyPE using the run_dype.py script:
python run_dype.py --prompt "Your text prompt here"Key Arguments:
| Argument | Default | Description |
|---|---|---|
--prompt | Dark fantasy scene | Text prompt for image generation |
--height | 4096 | Image height in pixels |
--width | 4096 | Image width in pixels |
--steps | 28 | Number of inference steps |
--seed | 42 | Random seed for reproducibility |
--method | yarn | Position encoding method: yarn, ntk, or base |
--no_dype | False | Disable DyPE (enabled by default) |
Examples:
# Generate 4K image with default settings (YARN + DyPE) python run_dype.py --prompt "A serene mountain landscape at sunset" # Use NTK method without DyPE python run_dype.py --method ntk --no_dype --prompt "A futuristic city skyline" # Baseline comparison (no position encoding modifications) python run_dype.py --method baseGenerated images will be saved to the outputs/ folder (created automatically).
This work is patent pending. For commercial use or licensing inquiries, please contact the authors.
If you find this useful for your research, please cite the following:
@misc{issachar2025dypedynamicpositionextrapolation, title={DyPE: Dynamic Position Extrapolation for Ultra High Resolution Diffusion}, author={Noam Issachar and Guy Yariv and Sagie Benaim and Yossi Adi and Dani Lischinski and Raanan Fattal}, year={2025}, eprint={2510.20766}, archivePrefix={arXiv}, primaryClass={cs.CV}, url={https://arxiv.org/abs/2510.20766}, }