preview
This commit is contained in:
@@ -21,6 +21,7 @@ const Txt2ImgHandler: RequestHandler<Txt2ImgRequest, any> = async (ctx, next) =>
|
||||
const { prompt, loraDetail, loraModel } = requestBody;
|
||||
const inputNode = selectNodeFromApiJSONbyID(txt2imgAPIformatJSON, "33");
|
||||
let temp = "";
|
||||
let preViewBlobs:any = [];
|
||||
inputNode.inputs.string = prompt;
|
||||
ctx.body = {
|
||||
data: await new Promise((resolve, reject) => {
|
||||
@@ -33,6 +34,7 @@ const Txt2ImgHandler: RequestHandler<Txt2ImgRequest, any> = async (ctx, next) =>
|
||||
prompt: txt2imgAPIformatJSON,
|
||||
// extra_data: txt2imgAPIformatExtraData
|
||||
});
|
||||
console.log(`ok`);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
@@ -50,11 +52,13 @@ const Txt2ImgHandler: RequestHandler<Txt2ImgRequest, any> = async (ctx, next) =>
|
||||
temp = data.output.text[0];
|
||||
}
|
||||
if (data.node === '94') {
|
||||
resolve({ prompt: temp, url: baseUrl + '/view?filename=' + data.output.images[0].filename })
|
||||
resolve({ prompt: temp, url: baseUrl + '/view?filename=' + data.output.images[0].filename, preViewBlobs: preViewBlobs });
|
||||
}
|
||||
}else if (type === "executing") {
|
||||
}
|
||||
} else {
|
||||
|
||||
} else if (event.data instanceof Buffer) {
|
||||
console.log(`event.data`, event.data);
|
||||
preViewBlobs.push(event.data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user