Spaces:
Running
on
Zero
Running
on
Zero
Update PhotoMaker v2 demo
Browse files
app.py
CHANGED
@@ -42,7 +42,11 @@ DEFAULT_ASPECT_RATIO = ASPECT_RATIO_LABELS[0]
|
|
42 |
enable_doodle_arg = False
|
43 |
photomaker_ckpt = hf_hub_download(repo_id="TencentARC/PhotoMaker", filename="photomaker-v2.bin", repo_type="model")
|
44 |
|
45 |
-
|
|
|
|
|
|
|
|
|
46 |
if device == "mps":
|
47 |
torch_dtype = torch.float16
|
48 |
|
|
|
42 |
enable_doodle_arg = False
|
43 |
photomaker_ckpt = hf_hub_download(repo_id="TencentARC/PhotoMaker", filename="photomaker-v2.bin", repo_type="model")
|
44 |
|
45 |
+
if torch.cuda.is_available() and torch.cuda.is_bf16_supported():
|
46 |
+
torch_dtype = torch.bfloat16
|
47 |
+
else:
|
48 |
+
torch_dtype = torch.float16
|
49 |
+
|
50 |
if device == "mps":
|
51 |
torch_dtype = torch.float16
|
52 |
|