Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui): initial main model in dropdown #5968

Merged
merged 1 commit into from
Mar 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,13 @@ const handleMainModels: ModelHandler = (models, state, dispatch, log) => {
return;
}

const isCurrentMainModelAvailable = currentModel ? models.some((m) => m.key === currentModel.key) : false;

const isCurrentMainModelAvailable = currentModel ? mainModels.some((m) => m.key === currentModel.key) : false;
if (isCurrentMainModelAvailable) {
return;
}

const defaultModel = state.config.sd.defaultModel;
const defaultModelInList = defaultModel ? models.find((m) => m.key === defaultModel) : false;
const defaultModelInList = defaultModel ? mainModels.find((m) => m.key === defaultModel) : false;

if (defaultModelInList) {
const result = zParameterModel.safeParse(defaultModelInList);
Expand All @@ -84,7 +83,7 @@ const handleMainModels: ModelHandler = (models, state, dispatch, log) => {
}
}

const result = zParameterModel.safeParse(models[0]);
const result = zParameterModel.safeParse(mainModels[0]);

if (!result.success) {
log.error({ error: result.error.format() }, 'Failed to parse main model');
Expand Down
Loading