                  logger.debug("Saving (save_iterations: %s, save_now: %s) Iteration: "
                               "(iteration: %s)", save_iteration, self._save_now, iteration)
                  model.save(is_exit=False)
                  self._save_now = False
                  self._preview.request_refresh()
  
          logger.debug("Training cycle complete")
          model.save(is_exit=True)
          trainer.clear_tensorboard()
          self._stop = True
 
</s> remove             if self._preview.should_toggle_mask():
 </s> add             if self._preview.should_toggle_mask or gui_triggers["mask"]: </s> remove                 self._preview.request_refresh()
 </s> add                 update_preview_images = True </s> remove                 if self._preview.should_quit():
 </s> add                 if self._preview.should_quit: </s> remove                 if self._preview.should_save():
 </s> add                 if self._preview.should_save:
                update_preview_images = True
                  logger.debug("Saving (save_iterations: %s, save_now: %s) Iteration: "
                               "(iteration: %s)", save_iteration, self._save_now, iteration)
                  model.save(is_exit=False)
                  self._save_now = False
                update_preview_images = True
  
          logger.debug("Training cycle complete")
          model.save(is_exit=True)
          trainer.clear_tensorboard()
          self._stop = True
keep keep keep keep replace keep keep keep keep keep
 Training - Use custom preview pop-out 
scripts/train.py