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
|
||||
buffered = io.BytesIO()
|
||||
image.save(buffered, format="PNG")
|
||||
img_str = base64.b64encode(buffered.getvalue()).decode('UTF-8')
|
||||
img_base64 = "data:image/jpeg;base64," + img_str
|
||||
img_base64 = "data:image/jpeg;base64," + base64.b64encode(buffered.getvalue()).decode('UTF-8')
|
||||
self.socketio.emit(
|
||||
"intermediateResult",
|
||||
{
|
||||
"url": img_base64,
|
||||
"isBase64": True,
|
||||
"mtime": 0,
|
||||
"metadata": {},
|
||||
"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" />
|
||||
<title>InvokeAI - A Stable Diffusion Toolkit</title>
|
||||
<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">
|
||||
</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;
|
||||
width: number;
|
||||
height: number;
|
||||
category: GalleryCategory;
|
||||
category: GalleryCategory;
|
||||
isBase64: boolean;
|
||||
};
|
||||
|
||||
// GalleryImages is an array of Image.
|
||||
|
@ -261,18 +261,20 @@ const makeSocketIOListeners = (
|
||||
const { intermediateImage } = getState().gallery;
|
||||
|
||||
if (intermediateImage) {
|
||||
dispatch(
|
||||
addImage({
|
||||
category: 'result',
|
||||
image: intermediateImage,
|
||||
})
|
||||
);
|
||||
dispatch(
|
||||
addLogEntry({
|
||||
timestamp: dateFormat(new Date(), 'isoDateTime'),
|
||||
message: `Intermediate image saved: ${intermediateImage.url}`,
|
||||
})
|
||||
);
|
||||
if (!intermediateImage.isBase64) {
|
||||
dispatch(
|
||||
addImage({
|
||||
category: 'result',
|
||||
image: intermediateImage,
|
||||
})
|
||||
);
|
||||
dispatch(
|
||||
addLogEntry({
|
||||
timestamp: dateFormat(new Date(), 'isoDateTime'),
|
||||
message: `Intermediate image saved: ${intermediateImage.url}`,
|
||||
})
|
||||
);
|
||||
}
|
||||
dispatch(clearIntermediateImage());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user