fix: Remove type from Model type name

This commit is contained in:
blessedcoolant 2023-06-18 19:41:30 +12:00
parent 7c9a939b47
commit 809ec7163e
3 changed files with 14 additions and 16 deletions

View File

@ -7,18 +7,17 @@ import {
import { receivedModels } from 'services/thunks/model';
export type SD1PipelineModelType = (
export type SD1PipelineModel = (
| StableDiffusion1ModelCheckpointConfig
| StableDiffusion1ModelDiffusersConfig
) & {
name: string;
};
export const sd1PipelineModelsAdapter =
createEntityAdapter<SD1PipelineModelType>({
selectId: (model) => model.name,
sortComparer: (a, b) => a.name.localeCompare(b.name),
});
export const sd1PipelineModelsAdapter = createEntityAdapter<SD1PipelineModel>({
selectId: (model) => model.name,
sortComparer: (a, b) => a.name.localeCompare(b.name),
});
export const sd1InitialPipelineModelsState =
sd1PipelineModelsAdapter.getInitialState();

View File

@ -7,18 +7,17 @@ import {
import { receivedModels } from 'services/thunks/model';
export type SD2PipelineModelType = (
export type SD2PipelineModel = (
| StableDiffusion2ModelCheckpointConfig
| StableDiffusion2ModelDiffusersConfig
) & {
name: string;
};
export const sd2PipelineModelsAdapater =
createEntityAdapter<SD2PipelineModelType>({
selectId: (model) => model.name,
sortComparer: (a, b) => a.name.localeCompare(b.name),
});
export const sd2PipelineModelsAdapater = createEntityAdapter<SD2PipelineModel>({
selectId: (model) => model.name,
sortComparer: (a, b) => a.name.localeCompare(b.name),
});
export const sd2InitialPipelineModelsState =
sd2PipelineModelsAdapater.getInitialState();

View File

@ -1,7 +1,7 @@
import { log } from 'app/logging/useLogger';
import { createAppAsyncThunk } from 'app/store/storeUtils';
import { SD1PipelineModelType } from 'features/system/store/models/sd1PipelineModelSlice';
import { SD2PipelineModelType } from 'features/system/store/models/sd2PipelineModelSlice';
import { SD1PipelineModel } from 'features/system/store/models/sd1PipelineModelSlice';
import { SD2PipelineModel } from 'features/system/store/models/sd2PipelineModelSlice';
import { reduce, size } from 'lodash-es';
import { BaseModelType, ModelType, ModelsService } from 'services/api';
@ -31,7 +31,7 @@ export const receivedModels = createAppAsyncThunk(
modelsAccumulator[modelName] = { ...model, name: modelName };
return modelsAccumulator;
},
{} as Record<string, SD1PipelineModelType>
{} as Record<string, SD1PipelineModel>
);
}
@ -42,7 +42,7 @@ export const receivedModels = createAppAsyncThunk(
modelsAccumulator[modelName] = { ...model, name: modelName };
return modelsAccumulator;
},
{} as Record<string, SD2PipelineModelType>
{} as Record<string, SD2PipelineModel>
);
}