Code Monkey home page Code Monkey logo

dooy / chatgpt-web-midjourney-proxy Goto Github PK

View Code? Open in Web Editor NEW
4.2K 32.0 1.1K 22.5 MB

One UI is all done with chatgpt web, midjourney, gpts,suno-v3,luma ; Simultaneous support Web / PWA / Linux / Win / MacOS platform

Home Page: https://vercel.ddaiai.com

License: MIT License

JavaScript 44.43% Shell 0.05% Dockerfile 0.06% HTML 1.01% TypeScript 24.26% Vue 27.03% Less 2.44% CSS 0.68% Batchfile 0.01% Rust 0.02%
chatgpt-ui chatgpt-web midjourney midjourney-api midjourney-ui gpts gptstore gpts-ui whisper-ui suno-v3 claude-3 suno vision gpt-4o luma

chatgpt-web-midjourney-proxy's Introduction

ChatGPT Web Midjourney Proxy

English | Русский язык | Français | 한국어 | Tiếng Việt | Türkçe

声明

  • 此项目只发布于 GitHub,基于 MIT 协议,免费且作为开源学习使用。并且不会有任何形式的卖号、付费服务、讨论群、讨论组等行为。谨防受骗。
  • 本开源是在 ChenZhaoYu 基础上做二次开发 ;使用 midjourney-proxy 、 Suno-API、Luma-API 作为后端API而形成的;
  • 可以直接用 https://vercel.ddaiai.com 先体验

cover

支持功能

无服务器-个人桌面安装

  • 请到 https://github.com/Dooy/chatgpt-web-midjourney-proxy/releases 下载最新版本安装(选择合适你操作系统的版本)
  • 选择一个合适的中转服务商( 最好都支持 gpt gpts midjourney claude suno luma )
  • 中转服务商推荐 https://www.openai-hk.com 一个keyapi接口地址 同时支持 gpt midjourney claude suno luma,mj-fast最低能到0.12rmb/张,suno 最低能到官网半价, luma最低能到0.16rmb/次 多模态

Vercel 一键部署

Deploy with Vercel

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 接口地址 搭建参考
MJ_API_SECRET mj proxy
SUNO_SERVER 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 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,video,dance
VISION_MODEL 默认使用的识图 可选:gpt-4o,gpt-4-turb,gpt-4-vision-preview
SYSTEM_MESSAGE 自定义默认角色消息
CUSTOM_VISION_MODELS 自定义可视图模型 用, 分开
LUMA_SERVER LUMA API 接口地址 搭建参考
LUMA_KEY LUMA API 的key

docker 部署

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

文件上传:

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走

curl -X POST -H "Content-Type: multipart/form-data" -F "file=@/path/to/file" http://OPENAI_API_BASE_URL/v1/upload

返回格式

{
"url":"https://xxxxxxx.jpg"
}

midjourney-proxy API docker部署

更多参考到 midjourney-proxy 开源光光

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

更多展示

自定义服务端api key、base_url:

base_url

GPTS GTP Store

多模态 多模态

suno 音乐制作

suno

录音 whisper 和 tts

whisper--tts

局部重绘:

局部重绘

换脸

换脸

混图

混图

支持图片上传图片 供gpt-4-vision-preview使用

混图 手机端:

文件上传 支持cloudflare r2 存储

R2_DOMAIN=
R2_BUCKET_NAME=
R2_ACCOUNT_ID=
R2_KEY_ID=
R2_KEY_SECRET=

文件服务器请求优先顺序

R2> 前端UI设置文件服务> 后端文件服务 >跟随中转

防爆破验证设置

防爆破

  • vercel 不支持;仅支持Docker化部署
  • 如果前面挂载 nginx 请配置 proxy_set_header X-Forwarded-For $remote_addr;
  • 参数如下: 错误验证3次,只能在10分钟后再验证
# 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
  • 脚本如下
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

其他

如果觉得这个项目对您有所帮助,请帮忙点个star 或者捐助我们

Star History Chart

捐助

如果我的开源项目对你有帮助,请考虑通过以下任意一种方式赞助:
付款备注上您的联系方式

微信捐助
支付宝捐助

chatgpt-web-midjourney-proxy's People

Contributors

bigqy avatar dooy avatar hugoshao avatar m4k4r avatar xuzhenjun130 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chatgpt-web-midjourney-proxy's Issues

增加访问密码输入三次超时60重试

