DeepSeek Harness Plugin: Integrating Local NPU Image Generation from Local Dream on Mobile into Conversations

DeepSeek Harness (DSH) adopts a plugin architecture and exposes extension capabilities to agents through a conversational interface. The dsh-localdream plugin aims to address the integration of local model inference. It brings the on-device Local Dream NPU image-generation capabilities into the chat flow, supporting text-to-image, image-to-image, upscaling, and tiled repaint. The entire process communicates only with the local loopback, without going to the cloud, so there are no charges and no content moderation.

Installation and Activation

The plugin has zero runtime dependencies; it does not require npm install and does not pollute the host environment.

git clone https://github.com/133563825as-ai/dsh-localdream.git ~/dsh-localdream

dsh plugin --profile web add link:~/dsh-localdream

After installation, you must restart DSH for the changes to take effect. You can verify it with:

dsh --profile web --dump-config | grep -A3 dsh-localdream

Core Capabilities

The plugin primarily provides the following capabilities:

  • Connect to on-device Local Dream NPU image generation: Uses mobile hardware for inference.
  • Text-to-image: Generates images from natural-language descriptions.
  • Image-to-image: Repaints based on an input image.
  • 4× upscaling: Increases image resolution.
  • Tiled repaint: Modifies local regions of an image (UltraFix mode).
  • Zero runtime dependencies: Does not rely on any external packages.
  • Offline, no charges, no content moderation: All computation is performed locally.
  • Supports any model: No preset art styles; works with any model supported by the Local Dream backend.

Prerequisites

  1. Install Local Dream on the phone, version 3.0.0-alpha.3 or higher.
  2. Manually enable Controlled Mode in the app. This is required for the plugin to work:
    > Local Dream → tap ⋮ in the top-right corner of the model list → Device Interconnect → Controlled Mode section → “Enter Controlled Mode”
  3. The plugin uses two ports exposed by Local Dream:
    • 127.0.0.1:8808: Control port (JSON API)
    • 127.0.0.1:8081: Generation port (native backend)

Tool Usage

The plugin provides six main tools to control the image-generation workflow.

1. ld_status

Used to check Controlled Mode status, current model, backend status, and the list of installed models. It is recommended to run this before generating images.

2. ld_draw

The core command for text-to-image or image-to-image.

// Text-to-image
ld_draw({ prompt: '雨夜少女', aspectRatio: '3:4' })

// Use a template
ld_draw({ template: '雨夜少女' })

3. ld_enhance

Handles image enhancement and repaint.

// 4× upscale
ld_enhance({ mode: 'upscale', image: '...' })

// Tiled repaint
ld_enhance({ mode: 'ultrafix', image: '...', prompt: '...' })

4. ld_config

View and modify usage preferences and per-model parameter presets within the container.

// View current configuration
ld_config({ action: 'show' })

// Set default aspect ratio
ld_config({ action: 'set', key: 'defaultAspectRatio', value: '3:4' })

// Reset a configuration item
ld_config({ action: 'reset', key: '' })

5. ld_prompt

Manage prompt templates.

// Save a template
ld_prompt({ action: 'save', name: '雨夜少女', prompt: '...', aspectRatio: '3:4', steps: 30 })

// List all templates
ld_prompt({ action: 'list' })

Configuration and Limitations

Configuration file location

All configuration and prompt templates are stored in <DSH_HOME>/localdream/ (usually /root/.dsh/localdream/), including settings.json, models.json, and the prompts/ directory. These are plain JSON files and can be edited directly.

Important limitations

  • *_turbo models are not supported: These models consume large amounts of memory and can cause process crashes.
  • UltraFix support scope: Only supports SD1.5 QNN and SDXL QNN backends. Other backends will error.
  • Size calculation: The width / height fields are invalid; the size is determined by aspect_ratio. The long edge is fixed to the model’s base size, and the short edge is scaled proportionally and rounded to a multiple of 8.
  • Image-to-image input size: The input image size must match the calculated value from aspectRatio, otherwise an error will occur.

Use Cases and Notes

This plugin is suitable for scenarios that require local, offline image generation. Because it relies on the Controlled Mode of the on-device Local Dream, ensure the phone and computer are in the same network environment (or connected via loopback), and keep the phone screen on to prevent the system from reclaiming the background process.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye