Update app.py
Browse files
app.py
CHANGED
|
@@ -27,10 +27,13 @@ torch.backends.cudnn.benchmark = 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 |
text_to_image = None
|
| 32 |
|
|
|
|
| 33 |
def load_model():
|
|
|
|
|
|
|
| 34 |
global text_to_image
|
| 35 |
text_to_image = keras_hub.models.StableDiffusion3TextToImage.from_preset(
|
| 36 |
"stable_diffusion_3_medium", width=768, height=768, dtype="bfloat16"
|
|
|
|
| 27 |
#torch.backends.cuda.preferred_linalg_library="cusolver"
|
| 28 |
torch.set_float32_matmul_precision("highest")
|
| 29 |
|
| 30 |
+
upscaler_2 = None # UpscaleWithModel.from_pretrained("Kim2091/ClearRealityV1").to(device)
|
| 31 |
text_to_image = None
|
| 32 |
|
| 33 |
+
@spaces.GPU(duration=40)
|
| 34 |
def load_model():
|
| 35 |
+
global upscaler_2
|
| 36 |
+
upscaler_2 = UpscaleWithModel.from_pretrained("Kim2091/ClearRealityV1").to(device)
|
| 37 |
global text_to_image
|
| 38 |
text_to_image = keras_hub.models.StableDiffusion3TextToImage.from_preset(
|
| 39 |
"stable_diffusion_3_medium", width=768, height=768, dtype="bfloat16"
|