Update app.py
Browse files
app.py
CHANGED
@@ -78,10 +78,10 @@ def load_and_prepare_models():
|
|
78 |
#use_safetensors=False,
|
79 |
)
|
80 |
torch.cuda.empty_cache()
|
81 |
-
torch.cuda.reset_peak_memory_stats()
|
82 |
pipe.to(device=device, dtype=torch.bfloat16)
|
83 |
pipe.vae=vaeX.to(device)
|
84 |
upscaler = UpscaleWithModel.from_pretrained("Kim2091/ClearRealityV1").to(torch.device("cuda:0"))
|
|
|
85 |
return pipe, upscaler
|
86 |
|
87 |
text_encoder=CLIPTextModelWithProjection.from_pretrained("ford442/stable-diffusion-3.5-large-bf16", subfolder='text_encoder', token=True).to(device=device, dtype=torch.bfloat16)
|
@@ -92,7 +92,7 @@ pipe, upscaler_2 = load_and_prepare_models()
|
|
92 |
|
93 |
#pipe.to(device)
|
94 |
|
95 |
-
upscaler_2 = UpscaleWithModel.from_pretrained("Kim2091/ClearRealityV1").to(torch.device("cuda:0"))
|
96 |
|
97 |
MAX_SEED = np.iinfo(np.int32).max
|
98 |
MAX_IMAGE_SIZE = 4096
|
|
|
78 |
#use_safetensors=False,
|
79 |
)
|
80 |
torch.cuda.empty_cache()
|
|
|
81 |
pipe.to(device=device, dtype=torch.bfloat16)
|
82 |
pipe.vae=vaeX.to(device)
|
83 |
upscaler = UpscaleWithModel.from_pretrained("Kim2091/ClearRealityV1").to(torch.device("cuda:0"))
|
84 |
+
torch.cuda.empty_cache()
|
85 |
return pipe, upscaler
|
86 |
|
87 |
text_encoder=CLIPTextModelWithProjection.from_pretrained("ford442/stable-diffusion-3.5-large-bf16", subfolder='text_encoder', token=True).to(device=device, dtype=torch.bfloat16)
|
|
|
92 |
|
93 |
#pipe.to(device)
|
94 |
|
95 |
+
#upscaler_2 = UpscaleWithModel.from_pretrained("Kim2091/ClearRealityV1").to(torch.device("cuda:0"))
|
96 |
|
97 |
MAX_SEED = np.iinfo(np.int32).max
|
98 |
MAX_IMAGE_SIZE = 4096
|