Skip to content

Align DyPE with the paper as much as possible#8980

Open
JPPhoto wants to merge 1 commit intoinvoke-ai:mainfrom
JPPhoto:dype-paper
Open

Align DyPE with the paper as much as possible#8980
JPPhoto wants to merge 1 commit intoinvoke-ai:mainfrom
JPPhoto:dype-paper

Conversation

@JPPhoto
Copy link
Collaborator

@JPPhoto JPPhoto commented Mar 21, 2026

Summary

Reworks FLUX DyPE to behave more like the paper while preserving the existing invocation surface and preset wiring.

This PR does three things:

  • Aligns the core DyPE math with a paper-style scheduler by replacing the previous repo-specific RoPE scaling heuristic with a direct timestep scheduler in the active vision_yarn path.
  • Keeps DyPE correctly synchronized with the actual denoiser noise schedule across all Flux scheduler paths, including the built-in Euler path and diffusers euler, heun, and lcm.
  • Retunes the area preset so it is no longer overly aggressive with the simpler paper-like DyPE core, which reduces artifact risk on larger and more extreme aspect-ratio outputs.

The implementation stays compatible with the current invocation/UI fields. Internally, the unused DyPE branches were removed, the remaining runtime path was simplified, and tests were added/updated to cover scheduler integration and preset behavior.

Related Issues / Discussions

Attempts to resolve ongoing DyPE issues related to loss of high-resolution detail, stretching, etc.

QA Instructions

Run the targeted tests:

  • pytest tests/backend/flux/dype/test_dype.py
  • pytest tests/backend/flux/test_denoise.py
  • pytest tests/app/invocations/test_flux_denoise.py

Test manually:

  1. Generate FLUX images with DyPE enabled using:
    • scheduler=euler
    • scheduler=heun
    • scheduler=lcm
    • and the built-in Euler path
  2. Compare dype_preset=auto vs. dype_preset=area at different resolutions:
    • 1536x1024
    • 2048x1152
    • 2304x960
  3. Confirm:
    • DyPE runs without scheduler-related errors
    • area is closer to auto in strength than before
    • ultra-wide results no longer use the previous overly aggressive area-based settings

Merge Plan

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable)
  • ❗Changes to a redux slice have a corresponding migration
  • Documentation added / updated (if applicable)
  • Updated What's New copy (if doing a release after this PR)

@github-actions github-actions bot added python PRs that change python files invocations PRs that change invocations backend PRs that change backend files python-tests PRs that change python tests labels Mar 21, 2026
@JPPhoto JPPhoto marked this pull request as draft March 21, 2026 19:28
@JPPhoto
Copy link
Collaborator Author

JPPhoto commented Mar 21, 2026

This still suffers from high-frequency detail loss that probably is going to be a side effect of DyPE. I don't think we'll be able to fix that without veering far from the original implementation again.

@JPPhoto JPPhoto marked this pull request as ready for review March 21, 2026 19:30
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 invocations PRs that change invocations python PRs that change python files python-tests PRs that change python tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant