Fixed error in catching OOM
This commit is contained in:
Sumeth Sathnindu
2025-01-19 10:40:49 +05:30
committed by GitHub
parent 3faf0d79ee
commit 8917255002
+3 -1
View File
@@ -273,7 +273,9 @@ class TangoFluxVAEDecodeAndPlay:
results = torch.cat(results, dim=0)
return results
except torch.OutOfMemoryError:
except (torch.cuda.OutOfMemoryError, RuntimeError) as e:
if isinstance(e, RuntimeError) and "out of memory" not in str(e):
raise e
torch.cuda.empty_cache()
log.warning("OOM encountered. Falling back to tiled decoding.")
return self.decode_tiled(vae, latents, tile_size)