  
              if self._preview.should_refresh or gui_triggers["refresh"] or update_preview_images:
                  viewer = display_func
              else:
                  viewer = None
  
              timelapse = self._timelapse if save_iteration else {}
 
</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 </s> remove             if self._preview.should_toggle_mask():
 </s> add             if self._preview.should_toggle_mask or gui_triggers["mask"]:
                update_preview_images = False
  
              if self._preview.should_refresh or gui_triggers["refresh"] or update_preview_images:
                  viewer = display_func
                update_preview_images = False
              else:
                  viewer = None
  
              timelapse = self._timelapse if save_iteration else {}
keep keep add keep keep keep keep
 Training - Use custom preview pop-out 
scripts/train.py