fix(ui): fix type issues related to change in LoRA type

This commit is contained in:
psychedelicious 2024-02-26 11:51:25 +11:00 committed by Kent Keirsey
parent 8faefa89fe
commit 58ef6dc6ce
5 changed files with 7 additions and 5 deletions

View File

@ -39,7 +39,7 @@ export const addModelSelectedListener = () => {
// handle incompatible loras
forEach(state.lora.loras, (lora, id) => {
if (lora.base !== newBaseModel) {
if (lora.model.base !== newBaseModel) {
dispatch(loraRemoved(id));
modelsCleared += 1;
}

View File

@ -123,7 +123,7 @@ export const addModelsLoadedListener = () => {
const loras = getState().lora.loras;
forEach(loras, (lora, id) => {
const isLoRAAvailable = some(action.payload.entities, (m) => m?.key === lora?.key);
const isLoRAAvailable = some(action.payload.entities, (m) => m?.key === lora?.model.key);
if (isLoRAAvailable) {
return;

View File

@ -18,7 +18,7 @@ export const LoRAList = memo(() => {
return (
<Flex flexWrap="wrap" gap={2}>
{lorasArray.map((lora) => (
<LoRACard key={lora.key} lora={lora} />
<LoRACard key={lora.model.key} lora={lora} />
))}
</Flex>
);

View File

@ -40,7 +40,8 @@ export const addLoRAsToGraph = (
const loraMetadata: CoreMetadataInvocation['loras'] = [];
enabledLoRAs.forEach((lora) => {
const { key, weight } = lora;
const { weight } = lora;
const { key } = lora.model;
const currentLoraNodeId = `${LORA_LOADER}_${key}`;
const loraLoaderNode: LoraLoaderInvocation = {

View File

@ -58,7 +58,8 @@ export const addSDXLLoRAsToGraph = (
let currentLoraIndex = 0;
enabledLoRAs.forEach((lora) => {
const { key, weight } = lora;
const { weight } = lora;
const { key } = lora.model;
const currentLoraNodeId = `${LORA_LOADER}_${key}`;
const loraLoaderNode: SDXLLoraLoaderInvocation = {