From c846c9896ac7b7c092631fb769dd3ba00bd67a58 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Wed, 1 Jul 2026 09:29:51 +0000 Subject: [PATCH] Studio: hide single-file image checkpoints from the chat model picker The chat picker treats a cached repo as an image model, and hides it, only when it ships a diffusers model_index.json. Single-file, ComfyUI, and ControlNet image checkpoints (an FP8 Qwen-Image, a z-image safetensors, a Qwen-Image ControlNet) carry none, so they surfaced as loadable chat models. Fall back to resolving the repo id against the known diffusion families, the same resolver the Images backend loads from, so these checkpoints are tagged text-to-image and stay in the Images picker only. --- studio/backend/routes/models.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/studio/backend/routes/models.py b/studio/backend/routes/models.py index 98073231ff..1d7c509796 100644 --- a/studio/backend/routes/models.py +++ b/studio/backend/routes/models.py @@ -3185,9 +3185,15 @@ async def list_cached_gguf(current_subject: str = Depends(get_current_subject)): def _repo_is_diffusers(repo_info) -> bool: - """A diffusers pipeline repo (e.g. a Z-Image / FLUX base) carries a top-level - model_index.json. These render images rather than chat, so the chat picker - hides them — mirroring how cached diffusion GGUFs are classified by arch.""" + """True for an image-diffusion repo, so the chat picker hides it (it renders + images, not chat) and the Images picker claims it — mirroring how cached + diffusion GGUFs are classified by arch. + + Two signals: a full diffusers pipeline carries a top-level model_index.json, + while single-file / ComfyUI / ControlNet image checkpoints (e.g. an FP8 + Qwen-Image or a z-image .safetensors) ship none. For those, fall back to the + repo id resolving to a known diffusion family — the same resolver the Images + backend loads from — so they don't surface as loadable chat models.""" try: for rev in repo_info.revisions: for f in rev.files: @@ -3195,6 +3201,13 @@ def _repo_is_diffusers(repo_info) -> bool: return True except Exception: pass + try: + from core.inference.diffusion_families import detect_family + + if detect_family(getattr(repo_info, "repo_id", "") or "") is not None: + return True + except Exception: + pass return False