Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
from huggingface_hub import InferenceClient
|
| 3 |
+
|
| 4 |
+
client = InferenceClient(
|
| 5 |
+
provider="fal-ai",
|
| 6 |
+
api_key=os.environ["HF_TOKEN"],
|
| 7 |
+
)
|
| 8 |
+
|
| 9 |
+
with open("cat.png", "rb") as image_file:
|
| 10 |
+
input_image = image_file.read()
|
| 11 |
+
|
| 12 |
+
# output is a PIL.Image object
|
| 13 |
+
image = client.image_to_image(
|
| 14 |
+
input_image,
|
| 15 |
+
prompt="Turn the cat into a tiger.",
|
| 16 |
+
model="black-forest-labs/FLUX.1-Kontext-dev",
|
| 17 |
+
)
|