Fixes b64 image sending and displaying

This commit is contained in:
psychedelicious 2022-11-01 21:54:35 +11:00 committed by Lincoln Stein
parent d1dfd257f9
commit 4013e8ad6f
2 changed files with 6 additions and 4 deletions

View File

@ -642,8 +642,8 @@ class InvokeAIWebServer:
(width, height) = image.size
buffered = io.BytesIO()
image.save(buffered, format="PNG")
img_str = base64.b64encode(buffered.getvalue())
img_base64 = bytes("data:image/jpeg;base64,", encoding='utf-8') + img_str
img_str = base64.b64encode(buffered.getvalue()).decode('UTF-8')
img_base64 = "data:image/jpeg;base64," + img_str
self.socketio.emit(
"intermediateResult",
{

View File

@ -44,13 +44,13 @@ const systemSelector = createSelector(
[
(state: RootState) => state.system,
(state: RootState) => state.options,
intermediateImageSelector,
(state: RootState) => state.gallery,
activeTabNameSelector,
],
(
system: SystemState,
options: OptionsState,
intermediateImage,
gallery: GalleryState,
activeTabName
) => {
const { isProcessing, isConnected, isGFPGANAvailable, isESRGANAvailable } =
@ -59,6 +59,8 @@ const systemSelector = createSelector(
const { upscalingLevel, facetoolStrength, shouldShowImageDetails } =
options;
const { intermediateImage } = gallery;
return {
isProcessing,
isConnected,