Repository navigation
Fix Oobleck tiled encode dropping latent frames (#15376) - #15445
Open
newcloud123 wants to merge 1 commit into
Open
newcloud123 wants to merge 1 commit into
newcloud123 wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Fixes #15376.
What / why
AutoencoderOobleck._tiled_encodederived the encoder's downsampling factor as(win_end - win_start) / tile_lengthfrom the first tile and used it to roundthe left/right trims of every tile. Because the encoder rounds each window's
downsampling independently, that empirical factor is slightly off (e.g.
2051.16instead of the true2048). Rounding both trims with it accumulatesan error at tile seams, so a 1024-frame waveform encoded to 1023 latent
frames with tiling enabled, breaking
StableAudioPipelinewhen adding noise.Fix
self.hop_length(product ofdownsampling_ratios)instead of the empirical factor.
indices with
round(pos / hop), referenced to the same absolute grid forevery tile. Each tile now keeps exactly the frames between
core_startandcore_end, so the concatenated result matches the untiled frame count.Verification
CPU only, random-weight 6-channel VAE, no weights/GPU:
no tiling = [1,3,1024],with tiling = [1,3,1024]after the fix (was
[1,3,1023]before).tests/test_oobleck_tiling_frame_count.pychecking 5 waveform lengths(512/768/1024/1025/1500 frames): tiled length == untiled length == expected.
pytestwith the fix: 1 passed, 5 subtests passed. With the original filerestored: 4 subtests failed.
py_compileon both changed files: pass.