修改verify.js起不到效果,不知道是变量出去了吗,修改内容如下:
``
const attemptStore = {};
module.exports = (req, res) => {
const clientIp = req.ip; // 获取客户端IP作为标识
const currentTime = Date.now();
const retryTimeout = 60000; // 60秒重试时间限制
let obj = { "status": "Fail", "message": "密钥无效 | Secret key is invalid", "data": null };

// 检查是否有验证尝试记录
if (!attemptStore[clientIp]) {
    attemptStore[clientIp] = { attempts: 0, lastAttempt: currentTime };
}

const clientAttempt = attemptStore[clientIp];

// 检查是否超过重试时间限制
if (currentTime - clientAttempt.lastAttempt < retryTimeout && clientAttempt.attempts >= 3) {
    obj.message = '超出尝试次数,请在60秒后重试 | Too many attempts, please retry after 60 seconds.';
} else {
    // 如果时间超过60秒,重置尝试次数
    if (currentTime - clientAttempt.lastAttempt >= retryTimeout) {
        clientAttempt.attempts = 0;
    }

    // 验证密钥
    if (req.body && req.body.token && process.env.AUTH_SECRET_KEY === req.body.token) {
        obj = { status: 'Success', message: 'Verify successfully', data: null };
        clientAttempt.attempts = 0; // 验证成功,重置尝试次数
    } else {
        clientAttempt.attempts += 1; // 验证失败,增加尝试次数
        obj.message += ` | 当前尝试次数: ${clientAttempt.attempts}`;
    }

    clientAttempt.lastAttempt = currentTime; // 更新最后尝试时间
}

res.setHeader('Content-type', 'application/json');
res.writeHead(200).end(JSON.stringify(obj));

};
``

gpt4-vision无法分析图片

vercel部署
cloudflare分配域名
报错内容
{
"error": {
"message": "json: cannot unmarshal array into Go value of type string (request id: 20231214130451569277952FI84XNUo)",
"type": "one_api_error",
"param": "",
"code": "count_token_messages_failed"
}
}
这里用的第三方api以及key

使用宝塔Docker compose部署出现问题

** WARN  Unsupported engine: wanted: {"node":"^16 || ^18 || ^19"} (current: {"node":"v20.10.0","pnpm":"8.11.0"})

[email protected] prod /app
node ./build/index.mjs

file:///app/build/index.mjs:49
throw new Error("Missing OPENAI_API_KEY or OPENAI_ACCESS_TOKEN environment variable");
^

Error: Missing OPENAI_API_KEY or OPENAI_ACCESS_TOKEN environment variable
at file:///app/build/index.mjs:49:9
at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
at async loadESM (node:internal/process/esm_loader:34:7)
at async handleMainPromise (node:internal/modules/run_main:113:12)

Node.js v20.10.0
 ELIFECYCLE  Command failed with exit code **

midjourney绘图部分功能按钮未出现

版本:v2.12.7

✅ midjourney 支持1.5倍变焦 2倍变焦
✅ midjourney 支持2倍高清 4倍高清
✅ midjourney 支持左、右、上、下延伸变化

如以上三种类型的功能,在进行绘图的过程中没有看到,不知道是不是我操作不正确

image

打字机效果

新版本貌似回复响应速度更快,而打字机效果有所下降,嗖的一下就全部出来了,望优化

MJ绘图新版本bug

现版本MJ绘图界面选择对应选项(如镜头,风格)可能不会自动添加上,最重要的是绘图模型(V6,V5.2,NIJI 5)也无法自动添加,
使用起来不是那边方便(老版本是直接会附上)

You didn't provide an API key 可是我在 docker 配置了,而且UI 又配置了一遍 openai 的 api_key

{
  "error": {
    "message": "You didn't provide an API key. You need to provide your API key in an Authorization header using Bearer auth (i.e. Authorization: Bearer YOUR_KEY), or as the password field (with blank username) if you're accessing the API from your browser and are prompted for a username and password. You can obtain an API key from https://platform.openai.com/account/api-keys.",
    "type": "invalid_request_error",
    "param": null,
    "code": null
  }
}

docker搭建使用换脸功能失败

提示如下:

提交中
[Unexpected token < in JSON at position 0]

另外大佬能否做个访问密码功能,这样就不怕在公网上分享给伙伴用了~

建议增加stable diffusion绘图功能

