          self.state.training_size = 256
          self.state.config["coverage"] = 62.5
          self.state.config["subpixel_upscaling"] = False
          self.state.config["reflect_padding"] = False
          self.state.config["mask_type"] = None
          self.state.config["lowmem"] = False
          self.encoder_dim = 1024
  
          if set_lowmem:
              logger.debug("Setting encoder_dim and lowmem flag for legacy lowmem model")
 
</s> remove         image = cv2.imread(filename)
 </s> add         image = cv2.imread(filename, cv2.IMREAD_UNCHANGED) </s> remove         vram_required = self._detector.vram + self._aligner.vram + self._vram_buffer
 </s> add         vram_required = (self._detector.vram +
                         self._aligner.vram +
                         self._masker.vram +
                         self._vram_buffer) </s> remove         # Mask
        if self.config.get("mask_type", None):
 </s> add         if self.config.get("replicate_input_mask", False): </s> remove         self.training_opts["mask_type"] = self.config.get("mask_type", None)
 </s> add  </s> remove         self.target = [batch["targets"][self.model.largest_face_index]]
        if self.use_mask:
            self.target += [batch["masks"]]
 </s> add         self.target = batch["targets"][self.model.largest_face_index]
        self.masks = batch["masks"][0]
        self.state.config["replicate_input_mask"] = False
          self.state.training_size = 256
          self.state.config["coverage"] = 62.5
          self.state.config["subpixel_upscaling"] = False
          self.state.config["reflect_padding"] = False
        self.state.config["replicate_input_mask"] = False
          self.state.config["lowmem"] = False
          self.encoder_dim = 1024
  
          if set_lowmem:
              logger.debug("Setting encoder_dim and lowmem flag for legacy lowmem model")
keep keep keep keep replace keep keep keep keep keep
 Smart Mask Exposure for Extraction & Training (#831)

Smart Masks - Initial Commit 
plugins/train/model/_base.py