Update README.md
Browse files
README.md
CHANGED
@@ -5,4 +5,23 @@ pipeline_tag: image-to-image
|
|
5 |
library_name: diffusers
|
6 |
tags:
|
7 |
- text-generation-inference
|
8 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
library_name: diffusers
|
6 |
tags:
|
7 |
- text-generation-inference
|
8 |
+
---
|
9 |
+
|
10 |
+
pip install git+https://github.com/huggingface/diffusers.git
|
11 |
+
|
12 |
+
```py
|
13 |
+
import torch
|
14 |
+
from diffusers import FluxKontextPipeline
|
15 |
+
from diffusers.utils import load_image
|
16 |
+
|
17 |
+
pipe = FluxKontextPipeline.from_pretrained("kpsss34/FLUX.1-Kontext-dev-int4", torch_dtype=torch.bfloat16)
|
18 |
+
pipe.to("cuda")
|
19 |
+
|
20 |
+
input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png")
|
21 |
+
|
22 |
+
image = pipe(
|
23 |
+
image=input_image,
|
24 |
+
prompt="Add a hat to the cat",
|
25 |
+
guidance_scale=2.5
|
26 |
+
).images[0]
|
27 |
+
```
|