Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Dooy committed Jun 4, 2024
1 parent 6506bac commit b3e3b8c
Show file tree
Hide file tree
Showing 2 changed files with 360 additions and 128 deletions.
260 changes: 132 additions & 128 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,91 +1,94 @@

# ChatGPT Web Midjourney Proxy

[中文](./README_ZH.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)
[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) 提供的midjourney api和 [Suno-API](https://github.com/SunoAI-API/Suno-API) 作为后端而形成的;

## Disclaimer
- This project is only released on GitHub under the MIT license, free and open-source for learning purposes. There will be no form of account selling, paid services, discussion groups, etc. Beware of scams.
- This open-source project is developed based on [ChenZhaoYu](https://github.com/Chanzhaoyu/chatgpt-web); it uses the midjourney API provided by [midjourney-proxy](https://github.com/novicezk/midjourney-proxy) and [Suno-API](https://github.com/SunoAI-API/Suno-API) as the backend.

![cover](./docs/mj2a1.jpg)
## Supported Features
- [x] Support for the standalone Suno module, with adjustable lyrics and music style
- [x] All original ChatGPT web features
- [x] ChatGPT web supports custom API keys and base_url
- [x] Midjourney text-to-image
- [x] Midjourney blend image + text-to-image
- [X] Midjourney image variations U1 to U4, V1 to V4, and redrawing
- [X] Midjourney partial redrawing
- [X] Midjourney 1.5x and 2x zoom
- [X] Midjourney 2x and 4x HD
- [X] Midjourney extensions to the left, right, top, and bottom
- [X] Midjourney supports both [midjourney-proxy](https://github.com/novicezk/midjourney-proxy) and [midjourney-proxy-plus](https://github.com/litter-coder/midjourney-proxy-plus)
- [X] Midjourney text from images
- [X] Local image storage using localforage
- [X] Support for different bots like midjourney and niji
- [X] Support for [InsightFace face replacement](https://discord.com/api/oauth2/authorize?client_id=1090660574196674713&permissions=274877945856&scope=bot)
- [X] Midjourney image blending
- [X] Midjourney get seed
- [X] DALL-E-3 image generation
- [X] ChatGPT front-end model selection
- [X] ChatGPT front-end supports custom models, context number, and reply count
- [X] ChatGPT supports image uploads for GPT-4-Vision-Preview
- [X] ChatGPT supports file backend uploads (for models like GPT-4-All, GPT-4-Gizmo-xxx) by default off, can be enabled with environment variable API_UPLOADER=1
- [X] ChatGPT supports reverse models like GPT-4-All, GPT-4-V, GPT-4-Gizmo-(gizmo_id)
- [X] ChatGPT supports hyperlink model switching https://vercel.ddaiai.com/#/m/gpt-4-all https://vercel.ddaiai.com/#/m/gpt-4-gizmo-g-2fkFE8rbu
- [X] ChatGPT supports ChatGPT-style hyperlink model switching https://chat.openai.com/g/g-2fkFE8rbu modified to https://vercel.ddaiai.com/#/g/g-2fkFE8rbu
- [X] ChatGPT supports GPTs multimodal
- [X] ChatGPT supports TTS whisper
- [X] Instant voice recognition (browser's built-in ASR) `v2.15.7` and above
- [X] Support hyperlink change settings, suitable for `one-api` and `new-api` deployments https://vercel.ddaiai.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] Support `one-api` and `new-api` deployments https://vercel.ddaiai.com/#/?settings={%22key%22:%22sk-abc%22,%22url%22:%22https://www.abc.com%22} `(v.2.14.3)`

## Serverless - Personal Desktop Installation
> - [x] Please download the latest version from https://github.com/Dooy/chatgpt-web-midjourney-proxy/releases (choose the version suitable for your operating system)
> - [x] Choose an appropriate proxy service (preferably one that supports `gpt`, `gpts`, `midjourney`, `claude`, `suno`)
> - [x] Recommended proxy service https://www.openai-hk.com a `key` and `api interface address` support `gpt`, `midjourney`, `claude`, `suno` simultaneously, mj-fast as low as 0.12 RMB/image
![multimodal](./docs/suno-ds.jpg)

## Vercel One-Click Deployment
## 支持功能
- [x] 支持 suno 单独模块,可歌词调整 曲风调整
- [x] 原chatgpt web 所有功能
- [x] chatgpt web 支持自定义api key、base_url
- [x] midjourney 文生图
- [x] midjourney 垫图+文生图
- [X] midjourney 图变 U1到U4 、 V1到V4、重绘等操作
- [X] midjourney 支持局部重绘
- [X] midjourney 支持1.5倍变焦 2倍变焦
- [X] midjourney 支持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 混图
- [X] midjourney 获取 seed
- [X] dall-e-3 画图
- [X] chatgpt 前端选择模型
- [X] chatgpt 前端支持自定义模型、上下文对话数、回复数
- [X] chatgpt 支持图片上传图片 供gpt-4-vision-preview使用
- [X] chatgpt 支持文件后端上传(供给gpt-4-all gpt-4-gizmo-xxx 模型)! 默认是关闭的 打开需要环境变量 API_UPLOADER=1
- [X] chatgpt 支持逆向模型 gpt-4-all gpt-4-v gpt-4-gizmo-(gizmo_id)
- [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
- [X] 即时语音识别(浏览器自带语音识别 ASR) `v2.15.7`以上版本
- [X] 支持超链更换设置,适合`one-api` `new-api`部署聊天 https://vercel.ddaiai.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`部署聊天 https://vercel.ddaiai.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` )
> - [x] 中转服务商推荐 https://www.openai-hk.com 一个`key``api接口地址` 同时支持 `gpt` `midjourney` `claude` `suno`mj-fast最低能到0.12rmb/张
![多模态](./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 Environment Variables
## env 环境变量

| Environment Variable | Description | Default Value | Docker Deployment | Vercel Deployment |
| 环境变量 | 说明 | 默认值 |docker等部署| vercel 部署|
| --- | --- | --- | --- | --- |
| OPENAI_API_BASE_URL | OpenAI API interface address | https://api.openai.com |||
| OPENAI_API_KEY | OpenAI API key | sk-xxxxx |||
| OPENAI_API_MODEL | Default model | gpt-3.5-turbo |||
| MJ_SERVER | MJ proxy interface address | [Reference for setup](https://github.com/novicezk/midjourney-proxy) |||
| MJ_API_SECRET | MJ proxy secret | Empty |||
| SUNO_SERVER | SUNO API interface address | [Reference for setup](https://github.com/SunoAI-API/Suno-API) |||
| SUNO_KEY | SUNO API key | Empty |||
| AUTH_SECRET_KEY | Access authorization password | None || x|
| API_UPLOADER | Support upload | Disabled || x|
| HIDE_SERVER | Hide server UI on the front end | || x|
| CUSTOM_MODELS | Custom selectable models | None |||
| TJ_BAIDU_ID | Baidu Analytics ID | None |||
| TJ_GOOGLE_ID | Google Analytics ID | None |||
| SYS_NOTIFY | System notifications, supports HTML | None |||
| DISABLE_GPT4 | Disable GPT-4 | None |||
| GPT_URL | Custom GPT_URL=/gpts.json | None or your external link |||
| UPLOAD_IMG_SIZE | GPT4V upload image size | 1 |||
| SYS_THEME | Default theme `light` or `dark` | dark |||
| MJ_IMG_WSRV | Enable `wsrv` image bed | None (disabled) |||
| AUTH_SECRET_ERROR_COUNT | Brute force prevention: Number of verification attempts NGINX please set `proxy_set_header X-Forwarded-For $remote_addr` | None || x|
| AUTH_SECRET_ERROR_TIME | Brute force prevention: Wait time in minutes | None || x|
| CLOSE_MD_PREVIEW | Do not close input preview | None |||
| UPLOAD_TYPE | Specify upload method [`R2` R2 upload] [`API` Follow UI front-end relay] [`Container` Local container] [`MyUrl` Custom link] | Empty || x|
| MENU_DISABLE | Disable menu options: gpts, draws, gallery, music | Empty |||
| VISION_MODEL | Default recognition model Options: `gpt-4o`, `gpt-4-turb`, `gpt-4-vision-preview`, etc. | Empty |||
| SYSTEM_MESSAGE | Custom default role message | Empty |||
| CUSTOM_VISION_MODELS | Custom vision models separated by `,` | Empty |||

## Docker Deployment
| 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 | 自定义可选模型 ||||
| TJ_BAIDU_ID | 百度统计ID ||||
| TJ_GOOGLE_ID | 谷歌统计ID ||||
| SYS_NOTIFY | 系统通知,支持HTML ||||
| DISABLE_GPT4 | 禁用GPT-4 ||||
| GPT_URL | 自定 GPT_URL=/gpts.json | 无 也可自己的外链 |||
| UPLOAD_IMG_SIZE | gpt4v 上传图片大小 | 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 ||||
| VISION_MODEL | 默认使用的识图 可选:`gpt-4o`,`gpt-4-turb`,`gpt-4-vision-preview`||||
| SYSTEM_MESSAGE | 自定义默认角色消息 ||||
| CUSTOM_VISION_MODELS | 自定义可视图模型 用`,` 分开 ||||



## docker 部署

> - [x] Requires [midjourney-proxy](https://github.com/novicezk/midjourney-proxy) support
> - [x] Requires [Suno-API](https://github.com/SunoAI-API/Suno-API) support
> - [x][midjourney-proxy](https://github.com/novicezk/midjourney-proxy) 支持
> - [x][Suno-API](https://github.com/SunoAI-API/Suno-API) 支持

```bash
docker run --name chatgpt-web-midjourney-proxy -d -p 6015:3002 \
Expand All @@ -94,13 +97,11 @@ docker run --name chatgpt-web-midjourney-proxy -d -p 6015:3002 \
-e MJ_SERVER=https://your-mj-server:6013 \
-e MJ_API_SECRET=your-mj-api-secret \
-e SUNO_SERVER=https://your-suno-server:8000 \
-e SUNO_KEY=you-suno-key ydlhero/chatg

pt-web-midjourney-proxy
-e SUNO_KEY=you-suno-key ydlhero/chatgpt-web-midjourney-proxy
```
Access http://ip:6015
访问 http://ip:6015

**File Upload**:
**文件上传**:
```bash
docker run --name chatgpt-web-midjourney-proxy -d -p 6015:3002 \
-e OPENAI_API_KEY=sk-xxxxx \
Expand All @@ -109,120 +110,123 @@ docker run --name chatgpt-web-midjourney-proxy -d -p 6015:3002 \
-e API_UPLOADER=1 -v /data/uploads:/app/uploads \
-e MJ_API_SECRET=abc123456 ydlhero/chatgpt-web-midjourney-proxy
```
If the front-end UI sets OPENAI_API_KEY and OPENAI_API_BASE_URL, the image upload will also follow the OPENAI_API_BASE_URL.
如果是前端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
```
Return format
返回格式
```json
{
"url":"https://xxxxxxx.jpg"
}
```

### Midjourney-proxy API Docker Deployment
For more references, go to [midjourney-proxy](https://github.com/novicezk/midjourney-proxy) open-source project.
### 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 Server ID \
-e mj.discord.channel-id=Discord Server Group ID \
-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
```

## More Demonstrations

### Custom Server API Key, Base_URL:
## 更多展示

### 自定义服务端api key、base_url:
![base_url](./docs/gptbase.jpg)

### GPTS GTP Store
![multimodal](./docs/gpts.jpg)
![multimodal](./docs/gpts1.jpg)
![多模态](./docs/gpts.jpg)
![多模态](./docs/gpts1.jpg)

### Suno Music Creation
### suno 音乐制作
![suno](./docs/suno.jpg)

### Recording Whisper and TTS

### 录音 whisper 和 tts
![whisper--tts](./docs/tts-whisper.png)

### Partial Redraw:
[![Partial Redraw](./docs/mj2.jpg)](./docs/mj2.jpg)
### 局部重绘:
[![局部重绘](./docs/mj2.jpg)](./docs/mj2.jpg)

### Face Replacement
![Face Replacement](./docs/mj2a2.jpg)
### 换脸
![换脸](./docs/mj2a2.jpg)

### Image Blending
![Image Blending](./docs/mj2a3.jpg)
### 混图
![混图](./docs/mj2a3.jpg)

### Support for Image Upload for GPT-4-Vision-Preview
![Image Blending](./docs/mj4a1.png)
Mobile:
### 支持图片上传图片 供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>

## File Upload Support for Cloudflare R2 Storage

- Cloudflare R2 storage 10 GB/month free https://www.cloudflare.com/zh-cn/developer-platform/r2/
- Configuration reference https://zhuanlan.zhihu.com/p/658058503
- Vercel does not support R2 storage
## 文件上传 支持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=
```
## File Server Request Priority
R2 > Front-end UI set file service > Backend file service > Follow proxy
## Brute Force Prevention Settings

![Brute Force Prevention](./docs/check_error.jpg)
- [x] Vercel is not supported; only Docker deployment is supported
- [x] If NGINX is mounted in front, configure `proxy_set_header X-Forwarded-For $remote_addr;`
- [x] Parameters: 3 failed verification attempts, can only reattempt after 10 minutes
## 文件服务器请求优先顺序
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 Note: Only alphanumeric characters
# Secret key 注意: 只能拿事英文+数字
AUTH_SECRET_KEY=my888god
# Brute force: verification attempts Note: Number; NGINX please set proxy_set_header X-Forwarded-For $remote_addr;
#爆破:验证次数 注意: 数字 ;nginx 请设置 proxy_set_header X-Forwarded-For $remote_addr;
AUTH_SECRET_ERROR_COUNT=3
# Brute force: wait time in minutes Note: Number
#爆破:验证停留时间 单位分钟 注意: 是数字
AUTH_SECRET_ERROR_TIME=10
```
- [x] Script:
- [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=your-english-password -e AUTH_SECRET_ERROR_COUNT=3 \
-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)

## Others
If you find this project helpful, please consider giving it a star or donating to us.
## 其他
如果觉得这个项目对您有所帮助,请帮忙点个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)

## Donations
If my open-source project is helpful to you, please consider sponsoring me through any of the following methods:
<br> `Payment remarks with your contact information`
## 捐助
如果我的开源项目对你有帮助,请考虑通过以下任意一种方式赞助:
<br> `付款备注上您的联系方式`
<div style="display: flex; flex-wrap: wrap">
<div style="width:200px">
<img src="./docs/wxpay.jpg" style="width:200px">
<div>WeChat Donation</div>
<div>微信捐助</div>
</div>
<div style="width:200px">
<img src="./docs/alipay.jpg" style="width:200px">
<div>Alipay Donation</div>
<div>支付宝捐助</div>
</div>
</div>
Loading

0 comments on commit b3e3b8c

Please sign in to comment.