DeepSeek Harness Plugin

shanliuling/dsh-image-gen

Stars ★ 1598 Downloads (30d) 89,465 Category Workflow & Automation Added 2026-08-19 npm dsh-image-gen

Native conversational image generation for DeepSeek Harness: ask the agent to create an image, and it handles generation and keeps the result directly in the conversation.

Install

# from npm (prebuilt)

dsh plugin --profile web add dsh-image-gen

# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)

dsh plugin --profile web add github:shanliuling/dsh-image-gen

Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).

README

🎨 dsh-image-gen

Draw by talking, right inside DeepSeek Harness

dsh-image-gen is a native image creation plugin for DeepSeek Harness. Instead of bolting an image button onto the chat, it teaches the Agent itself to make images: it can plan and generate a whole set in one go, read your sketches and selections on the canvas, and pull the right style template from the inspiration library on its own. When you want fine-grained control, Studio, multi-model comparison, and the Gallery are one click away.

Already paying for ChatGPT, Grok, or Google? Just sign in and start generating—no separate API key purchase needed.

Supports: Gemini · OpenAI / Compatible · Seedream · DashScope · Grok Imagine · GLM-Image · Local ComfyUI

pnpm dsh plugin --profile web add dsh-image-gen@latest

See Releases for what changed in each version.


Just say it

No parameters to learn, no pages to switch. Just say it in a DSH chat:

You say What the plugin does
"Make 4 illustrations for my Coffee Shop Grand Opening post, consistent flat style, 16:9" 🔁 Batch generation in chat: the Agent splits the request into 4 prompts and generates them one by one, all delivered in a single reply
"Draw a coffee shop menu in hand-drawn style #123" ✨ Inspiration on autopilot: the Agent searches the 500+ example library for that style, then applies the template
"Turn the sketch I drew on the canvas into a finished illustration" ✏️ Reads the canvas: the Agent looks at your canvas selection and turns the draft into an image
"Turn the sword I circled into an axe, keep everything else" 🎯 Edit what you circle: only the marked area changes
"Keep this character exactly the same, but put them in a snowy scene" 🎭 Identity consistency: edits keep the same person or object instead of a lookalike
"Same prompt, one from GPT and one from Gemini, side by side" ⚖️ Multi-model comparison: runs several models concurrently and lays the results out on one canvas
"Turn this character into a looping GIF of them waving" 🎞️ Animated GIFs: generates a looping animation that plays in the card, with speed control and per-frame edit notes

Quick Start

Hardened downloads (opt-in)

Two optional settings harden the paths that leave this machine, both off by default:

  • strictImageDownloads: result URLs must be public HTTPS on port 443. DNS answers are validated and pinned for the request, redirects from provider results are never followed, and responses respect the image byte limit.
  • requireHostAdmission: the plugin's web routes refuse requests with 503 whenever the host's connection admission service is absent or fails, instead of serving them unguarded.

They stay off by default because a TUN proxy or a custom corporate resolver can intentionally answer with private-range addresses; enabling either setting assumes your egress is direct.

1. Install the plugin

Requirements: DeepSeek Harness stable version, Node.js ^22.19.0 or >= 24.0.0.

Run this command from your DeepSeek Harness project root:

pnpm dsh plugin --profile web add dsh-image-gen@latest

💬 Power-user tip: You can also send this directly to the Agent in a DSH chat: Install the image generation plugin by running this command in the terminal: pnpm dsh plugin --profile web add dsh-image-gen@latest

# If dsh is installed globally:
dsh plugin --profile web add dsh-image-gen@latest

# Install the latest source directly from GitHub:
pnpm dsh plugin --profile web add git+https://github.com/shanliuling/dsh-image-gen.git

# Clone the repository and install it for local development:
git clone https://github.com/shanliuling/dsh-image-gen.git
pnpm dsh plugin --profile web add ./dsh-image-gen

2. Configure a Provider

After restarting DSH, click the Plugins icon in the left sidebar, then click dsh-image-gen under Installed — the Image Generation settings form lives on the plugin's detail page:

Plugins panel → Installed → dsh-image-gen

DSH 0.1.5 and earlier have no Plugins panel; the entry there is Settings → Plugins → Plugin Configuration → Image Generation. The same plugin build supports both.

