get image
This commit is contained in:
parent
6f43190f9d
commit
a32007c8fd
@ -20,6 +20,7 @@ const Txt23DHandler: RequestHandler<any, any> = async (ctx) => {
|
||||
const { prompt, url } = requestBody;
|
||||
const inputNode = selectNodeFromApiJSONbyID(txt23dApiFormatJSON, "33");
|
||||
inputNode.inputs.string = prompt;
|
||||
try {
|
||||
ctx.body = {
|
||||
url: ctx.body = baseUrl + '/view?filename=' + await new Promise((resolve, reject) => {
|
||||
const taskID = Math.random().toFixed(10);
|
||||
@ -52,5 +53,9 @@ const Txt23DHandler: RequestHandler<any, any> = async (ctx) => {
|
||||
}
|
||||
})
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
}
|
||||
export default Txt23DHandler;
|
@ -24,6 +24,7 @@ const Txt2ImgHandler: RequestHandler<Txt2ImgRequest, any> = async (ctx, next) =>
|
||||
let temp = "";
|
||||
let preViewBlobs: any = [];
|
||||
inputNode.inputs.string = prompt;
|
||||
try {
|
||||
ctx.body = {
|
||||
data: await new Promise((resolve, reject) => {
|
||||
const taskID = Math.random().toFixed(10);
|
||||
@ -75,5 +76,9 @@ const Txt2ImgHandler: RequestHandler<Txt2ImgRequest, any> = async (ctx, next) =>
|
||||
}
|
||||
})
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
}
|
||||
export default Txt2ImgHandler;
|
@ -21,6 +21,7 @@ const UpscaleHandler: RequestHandler<any ,any> = async (ctx) => {
|
||||
const { prompt, url } = requestBody;
|
||||
const inputNode = selectNodeFromApiJSONbyID(upScaleAPIFormatJSON, "12");
|
||||
inputNode.inputs.image = url;
|
||||
try {
|
||||
ctx.body = {
|
||||
url: baseUrl + '/view?filename=' + await new Promise((resolve, reject) => {
|
||||
const taskID = Math.random().toFixed(10);
|
||||
@ -52,5 +53,9 @@ const UpscaleHandler: RequestHandler<any ,any> = async (ctx) => {
|
||||
}
|
||||
})
|
||||
}
|
||||
}catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
}
|
||||
export default UpscaleHandler;
|
Loading…
x
Reference in New Issue
Block a user