Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix(loras): correct Civitai baseModel display names + show 4 per family

Adam Eivyc818ad28671d
diff --git a/client/src/pages/Loras.jsx b/client/src/pages/Loras.jsx
index 070f606675..d9d9aac38a 100644
--- a/client/src/pages/Loras.jsx
+++ b/client/src/pages/Loras.jsx
@@ -228,10 +228,13 @@ function SuggestionsPanel({ suggestions, loading, installedFilenames, installing
const runners = suggestions?.runners || {};
const sections = [
{ key: 'curated', label: 'Curated picks', cards: curated, hint: 'Hand-picked LoRAs that work across multiple base models.' },
- { key: 'mflux', label: 'Top for Flux 1', cards: runners.mflux || [], hint: 'Most-downloaded LoRAs trained against Flux.1 D / Flux.1 S.' },
- { key: 'flux2', label: 'Top for Flux 2', cards: runners.flux2 || [], hint: 'Most-downloaded LoRAs trained against Flux.2 Klein.' },
- { key: 'z-image', label: 'Top for Z-Image', cards: runners['z-image'] || [], hint: 'Z-Image LoRAs are still rare on Civitai — expect a sparse list.' },
- { key: 'ernie', label: 'Top for ERNIE', cards: runners.ernie || [], hint: 'ERNIE-Image LoRAs are still rare on Civitai — expect a sparse list.' },
+ // The four runner-family sections always render, even when Civitai
+ // search returns zero — `alwaysShow` lets the user see all four
+ // headers at a glance instead of silently collapsing the empty ones.
+ { key: 'mflux', label: 'Top for Flux 1', cards: runners.mflux || [], hint: 'Most-downloaded LoRAs trained against Flux.1 D / Flux.1 S.', alwaysShow: true },
+ { key: 'flux2', label: 'Top for Flux 2', cards: runners.flux2 || [], hint: 'Most-downloaded LoRAs trained against Flux.2 Klein 4B / 9B.', alwaysShow: true },
+ { key: 'z-image', label: 'Top for Z-Image', cards: runners['z-image'] || [], hint: 'Most-downloaded LoRAs trained against Z-Image / Z-Image-Turbo.', alwaysShow: true },
+ { key: 'ernie', label: 'Top for ERNIE', cards: runners.ernie || [], hint: 'Most-downloaded LoRAs trained against ERNIE-Image.', alwaysShow: true },
];
return (
<div className="space-y-4">
@@ -260,6 +263,7 @@ function SuggestionsPanel({ suggestions, loading, installedFilenames, installing
label={section.label}
hint={section.hint}
cards={section.cards}
+ alwaysShow={section.alwaysShow}
installedFilenames={installedFilenames}
installingSuggestionKey={installingSuggestionKey}
onInstall={onInstall}
@@ -269,26 +273,31 @@ function SuggestionsPanel({ suggestions, loading, installedFilenames, installing
);
}
-function SuggestionsSection({ label, hint, cards, installedFilenames, installingSuggestionKey, onInstall }) {
- if (!cards || cards.length === 0) return null;
+function SuggestionsSection({ label, hint, cards, alwaysShow = false, installedFilenames, installingSuggestionKey, onInstall }) {
+ const list = cards || [];
+ if (list.length === 0 && !alwaysShow) return null;
return (
<div>
<div className="flex items-baseline gap-3 mb-2">
<h3 className="text-sm font-medium text-gray-300">{label}</h3>
- <span className="text-xs text-gray-600">{cards.length}</span>
+ <span className="text-xs text-gray-600">{list.length}</span>
</div>
{hint && <p className="text-xs text-gray-500 mb-2">{hint}</p>}
- <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3">
- {cards.map((card) => (
- <SuggestionCard
- key={`${card.modelId}-${card.versionId}`}
- card={card}
- installedFilenames={installedFilenames}
- installingSuggestionKey={installingSuggestionKey}
- onInstall={onInstall}
- />
- ))}
- </div>
+ {list.length === 0 ? (
+ <p className="text-xs text-gray-600 italic">No LoRAs found on Civitai for this base model yet.</p>
+ ) : (
+ <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3">
+ {list.map((card) => (
+ <SuggestionCard
+ key={`${card.modelId}-${card.versionId}`}
+ card={card}
+ installedFilenames={installedFilenames}
+ installingSuggestionKey={installingSuggestionKey}
+ onInstall={onInstall}
+ />
+ ))}
+ </div>
+ )}
</div>
);
}
diff --git a/server/lib/civitai.js b/server/lib/civitai.js
index a6a2ef403c..0cdeb4a44b 100644
--- a/server/lib/civitai.js
+++ b/server/lib/civitai.js
@@ -255,11 +255,16 @@ export const buildSidecar = ({ model, version, file, filename }) => {
// Civitai's search endpoint expects. Civitai uses %20-encoded display names
// (`Flux.1 D`, `Flux.1 S`, `Flux.2`, etc.). The Z-Image ecosystem on Civitai
// is nascent — searches there often return zero; the UI handles that.
+// Civitai's `baseModels` display names — these are the literal strings the
+// search endpoint accepts; sending anything else returns zero results.
+// Discovered by inspecting modelVersions[].baseModel on multi-base-model
+// LoRAs (e.g. model 1155749). Civitai is inconsistent about hyphens and
+// per-variant naming, so each runner family lists every accepted alias.
const RUNNER_TO_BASE_MODELS = {
mflux: ['Flux.1 D', 'Flux.1 S'],
- flux2: ['Flux.2'],
- 'z-image': ['Z-Image'],
- ernie: ['Ernie-Image', 'ERNIE-Image'],
+ flux2: ['Flux.2 Klein 4B', 'Flux.2 Klein 9B'],
+ 'z-image': ['ZImageBase', 'ZImageTurbo'],
+ ernie: ['Ernie'],
};
// Search Civitai for LoRA-family models targeting the given runner family.
diff --git a/server/routes/loras.js b/server/routes/loras.js
index 0c13c156a2..ac223b39b7 100644
--- a/server/routes/loras.js
+++ b/server/routes/loras.js
@@ -26,11 +26,13 @@ router.get('/', asyncHandler(async (_req, res) => {
res.json(await listLoras());
}));
-// Civitai LoRA suggestions per runner family (mflux / flux2 / z-image).
+// Civitai LoRA suggestions per runner family (mflux / flux2 / z-image / ernie).
// Cached server-side for 1h. `?force=1` busts the cache for a manual refresh.
+// Default 4 cards per family — that's enough to show breadth without
+// overwhelming the panel; users can paste a URL for anything specific.
router.get('/suggestions', asyncHandler(async (req, res) => {
const force = req.query.force === '1' || req.query.force === 'true';
- const limit = Math.max(1, Math.min(24, Number(req.query.limit) || 12));
+ const limit = Math.max(1, Math.min(24, Number(req.query.limit) || 4));
res.json(await getSuggestions({ force, limit }));
}));
diff --git a/server/services/civitaiSuggestions.js b/server/services/civitaiSuggestions.js
index de5a7a22a3..874a5196a2 100644
--- a/server/services/civitaiSuggestions.js
+++ b/server/services/civitaiSuggestions.js
@@ -170,7 +170,7 @@ const fetchSuggestionsFor = async (runnerFamily, { fetchImpl, limit, force = fal
// - runners: per-family top-N from Civitai's search endpoint
// Never throws on partial failure — a Z-Image search returning zero or a
// transient curated 404 shouldn't kill the whole panel.
-export const getSuggestions = async ({ fetchImpl, limit = 12, force = false } = {}) => {
+export const getSuggestions = async ({ fetchImpl, limit = 4, force = false } = {}) => {
const [curated, runnerEntries] = await Promise.all([
getCurated({ fetchImpl, force }),
Promise.all(RUNNER_FAMILIES.map(async (family) => {