reset pipeline on each iteration

This commit is contained in:
Vladimir Mandic
2024-07-05 08:20:02 -04:00
parent eb2eef5e9e
commit 728de428ee
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -388,8 +388,9 @@ def process_images_inner(p: StableDiffusionProcessing) -> Processed:
devices.torch_gc()
if hasattr(shared.sd_model, 'restore_pipeline') and shared.sd_model.restore_pipeline is not None:
print('HERE RESTORE')
shared.sd_model.restore_pipeline()
if shared.native: # reset pipeline for each iteration
shared.sd_model = sd_models.set_diffuser_pipe(shared.sd_model, sd_models.DiffusersTaskType.TEXT_2_IMAGE)
t1 = time.time()
shared.log.info(f'Processed: images={len(output_images)} time={t1 - t0:.2f} its={(p.steps * len(output_images)) / (t1 - t0):.2f} memory={memstats.memory_stats()}')