              logger.trace("Training iteration: %s", iteration)  # type:ignore
              save_iteration = iteration % self._args.save_interval == 0 or iteration == 1
  
              if self._preview.should_toggle_mask or gui_triggers["mask"]:
                  trainer.toggle_mask()
                  update_preview_images = 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_refresh():
 </s> add             if self._preview.should_refresh or gui_triggers["refresh"] or update_preview_images: </s> remove                 self._preview.request_refresh()
 </s> add                 update_preview_images = True
            gui_triggers = self._process_gui_triggers()
              logger.trace("Training iteration: %s", iteration)  # type:ignore
              save_iteration = iteration % self._args.save_interval == 0 or iteration == 1
            gui_triggers = self._process_gui_triggers()
  
              if self._preview.should_toggle_mask or gui_triggers["mask"]:
                  trainer.toggle_mask()
                  update_preview_images = True
keep add keep keep keep keep
 Training - Use custom preview pop-out 
scripts/train.py