mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): on base model change, disable control adapters
Previously it deleted them entirely.
This commit is contained in:
parent
82e8b92ba0
commit
1cc686734b
@ -1106,7 +1106,8 @@
|
|||||||
},
|
},
|
||||||
"toast": {
|
"toast": {
|
||||||
"addedToBoard": "Added to board",
|
"addedToBoard": "Added to board",
|
||||||
"baseModelChangedCleared": "Base model changed, cleared",
|
"baseModelChangedCleared_one": "Base model changed, cleared or disabled {{number}} incompatible submodel",
|
||||||
|
"baseModelChangedCleared_many": "$t(toast.baseModelChangedCleared_one)s",
|
||||||
"canceled": "Processing Canceled",
|
"canceled": "Processing Canceled",
|
||||||
"canvasCopiedClipboard": "Canvas Copied to Clipboard",
|
"canvasCopiedClipboard": "Canvas Copied to Clipboard",
|
||||||
"canvasDownloaded": "Canvas Downloaded",
|
"canvasDownloaded": "Canvas Downloaded",
|
||||||
@ -1126,7 +1127,6 @@
|
|||||||
"imageSavingFailed": "Image Saving Failed",
|
"imageSavingFailed": "Image Saving Failed",
|
||||||
"imageUploaded": "Image Uploaded",
|
"imageUploaded": "Image Uploaded",
|
||||||
"imageUploadFailed": "Image Upload Failed",
|
"imageUploadFailed": "Image Upload Failed",
|
||||||
"incompatibleSubmodel": "incompatible submodel",
|
|
||||||
"initialImageNotSet": "Initial Image Not Set",
|
"initialImageNotSet": "Initial Image Not Set",
|
||||||
"initialImageNotSetDesc": "Could not load initial image",
|
"initialImageNotSetDesc": "Could not load initial image",
|
||||||
"initialImageSet": "Initial Image Set",
|
"initialImageSet": "Initial Image Set",
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { logger } from 'app/logging/logger';
|
import { logger } from 'app/logging/logger';
|
||||||
import { setBoundingBoxDimensions } from 'features/canvas/store/canvasSlice';
|
import { setBoundingBoxDimensions } from 'features/canvas/store/canvasSlice';
|
||||||
import {
|
import {
|
||||||
controlAdapterModelCleared,
|
controlAdapterIsEnabledChanged,
|
||||||
selectControlAdapterAll,
|
selectControlAdapterAll,
|
||||||
} from 'features/controlAdapters/store/controlAdaptersSlice';
|
} from 'features/controlAdapters/store/controlAdaptersSlice';
|
||||||
import { loraRemoved } from 'features/lora/store/loraSlice';
|
import { loraRemoved } from 'features/lora/store/loraSlice';
|
||||||
@ -62,7 +62,9 @@ export const addModelSelectedListener = () => {
|
|||||||
// handle incompatible controlnets
|
// handle incompatible controlnets
|
||||||
selectControlAdapterAll(state.controlAdapters).forEach((ca) => {
|
selectControlAdapterAll(state.controlAdapters).forEach((ca) => {
|
||||||
if (ca.model?.base_model !== base_model) {
|
if (ca.model?.base_model !== base_model) {
|
||||||
dispatch(controlAdapterModelCleared({ id: ca.id }));
|
dispatch(
|
||||||
|
controlAdapterIsEnabledChanged({ id: ca.id, isEnabled: false })
|
||||||
|
);
|
||||||
modelsCleared += 1;
|
modelsCleared += 1;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -71,11 +73,14 @@ export const addModelSelectedListener = () => {
|
|||||||
dispatch(
|
dispatch(
|
||||||
addToast(
|
addToast(
|
||||||
makeToast({
|
makeToast({
|
||||||
title: `${t(
|
title: t(
|
||||||
'toast.baseModelChangedCleared'
|
modelsCleared === 1
|
||||||
)} ${modelsCleared} ${t('toast.incompatibleSubmodel')}${
|
? 'toast.baseModelChangedCleared_one'
|
||||||
modelsCleared === 1 ? '' : 's'
|
: 'toast.baseModelChangedCleared_many',
|
||||||
}`,
|
{
|
||||||
|
number: modelsCleared,
|
||||||
|
}
|
||||||
|
),
|
||||||
status: 'warning',
|
status: 'warning',
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user