Update README.md
Browse files
README.md
CHANGED
|
@@ -19,15 +19,22 @@ tags:
|
|
| 19 |
import torch
|
| 20 |
from diffusers import FluxKontextPipeline
|
| 21 |
from diffusers.utils import load_image
|
|
|
|
| 22 |
|
| 23 |
pipe = FluxKontextPipeline.from_pretrained("kpsss34/FLUX.1-Kontext-dev-int4", torch_dtype=torch.bfloat16)
|
| 24 |
pipe.to("cuda")
|
| 25 |
|
| 26 |
-
input_image = load_image("
|
| 27 |
|
| 28 |
image = pipe(
|
| 29 |
image=input_image,
|
| 30 |
-
prompt="
|
| 31 |
-
guidance_scale=2.5
|
|
|
|
| 32 |
).images[0]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
```
|
|
|
|
| 19 |
import torch
|
| 20 |
from diffusers import FluxKontextPipeline
|
| 21 |
from diffusers.utils import load_image
|
| 22 |
+
import uuid
|
| 23 |
|
| 24 |
pipe = FluxKontextPipeline.from_pretrained("kpsss34/FLUX.1-Kontext-dev-int4", torch_dtype=torch.bfloat16)
|
| 25 |
pipe.to("cuda")
|
| 26 |
|
| 27 |
+
input_image = load_image("./1.jpg")
|
| 28 |
|
| 29 |
image = pipe(
|
| 30 |
image=input_image,
|
| 31 |
+
prompt="woman wearing dress",
|
| 32 |
+
guidance_scale=2.5,
|
| 33 |
+
num_inference_steps=30
|
| 34 |
).images[0]
|
| 35 |
+
|
| 36 |
+
filename = f"generated_image_{uuid.uuid4().hex}.png"
|
| 37 |
+
image.save(filename)
|
| 38 |
+
|
| 39 |
+
print(f"Saved image as {filename}")
|
| 40 |
```
|