File size: 663 Bytes
1ac235d 5c70c2c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
---
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]
```
|