login
Browse files
app.py
CHANGED
@@ -12,17 +12,14 @@ from huggingface_hub import login
|
|
12 |
import os
|
13 |
|
14 |
MARKDOWN = """
|
15 |
-
# FLUX.1 Inpainting
|
16 |
-
|
17 |
-
Shoutout to [Black Forest Labs](https://huggingface.co/black-forest-labs) team for
|
18 |
-
creating this amazing model, and a big thanks to [Gothos](https://github.com/Gothos)
|
19 |
-
for taking it to the next level by enabling inpainting with the FLUX.
|
20 |
"""
|
21 |
|
22 |
MAX_SEED = np.iinfo(np.int32).max
|
23 |
IMAGE_SIZE = 1024
|
24 |
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
|
25 |
-
|
|
|
26 |
|
27 |
def remove_background(image: Image.Image, threshold: int = 50) -> Image.Image:
|
28 |
image = image.convert("RGBA")
|
|
|
12 |
import os
|
13 |
|
14 |
MARKDOWN = """
|
15 |
+
# FLUX.1 Inpainting with lora
|
|
|
|
|
|
|
|
|
16 |
"""
|
17 |
|
18 |
MAX_SEED = np.iinfo(np.int32).max
|
19 |
IMAGE_SIZE = 1024
|
20 |
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
|
21 |
+
HF_TOKEN = os.environ.get("HF_TOKEN")
|
22 |
+
login(token=HF_TOKEN)
|
23 |
|
24 |
def remove_background(image: Image.Image, threshold: int = 50) -> Image.Image:
|
25 |
image = image.convert("RGBA")
|