应该不难实现,目前有很多中转支持直接发送提示词而返回图片功能,希望可以搞一个,这样绘图功能就全啦。
可以参考接口文档https://ob6nfbpu76.apifox.cn/api-128172961

画廊功能优化

1、画廊可以增加复制生成图案提示词功能。
2、Dall.e生成的绘画也加入画廊就好了。
3、生成号的图画如果能存储到自定义的存储空间就可以一直保存了,而且可以将他人生成的一并保存形成公共画廊

关于本月使用量的取值

请教一下作者,这个本月使用量如何才能让其取值呢?我用的是中转API,可以用旧格式调用余额和消耗量

本地部署

本地部署,项目无法挂后台运行如何解决?

希望优化对话交互

  1. 支持实时以markdown 格式预览用户即将发送的内容
  2. 用户发送的消息以Markdown 格式显示
  3. 重试的时候,应该使用当前模型,而不是重发被重试的消息
  4. 允许修改历史消息内容,便于优化 prompt 重新提问

OPENAI_API_MODEL 不生效

新版本中,设置的默认 OPENAI_API_MODEL 并不管用。
我想要在新建聊天窗口的时候默认模型为设置的 OPENAI_API_MODEL。
但是现在显示的都是 gpt-3.5-turbo

使用MJ进行绘画,如何保证人物的一致性?

大佬们,用这个MJ绘图,怎么保证角色的一致性呢?
比如出了1个4宫格的图,然后我看中了第一张图,然后我把第一张图给单独拿出来,想把里面的人物换一个姿势。
里面有seed值,但是不知道怎么应用。 我尝试用--seed XX 参数 保证一致性,但是不起作用。

添加密码

希望可以添加一个密码,不然被别人登录,api一下就消耗完了。

建议增加弹窗公告功能

建议在打开页面时增加弹窗之类的公告,方便在出现各类问题或更新可用模型是能够给分享使用的人一个简单提示~

gpts无法使用

{
"error": {
"message": "The model gpt-4-gizmo-g-qdhTcI4hP does not exist",
"type": "invalid_request_error",
"param": null,
"code": "model_not_found"
}
}

docker部署配置的环境变量无效

问题描述

环境变量:OPENAI_API_KEY、OPENAI_API_BASE_URL、MJ_SERVER,均已配置

但前端配置界面参数为空,此时进行对话只会提示“思考中”,若在前端配置界面手动填写Openai相关参数则有效。但是Midjourney相关参数填写依旧无效,填写后绘图提示“提交中[Failed to fetch]”,若留空则为“[Unexpected token '<', "<!DOCTYPE "... is not valid JSON]”。

日志

日志只有这一段内容

> [email protected] prod /app
> node ./build/index.mjs

Server is running on port 3002
TypeError [ERR_HTTP_INVALID_HEADER_VALUE]: Invalid value "undefined" for header "mj-api-secret"
    at ClientRequest.setHeader (node:_http_outgoing:655:3)
    at new ClientRequest (node:_http_client:286:14)
    at Object.request (node:http:103:10)
    at /app/node_modules/.pnpm/[email protected]/node_modules/express-http-proxy/app/steps/sendProxyRequest.js:13:51
    at new Promise (<anonymous>)
    at sendProxyRequest (/app/node_modules/.pnpm/[email protected]/node_modules/express-http-proxy/app/steps/sendProxyRequest.js:11:10)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

docker部署的文件上传问题

请问使用docker部署,并且在ui界面设置 OPENAI_API_KEY OPENAI_API_BASE_URL后,如何不修改文件上传地址呢?(使用的代理openai api,这个代理没有文件上传的功能)

没有midjourney api 是否支持用discord的user-token?

看说明有提到参考了novicezk/midjourney-proxy,本项目是否也支持用discord的user-token?
-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=********** \

tts

是复读机,
image

Vercel部署环境变量未生效

fork仓库后使用Vercel部署,填入的环境变量API_UPLOADER、MJ_SERVER、OPENAI_API_BASE_URL前端未生效,仍需在网页填入MJ_SERVER、OPENAI_API_BASE_URL变量

请问,"gpt-4-all" 模型是哪里来的?

请教下作者,我在设置页面中,看到了“gpt-4-all”模型,这个模型我在官方查询不到,是不是它是非官方模型,同时当我基于项目内的gtps功能进行聊天时,像以下这三个,选择后,均提示模型不正确的问题:

image

image

这些模型是不是都是自定义的呢?请教一下。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.