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
@@ -2,7 +2,6 @@ import {
|
||||
ArrowDownIcon,
|
||||
BoxIcon,
|
||||
CpuIcon,
|
||||
ExternalLinkIcon,
|
||||
FileTextIcon,
|
||||
FolderIcon,
|
||||
HistoryIcon,
|
||||
@@ -15,8 +14,6 @@ import {
|
||||
TriangleAlertIcon,
|
||||
} from "lucide-react";
|
||||
import type { Metadata } from "next";
|
||||
import { civitaiPageUrl } from "@/lib/civitai/input";
|
||||
import { CIVITAI_LATEST, civitaiModelId } from "@/lib/civitai/paths";
|
||||
import Link from "next/link";
|
||||
import { notFound, redirect } from "next/navigation";
|
||||
import { Suspense } from "react";
|
||||
@@ -98,11 +95,6 @@ export default async function ModelPage({ params, searchParams }: PageProps<"/[o
|
||||
|
||||
// A local model has no Hub repo: no commit, Hub checks or model tree; its README is the model card.
|
||||
const local = model.source === "local";
|
||||
// A CivitAI model: pinned to a model version (pinnedSha), no Hub repo, commit or model tree.
|
||||
const civitai = model.source === "civitai";
|
||||
const noHub = local || civitai;
|
||||
const civitaiId = civitai ? civitaiModelId(model.repoId) : null;
|
||||
const civitaiPage = civitaiId ? civitaiPageUrl(civitaiId, { nsfw: model.nsfw }) : null;
|
||||
const tab: TabId = TABS.some((t) => t.id === sp.tab) ? (sp.tab as TabId) : "files";
|
||||
const [author, name] = model.repoId.split("/");
|
||||
const hub = `https://huggingface.co/${model.repoId}`;
|
||||
@@ -143,31 +135,13 @@ export default async function ModelPage({ params, searchParams }: PageProps<"/[o
|
||||
title={
|
||||
<span className="flex flex-wrap items-center gap-x-2 gap-y-2">
|
||||
<Avatar url={model.authorAvatarUrl} name={author} />
|
||||
{civitai ? (
|
||||
<span className="break-all">{model.displayName ?? model.repoId}</span>
|
||||
) : (
|
||||
<>
|
||||
<Link href={`/?author=${encodeURIComponent(author)}`} className="font-normal text-muted-foreground hover:text-foreground hover:underline">
|
||||
{author}
|
||||
</Link>
|
||||
<span className="font-normal text-muted-foreground">/</span>
|
||||
<span className="break-all">{name}</span>
|
||||
</>
|
||||
)}
|
||||
<CopyButton value={model.repoId} label={local ? "Copy name" : "Copy repo ID"} />
|
||||
{civitaiPage && (
|
||||
<a
|
||||
href={civitaiPage}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
title="Open on CivitAI"
|
||||
aria-label="Open on CivitAI"
|
||||
className="inline-flex size-7 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground"
|
||||
>
|
||||
<ExternalLinkIcon className="size-4" />
|
||||
</a>
|
||||
)}
|
||||
{!noHub && (
|
||||
{!local && (
|
||||
<a
|
||||
href={hub}
|
||||
target="_blank"
|
||||
@@ -292,14 +266,6 @@ export default async function ModelPage({ params, searchParams }: PageProps<"/[o
|
||||
<div className="p-5 sm:p-6">
|
||||
{local ? (
|
||||
<LocalModelCardSection markdown={model.localReadme} localPath={model.localPath} />
|
||||
) : civitai ? (
|
||||
<p className="text-sm text-muted-foreground">
|
||||
The creator's description is on{" "}
|
||||
<a href={civitaiPage ?? "#"} target="_blank" rel="noreferrer" className="underline">
|
||||
CivitAI
|
||||
</a>
|
||||
.
|
||||
</p>
|
||||
) : (
|
||||
<Suspense fallback={<ModelCardSkeleton />}>
|
||||
<ModelCardSection repoId={model.repoId} sha={model.pinnedSha} />
|
||||
@@ -317,7 +283,7 @@ export default async function ModelPage({ params, searchParams }: PageProps<"/[o
|
||||
freeBytes={worker.online ? worker.modelsDirFreeBytes : null}
|
||||
busy={model.status === "downloading"}
|
||||
hubMissing={hubMissing}
|
||||
local={noHub}
|
||||
local={local}
|
||||
/>
|
||||
)}
|
||||
{tab === "jobs" && (
|
||||
@@ -367,27 +333,6 @@ export default async function ModelPage({ params, searchParams }: PageProps<"/[o
|
||||
<dt className="text-muted-foreground">Source</dt>
|
||||
<dd>Local folder, no Hugging Face repo</dd>
|
||||
</>
|
||||
) : civitai ? (
|
||||
<>
|
||||
<dt className="text-muted-foreground">Version</dt>
|
||||
<dd className="flex items-center gap-1">
|
||||
<a
|
||||
href={civitaiId ? civitaiPageUrl(civitaiId, { nsfw: model.nsfw, versionId: Number(model.pinnedSha) }) : "#"}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
className="font-mono hover:underline"
|
||||
>
|
||||
{model.pinnedSha}
|
||||
</a>
|
||||
<span className="text-muted-foreground">
|
||||
{model.trackedRevision === CIVITAI_LATEST ? "following new versions" : "pinned"}
|
||||
</span>
|
||||
</dd>
|
||||
<dt className="text-muted-foreground">Downloaded</dt>
|
||||
<dd>
|
||||
<LocalTime value={model.downloadedAt} />
|
||||
</dd>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<dt className="text-muted-foreground">Commit</dt>
|
||||
@@ -423,7 +368,7 @@ export default async function ModelPage({ params, searchParams }: PageProps<"/[o
|
||||
<dd className="flex flex-col font-mono text-xs">{model.excludePatterns.map((p) => <span key={p} className="break-all">{p}</span>)}</dd>
|
||||
</>
|
||||
)}
|
||||
{!noHub && (
|
||||
{!local && (
|
||||
<>
|
||||
<dt className="text-muted-foreground">On the Hub</dt>
|
||||
<dd className="flex flex-col items-start gap-0.5">
|
||||
@@ -455,7 +400,7 @@ export default async function ModelPage({ params, searchParams }: PageProps<"/[o
|
||||
</dl>
|
||||
</SideCard>
|
||||
|
||||
{!noHub && (
|
||||
{!local && (
|
||||
<SideCard title="Model tree" icon={SparklesIcon}>
|
||||
<ModelTree
|
||||
repoId={model.repoId}
|
||||
|
||||
Reference in new issue
Block a user