This PR updates the Stable Diffusion IP-Adapter integration#13810
Open
sywangyi wants to merge 2 commits into
Open
This PR updates the Stable Diffusion IP-Adapter integration#13810sywangyi wants to merge 2 commits into
sywangyi wants to merge 2 commits into
Conversation
tests to keep them passing across PyTorch versions. These cases pass on PyTorch 2.11, but fail on PyTorch 2.12 because torch.randn no longer produces the same values for the same seed, which changes the generated latents and breaks the expected image slices. Signed-off-by: Wang, Yi <yi.a.wang@intel.com>
Signed-off-by: Wang, Yi <yi.a.wang@intel.com>
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.
What changed
The tests now patch the pipeline-level randn_tensor calls for Stable Diffusion, Stable Diffusion Img2Img, and Stable Diffusion Inpaint with a fixed noise tensor. This removes the dependency on PyTorch's version-specific random sampling behavior and makes the assertions deterministic again. The expected output slices were updated accordingly.
Why
The failures are not caused by a regression in IP-Adapter itself. The root cause is that PyTorch 2.12 generates different random values than PyTorch 2.11 under the same seed when the tests reach the torch.randn path. Since these tests compare output slices against fixed reference values, the changed latents cause them to fail even though the underlying feature behavior is unchanged.
@sayakpaul