feat: add IP-Adapter Plus (Resampler image projection) support - #1839
Open
fszontagh wants to merge 1 commit into
Open
feat: add IP-Adapter Plus (Resampler image projection) support#1839fszontagh wants to merge 1 commit into
fszontagh wants to merge 1 commit into
Conversation
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
Adds IP-Adapter Plus support on top of #1803. Plus checkpoints replace the small linear
image_projwith a Resampler (Perceiver-style) that attends over the CLIP-Vision hidden states and emits more image tokens (16 vs 4), transferring finer detail from the reference.The variant is auto-detected from the weight file (presence of
image_proj.latents), and all Resampler dimensions are read from tensor shapes, so no new flags are needed - the existing--ip-adapter/--ip-adapter-image/--ip-adapter-strengthoptions work for both classic and Plus. Plus uses the penultimate, unpooled CLIP-Vision hidden states; the classic path and the existing conditional/unconditional CFG handling are unchanged.Related Issue / Discussion
Follow-up to #1803 (IP-Adapter). Covers the
ip-adapter-plus_sd15andip-adapter-plus_sdxl_vit-hweights.Additional Information
Verified with
h94/IP-Adapterweights + CLIP ViT-H:ip-adapter-plus_sd15): all 83 tensors bind, logsIP-Adapter: 16 image tokens, produces a coherent reference-conditioned image that is distinctly finer than the classic adapter at identical settings.ip-adapter-plus_sdxl_vit-h): all 191 tensors bind and the Resampler projects 16 tokens (dims auto-detected: dim 1280, output 2048).Docs added under
docs/ip_adapter.md(new "Plus variants" section).Checklist