mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-01-23 07:51:18 +01:00
Add swipes when using paintbrush
This commit is contained in:
parent
e1a29b36f5
commit
4fd8d8e0ee
@ -3617,10 +3617,23 @@ async function sdMessageButton(e) {
|
|||||||
|
|
||||||
function saveGeneratedImage(prompt, image, generationType, negative) {
|
function saveGeneratedImage(prompt, image, generationType, negative) {
|
||||||
// Some message sources may not create the extra object
|
// Some message sources may not create the extra object
|
||||||
if (typeof message.extra !== 'object') {
|
if (typeof message.extra !== 'object' || message.extra === null) {
|
||||||
message.extra = {};
|
message.extra = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add image to the swipe list if it's not already there
|
||||||
|
if (!Array.isArray(message.extra.image_swipes)) {
|
||||||
|
message.extra.image_swipes = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
const swipes = message.extra.image_swipes;
|
||||||
|
|
||||||
|
if (message.extra.image && !swipes.includes(message.extra.image)) {
|
||||||
|
swipes.push(message.extra.image);
|
||||||
|
}
|
||||||
|
|
||||||
|
swipes.push(image);
|
||||||
|
|
||||||
// If already contains an image and it's not inline - leave it as is
|
// If already contains an image and it's not inline - leave it as is
|
||||||
message.extra.inline_image = message.extra.image && !message.extra.inline_image ? false : true;
|
message.extra.inline_image = message.extra.image && !message.extra.inline_image ? false : true;
|
||||||
message.extra.image = image;
|
message.extra.image = image;
|
||||||
|
Loading…
Reference in New Issue
Block a user