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