Choose a Provider, enter your API key, and adjust the model, Endpoint / Base URL, and workspace-save options as needed. Once the key is stored, click Test connection to verify it, or Fetch models to pull every image-capable model the provider offers—no manual lookups needed. For ComfyUI, enter an address reachable by the DSH Host and import an API Format Workflow JSON file. With several workflows imported, switch between them from the image button next to the chat input.

Already paying for ChatGPT, Grok, or Google? No API key needed: expand the matching subscription Provider row, click Sign in and complete the authorization in your browser, then start generating (and editing) right away.

3. Start creating

Describe the image you want directly in chat:

Create a cinematic cyberpunk cat on a neon street at night, 16:9.

Want a whole set? Just say how many and what should stay consistent:

Make 5 images for my "Weekend Camping Checklist" post: tent, stove, sleeping bag, lights, snacks. Consistent Japanese hand-drawn style, 3:4.

You can also upload a reference image directly for style transfer or editing:

Keep the character and composition unchanged, then add black sunglasses to the cat.

For more precise parameter control, open Gallery from the conversation header, then switch between Gallery / Studio / Inspiration / Favorites.


Core Capabilities

🔁 Batch generation in chat: one message, a whole set

Post illustrations, storyboards, series art, or several variations on a theme—without asking for them one at a time.

  • Describe how many images you want and what they share. The Agent plans the set of prompts itself, up to 10 images per call, attached in order to a single reply.
  • Aspect ratio, resolution, model, and Provider can be set once for the whole set to keep it consistent.
  • Images generate one after another, and one failure never stops the rest: the reply reports "X of Y generated" and lists what failed and why.
  • Works with local ComfyUI and subscription channels too.

How is this different from Studio batches? Chat batches are a set of different images the Agent plans for you (say, 4 illustrations of different scenes). Studio batches are several candidates for the same prompt, and you keep the ones you like.

✏️ A canvas the AI can actually read

Sketch on an infinite canvas, lay out references, circle what should change, then just tell the AI what you want. The Agent sees what is on the canvas and what you have selected, so there is no need to screenshot, upload, or describe positions.

  • Sketch → image: draw a rough outline, select it, and say "make this a cartoon character".
  • Edit what you circle: mark an area on an existing image and say "turn this into an axe"; only the circled part changes.
  • Combine references: drag images from Recent generations or the Gallery onto the canvas, or click Send to canvas on a thumbnail, then select several together as references. Repeated imports of the same history item are deduplicated.
  • Every result stays on the canvas, so you can keep iterating from any version.

💬 In-chat generation, editing, and revision switching

  • Use natural language for text-to-image, image-to-image, multi-image reference, and style transfer.
  • Identity consistency: when you ask to keep a person, character, or object the same, the plugin tells the model to reuse the subject from the references and change only the scene, clothing, pose, or style, rather than drawing a similar-looking replacement.
  • Edit the original prompt to regenerate, then switch between revisions on the same image card.

🎞️ Animated GIFs: generate, play, edit by frame

With a GIF-capable model such as GPT Image 2.6, just ask for a "GIF" or "animation" in chat to get a looping animation, including animating the character from a reference image. Frame count and timing can be set with frame_count (2–16) and frame_duration_ms (20–2000 ms).

  • When a result is a GIF, the chat card plays it: set the speed (0.2×–2×) from its corner, and the toolbar's download menu saves the GIF at the current or the original speed, or the frame on screen as PNG. The enlarged view adds a play button and a frame timeline (hover to preview a frame, click to stop on it) next to the speed. In the Gallery, GIF tiles carry a badge and play on hover, and the enlarged view plays and downloads them the same way. The GIF file can be dragged straight out, and regenerating keeps it a GIF (the clipboard only takes still images, so copying gives a single frame).
  • A GIF card's Edit chip (or Edit frames in the enlarged view) takes notes on frames: click a spot on the picture to leave a note, which shows only on its own frame, or switch to All frames to see them together; send once to redraw the whole animation from your notes, kept as a new version that plays (OpenAI and compatible channels only, and the relay must support image editing; otherwise one click turns the notes into a plain regeneration).
  • Supported channels: official OpenAI and OpenAI-compatible relays (the model and relay must support GIF). The Codex images endpoint behind the ChatGPT subscription does not offer GIF output upstream yet.
🖼️ SVG vector output

