mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Fixes Canvas Auto Save to Gallery
This commit is contained in:
parent
2ab868314f
commit
ae4a44de3e
@ -98,7 +98,8 @@ const makeSocketIOListeners = (
|
|||||||
*/
|
*/
|
||||||
onGenerationResult: (data: InvokeAI.ImageResultResponse) => {
|
onGenerationResult: (data: InvokeAI.ImageResultResponse) => {
|
||||||
try {
|
try {
|
||||||
const { shouldLoopback, activeTab } = getState().options;
|
const state = getState();
|
||||||
|
const { shouldLoopback, activeTab } = state.options;
|
||||||
const { boundingBox: _, generationMode, ...rest } = data;
|
const { boundingBox: _, generationMode, ...rest } = data;
|
||||||
|
|
||||||
const newImage = {
|
const newImage = {
|
||||||
@ -107,24 +108,31 @@ const makeSocketIOListeners = (
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (['txt2img', 'img2img'].includes(generationMode)) {
|
if (['txt2img', 'img2img'].includes(generationMode)) {
|
||||||
newImage.category = 'result';
|
|
||||||
dispatch(
|
dispatch(
|
||||||
addImage({
|
addImage({
|
||||||
category: 'result',
|
category: 'result',
|
||||||
image: newImage,
|
image: { ...newImage, category: 'result' },
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (generationMode === 'unifiedCanvas' && data.boundingBox) {
|
if (generationMode === 'unifiedCanvas' && data.boundingBox) {
|
||||||
newImage.category = 'temp';
|
|
||||||
const { boundingBox } = data;
|
const { boundingBox } = data;
|
||||||
dispatch(
|
dispatch(
|
||||||
addImageToStagingArea({
|
addImageToStagingArea({
|
||||||
image: newImage,
|
image: { ...newImage, category: 'temp' },
|
||||||
boundingBox,
|
boundingBox,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (state.canvas.shouldAutoSave) {
|
||||||
|
dispatch(
|
||||||
|
addImage({
|
||||||
|
image: { ...newImage, category: 'result' },
|
||||||
|
category: 'result',
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shouldLoopback) {
|
if (shouldLoopback) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user