ant404/dsh-media-gen

DSH plugin: generate images and videos via OpenAI-compatible providers, with dedicated settings menu and workspace media_gen output.

Project Overview项目介绍

ant404/dsh-media-gen is a DSH-native plugin that adds image and video generation capabilities directly to DSH chat sessions. It works with any OpenAI-compatible media generation API endpoints, and it reuses the existing provider, model, and API key configurations already set up in DSH’s core model settings, so users do not have to re-enter credentials. The plugin adds a dedicated “Media Generation” menu to the DSH settings page, where users can configure separate providers and models for text-to-image, image-to-image editing, and text-to-video generation. It saves all generated media to a user-specified local directory and displays inline previews directly in the DSH chat session.

Installing the plugin is straightforward via the DSH CLI. The recommended method is to run dsh plugin --profile web add github:ant404/dsh-media-gen directly from the command line, and developers can also install it from a local directory for testing. After installation, you just need to restart or refresh DSH, then navigate to the Media Generation settings page to select your preferred providers and models for each generation type. To use the plugin, simply type a natural language request directly into your DSH chat session, for example asking to generate a 16:9 image of a mountain sunrise or turn an existing image into a watercolor style.

The plugin is released under the permissive MIT open-source license, with no cost for personal or commercial use. It includes multiple security safeguards to protect user credentials: API keys are never exposed to the DSH frontend browser, and all access to raw media files and configuration endpoints is restricted to localhost only. It automatically handles inconsistent video API endpoints across different providers by trying common paths and polling asynchronous generation tasks until they complete. Generated media links remain accessible in historical chat sessions even after restarting DSH, and the default output directory is media_gen in the current workspace.

这是一款专为 DeepSeek Harness (DSH) 开发的原生插件,用于在 DSH 会话中生成图片和视频。它全部通过 OpenAI 兼容接口(包含文生图、图生图/编辑、文生视频三类接口)工作,并且会复用 DSH 模型设置中已经配置好的服务商、模型和 API 密钥。插件在 DSH 设置页面新增了独立的「媒体生成」菜单,支持分别配置三类生成任务对应的服务商、模型,以及媒体输出目录。生成的图片和视频会保存到本地磁盘,同时在会话中返回内联预览或播放链接。

安装完成后只需重启或刷新 DSH,进入设置页的「媒体生成」菜单完成配置即可使用。用户在 DSH 会话中直接自然语言描述需求即可触发生成,比如要求生成指定比例的风景图、将本地图片转为特定风格、生成指定时长的短视频。插件提供了四个专用工具,分别用于列出可用服务商、文生图、图生图/图片编辑、异步视频生成。所有生成任务严格使用设置页配置的模型,不支持临时切换,方便 DSH 用户直接在会话中完成媒体生成需求。

本插件采用 MIT 许可开源,完全免费使用。安全层面做了不少限制:API 密钥不会暴露给浏览器,仅回传是否配置的布尔值,所有原始媒体和配置接口仅允许本地回环地址访问,避免信息泄露。插件兼容不同服务商的视频接口路径,会自动轮询异步生成的视频任务直到完成。输出目录默认是当前工作区下的 media_gen,支持相对和绝对路径,重启 DSH 后历史会话的媒体链接仍可访问。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add github:ant404/dsh-media-gen

把 ant404/dsh-media-gen 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-media-gen

在 DSH 会话中生成图片和视频的插件,全部走 OpenAI 兼容接口(/images/generations、/images/edits、/videos/generations 或 /videos),并复用 DSH 模型设置里已经配置好的 Provider / 模型 / API Key。

  • 设置页单独开一个「媒体生成」菜单,分别配置:
    • 文生图模型(text-to-image)
    • 图生图模型(image-to-image / edit)
    • 视频生成模型(video)
    • 输出目录(默认 media_gen,相对路径基于当前工作区;也支持绝对路径)
  • 生成的图片/视频保存到磁盘(默认 <当前工作区>\media_gen),同时在会话里返回内联预览/播放链接。
  • Provider 直接从 DSH 的 settings.yaml → llm-pi-ai.providers 读取,与聊天模型共用同一套 baseURL / apiKeyEnv;浏览器永远接触不到 API Key。

安装

# 推荐:从 GitHub 安装
dsh plugin --profile web add github:ant404/dsh-media-gen

# 或本地目录安装(开发时)
dsh plugin --profile web add "D:/sysdir/Documents/deepseek-harness-workspace/dsh-media-gen"

安装后重启/刷新 DSH,进入 设置 → 媒体生成,为三种生成分别选择 Provider 和 Model,然后保存。

使用

在会话中直接说:

生成一张 16:9 的雪山日出
把这张图变成水彩画风格:C:\path\to\input.png
生成一段 5 秒的赛博朋克城市夜景视频

插件提供的工具:

工具 说明
media_list_providers 列出 DSH 中可用的 OpenAI 兼容 Provider 及其模型
media_gen_image 文生图(/images/generations)
media_edit_image 图生图/图片编辑(/images/edits,传本地路径或 http(s) URL)
media_gen_video 视频生成(/videos 或 /videos/generations,自动轮询异步任务);结果在聊天中以内嵌 <video> 播放,带下载链接

所有媒体生成工具严格使用「设置 → 媒体生成」里配置的 Provider / Model,不支持在工具调用里临时换模型;要换模型请到设置菜单修改。

图片交互

  • 生成的图片在会话里以小图显示(最大约 280px)。
  • 左键点击图片:放大查看,点背景或按 Esc 关闭。
  • 右键点击图片:弹出「引用」菜单;点击后会把该图片的本地文件路径插入到对话输入框,方便接着做图生图/图生视频。

配置项(也可写在 cordis.yml / 设置菜单)

dsh-media-gen:
  # 输出目录已固定为 <当前工作区>/media_gen,该配置项不再生效
  outputDir: media_gen
  imageProvider: agnes-ai
  imageModel: agnes-image-2.1-flash
  imageEditProvider: agnes-ai
  imageEditModel: agnes-image-2.1-flash
  videoProvider: agnes-ai
  videoModel: agnes-video-v2.0
  videoEndpoint: ''             # 留空自动 /videos/generations → /videos
  timeoutMs: 120000
  videoTimeoutMs: 600000

Provider / Model 也可以直接在「设置 → 媒体生成」界面里选并保存,会写入 DSH settings,热生效。

视频接口兼容说明

OpenAI 官方与各家网关的视频接口并不完全统一。插件默认先请求 POST {base}/videos,404/405 再试 POST {base}/videos/generations;如果返回的是异步任务(id + status),会自动轮询 /videos/{id}、/videos/generations/{id},以及 Agnes 风格 agnesapi?video_id=,直到完成。结果 URL 支持 metadata.url 等嵌套字段;若你的网关使用其他路径,可在设置里填 videoEndpoint。

安全说明

  • /media-gen/raw/* 与配置接口都只允许 loopback(127.0.0.1/localhost)访问。
  • 不在浏览器中输出 API Key;只回传 hasKey 布尔值。
  • 原始文件保存在你配置的输出目录;插件会维护持久索引(~/.dsh/storages/dsh-media-gen-index.json),重启后历史会话里的图片/视频链接仍可访问。

License

MIT

← 上一个 Prev dsh-tree-view 下一个 Next dsh-knj-scheduler →