get image
This commit is contained in:
parent
7260601060
commit
bcc9c30afc
@ -54,6 +54,16 @@ const Txt2ImgHandler: RequestHandler<Txt2ImgRequest, any> = async (ctx, next) =>
|
||||
}
|
||||
if (data.node === '94') {
|
||||
console.log(data.output);
|
||||
const filePath = './data.json';
|
||||
|
||||
readJSONFile(filePath)
|
||||
.then((data: any) => {
|
||||
console.log('读取的JSON数据:', data);
|
||||
// 修改对象
|
||||
data.push({ prompt: prompt, url: baseUrl + '/view?filename=' + data.output.images[0].filename, like: 0, index: data.length })
|
||||
// 保存回JSON文件
|
||||
return saveJSONFile(filePath, data);
|
||||
})
|
||||
// 综合使用示例
|
||||
|
||||
resolve({ prompt: temp, url: baseUrl + '/view?filename=' + data.output.images[0].filename });
|
||||
|
@ -42,16 +42,6 @@ const UpscaleHandler: RequestHandler<any ,any> = async (ctx) => {
|
||||
if (type === "executed") {
|
||||
console.log(data.output);
|
||||
if (data.node === '47') {
|
||||
const filePath = './data.json';
|
||||
|
||||
readJSONFile(filePath)
|
||||
.then((data: any) => {
|
||||
console.log('读取的JSON数据:', data);
|
||||
// 修改对象
|
||||
data.push({ prompt: prompt, url: baseUrl + '/view?filename=' + data.output.images[0].filename, like: 0,index: data.length })
|
||||
// 保存回JSON文件
|
||||
return saveJSONFile(filePath, data);
|
||||
})
|
||||
|
||||
resolve(data.output.images[0].filename)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user