code_execution_files / Alissonerdx_BFS-Best-Face-Swap_0.txt
ariG23498's picture
ariG23498 HF Staff
Upload Alissonerdx_BFS-Best-Face-Swap_0.txt with huggingface_hub
56c3798 verified
```CODE:
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", 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]
```
ERROR:
Traceback (most recent call last):
File "/tmp/Alissonerdx_BFS-Best-Face-Swap_0LUp0fO.py", line 28, in <module>
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", dtype=torch.bfloat16, device_map="cuda")
File "/tmp/.cache/uv/environments-v2/04a66d23059ab39c/lib/python3.13/site-packages/huggingface_hub/utils/_validators.py", line 89, in _inner_fn
return fn(*args, **kwargs)
File "/tmp/.cache/uv/environments-v2/04a66d23059ab39c/lib/python3.13/site-packages/diffusers/pipelines/pipeline_utils.py", line 825, in from_pretrained
raise ValueError(
...<2 lines>...
)
ValueError: The provided pretrained_model_name_or_path "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" is neither a valid local path nor a valid repo id. Please check the parameter.