Skip to content

Commit 5751cad

Browse files
chore(ui): lint
1 parent d9af2ab commit 5751cad

File tree

2 files changed

+2
-42
lines changed

2 files changed

+2
-42
lines changed

invokeai/frontend/web/src/features/controlLayers/store/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ const zCanvasObjectState = z.union([
232232
]);
233233
export type CanvasObjectState = z.infer<typeof zCanvasObjectState>;
234234

235-
export const zIPAdapterConfig = z.object({
235+
const zIPAdapterConfig = z.object({
236236
type: z.literal('ip_adapter'),
237237
image: zImageWithDims.nullable(),
238238
model: zModelIdentifierField.nullable(),

invokeai/frontend/web/src/features/metadata/util/modelFetchingHelpers.ts

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { getStore } from 'app/store/nanostores/store';
2-
import type { ModelIdentifierField } from 'features/nodes/types/common';
32
import { modelsApi } from 'services/api/endpoints/models';
4-
import type { AnyModelConfig, BaseModelType, ModelType } from 'services/api/types';
3+
import type { AnyModelConfig } from 'services/api/types';
54

65
/**
76
* Raised when a model config is unable to be fetched.
@@ -47,45 +46,6 @@ const fetchModelConfig = async (key: string): Promise<AnyModelConfig> => {
4746
}
4847
};
4948

50-
/**
51-
* Fetches the model config for a given model name, base model, and model type. This provides backwards compatibility
52-
* for MM1 model identifiers.
53-
* @param name The model name.
54-
* @param base The base model.
55-
* @param type The model type.
56-
* @returns A promise that resolves to the model config.
57-
* @throws {ModelConfigNotFoundError} If the model config is unable to be fetched.
58-
*/
59-
const fetchModelConfigByAttrs = async (name: string, base: BaseModelType, type: ModelType): Promise<AnyModelConfig> => {
60-
const { dispatch } = getStore();
61-
try {
62-
const req = dispatch(
63-
modelsApi.endpoints.getModelConfigByAttrs.initiate({ name, base, type }, { subscribe: false })
64-
);
65-
return await req.unwrap();
66-
} catch {
67-
throw new ModelConfigNotFoundError(`Unable to retrieve model config for name/base/type ${name}/${base}/${type}`);
68-
}
69-
};
70-
71-
/**
72-
* Fetches the model config given an identifier. First attempts to fetch by key, then falls back to fetching by attrs.
73-
* @param identifier The model identifier.
74-
* @returns A promise that resolves to the model config.
75-
* @throws {ModelConfigNotFoundError} If the model config is unable to be fetched.
76-
*/
77-
export const fetchModelConfigByIdentifier = async (identifier: ModelIdentifierField): Promise<AnyModelConfig> => {
78-
try {
79-
return await fetchModelConfig(identifier.key);
80-
} catch {
81-
try {
82-
return await fetchModelConfigByAttrs(identifier.name, identifier.base, identifier.type);
83-
} catch {
84-
throw new ModelConfigNotFoundError(`Unable to retrieve model config for identifier ${identifier}`);
85-
}
86-
}
87-
};
88-
8949
/**
9050
* Fetches the model config for a given model key and type, and ensures that the model config is of a specific type.
9151
* @param key The model key.

0 commit comments

Comments
 (0)