Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
Co-authored-by: YiYi Xu <yixu310@gmail.com>
DN6
left a comment
There was a problem hiding this comment.
Small nits. Looks good otherwise.
| @slow | ||
| @require_big_gpu_with_torch_cuda | ||
| @pytest.mark.big_gpu_with_torch_cuda | ||
| class FluxIPAdapterPipelineSlowTests(unittest.TestCase): |
There was a problem hiding this comment.
@hlky Could we add a fast test using something similar to what's been done here
diffusers/tests/pipelines/test_pipelines_common.py
Lines 269 to 301 in 9020086
yiyixuxu
left a comment
There was a problem hiding this comment.
left one comment, looks good otherwise!
Co-authored-by: YiYi Xu <yixu310@gmail.com>
* Flux IP-Adapter * test cfg * make style * temp remove copied from * fix test * fix test * v2 * fix * make style * temp remove copied from * Apply suggestions from code review Co-authored-by: YiYi Xu <yixu310@gmail.com> * Move encoder_hid_proj to inside FluxTransformer2DModel * merge * separate encode_prompt, add copied from, image_encoder offload * make * fix test * fix * Update src/diffusers/pipelines/flux/pipeline_flux.py * test_flux_prompt_embeds change not needed * true_cfg -> true_cfg_scale * fix merge conflict * test_flux_ip_adapter_inference * add fast test * FluxIPAdapterMixin not test mixin * Update pipeline_flux.py Co-authored-by: YiYi Xu <yixu310@gmail.com> --------- Co-authored-by: YiYi Xu <yixu310@gmail.com>
* Flux IP-Adapter * test cfg * make style * temp remove copied from * fix test * fix test * v2 * fix * make style * temp remove copied from * Apply suggestions from code review Co-authored-by: YiYi Xu <yixu310@gmail.com> * Move encoder_hid_proj to inside FluxTransformer2DModel * merge * separate encode_prompt, add copied from, image_encoder offload * make * fix test * fix * Update src/diffusers/pipelines/flux/pipeline_flux.py * test_flux_prompt_embeds change not needed * true_cfg -> true_cfg_scale * fix merge conflict * test_flux_ip_adapter_inference * add fast test * FluxIPAdapterMixin not test mixin * Update pipeline_flux.py Co-authored-by: YiYi Xu <yixu310@gmail.com> --------- Co-authored-by: YiYi Xu <yixu310@gmail.com>
|
@hlky Thank you in advance for your help! |
|
@chaewon-huh IP Adapter support for those pipelines is available |
What does this PR do?
Adds support for XLabs Flux IP Adapter.
Example
flux-ip-adapter-v2
Details
Note:
true_cfg=1.0is important, andstrengthis sensitive, fixed strength may not work, see here for more strength schedules, good results will require experimentation with strength schedules and the start/stop values. Results also vary with input image, I had no success with the statue image used for v1 test.Multiple input images is not yet supported (dev note: apply
torch.meanto the batch ofimage_embedsand toip_attention)Notes
--timestep_to_start_cfggreater than the number of steps to disable CFGpipeline_flux_with_cfgcommunity example, except we run positive and negative separately.load_ip_adapter.load_ip_adaptersupportsimage_encoder_pretrained_model_name_or_pathe.g."openai/clip-vit-large-patch14"rather than justimage_encoder_folder, also supportsimage_encoder_dtypewith defaulttorch.float16.FluxTransformerBlockbecause of where ip_attention is applied to thehidden_states, see here in the original codebase.flux-ip-adapter-v2 will be fixed and tested shortly.Fixes #9825
Fixes #9403
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.
@sayakpaul @yiyixuxu @DN6