Commit
·
4d88552
1
Parent(s):
0837c13
Update app.py
Browse files
app.py
CHANGED
@@ -16,17 +16,7 @@ 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([
|
26 |
-
transforms.ToTensor(),
|
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 |
+
pipe = DiffusionPipeline.from_pretrained("runwayml/stable-diffusion-inpainting", dtype=torch.float16).to("cuda")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
def read_content(file_path: str) -> str:
|
22 |
"""read the content of target file
|