Skip to content

Releases: rayyugz/dsh-plugin-hunyuan-image

v1.0.0 — 腾讯混元生图 DSH 插件

Choose a tag to compare

@rayyugz rayyugz released this 10 Oct 11:27

Tencent Hunyuan Image Generation · DSH Plugin v1.0.0

English · 简体中文

Bring Tencent Hunyuan's Hy-Image-3.5-preview and Hy-Image-3.0 into DSH (DeepSeek Harness).
Zero native dependencies — works on macOS, Windows and Linux.


📦 Install (no build step required)

  1. Download dsh-plugin-hunyuan-image-1.0.0.tgz from the Assets section below.

  2. Extract it into a permanent folder:

    mkdir -p ~/dsh-plugins
    tar -xzf dsh-plugin-hunyuan-image-1.0.0.tgz -C ~/dsh-plugins
  3. In the DSH chat, tell the assistant:

    Please install ~/dsh-plugins/package as a DSH plugin (use plugin_manager with install_bundle).

  4. Restart DSH, then open Hunyuan Image → Settings and fill in your API Key and output folder.

Full walkthrough: INSTALL.md.


✅ What this version can do

1. Two generation models

Model Capabilities
hy-image-v3.5-preview Chat/Messages protocol; multimodal input, multi-turn editing, chain-of-thought rewriting; up to 4K (4096×4096)
hy-image-v3 Classic text-to-image; prompt rewriting; the official 37 preset sizes

2. Official two-step size picker

The same interaction as the Tencent TokenHub web console — resolution tier × aspect ratio:

  • v3.5 — resolution 1K / 1.5K / 2K / 4K × ratio 21:9 / 16:9 / 4:3 / 1:1 / 2:3 / 3:2 / 3:4 / 9:16
  • v3.0 — resolution 720P / 1K × ratio 1:1 / 3:4 / 4:3 / 9:16 / 16:9 / 3:5 / 5:3

The plugin converts your choice into the WxH the API expects, and guarantees it satisfies the
official constraints (v3.5: edges [256, 8192], area ≤ 16,777,216; v3.0: edges [512, 2048],
area ≤ 1,048,576). The UI shows the exact size that will be sent.

Example: 4K 16:9 = 5461x3072, matching the official documentation example.

3. Batch generation

Generate 1 / 2 / 4 images in one go (issued in parallel); results are shown one by one with a
1/4 index badge. Partial failures are reported explicitly ("generated 2, 1 failed").

4. Local gallery

  • Every successful generation is stored automatically (plain-JS JSON — no SQLite, no native module)
  • Thumbnail grid and list views
  • Keyword search (prompt + rewritten prompt) with filtering by model and time range
  • Detail drawer with the full prompt, model, size, timestamp and local path
  • 🔁 Generate again — refills the original prompt and parameters in one click
  • Multi-select batch delete (removes the local files too), copy prompt, copy image

5. Customisable output folder

  • Defaults to ~/Pictures/DSH-Hunyuan-Image; point it anywhere (a non-system drive is recommended)
  • "📂 Choose…" opens the native OS folder picker
  • Changes take effect immediately — no plugin restart
  • Files are bucketed by month under <folder>/<YYYY-MM>/, so one directory never accumulates thousands of files

6. Official advanced parameters

(Session-scoped on purpose, so no hard-to-find hidden state is left behind)

Parameter Applies to Description
Seed seed both Reproduce the same result
Watermark footnote footnote both ≤ 16 characters, bottom-right corner
External search augmentation use_search_tool v3.5 Let the model search the web before drawing
Reference-image area cap resize_max_pixels v3.5 Caps the token cost of large (4K/6K) references
Automatic prompt rewriting revise v3.0 Adds ~11 s; recommended on

7. Callable by the model

The plugin registers a hunyuan_generate_image tool, so saying "draw a cat" in a conversation
lets the model generate the image itself.

8. Reference images

Local upload (converted to a data URL) or public URLs.
v3.5 accepts up to 20 (≤ 20 MB each); v3.0 up to 3 (≤ 10 MB each).

9. Durable images

Tencent's remote URLs expire after 12 hours; the plugin downloads every image immediately on
success, so gallery entries never break.


⚠️ Not implemented yet

Feature Status Why
Localised panel UI ❌ The in-panel UI is currently Chinese-only; only the plugin title and description are localised (EN/ZH). These translated READMEs are a stopgap
Auto "open gallery" button when you mention the gallery ❌ Requires listening to session message events and injecting an action button
Export / Save-as dialog ⚠️ stub DSH does not expose a "save as" dialog to plugins yet
WeChat / Feishu sharing ⚠️ stub DSH does not expose an IM sharing channel to plugins yet
Drag an image into the conversation ❌ Depends on DSH exposing drag events
Multi-turn editing UI ❌ Data layer is ready (assembled_history is stored); only the UI is missing

