Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions apps/website/src/config/model-vendors.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
export interface ModelDeveloper {
readonly name: string
readonly url: string
readonly wikidata?: string
Comment thread
MaanilVerma marked this conversation as resolved.
Resolved
}

const alibabaCloud: ModelDeveloper = {
name: 'Alibaba Cloud',
url: 'https://www.alibabacloud.com/',
wikidata: 'Q17062154'
}

/**
* Catalogue provider label to the organisation that developed its models.
* `null` marks a host whose model developer is not yet known. Wikidata ids were
* checked on 2026-09-25; developers without an organisation entry have none.
*/
export const MODEL_DEVELOPERS: Readonly<Record<string, ModelDeveloper | null>> =
{
Beeble: { name: 'Beeble', url: 'https://beeble.ai/' },
'Black Forest Labs': {
name: 'Black Forest Labs',
url: 'https://bfl.ai/',
wikidata: 'Q128801641'
},
Bria: { name: 'Bria', url: 'https://bria.ai/' },
ByteDance: {
name: 'ByteDance',
url: 'https://www.bytedance.com/',
wikidata: 'Q55606242'
},
ElevenLabs: {
name: 'ElevenLabs',
url: 'https://elevenlabs.io/',
wikidata: 'Q116798355'
},
Freepik: {
name: 'Freepik',
url: 'https://www.freepik.com/',
wikidata: 'Q97573128'
},
Google: {
name: 'Google DeepMind',
url: 'https://deepmind.google/',
wikidata: 'Q15733006'
},
Heygen: {
name: 'HeyGen',
url: 'https://www.heygen.com/',
wikidata: 'Q123258741'
},
Ideogram: { name: 'Ideogram', url: 'https://ideogram.ai/' },
Kling: {
name: 'Kuaishou',
url: 'https://www.kuaishou.com/',
wikidata: 'Q47015540'
},
Krea: { name: 'Krea', url: 'https://www.krea.ai/', wikidata: 'Q135906383' },
Luma: { name: 'Luma AI', url: 'https://lumalabs.ai/' },
OpenAI: {
name: 'OpenAI',
url: 'https://openai.com/',
wikidata: 'Q21708200'
},
Qwen: alibabaCloud,
Recraft: { name: 'Recraft', url: 'https://www.recraft.ai/' },
Runway: {
name: 'Runway',
url: 'https://runwayml.com/',
wikidata: 'Q123367593'
},
Wan: alibabaCloud,
Comment thread
benjcooley marked this conversation as resolved.
Resolved
WaveSpeed: null,
xAI: { name: 'xAI', url: 'https://x.ai/', wikidata: 'Q120599684' }
}