Generation can also return a vector document: pass output_format: "svg" to generate_image (official OpenAI and compatible relays, text-to-image only — the edits endpoint does not produce SVG).

  • The result does appear as a chat card: the card draws the vector image itself (open it to zoom without loss), and its toolbar copies the markup, downloads the .svg, or opens the saved file in the sidebar. DSH attachments store png/jpeg/webp/gif only, so the card renders the markup from the tool result; the Gallery and version history still keep bitmaps only.
  • A vector document has no pixel grid, so size / aspect_ratio / image_size are not sent and the result says so; frame_count / frame_duration_ms belong to GIF and are rejected alongside SVG.

✨ 500+ prompt inspirations, and the Agent finds them for you

Ships with a hand-drawn style cookbook (styles / layouts / theme colors) and the awesome-gpt-image-2 example set: 500+ ready-to-reuse prompts.

  • Name it in chat: say "use style #123", "make it an infographic layout", or "Morandi palette", and the Agent searches the library first, then applies the template to your topic. Styles, layouts, and theme colors can be combined.
  • Browse in the UI: filter, favorite, copy, or send a prompt straight to Studio (see the Studio demo below).
  • Images are cached locally, so browsing and learning consume no tokens or generation quota.

🎛️ Studio: hands-on control, no chat needed

When you want precise control, open Gallery → Studio from the conversation header and every parameter is right there.

  • Start from inspiration: click "Send to Studio" in the inspiration library and the prompt is filled in.
  • Every parameter in view: pick the Provider, model, aspect ratio, quality, and watermark separately; generate 1–4 candidates and save only the ones you like.
  • Keep editing past results: drag an image in from Recent generations and click "Continue editing" to make it the image-to-image reference (up to 5).
  • Switch between single model and multi-model comparison in one click.

⚖️ Side-by-side multi-model comparison

Run the same prompt and reference images across multiple models concurrently, then compare and save the results on one canvas.

🖼️ Gallery, favorites, and batch management

  • Manage images saved from chat and Studio in one place, isolated by workspace.
  • Search, filter, favorite, download, continue editing, regenerate, and batch-manage results.

🧩 Multiple local ComfyUI workflows

Bring private image generation on your local GPU directly into Agent conversations.

  • Import and manage multiple named workflows with prompt presets and common placeholders.
  • Let the Agent select a workflow by name for text-to-image, image-to-image, or batch generation in chat.
  • Placeholders: {{prompt}}, {{seed}}; with {{width}}/{{height}} the size or aspect ratio the Agent asks for takes effect (1024×1024 by default); for editing put {{image}} in a LoadImage input, one per reference image, filled in node order.

ComfyUI is not yet integrated into Studio or multi-model comparison.


Provider Support

Provider Chat generation Chat batch Chat editing Studio Multi-model comparison GIF
Google Gemini ✅ ✅ ✅ Multiple ✅ ✅ —
OpenAI Images ✅ ✅ ✅ Multiple ✅ ✅ ✅
OpenAI Compatible (relay) ✅ ✅ ✅ Multiple ✅ ✅ ✅
ByteDance Seedream / Volcengine Ark ✅ ✅ ✅ Multiple ✅ ✅ —
Aliyun DashScope / Qwen Image ✅ ✅ ✅ Multiple ✅ ✅ —
xAI Grok Imagine ✅ ✅ ⚠️ Limited ✅ ✅ —
Zhipu GLM-Image ✅ ✅ — ✅ ✅ —
Local ComfyUI ✅ ✅ ✅ Multiple — — —
ChatGPT subscription (key-free) ✅ ✅ ✅ Multiple ✅ ✅ —
Grok subscription (key-free) ✅ ✅ ✅ Multiple ✅ ✅ —
Google subscription (key-free) ✅ ✅ ✅ Multiple ✅ ✅ —

Studio and multi-model comparison currently support cloud Providers only (subscription channels included). Multi-model comparison uses the model configured for each Provider in Settings. Zhipu GLM-Image does not support image-to-image upstream. xAI image editing goes through the OpenAI-compatible protocol (multipart); some gateways may need further adaptation. Subscription channels work through account sign-in (no API key). Edits ride each channel's edit endpoint (up to 5 reference images), with aspect ratio and quality selectable directly in Studio. Chat generation and editing on OpenAI and compatible channels can produce an animated GIF directly, for example animating the character in a reference image (the model and relay must support it; editing also needs the relay to support image edits); frame count and timing options are in the Provider configuration reference. The endpoint the ChatGPT subscription uses does not offer GIF output yet.