🔧 Technical notes

  • DSH Cordis two-entry architecture
    • dist/server.js — Host half (Node.js), registers the tool and HTTP endpoints
    • dist/client.js — Client half (browser), loaded in window.__ModuleLoader__.load() format
  • Client-side JSX is compiled to React.createElement (the DSH module table provides React but not jsx-runtime)
  • Client ↔ host over /hunyuan/api/* JSON-RPC; images served back through /hunyuan/file
    (restricted to the configured output folder, preventing path traversal)
  • Zero native dependencies — the gallery is a JSON file rather than SQLite, so it loads under
    the macOS code-signing / hardened-runtime restrictions of the DSH app, and needs no rebuild on
    Windows or Linux

📄 License

MIT



腾讯混元生图 · DSH 插件 v1.0.0

English · 简体中文

把腾讯混元的 Hy-Image-3.5-preview 与 Hy-Image-3.0 接入 DSH(DeepSeek Harness)。
零原生依赖,macOS / Windows / Linux 通用。


📦 安装(不需要编译)

  1. 从下方 Assets 下载 dsh-plugin-hunyuan-image-1.0.0.tgz

  2. 解压到固定目录:

    mkdir -p ~/dsh-plugins
    tar -xzf dsh-plugin-hunyuan-image-1.0.0.tgz -C ~/dsh-plugins
  3. 在 DSH 对话框里对 AI 说:

    请把 ~/dsh-plugins/package 安装为 DSH 插件(用 plugin_manager 的 install_bundle)

  4. 重启 DSH,然后在「混元生图 → 设置」里填 API Key 与图片保存路径

完整步骤见 INSTALL.zh-CN.md。


✅ 这一版能做什么

1. 双模型生图

模型 能力
hy-image-v3.5-preview Chat/Messages 协议;多模态输入、多轮编辑、思维链改写;最高 4K(4096×4096)
hy-image-v3 经典文生图;提示词自动改写;官方 37 组预设尺寸

2. 官方两段式尺寸选择

与腾讯 TokenHub 网页端一致的交互——分辨率档位 × 比例:

  • v3.5 — 分辨率 1K / 1.5K / 2K / 4K × 比例 21:9 / 16:9 / 4:3 / 1:1 / 2:3 / 3:2 / 3:4 / 9:16
  • v3.0 — 分辨率 720P / 1K × 比例 1:1 / 3:4 / 4:3 / 9:16 / 16:9 / 3:5 / 5:3

插件自动换算为 API 需要的 WxH,并保证落在官方约束内
(v3.5 边长 [256, 8192]、面积 ≤ 16777216;v3.0 边长 [512, 2048]、面积 ≤ 1048576)。
界面会实时显示「实际下发尺寸」。

例:4K 16:9 = 5461x3072(与官方文档举例一致)

3. 批量生图

一次生成 1 / 2 / 4 张(并行发起),结果逐张展示并带 1/4 序号角标。
部分失败会明确提示(如「已生成 2 张,另有 1 张失败」)。

4. 本地图库

  • 生图成功自动入库(纯 JS 的 JSON 存储,无 SQLite、无原生模块)
  • 缩略图网格 / 列表两种视图
  • 关键词搜索(匹配提示词与改写后提示词)+ 按模型、时间范围筛选
  • 详情侧栏:大图 + 提示词 + 模型 + 尺寸 + 时间 + 本地路径
  • 🔁 再次生图:一键回填原提示词与参数
  • 多选批量删除(同步清理本地文件)、复制提示词、复制图片

5. 自定义图片保存路径

  • 默认 ~/Pictures/DSH-Hunyuan-Image,可改为任意位置(建议非系统盘)
  • 点「📂 选择...」调用系统原生目录选择框
  • 改完立即生效,无需重启插件
  • 按 <保存路径>/<年-月>/ 月份分桶归档,避免单目录堆积

6. 官方高级参数

(本次会话内有效,刻意不做持久化,避免留下难排查的隐藏状态)

参数 适用 说明
生成种子 seed 两者 复现同一结果
水印脚注 footnote 两者 ≤16 字符,生成在图片右下角
外部搜索增强 use_search_tool v3.5 让模型联网检索后再生图
参考图面积上限 resize_max_pixels v3.5 控制大图(4K/6K)带来的 token 消耗
提示词自动改写 revise v3.0 约多耗 11 秒,官方建议开启

7. 模型可直调

插件向 DSH 注册了 hunyuan_generate_image 工具,
你在对话里说「画一只猫」时,模型可以自己调用它生图。

8. 参考图输入

支持本地上传(自动转 data URL)与公网 URL。
v3.5 最多 20 张(单张 ≤20MB),v3.0 最多 3 张(单张 ≤10MB)。

9. 图片永久保存

腾讯返回的远程 URL 仅 12 小时有效,插件会在生成成功时立刻下载到本地,
图库里的图片不会失效。


⚠️ 尚未实现

功能 状态 原因
面板界面多语言 ❌ 面板内界面目前只有中文;插件的标题/描述已本地化(中/英),但面板里的控件文字尚未国际化。本仓库的多语言 README 只是过渡方案
对话中提到「图库」自动弹按钮 ❌ 需监听会话消息事件并注入 Action Button
导出 / 另存为对话框 ⚠️ 占位 DSH 尚未向插件暴露「另存为」对话框
微信 / 飞书分享 ⚠️ 占位 DSH 尚未向插件暴露 IM 分享通道
拖拽图片到对话 ❌ 依赖 DSH 暴露拖拽事件
多轮编辑界面 ❌ 数据层已就绪(已保存 assembled_history),缺 UI

🔧 技术要点

  • DSH Cordis 双 entry 架构
    • dist/server.js —— Host 半(Node.js),注册工具与 HTTP 端点
    • dist/client.js —— Client 半(浏览器),以 window.__ModuleLoader__.load() 格式加载
  • 客户端 JSX 编译为 React.createElement(DSH 模块表只提供 React,不提供 jsx-runtime)
  • 前后端通过 /hunyuan/api/* JSON-RPC 通信;图片经 /hunyuan/file 回送
    (仅允许读取当前保存目录内的文件,防路径穿越)
  • 零原生依赖——图库用 JSON 文件而非 SQLite,因此在 macOS 代码签名 / 强化运行时下也能加载,
    Windows / Linux 无需重新编译

📄 许可

MIT