mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): log model load events
- Fix types - Fix logging in listener
This commit is contained in:
parent
ef55077e84
commit
328dc99f3a
invokeai/frontend/web/src
@ -8,14 +8,16 @@ export const addModelLoadEventListener = (startAppListening: AppStartListening)
|
|||||||
startAppListening({
|
startAppListening({
|
||||||
actionCreator: socketModelLoadStarted,
|
actionCreator: socketModelLoadStarted,
|
||||||
effect: (action) => {
|
effect: (action) => {
|
||||||
const { base_model, model_name, model_type, submodel } = action.payload.data;
|
const { model_config, submodel_type } = action.payload.data;
|
||||||
|
const { name, base, type } = model_config;
|
||||||
|
|
||||||
let message = `Model load started: ${base_model}/${model_type}/${model_name}`;
|
const extras: string[] = [base, type];
|
||||||
|
if (submodel_type) {
|
||||||
if (submodel) {
|
extras.push(submodel_type);
|
||||||
message = message.concat(`/${submodel}`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const message = `Model load started: ${name} (${extras.join(', ')})`;
|
||||||
|
|
||||||
log.debug(action.payload, message);
|
log.debug(action.payload, message);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@ -23,14 +25,16 @@ export const addModelLoadEventListener = (startAppListening: AppStartListening)
|
|||||||
startAppListening({
|
startAppListening({
|
||||||
actionCreator: socketModelLoadCompleted,
|
actionCreator: socketModelLoadCompleted,
|
||||||
effect: (action) => {
|
effect: (action) => {
|
||||||
const { base_model, model_name, model_type, submodel } = action.payload.data;
|
const { model_config, submodel_type } = action.payload.data;
|
||||||
|
const { name, base, type } = model_config;
|
||||||
|
|
||||||
let message = `Model load complete: ${base_model}/${model_type}/${model_name}`;
|
const extras: string[] = [base, type];
|
||||||
|
if (submodel_type) {
|
||||||
if (submodel) {
|
extras.push(submodel_type);
|
||||||
message = message.concat(`/${submodel}`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const message = `Model load complete: ${name} (${extras.join(', ')})`;
|
||||||
|
|
||||||
log.debug(action.payload, message);
|
log.debug(action.payload, message);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import type { components } from 'services/api/schema';
|
import type { components } from 'services/api/schema';
|
||||||
import type { BaseModelType, Graph, GraphExecutionState, ModelType, SubModelType } from 'services/api/types';
|
import type { AnyModelConfig, Graph, GraphExecutionState, SubModelType } from 'services/api/types';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A progress image, we get one for each step in the generation
|
* A progress image, we get one for each step in the generation
|
||||||
@ -25,10 +25,8 @@ export type ModelLoadStartedEvent = {
|
|||||||
queue_item_id: number;
|
queue_item_id: number;
|
||||||
queue_batch_id: string;
|
queue_batch_id: string;
|
||||||
graph_execution_state_id: string;
|
graph_execution_state_id: string;
|
||||||
model_name: string;
|
model_config: AnyModelConfig;
|
||||||
base_model: BaseModelType;
|
submodel_type?: SubModelType | null;
|
||||||
model_type: ModelType;
|
|
||||||
submodel: SubModelType;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ModelLoadCompletedEvent = {
|
export type ModelLoadCompletedEvent = {
|
||||||
@ -36,13 +34,8 @@ export type ModelLoadCompletedEvent = {
|
|||||||
queue_item_id: number;
|
queue_item_id: number;
|
||||||
queue_batch_id: string;
|
queue_batch_id: string;
|
||||||
graph_execution_state_id: string;
|
graph_execution_state_id: string;
|
||||||
model_name: string;
|
model_config: AnyModelConfig;
|
||||||
base_model: BaseModelType;
|
submodel_type?: SubModelType | null;
|
||||||
model_type: ModelType;
|
|
||||||
submodel: SubModelType;
|
|
||||||
hash?: string;
|
|
||||||
location: string;
|
|
||||||
precision: string;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ModelInstallDownloadingEvent = {
|
export type ModelInstallDownloadingEvent = {
|
||||||
|
Loading…
Reference in New Issue
Block a user