kpsss34's picture
Update README.md
5c70c2c verified
---
base_model:
- black-forest-labs/FLUX.1-Kontext-dev
pipeline_tag: image-to-image
library_name: diffusers
tags:
- text-generation-inference
---
pip install git+https://github.com/huggingface/diffusers.git
```py
import torch
from diffusers import FluxKontextPipeline
from diffusers.utils import load_image
pipe = FluxKontextPipeline.from_pretrained("kpsss34/FLUX.1-Kontext-dev-int4", torch_dtype=torch.bfloat16)
pipe.to("cuda")
input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png")
image = pipe(
image=input_image,
prompt="Add a hat to the cat",
guidance_scale=2.5
).images[0]
```