Instructions to use XLabs-AI/flux-ip-adapter-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use XLabs-AI/flux-ip-adapter-v2 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("XLabs-AI/flux-ip-adapter-v2", dtype=torch.bfloat16, device_map="cuda") prompt = "Turn this cat into a dog" input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png") image = pipe(image=input_image, prompt=prompt).images[0] - Notebooks
- Google Colab
- Kaggle
comfyui workflow demo use flux1-dev-fp8?
because my V100 can't load flux1-dev-fp8 with bad error like 'module 'torch' has no attribute 'float8_e4m3fn',
how to run this demo with flux1-dev.safetensor?
thank you very much!!

Error occurred when executing ApplyFluxIPAdapter:
mat1 and mat2 shapes cannot be multiplied (2x1024 and 768x65536)
File "/home/notebook/code/personal/ComfyUI/execution.py", line 152, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "/home/notebook/code/personal/ComfyUI/execution.py", line 82, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "/home/notebook/code/personal/ComfyUI/execution.py", line 75, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "/home/notebook/code/personal/ComfyUI/custom_nodes/x-flux-comfyui/nodes.py", line 615, in applymodel
ip_projes = ip_adapter_flux['ip_adapter_proj_model'](out.to(ip_projes_dev, dtype=torch.bfloat16)).to(device, dtype=torch.bfloat16)
File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/home/notebook/code/personal/ComfyUI/custom_nodes/x-flux-comfyui/layers.py", line 291, in forward
clip_extra_context_tokens = self.proj(embeds).reshape(
File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/linear.py", line 114, in forward
return F.linear(input, self.weight, self.bias)