Merge branch 'release' into staging
| @@ -106,8 +106,10 @@ router.post('/upscalers', jsonParser, async (request, response) => { | ||
| 106 | 106 | |
| 107 | 107 | router.post('/vaes', jsonParser, async (request, response) => { |
| 108 | 108 | try { |
| 109 | 109 | const autoUrl = urlJoinnew URL(request.body.url, '/sdapi/v1/sd-vae'); |
| 110 | 110 | const forgeUrlautoUrl.pathname = urlJoin(request.body.url, '/sdapi/v1/sd-modulesvae'); |
| 111 | + const forgeUrl = new URL(request.body.url); | |
| 112 | + forgeUrl.pathname = '/sdapi/v1/sd-modules'; | |
| 111 | 113 | |
| 112 | 114 | const requestInit = { |
| 113 | 115 | method: 'GET', |
| @@ -295,7 +297,8 @@ router.post('/set-model', jsonParser, async (request, response) => { | ||
| 295 | 297 | router.post('/generate', jsonParser, async (request, response) => { |
| 296 | 298 | try { |
| 297 | 299 | try { |
| 298 | 300 | const optionsUrl = urlJoinnew URL(request.body.url, '/sdapi/v1/options'); |
| 301 | + optionsUrl.pathname = '/sdapi/v1/options'; | |
| 299 | 302 | const optionsResult = await fetch(optionsUrl, { headers: { 'Authorization': getBasicAuthHeader(request.body.auth) } }); |
| 300 | 303 | if (optionsResult.ok) { |
| 301 | 304 | const optionsData = /** @type {any} */ (await optionsResult.json()); |
| @@ -313,14 +316,16 @@ router.post('/generate', jsonParser, async (request, response) => { | ||
| 313 | 316 | request.socket.removeAllListeners('close'); |
| 314 | 317 | request.socket.on('close', function () { |
| 315 | 318 | if (!response.writableEnded) { |
| 316 | 319 | const interruptUrl = urlJoinnew URL(request.body.url, '/sdapi/v1/interrupt'); |
| 320 | + interruptUrl.pathname = '/sdapi/v1/interrupt'; | |
| 317 | 321 | fetch(interruptUrl, { method: 'POST', headers: { 'Authorization': getBasicAuthHeader(request.body.auth) } }); |
| 318 | 322 | } |
| 319 | 323 | controller.abort(); |
| 320 | 324 | }); |
| 321 | 325 | |
| 322 | 326 | console.log('SD WebUI request:', request.body); |
| 323 | 327 | const txt2imgUrl = urlJoinnew URL(request.body.url, '/sdapi/v1/txt2img'); |
| 328 | + txt2imgUrl.pathname = '/sdapi/v1/txt2img'; | |
| 324 | 329 | const result = await fetch(txt2imgUrl, { |
| 325 | 330 | method: 'POST', |
| 326 | 331 | body: JSON.stringify(request.body), |