Skip to content

[PAG] fix IP-Adapter inputs in KolorsPAGPipeline - #15349

Open
chsu-amd wants to merge 1 commit into
huggingface:mainfrom
chsu-amd:fix-kolors-pag-ip-adapter-embeds
Open

chsu-amd wants to merge 1 commit into
huggingface:mainfrom
chsu-amd:fix-kolors-pag-ip-adapter-embeds

Conversation

@chsu-amd

@chsu-amd chsu-amd commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes #15347

KolorsPAGPipeline assigned the result of prepare_ip_adapter_image_embeds() to image_embeds instead of ip_adapter_image_embeds. With ip_adapter_image, the PAG loop that follows iterates ip_adapter_image_embeds, which is still None, and raises TypeError. With ip_adapter_image_embeds, the UNet got only the last tensor of that loop instead of the list, which raises ValueError with two IP-Adapters (and goes through the deprecated tensor fallback with one). The block came in with #8934, which took the PAG loop from StableDiffusionXLPAGPipeline but kept the image_embeds variable from KolorsPipeline.

This PR does what StableDiffusionXLPAGPipeline does: assign to ip_adapter_image_embeds and pass that list to the UNet as added_cond_kwargs["image_embeds"].

With the fix, the reproduction script from #15347 prints OK for both ip_adapter_image and ip_adapter_image_embeds (on main it prints the TypeError and the ValueError).

Tests: a TestKolorsPAGPipelineIPAdapter class (IPAdapterTesterMixin) in tests/pipelines/pag/test_pag_kolors.py; its test_ip_adapter fails on main with the ValueError above. The whole file: 28 passed, 17 skipped on CPU, 44 passed, 1 skipped on an RTX 5090. ruff check / ruff format --check (0.9.10) pass on the changed files.

Self-review notes (the self-review skill's rubric: review-rules.md, code_style.md, testing.md):

Before submitting

Who can review?

@yiyixuxu @sayakpaul

@chsu-amd
chsu-amd marked this pull request as ready for review November 19, 2026 04:10
@sayakpaul

Copy link
Copy Markdown
Member

Can we reduce the number of PRs being opened / day a little bit? 😅

@chsu-amd

Copy link
Copy Markdown
Contributor Author

Sorry about that, will slow down.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

KolorsPAGPipeline: IP-Adapter inputs raise TypeError / ValueError

2 participants