Introduction

The DeepSeek Harness (DSH) plugin ecosystem emphasizes modularity and integration. In visual creation scenarios, it often requires first calling a reverse-prompt plugin to obtain prompts, then calling an image-generation plugin to generate images. This process is fragmented and relatively costly. taxue-dsh-artisan (taxue artist) integrates the native toolchain and combines prompt reversal, auditing and optimization, palette extraction, and multi-provider image generation into one plugin, supporting chained invocation between tools.

The plugin is maintained by taxueseek, licensed under the MIT License, and aims to provide developers with a standardized path from reference images to generated images.

Core Features

The plugin includes four native tools, covering the full workflow from analysis to generation:

  • reverse_prompt: local prompt reversal. It outputs not only descriptions but also a complete, ready-to-use image-generation prompt, including aspect-ratio suggestions, optimization directions, and style guidance. It supports translation of the 6-block structured protocol and 9 quantified restoration anchors.
  • optimize_prompt: local prompt auditing. It performs structural auditing, style-risk detection, and single-variable optimization suggestions.
  • extract_palette: local deterministic color-palette extraction. Based on the K-Means algorithm in the Oklab color space, it extracts primary colors, secondary colors, accent colors, and shadow/highlight anchor colors from PNG reference images, ensuring deterministic results.
  • generate_image: remote image-generation tool. It supports multiple providers, including Google Gemini, OpenAI, ByteDance Seedream, xAI Grok, and ChatGPT subscription.

Working Principles and Features

Prompt Reversal and Optimization

reverse_prompt abandons the original Forge task-package mode and adopts a direct-output strategy. After the model reads the image, it directly generates a prompt field that can be pasted into an image-generation tool, rather than a meta-instruction that requires a second model execution. The output includes:
* prompt: the complete prompt.
* optimization_advice: actionable optimization directions.
* aspect_ratio: an aspect-ratio suggestion converted from actual pixels (for example, 9:16).
* quality_gate / risk_flags: quality gate and risk detection.

The plugin has 9 visual restoration anchors, including aspect-ratio anchors, temperament anchors, style anchors, composition anchors, and others. These quantified constraints improve the fidelity of the generated image to the reference image.

Token Optimization

Compared with the older toolchain, taxue-dsh-artisan clearly optimizes token usage:
* Reduced injected payload: Direct prompt output reduces metadata injection by about 44% (from 3863 bytes to about 2178 bytes).
* Simplified chain: The call chain is shortened from the original 8-24 steps to 2-3 steps.

Deterministic Palette Extraction

extract_palette works only on 8-bit non-interlaced PNG files. The algorithm uses K-Means with a fixed number of iterations and outputs hex values, proportions, and lightness anchors. If JPEG/WebP files need to be processed, they must first be converted to PNG using a local command.

Image-to-Image Support

generate_image supports reference-image guidance. By default, reference_assets is used only for side-by-side preview in the result card and does not participate in generation. After explicitly setting use_reference_images: true, the plugin encodes the reference images inline in the request:
* Google Gemini: as an input_image content block.
* OpenAI / Seedream / codex: as an array of data URLs in the image field.
* Grok: as an array of data URLs in the image_url field.

Installation and Configuration

Install the Plugin

Run the following command in a DSH environment to install the plugin:

dsh plugin --profile web add taxue-dsh-artisan

After installation, restart dsh web, then configure providers and API keys in Settings → Plugins → taxue artist (credentials are persisted and not returned to the frontend).

Credential and Provider Configuration

The plugin supports the following providers. Configure the corresponding environment variables:

Provider Default Model Credential Environment Variable
Google Gemini gemini-3.1-flash-image GEMINI_API_KEY
OpenAI gpt-image-2 OPENAI_API_KEY
ByteDance Seedream doubao-seedream-5-0-260128 ARK_API_KEY
xAI Grok grok-imagine-image-2.0 XAI_API_KEY
ChatGPT codex gpt-image-2 No key required

Credential routing rules:
* Grok and codex prefer subscriptions. Grok uses /v1/images/generations, while codex uses /backend-api/codex. If subscription login is not available, they fall back to API keys.
* Grok does not support the size/quality/style parameters. It only supports aspect_ratio and resolution.
* Grok image generation takes about 5-60 seconds. Use background-run mode to avoid timeout.

Save Settings

generate_image supports configuring the on-disk output path for generated images.
* Enter an absolute path in settings; generated images will be saved to that directory.
* If left empty, they will be saved to the default ~/Downloads/ directory.
* Each generated image is accompanied by a same-named .json sidecar file, recording the prompt, model, and timestamp for traceability.

Usage Examples

Chained Reverse Prompt and Image Generation

After calling reverse_prompt to obtain the complete prompt, pass it directly as a parameter to generate_image:

{
  "tool": "generate_image",
  "arguments": {
    "prompt": "基于上一步获取的完整提示词...",
    "provider": "openai",
    "reference_assets": "/path/to/reference.png"
  }
}

Enable Image-to-Image

To make the generated image closer to the reference image, explicitly enable reference-image inlining:

{
  "tool": "generate_image",
  "arguments": {
    "prompt": "...",
    "provider": "grok",
    "use_reference_images": true,
    "reference_assets": "/path/to/reference.png"
  }
}

Deterministic Palette Extraction

Call extract_palette to retrieve the color scheme of a reference image:

{
  "tool": "extract_palette",
  "arguments": {
    "image_path": "/path/to/image.png"
  }
}

Notes

  1. Image-to-image is disabled by default: To prevent accidental image uploads, use_reference_images defaults to false. It must be explicitly set to true for the reference image to be uploaded.
  2. Palette format restriction: extract_palette supports only 8-bit non-interlated PNG. JPEG or WebP images must be converted to PNG first.
  3. Output language: The output_language parameter for reverse_prompt and optimize_prompt supports zh-CN (default), en, and bilingual.
  4. Asynchronous background: generate_image supports the run_in_background parameter to avoid interruption caused by long generation times.

This plugin integrates the previously scattered visual creation toolchain into a single entity, making it suitable for development scenarios that require high-fidelity image restoration and style transfer in DeepSeek Harness.