AI prompts
base on One UI is all done with chatgpt web, midjourney, gpts,suno,luma,runway,viggle,flux,ideogram,realtime,pika,udio; Simultaneous support Web / PWA / Linux / Win / MacOS platform # ChatGPT Web Midjourney Proxy
[English](./README_EN.md) | [Русский язык](./README_RU.md) | [Français](./README_FR.md) | [한국어](./README_KR.md) | [Tiếng Việt](./README_VN.md) | [Türkçe](./README_TR.md)
## 声明
- 此项目只发布于 GitHub,基于 MIT 协议,免费且作为开源学习使用。并且不会有任何形式的卖号、付费服务、讨论群、讨论组等行为。谨防受骗。
- 本开源是在 [ChenZhaoYu](https://github.com/Chanzhaoyu/chatgpt-web) 基础上做二次开发 ;使用 [midjourney-proxy](https://github.com/novicezk/midjourney-proxy) 、 Suno-API、[Luma-API](https://github.com/LumaAI-API/Luma-API) 作为后端API而形成的;
- 可以直接用 https://vercel.ddaiai.com 先体验
![cover](./docs/mj2a1.jpg)
## 支持功能
- [x] 支持 udio 文生音乐
- [x] 支持 pika 文生视频,图生视频
- [x] 支持 openai realtime [点击观看.youtube](https://www.youtube.com/watch?v=pKvVi3oBRQU) [B站](https://www.bilibili.com/video/BV1Kt22YPE2c/)
- [x] 支持 kling 可灵 文生视频,图生视频, 绘图
- [x] 支持 ideogram 绘图
- [x] 支持 runway 文生视频,图生视频
- [x] 支持 luma 文生视频,图生视频
- [x] 支持 viggle 舞蹈
- [x] 支持 suno 单独模块,可歌词调整 曲风调整
- [x] 支持 suno 以音频生成音频
- [x] 支持 flux dall.e 文生图
- [x] 原chatgpt web 所有功能
- [x] chatgpt web 支持自定义api key、base_url
- [x] midjourney 文生图、垫图+文生图 、图变 U1到U4 、 V1到V4、重绘等操作
- [X] midjourney 支持局部重绘、支持1.5倍变焦 2倍变焦、2倍高清 4倍高清
- [X] midjourney 支持左、右、上、下延伸变化
- [X] midjourney 同时支持[midjourney-proxy](https://github.com/novicezk/midjourney-proxy) 接口 和 [midjourney-proxy-plus](https://github.com/litter-coder/midjourney-proxy-plus) 接口
- [X] midjourney 图生文
- [X] 图片使用localforage实现本地存储
- [X] 支持midjourney、niji 不同机器人
- [X] 支持[InsightFace 人脸替换](https://discord.com/api/oauth2/authorize?client_id=1090660574196674713&permissions=274877945856&scope=bot)
- [X] midjourney 混图、获取 seed
- [X] chatgpt 前端支持自定义模型、上下文对话数、回复数
- [X] chatgpt 支持图片上传图片 供gpt-4-vision-preview使用、gpts
- [X] chatgpt 支持超链模型切换 https://vercel.ddaiai.com/#/m/gpt-4-all https://vercel.ddaiai.com/#/m/gpt-4-gizmo-g-2fkFE8rbu
- [X] 支持ChatGPT试的超链模型切换 https://chat.openai.com/g/g-2fkFE8rbu 修改为 https://vercel.ddaiai.com/#/g/g-2fkFE8rbu
- [X] chatgpt 支持 GPTs 多模态
- [X] chatgpt 支持 tts whisper dall-e-3 画图
- [X] 即时语音识别(浏览器自带语音识别 ASR) `v2.15.7`以上版本
- [X] 支持超链更换设置,适合`one-api` `new-api`部署聊天(<b color="red">为了安全,此方式请使用自己域名</b>) https://mj.your-name.com/#/s/t?OPENAI_API_BASE_URL=https://abc.com&OPENAI_API_KEY=sk-xxxxx&MJ_SERVER=https://abc.com&MJ_API_SECRET=sk-xxx&UPLOADER_URL=
- [X] 支持`one-api`、`new-api`部署聊天 (<b color="red">为了安全,此方式请使用自己域名</b>) https://mj.your-name.com/#/?settings={%22key%22:%22sk-abc%22,%22url%22:%22https://www.abc.com%22} `(v.2.14.3)`
## 无服务器-个人桌面安装
> - [x] 请到 https://github.com/Dooy/chatgpt-web-midjourney-proxy/releases 下载最新版本安装(选择合适你操作系统的版本)
> - [x] 选择一个合适的中转服务商( 最好都支持 `gpt` `gpts` `midjourney` `claude` `suno` `luma` `runway` `viggle` `flux` `ideogram` `kling` `pika`)
> - [x] 中转服务商推荐 https://www.openai-hk.com 一个`key`和`api接口地址` 同时支持 [gpt](https://www.openai-hk.com/docs/getting-started.html) [gpts](https://www.openai-hk.com/docs/openai/gpts.html) [midjourney](https://www.openai-hk.com/docs/midjourney/guide.html) [claude](https://www.openai-hk.com/docs/lab/claude-3.html) [suno](https://www.openai-hk.com/docs/lab/suno-v3.html) [luma](https://www.openai-hk.com/docs/lab/luma-video.html) [runway](https://www.openai-hk.com/docs/lab/runway-video.html) [viggle](https://www.openai-hk.com/docs/lab/viggle-dance.html) [ideogram](https://www.openai-hk.com/docs/lab/ideogram.html) [flux](https://www.openai-hk.com/docs/lab/flux.html) [kling](https://www.openai-hk.com/docs/lab/kling.html) [pika](https://www.openai-hk.com/docs/lab/pika-video.html) [udio](https://www.openai-hk.com/docs/lab/udio-music.html),mj-fast最低能到0.12rmb/张,`suno` 最低能到4分一首
![多模态](./docs/suno-ds.jpg)
## Vercel 一键部署
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/Dooy/chatgpt-web-midjourney-proxy&env=OPENAI_API_BASE_URL&env=OPENAI_API_KEY&env=MJ_SERVER&env=MJ_API_SECRET&project-name=chatgpt-web-midjourney-proxy&repository-name=chatgpt-web-midjourney-proxy)
## env 环境变量
| 环境变量 | 说明 | 默认值 |docker等部署| vercel 部署|
| --- | --- | --- | --- | --- |
| OPENAI_API_BASE_URL | OpenAI API 接口地址 | https://api.openai.com | ✅ | ✅|
| OPENAI_API_KEY | OpenAI API 密钥 | sk-xxxxx | ✅ | ✅|
| OPENAI_API_MODEL | 默认模型 | gpt-3.5-turbo | ✅ | ✅|
| MJ_SERVER | mj proxy 接口地址 |[搭建参考](https://github.com/novicezk/midjourney-proxy) | ✅ | ✅|
| MJ_API_SECRET | mj proxy | 空 | ✅ | ✅|
| SUNO_SERVER | SUNO API 接口地址 | [搭建参考](https://github.com/SunoAI-API/Suno-API) | ✅ | ✅|
| SUNO_KEY | SUNO API 的key | 空 | ✅ | ✅|
| AUTH_SECRET_KEY | 访问授权密码 | 无 | ✅ | x|
| API_UPLOADER | 支持上传 | 关闭 | ✅ | x|
| HIDE_SERVER | 前端ui隐藏服务端| | ✅ | x|
| CUSTOM_MODELS | 自定义可选模型 `CUSTOM_MODELS=-all,gpt-3.5` | 无 | ✅ | ✅|
| TJ_BAIDU_ID | 百度统计ID | 无 | ✅ | ✅|
| TJ_GOOGLE_ID | 谷歌统计ID | 无 | ✅ | ✅|
| SYS_NOTIFY | 系统通知,支持HTML | 无 | ✅ | ✅|
| DISABLE_GPT4 | 禁用GPT-4 | 无 | ✅ | ✅|
| GPT_URL | 自定 GPT_URL=/gpts.json | 无 也可自己的外链 | ✅ | ✅|
| UPLOAD_IMG_SIZE | 上传图片大小限制 默认1M | 1 | ✅ | ✅|
| SYS_THEME | 默认主题 `light`或者`dark` | dark | ✅ | ✅|
| MJ_IMG_WSRV | 是否开启 `wsrv`图床 | 无(关闭) | ✅ | ✅|
| AUTH_SECRET_ERROR_COUNT | 防爆破验证:验证次数触发 NGINX 请设置 `proxy_set_header X-Forwarded-For $remote_addr` | 无 | ✅ | x|
| AUTH_SECRET_ERROR_TIME | 防爆破验证:停留时间 单位分钟 | 无 | ✅ | x|
| CLOSE_MD_PREVIEW | 是否不关闭输入预览 | 无 | ✅ | ✅|
| UPLOAD_TYPE | 指定上传方式 [`R2` R2上传] [`API` 跟随UI前端中转]、[`Container` 本地容器]、[`MyUrl` 自定义链接] | 空 | ✅ | x|
| MENU_DISABLE | 菜单禁用 可选:gpts,draws,gallery,music,video,dance,realtime | 空 | ✅ | ✅|
| VISION_MODEL | 默认使用的识图 可选:`gpt-4o`,`gpt-4-turb`,`gpt-4-vision-preview`等 | 空 | ✅ | ✅|
| SYSTEM_MESSAGE | 自定义默认角色消息 | 空 | ✅ | ✅|
| CUSTOM_VISION_MODELS | 自定义可视图模型 用`,` 分开 | 空 | ✅ | ✅|
| LUMA_SERVER | LUMA API 接口地址 | [搭建参考](https://github.com/LumaAI-API/Luma-API) | ✅ | ✅|
| LUMA_KEY | LUMA API 的key | 空 | ✅ | ✅|
## docker 部署
> - [x] 需 [midjourney-proxy](https://github.com/novicezk/midjourney-proxy) 或者[trueai](https://github.com/trueai-org/midjourney-proxy) 支持
> - [x] 需 Suno-API 支持
> - [x] 需 [Luma-API](https://github.com/LumaAI-API/Luma-API) 支持
```bash
docker run --name chatgpt-web-midjourney-proxy -d -p 6015:3002 \
-e OPENAI_API_KEY=sk-xxxxx \
-e OPENAI_API_BASE_URL=https://api.openai.com \
-e MJ_SERVER=https://your-mj-server:6013 \
-e MJ_API_SECRET=your-mj-api-secret \
-e LUMA_SERVER=https://your-luma-server:8000 \
-e LUMA_KEY=your-luma-key \
-e SUNO_SERVER=https://your-suno-server:8000 \
-e SUNO_KEY=you-suno-key ydlhero/chatgpt-web-midjourney-proxy
```
访问 http://ip:6015
**文件上传**:
```bash
docker run --name chatgpt-web-midjourney-proxy -d -p 6015:3002 \
-e OPENAI_API_KEY=sk-xxxxx \
-e OPENAI_API_BASE_URL=https://api.openai.com \
-e MJ_SERVER=https://172.17.0.1:6013 \
-e API_UPLOADER=1 -v /data/uploads:/app/uploads \
-e MJ_API_SECRET=abc123456 ydlhero/chatgpt-web-midjourney-proxy
```
如果是前端ui设置 OPENAI_API_KEY OPENAI_API_BASE_URL ; 图片上传也会随着走 OPENAI_API_BASE_URL走
```shell
curl -X POST -H "Content-Type: multipart/form-data" -F "file=@/path/to/file" http://OPENAI_API_BASE_URL/v1/upload
```
返回格式
```json
{
"url":"https://xxxxxxx.jpg"
}
```
### midjourney-proxy API docker部署
更多参考到 [midjourney-proxy](https://github.com/novicezk/midjourney-proxy) 开源光光
```bash
docker run -d --name mj6013 -p 6013:8080 \
-e mj.discord.guild-id=discord服务ID \
-e mj.discord.channel-id=discord服务组ID \
-e mj.queue.timeout-minutes=6 \
-e mj.api-secret=abc123456 \
-e mj.discord.user-token=********** \
--restart=always novicezk/midjourney-proxy:2.5.5
```
## 更多展示
### Realtime
[点击观看Realtime视频](https://www.youtube.com/watch?v=pKvVi3oBRQU)
<div style="display: flex; flex-wrap: wrap">
<img src="./docs/realtime-2.jpg" style="width:200px" >
</div>
### suno、udio 音乐AI制作
![suno](./docs/suno2.jpg)
### luma runway pika kling 视频AI制作
![suno](./docs/luma-video.jpg)
### 自定义服务端api key、base_url:
![base_url](./docs/gptbase.jpg)
### GPTS GTP Store
![多模态](./docs/gpts.jpg)
![多模态](./docs/gpts1.jpg)
### 录音 whisper 和 tts
![whisper--tts](./docs/tts-whisper.png)
### 局部重绘:
[![局部重绘](./docs/mj2.jpg)](./docs/mj2.jpg)
### 换脸
![换脸](./docs/mj2a2.jpg)
### 混图
![混图](./docs/mj2a3.jpg)
### 支持图片上传图片 供gpt-4-vision-preview使用
![混图](./docs/mj4a1.png)
手机端:
<div style="display: flex; flex-wrap: wrap">
<img src="./docs/mjs1.jpg" style="width:200px" >
<img src="./docs/mjs2.jpg" style="width:200px">
<img src="./docs/mjs3.jpg" style="width:200px">
</div>
## 文件上传 支持cloudflare r2 存储
- cloudflare r2 存储 10 GB/月 免费 https://www.cloudflare.com/zh-cn/developer-platform/r2/
- 配置文档参考 https://zhuanlan.zhihu.com/p/658058503
- vercel 不支持 r2 存储
```yml
R2_DOMAIN=
R2_BUCKET_NAME=
R2_ACCOUNT_ID=
R2_KEY_ID=
R2_KEY_SECRET=
```
## 文件服务器请求优先顺序
R2> 前端UI设置文件服务> 后端文件服务 >跟随中转
## 防爆破验证设置
![防爆破](./docs/check_error.jpg)
- [x] vercel 不支持;仅支持Docker化部署
- [x] 如果前面挂载 `nginx` 请配置 `proxy_set_header X-Forwarded-For $remote_addr;`
- [x] 参数如下: 错误验证3次,只能在10分钟后再验证
```yml
# Secret key 注意: 只能拿事英文+数字
AUTH_SECRET_KEY=my888god
#爆破:验证次数 注意: 数字 ;nginx 请设置 proxy_set_header X-Forwarded-For $remote_addr;
AUTH_SECRET_ERROR_COUNT=3
#爆破:验证停留时间 单位分钟 注意: 是数字
AUTH_SECRET_ERROR_TIME=10
```
- [x] 脚本如下
```shell
docker run --name chatgpt-web-midjourney-proxy -d -p 6015:3002 \
-e OPENAI_API_KEY=sk-xxxxx \
-e OPENAI_API_BASE_URL=https://api.openai.com \
-e MJ_SERVER=https://172.17.0.1:6013 \
-e MJ_API_SECRET=abc123456 \
-e API_UPLOADER=1 -v /data/uploads:/app/uploads \
-e AUTH_SECRET_KEY=你的英文密码 -e AUTH_SECRET_ERROR_COUNT=3 \
-e AUTH_SECRET_ERROR_TIME=10 ydlhero/chatgpt-web-midjourney-proxy
```
-
## License
MIT © [Dooy](./license)
## 其他
如果觉得这个项目对您有所帮助,请帮忙点个star 或者捐助我们
[![Star History Chart](https://api.star-history.com/svg?repos=Dooy/chatgpt-web-midjourney-proxy&type=Date)](https://star-history.com/#Dooy/chatgpt-web-midjourney-proxy&Date)
## 捐助
如果我的开源项目对你有帮助,请考虑通过以下任意一种方式赞助:
<br> `付款备注上您的联系方式`
<div style="display: flex; flex-wrap: wrap">
<div style="width:200px">
<img src="./docs/wxpay.jpg" style="width:200px">
<div>微信捐助</div>
</div>
<div style="width:200px">
<img src="./docs/alipay.jpg" style="width:200px">
<div>支付宝捐助</div>
</div>
</div>", Assign "at most 3 tags" to the expected json: {"id":"7036","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"