          logger.trace("Loading latest preview")  # type:ignore
          if not self.update_preview.get():
              logger.trace("Preview not updated")  # type:ignore
              return
          get_images().load_training_preview()
          self.display_item = get_images().previewtrain
  
      def display_item_process(self) -> None:
          """ Display the preview(s) resized as appropriate """
          logger.trace("Displaying preview")  # type:ignore
          sortednames = sorted(list(get_images().previewtrain.keys()))
 
</s> remove         if not self.update_preview.get():
 </s> add         if not self._preview.load(): </s> remove         size = 256 if self.command == "convert" else 128
        get_images().load_latest_preview(thumbnail_size=int(size * get_config().scaling_factor),
                                         frame_dims=(self.winfo_width(), self.winfo_height()))
        self.display_item = get_images().previewoutput
 </s> add         size = int(256 if self.command == "convert" else 128 * get_config().scaling_factor)
        if not self._preview.load_latest_preview(thumbnail_size=size,
                                                 frame_dims=(self.winfo_width(),
                                                             self.winfo_height())):
            logger.trace("Preview not updated")  # type:ignore
            return
        logger.debug("Preview loaded")
        self.display_item = True </s> remove         logger.trace("Displaying preview")  # type:ignore
        sortednames = sorted(list(get_images().previewtrain.keys()))
        existing = self.subnotebook_get_titles_ids()
        should_update = self.update_preview.get()

        for name in sortednames:
            if name not in existing:
                self.add_child(name)
            elif should_update:
                tab_id = existing[name]
                self.update_child(tab_id, name)

        if should_update:
            self.update_preview.set(False)

    def add_child(self, name: str) -> None:
        """ Add the preview canvas child

        Parameters
        ----------
        name: str
            The name of the notebook tab to add
        """
        logger.debug("Adding child")
        preview = PreviewTrainCanvas(self.subnotebook, name)
        preview = self.subnotebook_add_page(name, widget=preview)
        Tooltip(preview, text=self.helptext, wrap_length=200)
        self.vars["modified"].set(get_images().previewtrain[name][2])

    def update_child(self, tab_id: int, name: str) -> None:
        """ Update the preview canvas
 </s> add         if self.subnotebook.children:
            return
        logger.debug("Preview loaded")
        self.display_item = True
          logger.trace("Loading latest preview")  # type:ignore
          if not self.update_preview.get():
              logger.trace("Preview not updated")  # type:ignore
              return
        logger.debug("Preview loaded")
        self.display_item = True
        logger.debug("Preview loaded")
        self.display_item = True
  
      def display_item_process(self) -> None:
          """ Display the preview(s) resized as appropriate """
          logger.trace("Displaying preview")  # type:ignore
          sortednames = sorted(list(get_images().previewtrain.keys()))
keep keep keep keep replace replace keep keep keep keep keep
 GUI - Preview updates
  - Training preview. Embed preview pop-out window
  - Bugfix - convert/extract previews 
lib/gui/display_command.py