Image-to-Image
Diffusers
Safetensors
Diffusion Single File
English
FluxKontextPipeline
image-generation
flux
Instructions to use AlekseyCalvin/Flux_Kontext_Dev_fp8_scaled_diffusers with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use AlekseyCalvin/Flux_Kontext_Dev_fp8_scaled_diffusers 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("AlekseyCalvin/Flux_Kontext_Dev_fp8_scaled_diffusers", torch_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 AlekseyCalvin/Flux_Kontext_Dev_fp8_scaled_diffusers 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
- Notebooks
- Google Colab
- Kaggle
metadata
language:
- en
license: other
license_name: flux-1-dev-non-commercial-license
license_link: LICENSE.md
tags:
- image-generation
- flux
- diffusion-single-file
- diffusers
pipeline_tag: image-to-image
library_name: diffusers
base_model:
- black-forest-labs/FLUX.1-Kontext-dev
FLUX.1 Kontext Fp8 Scaled Quant Diffusers Conversion
'FLUX.1 Kontext [dev]' is a 12 billion parameter rectified flow transformer capable of editing images based on text instructions. It was developed by Black Forest Labs.
For more info, read BFL's blog and paper (!).
Key Features
- Change existing images based on an edit instruction.
- Have character, style and object reference without any finetuning.
- Robust consistency allows users to refine an image through multiple successive edits with minimal visual drift.
- Trained using guidance distillation, making
FLUX.1 Kontext [dev]more efficient. - Open weights to drive new scientific research, and empower artists to develop innovative workflows.
- Generated outputs can be used for personal, scientific, and commercial purposes, as described in the FLUX.1 [dev] Non-Commercial License.
Using with diffusers 🧨
# Install diffusers from the main branch until future stable release
pip install git+https://github.com/huggingface/diffusers.git
Image colorization:
import torch
from diffusers import FluxKontextPipeline
from diffusers.utils import load_image
pipe = FluxKontextPipeline.from_pretrained("AlekseyCalvin/Flux_Kontext_Dev_fp8_scaled_diffusers", torch_dtype=torch.bfloat16)
pipe.to("cuda")
input_image = load_image("https://images.squarespace-cdn.com/content/v1/5691c07b69492ec8d7400b4c/1606213149449-YYZKF3NPCITJGMLM3VAG/Boris%2BPoplavsky.jpg")
image = pipe(
image=input_image,
prompt="Colorize this photograph. Crisp intricate textured detailing. Rich tonality. Crisp details. Chromatic richness and range. Make it indistinguishable from a top quality large-format UHD or 50MP+ or 12k+ professional photo taken using a DSLR camera in 2025, upscale quality and carefully restore any blemished or blurred details. Retain facial features and proportions with great fidelity to the source. Add fine textural detailing only where missing. Render tones consistent with real life. Leave everything else about the photo unchanged.",
guidance_scale=2.5
).images[0]
Or customize the prompt for other forms of editing.