-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Feature: Add DyPE (Dynamic Position Extrapolation) support to FLUX models for improved high-resolution image generation #8763
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Pfannkuchensack
wants to merge
11
commits into
invoke-ai:main
Choose a base branch
from
Pfannkuchensack:claude/assess-dype-port-3mt4G
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+1,492
−206
Conversation
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
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
| activation_threshold: int = 1536, | ||
| ) -> DyPEConfig | None: | ||
| """Automatically determine DyPE config based on target resolution. | ||
Collaborator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you experimented with looking at the area of the desired image and comparing to the base area instead of a pure dimensional comparison? Curious if this yields better results for something like 1152x1440 images.
JPPhoto
reviewed
Jan 13, 2026
Version bump for dype_preset field addition.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backend
PRs that change backend files
docs
PRs that change docs
frontend
PRs that change frontend files
invocations
PRs that change invocations
python
PRs that change python files
python-tests
PRs that change python tests
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
QA Instructions
Merge Plan
Standard merge. Redux slice changes include new
fluxDypePresetstate field.Checklist
What's Newcopy (if doing a release after this PR)