Sets status immediately when clicking Invoke

This commit is contained in:
psychedelicious 2022-11-18 14:12:44 +11:00 committed by blessedcoolant
parent ae6dd219d9
commit e28599cadb
2 changed files with 14 additions and 18 deletions

View File

@ -13,7 +13,9 @@ import {
import { OptionsState } from 'features/options/optionsSlice';
import {
addLogEntry,
generationRequested,
modelChangeRequested,
setCurrentStatus,
setIsProcessing,
} from 'features/system/systemSlice';
import { InvokeTabName } from 'features/tabs/InvokeTabs';
@ -52,24 +54,7 @@ const makeSocketIOEmitters = (
systemState,
};
// if (generationMode === 'inpainting') {
// const initialCanvasImage = initialCanvasImageSelector(getState());
// const imageUrl = initialCanvasImage?.image.url;
// if (!imageUrl) {
// dispatch(
// addLogEntry({
// timestamp: dateFormat(new Date(), 'isoDateTime'),
// message: 'Inpainting image not loaded, cannot generate image.',
// level: 'error',
// })
// );
// dispatch(errorOccurred());
// return;
// }
// frontendToBackendParametersConfig.imageToProcessUrl = imageUrl;
// } else
dispatch(generationRequested());
if (!['txt2img', 'img2img'].includes(generationMode)) {
if (!galleryState.currentImage?.url) return;

View File

@ -175,6 +175,16 @@ export const systemSlice = createSlice({
state.currentStatusHasSteps = false;
state.currentStatus = 'Processing canceled';
},
generationRequested: (state) => {
state.isProcessing = true;
state.isCancelable = true;
state.currentStep = 0;
state.totalSteps = 0;
state.currentIteration = 0;
state.totalIterations = 0;
state.currentStatusHasSteps = false;
state.currentStatus = 'Preparing';
},
setModelList: (
state,
action: PayloadAction<InvokeAI.ModelList | Record<string, never>>
@ -220,6 +230,7 @@ export const {
modelChangeRequested,
setSaveIntermediatesInterval,
setEnableImageDebugging,
generationRequested,
} = systemSlice.actions;
export default systemSlice.reducer;