Skip to content

v1.2.1 - Browse Filters + Selection Performance / Browse 過濾器擴充 + 選取效能

Choose a tag to compare

@acer1204 acer1204 released this 23 May 07:19
· 1 commit to main since this release

New Features / 新功能

Browse Filters: Category multi-select
Browse 過濾器:Category 多選

A new "Category" dropdown in Browse > Filters exposes the same chips civitai.red shows in its frontend search UI: Action, Animal, Assets, Background, Base Model, Buildings, Celebrity, Character, Clothing, Concept, Objects, Poses, Style, Tool, Vehicle. Multi-select is wired to repeated ?tag= query parameters (mirrors the website's ?category=). Combines AND with Search by: Tag — both feed the same tag list.

Browse 的 Filters 區新增「Category」下拉,選項對應 civitai.red 前端搜尋頁的同一組 chips:Action / Animal / Assets / Background / Base Model / Buildings / Celebrity / Character / Clothing / Concept / Objects / Poses / Style / Tool / Vehicle。支援多選,送 API 時用 repeated ?tag= 參數(對應網頁的 ?category=)。若同時用 Search by: Tag,兩邊的 tag 會合併以 AND 篩選。

Browse Filters: Filter by user
Browse 過濾器:Filter by user

A new "Filter by user" textbox lets you narrow results to a specific creator independent of the search box (mirrors the website's ?users= chip). When the search box and this field contain the same string, the duplicate ?query= is dropped (public API's query= only matches model name / description, not username — sending both would AND-restrict to almost zero results).

Filters 區新增「Filter by user」文字框,可獨立於搜尋框指定創作者(對應網頁的 ?users= 過濾)。當搜尋框跟此欄位填同樣字串時,會自動省略 ?query=(公開 API 的 query= 只比對 model 名稱 / 描述,不比對 username,同時送兩個會 AND 到幾乎零筆)。

NSFW: Checkbox → Yes/No dropdown
NSFW:從 Checkbox 改為 Yes/No 下拉

Visual height now matches the Sort / Period dropdowns next to it. Backend still stores as a boolean for backward compatibility with existing search_config.json.

外觀高度跟旁邊的 Sort / Period 下拉一致。後端仍存 bool,跟既有的 search_config.json 相容。

Performance / 效能

Smoother card selection — no more re-render flash
卡片勾選不再閃爍

Clicking a checkbox in Browse or Installed no longer re-renders the cards grid. Previously every toggle posted updated HTML for the whole grid, which:

  • flashed a Gradio "loading" overlay on the cards container
  • reloaded every image and video in the grid
  • reset the scroll position to the top

Now the JS already flips the checkbox visual state on click, and the backend updates the selection set silently (outputs=[]). The next render that does touch HTML (Select All / page change / new search / delete) picks up the latest state from _selected_model_ids or _selected_installed_paths.

Browse 或 Installed 點 checkbox 時,卡片區不再整個重畫。之前每點一下就會:

  • 卡片容器閃一下 Gradio 的「loading」遮罩
  • 所有圖片和影片重新載入
  • scroll 位置被拉回最頂

現在 JS 點下去當下就翻轉 checkbox 視覺狀態,後端只靜默更新選取集合(outputs=[])。下次真的需要動 HTML(Select All / 翻頁 / 新搜尋 / 刪除)時自然會從 _selected_model_ids_selected_installed_paths 讀到最新狀態。

Off-screen card videos pause automatically
離畫面的卡片影片自動暫停

<video autoplay loop muted> card previews kept decoding frames even when scrolled out of view — with 50–100 autoplay videos on a page, the constant decode work was choking scroll performance and causing visible flicker. An IntersectionObserver now pauses any card video that's not on-screen and resumes it when it scrolls back into view. A MutationObserver picks up new videos whenever Gradio re-renders the cards.

<video autoplay loop muted> 卡片預覽就算捲出視窗也會持續 decode,一頁 50-100 支同時播時嚴重拖累滾動效能、引發畫面閃爍。新增 IntersectionObserver:離畫面的影片自動暫停,捲回視野時再播。另用 MutationObserver 監聽 Gradio 重新渲染卡片時自動接管新插入的 video。

Bug Fixes / 錯誤修復

Preview image 404 → "No Preview" instead of broken image
預覽圖 404 → 顯示「No Preview」而非破圖

Some versions of a multi-version model have images[] entries with empty URLs, or URLs that 404 on CivitAI's CDN. Cards previously showed a broken-image icon. Now:

  • Card rendering walks images[] and skips entries with missing URL.
  • Each <img> / <video> carries an inline onerror handler that swaps the element for a "No Preview" placeholder div when the asset actually fails to load.

部分多版本模型的 images[] 內含空 URL,或 URL 在 CivitAI CDN 上 404。卡片之前會顯示破圖。修法:

  • 渲染時逐一檢查 images[],跳過沒有 URL 的條目
  • 每個 <img> / <video>onerror handler,實際載入失敗時自動換成「No Preview」placeholder

Notes on web vs API search / 網頁與 API 搜尋的差異

civitai.red's /search/models page uses a Meilisearch backend that fuzzy-matches a single query across model name, description, tags, trained-words and creator username. The public /api/v1/models endpoint used by this extension only matches query= against model name (and possibly description), so the same search term can yield very different result counts between the website and the extension. To find all models by a creator use Search by: User name or fill Filter by user; for tag-like queries (e.g. "nipple", "cat ears") use Search by: Tag.

civitai.red 的 /search/models 頁面用 Meilisearch 後端,一個 query 會模糊比對 model 名稱、描述、tags、trained-words 跟創作者名稱。本擴充功能用的公開 /api/v1/models 端點 query= 只比對 model 名稱(可能含描述),所以同一個搜尋字在網頁跟擴充功能的結果筆數可能差很多。要找某創作者的全部作品請用 Search by: User name 或填 Filter by user;要找像 tag 的關鍵字(例如「nipple」、「cat ears」)請改用 Search by: Tag

Previous Releases / 歷史版本

  • v1.2 - Installed Tab Overhaul / Installed 分頁大改版
  • v1.1.1 - Fix Copy / Copy All buttons silent failure / 修復 Copy 按鈕靜默失效
  • v1.1.0 - Multi-version Cards & civitai.red Full Support / 多版本卡片 + civitai.red 完整支援
  • v1.0.2 - Fix installed detection for commission/restricted models / 修復受限模型安裝偵測
  • v1.0.1 - Initial release / 初始版本