Instructions to use black-forest-labs/FLUX.1-Kontext-dev with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use black-forest-labs/FLUX.1-Kontext-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.1-Kontext-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.1-Kontext-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
The images generated using Flux. 1 Kontext [pro] Image show people standing or leaning on the right side
The character movements generated using Flux. 1 Kontext [pro] Image are all on the right side, but the prompt words describe standing on the left side or leaning on the left side and sitting on the left side. Sometimes one or two random images are on the left side, but most of them are on the right side





I have the same problem too. Does anyone know the reason and resolution?
try prompting the camera angle to be from the opposite side of where you want the person stood?
I know why this happens and the fix for it. It is caused because of what the model learned from. Imagine a kid always sees an orange as being blue. If they're asked to draw an orange, it will be blue because of what they know. The AI model has been trained on data that causes it to associate portraits with that. The fix would be to change the prompt from portrait to selfie, since most of the selfies it's trained on will have the person in the center. Hopefully this helps :D