Revert CivitAI downloads
Removes the CivitAI work again (765dac2,a1acd8c): the API client and link parser, CIVITAI_TOKEN, adding CivitAI models, migration 0027 and the model page changes. Kaname downloads from Hugging Face only, as in 0.21.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a1acd8c0a5
commit
7d1a8fb85a
25 files changed
+17
-2849
No files matched your search
@@ -18,11 +18,8 @@ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@
|
||||
import { useRecommended } from "@/hooks/use-recommended";
|
||||
import { groupSplitFiles } from "@/lib/file-groups";
|
||||
import { formatBytes, shortSha } from "@/lib/format";
|
||||
import type { CivitaiLookupResult } from "@/lib/civitai/lookup";
|
||||
import { isCivitaiInput } from "@/lib/civitai/input";
|
||||
import type { LookupResult } from "@/lib/hub/lookup";
|
||||
import { escapeGlob, matchesAny, parsePatternList, quantGroup } from "@/lib/selection";
|
||||
import { CivitaiSelection } from "./civitai-selection";
|
||||
|
||||
type ApiErrorBody = { error?: { code: string; message: string } };
|
||||
|
||||
@@ -55,9 +52,6 @@ export function AddModelForm({
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const [result, setResult] = useState<LookupResult | null>(null);
|
||||
const [civitai, setCivitai] = useState<CivitaiLookupResult | null>(null);
|
||||
// Not while importing a folder: imports match a folder against a Hub repo.
|
||||
const civitaiInput = !importFolder && isCivitaiInput(repo);
|
||||
|
||||
const [checked, setChecked] = useState<Set<string>>(new Set());
|
||||
const [includeText, setIncludeText] = useState("");
|
||||
@@ -88,11 +82,6 @@ export function AddModelForm({
|
||||
e?.preventDefault();
|
||||
setLoading(true);
|
||||
setError(null);
|
||||
if (civitaiInput) {
|
||||
await lookupCivitai();
|
||||
return;
|
||||
}
|
||||
setCivitai(null);
|
||||
try {
|
||||
const r = await postJson<LookupResult>("/api/hub/lookup", { repo, revision });
|
||||
setResult(r);
|
||||
@@ -111,21 +100,6 @@ export function AddModelForm({
|
||||
}
|
||||
}
|
||||
|
||||
/** CivitAI: the model behind the pasted link, at `versionId` (the version picker) or the link's version. */
|
||||
async function lookupCivitai(versionId?: number) {
|
||||
setLoading(true);
|
||||
setError(null);
|
||||
setResult(null);
|
||||
try {
|
||||
setCivitai(await postJson<CivitaiLookupResult>("/api/civitai/lookup", { input: repo, versionId }));
|
||||
} catch (err) {
|
||||
setCivitai(null);
|
||||
setError(err instanceof Error ? err.message : String(err));
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
}
|
||||
|
||||
const autoLookup = useRef(false);
|
||||
useEffect(() => {
|
||||
if (importFolder && !autoLookup.current) {
|
||||
@@ -242,17 +216,17 @@ export function AddModelForm({
|
||||
<div className="flex flex-col gap-4">
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>{importFolder ? `Import ${importFolder.path}` : "Hugging Face or CivitAI"}</CardTitle>
|
||||
<CardTitle>{importFolder ? `Import ${importFolder.path}` : "Hugging Face repository"}</CardTitle>
|
||||
<CardDescription>
|
||||
{importFolder
|
||||
? `The folder's files are matched against this Hub repo${importFolder.commit ? " at the commit hf recorded when it downloaded them" : ""}. Change the repo or revision if they don't fit.`
|
||||
: "Repo ID like unsloth/Qwen3-8B-GGUF or the repo URL, or a CivitAI model link (civitai.com or civitai.red)."}
|
||||
: "Repo ID like unsloth/Qwen3-8B-GGUF, or paste the repo URL."}
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<form onSubmit={lookup} className="flex flex-col gap-3 sm:flex-row sm:items-end">
|
||||
<div className="flex flex-1 flex-col gap-1.5">
|
||||
<Label htmlFor="repo">{importFolder ? "Repo ID" : "Repo ID or link"}</Label>
|
||||
<Label htmlFor="repo">Repo ID</Label>
|
||||
<Input
|
||||
id="repo"
|
||||
value={repo}
|
||||
@@ -269,9 +243,7 @@ export function AddModelForm({
|
||||
id="revision"
|
||||
value={revision}
|
||||
onChange={(e) => setRevision(e.target.value)}
|
||||
placeholder={civitaiInput ? "picked after the lookup" : "main"}
|
||||
disabled={civitaiInput}
|
||||
title={civitaiInput ? "CivitAI versions are picked after the lookup" : undefined}
|
||||
placeholder="main"
|
||||
spellCheck={false}
|
||||
/>
|
||||
</div>
|
||||
@@ -299,18 +271,6 @@ export function AddModelForm({
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
{civitai && (
|
||||
<CivitaiSelection
|
||||
key={civitai.version.id}
|
||||
result={civitai}
|
||||
freeBytes={freeBytes}
|
||||
loading={loading}
|
||||
onVersion={(v) => void lookupCivitai(v)}
|
||||
onAdded={onAdded}
|
||||
postJson={postJson}
|
||||
/>
|
||||
)}
|
||||
|
||||
{result && (
|
||||
<>
|
||||
<Card>
|
||||
|
||||
Reference in new issue
Block a user