Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hunyuan

环境要求

  • Node.js 18+(推荐 Node.js 20+)

安装

npm install

运行

npm start

默认端口为 3000。你也可以这样修改端口:

PORT=8080 npm start

API

  • 接口:GET/POST /
  • 主参数:type=generations
  • 必填:prompt
  • 可选:
    • model
    • n
    • size
    • images(或 image,用于图生图流程)

兼容 OpenAI 的图片接口:

  • POST /v1/images/generations
    • JSON 请求体:prompt(必填),modelnsize(可选)
    {"prompt":"qwq"}
  • POST /v1/images/edits
    • JSON 请求体:prompt(必填)、image(必填,支持 URL 或 URL 数组)
    • image 示例:
      • "https://example.com/a.jpg"
      • [{ "url": "https://example.com/a.jpg" }]
      • [{ "Url": "https://example.com/a.jpg" }]
      {"prompt":"qwq","image":"https://qwq"}

这些接口返回 OpenAI 风格的数据结构:

  • created
  • data: [{ "url": "...", "revised_prompt": "..." }]
npm run build

运行打包后的文件:

npm run start:dist

说明:

  • 打包产物:dist/hunyuan-server.cjs
  • 请将 hunyuan_cookie.json 放在入口文件同目录,或通过以下方式指定:
    • COOKIE_FILE=/path/to/hunyuan_cookie.json
    • 文件内格式
    ["cookie"]
  • 启动日志会打印 API 地址和支持的参数信息。

About

No description, website, or topics provided.

Resources

Stars

8 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages