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
Can this model do text2image?
As the title says, can I use it like flux.1-dev to generate images from only text input?
I tried replace the flux.1-dev model file with this one, and kept the rest of workflow unchanged, but the result is very bad.
The technical report mentioned that the dev version only focuses on image-to-image.
I on the other hand had bad results using it for image-to-image, but good results using it for text-to-image (replacing accordingly flux1-dev and flux-fill in my workflows)
The technical report mentioned that the dev version only focuses on image-to-image.
That could be the case. I read elsewhere that the max and pro version generates nice images.
As the title says, can I use it like flux.1-dev to generate images from only text input?
yes it can text to image and image to image, but text to image generation is weak