mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): fix lora name disappearing (#3753)
This commit is contained in:
commit
af3b7e73ab
@ -37,7 +37,7 @@ const ParamLora = (props: Props) => {
|
|||||||
return (
|
return (
|
||||||
<Flex sx={{ gap: 2.5, alignItems: 'flex-end' }}>
|
<Flex sx={{ gap: 2.5, alignItems: 'flex-end' }}>
|
||||||
<IAISlider
|
<IAISlider
|
||||||
label={lora.name}
|
label={lora.model_name}
|
||||||
value={lora.weight}
|
value={lora.weight}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
min={-1}
|
min={-1}
|
||||||
|
@ -18,7 +18,7 @@ const selector = createSelector(
|
|||||||
const ParamLoraList = () => {
|
const ParamLoraList = () => {
|
||||||
const { loras } = useAppSelector(selector);
|
const { loras } = useAppSelector(selector);
|
||||||
|
|
||||||
return map(loras, (lora) => <ParamLora key={lora.name} lora={lora} />);
|
return map(loras, (lora) => <ParamLora key={lora.model_name} lora={lora} />);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default ParamLoraList;
|
export default ParamLoraList;
|
||||||
|
@ -1,12 +1,8 @@
|
|||||||
import { PayloadAction, createSlice } from '@reduxjs/toolkit';
|
import { PayloadAction, createSlice } from '@reduxjs/toolkit';
|
||||||
import { LoRAModelParam } from 'features/parameters/store/parameterZodSchemas';
|
import { LoRAModelParam } from 'features/parameters/store/parameterZodSchemas';
|
||||||
import { LoRAModelConfigEntity } from 'services/api/endpoints/models';
|
import { LoRAModelConfigEntity } from 'services/api/endpoints/models';
|
||||||
import { BaseModelType } from 'services/api/types';
|
|
||||||
|
|
||||||
export type Lora = {
|
export type Lora = LoRAModelParam & {
|
||||||
id: string;
|
|
||||||
base_model: BaseModelType;
|
|
||||||
name: string;
|
|
||||||
weight: number;
|
weight: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -27,8 +23,8 @@ export const loraSlice = createSlice({
|
|||||||
initialState: intialLoraState,
|
initialState: intialLoraState,
|
||||||
reducers: {
|
reducers: {
|
||||||
loraAdded: (state, action: PayloadAction<LoRAModelConfigEntity>) => {
|
loraAdded: (state, action: PayloadAction<LoRAModelConfigEntity>) => {
|
||||||
const { name, id, base_model } = action.payload;
|
const { model_name, id, base_model } = action.payload;
|
||||||
state.loras[id] = { id, name, base_model, ...defaultLoRAConfig };
|
state.loras[id] = { id, model_name, base_model, ...defaultLoRAConfig };
|
||||||
},
|
},
|
||||||
loraRemoved: (state, action: PayloadAction<string>) => {
|
loraRemoved: (state, action: PayloadAction<string>) => {
|
||||||
const id = action.payload;
|
const id = action.payload;
|
||||||
|
@ -170,7 +170,7 @@ export const isValidVaeModel = (val: unknown): val is VaeModelParam =>
|
|||||||
*/
|
*/
|
||||||
export const zLoRAModel = z.object({
|
export const zLoRAModel = z.object({
|
||||||
id: z.string(),
|
id: z.string(),
|
||||||
name: z.string(),
|
model_name: z.string(),
|
||||||
base_model: zBaseModel,
|
base_model: zBaseModel,
|
||||||
});
|
});
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user