adds input prompt to imagehistory
This commit is contained in:
parent
e1fb53b461
commit
eb55f30414
|
@ -2,7 +2,12 @@ const IMAGE_HISTORY_SIZE = 10000;
|
|||
const imageHistory = new Array<ImageHistory>(IMAGE_HISTORY_SIZE);
|
||||
let index = 0;
|
||||
|
||||
type ImageHistory = { url: string; prompt: string, token?: string };
|
||||
type ImageHistory = {
|
||||
url: string;
|
||||
prompt: string;
|
||||
inputPrompt: string;
|
||||
token?: string;
|
||||
};
|
||||
|
||||
export function addToImageHistory(image: ImageHistory) {
|
||||
if (image.token?.length) {
|
||||
|
|
|
@ -68,7 +68,11 @@ export async function mirrorGeneratedImage(
|
|||
}
|
||||
item.url = `${host}/user_content/${path.basename(mirror)}`;
|
||||
await createThumbnail(mirror);
|
||||
addToImageHistory({ url: item.url, prompt, token: req.user?.token});
|
||||
addToImageHistory({
|
||||
url: item.url,
|
||||
prompt,
|
||||
inputPrompt: req.body.prompt,
|
||||
token: req.user?.token});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue