erictik / midjourney-api

MidJourney client. Unofficial Node.js client
Apache License 2.0
1.64k stars 269 forks source link

Face Swap error - uncaughtException: Error: Unexpected server response: 403 #252

Open glbrtjose opened 6 months ago

glbrtjose commented 6 months ago

the code that reproduces this issue or a replay of the bug

const client = new Midjourney({ ServerId: process.env.SERVER_ID, ChannelId: process.env.CHANNEL_ID, SalaiToken: process.env.SALAI_TOKEN, Debug: true, HuggingFaceToken: process.env.HUGGINGFACE_TOKEN, }); await client.Connect(); const source = "https://cdn.discordapp.com/attachments/1107965981839605792/1129362418775113789/3829c5d7-3e7e-473c-9c7b-b858e3ec97bc.jpeg"; const target = "https://cdn.discordapp.com/attachments/1108587422389899304/1129321837042602016/guapitu006_a_girls_face_with_david_bowies_thunderbolt_71ee5899-bd45-4fc4-8c9d-92f19ddb0a03.png"; const info = await client.FaceSwap(target, source);

Describe the bug

Describe the bug When executing the method FaceSwap, it returns the following message

error - node_modules/ws/lib/websocket.js (896:6) @ abortHandshake error - uncaughtException: Error: Unexpected server response: 403 at ClientRequest.eval (webpack-internal:///(sc_server)/./node_modules/ws/lib/websocket.js:706:13) at ClientRequest.emit (node:events:511:28) at HTTPParser.parserOnIncomingClient (node:_http_client:693:27) at HTTPParser.parserOnHeadersComplete (node:_http_common:119:17) at TLSSocket.socketOnData (node:_http_client:535:22) at TLSSocket.emit (node:events:511:28) at addChunk (node:internal/streams/readable:332:12) at readableAddChunk (node:internal/streams/readable:305:9) at Readable.push (node:internal/streams/readable:242:10) at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23) at TLSWrap.callbackTrampoline (node:internal/async_hooks:130:17) null

Expected behavior It should return the uri inside an object

Screenshots If applicable, add screenshots to help explain your problem.

error log

error - node_modules/ws/lib/websocket.js (896:6) @ abortHandshake error - uncaughtException: Error: Unexpected server response: 403 at ClientRequest.eval (webpack-internal:///(sc_server)/./node_modules/ws/lib/websocket.js:706:13) at ClientRequest.emit (node:events:511:28) at HTTPParser.parserOnIncomingClient (node:_http_client:693:27) at HTTPParser.parserOnHeadersComplete (node:_http_common:119:17) at TLSSocket.socketOnData (node:_http_client:535:22) at TLSSocket.emit (node:events:511:28) at addChunk (node:internal/streams/readable:332:12) at readableAddChunk (node:internal/streams/readable:305:9) at Readable.push (node:internal/streams/readable:242:10) at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23) at TLSWrap.callbackTrampoline (node:internal/async_hooks:130:17)

RoberBicho commented 2 months ago

any change?