fs img
This commit is contained in:
@@ -8,7 +8,10 @@ export default defineEventHandler(async event => {
|
|||||||
if (!fs.existsSync('outputs')) {
|
if (!fs.existsSync('outputs')) {
|
||||||
path = `../outputs/outputs/txt2img-samples/samples/${event.context.params.id}`
|
path = `../outputs/outputs/txt2img-samples/samples/${event.context.params.id}`
|
||||||
}
|
}
|
||||||
return await useStorage().getItem(`img:${event.context.params.id}`)
|
// 读取图片文件
|
||||||
|
let image = fs.readFileSync(path)
|
||||||
|
// 返回图片
|
||||||
|
return image
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user