Spaces:
Running
Running
Commit
·
60be08d
1
Parent(s):
fae0a95
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,10 +16,11 @@ from diffusers import DiffusionPipeline
|
|
| 16 |
|
| 17 |
from share_btn import community_icon_html, loading_icon_html, share_js
|
| 18 |
|
| 19 |
-
|
| 20 |
|
| 21 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 22 |
|
|
|
|
| 23 |
pipe = DiffusionPipeline.from_pretrained("runwayml/stable-diffusion-inpainting", dtype=torch.float16, revision="fp16", use_auth_token=auth_token).to(device)
|
| 24 |
|
| 25 |
transform = transforms.Compose([
|
|
@@ -27,6 +28,7 @@ transform = transforms.Compose([
|
|
| 27 |
transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]),
|
| 28 |
transforms.Resize((512, 512)),
|
| 29 |
])
|
|
|
|
| 30 |
|
| 31 |
def read_content(file_path: str) -> str:
|
| 32 |
"""read the content of target file
|
|
|
|
| 16 |
|
| 17 |
from share_btn import community_icon_html, loading_icon_html, share_js
|
| 18 |
|
| 19 |
+
HF_TOKEN_SD = os.environ.get('HF_TOKEN_SD') or True
|
| 20 |
|
| 21 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 22 |
|
| 23 |
+
'''
|
| 24 |
pipe = DiffusionPipeline.from_pretrained("runwayml/stable-diffusion-inpainting", dtype=torch.float16, revision="fp16", use_auth_token=auth_token).to(device)
|
| 25 |
|
| 26 |
transform = transforms.Compose([
|
|
|
|
| 28 |
transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]),
|
| 29 |
transforms.Resize((512, 512)),
|
| 30 |
])
|
| 31 |
+
'''
|
| 32 |
|
| 33 |
def read_content(file_path: str) -> str:
|
| 34 |
"""read the content of target file
|