              return
  
          self._images = self._get_images()
          self._timelapse = self._set_timelapse()
          self._gui_preview_trigger = os.path.join(os.path.realpath(os.path.dirname(sys.argv[0])),
                                                   "lib", "gui", ".cache", ".preview_trigger")
          self._stop = False
          self._save_now = False
          self._toggle_preview_mask = False
          self._refresh_preview = False
          self._preview_buffer = dict()
 
</s> remove             if self._toggle_preview_mask:
                trainer.toggle_mask()
                self._toggle_preview_mask = False

 </s> add  </s> remove                     if not preview_trigger_set and os.path.isfile(self._gui_preview_trigger):
 </s> add                     if os.path.isfile(self._gui_triggers["mask_toggle"]):
                        self._toggle_preview_mask = True

                    if not preview_trigger_set and os.path.isfile(self._gui_triggers["update"]): </s> remove         preview_trigger().clear()
 </s> add         preview_trigger().clear(trigger_type=None) </s> remove                 if self._args.redirect_gui:
 </s> add                 if self._args.redirect_gui:  # Remove any gui trigger files following an update
        gui_cache = os.path.join(
            os.path.realpath(os.path.dirname(sys.argv[0])), "lib", "gui", ".cache")
        self._gui_triggers = dict(update=os.path.join(gui_cache, ".preview_trigger"),
                                  mask_toggle=os.path.join(gui_cache, ".preview_mask_toggle"))
              return
  
          self._images = self._get_images()
          self._timelapse = self._set_timelapse()
        gui_cache = os.path.join(
            os.path.realpath(os.path.dirname(sys.argv[0])), "lib", "gui", ".cache")
        self._gui_triggers = dict(update=os.path.join(gui_cache, ".preview_trigger"),
                                  mask_toggle=os.path.join(gui_cache, ".preview_mask_toggle"))
        gui_cache = os.path.join(
            os.path.realpath(os.path.dirname(sys.argv[0])), "lib", "gui", ".cache")
        self._gui_triggers = dict(update=os.path.join(gui_cache, ".preview_trigger"),
                                  mask_toggle=os.path.join(gui_cache, ".preview_mask_toggle"))
          self._stop = False
          self._save_now = False
          self._toggle_preview_mask = False
          self._refresh_preview = False
          self._preview_buffer = dict()
keep keep keep keep replace replace keep keep keep keep keep
 Updates
  - Change shortcut key to M
  - Slight optimizations
  - GUI support for mask toggling 
scripts/train.py