get image

This commit is contained in:
zjt
2024-05-25 22:31:49 +08:00
parent 6f43190f9d
commit a32007c8fd
3 changed files with 62 additions and 47 deletions

View File

@@ -21,7 +21,8 @@ const UpscaleHandler: RequestHandler<any ,any> = async (ctx) => {
const { prompt, url } = requestBody;
const inputNode = selectNodeFromApiJSONbyID(upScaleAPIFormatJSON, "12");
inputNode.inputs.image = url;
ctx.body = {
try {
ctx.body = {
url: baseUrl + '/view?filename=' + await new Promise((resolve, reject) => {
const taskID = Math.random().toFixed(10);
const ws = new WebSocket(`${baseWsUrl}/ws?clientId=${taskID}`);
@@ -51,6 +52,10 @@ const UpscaleHandler: RequestHandler<any ,any> = async (ctx) => {
}
}
})
}
}catch (error) {
console.log(error);
}
}
export default UpscaleHandler;