From 8fa2eeb18e00e92f523df39626d9fa5f1c8e6a51 Mon Sep 17 00:00:00 2001 From: Eric Date: Sun, 4 Jun 2023 18:31:04 +0800 Subject: [PATCH] test --- package.json | 2 +- pages/api/imagine.ts | 5 +---- yarn.lock | 8 ++++---- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 36c44d9..cb92588 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "@vercel/analytics": "^1.0.1", "axios": "^1.3.6", "eventsource-parser": "^1.0.0", - "midjourney": "^2.4.45", + "midjourney": "^2.4.46", "next": "^13.4.4" }, "keywords": [ diff --git a/pages/api/imagine.ts b/pages/api/imagine.ts index a49e70e..cd25bdc 100644 --- a/pages/api/imagine.ts +++ b/pages/api/imagine.ts @@ -4,13 +4,10 @@ import { ResponseError } from "../../interfaces"; export const config = { runtime: "edge", }; -import WebSocket from "isomorphic-ws"; const handler = async (req: Request) => { const { prompt } = await req.json(); - if (typeof global !== "undefined") { - (global as any).WebSocket = WebSocket; - } + console.log("imagine.handler", prompt); const client = new Midjourney({ ServerId: process.env.SERVER_ID, diff --git a/yarn.lock b/yarn.lock index f8717eb..ca439b1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2231,10 +2231,10 @@ micromatch@^4.0.4, micromatch@^4.0.5: braces "^3.0.2" picomatch "^2.3.1" -midjourney@^2.4.45: - version "2.4.45" - resolved "https://registry.yarnpkg.com/midjourney/-/midjourney-2.4.45.tgz#1d7b1d38165606b07854f8693dd94da79ad87db6" - integrity sha512-6Iij4FC7g6nrRJ9Lftsp0mhl83puvsog4LhVb1vti+97tvYmnrNoRLgXK7v7uzLS3dX7q2QK6SUXpdU/PU4k1Q== +midjourney@^2.4.46: + version "2.4.46" + resolved "https://registry.yarnpkg.com/midjourney/-/midjourney-2.4.46.tgz#86da33cb630c94e034d2fc022072007709748793" + integrity sha512-ZSdk6Trb86gyQclZ6y20a66dXkmYQ3OYdSMguVbj5rv4gVV1NuOlqMvsbwL7SNdUC9KPaJfFtP6/mQZnpynKpw== dependencies: "@huggingface/inference" "^2.5.0" isomorphic-ws "^5.0.0"