Giter Site home page Giter Site logo

erictik / midjourney-ui Goto Github PK

View Code? Open in Web Editor NEW
334.0 14.0 118.0 1.91 MB

Midjourney UI is an open source AI painting UI based on Midjourney

Home Page: https://midjourney-ui.vercel.app

License: Apache License 2.0

TypeScript 86.91% JavaScript 2.96% CSS 9.03% Dockerfile 1.10%
midjourney midjourney-ui

midjourney-ui's People

Contributors

aeroxi avatar artemptushkin avatar gluneau avatar soyzhou avatar zcpua 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

midjourney-ui's Issues

docker run 1.1.47 with error

Digest: sha256:66f1dd266b4a1e4b3c0409b7f27ab5039e6166a2da40c97f87e8c19958269046
Status: Downloaded newer image for erictik/midjourney-ui:latest
yarn run v1.22.19
$ next start
  ▲ Next.js 13.5.3
  - Local:        http://localhost:3000

 ✓ Ready in 582ms
Error: Cannot find module 'next/dist/shared/lib/html-context.js'
Require stack:
- /dist/.next/server/pages/_document.js
- /dist/node_modules/next/dist/server/require.js
- /dist/node_modules/next/dist/server/next-server.js
- /dist/node_modules/next/dist/server/next.js
- /dist/node_modules/next/dist/server/lib/start-server.js
- /dist/node_modules/next/dist/cli/next-start.js
- /dist/node_modules/next/dist/lib/commands.js
- /dist/node_modules/next/dist/bin/next
    at Module._resolveFilename (node:internal/modules/cjs/loader:1048:15)
    at /dist/node_modules/next/dist/server/require-hook.js:54:36
    at Module._load (node:internal/modules/cjs/loader:901:27)
    at Module.require (node:internal/modules/cjs/loader:1115:19)
    at mod.require (/dist/node_modules/next/dist/server/require-hook.js:64:28)
    at require (node:internal/modules/helpers:130:18)
    at 8743 (/dist/.next/server/pages/_document.js:263:18)
    at __webpack_require__ (/dist/.next/server/webpack-runtime.js:25:42)
    at 2940 (/dist/.next/server/chunks/378.js:6354:22)
    at __webpack_require__ (/dist/.next/server/webpack-runtime.js:25:42) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/dist/.next/server/pages/_document.js',
    '/dist/node_modules/next/dist/server/require.js',
    '/dist/node_modules/next/dist/server/next-server.js',
    '/dist/node_modules/next/dist/server/next.js',
    '/dist/node_modules/next/dist/server/lib/start-server.js',
    '/dist/node_modules/next/dist/cli/next-start.js',
    '/dist/node_modules/next/dist/lib/commands.js',
    '/dist/node_modules/next/dist/bin/next'
  ]
}
Error: Cannot find module 'next/dist/shared/lib/html-context.js'
Require stack:
- /dist/.next/server/pages/_document.js
- /dist/node_modules/next/dist/server/require.js
- /dist/node_modules/next/dist/server/next-server.js
- /dist/node_modules/next/dist/server/next.js
- /dist/node_modules/next/dist/server/lib/start-server.js
- /dist/node_modules/next/dist/cli/next-start.js
- /dist/node_modules/next/dist/lib/commands.js
- /dist/node_modules/next/dist/bin/next
    at Module._resolveFilename (node:internal/modules/cjs/loader:1048:15)
    at /dist/node_modules/next/dist/server/require-hook.js:54:36
    at Module._load (node:internal/modules/cjs/loader:901:27)
    at Module.require (node:internal/modules/cjs/loader:1115:19)
    at mod.require (/dist/node_modules/next/dist/server/require-hook.js:64:28)
    at require (node:internal/modules/helpers:130:18)
    at 8743 (/dist/.next/server/pages/_document.js:263:18)
    at __webpack_require__ (/dist/.next/server/webpack-runtime.js:25:42)
    at 2940 (/dist/.next/server/chunks/378.js:6354:22)
    at __webpack_require__ (/dist/.next/server/webpack-runtime.js:25:42) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/dist/.next/server/pages/_document.js',
    '/dist/node_modules/next/dist/server/require.js',
    '/dist/node_modules/next/dist/server/next-server.js',
    '/dist/node_modules/next/dist/server/next.js',
    '/dist/node_modules/next/dist/server/lib/start-server.js',
    '/dist/node_modules/next/dist/cli/next-start.js',
    '/dist/node_modules/next/dist/lib/commands.js',
    '/dist/node_modules/next/dist/bin/next'
  ]
}

