Instructions to use black-forest-labs/FLUX.2-dev with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use black-forest-labs/FLUX.2-dev 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-dev", 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] - Diffusion Single File
How to use black-forest-labs/FLUX.2-dev with Diffusion Single File:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Inference
- Notebooks
- Google Colab
- Kaggle
Pinokio and Flux 2 β Error .... .... Make sure you've entered a valid HuggingFace token.
Newbie stuck in square one, sorry if this is told somewhere already.
So using pinokio (run as admin) and installed FLUX.2-dev Image Generator (NVFP4/4-bit). Install went ok then was this part:
π HuggingFace Access Token
Get your token from: https://huggingface.co/settings/tokens
Enter your HuggingFace token here (hf_...)
How to get your token:
Go to HuggingFace Settings
Click "New token"
Name it (e.g., "flux2-ui")
Select "Read" permissions
Copy the token and paste it above
Did all the above making sure it was "READ"
Make sure you've accepted the FLUX.2-dev license
This part I am not sure where this license should be "accepted".
Then did the Init pipeline and it downloaded flux (took quite a while). After that it said it initialized.
looking good but... with first test image the status window throw this error:
"β Error during generation: Remote text encoder error: Failed to load pickle data after 3 attempts: invalid load key, '<'.
Response size: 4236 bytes
This might be a network issue. Try again or check your internet connection.
Make sure you've entered a valid HuggingFace token."
I have tried renew the token few time and copied new token (paste with left click and "paste", not ctrl + V) to license spot but no help. I stuck with this error.
Any guidance is appreciated. Have done googling around this but cannot put my finger of what's wrong.
Local Artificial idiot