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';
|
} from './types';
|
||||||
import {
|
import {
|
||||||
CONTROLNET_MODELS,
|
CONTROLNET_MODELS,
|
||||||
|
CONTROLNET_MODEL_MAP,
|
||||||
CONTROLNET_PROCESSORS,
|
CONTROLNET_PROCESSORS,
|
||||||
ControlNetModel,
|
ControlNetModel,
|
||||||
} from './constants';
|
} from './constants';
|
||||||
@ -135,6 +136,16 @@ export const controlNetSlice = createSlice({
|
|||||||
) => {
|
) => {
|
||||||
const { controlNetId, model } = action.payload;
|
const { controlNetId, model } = action.payload;
|
||||||
state.controlNets[controlNetId].model = model;
|
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: (
|
controlNetWeightChanged: (
|
||||||
state,
|
state,
|
||||||
|
Loading…
Reference in New Issue
Block a user