From 15be10b0232bec5a41c101b525af88c6141a1a0f Mon Sep 17 00:00:00 2001 From: Maanil Verma Date: Fri, 25 Sep 2026 22:07:54 +0530 Subject: [PATCH 1/4] feat(website): build model page JSON-LD, inert while pages are noindex Model pages now pass a SoftwareApplication (developer as an Organization with its Wikidata link) and a Home > Models > model breadcrumb to BaseLayout. BaseLayout drops JSON-LD on noindex pages, so production output is unchanged until noindex comes off. An Offer is emitted only for a positive price and is never rounded to $0; prices are not wired yet. --- apps/website/src/config/model-vendors.ts | 82 ++++++++++++ apps/website/src/routes/models/[slug].astro | 19 +++ apps/website/src/utils/jsonLd.ts | 19 ++- apps/website/src/utils/modelJsonLd.test.ts | 136 ++++++++++++++++++++ apps/website/src/utils/modelJsonLd.ts | 92 +++++++++++++ 5 files changed, 345 insertions(+), 3 deletions(-) create mode 100644 apps/website/src/config/model-vendors.ts create mode 100644 apps/website/src/utils/modelJsonLd.test.ts create mode 100644 apps/website/src/utils/modelJsonLd.ts diff --git a/apps/website/src/config/model-vendors.ts b/apps/website/src/config/model-vendors.ts new file mode 100644 index 00000000000..d1ab3193861 --- /dev/null +++ b/apps/website/src/config/model-vendors.ts @@ -0,0 +1,82 @@ +export interface ModelDeveloper { + readonly name: string + readonly url: string + readonly wikidata?: string +} + +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> = + { + 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, + 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 + return MODEL_DEVELOPERS[provider] ?? undefined +} diff --git a/apps/website/src/routes/models/[slug].astro b/apps/website/src/routes/models/[slug].astro index 7f33e51da6c..0040db26419 100644 --- a/apps/website/src/routes/models/[slug].astro +++ b/apps/website/src/routes/models/[slug].astro @@ -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 = () => @@ -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) +}) --- diff --git a/apps/website/src/utils/jsonLd.ts b/apps/website/src/utils/jsonLd.ts index 48a0e43f7f5..003d8624b7f 100644 --- a/apps/website/src/utils/jsonLd.ts +++ b/apps/website/src/utils/jsonLd.ts @@ -234,6 +234,12 @@ export interface SoftwareAppInput { license?: string codeRepository?: string authorName?: string + author?: { + type: 'Person' | 'Organization' + name: string + url?: string + sameAs?: string[] + } isFree?: boolean sameAs?: string[] mainEntityOfPage?: string @@ -244,9 +250,16 @@ 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 + } + : input.authorName + ? { '@type': 'Person', name: input.authorName } + : undefined return { '@type': 'SoftwareApplication', '@id': input.id, diff --git a/apps/website/src/utils/modelJsonLd.test.ts b/apps/website/src/utils/modelJsonLd.test.ts new file mode 100644 index 00000000000..ead9179d746 --- /dev/null +++ b/apps/website/src/utils/modelJsonLd.test.ts @@ -0,0 +1,136 @@ +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[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', + 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 dollar price, to the cent', 1.5, '1.5'] + ] 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+$/) + }) +}) diff --git a/apps/website/src/utils/modelJsonLd.ts b/apps/website/src/utils/modelJsonLd.ts new file mode 100644 index 00000000000..c642c1c4f38 --- /dev/null +++ b/apps/website/src/utils/modelJsonLd.ts @@ -0,0 +1,92 @@ +import type { ModelDeveloper } from '../config/model-vendors' +import { t } from '../i18n/translations' +import type { Crumb, JsonLdNode } from './jsonLd' +import { jsonLdId, organizationId, softwareApplicationNode } from './jsonLd' + +interface ModelPageJsonLdInput { + model: { + name: string + summary?: string + thumbnail?: { url: string; kind: 'image' | 'video' | 'audio' } + } + useCaseLabel?: string + url: string + siteUrl: string + developer?: ModelDeveloper + price?: { usd: number; settings: string } +} + +const usdFormat = new Intl.NumberFormat('en-US', { + maximumFractionDigits: 2, + maximumSignificantDigits: 4, + roundingPriority: 'morePrecision', + useGrouping: false +}) + +function offerFor(price: ModelPageJsonLdInput['price']) { + if (!price || !(price.usd > 0)) return undefined + const amount = usdFormat.format(price.usd) + return { + '@type': 'Offer', + price: amount, + priceCurrency: 'USD', + priceSpecification: { + '@type': 'UnitPriceSpecification', + price: amount, + priceCurrency: 'USD', + description: price.settings + } + } +} + +export function modelPageJsonLd({ + model, + useCaseLabel, + url, + siteUrl, + developer, + price +}: ModelPageJsonLdInput): { + pageType: 'WebPage' + mainEntityId: string + breadcrumbs: Crumb[] + extraJsonLd: JsonLdNode[] +} { + const id = jsonLdId(url, 'software') + const software = softwareApplicationNode({ + siteUrl, + id, + name: model.name, + url, + description: model.summary, + applicationCategory: 'MultimediaApplication', + applicationSubCategory: useCaseLabel, + operatingSystem: 'Web', + image: model.thumbnail?.kind === 'image' ? model.thumbnail.url : undefined, + author: developer && { + type: 'Organization', + name: developer.name, + url: developer.url, + sameAs: developer.wikidata + ? [`https://www.wikidata.org/wiki/${developer.wikidata}`] + : undefined + }, + mainEntityOfPage: url + }) + return { + pageType: 'WebPage', + mainEntityId: id, + breadcrumbs: [ + { name: t('breadcrumb.home'), url: `${siteUrl}/` }, + { name: t('workshop.title'), url: `${siteUrl}/models/` }, + { name: model.name } + ], + extraJsonLd: [ + { + ...software, + provider: { '@id': organizationId(siteUrl) }, + offers: offerFor(price) + } + ] + } +} From f9c5c7dbc18e7efd6fe293fe6b34d571f43631ce Mon Sep 17 00:00:00 2001 From: Maanil Verma Date: Sat, 26 Sep 2026 00:06:21 +0530 Subject: [PATCH 2/4] fix(website): skip a model Offer when the price is not finite --- apps/website/src/utils/modelJsonLd.test.ts | 4 +++- apps/website/src/utils/modelJsonLd.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/website/src/utils/modelJsonLd.test.ts b/apps/website/src/utils/modelJsonLd.test.ts index ead9179d746..ce43addc4ed 100644 --- a/apps/website/src/utils/modelJsonLd.test.ts +++ b/apps/website/src/utils/modelJsonLd.test.ts @@ -90,7 +90,9 @@ describe('modelPageJsonLd', () => { ['no price', undefined, undefined], ['a zero price', 0, undefined], ['a sub-cent price, kept above $0', 0.57 / 211, '0.002701'], - ['a dollar price, to the cent', 1.5, '1.5'] + ['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' } diff --git a/apps/website/src/utils/modelJsonLd.ts b/apps/website/src/utils/modelJsonLd.ts index c642c1c4f38..843632fe514 100644 --- a/apps/website/src/utils/modelJsonLd.ts +++ b/apps/website/src/utils/modelJsonLd.ts @@ -24,7 +24,7 @@ const usdFormat = new Intl.NumberFormat('en-US', { }) function offerFor(price: ModelPageJsonLdInput['price']) { - if (!price || !(price.usd > 0)) return undefined + if (!price || !Number.isFinite(price.usd) || price.usd <= 0) return undefined const amount = usdFormat.format(price.usd) return { '@type': 'Offer', From 242ea8222ffa3792259349b78853d71b9e1b52c3 Mon Sep 17 00:00:00 2001 From: Maanil Verma Date: Tue, 29 Sep 2026 08:22:18 +0530 Subject: [PATCH 3/4] refactor(website): give SoftwareApplication one typed author input --- .../templates/cloud-nodes/PackDetailPage.astro | 4 +++- apps/website/src/utils/jsonLd.test.ts | 2 +- apps/website/src/utils/jsonLd.ts | 17 ++++++----------- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/apps/website/src/templates/cloud-nodes/PackDetailPage.astro b/apps/website/src/templates/cloud-nodes/PackDetailPage.astro index 277717f1811..679e2aef834 100644 --- a/apps/website/src/templates/cloud-nodes/PackDetailPage.astro +++ b/apps/website/src/templates/cloud-nodes/PackDetailPage.astro @@ -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 }) --- diff --git a/apps/website/src/utils/jsonLd.test.ts b/apps/website/src/utils/jsonLd.test.ts index 5de0b0c01c9..c74679216fa 100644 --- a/apps/website/src/utils/jsonLd.test.ts +++ b/apps/website/src/utils/jsonLd.test.ts @@ -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' } }) expect(node.author).toEqual({ '@type': 'Person', name: 'Jane Dev' }) expect(node.publisher).toBeUndefined() diff --git a/apps/website/src/utils/jsonLd.ts b/apps/website/src/utils/jsonLd.ts index 003d8624b7f..54a37cf9acb 100644 --- a/apps/website/src/utils/jsonLd.ts +++ b/apps/website/src/utils/jsonLd.ts @@ -233,7 +233,6 @@ export interface SoftwareAppInput { softwareVersion?: string license?: string codeRepository?: string - authorName?: string author?: { type: 'Person' | 'Organization' name: string @@ -250,16 +249,12 @@ export function softwareApplicationNode(input: SoftwareAppInput): JsonLdNode { const orgRef = { '@id': organizationId(input.siteUrl) } const author = input.firstParty ? orgRef - : input.author - ? { - '@type': input.author.type, - name: input.author.name, - url: input.author.url, - sameAs: input.author.sameAs - } - : 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, From a5c261a136f77d4bd5f6fef15fc9a1f5aa2492b1 Mon Sep 17 00:00:00 2001 From: Maanil Verma Date: Tue, 29 Sep 2026 18:35:37 +0530 Subject: [PATCH 4/4] test(website): assert the model developer url in JSON-LD --- apps/website/src/utils/modelJsonLd.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/website/src/utils/modelJsonLd.test.ts b/apps/website/src/utils/modelJsonLd.test.ts index ce43addc4ed..45f21edcdc0 100644 --- a/apps/website/src/utils/modelJsonLd.test.ts +++ b/apps/website/src/utils/modelJsonLd.test.ts @@ -64,6 +64,7 @@ describe('modelPageJsonLd', () => { author: { '@type': 'Organization', name: 'Black Forest Labs', + url: 'https://bfl.ai/', sameAs: ['https://www.wikidata.org/wiki/Q128801641'] } })