AI media harness for planning, generating, and editing locally
TypeScript
Add Turbo LoRA
Bitti81abe8c4d9ef
diff --git a/docs/generator-weights.md b/docs/generator-weights.mdindex 6b684dc..f59c2e8 100644--- a/docs/generator-weights.md+++ b/docs/generator-weights.md@@ -4,7 +4,9 @@Settings → Generators includes a separate **LoRAs** library. **TaoMate 3-Step**downloads [TaoMate-H3-3step-ComfyUI.safetensors](https://huggingface.co/CZMartin22/TaoMate-H3-3step-ComfyUI/resolve/main/TaoMate-H3-3step-ComfyUI.safetensors).-It uses the same managed `weights` location, background transfer, progress,+**Turbo** downloads [minimax_h3_ref2v_turbo_4step_v0.1_comfyui_bf16.safetensors](https://huggingface.co/lightx2v/Minimax-h3-Turbo/resolve/main/minimax_h3_ref2v_turbo_4step_v0.1_comfyui_bf16.safetensors)+and defaults to an editable **4-step override**.+Both use the same managed `weights` location, background transfer, progress,cancellation, retry, and Work Queue controls as model weights. Downloads areserialized with weight downloads, and video generation can continue while downloading.Missing managed files become downloadable again. Removing a downloaded LoRAdiff --git a/src/lib/loras.test.ts b/src/lib/loras.test.tsindex 54b8cc2..aa10f00 100644--- a/src/lib/loras.test.ts+++ b/src/lib/loras.test.ts@@ -1,6 +1,6 @@// @vitest-environment jsdomimport { beforeEach, expect, it } from "vitest";-import { loadLoras, saveLoras, TAOMATE_LORA } from "./loras";+import { loadLoras, saveLoras, TAOMATE_LORA, TURBO_LORA } from "./loras";import { createGeneratorTemplate, engineProviderSetting, generationStepsWithLoras, loadGeneratorTemplateSettings, saveGeneratorTemplateSettings, withEngineSettings } from "./settings";import { createProjectConfig } from "./project";@@ -40,10 +40,10 @@ it.each([0, 1, -3, 2.5, NaN, Infinity, 2147483648])("rejects invalid step overriexpect(() => saveLoras([{ id: "bad", name: "Bad", path: "D:/bad.safetensors", stepOverride }])).toThrow("Step override must be a whole number");});-it("starts with only TaoMate and preserves the local library", () => {- expect(loadLoras()).toEqual([TAOMATE_LORA]);+it("starts with TaoMate and Turbo and preserves the local library", () => {+ expect(loadLoras()).toEqual([TAOMATE_LORA, TURBO_LORA]);saveLoras([{ ...TAOMATE_LORA, path: "C:/weights/TaoMate.safetensors" }, { id: "style", name: "Style", path: "D:/style.safetensors" }]);- expect(loadLoras().map(({ name }) => name)).toEqual(["TaoMate 3-Step", "Style"]);+ expect(loadLoras().map(({ name }) => name)).toEqual(["TaoMate 3-Step", "Style", "Turbo"]);});it("round-trips template order, enabled flags and strengths, and sends only active adapters", () => {diff --git a/src/lib/loras.ts b/src/lib/loras.tsindex 70bdc4f..788bf75 100644--- a/src/lib/loras.ts+++ b/src/lib/loras.ts@@ -14,6 +14,11 @@ export const TAOMATE_LORA: Lora = {url: "https://huggingface.co/CZMartin22/TaoMate-H3-3step-ComfyUI/resolve/main/TaoMate-H3-3step-ComfyUI.safetensors",stepOverride: 3,};+export const TURBO_LORA: Lora = {+ id: "turbo-4step", name: "Turbo", path: "",+ url: "https://huggingface.co/lightx2v/Minimax-h3-Turbo/resolve/main/minimax_h3_ref2v_turbo_4step_v0.1_comfyui_bf16.safetensors",+ stepOverride: 4,+};const KEY = "slopus.loras.v1";const EVENT = "slopus:loras-changed";export function loadLoras(): Lora[] {@@ -30,8 +35,9 @@ export function loadLoras(): Lora[] {: entry.stepOverride === undefined && entry.schedule === "taomate-3step" ? { stepOverride: 3 } : {}) }];}) : [];if (!ids.has(TAOMATE_LORA.id)) entries.unshift({ ...TAOMATE_LORA });+ if (!ids.has(TURBO_LORA.id)) entries.push({ ...TURBO_LORA });return entries;- } catch { return [{ ...TAOMATE_LORA }]; }+ } catch { return [{ ...TAOMATE_LORA }, { ...TURBO_LORA }]; }}export function saveLoras(loras: Lora[]): void {if (loras.some((lora) => lora.stepOverride !== undefined && !isLoraStepOverride(lora.stepOverride))) {diff --git a/src/lib/weightDownloads.test.ts b/src/lib/weightDownloads.test.tsindex c7b9be9..e67fcbe 100644--- a/src/lib/weightDownloads.test.ts+++ b/src/lib/weightDownloads.test.ts@@ -1,7 +1,7 @@// @vitest-environment jsdomimport { invoke } from "@tauri-apps/api/core";import { downloadLora, removeLora, refreshDownloadedLoras, retryWeightDownload } from "./weightDownloads";-import { loadLoras, saveLoras, TAOMATE_LORA } from "./loras";+import { loadLoras, saveLoras, TAOMATE_LORA, TURBO_LORA } from "./loras";import { beforeEach, expect, it, vi } from "vitest";import { chooseWeightSource, downloadTemplateWeights, getWeightDownloadState, refreshDownloadedWeights, removeTemplateWeights, updateWeightPath, weightDownloadProgress, type DownloadState } from "./weightDownloads";import { createGeneratorTemplate, defaultGeneratorTemplate, isDownloadUrl, loadGeneratorTemplateSettings, minimaxOriginalTemplate, saveGeneratorTemplateSettings, templateNeedsDownload, type WeightSource } from "./settings";@@ -13,18 +13,20 @@ const files = new Set<string>();const source = (url: string, gpuModel = "", minVramGb = 0): WeightSource => ({ url, gpuModel, minVramGb });const saved = () => loadGeneratorTemplateSettings().templates.find((template) => template.id === "minimax-h3-original")!;-it("downloads LoRAs through the weight transfer and restores missing downloads", async () => {- await downloadLora(TAOMATE_LORA.id);- expect(invoke).toHaveBeenCalledWith("download_weight", { requestId: expect.any(String), url: TAOMATE_LORA.url });- expect(loadLoras()[0].path).toContain("TaoMate-H3-3step-ComfyUI.safetensors");- expect(getWeightDownloadState()).toMatchObject({ loraId: TAOMATE_LORA.id, active: false, completed: 1, error: null });+it.each([TAOMATE_LORA, TURBO_LORA])("downloads $name through the weight transfer and restores missing downloads", async (lora) => {+ const savedLora = () => loadLoras().find(({ id }) => id === lora.id)!;+ await downloadLora(lora.id);+ expect(invoke).toHaveBeenCalledWith("download_weight", { requestId: expect.any(String), url: lora.url });+ const path = `C:/Slopus/weights/${lora.url!.split('/').at(-1)}`;+ expect(savedLora()).toMatchObject({ path, stepOverride: lora.stepOverride });+ expect(getWeightDownloadState()).toMatchObject({ loraId: lora.id, active: false, completed: 1, error: null });files.clear();await refreshDownloadedLoras();- expect(loadLoras()[0].path).toBe("");- await downloadLora(TAOMATE_LORA.id);- await removeLora(TAOMATE_LORA.id);- expect(invoke).toHaveBeenCalledWith("remove_downloaded_weights", { paths: [expect.stringContaining("TaoMate")] });- expect(loadLoras()[0].path).toBe("");+ expect(savedLora().path).toBe("");+ await downloadLora(lora.id);+ await removeLora(lora.id);+ expect(invoke).toHaveBeenCalledWith("remove_downloaded_weights", { paths: [path] });+ expect(savedLora().path).toBe("");});it("removes manually added adapters without deleting the user's file", async () => {