Update imagic.py
Browse files
imagic.py
CHANGED
@@ -318,7 +318,9 @@ class ImagicStableDiffusionPipeline(DiffusionPipeline):
|
|
318 |
|
319 |
with torch.no_grad():
|
320 |
torch.cuda.empty_cache()
|
321 |
-
|
|
|
|
|
322 |
optimizer.zero_grad()
|
323 |
|
324 |
# Checks if the accelerator has performed an optimization step behind the scenes
|
|
|
318 |
|
319 |
with torch.no_grad():
|
320 |
torch.cuda.empty_cache()
|
321 |
+
|
322 |
+
with torch.no_grad():
|
323 |
+
optimizer.step()
|
324 |
optimizer.zero_grad()
|
325 |
|
326 |
# Checks if the accelerator has performed an optimization step behind the scenes
|