From eb58276a2c11f1cbdba1eb7133d4d9404118b7fd Mon Sep 17 00:00:00 2001 From: JigenD Date: Thu, 25 Aug 2022 08:34:51 -0400 Subject: [PATCH 1/2] fix VRAM utilization --- ldm/simplet2i.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ldm/simplet2i.py b/ldm/simplet2i.py index 4737d90ba7..b5dc775c73 100644 --- a/ldm/simplet2i.py +++ b/ldm/simplet2i.py @@ -494,6 +494,7 @@ The vast majority of these arguments default to reasonable values. sd = pl_sd["state_dict"] model = instantiate_from_config(config.model) m, u = model.load_state_dict(sd, strict=False) + model.cuda() model.eval() if self.full_precision: print('Using slower but more accurate full-precision math (--full_precision)') From e82c5eba18bc2f2b0e9588b5a9227e19ed1e04a3 Mon Sep 17 00:00:00 2001 From: JigenD Date: Thu, 25 Aug 2022 12:18:35 -0400 Subject: [PATCH 2/2] PR revision: replace cuda call with dynamic type --- ldm/simplet2i.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ldm/simplet2i.py b/ldm/simplet2i.py index b5dc775c73..c67d02bb6c 100644 --- a/ldm/simplet2i.py +++ b/ldm/simplet2i.py @@ -494,7 +494,7 @@ The vast majority of these arguments default to reasonable values. sd = pl_sd["state_dict"] model = instantiate_from_config(config.model) m, u = model.load_state_dict(sd, strict=False) - model.cuda() + model.to(self.device) model.eval() if self.full_precision: print('Using slower but more accurate full-precision math (--full_precision)')