Repository navigation
feat(flux2): tile the FLUX.2 VAE encode and decode - #9890
Merged
Merged
Conversation
Adds tiled/tile_size to the FLUX.2 VAE nodes, honours force_tiled_decode and auto_tiled_decode, and retries tiled after OOM. The FLUX.2 working-memory estimate now resolves the tile sentinel and caps the tile to the image.
JPPhoto
approved these changes
Oct 16, 2026
JPPhoto
left a comment
Collaborator
There was a problem hiding this comment.
The documentation should probably mention the different result from a tiled decode. Otherwise, this is good.
# Conflicts: # docs/src/content/docs/configuration/Optimization/low-vram-mode.mdx
lstein
enabled auto-merge (squash)
October 17, 2026 22:30
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
The FLUX.2 VAE nodes were the only VAE family not wired to the shared tiling code.
force_tiled_decodeandauto_tiled_decodeskipped them, and an encode or decode that ran out of memory failed instead of retrying tiled. An untiled FLUX.2 decode costs about 4.3 GB at 1024² and grows with the pixel area, so large images could not be decoded on most cards.flux2_vae_encodeandflux2_vae_decode(1.0.0 → 1.1.0) now behave like the FLUX.1 nodes:tiledandtile_size, with the same defaults and the same 0 = default-tile sentinel.force_tiled_decode: tiles both nodes.auto_tiled_decode: the decode tiles up front when the untiled decode would take most of the GPU.scoped_vae_tiling, so the cached VAE is left as it was.estimate_vae_working_memory_flux2now handles tiles the way the FLUX.1 estimate does:Next step: an Upscale-widget entry for FLUX.2 that runs the pass at 2048²–4096².
Related Issues / Discussions
Prerequisite for FLUX.2 in the Upscale widget (follow-up to #9825 and #9889).
QA Instructions
Automated
pytestontest_flux2_vae_tiling.py(new),test_flux2_working_memory.py,test_flux_vae_encode_tiling.py,test_flux_vae_decode_tiling.py,test_ideogram4_vae_decode.py,test_frontend_graph_node_types.pyandtests/app/services/config: 956 passed, 3 skipped.AutoencoderKLFlux2on CPU. The image is non-square and no side is a multiple of the tile. They check:force_tiled_decode, auto pre-tiling on and off, and the OOM retry with the default tile;force_tiled_decode, the state restore, the retry tile.ruff@0.11.2 check/format --check: pass.openapi.json,schema.tsanddocs/src/generated/settings.jsonare regenerated.GPU (RTX 4090, FLUX.2 Klein 4B fp8, 4 steps, seed 1234, model cache emptied before each graph). Baseline is main's FLUX.2 VAE code.
tiledencode and decodetiledencode and decodeReview
Resolved: the estimator over-reserved for tiles as large as the image or larger (see Summary).
Remaining, shared with the FLUX.1 and Z-Image nodes, and left out of this PR:
tiledon the encode.tile_size. The OOM retry uses the default tile instead. A tile size left over from an earlier run can therefore make the pre-tile a single pass.Compatibility / Rollout
force_tiled_decodeusers: FLUX.2 encode and decode now tile too, as the setting describes.Checklist
What's Newcopy (if doing a release after this PR)Need help on this PR? Tag
@codesmith-botwith what you need.