From deb0924d360c00e7428769df7443f420f50e5947 Mon Sep 17 00:00:00 2001 From: Eric Date: Sun, 30 Apr 2023 23:08:33 +0800 Subject: [PATCH] upgrade midjourney (fix next stream api) --- package.json | 2 +- pages/api/imagine.ts | 1 - yarn.lock | 54 +++++++++++++++++++++++++++++--------------- 3 files changed, 37 insertions(+), 20 deletions(-) diff --git a/package.json b/package.json index 7189ba0..93490d6 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "@ant-design/pro-layout": "^7.10.3", "axios": "^1.3.6", "eventsource-parser": "^1.0.0", - "midjourney": "^1.0.14", + "midjourney": "^1.0.18", "next": "^13.1.1" }, "keywords": [ diff --git a/pages/api/imagine.ts b/pages/api/imagine.ts index 26be164..666dff5 100644 --- a/pages/api/imagine.ts +++ b/pages/api/imagine.ts @@ -16,7 +16,6 @@ const handler = async (req: Request) => { const readable = new ReadableStream({ start(controller) { console.log("imagine.start", prompt); - console.log("ReadableStream", ReadableStream); client .Imagine(prompt, (uri: string) => { console.log("imagine.loading", uri); diff --git a/yarn.lock b/yarn.lock index 9e73141..6358390 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1499,6 +1499,11 @@ esutils@^2.0.2: resolved "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== +eventemitter3@^4.0.4: + version "4.0.7" + resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" + integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== + eventsource-parser@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/eventsource-parser/-/eventsource-parser-1.0.0.tgz#6332e37fd5512e3c8d9df05773b2bf9e152ccc04" @@ -2174,13 +2179,13 @@ micromatch@^4.0.4, micromatch@^4.0.5: braces "^3.0.2" picomatch "^2.3.1" -midjourney@^1.0.14: - version "1.0.14" - resolved "https://registry.yarnpkg.com/midjourney/-/midjourney-1.0.14.tgz#c8affe2f79e766a646ca8bcfb4dfcb0b6e8b1667" - integrity sha512-ots7Mu/OVM5cKG/+yU6ZDFitS4Y3ng1vmOWgXbMfBOb17ZI6ne+CBEFLq0j5gIRfZtUk0uT7vFuCTrKAfDYvNw== +midjourney@^1.0.18: + version "1.0.18" + resolved "https://registry.yarnpkg.com/midjourney/-/midjourney-1.0.18.tgz#cbe30c25084f46453dbc1148ca7714bf7a7ba250" + integrity sha512-Dp1cD42QcUmbowKvvJbPy2QIFGO5VAAGQXbvwWej4VEtv3JavFNKJOQcTG/GTh3GKhaVUlUCxrIqC1K00iKmRw== dependencies: - axios "^1.3.6" - p-limit "^4.0.0" + p-queue "^6.6.2" + throat "^6.0.2" tslib "^2.5.0" mime-db@1.52.0: @@ -2379,6 +2384,11 @@ optionator@^0.9.1: type-check "^0.4.0" word-wrap "^1.2.3" +p-finally@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + integrity sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow== + p-limit@^3.0.2: version "3.1.0" resolved "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz" @@ -2386,13 +2396,6 @@ p-limit@^3.0.2: dependencies: yocto-queue "^0.1.0" -p-limit@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-4.0.0.tgz#914af6544ed32bfa54670b061cafcbd04984b644" - integrity sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ== - dependencies: - yocto-queue "^1.0.0" - p-locate@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz" @@ -2400,6 +2403,21 @@ p-locate@^5.0.0: dependencies: p-limit "^3.0.2" +p-queue@^6.6.2: + version "6.6.2" + resolved "https://registry.yarnpkg.com/p-queue/-/p-queue-6.6.2.tgz#2068a9dcf8e67dd0ec3e7a2bcb76810faa85e426" + integrity sha512-RwFpb72c/BhQLEXIZ5K2e+AhgNVmIejGlTgiB9MzZ0e93GRvqZ7uSi0dvRF7/XIXDeNkra2fNHBxTyPDGySpjQ== + dependencies: + eventemitter3 "^4.0.4" + p-timeout "^3.2.0" + +p-timeout@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-3.2.0.tgz#c7e17abc971d2a7962ef83626b35d635acf23dfe" + integrity sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg== + dependencies: + p-finally "^1.0.0" + parent-module@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz" @@ -3304,6 +3322,11 @@ thenify-all@^1.0.0: dependencies: any-promise "^1.0.0" +throat@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/throat/-/throat-6.0.2.tgz#51a3fbb5e11ae72e2cf74861ed5c8020f89f29fe" + integrity sha512-WKexMoJj3vEuK0yFEapj8y64V0A6xcuPuK9Gt1d0R+dzCSJc0lHqQytAbSB4cDAK0dWh4T0E2ETkoLE2WZ41OQ== + throttle-debounce@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/throttle-debounce/-/throttle-debounce-5.0.0.tgz" @@ -3537,8 +3560,3 @@ yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== - -yocto-queue@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-1.0.0.tgz#7f816433fb2cbc511ec8bf7d263c3b58a1a3c251" - integrity sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==