Skip to content

AI media harness for planning, generating, and editing locally

TypeScript

Update Fast template models and steps

Bitti8711e6f22676
diff --git a/docs/generator-weights.md b/docs/generator-weights.md
index ae62740..cb8b62c 100644
--- a/docs/generator-weights.md
+++ b/docs/generator-weights.md
@@ -45,8 +45,10 @@ The bundled **First/Last Frame** (formerly **Minimax H3 Original**),
**References**, **First/Last Frame Fast**, and **Singularity** templates each download four model files. References has the same
settings, with the `minimax_h3_ref2va_pruned_int8_convrot.safetensors` transformer
in place of the First/Last Frame `minimax_h3_fl2va_pruned_int8_convrot.safetensors`.
-First/Last Frame Fast uses `minimax_h3_fl2va_fasth3_dense_pruned_int8_convrot.safetensors`
-and defaults to **6 steps**; its other settings are identical. First/Last Frame and
+First/Last Frame Fast uses `fastvideo_fasth3_8step_v2_pruned_int8_convrot.safetensors`
+and `minimax_h3_video_vae_int8_convrot.safetensors`, and defaults to **8 steps**.
+Existing Fast templates receive the updated URLs and step default once, preserving custom settings.
+First/Last Frame and
References default to 20 steps.
Singularity defaults to **4 steps** and uses
[Minimax-h3_Singularity_ref2va_Pruned_v1.3_int8.safetensors](https://huggingface.co/WarmBloodAban/Minimax-h3_Singularity/blob/main/Minimax-h3_Singularity_ref2va_Pruned_v1.3_int8.safetensors)
diff --git a/src/lib/settings.test.ts b/src/lib/settings.test.ts
index 53105f7..bd2e95f 100644
--- a/src/lib/settings.test.ts
+++ b/src/lib/settings.test.ts
@@ -114,7 +114,7 @@ describe("generator templates", () => {
expect(settings.templates[2]).toEqual(minimaxFastTemplate());
expect(settings.templates[3]).toEqual(minimaxSingularityTemplate());
expect(settings.defaultTemplateId).toBe(template.id);
- expect(settings.catalogVersion).toBe(8);
+ expect(settings.catalogVersion).toBe(9);
expect(loadGeneratorTemplateSettings()).toEqual(settings);
saveGeneratorTemplateSettings({ ...settings, templates: [settings.templates[0]] });
expect(loadGeneratorTemplateSettings().templates).toHaveLength(1);
@@ -135,7 +135,7 @@ describe("generator templates", () => {
const settings = loadGeneratorTemplateSettings();
expect(settings.templates).toEqual([expect.objectContaining(custom), minimaxSingularityTemplate(), viggleAnimateTemplate()]);
expect(settings.defaultTemplateId).toBe(custom.id);
- expect(settings.catalogVersion).toBe(8);
+ expect(settings.catalogVersion).toBe(9);
expect(loadGeneratorTemplateSettings()).toEqual(settings);
saveGeneratorTemplateSettings({ ...settings, templates: [custom] });
expect(loadGeneratorTemplateSettings().templates).toEqual([expect.objectContaining(custom)]);
@@ -170,16 +170,53 @@ describe("generator templates", () => {
expect(loadGeneratorTemplateSettings().templates).toEqual([template, viggleAnimateTemplate()]);
});
- it("adds First/Last Frame Fast with six steps and its transformer URL", () => {
+ it("adds First/Last Frame Fast with eight steps and its model URLs", () => {
const original = minimaxOriginalTemplate();
const fast = minimaxFastTemplate();
- const transformer = "https://huggingface.co/datasets/jacokon/fasth3-live/resolve/main/minimax_h3_fl2va_fasth3_dense_pruned_int8_convrot.safetensors";
- expect(fast).toEqual({ ...original, id: "minimax-h3-fast", name: "First/Last Frame Fast", defaultSteps: 6,
- paths: { ...original.paths, transformer },
- sources: { ...original.sources, transformer: [{ ...original.sources!.transformer![0], url: transformer }, original.sources!.transformer![1]] },
+ const transformer = "https://huggingface.co/FastVideo/FastVideo-FastH3-Comfy/resolve/main/diffusion_models/fastvideo_fasth3_8step_v2_pruned_int8_convrot.safetensors";
+ const videoVae = "https://huggingface.co/Comfy-Org/MiniMax-H3/blob/main/vae/minimax_h3_video_vae_int8_convrot.safetensors";
+ expect(fast).toEqual({ ...original, id: "minimax-h3-fast", name: "First/Last Frame Fast", defaultSteps: 8,
+ paths: { ...original.paths, transformer, videoVae },
+ sources: { ...original.sources, transformer: [{ ...original.sources!.transformer![0], url: transformer }, original.sources!.transformer![1]],
+ videoVae: [{ url: videoVae, gpuModel: "", minVramGb: 0 }] },
});
saveGeneratorTemplateSettings({ templates: [fast], defaultTemplateId: "", catalogVersion: 4 });
- expect(loadGeneratorTemplateSettings().templates[0].defaultSteps).toBe(6);
+ expect(loadGeneratorTemplateSettings().templates[0].defaultSteps).toBe(8);
+ });
+
+ it.each([false, true])("upgrades saved Fast model URLs and invalidates old downloads: %s", (downloaded) => {
+ const template = minimaxFastTemplate();
+ template.defaultSteps = 6;
+ const oldUrls = {
+ transformer: "https://huggingface.co/datasets/jacokon/fasth3-live/resolve/main/minimax_h3_fl2va_fasth3_dense_pruned_int8_convrot.safetensors",
+ videoVae: minimaxOriginalTemplate().paths.videoVae.replace("/blob/", "/resolve/"),
+ };
+ for (const field of ["transformer", "videoVae"] as const) {
+ const downloadedPath = `D:/Models/old-${field}.safetensors`;
+ template.paths[field] = downloaded ? downloadedPath : oldUrls[field];
+ template.sources![field]![0] = { ...template.sources![field]![0], url: oldUrls[field],
+ ...(downloaded ? { downloadedPath } : {}) };
+ }
+ localStorage.setItem("slopus.generator-templates.v1", JSON.stringify({ templates: [template], catalogVersion: 8 }));
+ const settings = loadGeneratorTemplateSettings();
+ expect(settings.templates).toEqual([minimaxFastTemplate()]);
+ expect(settings.catalogVersion).toBe(9);
+ expect(templateNeedsDownload(settings.templates[0])).toBe(true);
+ expect(loadGeneratorTemplateSettings()).toEqual(settings);
+ });
+
+ it("preserves customized Fast models and steps, and does not restore a removed template", () => {
+ const template = minimaxFastTemplate();
+ template.defaultSteps = 12;
+ template.paths.transformer = "D:/Models/custom-transformer.safetensors";
+ template.paths.videoVae = "https://example.com/custom-vae.safetensors";
+ template.sources = { ...template.sources, videoVae: [{ url: template.paths.videoVae, gpuModel: "", minVramGb: 0 }] };
+ delete template.sources.transformer;
+ localStorage.setItem("slopus.generator-templates.v1", JSON.stringify({ templates: [template], catalogVersion: 8 }));
+ expect(loadGeneratorTemplateSettings().templates).toEqual([template]);
+ const original = minimaxOriginalTemplate();
+ localStorage.setItem("slopus.generator-templates.v1", JSON.stringify({ templates: [original], catalogVersion: 8 }));
+ expect(loadGeneratorTemplateSettings().templates).toEqual([original]);
});
it.each(["textEncoder", "transformer"] as const)("upgrades saved Minimax %s variants once and preserves downloaded weights", (field) => {
@@ -189,7 +226,7 @@ describe("generator templates", () => {
template.paths[field] = downloadedPath;
localStorage.setItem("slopus.generator-templates.v1", JSON.stringify({ templates: [template], catalogVersion: 1 }));
const settings = loadGeneratorTemplateSettings();
- expect(settings.catalogVersion).toBe(8);
+ expect(settings.catalogVersion).toBe(9);
expect(settings.templates[0].paths[field]).toBe(downloadedPath);
expect(settings.templates[0].sources![field]).toEqual(minimaxOriginalTemplate().sources![field]!.map((source, index) =>
index === 0 ? { ...source, downloadedPath } : source));
@@ -224,7 +261,7 @@ describe("generator templates", () => {
localStorage.setItem("slopus.generator-templates.v1", JSON.stringify({ templates: [template], defaultTemplateId: template.id, catalogVersion: 2 }));
const settings = loadGeneratorTemplateSettings();
const migrated = settings.templates[0];
- expect(settings.catalogVersion).toBe(8);
+ expect(settings.catalogVersion).toBe(9);
expect(migrated.sources!.textEncoder).toEqual([
{ url: originalUrl, gpuModel: "", minVramGb: 0, ...(selection === "cached original" ? { downloadedPath: cachedOriginal } : {}) },
custom,
diff --git a/src/lib/settings.ts b/src/lib/settings.ts
index e735896..710023b 100644
--- a/src/lib/settings.ts
+++ b/src/lib/settings.ts
@@ -204,8 +204,13 @@ export function minimaxReferencesTemplate(): GeneratorTemplate {
}
export function minimaxFastTemplate(): GeneratorTemplate {
- return minimaxVariantTemplate("minimax-h3-fast", "First/Last Frame Fast",
- "https://huggingface.co/datasets/jacokon/fasth3-live/resolve/main/minimax_h3_fl2va_fasth3_dense_pruned_int8_convrot.safetensors", 6);
+ const template = minimaxVariantTemplate("minimax-h3-fast", "First/Last Frame Fast",
+ "https://huggingface.co/FastVideo/FastVideo-FastH3-Comfy/resolve/main/diffusion_models/fastvideo_fasth3_8step_v2_pruned_int8_convrot.safetensors", 8);
+ const videoVae = "https://huggingface.co/Comfy-Org/MiniMax-H3/blob/main/vae/minimax_h3_video_vae_int8_convrot.safetensors";
+ return { ...template,
+ paths: { ...template.paths, videoVae },
+ sources: { ...template.sources, videoVae: [{ url: videoVae, gpuModel: "", minVramGb: 0 }] },
+ };
}
export function minimaxSingularityTemplate(): GeneratorTemplate {
@@ -232,7 +237,7 @@ export function viggleAnimateTemplate(): GeneratorTemplate {
const initialTemplateSettings = (paths = EMPTY_ENGINE_SETTINGS): GeneratorTemplateSettings => ({
templates: [{ id: "default", name: "Default", defaultSteps: DEFAULT_GENERATION_STEPS, attention: "sage2", paths: copyPaths(paths) }, minimaxOriginalTemplate(), minimaxReferencesTemplate(), minimaxFastTemplate(), minimaxSingularityTemplate(), viggleAnimateTemplate()],
defaultTemplateId: "default",
- catalogVersion: 8,
+ catalogVersion: 9,
});
const normalizeTemplateSettings = (value: unknown): GeneratorTemplateSettings | null => {
@@ -290,7 +295,7 @@ const normalizeTemplateSettings = (value: unknown): GeneratorTemplateSettings |
templates,
defaultTemplateId: templates.find((template) => template.id === requestedDefault && !templateNeedsDownload(template))?.id
?? templates.find((template) => !templateNeedsDownload(template))?.id ?? "",
- catalogVersion: typeof record.catalogVersion === "number" && [1, 2, 3, 4, 5, 6, 7, 8].includes(record.catalogVersion) ? record.catalogVersion : 0,
+ catalogVersion: typeof record.catalogVersion === "number" && [1, 2, 3, 4, 5, 6, 7, 8, 9].includes(record.catalogVersion) ? record.catalogVersion : 0,
};
};
@@ -376,6 +381,34 @@ export function loadGeneratorTemplateSettings(): GeneratorTemplateSettings {
normalized = normalizeTemplateSettings({ ...normalized, catalogVersion: 8 })!;
localStorage.setItem(GENERATOR_TEMPLATES_KEY, JSON.stringify(normalized));
}
+ if ((normalized.catalogVersion ?? 0) < 9) {
+ const fast = normalized.templates.find(({ id }) => id === "minimax-h3-fast");
+ if (fast) {
+ const bundled = minimaxFastTemplate();
+ const oldUrls = {
+ transformer: "https://huggingface.co/datasets/jacokon/fasth3-live/resolve/main/minimax_h3_fl2va_fasth3_dense_pruned_int8_convrot.safetensors",
+ videoVae: minimaxOriginalTemplate().paths.videoVae,
+ };
+ for (const field of ["transformer", "videoVae"] as const) {
+ const matchesOldUrl = (url: string) => url.replace("/blob/", "/resolve/") === oldUrls[field].replace("/blob/", "/resolve/");
+ const sources = fast.sources?.[field];
+ if (matchesOldUrl(fast.paths[field]) || sources?.some((source) => matchesOldUrl(source.url)
+ && source.downloadedPath === fast.paths[field])) {
+ fast.paths[field] = bundled.paths[field];
+ }
+ if (sources) {
+ fast.sources![field] = sources.map((source) => {
+ if (!matchesOldUrl(source.url)) return source;
+ const { downloadedPath: _downloadedPath, ...updated } = source;
+ return { ...updated, url: bundled.paths[field] };
+ });
+ }
+ }
+ if (fast.defaultSteps === 6) fast.defaultSteps = bundled.defaultSteps;
+ }
+ normalized = normalizeTemplateSettings({ ...normalized, catalogVersion: 9 })!;
+ localStorage.setItem(GENERATOR_TEMPLATES_KEY, JSON.stringify(normalized));
+ }
return normalized;
}
}
diff --git a/src/lib/weightDownloads.test.ts b/src/lib/weightDownloads.test.ts
index f1bf76c..fa7b129 100644
--- a/src/lib/weightDownloads.test.ts
+++ b/src/lib/weightDownloads.test.ts
@@ -238,14 +238,17 @@ it.each([12, 20, 24])("downloads the References transformer for %s GiB of VRAM",
expect(templateNeedsDownload(loadGeneratorTemplateSettings().templates.find(({ id }) => id === "minimax-h3-references")!)).toBe(false);
});
-it("downloads the fast transformer and retains its six-step default", async () => {
+it("downloads the fast transformer and video VAE and retains its eight-step default", async () => {
await downloadTemplateWeights("minimax-h3-fast");
expect(getWeightDownloadState()).toMatchObject({ active: false, completed: 4, error: null });
expect(invoke).toHaveBeenCalledWith("download_weight", expect.objectContaining({
- url: "https://huggingface.co/datasets/jacokon/fasth3-live/resolve/main/minimax_h3_fl2va_fasth3_dense_pruned_int8_convrot.safetensors",
+ url: "https://huggingface.co/FastVideo/FastVideo-FastH3-Comfy/resolve/main/diffusion_models/fastvideo_fasth3_8step_v2_pruned_int8_convrot.safetensors",
+ }));
+ expect(invoke).toHaveBeenCalledWith("download_weight", expect.objectContaining({
+ url: "https://huggingface.co/Comfy-Org/MiniMax-H3/blob/main/vae/minimax_h3_video_vae_int8_convrot.safetensors",
}));
const template = loadGeneratorTemplateSettings().templates.find(({ id }) => id === "minimax-h3-fast")!;
- expect(template.defaultSteps).toBe(6);
+ expect(template.defaultSteps).toBe(8);
expect(templateNeedsDownload(template)).toBe(false);
});