Skip to content

AI media harness for planning, generating, and editing locally

TypeScript

Sort generator models by media type and name

Bitti4d963823f63d
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index a33f811..f3ec99f 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -42,6 +42,7 @@ Changes since 0.3.2.
## Fixes and improvements
+- Settings lists video generator models first, then image models, then music models, alphabetically within each category.
- Local image edits on larger originals use the selected resolution as the maximum rectangle or lasso size. Each crop is merged back into the original-sized image, preserving pixels outside the selected area. Requires updated workers.
- Krea 2 and other generators without LoRA support no longer inherit adapters from the default generator when their own adapter list is omitted.
- Single Shot without Context video applies Tone once across the assembled main clip and ending, avoiding separate grading of its temporary ending. Retained Previous video frames are preserved. Requires updated workers.
diff --git a/src/components/SettingsView.test.tsx b/src/components/SettingsView.test.tsx
index 5959901..a54da15 100644
--- a/src/components/SettingsView.test.tsx
+++ b/src/components/SettingsView.test.tsx
@@ -91,7 +91,7 @@ describe("the settings screen", () => {
saveLoras([{ id: "future-adapter", name: "MOSS adapter", modelType: "moss", path: "D:/moss-adapter.safetensors" }]);
open(null);
const models = screen.getByRole("list", { name: "Generator models" });
- expect(within(models).getAllByRole("button").map((button) => button.getAttribute("aria-label"))).toEqual(["MiniMax H3", "MOSS", "Fibo 2.0", "YuE2", "MiniMax Music3", "Krea 2", "Other"]);
+ expect(within(models).getAllByRole("button").map((button) => button.getAttribute("aria-label"))).toEqual(["MiniMax H3", "Fibo 2.0", "Krea 2", "MOSS", "MiniMax Music3", "YuE2", "Other"]);
expect(screen.queryByRole("button", { name: "Edit Default generator" })).toBeNull();
fireEvent.click(within(models).getByRole("button", { name: "MiniMax H3" }));
expect(screen.getByRole("button", { name: "Edit Default generator" })).toBeTruthy();
diff --git a/src/components/SettingsView.tsx b/src/components/SettingsView.tsx
index 0edcb34..6faa5f1 100644
--- a/src/components/SettingsView.tsx
+++ b/src/components/SettingsView.tsx
@@ -286,6 +286,10 @@ const engineSeverity = (status: SlopfabStatus | null, desktop: boolean): InfoBar
groups of one-setting-per-row cards. */
export interface SettingsNavigation { templateId: string; loraId?: string; otherWeightId?: string }
const modelPageLabel = (model: string) => model === "other" ? "Other" : model === MOSS_MODEL_TYPE ? "MOSS" : GENERATOR_MODELS.find(({ value }) => value === model)?.label ?? model;
+const modelPageOrder = (id: string) => {
+ const model = GENERATOR_MODELS.find(({ value }) => value === id);
+ return model?.videoGeneration ? 0 : model?.musicGeneration ? 2 : model?.imageGeneration ? 1 : 3;
+};
export function SettingsView({ onClose, updates, initialTab = "engine", titleBarActions, navigation, providers = CHECKING_PROVIDERS }: {
onClose: () => void; updates?: ReactNode; initialTab?: TabId;
@@ -678,12 +682,14 @@ export function SettingsView({ onClose, updates, initialTab = "engine", titleBar
]} />}
</>;
+ const modelPages = [...new Set([...GENERATOR_MODELS.map(({ value }) => value), ...templateSettings.templates.map(({ modelType }) => modelType)])]
+ .sort((a, b) => modelPageOrder(a) - modelPageOrder(b) || modelPageLabel(a).localeCompare(modelPageLabel(b)));
const generatorList = <>
{downloadStatus}
{modelPage === null ? <>
<SettingsGroup heading="Models">
<div className="settings-card-list" role="list" aria-label="Generator models">
- {[...new Set([...GENERATOR_MODELS.map(({ value }) => value), ...templateSettings.templates.map(({ modelType }) => modelType)]), "other"].map((model) =>
+ {[...modelPages, "other"].map((model) =>
<OpenableCard key={model} icon={model === "other" ? <ModelFile20 /> : generatorModel(model).musicGeneration ? <Audio22 /> : !generatorModel(model).videoGeneration ? <Image20 /> : <Video20 />} header={modelPageLabel(model)}
openLabel={modelPageLabel(model)} openRef={`model:${model}`} description={model === "other" ? "Other weights" : "Generators and LoRAs"} onOpen={() => setModelPage(model)} />)}
</div>