Instructions to use Alissonerdx/BFS-Best-Face-Swap with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Alissonerdx/BFS-Best-Face-Swap 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("black-forest-labs/FLUX.2-klein-9B,black-forest-labs/FLUX.2-klein-4B,black-forest-labs/FLUX.2-klein-base-4B,black-forest-labs/FLUX.2-klein-base-9B,black-forest-labs/FLUX.2-klein-9b-fp8,black-forest-labs/FLUX.2-klein-4b-fp8,Qwen/Qwen-Image-Edit-2511,krea/Krea-2-Raw", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("Alissonerdx/BFS-Best-Face-Swap") 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] - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
Krea2 dont work for me.
Both head swap and body swap throws errors.
[WARNING] lora key not loaded: diffusion_model.txtfusion.refiner_blocks.1.attn.wv.lora_A.weight
[WARNING] lora key not loaded: diffusion_model.txtfusion.refiner_blocks.1.attn.wv.lora_B.weight
[WARNING] lora key not loaded: diffusion_model.txtfusion.refiner_blocks.1.mlp.down.lora_A.weight
[WARNING] lora key not loaded: diffusion_model.txtfusion.refiner_blocks.1.mlp.down.lora_B.weight
[WARNING] lora key not loaded: diffusion_model.txtfusion.refiner_blocks.1.mlp.gate.lora_A.weight
[WARNING] lora key not loaded: diffusion_model.txtfusion.refiner_blocks.1.mlp.gate.lora_B.weight
[WARNING] lora key not loaded: diffusion_model.txtfusion.refiner_blocks.1.mlp.up.lora_A.weight
[WARNING] lora key not loaded: diffusion_model.txtfusion.refiner_blocks.1.mlp.up.lora_B.weight
[krea2edit] NOTE: connect 'target_latent' (the same latent that feeds KSampler.latent_image) to pre-encode the source here instead of on the first sampling step. Without it the VAE is loaded mid-sampling and can evict part of the diffusion model, slowing every remaining step.
[INFO] Requested to load Flux2
[INFO] loaded completely; 17604.02 MB loaded, full load: True
Both head swap and body swap throws errors.
[WARNING] lora key not loaded: diffusion_model.txtfusion.refiner_blocks.1.attn.wv.lora_A.weight
[WARNING] lora key not loaded: diffusion_model.txtfusion.refiner_blocks.1.attn.wv.lora_B.weight
[WARNING] lora key not loaded: diffusion_model.txtfusion.refiner_blocks.1.mlp.down.lora_A.weight
[WARNING] lora key not loaded: diffusion_model.txtfusion.refiner_blocks.1.mlp.down.lora_B.weight
[WARNING] lora key not loaded: diffusion_model.txtfusion.refiner_blocks.1.mlp.gate.lora_A.weight
[WARNING] lora key not loaded: diffusion_model.txtfusion.refiner_blocks.1.mlp.gate.lora_B.weight
[WARNING] lora key not loaded: diffusion_model.txtfusion.refiner_blocks.1.mlp.up.lora_A.weight
[WARNING] lora key not loaded: diffusion_model.txtfusion.refiner_blocks.1.mlp.up.lora_B.weight
[krea2edit] NOTE: connect 'target_latent' (the same latent that feeds KSampler.latent_image) to pre-encode the source here instead of on the first sampling step. Without it the VAE is loaded mid-sampling and can evict part of the diffusion model, slowing every remaining step.
[INFO] Requested to load Flux2
[INFO] loaded completely; 17604.02 MB loaded, full load: True
One question: are you using the exact workflow I provided with the same models, or are you using other LoRas in conjunction?
Your workflow and no other Loras.
BTW: On a Macbook pro.
Normal Krea2 text to image works fine.
EDIT: Using Krea2 turbo Q8 gguf.. Maybe the reason?