Spaces:
Runtime error
ComfyUI IPAdapter plus
ComfyUI reference implementation for IPAdapter models.
The IPAdapter are very powerful models for image-to-image conditioning. The subject or even just the style of the reference image(s) can be easily transferred to a generation. Think of it as a 1-image lora.
Sponsorship
If you like my work and wish to see updates and new features please consider sponsoring my projects.
- ComfyUI IPAdapter Plus
- ComfyUI InstantID (Native)
- ComfyUI Essentials
- ComfyUI FaceAnalysis
- Comfy Dungeon
Not to mention the documentation and videos tutorials. Check my ComfyUI Advanced Understanding videos on YouTube for example, part 1 and part 2
The only way to keep the code open and free is by sponsoring its development. The more sponsorships the more time I can dedicate to my open source projects.
Please consider a Github Sponsorship or PayPal donation (Matteo "matt3o" Spinelli). For sponsorships of $50+, let me know if you'd like to be mentioned in this readme file, you can find me on Discord or matt3o :snail: gmail.com.
Important updates
2024/07/26: Added support for image batches and animation to the ClipVision Enhancer.
2024/07/18: Support for Kolors.
2024/07/17: Added experimental ClipVision Enhancer node. It was somehow inspired by the Scaling on Scales paper but the implementation is a bit different. The new IPAdapterClipVisionEnhancer tries to catch small details by tiling the embeds (instead of the image in the pixel space), the result is a slightly higher resolution visual embedding with no cost of performance.
2024/07/11: Added experimental Precise composition (layout) transfer. It's not as good as style. embeds_scaling
has a huge impact. Start with strength 0.8 and boost 0.3 in SDXL and 0.6 boost 0.35 in SD1.5.
2024/06/28: Added the IPAdapter Precise Style Transfer
node. Increase the style_boost
option to lower the bleeding of the composition layer. Important: works better in SDXL, start with a style_boost of 2; for SD1.5 try to increase the weight a little over 1.0 and set the style_boost to a value between -1 and +1, starting with 0.
2024/06/22: Added style transfer precise
, offers less bleeding of the embeds between the style and composition layers. It is sometimes better than the standard style transfer especially if the reference image is very different from the generated image. Works better in SDXL than SD1.5.
2024/05/21: Improved memory allocation when encode_batch_size
. Useful mostly for very long animations.
2024/05/02: Add encode_batch_size
to the Advanced batch node. This can be useful for animations with a lot of frames to reduce the VRAM usage during the image encoding. Please note that results will be slightly different based on the batch size.
2024/04/27: Refactored the IPAdapterWeights mostly useful for AnimateDiff animations.
2024/04/21: Added Regional Conditioning nodes to simplify attention masking and masked text conditioning.
2024/04/16: Added support for the new SDXL portrait unnorm model (link below). It's very strong and tends to ignore the text conditioning. Lower the CFG to 3-4 or use a RescaleCFG node.
2024/04/12: Added scheduled weights. Useful for animations.
(Older updates removed for readability)
Example workflows
The examples directory has many workflows that cover all IPAdapter functionalities.
Video Tutorials
- :star: New IPAdapter features
- :art: IPAdapter Style and Composition
The following videos are about the previous version of IPAdapter, but they still contain valuable information.
:nerd_face: Basic usage video, :rocket: Advanced features video, :japanese_goblin: Attention Masking video, :movie_camera: Animation Features video
Installation
Download or git clone this repository inside ComfyUI/custom_nodes/
directory or use the Manager. IPAdapter always requires the latest version of ComfyUI. If something doesn't work be sure to upgrade. Beware that the automatic update of the manager sometimes doesn't work and you may need to upgrade manually.
There's now a Unified Model Loader, for it to work you need to name the files exactly as described below. The legacy loaders work with any file name but you have to select them manually. The models can be placed into sub-directories.
Remember you can also use any custom location setting an ipadapter
entry in the extra_model_paths.yaml
file.
/ComfyUI/models/clip_vision
- CLIP-ViT-H-14-laion2B-s32B-b79K.safetensors, download and rename
- CLIP-ViT-bigG-14-laion2B-39B-b160k.safetensors, download and rename
- clip-vit-large-patch14-336.bin, download and rename only for Kolors models
/ComfyUI/models/ipadapter
, create it if not present- ip-adapter_sd15.safetensors, Basic model, average strength
- ip-adapter_sd15_light_v11.bin, Light impact model
- ip-adapter-plus_sd15.safetensors, Plus model, very strong
- ip-adapter-plus-face_sd15.safetensors, Face model, portraits
- ip-adapter-full-face_sd15.safetensors, Stronger face model, not necessarily better
- ip-adapter_sd15_vit-G.safetensors, Base model, requires bigG clip vision encoder
- ip-adapter_sdxl_vit-h.safetensors, SDXL model
- ip-adapter-plus_sdxl_vit-h.safetensors, SDXL plus model
- ip-adapter-plus-face_sdxl_vit-h.safetensors, SDXL face model
- ip-adapter_sdxl.safetensors, vit-G SDXL model, requires bigG clip vision encoder
- Deprecated ip-adapter_sd15_light.safetensors, v1.0 Light impact model
FaceID models require insightface
, you need to install it in your ComfyUI environment. Check this issue for help. Remember that most FaceID models also need a LoRA.
For the Unified Loader to work the files need to be named exactly as shown in the list below.
/ComfyUI/models/ipadapter
- ip-adapter-faceid_sd15.bin, base FaceID model
- ip-adapter-faceid-plusv2_sd15.bin, FaceID plus v2
- ip-adapter-faceid-portrait-v11_sd15.bin, text prompt style transfer for portraits
- ip-adapter-faceid_sdxl.bin, SDXL base FaceID
- ip-adapter-faceid-plusv2_sdxl.bin, SDXL plus v2
- ip-adapter-faceid-portrait_sdxl.bin, SDXL text prompt style transfer
- ip-adapter-faceid-portrait_sdxl_unnorm.bin, very strong style transfer SDXL only
- Deprecated ip-adapter-faceid-plus_sd15.bin, FaceID plus v1
- Deprecated ip-adapter-faceid-portrait_sd15.bin, v1 of the portrait model
Most FaceID models require a LoRA. If you use the IPAdapter Unified Loader FaceID
it will be loaded automatically if you follow the naming convention. Otherwise you have to load them manually, be careful each FaceID model has to be paired with its own specific LoRA.
/ComfyUI/models/loras
- ip-adapter-faceid_sd15_lora.safetensors
- ip-adapter-faceid-plusv2_sd15_lora.safetensors
- ip-adapter-faceid_sdxl_lora.safetensors, SDXL FaceID LoRA
- ip-adapter-faceid-plusv2_sdxl_lora.safetensors, SDXL plus v2 LoRA
- Deprecated ip-adapter-faceid-plus_sd15_lora.safetensors, LoRA for the deprecated FaceID plus v1 model
All models can be found on huggingface.
Community's models
The community has baked some interesting IPAdapter models.
/ComfyUI/models/ipadapter
- ip_plus_composition_sd15.safetensors, general composition ignoring style and content, more about it here
- ip_plus_composition_sdxl.safetensors, SDXL version
- Kolors-IP-Adapter-Plus.bin, IPAdapter Plus for Kolors model
if you know of other models please let me know and I will add them to the unified loader.
Generic suggestions
There are many workflows included in the examples directory. Please check them before asking for support.
Usually it's a good idea to lower the weight
to at least 0.8
and increase the number steps. To increase adherece to the prompt you may try to change the weight type in the IPAdapter Advanced
node.
Nodes reference
I'm (slowly) documenting all nodes. Please check the Nodes reference.
Troubleshooting
Please check the troubleshooting before posting a new issue. Also remember to check the previous closed issues.
Current sponsors
It's only thanks to generous sponsors that the whole community can enjoy open and free software. Please join me in thanking the following companies and individuals!
:trophy: Gold sponsors
:tada: Silver sponsors
Companies supporting my projects
- RunComfy (ComfyUI Cloud)
Esteemed individuals
One-time Extraordinaires
- Eric Rollei
- francaleu
- Neta.art
- Samwise Wang
- And all private sponsors, you know who you are!