mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): models loaded handler
This commit is contained in:
parent
712e090134
commit
0ed6591d8c
@ -45,7 +45,7 @@ export const addModelSelectedListener = (startAppListening: AppStartListening) =
|
|||||||
}
|
}
|
||||||
|
|
||||||
// handle incompatible controlnets
|
// handle incompatible controlnets
|
||||||
state.canvasV2.controlAdapters.forEach((ca) => {
|
state.canvasV2.controlAdapters.entities.forEach((ca) => {
|
||||||
if (ca.model?.base !== newBaseModel) {
|
if (ca.model?.base !== newBaseModel) {
|
||||||
modelsCleared += 1;
|
modelsCleared += 1;
|
||||||
if (ca.isEnabled) {
|
if (ca.isEnabled) {
|
||||||
|
@ -172,7 +172,7 @@ const handleLoRAModels: ModelHandler = (models, state, dispatch, _log) => {
|
|||||||
|
|
||||||
const handleControlAdapterModels: ModelHandler = (models, state, dispatch, _log) => {
|
const handleControlAdapterModels: ModelHandler = (models, state, dispatch, _log) => {
|
||||||
const caModels = models.filter(isControlNetOrT2IAdapterModelConfig);
|
const caModels = models.filter(isControlNetOrT2IAdapterModelConfig);
|
||||||
state.canvasV2.controlAdapters.forEach((ca) => {
|
state.canvasV2.controlAdapters.entities.forEach((ca) => {
|
||||||
const isModelAvailable = caModels.some((m) => m.key === ca.model?.key);
|
const isModelAvailable = caModels.some((m) => m.key === ca.model?.key);
|
||||||
if (isModelAvailable) {
|
if (isModelAvailable) {
|
||||||
return;
|
return;
|
||||||
@ -183,7 +183,7 @@ const handleControlAdapterModels: ModelHandler = (models, state, dispatch, _log)
|
|||||||
|
|
||||||
const handleIPAdapterModels: ModelHandler = (models, state, dispatch, _log) => {
|
const handleIPAdapterModels: ModelHandler = (models, state, dispatch, _log) => {
|
||||||
const ipaModels = models.filter(isIPAdapterModelConfig);
|
const ipaModels = models.filter(isIPAdapterModelConfig);
|
||||||
state.canvasV2.controlAdapters.forEach(({ id, model }) => {
|
state.canvasV2.ipAdapters.entities.forEach(({ id, model }) => {
|
||||||
const isModelAvailable = ipaModels.some((m) => m.key === model?.key);
|
const isModelAvailable = ipaModels.some((m) => m.key === model?.key);
|
||||||
if (isModelAvailable) {
|
if (isModelAvailable) {
|
||||||
return;
|
return;
|
||||||
@ -191,7 +191,7 @@ const handleIPAdapterModels: ModelHandler = (models, state, dispatch, _log) => {
|
|||||||
dispatch(ipaModelChanged({ id, modelConfig: null }));
|
dispatch(ipaModelChanged({ id, modelConfig: null }));
|
||||||
});
|
});
|
||||||
|
|
||||||
state.canvasV2.regions.forEach(({ id, ipAdapters }) => {
|
state.canvasV2.regions.entities.forEach(({ id, ipAdapters }) => {
|
||||||
ipAdapters.forEach(({ id: ipAdapterId, model }) => {
|
ipAdapters.forEach(({ id: ipAdapterId, model }) => {
|
||||||
const isModelAvailable = ipaModels.some((m) => m.key === model?.key);
|
const isModelAvailable = ipaModels.some((m) => m.key === model?.key);
|
||||||
if (isModelAvailable) {
|
if (isModelAvailable) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user