Skip to content

Commit a20113d

Browse files
authored
put no_grad decorator on make_image closures (CompVis#375)
1 parent 0f93dad commit a20113d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ldm/simplet2i.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,7 @@ def _txt2img(
474474

475475
sampler = self.sampler
476476

477+
@torch.no_grad()
477478
def make_image(x_T):
478479
uc, c = self._get_uc_and_c(prompt, skip_normalize)
479480
shape = [
@@ -528,6 +529,7 @@ def _img2img(
528529

529530
t_enc = int(strength * steps)
530531

532+
@torch.no_grad()
531533
def make_image(x_T):
532534
uc, c = self._get_uc_and_c(prompt, skip_normalize)
533535

0 commit comments

Comments
 (0)