Introduction

DeepSeek Harness (DSH) uses a plugin architecture that allows capabilities to be extended through added features. dsh-rembg is a local image background removal plugin that integrates the functionality of Python rembg into the DSH ecosystem, providing agents with background removal capabilities that do not require a cloud API.

Plugin Overview

dsh-rembg is an image processing plugin that runs in the DSH environment. It is maintained by the developer mengruoa and categorized under model inference. It uses the MIT license. The plugin allows background removal operations to be performed within the DSH process without relying on the system Python environment.

Installation and Activation

Installing this plugin requires DSH version >= 0.1.7-rc.1.

dsh plugin --profile web add dsh-rembg

After installation, start DSH to use it.

Configuration and Initialization

After installing the plugin, you need to complete the initial configuration in the Web GUI.

  1. Open the “Plugins” sidebar in the Web GUI.
  2. Find the dsh-rembg plugin and click to enter it.
  3. Click the configuration entry on the right side of the rembg row.
  4. Select the runtime mode (CPU or NVIDIA GPU).
  5. Click “Initialize Environment” to install the required Python dependencies.
  6. Select and install the required background removal models from the model list.
  7. Save the settings.

Configuration Notes:
- Starting with DSH 0.1.7-rc.1, the configuration entry has been moved from “Settings -> Plugins -> Plugin Configuration” to the row-level configuration on the plugin page.
- The configuration values are persisted in the rembg row within the cordis.patch.yml file of the current profile.
- GPU mode requires a local NVIDIA GPU, appropriate graphics drivers, and detectability via the nvidia-smi command.

Usage

The plugin provides the rembg tool function for model invocation.

Function Parameters:
- path: Absolute path to the input image. Required.
- model: Name of an installed model. Optional. If not specified, the default model configured on the configuration page is used.

Usage Example:

用 rembg 工具把 /path/to/photo.png 的背景去掉。

To view the list of models available in the current environment, call the rembg_models function first, then call rembg using one of the valid returned models.

Notes

  • The plugin dependencies and model files are stored in the plugin installation directory and do not modify the system Python environment.
  • Before use, ensure that the DSH process has permission to access the target image path and write to the output path.
  • GPU mode relies on hardware and drivers. If the environment does not meet the requirements, switch to CPU mode.

Conclusion

dsh-rembg provides lightweight local image background removal capabilities for the DSH ecosystem. It is suitable for agent development that requires image processing in local environments, especially in scenarios without public cloud API access. For more details, see the Plugin Directory or Source Code.