Update app.py
Browse files
app.py
CHANGED
|
@@ -15,6 +15,8 @@ import keras
|
|
| 15 |
import keras_hub
|
| 16 |
import torch
|
| 17 |
|
|
|
|
|
|
|
| 18 |
torch.backends.cuda.matmul.allow_tf32 = False
|
| 19 |
torch.backends.cuda.matmul.allow_bf16_reduced_precision_reduction = False
|
| 20 |
torch.backends.cuda.matmul.allow_fp16_reduced_precision_reduction = False
|
|
@@ -25,7 +27,7 @@ torch.backends.cudnn.benchmark = False
|
|
| 25 |
#torch.backends.cuda.preferred_linalg_library="cusolver"
|
| 26 |
torch.set_float32_matmul_precision("highest")
|
| 27 |
|
| 28 |
-
upscaler_2 = UpscaleWithModel.from_pretrained("Kim2091/ClearRealityV1").to(
|
| 29 |
|
| 30 |
text_to_image = keras_hub.models.StableDiffusion3TextToImage.from_preset(
|
| 31 |
"stable_diffusion_3_medium", width=768, height=768, dtype="bfloat16"
|
|
|
|
| 15 |
import keras_hub
|
| 16 |
import torch
|
| 17 |
|
| 18 |
+
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
| 19 |
+
|
| 20 |
torch.backends.cuda.matmul.allow_tf32 = False
|
| 21 |
torch.backends.cuda.matmul.allow_bf16_reduced_precision_reduction = False
|
| 22 |
torch.backends.cuda.matmul.allow_fp16_reduced_precision_reduction = False
|
|
|
|
| 27 |
#torch.backends.cuda.preferred_linalg_library="cusolver"
|
| 28 |
torch.set_float32_matmul_precision("highest")
|
| 29 |
|
| 30 |
+
upscaler_2 = UpscaleWithModel.from_pretrained("Kim2091/ClearRealityV1").to(device)
|
| 31 |
|
| 32 |
text_to_image = keras_hub.models.StableDiffusion3TextToImage.from_preset(
|
| 33 |
"stable_diffusion_3_medium", width=768, height=768, dtype="bfloat16"
|