feat(models): fallback CTAs when no hub model page exists

When hubSlug is absent: show Download (HF link, solid) + Run on Cloud
instead of a generic workflows link. Variant logic: the first available
button is solid, subsequent are outline.
This commit is contained in:
bymyself
2026-05-05 05:35:34 +00:00
parent b0986f1624
commit 5feefc7783
2 changed files with 20 additions and 3 deletions

View File

@@ -23,7 +23,7 @@ const {
const workflowsUrl = hubSlug
? `https://www.comfy.org/workflows/model/${hubSlug}`
: 'https://www.comfy.org/workflows'
: null
const dirDisplayMap: Record<string, string> = {
diffusion_models: 'Diffusion Model',
@@ -76,6 +76,7 @@ const isPartnerNode = directory === 'partner_nodes'
<div class="flex flex-col gap-3 sm:flex-row">
<BrandButton
v-if="workflowsUrl"
:href="workflowsUrl"
variant="solid"
size="lg"
@@ -85,17 +86,29 @@ const isPartnerNode = directory === 'partner_nodes'
</BrandButton>
<BrandButton
v-if="!isPartnerNode"
v-if="!isPartnerNode && huggingFaceUrl"
:href="huggingFaceUrl"
target="_blank"
rel="noopener noreferrer"
variant="outline"
:variant="workflowsUrl ? 'outline' : 'solid'"
size="lg"
class="w-full uppercase sm:w-auto sm:min-w-48"
>
{{ t('models.hero.secondaryCta') }}
</BrandButton>
<BrandButton
v-if="!workflowsUrl"
href="https://www.comfy.org/cloud"
target="_blank"
rel="noopener noreferrer"
:variant="huggingFaceUrl && !isPartnerNode ? 'outline' : 'solid'"
size="lg"
class="w-full uppercase sm:w-auto sm:min-w-48"
>
{{ t('models.hero.cloudCta') }}
</BrandButton>
<BrandButton
v-if="docsUrl"
:href="docsUrl"

View File

@@ -3607,6 +3607,10 @@ const translations = {
en: 'DOWNLOAD MODEL',
'zh-CN': '下载模型'
},
'models.hero.cloudCta': {
en: 'RUN ON CLOUD',
'zh-CN': '云端运行'
},
'models.hero.tutorialCta': {
en: 'VIEW TUTORIAL',
'zh-CN': '查看教程'