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 (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()) img_str = base64.b64encode(buffered.getvalue()).decode('UTF-8')
img_base64 = bytes("data:image/jpeg;base64,", encoding='utf-8') + img_str img_base64 = "data:image/jpeg;base64," + img_str
self.socketio.emit( self.socketio.emit(
"intermediateResult", "intermediateResult",
{ {

View File

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