          if get_backend() == "amd":
              logger.debug("Parallel processing disabled by amd")
              return False
  
          stats = gpu_stats.get_card_most_free()
          vram_free = int(stats["free"])
          logger.verbose("%s - %sMB free of %sMB",
                         stats["device"],
                         vram_free,
                         int(stats["total"]))
          if vram_free <= self._total_vram_required:
 
</s> remove                        stats["device"],
                       vram_free,
                       int(stats["total"]))
        if vram_free <= self._total_vram_required:
 </s> add                        self._vram_stats["device"],
                       self._vram_stats["vram_free"],
                       self._vram_stats["vram_total"])
        if self._vram_stats["vram_free"] <= self._total_vram_required: </s> remove         gpu_stats = GPUStats()
        if gpu_stats.device_count == 0:
 </s> add         if self._vram_stats["count"] == 0: </s> remove         if sum([plugin.vram for plugin in self._all_plugins]) == 0:
 </s> add         if sum([plugin.vram for plugin in self._active_plugins]) == 0: </s> remove         stats = GPUStats().get_card_most_free()
        vram_free = int(stats["free"])
        if self._is_parallel:
            batch_required = sum([plugin.vram_per_batch * plugin.batchsize
                                  for plugin in self._all_plugins])
            plugin_required = self._total_vram_required + batch_required
            if plugin_required <= vram_free:
                logger.debug("Plugin requirements within threshold: (plugin_required: %sMB, "
                             "vram_free: %sMB)", plugin_required, vram_free)
                return
            # Hacky split across plugins that use vram
            gpu_plugin_count = sum([1 for plugin in self._all_plugins if plugin.vram != 0])
            available_vram = (vram_free - self._total_vram_required) // gpu_plugin_count
            for plugin in self._all_plugins:
                if plugin.vram != 0:
                    self._set_plugin_batchsize(plugin, available_vram)
        else:
            for plugin in self._all_plugins:
                if plugin.vram == 0:
                    continue
                vram_required = plugin.vram + self._vram_buffer
                batch_required = plugin.vram_per_batch * plugin.batchsize
                plugin_required = vram_required + batch_required
                if plugin_required <= vram_free:
                    logger.debug("%s requirements within threshold: (plugin_required: %sMB, "
                                 "vram_free: %sMB)", plugin.name, plugin_required, vram_free)
                    continue
                available_vram = vram_free - vram_required
                self._set_plugin_batchsize(plugin, available_vram)
 </s> add         batch_required = sum([plugin.vram_per_batch * plugin.batchsize
                              for plugin in self._active_plugins])
        gpu_plugins = [p for p in self._current_phase if self._vram_per_phase[p] > 0]
        plugins_required = sum([self._vram_per_phase[p]
                                for p in gpu_plugins]) * self._parallel_scaling[len(gpu_plugins)]
        if plugins_required + batch_required <= self._vram_stats["vram_free"]:
            logger.debug("Plugin requirements within threshold: (plugins_required: %sMB, "
                         "vram_free: %sMB)", plugins_required, self._vram_stats["vram_free"])
            return
        # Hacky split across plugins that use vram
        available_vram = (self._vram_stats["vram_free"] - plugins_required) // len(gpu_plugins)
        self._set_plugin_batchsize(gpu_plugins, available_vram)
          if get_backend() == "amd":
              logger.debug("Parallel processing disabled by amd")
              return False
  


          logger.verbose("%s - %sMB free of %sMB",
                         stats["device"],
                         vram_free,
                         int(stats["total"]))
          if vram_free <= self._total_vram_required:
keep keep keep keep replace replace keep keep keep keep keep
 Extract - Better VRAM Allocation in Extraction Pipeline 
plugins/extract/pipeline.py