When building visually capable agents in DeepSeek Harness (DSH), directly calling NovelAI V4.5 Full to generate images is a common requirement. Manually writing Danbooru-tagged prompts can be time-consuming and error-prone. dsh-plugin-novelai aims to solve this pain point, allowing agents to describe the desired scene directly in conversation while the plugin handles prompt engineering and API calls.

This is a model inference plugin maintained by ysysz0343-web, supporting NovelAI Diffusion V4.5 Full rules. It integrates automatic prompt writing, Danbooru tag lookup, and image prompt reverse engineering.

Installation

Install it via the official CLI:

dsh plugin --profile web add github:ysysz0343-web/dsh-plugin-novelai

After installation, some versions require restarting Harness (dsh web) for changes to take effect.

Token Configuration

The plugin requires a NovelAI API Token. The configuration priority from high to low is:

  1. Send the API Key directly in the conversation (e.g. nst-xxxx); it will be automatically included when the AI generates;
  2. Configure it under config.token in cordis.yaml;
  3. Use the environment variable NOVELAI_API_KEY or write it to $DSH_HOME/.credentials.yaml (DSH native credential store).

Usage

After configuring the token, simply describe the desired image in the conversation. The AI will automatically write the prompt according to the rules and call the generation tool.

  • Image generation example: Generate an nai4.5f image: a silver-haired girl holding a red umbrella in a rainy neon-lit narrow alley, wet skirt hem, rear-side view
  • Reverse prompt example: Reverse the prompt of E:\path\to\image.png

The plugin includes the following tools:

  • nai_generate_image: Generates NovelAI V4.5 Full images according to the rules.
  • nai_tag_suggest: Queries suggested Danbooru tags (Chinese/English/pinyin supported) for normalizing prompts.
  • nai_reverse_prompt: Reverses image prompts. Requires an image-understanding LLM configured in settings.yaml.

The reverse prompt configuration example is as follows:

novelai-image:
  visionBaseUrl: http://127.0.0.1:8080/v1
  visionApiKey: ""
  visionModel: Qwen3.8-27B-Uncensored-noMTP-Q4_K_M.gguf

Notes and Limitations

  • Security: The token is not written to disk; the plugin process does not persist any credentials.
  • Request method: Uses the curl.exe built into Windows to send requests.
  • Data format: Responses are MessagePack binary streams; the plugin includes a decoder for parsing.
  • Repository requirement: Plugins installed from GitHub require the repository to be public.

The plugin source code and directory page can be found in the links below.