feat(model-manager): add CivitAI browse view + fix civitai.red / 401
- New "Browse CivitAI" view: thumbnail grid with search, type/sort/period filters and NSFW toggle; click a model card to download it (per-card version picker for multi-version models). Cursor + page based "Load more". - Backend: /api/civitai/search and /api/civitai/download endpoints; new civitai_search() catalog helper. - Fix 401 on paste: recognize the civitai.red mirror (and any civitai.* host), normalize API calls to civitai.com, and always resolve the model-version so type + filename are auto-detected for every CivitAI URL. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -20,6 +20,9 @@
|
||||
<button class="nav-item active" data-view="installed">
|
||||
<span class="nav-ico">▦</span> Installed Models
|
||||
</button>
|
||||
<button class="nav-item" data-view="browse">
|
||||
<span class="nav-ico">🔍</span> Browse CivitAI
|
||||
</button>
|
||||
<button class="nav-item" data-view="download">
|
||||
<span class="nav-ico">↓</span> Add / Download
|
||||
</button>
|
||||
@@ -45,6 +48,53 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Browse CivitAI -->
|
||||
<section class="view" id="view-browse">
|
||||
<header class="view-head">
|
||||
<h1>Browse CivitAI</h1>
|
||||
<div class="head-actions">
|
||||
<span class="form-msg" id="browseToast"></span>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="browse-controls">
|
||||
<input type="search" id="bSearch" placeholder="Search models…" />
|
||||
<select id="bType">
|
||||
<option value="">All types</option>
|
||||
<option value="Checkpoint">Checkpoint</option>
|
||||
<option value="LORA">LoRA</option>
|
||||
<option value="LoCon">LyCORIS</option>
|
||||
<option value="TextualInversion">Embedding</option>
|
||||
<option value="Controlnet">ControlNet</option>
|
||||
<option value="VAE">VAE</option>
|
||||
<option value="Upscaler">Upscaler</option>
|
||||
<option value="Hypernetwork">Hypernetwork</option>
|
||||
<option value="Poses">Poses</option>
|
||||
</select>
|
||||
<select id="bSort">
|
||||
<option>Most Downloaded</option>
|
||||
<option>Highest Rated</option>
|
||||
<option>Newest</option>
|
||||
</select>
|
||||
<select id="bPeriod">
|
||||
<option>AllTime</option>
|
||||
<option>Year</option>
|
||||
<option>Month</option>
|
||||
<option>Week</option>
|
||||
<option>Day</option>
|
||||
</select>
|
||||
<label class="check"><input type="checkbox" id="bNsfw" /> NSFW</label>
|
||||
<button class="btn primary" id="bGo">Search</button>
|
||||
</div>
|
||||
|
||||
<div id="browseGrid" class="browse-grid">
|
||||
<p class="empty">Search the CivitAI catalog, then click <b>Download</b> on a model.</p>
|
||||
</div>
|
||||
<div class="browse-more">
|
||||
<button class="btn" id="bMore" style="display:none">Load more</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Add / Download -->
|
||||
<section class="view" id="view-download">
|
||||
<header class="view-head"><h1>Add / Download Model</h1></header>
|
||||
|
||||
Reference in New Issue
Block a user