Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Select the klein row by the label the image picker actually renders (#8387)

Daniel Han458884840368
diff --git a/tests/studio/playwright_image_download_cancel_retry.py b/tests/studio/playwright_image_download_cancel_retry.py
index 6958855dcac..4d8e6ab9fca 100644
--- a/tests/studio/playwright_image_download_cancel_retry.py
+++ b/tests/studio/playwright_image_download_cancel_retry.py
@@ -31,6 +31,7 @@ from playwright_image_model_footprint import (
REQUIRED_BYTES,
_api_payload,
_json,
+ klein_row,
)
@@ -89,7 +90,7 @@ def _open_quant(page, *, navigate: bool) -> None:
trigger = page.get_by_role("button", name = "Select image model")
trigger.wait_for(state = "visible", timeout = 30_000)
trigger.click()
- page.get_by_text("FLUX.2-klein-4B-GGUF", exact = True).click()
+ klein_row(page).click()
gguf = page.get_by_text("GGUF", exact = True)
if gguf.count() == 1:
gguf.click()
diff --git a/tests/studio/playwright_image_model_footprint.py b/tests/studio/playwright_image_model_footprint.py
index 696cbaf6b2b..3f8efdd0d3a 100644
--- a/tests/studio/playwright_image_model_footprint.py
+++ b/tests/studio/playwright_image_model_footprint.py
@@ -9,6 +9,7 @@ live Hugging Face metadata.
"""
import os
+import re
from pathlib import Path
from urllib.parse import parse_qs, urlparse
@@ -24,6 +25,11 @@ COMPANION_BYTES = 8_200_000_000
REQUIRED_BYTES = CHECKPOINT_BYTES + COMPANION_BYTES
REPO_ID = "unsloth/FLUX.2-klein-4B-GGUF"
FILENAME = "FLUX.2-klein-4B-Q4_K_M.gguf"
+# The row is labelled by the catalogue's displayName ("FLUX.2 klein 4B"), not by the
+# artifact repo id. Matching the id exactly waited 30 s for text the picker never
+# renders. This test is about the footprint the row reports, not about its wording,
+# so accept either spelling and let a genuinely missing row still fail.
+KLEIN_ROW = re.compile(r"FLUX\.2[\s\-]klein[\s\-]4B")
def _json(route: Route, payload: object) -> None:
@@ -176,6 +182,18 @@ def _api_payload(path: str, query: dict[str, list[str]], *, full_footprint: bool
return {}
+def klein_row(page):
+ """The klein row inside the open picker, and nothing else on the page.
+
+ An unscoped search is not specific enough once a download has been started:
+ the hub download panel labels itself "black-forest-labs/FLUX.2-klein-4B ·
+ Required assets", so a page-wide match returns it first and clicking it
+ leaves the picker where it was. The old exact repo-id text never matched
+ that panel, so scoping only became necessary with the pattern.
+ """
+ return page.locator(".unsloth-model-selector-menu").get_by_text(KLEIN_ROW).first
+
+
def _open_klein_quant(page) -> None:
page.goto(f"{BASE_URL}/images", wait_until = "domcontentloaded")
trigger = page.get_by_role("button", name = "Select image model")
@@ -186,7 +204,7 @@ def _open_klein_quant(page) -> None:
print(page.locator("body").inner_text()[:4_000])
raise
trigger.click()
- klein = page.get_by_text("FLUX.2-klein-4B-GGUF", exact = True)
+ klein = klein_row(page)
try:
klein.wait_for(state = "visible", timeout = 30_000)
except Exception: