              self.wrapper.task.terminate()
  
          self._last_session.save()
          get_images().delete_preview()
          preview_trigger().clear()
          self.quit()
          logger.debug("Closed GUI")
          sys.exit(0)
  
      def _confirm_close_on_running_task(self):
 
</s> remove         preview_trigger().clear()
 </s> add         preview_trigger().clear(trigger_type=None) </s> remove         preview_trigger().clear()
 </s> add         preview_trigger().clear(trigger_type=None) </s> remove         self.add_option_refresh()
 </s> add         self._add_option_refresh()
        self._add_option_mask_toggle() </s> remove     def add_option_refresh(self):
 </s> add     def _add_option_refresh(self): </s> remove         logger.info("Flipping mask display")
 </s> add         """ Toggle the mask overlay on or off based on user input. """
        preview_trigger().clear(trigger_type=None)
              self.wrapper.task.terminate()
  
          self._last_session.save()
          get_images().delete_preview()
        preview_trigger().clear(trigger_type=None)
          self.quit()
          logger.debug("Closed GUI")
          sys.exit(0)
  
      def _confirm_close_on_running_task(self):
keep keep keep keep replace keep keep keep keep keep
 Updates
  - Change shortcut key to M
  - Slight optimizations
  - GUI support for mask toggling 
scripts/gui.py