部署到 vercel 后开始绘图显示502,本地绘图正常

本地运行绘图正常,部署到 vercel 后请求 prompt 显示 405
image
随后在控制台看见以下报错
image
说是 28 行报错
image

const client = new Midjourney({
ServerId: 'xxx',
ChannelId: 'xxx',
SalaiToken: 'xxx',
Debug: true,
Ws: true,
});
以上配置都是写死的字符串,不知哪里出了问题

违禁词处理

是否对违禁词,有识别判断机制呢?discord会返回违禁词的错误,是否会返回对应的错误信息?

[not work] about session_id

I can not use this normally.
I see the commit, it is added the session_id
What is the different between session_id and SALAI_TOKEN?
Should I config that session_id?

改改返回照片地址吧

因为网络限制,src="[https://cdn.discordapp.com/attachments//nd_the_Ye_18a33ae1-6b56-49a9-9755-6c9d3510f7cf.png"这类照片不能访问,这个怎么处理]([https://cdn.discordapp.com/attachments//nd_the_Ye_18a33ae1-6b56-49a9-9755-6c9d3510f7cf.png,你可以把后端显示的代码地址https://cdn.discordapp.com/attachments,可以变成后端可配置?

Issues generating images

I get this error

Failed to load resource: the server responded with a status of 404 (Not Found) on image command

next or webpack error when running

node:child_process Module build failed: UnhandledSchemeError: Reading from "node:child_process" is not handled by plugins (Unhandled scheme). Webpack supports "data:" and "file:" URIs by default. You may need an additional plugin to handle "node:" URIs. Import trace for requested module: node:child_process ./node_modules/discord.js/src/sharding/Shard.js ./node_modules/discord.js/src/index.js ./node_modules/midjourney/libs/midjourney.js ./node_modules/midjourney/libs/index.js

No image

Added to netlify, edited the .env but nothing is generated when sending a message

[not work] update error

imagine.error Error: ImagineApi failed with status 400
at (node_modules/midjourney/libs/midjourney.js:24:0)
at (node_modules/tslib/tslib.es6.js:118:42)

Dynamic Code Evaluation not allowed in Edge Runtime

Dynamic Code Evaluation (e. g. 'eval', 'new Function', 'WebAssembly.compile') not allowed in Edge Runtime
Learn More: https://nextjs.org/docs/messages/edge-dynamic-code-evaluation

Import trace for requested module:
./node_modules/_lodash.snakecase@[email protected]/index.js
./node_modules/_discord.js@[email protected]/src/util/Transformers.js
./node_modules/_discord.js@[email protected]/src/util/Options.js
./node_modules/_discord.js@[email protected]/src/index.js
./node_modules/_midjourney@2.2.31@midjourney/libs/midjourney.js
./node_modules/_midjourney@2.2.31@midjourney/libs/index.js

i just fork the repo and npm run build in local.
anyone have meet this issue?

Partial Response Received by API (Netlify & Vercel)

Hoping someone can help here because I've spent two days trying to get this working and I'm too dumb to figure out what's wrong.

I'm trying to generate images via the API endpoint with Make.com, deployed on both Vercel (WS=FALSE) and Netlify(WS=FALSE and WS=TRUE).

The API request often — almost always — returns incomplete streaming binary data which translates into an incomplete JSON response like the below:

{"uri":"https://cdn.discordapp.com/attachments/1099844378522034196/1120457502526554193/grid_0.webp",

Occasionally, it will return the final JSON with progress:done, in a similarly truncated form. Very occasionally, it will return a complete, successful response.

My timeout values are long enough to fully process the image.

When I try to generate an image via cURL, I also get incomplete data with the following response:

curl: (18) transfer closed with outstanding read data remaining

Can someone point me in the right direction to even start troubleshooting this? I'm about to lose my mind here.

not work with vercel

在 vercel 上部署后,报下面这个错误👇🏻

    Error: SalaiToken are required
        at (node_modules/midjourney/libs/midjourney.js:16:18)
        at (pages/api/imagine.ts:12:17)
        at (node_modules/next/dist/esm/server/web/adapter.js:144:19)

经过检查,实际上已经设置好了四个环境变量。

image

几个参数经过反复确认,也都是 OK 的。

图片出不来

DevTools failed to load source map: Could not load content for chrome-extension://cofdbpoegempjloogbagkncekinflcnj/build/content.js.map: 系统错误: net::ERR_BLOCKED_BY_CLIENT

能启动服务,但提交就报500错误,docker或本地部署都是这样

报错信息如下 :

  • error Error: The edge runtime does not support Node.js 'http' module.
    Learn More: https://nextjs.org/docs/messages/node-module-in-edge-runtime
    at (webpack-internal:///(middleware)/./node_modules/next/dist/esm/server/web/globals.js:33)
    at Object.get (webpack-internal:///(middleware)/./node_modules/next/dist/esm/server/web/globals.js:33:19)
    at eval (webpack-internal:///(middleware)/./node_modules/agent-base/dist/index.js:45:26)
    at (middleware)/./node_modules/agent-base/dist/index.js (file:///Users/weliam/study/midjourney-ui/.next/server/pages/api/imagine.js:140:1)
    at webpack_require (file:///Users/weliam/study/midjourney-ui/.next/server/edge-runtime-webpack.js:37:33)
    at fn (file:///Users/weliam/study/midjourney-ui/.next/server/edge-runtime-webpack.js:268:21)
    at eval (webpack-internal:///(middleware)/./node_modules/https-proxy-agent/dist/index.js:49:22)
    at (middleware)/./node_modules/https-proxy-agent/dist/index.js (file:///Users/weliam/study/midjourney-ui/.next/server/pages/api/imagine.js:184:1)
    at webpack_require (file:///Users/weliam/study/midjourney-ui/.next/server/edge-runtime-webpack.js:37:33)
    at fn (file:///Users/weliam/study/midjourney-ui/.next/server/edge-runtime-webpack.js:268:21)
    at eval (webpack-internal:///(middleware)/./node_modules/midjourney/libs/midjourne.api.js:10:29) {
    digest: undefined
    }

请问这问题如何解决?

variation doesn't work

i will fork this repo and deploy on vercel and config the env.
Then i test imagine, it works well. but variation failed the http status is 504. there is no more log in addition to the following log
[POST] /api/variation/ reason=EDGE_FUNCTION_INVOCATION_TIMEOUT, status=504, user_error=true

求助:部署后发送关键词不显示图片

部署地址:netlify
问题:接口请求正常200,discord频道能正确收到信息并且绘图,但是自己部署网站不显示图片
问题截图:
image
查看日志发现有个报错:
image

希望作者大大能帮忙看看~麻烦啦

Is it safe for a discord account?

Hello,
I would like to ask if it is safe for a discord account, which we are using as a midjourney subscription provider.
I am just wodering, because this way there would be thousands of websites offering extremely cheap midjourney generations just by purchasing one subscription. And as far as I know there are not so many this type of websites.

thanks for the answer in advance

ImagineApi failed with status 400

I was working last week and it went good.
From yesterday it's failing returning 400.

api.DiscordBaseUrl https: //discord.com
api.fetchUrl https: //discord.com/api/v9/interactions
imagine.error [Error: ImagineApi failed with status 400]
api.error.config {
payload: {
type: 2,
application_id: '',
guild_id: '',
channel_id: '',
session_id: '',
data: {
version: '',
id: '',
name: 'imagine',
type: 1,
options: [
{ type: 3, name: 'prompt', value: '[
4758450366
] draw a cat'
}
],

Docker fails

The program fails in Docker container when submitting the prompt from the UI:

(base) morpher@rog ~/Documents/MyProjects/midjourney-ui (main)$ docker run --env-file .env -p 3000:3000 erictik/midjourney-ui
yarn run v1.22.19
$ next start
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
imagine.handler unicorn
imagine.start unicorn
ReadableStream class {
  constructor(e2 = {}, t2 = {}) {
    void 0 === e2 ? e2 = null : D(e2, "First parameter");
    const r2 = Ye(t2, "Second parameter"), o2 = function(e3, t3) {
      F(e3, t3);
      const r3 = e3, o3 = null == r3 ? void 0 : r3.autoAllocateChunkSize, n3 = null == r3 ? void 0 : r3.cancel, a2 = null == r3 ? void 0 : r3.pull, i2 = null == r3 ? void 0 : r3.start, l2 = null == r3 ? void 0 : r3.type;
      return { autoAllocateChunkSize: void 0 === o3 ? void 0 : N(o3, `${t3} has member 'autoAllocateChunkSize' that`), cancel: void 0 === n3 ? void 0 : $t(n3, r3, `${t3} has member 'cancel' that`), pull: void 0 === a2 ? void 0 : Mt(a2, r3, `${t3} has member 'pull' that`), start: void 0 === i2 ? void 0 : Yt(i2, r3, `${t3} has member 'start' that`), type: void 0 === l2 ? void 0 : Qt(l2, `${t3} has member 'type' that`) };
    }(e2, "First parameter");
    var n2;
    if ((n2 = this)._state = "readable", n2._reader = void 0, n2._storedError = void 0, n2._disturbed = false, "bytes" === o2.type) {
      if (void 0 !== r2.size)
        throw new RangeError("The strategy for a byte stream cannot have a size function");
      Oe(this, o2, $e(r2, 0));
    } else {
      const e3 = Me(r2);
      It(this, o2, $e(r2, 1), e3);
    }
  }
  get locked() {
    if (!Vt(this))
      throw Kt("locked");
    return Ut(this);
  }
  cancel(e2) {
    return Vt(this) ? Ut(this) ? d(new TypeError("Cannot cancel a stream that already has a reader")) : Gt(this, e2) : d(Kt("cancel"));
  }
  getReader(e2) {
    if (!Vt(this))
      throw Kt("getReader");
    return void 0 === function(e3, t2) {
      F(e3, t2);
      const r2 = null == e3 ? void 0 : e3.mode;
      return { mode: void 0 === r2 ? void 0 : Nt(r2, `${t2} has member 'mode' that`) };
    }(e2, "First parameter").mode ? new ReadableStreamDefaultReader(this) : function(e3) {
      return new ReadableStreamBYOBReader(e3);
    }(this);
  }
  pipeThrough(e2, t2 = {}) {
    if (!H(this))
      throw Kt("pipeThrough");
    $(e2, 1, "pipeThrough");
    const r2 = xt(e2, "First parameter"), o2 = Ht(t2, "Second parameter");
    if (this.locked)
      throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");
    if (r2.writable.locked)
      throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");
    return m(kt(this, r2.writable, o2.preventClose, o2.preventAbort, o2.preventCancel, o2.signal)), r2.readable;
  }
  pipeTo(e2, t2 = {}) {
    if (!H(this))
      return d(Kt("pipeTo"));
    if (void 0 === e2)
      return d("Parameter 1 is required in 'pipeTo'.");
    if (!x(e2))
      return d(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));
    let r2;
    try {
      r2 = Ht(t2, "Second parameter");
    } catch (e3) {
      return d(e3);
    }
    return this.locked ? d(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")) : e2.locked ? d(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")) : kt(this, e2, r2.preventClose, r2.preventAbort, r2.preventCancel, r2.signal);
  }
  tee() {
    if (!H(this))
      throw Kt("tee");
    if (this.locked)
      throw new TypeError("Cannot tee a stream that already has a reader");
    return Ot(this);
  }
  values(e2) {
    if (!H(this))
      throw Kt("values");
    return function(e3, t2) {
      const r2 = e3.getReader(), o2 = new te(r2, t2), n2 = Object.create(re);
      return n2._asyncIteratorImpl = o2, n2;
    }(this, function(e3, t2) {
      F(e3, t2);
      const r2 = null == e3 ? void 0 : e3.preventCancel;
      return { preventCancel: Boolean(r2) };
    }(e2, "First parameter").preventCancel);
  }
}
imagine.error [Error: A Node.js API is used (setImmediate) which is not supported in the Edge Runtime.
Learn more: https://nextjs.org/docs/api-reference/edge-runtime]

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.