Introduction

DeepSeek Harness (DSH) supports plugin-based extension. This plugin provides DSH with local image generation capabilities. It calls the locally installed ComfyUI and runs the Qwen-Image 2.1 model to perform text-to-image and image-to-image tasks. Generated images are saved to disk and displayed directly in the conversation interface. All network traffic for the plugin is strictly limited to the local loopback address (127.0.0.1). It does not rely on external networks and requires no API keys.

Plugin Positioning

  • Name: dsh-qwen-paint
  • Owner: yanfei0725
  • License: MIT
  • Core Value: Generate images locally using the Qwen-Image 2.1 model, reducing usage costs and protecting data privacy.

Core Features

The plugin mainly includes the following feature modules:

  1. Generation Modes

    • Text-to-Image and Image-to-Image: Supports generating new images from text or reference images.
    • Automatic Upscaling After Generation: After setting the parameters, the generated image can be automatically upscaled using chunked processing.
    • Serial Gacha (Queue Mode): When VRAM is insufficient, it uses a “submit one image → wait for the result → save to disk → submit the next one” workflow, suitable for batch generation.
    • Single-Batch Generation: Supports submitting multiple images for generation at once.
  2. VRAM and Performance Management

    • VRAM Tiers: Supports auto, resident (full residency), standard, save (VRAM saving), ram (load weights into memory), and cpu modes.
    • Model Precision Tiers: Supports BF16, FP8, int8, and GGUF.
    • Text Control Tiers: Supports turbo (8 steps / CFG 1.0) and native (Qwen native operating point).
    • Adjustable Weights: Supports adjusting the weights of the main model, LoRA, and ControlNet.
    • Generic ControlNet Support: Passes the control image via the controlImage parameter.
    • SageAttention: Supports performance mode and compatibility mode, depending on the ComfyUI global flag --use-sage-attention.
    • RDNA3 FlashAttention: Integrates with the installed RDNA3 FlashAttention nodes.
    • Automatic OOM Fallback: When VRAM is insufficient, it automatically switches VAE decoding to chunked mode and retries.
  3. Ecosystem Integration

    • Memory Integration: Supports integration with the dsh-auto-memory plugin and reads memory preferences.

Usage

Configure or pass the following items in DSH’s configuration or invocation parameters:

  • Enable Upscaling: Set the upscaleAfter parameter, for example to 2.
  • Enable Serial Mode: Set serialBatch to auto (default), on, or off.
  • Set VRAM Mode: Set vramMode, for example to ram to load weights into memory.
  • Set Precision: Set precisionTier, for example to BF16.
  • Set Text Control: Set textControl, for example to native.
  • Enable ControlNet: Pass the controlImage parameter and ensure the corresponding ControlNet nodes exist in ComfyUI.
  • Enable SageAttention: Add --use-sage-attention to the ComfyUI startup parameters; the plugin can internally configure the SageAttention mode.
  • Configure AMD Optimizations (optional): Adjust AMD-specific kernel or asynchronous offload parameters in the ComfyUI startup parameters; a restart is required for changes to take effect.

Dependencies and Installation

The plugin depends on the following runtime environment:
* DeepSeek Harness: The version must meet the plugin’s compatibility requirements.
* ComfyUI: It must be installed and configured with the Qwen-Image 2.1 model files.
* Model Files: The corresponding Qwen-Image 2.1 weight files must be stored locally (according to the precision tier requirement).

Notes

  1. Network and Security: All network traffic is limited to the local loopback address (127.0.0.1), so no external call fees are incurred.
  2. Startup Parameters: Configuration changes involving ComfyUI startup, such as changing vramMode or AMD optimization parameters, require a ComfyUI restart to take effect.
  3. ControlNet: When using ControlNet, all three conditions must be met simultaneously: ComfyUI detects the ControlNetLoader and ControlNetApplyAdvanced nodes, the weights are selected in the panel, and the controlImage parameter is passed. Missing any one condition will prevent it from working.
  4. AMD Platform: BF16, FP8, and ControlNet are untested on the development machine (AMD). AMD-specific optimizations (kernels / asynchronous offload) are disabled by default; enabling them requires a ComfyUI restart.
  5. SageAttention: This feature depends on the ComfyUI global flag --use-sage-attention. If enabling it causes ComfyUI startup to fail, the plugin will automatically disable this feature within the current session and fall back to avoid repeated crashes.
  6. Testing Disclaimer: SADA node types and image-quality/speed benefits have not been validated on real hardware.