Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -125,6 +125,7 @@ FTP_DIR = os.getenv("FTP_DIR")
|
|
125 |
# os.putenv('TORCH_LINALG_PREFER_CUSOLVER','1')
|
126 |
os.putenv('HF_HUB_ENABLE_HF_TRANSFER','1')
|
127 |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
|
|
128 |
|
129 |
upscaler = UpscaleWithModel.from_pretrained("Kim2091/ClearRealityV1").to(torch.device("cuda:0"))
|
130 |
|
@@ -204,9 +205,8 @@ def load_and_prepare_model():
|
|
204 |
pipe.vae.eval()
|
205 |
pipe.text_encoder.eval()
|
206 |
'''
|
207 |
-
|
208 |
#pipe.unet = pipe.unet.to(memory_format=torch.contiguous_format)
|
209 |
-
|
210 |
#pipe.unet.to(memory_format=torch.channels_last)
|
211 |
#pipe.enable_vae_tiling()
|
212 |
#pipe.unet = torch.compile(pipe.unet, backend="hidet", dynamic=False, mode='max-autotune') #.to(device=device, dtype=torch.bfloat16)
|
|
|
125 |
# os.putenv('TORCH_LINALG_PREFER_CUSOLVER','1')
|
126 |
os.putenv('HF_HUB_ENABLE_HF_TRANSFER','1')
|
127 |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
128 |
+
os.environ["SAFETENSORS_FAST_GPU"] = "1"
|
129 |
|
130 |
upscaler = UpscaleWithModel.from_pretrained("Kim2091/ClearRealityV1").to(torch.device("cuda:0"))
|
131 |
|
|
|
205 |
pipe.vae.eval()
|
206 |
pipe.text_encoder.eval()
|
207 |
'''
|
|
|
208 |
#pipe.unet = pipe.unet.to(memory_format=torch.contiguous_format)
|
209 |
+
pipe.load_lora_weights("ford442/sdxl-vae-bf16", weight_name="LoRA/FLUX-dev-lora-add_details.safetensors", low_cpu_mem_usage=False)
|
210 |
#pipe.unet.to(memory_format=torch.channels_last)
|
211 |
#pipe.enable_vae_tiling()
|
212 |
#pipe.unet = torch.compile(pipe.unet, backend="hidet", dynamic=False, mode='max-autotune') #.to(device=device, dtype=torch.bfloat16)
|