Feature: Add DyPE (Dynamic Position Extrapolation) support to FLUX models for improved high-resolution image generation#8763
Merged
lstein merged 16 commits intoinvoke-ai:mainfrom Jan 27, 2026
Conversation
Add detailed plan for porting ComfyUI-DyPE (Dynamic Position Extrapolation) to InvokeAI, enabling 4K+ image generation with FLUX models without training. Estimated effort: 5-7 developer days.
- Integrate DyPE directly into FluxDenoise (no separate node) - Add 4K preset and "auto" mode for automatic activation - Confirm FLUX Schnell support (same base resolution as Dev)
FLUX can handle resolutions up to ~1.5x natively without artifacts. Set activation_threshold=1536 so DyPE only kicks in above that.
Add Dynamic Position Extrapolation (DyPE) support to FLUX models, enabling artifact-free generation at 4K+ resolutions. New files: - invokeai/backend/flux/dype/base.py: DyPEConfig and scaling calculations - invokeai/backend/flux/dype/rope.py: DyPE-enhanced RoPE functions - invokeai/backend/flux/dype/embed.py: DyPEEmbedND position embedder - invokeai/backend/flux/dype/presets.py: Presets (off, auto, 4k) - invokeai/backend/flux/extensions/dype_extension.py: Pipeline integration Modified files: - invokeai/backend/flux/denoise.py: Add dype_extension parameter - invokeai/app/invocations/flux_denoise.py: Add UI parameters UI parameters: - dype_preset: off | auto | 4k - dype_scale: Custom magnitude override (0-8) - dype_exponent: Custom decay speed override (0-1000) Auto mode activates DyPE for resolutions > 1536px. Based on: https://github.com/wildminder/ComfyUI-DyPE
Merged main to get latest changes including: - FLUX scheduler support (heun, lcm) - Z-Image Seed Variance Enhancer - Canvas transform smoothing - Various fixes and improvements DyPE now works with both the original Euler sampler and the new diffusers scheduler support.
Add Linear UI integration for FLUX DyPE (Dynamic Position Extrapolation): - Add ParamFluxDypePreset component with Off/Auto/4K options - Integrate preset selector in GenerationSettingsAccordion for FLUX models - Add state management (paramsSlice, types) for fluxDypePreset - Add dype_preset to FLUX denoise graph builder and metadata - Add translations for DyPE preset label and popover - Add zFluxDypePresetField schema definition Fix DyPE frequency computation: - Remove incorrect mscale multiplication on frequencies - Use only NTK-aware theta scaling for position extrapolation
- Add FluxDypePreset handler to ImageMetadataHandlers - Parse dype_preset from metadata and dispatch setFluxDypePreset on recall - Add translation key metadata.dypePreset
Remove internal planning document from the branch.
JPPhoto
reviewed
Jan 13, 2026
JPPhoto
reviewed
Jan 13, 2026
Version bump for dype_preset field addition.
Collaborator
Collaborator
|
I also wonder if this should be part of the standard metadata that can be recalled. Thoughts? |
Collaborator
Author
The Recall should be working. |
Shorten the label from "DyPE (High-Res)" to "DyPE" to prevent text truncation in the sidebar. The high-resolution context is preserved in the informational popover tooltip.
The dype_preset metadata was being saved but not displayed in the Recall Parameters tab. Add FluxDypePreset handler to ImageMetadataActions so users can see and recall this parameter.
1 task
Resolved conflicts: - buildFLUXGraph.ts: Added dype_preset to standard FLUX denoise node and metadata (not FLUX.2 Klein which uses different architecture) - GenerationSettingsAccordion.tsx: Combined DyPE preset UI with Flux2 scheduler support
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.
Summary
Add DyPE (Dynamic Position Extrapolation) support to FLUX models for improved high-resolution image generation.
Features:
Technical Details:
theta_scaled = theta * scale^(dim/(dim-2))Related Issues / Discussions
DyPE paper: Dynamic Position Extrapolation for high-resolution diffusion models
#8654
QA Instructions
Merge Plan
Standard merge. Redux slice changes include new
fluxDypePresetstate field.Checklist
What's Newcopy (if doing a release after this PR)