Skip to content

Commit

Permalink
put no_grad decorator on make_image closures (#375)
Browse files Browse the repository at this point in the history
  • Loading branch information
bakkot authored Sep 5, 2022
1 parent 0f93dad commit a20113d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ldm/simplet2i.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,7 @@ def _txt2img(

sampler = self.sampler

@torch.no_grad()
def make_image(x_T):
uc, c = self._get_uc_and_c(prompt, skip_normalize)
shape = [
Expand Down Expand Up @@ -528,6 +529,7 @@ def _img2img(

t_enc = int(strength * steps)

@torch.no_grad()
def make_image(x_T):
uc, c = self._get_uc_and_c(prompt, skip_normalize)

Expand Down

0 comments on commit a20113d

Please sign in to comment.