mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
do not try to save base64 intermediates in gallery on cancellation
This commit is contained in:
parent
4013e8ad6f
commit
7c5305ccba
@ -642,12 +642,12 @@ class InvokeAIWebServer:
|
|||||||
(width, height) = image.size
|
(width, height) = image.size
|
||||||
buffered = io.BytesIO()
|
buffered = io.BytesIO()
|
||||||
image.save(buffered, format="PNG")
|
image.save(buffered, format="PNG")
|
||||||
img_str = base64.b64encode(buffered.getvalue()).decode('UTF-8')
|
img_base64 = "data:image/jpeg;base64," + base64.b64encode(buffered.getvalue()).decode('UTF-8')
|
||||||
img_base64 = "data:image/jpeg;base64," + img_str
|
|
||||||
self.socketio.emit(
|
self.socketio.emit(
|
||||||
"intermediateResult",
|
"intermediateResult",
|
||||||
{
|
{
|
||||||
"url": img_base64,
|
"url": img_base64,
|
||||||
|
"isBase64": True,
|
||||||
"mtime": 0,
|
"mtime": 0,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"width": width,
|
"width": width,
|
||||||
|
829
frontend/dist/assets/index.4488003f.js
vendored
829
frontend/dist/assets/index.4488003f.js
vendored
File diff suppressed because one or more lines are too long
517
frontend/dist/assets/index.e2832fd4.js
vendored
Normal file
517
frontend/dist/assets/index.e2832fd4.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
frontend/dist/index.html
vendored
2
frontend/dist/index.html
vendored
@ -6,7 +6,7 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>InvokeAI - A Stable Diffusion Toolkit</title>
|
<title>InvokeAI - A Stable Diffusion Toolkit</title>
|
||||||
<link rel="shortcut icon" type="icon" href="./assets/favicon.0d253ced.ico" />
|
<link rel="shortcut icon" type="icon" href="./assets/favicon.0d253ced.ico" />
|
||||||
<script type="module" crossorigin src="./assets/index.4488003f.js"></script>
|
<script type="module" crossorigin src="./assets/index.e2832fd4.js"></script>
|
||||||
<link rel="stylesheet" href="./assets/index.52c8231e.css">
|
<link rel="stylesheet" href="./assets/index.52c8231e.css">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
3
frontend/src/app/invokeai.d.ts
vendored
3
frontend/src/app/invokeai.d.ts
vendored
@ -115,7 +115,8 @@ export declare type Image = {
|
|||||||
metadata?: Metadata;
|
metadata?: Metadata;
|
||||||
width: number;
|
width: number;
|
||||||
height: number;
|
height: number;
|
||||||
category: GalleryCategory;
|
category: GalleryCategory;
|
||||||
|
isBase64: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
// GalleryImages is an array of Image.
|
// GalleryImages is an array of Image.
|
||||||
|
@ -261,18 +261,20 @@ const makeSocketIOListeners = (
|
|||||||
const { intermediateImage } = getState().gallery;
|
const { intermediateImage } = getState().gallery;
|
||||||
|
|
||||||
if (intermediateImage) {
|
if (intermediateImage) {
|
||||||
dispatch(
|
if (!intermediateImage.isBase64) {
|
||||||
addImage({
|
dispatch(
|
||||||
category: 'result',
|
addImage({
|
||||||
image: intermediateImage,
|
category: 'result',
|
||||||
})
|
image: intermediateImage,
|
||||||
);
|
})
|
||||||
dispatch(
|
);
|
||||||
addLogEntry({
|
dispatch(
|
||||||
timestamp: dateFormat(new Date(), 'isoDateTime'),
|
addLogEntry({
|
||||||
message: `Intermediate image saved: ${intermediateImage.url}`,
|
timestamp: dateFormat(new Date(), 'isoDateTime'),
|
||||||
})
|
message: `Intermediate image saved: ${intermediateImage.url}`,
|
||||||
);
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
dispatch(clearIntermediateImage());
|
dispatch(clearIntermediateImage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user