Spaces:
Running
Running
yizhangliu
commited on
Commit
•
8d01019
1
Parent(s):
a5ca5a6
Update app.py
Browse files
app.py
CHANGED
@@ -58,10 +58,16 @@ BUILD_DIR = os.environ.get("LAMA_CLEANER_BUILD_DIR", "app/build")
|
|
58 |
|
59 |
from share_btn import community_icon_html, loading_icon_html, share_js
|
60 |
|
61 |
-
HF_TOKEN_SD = os.environ.get('HF_TOKEN_SD')
|
62 |
|
63 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
64 |
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
def diffuser_callback(i, t, latents):
|
66 |
pass
|
67 |
|
|
|
58 |
|
59 |
from share_btn import community_icon_html, loading_icon_html, share_js
|
60 |
|
61 |
+
HF_TOKEN_SD = os.environ.get('HF_TOKEN_SD')
|
62 |
|
63 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
64 |
|
65 |
+
def get_image_ext(img_bytes):
|
66 |
+
w = imghdr.what("", img_bytes)
|
67 |
+
if w is None:
|
68 |
+
w = "jpeg"
|
69 |
+
return w
|
70 |
+
|
71 |
def diffuser_callback(i, t, latents):
|
72 |
pass
|
73 |
|