📖 For default models and endpoints, per-Provider aspect ratios and quality tiers, size tables, watermarks, relay edit formats, and other advanced settings, see the Provider configuration reference.


Data and Privacy

  • BYOK: API keys are stored through the DSH Credentials service and are never displayed in plaintext on the settings page.
  • Subscription sign-in: Subscription tokens are saved in DSH Credentials after your authorized sign-in, fully isolated from API keys; the browser side never touches a token.
  • Cloud requests: The prompt and reference images used for a request are sent to the selected Provider. Follow that Provider's terms of service.
  • Provider image downloads: Downloads use the host's existing network and proxy configuration without additional Fake-IP, private-address or loopback blocking. Complete SSRF target restrictions are not currently provided.
  • Local ComfyUI: Requests are sent to the configured ComfyUI address.
  • Workspace files: When workspace saving is enabled, chat results are written to disk; Studio saves only the candidates you select.
  • GIF originals: The original file of an animated result is also kept in the raw-image vault (vaultEnabled turns it off) so the card can play and export it; it is removed together with the gallery entry.
  • Gallery and favorites: Gallery metadata and favorite state are stored in the current browser's local storage.
  • Deleted records: Normal deletion retains a small image ID marker, including after 30 days, so reopening an old conversation does not silently restore the image to the gallery.
  • Inspiration cache: Example metadata ships with the plugin. Images load on demand and are cached locally, and the cache can be cleared at any time.

FAQ

The settings entry depends on the DSH version: 0.1.6 and newer place it on the plugin's detail page (click Plugins in the left sidebar, then dsh-image-gen under Installed), while 0.1.5 and earlier place it at Settings → Plugins → Plugin Configuration → Image Generation.

If it is missing in both places, fully restart the current DSH Profile, then inspect the plugin configuration:

dsh --profile web --dump-config

If dsh-image-gen is absent from the output, run the installation command again. When filing an issue, include the DSH version, plugin version, and relevant error logs, but never include your API key.

Up to 10 per batch call; beyond that, the plugin tells the Agent to split the request into several calls. Images generate one at a time, a single failure does not stop the others, and any failures are listed with their reasons.

When “Save to workspace” is enabled, chat results are saved to the dsh-image-gen/ subdirectory of the current workspace by default. You can change this directory in Settings. Studio candidates remain on the temporary canvas until you select which results should enter the gallery and be saved.

In Google Gemini settings, select “Native generateContent” under “Request protocol”, enter the relay's API base URL (for example, https://your-relay.example/v1beta), and save. This applies to conversation generation, editing, and Studio. An existing full Interactions URL can also be kept; the plugin builds the native endpoint using the selected model.

The configuration field is googleNative: true. It defaults to false, keeping existing users on the Interactions protocol.

Studio and multi-model comparison currently support cloud Providers only; ComfyUI is not yet integrated. ComfyUI supports text-to-image, image editing (with several reference images), batch generation, and multiple named workflows through Agent chat.

No. Deleting a gallery record does not modify the original chat message. You may separately choose to remove the corresponding local image file from the workspace. File deletion is normally irreversible, so confirm carefully.

If pnpm reports ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED, open the profile's pnpm-workspace.yaml at the path shown by DSH. Set the exact key printed by pnpm to true under allowBuilds, then rerun the GitHub install command. If a later commit triggers the error again, use the new key. The npm package is prebuilt and ready to install.

pnpm dsh plugin --profile web add dsh-image-gen@latest

Restart the corresponding DSH Profile after upgrading.


Local Development

git clone https://github.com/shanliuling/dsh-image-gen.git
cd dsh-image-gen

pnpm install
pnpm run typecheck
pnpm test
pnpm run build
pnpm run pack:check
pnpm run test:package

Maintainer notes on dependency requirements and the scope of test:package are in CONTRIBUTING.md. Feedback is welcome through Issues; read the contributing guide before opening a Pull Request.

Acknowledgements

  • AtomGit: Hosts a copy of the project for users in China to browse and download the source code.

License

This project is open source under the Apache License 2.0.

If dsh-image-gen improves your workflow, consider giving the project a ⭐ Star to support continued maintenance.

View Releases · Open an Issue · Contribute

Content from the project README on GitHub ↗

Links

More in this category

View the whole category →

Community comments

Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.