Skip to content

This PR updates the Stable Diffusion IP-Adapter integration#13810

Open
sywangyi wants to merge 2 commits into
huggingface:mainfrom
sywangyi:ip_adapter_fix
Open

This PR updates the Stable Diffusion IP-Adapter integration#13810
sywangyi wants to merge 2 commits into
huggingface:mainfrom
sywangyi:ip_adapter_fix

Conversation

@sywangyi
Copy link
Copy Markdown
Contributor

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

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>
@github-actions github-actions Bot added tests size/L PR with diff > 200 LOC labels May 26, 2026
@sayakpaul sayakpaul requested a review from dg845 May 26, 2026 06:53
Signed-off-by: Wang, Yi <yi.a.wang@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L PR with diff > 200 LOC tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant