From 300f261d3518e9c7d43cfcb63ac5d19dd0b832a3 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Wed, 1 Jul 2026 06:04:37 +0000 Subject: [PATCH] Studio Images: load non-curated unsloth/on-device diffusers repos instead of no-op handleModelSelect only loaded curated safetensors ids and GGUF variant picks; any other non-GGUF pick (an on-device diffusers folder, or a future unsloth diffusers image repo surfaced by search) silently did nothing. Treat such a pick as a full diffusers pipeline load when the id is unsloth-hosted or on-device (the backend infers the family + base repo and gates loads to unsloth/* or local paths), and show a clear message otherwise instead of silently ignoring the click. Curated and GGUF paths are unchanged. --- .../src/features/images/images-page.tsx | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/studio/frontend/src/features/images/images-page.tsx b/studio/frontend/src/features/images/images-page.tsx index 47f3f84c67..b473c8d737 100644 --- a/studio/frontend/src/features/images/images-page.tsx +++ b/studio/frontend/src/features/images/images-page.tsx @@ -1192,12 +1192,29 @@ export function ImagesPage() { void handleLoad(id, { kind: spec.kind, filename: spec.filename }); return; } - if (!meta.ggufVariant || !meta.ggufFilename) return; // not a quant pick - setQuant(meta.ggufVariant); + // GGUF quant pick from the variant expander. + if (meta.ggufVariant && meta.ggufFilename) { + setQuant(meta.ggufVariant); + const dq = defaultsFor(id); + setSteps(dq.steps); + setGuidance(dq.guidance); + void handleLoad(id, { kind: "gguf", filename: meta.ggufFilename }); + return; + } + // A direct local .gguf file picked without a variant isn't wired for Images. + if (meta.isGguf) return; + // Otherwise treat it as a full diffusers repo (safetensors / bnb-4bit). The backend + // infers the family + base repo from the id and gates loads to unsloth/* repos or + // on-device paths, so only attempt those; other Hub orgs can't be assembled here. + if (meta.source !== "local" && !id.toLowerCase().startsWith("unsloth/")) { + toast.error("Only unsloth or on-device image models can be loaded here"); + return; + } + setQuant(null); const d = defaultsFor(id); setSteps(d.steps); setGuidance(d.guidance); - void handleLoad(id, { kind: "gguf", filename: meta.ggufFilename }); + void handleLoad(id, { kind: "pipeline" }); }, [handleLoad], );