use better context manager to fix potential problems

This commit is contained in:
lllyasviel
2024-02-08 01:51:18 -08:00
parent 4c9db26541
commit 760f727eb9
2 changed files with 4 additions and 1 deletions

View File

@@ -814,7 +814,7 @@ def process_images_inner(p: StableDiffusionProcessing) -> Processed:
infotexts = []
output_images = []
with torch.no_grad():
with torch.inference_mode():
with devices.autocast():
p.init(p.all_prompts, p.all_seeds, p.all_subseeds)