export function modelDeveloper(
provider: string | undefined
): ModelDeveloper | undefined {
if (!provider || !Object.hasOwn(MODEL_DEVELOPERS, provider)) return undefined
Comment thread
MaanilVerma marked this conversation as resolved.
Resolved
return MODEL_DEVELOPERS[provider] ?? undefined
}
19 changes: 19 additions & 0 deletions apps/website/src/routes/models/[slug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import BaseLayout from '../../layouts/BaseLayout.astro'
import ModelsPage from '../../components/workshop/ModelsPage.vue'
import ModelsShowcase from '../../components/models/ModelsShowcase.astro'
import { workshopPagePaths } from '../../config/workshop-page-content'
import { modelDeveloper } from '../../config/model-vendors'
import { t } from '../../i18n/translations'
import { pageContext } from '../../utils/jsonLd'
import { modelPageJsonLd } from '../../utils/modelJsonLd'
import { prepareModelPage } from './model-page'

export const getStaticPaths: GetStaticPaths = () =>
Expand All @@ -16,6 +19,18 @@ const page = await prepareModelPage(Astro.params.slug)
// separate deployment decision, not a reason to switch this site to SSR.
if (page.kind === 'redirect') return Astro.redirect(page.href, 301)
const { model } = page
const { siteUrl, url } = pageContext(
Astro.site,
Astro.url.pathname,
Astro.currentLocale
)
const jsonLd = modelPageJsonLd({
model,
useCaseLabel: page.useCaseLabel,
url,
siteUrl,
developer: modelDeveloper(model.provider)
})
---

<BaseLayout
Expand All @@ -26,6 +41,10 @@ const { model } = page
)}
ogImage={model.thumbnailUrl}
Comment thread
benjcooley marked this conversation as resolved.
Resolved
noindex
pageType={jsonLd.pageType}
Comment thread
MaanilVerma marked this conversation as resolved.
Resolved
breadcrumbs={jsonLd.breadcrumbs}
mainEntityId={jsonLd.mainEntityId}
extraJsonLd={jsonLd.extraJsonLd}
>
<ModelsPage slug={model.slug} workflowId={model.workflowId} client:load>
<ModelsShowcase slot="fallback" />
Expand Down
4 changes: 3 additions & 1 deletion apps/website/src/templates/cloud-nodes/PackDetailPage.astro
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ const software = softwareApplicationNode({
softwareVersion: pack.latestVersion,
license: pack.license,
codeRepository: pack.repoUrl,
authorName: pack.publisher?.name,
author: pack.publisher?.name
? { type: 'Person', name: pack.publisher.name }
: undefined,
isFree: true
})
---
Expand Down
2 changes: 1 addition & 1 deletion apps/website/src/utils/jsonLd.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ describe('softwareApplicationNode', () => {
name: 'Foo Pack',
url: 'https://comfy.org/cloud/supported-nodes/foo/',
applicationCategory: 'DeveloperApplication',
authorName: 'Jane Dev'
author: { type: 'Person', name: 'Jane Dev' }
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
})
expect(node.author).toEqual({ '@type': 'Person', name: 'Jane Dev' })
expect(node.publisher).toBeUndefined()
Expand Down
16 changes: 12 additions & 4 deletions apps/website/src/utils/jsonLd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,12 @@ export interface SoftwareAppInput {
softwareVersion?: string
license?: string
codeRepository?: string
authorName?: string
author?: {
Comment thread
benjcooley marked this conversation as resolved.
Resolved
type: 'Person' | 'Organization'
name: string
url?: string
sameAs?: string[]
}
isFree?: boolean
sameAs?: string[]
mainEntityOfPage?: string
Expand All @@ -244,9 +249,12 @@ export function softwareApplicationNode(input: SoftwareAppInput): JsonLdNode {
const orgRef = { '@id': organizationId(input.siteUrl) }
const author = input.firstParty
? orgRef
: input.authorName
? { '@type': 'Person', name: input.authorName }
: undefined
: input.author && {
'@type': input.author.type,
name: input.author.name,
url: input.author.url,
sameAs: input.author.sameAs
}
return {
'@type': 'SoftwareApplication',
'@id': input.id,
Expand Down
139 changes: 139 additions & 0 deletions apps/website/src/utils/modelJsonLd.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
import { describe, expect, it } from 'vitest'

import { MODEL_DEVELOPERS, modelDeveloper } from '../config/model-vendors'
import {
getWorkshopPageDetail,
workshopPagePaths
} from '../config/workshop-page-content'
import type { JsonLdNode } from './jsonLd'
import { modelPageJsonLd } from './modelJsonLd'

const siteUrl = 'https://comfy.org'
const url = 'https://comfy.org/models/example/'

const imageModel = {
name: 'FLUX 2 Max Text-to-Image',
summary: 'Generates an image from text.',
thumbnail: { url: 'https://cdn.example/flux.png', kind: 'image' as const }
}
const videoModel = {
name: 'Seedance 2.5 Text-to-Video',
summary: 'Generates a video from text.',
thumbnail: { url: 'https://cdn.example/seedance.mp4', kind: 'video' as const }
}

function software(
input: Partial<Parameters<typeof modelPageJsonLd>[0]>
): JsonLdNode {
const [node] = modelPageJsonLd({
model: imageModel,
url,
siteUrl,
developer: modelDeveloper('Black Forest Labs'),
...input
}).extraJsonLd
return node
}

describe('modelPageJsonLd', () => {
it('describes the page as Home > Models > model with the app as main entity', () => {
const result = modelPageJsonLd({
model: imageModel,
useCaseLabel: 'Generate images',
url,
siteUrl,
developer: modelDeveloper('Black Forest Labs')
})
expect(result.pageType).toBe('WebPage')
expect(result.mainEntityId).toBe(`${url}#software`)
expect(result.breadcrumbs).toEqual([
{ name: 'Home', url: 'https://comfy.org/' },
{ name: 'Models', url: 'https://comfy.org/models/' },
{ name: 'FLUX 2 Max Text-to-Image' }
])
expect(result.extraJsonLd[0]).toMatchObject({
'@type': 'SoftwareApplication',
'@id': `${url}#software`,
name: 'FLUX 2 Max Text-to-Image',
description: 'Generates an image from text.',
applicationCategory: 'MultimediaApplication',
applicationSubCategory: 'Generate images',
operatingSystem: 'Web',
provider: { '@id': 'https://comfy.org/#organization' },
mainEntityOfPage: url,
author: {
'@type': 'Organization',
name: 'Black Forest Labs',
url: 'https://bfl.ai/',
sameAs: ['https://www.wikidata.org/wiki/Q128801641']
}
})
})

it.for([
['an image thumbnail', imageModel, 'https://cdn.example/flux.png'],
['a video thumbnail', videoModel, undefined]
] as const)('sets image from %s', ([, model, image]) => {
expect(software({ model }).image).toBe(image)
})

it.for([
['WaveSpeed, a host', 'WaveSpeed'],
['an unknown provider', 'Someone New'],
['no provider', undefined]
] as const)('omits the author for %s', ([, provider]) => {
expect(software({ developer: modelDeveloper(provider) }).author).toBe(
undefined
)
})

it.for([
['no price', undefined, undefined],
['a zero price', 0, undefined],
['a sub-cent price, kept above $0', 0.57 / 211, '0.002701'],
['a non-finite price', Infinity, undefined],
['a dollar price, to the cent', 1.5, '1.5'],
['a large price, to the cent', 1234.5678, '1234.57']
] as const)('handles %s', ([, usd, price]) => {
const node = software({
price: usd === undefined ? undefined : { usd, settings: '1024x1024' }
})
expect(node.offers).toEqual(
price === undefined ? undefined : expect.objectContaining({ price })
)
})

it('states the priced settings on the offer', () => {
expect(
software({ price: { usd: 0.04, settings: '1024x1024' } }).offers
).toEqual({
'@type': 'Offer',
price: '0.04',
priceCurrency: 'USD',
priceSpecification: {
'@type': 'UnitPriceSpecification',
price: '0.04',
priceCurrency: 'USD',
description: '1024x1024'
}
})
})
})

describe('MODEL_DEVELOPERS', () => {
it('has a row for every catalogue provider', () => {
const providers = new Set(
workshopPagePaths.flatMap(
(slug) => getWorkshopPageDetail(slug)?.provider ?? []
)
)
expect(
[...providers].filter((p) => !Object.hasOwn(MODEL_DEVELOPERS, p))
).toEqual([])
})

it('links only well-formed Wikidata ids', () => {
for (const developer of Object.values(MODEL_DEVELOPERS))
if (developer?.wikidata) expect(developer.wikidata).toMatch(/^Q\d+$/)
})
})
Loading
Loading