mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Clear incompatible IP-Adapter when base model changes in the Linear UI.
This commit is contained in:
parent
2a3909da94
commit
382e2139bd
@ -1,6 +1,9 @@
|
||||
import { logger } from 'app/logging/logger';
|
||||
import { setBoundingBoxDimensions } from 'features/canvas/store/canvasSlice';
|
||||
import { controlNetRemoved } from 'features/controlNet/store/controlNetSlice';
|
||||
import {
|
||||
controlNetRemoved,
|
||||
ipAdapterStateReset,
|
||||
} from 'features/controlNet/store/controlNetSlice';
|
||||
import { loraRemoved } from 'features/lora/store/loraSlice';
|
||||
import { modelSelected } from 'features/parameters/store/actions';
|
||||
import {
|
||||
@ -56,6 +59,7 @@ export const addModelSelectedListener = () => {
|
||||
modelsCleared += 1;
|
||||
}
|
||||
|
||||
// handle incompatible controlnets
|
||||
const { controlNets } = state.controlNet;
|
||||
forEach(controlNets, (controlNet, controlNetId) => {
|
||||
if (controlNet.model?.base_model !== base_model) {
|
||||
@ -64,6 +68,16 @@ export const addModelSelectedListener = () => {
|
||||
}
|
||||
});
|
||||
|
||||
// handle incompatible IP-Adapter
|
||||
const { ipAdapterInfo } = state.controlNet;
|
||||
if (
|
||||
ipAdapterInfo.model &&
|
||||
ipAdapterInfo.model.base_model !== base_model
|
||||
) {
|
||||
dispatch(ipAdapterStateReset());
|
||||
modelsCleared += 1;
|
||||
}
|
||||
|
||||
if (modelsCleared > 0) {
|
||||
dispatch(
|
||||
addToast(
|
||||
|
Loading…
Reference in New Issue
Block a user