Update README.md
Browse files
README.md
CHANGED
@@ -4,4 +4,29 @@ base_model:
|
|
4 |
pipeline_tag: image-to-image
|
5 |
tags:
|
6 |
- text-generation-inference
|
7 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
pipeline_tag: image-to-image
|
5 |
tags:
|
6 |
- text-generation-inference
|
7 |
+
---
|
8 |
+
|
9 |
+
pip install -U diffusers
|
10 |
+
|
11 |
+
```python
|
12 |
+
import torch
|
13 |
+
from diffusers import FluxFillPipeline
|
14 |
+
from diffusers.utils import load_image
|
15 |
+
|
16 |
+
image = load_image("https://huggingface.co/datasets/diffusers/diffusers-images-docs/resolve/main/cup.png")
|
17 |
+
mask = load_image("https://huggingface.co/datasets/diffusers/diffusers-images-docs/resolve/main/cup_mask.png")
|
18 |
+
|
19 |
+
pipe = FluxFillPipeline.from_pretrained("kpsss34/FLUX.1-Fill-int4", torch_dtype=torch.bfloat16).to("cuda")
|
20 |
+
image = pipe(
|
21 |
+
prompt="a white paper cup",
|
22 |
+
image=image,
|
23 |
+
mask_image=mask,
|
24 |
+
height=512,
|
25 |
+
width=512,
|
26 |
+
guidance_scale=30,
|
27 |
+
num_inference_steps=50,
|
28 |
+
max_sequence_length=512,
|
29 |
+
generator=torch.Generator("cpu").manual_seed(0)
|
30 |
+
).images[0]
|
31 |
+
image.save(f"flux-fill-dev.png")
|
32 |
+
```
|