mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): auto-select controlnet processor
- when the controlnet model is changed, if there is a default processor for the model set, the processor is changed. - once a control image is selected (and processed), changing the model does not change the processor - must be manually changed
This commit is contained in:
parent
fa1ac57c90
commit
6245a27650
@ -9,6 +9,7 @@ import {
|
||||
} from './types';
|
||||
import {
|
||||
CONTROLNET_MODELS,
|
||||
CONTROLNET_MODEL_MAP,
|
||||
CONTROLNET_PROCESSORS,
|
||||
ControlNetModel,
|
||||
} from './constants';
|
||||
@ -135,6 +136,16 @@ export const controlNetSlice = createSlice({
|
||||
) => {
|
||||
const { controlNetId, model } = action.payload;
|
||||
state.controlNets[controlNetId].model = model;
|
||||
|
||||
if (!state.controlNets[controlNetId].controlImage) {
|
||||
const processorType = CONTROLNET_MODEL_MAP[model];
|
||||
if (processorType) {
|
||||
state.controlNets[controlNetId].processorType = processorType;
|
||||
state.controlNets[controlNetId].processorNode = CONTROLNET_PROCESSORS[
|
||||
processorType
|
||||
].default as RequiredControlNetProcessorNode;
|
||||
}
|
||||
}
|
||||
},
|
||||
controlNetWeightChanged: (
|
||||
state,
|
||||
|
Loading…
Reference in New Issue
Block a user