mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Sets status immediately when clicking Invoke
This commit is contained in:
parent
ae6dd219d9
commit
e28599cadb
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user