From e5b80190c00ef2c43d6901b2d1de4fe4a7135f12 Mon Sep 17 00:00:00 2001 From: Maanil Verma Date: Tue, 29 Sep 2026 10:57:55 +0530 Subject: [PATCH 01/28] feat(website): generate vercel.json redirects from one typed list Every redirect now lives in src/config/redirects.ts. vercel.json is generated from it (pnpm --filter @comfyorg/website sync:redirects) and Astro's redirect map is derived from it, so the two can no longer disagree. A test fails when vercel.json drifts, a destination is itself a source, a source repeats, or an internal destination lacks its trailing slash. The Astro-only entries and the 12 supported-models alias pages now answer with a real 308 on Vercel instead of a 200 meta-refresh page, and both slash forms of every source redirect. --- apps/website/astro.config.ts | 4 +- apps/website/package.json | 1 + apps/website/scripts/sync-vercel-redirects.ts | 20 ++ apps/website/src/config/redirects.test.ts | 215 +++++++------ apps/website/src/config/redirects.ts | 167 +++++++--- apps/website/src/lib/hreflang.test.ts | 4 +- .../src/pages/p/supported-models/[slug].astro | 10 +- apps/website/src/utils/hreflangAudit.ts | 4 +- apps/website/vercel.json | 288 +++++++++++++++--- 9 files changed, 517 insertions(+), 196 deletions(-) create mode 100644 apps/website/scripts/sync-vercel-redirects.ts diff --git a/apps/website/astro.config.ts b/apps/website/astro.config.ts index f57109ff09d..e8889d35518 100644 --- a/apps/website/astro.config.ts +++ b/apps/website/astro.config.ts @@ -5,7 +5,7 @@ import vue from '@astrojs/vue' import tailwindcss from '@tailwindcss/vite' import { isExcludedFromSitemap } from './src/config/indexing' import { DEFAULT_LOCALE, LOCALE_CODES } from './src/config/locales' -import { redirects } from './src/config/redirects' +import { astroRedirects } from './src/config/redirects' import { markdownTwins } from './src/integrations/markdown-twins' import { workshopReleaseGate } from './src/integrations/workshop-release-gate' import { sitemapAlternates } from './src/lib/hreflang' @@ -20,7 +20,7 @@ export default defineConfig({ // Keep MDX punctuation verbatim; SmartyPants would turn the source's straight // quotes into curly ones and drift from the rest of the site's copy. markdown: { smartypants: false }, - redirects, + redirects: astroRedirects, build: { assets: '_website' }, diff --git a/apps/website/package.json b/apps/website/package.json index 2c67717ac86..cd94e803c5c 100644 --- a/apps/website/package.json +++ b/apps/website/package.json @@ -27,6 +27,7 @@ "rate-card:generate-types": "openapi-ts -f openapi-ts.rate-card.config.ts && node -e \"const fs=require('fs'); const f='src/types/rate-card/zod.gen.ts'; fs.writeFileSync(f, fs.readFileSync(f,'utf8').replace(\\\"from 'zod/v3'\\\", \\\"from 'zod'\\\"));\" && pnpm exec oxfmt --ignore-path .gitignore --write src/types/rate-card/index.ts src/types/rate-card/types.gen.ts src/types/rate-card/zod.gen.ts", "rate-card:refresh-snapshot": "tsx ./scripts/refresh-rate-card-snapshot.ts", "generate:models": "tsx ./scripts/generate-models.ts", + "sync:redirects": "tsx ./scripts/sync-vercel-redirects.ts", "generate:workshop-catalog": "tsx ./scripts/generate-workshop-catalog.ts", "generate:workshop-display": "tsx ./scripts/generate-workshop-display.ts", "generate:workshop-router-contracts": "tsx ./scripts/generate-workshop-router-contracts.ts", diff --git a/apps/website/scripts/sync-vercel-redirects.ts b/apps/website/scripts/sync-vercel-redirects.ts new file mode 100644 index 00000000000..85a94676bab --- /dev/null +++ b/apps/website/scripts/sync-vercel-redirects.ts @@ -0,0 +1,20 @@ +import { readFileSync, writeFileSync } from 'node:fs' +import { dirname, join } from 'node:path' +import { fileURLToPath } from 'node:url' + +import { siteRedirects, toVercelRedirects } from '../src/config/redirects' + +const vercelJsonPath = join( + dirname(fileURLToPath(import.meta.url)), + '..', + 'vercel.json' +) + +const config: Record = JSON.parse( + readFileSync(vercelJsonPath, 'utf8') +) + +writeFileSync( + vercelJsonPath, + `${JSON.stringify({ ...config, redirects: toVercelRedirects(siteRedirects) }, null, 2)}\n` +) diff --git a/apps/website/src/config/redirects.test.ts b/apps/website/src/config/redirects.test.ts index 4e1860496ec..dad422d0205 100644 --- a/apps/website/src/config/redirects.test.ts +++ b/apps/website/src/config/redirects.test.ts @@ -5,137 +5,152 @@ import { fileURLToPath } from 'node:url' import { describe, expect, it } from 'vitest' import { z } from 'zod' -import { redirects as astroRedirects } from './redirects' -import { getRoutes } from './routes' +import { + astroRedirects, + isInternalDestination, + siteRedirects, + toVercelRedirects +} from './redirects' const appDir = join(dirname(fileURLToPath(import.meta.url)), '..', '..') -const VercelRedirectSchema = z.object({ - source: z.string(), - destination: z.string(), - permanent: z.boolean().optional(), - statusCode: z.number().optional() -}) - const VercelConfigSchema = z.object({ - redirects: z.array(VercelRedirectSchema) + redirects: z.array(z.unknown()), + headers: z.array(z.unknown()).default([]), + rewrites: z.array(z.unknown()).default([]) }) -type VercelRedirect = z.infer - -const { redirects } = VercelConfigSchema.parse( +const vercelConfig = VercelConfigSchema.parse( JSON.parse(readFileSync(join(appDir, 'vercel.json'), 'utf8')) ) -function findRedirect(source: string): VercelRedirect | undefined { - return redirects.find((redirect) => redirect.source === source) -} +const VERCEL_ROUTE_LIMIT = 2048 -const minimaxCanonical = `${getRoutes('en').minimax}/` -const minimaxZhCanonical = `${getRoutes('zh-CN').minimax}/` +const withoutSlash = (path: string) => path.replace(/\/$/, '') -describe('legacy MiniMax H3 redirects', () => { - it.for([ - { source: '/minimax', destination: minimaxCanonical }, - { source: '/minimax/', destination: minimaxCanonical }, - { source: '/zh-CN/minimax', destination: minimaxZhCanonical }, - { source: '/zh-CN/minimax/', destination: minimaxZhCanonical } - ])( - 'sends $source to $destination with a temporary status', - ({ source, destination }) => { - const redirect = findRedirect(source) - - if (!redirect) { - throw new Error(`${source} is missing from vercel.json`) - } - - expect(redirect.destination).toBe(destination) - expect(redirect.permanent, `${source} must be a temporary redirect`).toBe( - false - ) - } - ) +describe('vercel.json redirects', () => { + it('match the list in redirects.ts (run `pnpm --filter @comfyorg/website sync:redirects`)', () => { + expect(vercelConfig.redirects).toEqual(toVercelRedirects(siteRedirects)) + }) - it.for([ - getRoutes('en').minimax, - minimaxCanonical, - getRoutes('zh-CN').minimax, - minimaxZhCanonical - ])('leaves the new canonical path %s unredirected', (canonicalPath) => { - expect(findRedirect(canonicalPath)).toBeUndefined() + it('stay under the Vercel route limit', () => { + const routes = + vercelConfig.redirects.length + + vercelConfig.headers.length + + vercelConfig.rewrites.length + expect(routes).toBeLessThan(VERCEL_ROUTE_LIMIT) }) }) -/** - * Astro renders a stub page for each entry in its redirect map, and that stub's - * canonical is the destination string verbatim. Every real page self-canonicalizes - * with a trailing slash via `absoluteUrl()`, so a slash-less destination points - * the stub's canonical one hop short of the page it redirects to. - * - * #14390 fixed exactly this once already and it regressed, which is why it is a - * test now rather than a convention. - */ -describe('astro redirect destinations', () => { - const destinations = Object.values(astroRedirects).map((entry) => - typeof entry === 'string' ? entry : entry.destination - ) +describe('the redirect list', () => { + const sources = siteRedirects.map(({ source }) => source) - it('every destination ends with a trailing slash', () => { - const slashless = destinations.filter( - // A dynamic destination names a route rather than a URL, and Astro - // rejects it outright when it carries a trailing slash. - (destination) => !destination.includes('[') && !destination.endsWith('/') + it('names each source once', () => { + const duplicates = sources.filter( + (source, index) => sources.indexOf(source) !== index ) + expect(duplicates).toEqual([]) + }) + + it('writes sources as literal paths without a trailing slash', () => { + expect( + sources.filter((source) => source.endsWith('/') || /[:*(]/.test(source)) + ).toEqual([]) + }) + + it('ends every internal destination with a trailing slash', () => { expect( - slashless, - 'these canonicalize one hop short of their target' + siteRedirects + .map(({ destination }) => destination) + .filter( + (destination) => + isInternalDestination(destination) && !destination.endsWith('/') + ) + ).toEqual([]) + }) + + it('reaches every destination in one hop', () => { + const sourceSet = new Set(sources) + expect( + siteRedirects.filter( + ({ destination }) => + isInternalDestination(destination) && + sourceSet.has(withoutSlash(destination)) + ) ).toEqual([]) }) }) -describe('legacy Enterprise redirects', () => { - const cases = [ - { - source: '/cloud/enterprise', - destination: `${getRoutes('en').enterprise}/` - }, +describe('generated Vercel rules', () => { + const vercelRedirects = toVercelRedirects(siteRedirects) + const find = (source: string) => + vercelRedirects.find((redirect) => redirect.source === source) + + it.for([ + { source: '/cloud/enterprise', destination: '/enterprise/' }, + { source: '/zh-CN/affiliates', destination: '/affiliates/' }, { - source: '/zh-CN/cloud/enterprise', - destination: `${getRoutes('zh-CN').enterprise}/` + source: '/p/supported-models/t5xxl-fp8-e4m3fn-scaled', + destination: '/p/supported-models/t5xxl-fp16/' } - ] as const - const vercelCases = cases.flatMap(({ source, destination }) => [ - { source, destination }, - { source: `${source}/`, destination } - ]) - - it.for(vercelCases)( - 'sends $source to $destination permanently', + ])( + 'send $source and $source/ to $destination permanently', ({ source, destination }) => { - const redirect = findRedirect(source) - - if (!redirect) { - throw new Error(`${source} is missing from vercel.json`) + for (const form of [source, `${source}/`]) { + expect(find(form)).toEqual({ + source: form, + destination, + permanent: true + }) } - - expect(redirect.destination).toBe(destination) - expect(redirect.permanent).toBe(true) } ) - it.for(cases)( - 'sets the Astro redirect for $source', - ({ source, destination }) => { - expect(astroRedirects[source]).toEqual({ status: 301, destination }) + it('keeps only the listed rows temporary', () => { + expect( + vercelRedirects + .filter(({ permanent }) => !permanent) + .map(({ source }) => source) + ).toEqual([ + '/trust', + '/trust/', + '/login', + '/share-news', + '/share-news/', + '/share-news-pleaseeee', + '/share-news-pleaseeee/', + '/minimax', + '/minimax/', + '/zh-CN/minimax', + '/zh-CN/minimax/' + ]) + }) + + it('leaves /login/ to the Workshop sign-in page', () => { + expect(find('/login')?.permanent).toBe(false) + expect(find('/login/')).toBeUndefined() + }) + + it.for(['/minimax-h3', '/enterprise', '/zh-CN/enterprise', '/pricing'])( + 'leaves the destination %s unredirected', + (path) => { + expect(find(path)).toBeUndefined() + expect(find(`${path}/`)).toBeUndefined() } ) +}) + +describe('Astro redirects', () => { + it('cover every internal row, so local preview matches Vercel', () => { + expect(Object.keys(astroRedirects)).toEqual( + siteRedirects + .filter(({ destination }) => isInternalDestination(destination)) + .map(({ source }) => source) + ) + }) - it('leaves the canonical Enterprise routes unredirected', () => { - expect(findRedirect('/enterprise')).toBeUndefined() - expect(findRedirect('/enterprise/')).toBeUndefined() - expect(findRedirect('/zh-CN/enterprise')).toBeUndefined() - expect(findRedirect('/zh-CN/enterprise/')).toBeUndefined() - expect(findRedirect('/enterprise/managed-builds')).toBeUndefined() - expect(findRedirect('/enterprise/managed-builds/')).toBeUndefined() + it('leave off-site rows to Vercel', () => { + expect(astroRedirects['/blog']).toBeUndefined() + expect(astroRedirects['/login']).toBeUndefined() }) }) diff --git a/apps/website/src/config/redirects.ts b/apps/website/src/config/redirects.ts index 6e4d9bcf0cf..fc8492eca3d 100644 --- a/apps/website/src/config/redirects.ts +++ b/apps/website/src/config/redirects.ts @@ -1,43 +1,132 @@ import type { RedirectConfig } from 'astro' +import { models } from './models' + +interface SiteRedirect { + /** A literal path with no trailing slash; both slash forms redirect. */ + readonly source: `/${string}` + /** An internal destination ends in `/`, the form every page canonicalizes to. */ + readonly destination: string + /** Only a temporary (307) redirect sets this; every other row is a 308. */ + readonly temporaryBecause?: string + /** Set when `${source}/` is a live page, so only the bare source redirects. */ + readonly slashFormIsPageBecause?: string +} + +interface VercelRedirect { + readonly source: string + readonly destination: string + readonly permanent: boolean +} + +const modelAliasRedirects = models.flatMap(({ slug, canonicalSlug }) => + canonicalSlug + ? [ + { + source: `/p/supported-models/${slug}`, + destination: `/p/supported-models/${canonicalSlug}/` + } as const + ] + : [] +) + +/** + * Every redirect the website serves. `vercel.json` is generated from this + * (`pnpm --filter @comfyorg/website sync:redirects`) and a test fails when the + * two drift, so edit this list and never `vercel.json` by hand. + */ +export const siteRedirects: readonly SiteRedirect[] = [ + { source: '/career', destination: '/careers/' }, + { source: '/privacy', destination: '/privacy-policy/' }, + { source: '/press', destination: '/about/' }, + { source: '/blog', destination: 'https://blog.comfy.org/' }, + { source: '/discord', destination: 'https://discord.com/invite/comfyorg' }, + { + source: '/trust', + destination: 'https://trust.comfy.org', + temporaryBecause: 'points at a third-party (Vanta) trust center' + }, + { + source: '/login', + destination: 'https://cloud.comfy.org/cloud/login', + temporaryBecause: 'hands sign-in off to Comfy Cloud', + slashFormIsPageBecause: '/login/ is the Workshop sign-in page' + }, + { + source: '/share-news', + destination: 'https://vibe-code-support-page.vercel.app/', + temporaryBecause: 'a campaign link; a 301 stuck in the edge cache (#18611)' + }, + { + source: '/share-news-pleaseeee', + destination: 'https://vibe-code-support-page.vercel.app/', + temporaryBecause: 'a campaign link; a 301 stuck in the edge cache (#18611)' + }, + { + source: '/minimax', + destination: '/minimax-h3/', + temporaryBecause: 'the MiniMax launch may reuse /minimax/' + }, + { + source: '/zh-CN/minimax', + destination: '/zh-CN/minimax-h3/', + temporaryBecause: 'the MiniMax launch may reuse /minimax/' + }, + { source: '/cloud/enterprise', destination: '/enterprise/' }, + { source: '/zh-CN/cloud/enterprise', destination: '/zh-CN/enterprise/' }, + { + source: + '/cloud/enterprise-case-studies/comfyui-at-architectural-scale-how-moment-factory-reimagined-3d-projection-mapping', + destination: '/customers/moment-factory/' + }, + { + source: + '/cloud/enterprise-case-studies/how-series-entertainment-rebuilt-game-and-video-production-with-comfyui', + destination: '/customers/series-entertainment/' + }, + { source: '/zh-CN/terms-of-service', destination: '/terms-of-service/' }, + { source: '/api', destination: '/platform/' }, + { source: '/zh-CN/api', destination: '/zh-CN/platform/' }, + { source: '/platform/models', destination: '/platform/router/' }, + { source: '/zh-CN/platform/models', destination: '/zh-CN/platform/router/' }, + { source: '/cloud/pricing', destination: '/pricing/' }, + { source: '/zh-CN/cloud/pricing', destination: '/zh-CN/pricing/' }, + // Affiliates exists in English only. + { source: '/zh-CN/affiliates', destination: '/affiliates/' }, + { source: '/zh-CN/affiliates/terms', destination: '/affiliates/terms/' }, + ...modelAliasRedirects +] + +export function isInternalDestination(destination: string): boolean { + return destination.startsWith('/') +} + +export function toVercelRedirects( + rows: readonly SiteRedirect[] +): VercelRedirect[] { + return rows.flatMap( + ({ source, destination, temporaryBecause, slashFormIsPageBecause }) => + (slashFormIsPageBecause ? [source] : [source, `${source}/`]).map( + (form) => ({ + source: form, + destination, + permanent: temporaryBecause === undefined + }) + ) + ) +} + /** - * Astro's redirect map. - * - * Trailing slashes on destinations are load-bearing: Astro renders a stub page - * per redirect whose canonical is the destination string verbatim, and every - * real page self-canonicalizes with a slash via `absoluteUrl()`. A slash-less - * destination canonicalizes one hop short of the page it redirects to, which is - * what #14390 fixed once already. - * - * The map lives here rather than inline in `astro.config.ts` so `redirects.test.ts` - * can assert over the values Astro actually receives. It used to scrape the - * config's source text, which stopped checking any entry written in a shape the - * regex did not anticipate. + * Astro renders each entry as a meta-refresh stub so `astro preview` and the + * e2e suite see the redirects; on Vercel the `vercel.json` rule answers first. + * Astro cannot redirect off-site, so external rows live in `vercel.json` only. */ -export const redirects = { - '/cloud/enterprise': { status: 301, destination: '/enterprise/' }, - '/zh-CN/cloud/enterprise': { - status: 301, - destination: '/zh-CN/enterprise/' - }, - '/cloud/enterprise-case-studies/comfyui-at-architectural-scale-how-moment-factory-reimagined-3d-projection-mapping': - '/customers/moment-factory/', - '/cloud/enterprise-case-studies/how-series-entertainment-rebuilt-game-and-video-production-with-comfyui': - '/customers/series-entertainment/', - '/zh-CN/terms-of-service': '/terms-of-service/', - // The platform rename, added on main while this branch was open. - '/api': '/platform/', - '/zh-CN/api': '/zh-CN/platform/', - // Models API became Comfy Router and moved back to /platform/router. - '/platform/models': '/platform/router/', - '/zh-CN/platform/models': '/zh-CN/platform/router/', - // Pricing moved out from under /cloud, also from main. - '/cloud/pricing': '/pricing/', - '/zh-CN/cloud/pricing': '/zh-CN/pricing/', - // Affiliates exists in English only. Without these a reader who swaps the - // locale prefix by hand gets a 404 instead of the page they asked for. - '/zh-CN/affiliates': '/affiliates/', - '/zh-CN/affiliates/terms': '/affiliates/terms/', - '/minimax': { status: 307, destination: '/minimax-h3/' }, - '/zh-CN/minimax': { status: 307, destination: '/zh-CN/minimax-h3/' } -} satisfies Record +export const astroRedirects: Record = + Object.fromEntries( + siteRedirects + .filter(({ destination }) => isInternalDestination(destination)) + .map(({ source, destination, temporaryBecause }) => [ + source, + { status: temporaryBecause ? 307 : 308, destination } + ]) + ) diff --git a/apps/website/src/lib/hreflang.test.ts b/apps/website/src/lib/hreflang.test.ts index e71ec97b14f..c61dc623c33 100644 --- a/apps/website/src/lib/hreflang.test.ts +++ b/apps/website/src/lib/hreflang.test.ts @@ -7,7 +7,7 @@ import { describe, expect, it } from 'vitest' import { isNoindexPathname } from '../config/indexing' import type { Locale } from '../config/locales' import { DEFAULT_LOCALE, LOCALE_CODES, LOCALES } from '../config/locales' -import { redirects } from '../config/redirects' +import { astroRedirects } from '../config/redirects' import { routeOf } from '../utils/hreflangRoutes' import type { Alternate } from './hreflang' import { @@ -196,7 +196,7 @@ describe('the emitter agrees with the page tree', () => { }) const redirected = new Set( - Object.keys(redirects).map((source) => source.replace(/\/$/, '')) + Object.keys(astroRedirects).map((source) => source.replace(/\/$/, '')) ) const publishedPages = astroFiles(pagesDir) diff --git a/apps/website/src/pages/p/supported-models/[slug].astro b/apps/website/src/pages/p/supported-models/[slug].astro index ac1f35e6c1b..006ef953135 100644 --- a/apps/website/src/pages/p/supported-models/[slug].astro +++ b/apps/website/src/pages/p/supported-models/[slug].astro @@ -16,18 +16,14 @@ import { buildModelFaqs, modelFaqJsonLd } from '../../../utils/modelFaq' import { getPageDescription } from '../../../utils/modelSeoCopy' export const getStaticPaths: GetStaticPaths = () => { - return models.map((model) => ({ - params: { slug: model.slug } - })) + return models + .filter((model) => !model.canonicalSlug) + .map((model) => ({ params: { slug: model.slug } })) } const { slug } = Astro.params const model = getModelBySlug(slug as string)! -if (model.canonicalSlug) { - return Astro.redirect(`/p/supported-models/${model.canonicalSlug}/`, 301) -} - const { displayName } = model // fal-style LLMs surface: markdown twin + agent handoff links. diff --git a/apps/website/src/utils/hreflangAudit.ts b/apps/website/src/utils/hreflangAudit.ts index dde6f5e2736..16922310901 100644 --- a/apps/website/src/utils/hreflangAudit.ts +++ b/apps/website/src/utils/hreflangAudit.ts @@ -9,7 +9,7 @@ import type { Alternate } from './hreflangRoutes' import { isExcludedFromSitemap } from '../config/indexing' import { DEFAULT_LOCALE, LOCALE_CODES, LOCALES } from '../config/locales' -import { redirects } from '../config/redirects' +import { astroRedirects } from '../config/redirects' import { supportsLocaleRoute } from '../config/routes' import { unprefixed } from './hreflangRoutes' @@ -71,7 +71,7 @@ function isClustered( alternates.length > 0 || (LOCALE_CODES.some((locale) => supportsLocaleRoute(locale, path)) && !isExcludedFromSitemap(`${origin}${route}`) && - !Object.hasOwn(redirects, route.replace(/\/$/, ''))) + !Object.hasOwn(astroRedirects, route.replace(/\/$/, ''))) ) } diff --git a/apps/website/vercel.json b/apps/website/vercel.json index f8c50805c9a..679394f7f01 100644 --- a/apps/website/vercel.json +++ b/apps/website/vercel.json @@ -54,14 +54,89 @@ "redirects": [ { "source": "/career", - "destination": "/careers", + "destination": "/careers/", + "permanent": true + }, + { + "source": "/career/", + "destination": "/careers/", "permanent": true }, { "source": "/privacy", - "destination": "/privacy-policy", + "destination": "/privacy-policy/", + "permanent": true + }, + { + "source": "/privacy/", + "destination": "/privacy-policy/", + "permanent": true + }, + { + "source": "/press", + "destination": "/about/", + "permanent": true + }, + { + "source": "/press/", + "destination": "/about/", + "permanent": true + }, + { + "source": "/blog", + "destination": "https://blog.comfy.org/", + "permanent": true + }, + { + "source": "/blog/", + "destination": "https://blog.comfy.org/", + "permanent": true + }, + { + "source": "/discord", + "destination": "https://discord.com/invite/comfyorg", + "permanent": true + }, + { + "source": "/discord/", + "destination": "https://discord.com/invite/comfyorg", "permanent": true }, + { + "source": "/trust", + "destination": "https://trust.comfy.org", + "permanent": false + }, + { + "source": "/trust/", + "destination": "https://trust.comfy.org", + "permanent": false + }, + { + "source": "/login", + "destination": "https://cloud.comfy.org/cloud/login", + "permanent": false + }, + { + "source": "/share-news", + "destination": "https://vibe-code-support-page.vercel.app/", + "permanent": false + }, + { + "source": "/share-news/", + "destination": "https://vibe-code-support-page.vercel.app/", + "permanent": false + }, + { + "source": "/share-news-pleaseeee", + "destination": "https://vibe-code-support-page.vercel.app/", + "permanent": false + }, + { + "source": "/share-news-pleaseeee/", + "destination": "https://vibe-code-support-page.vercel.app/", + "permanent": false + }, { "source": "/minimax", "destination": "/minimax-h3/", @@ -103,109 +178,234 @@ "permanent": true }, { - "source": "/blog", - "destination": "https://blog.comfy.org/", + "source": "/cloud/enterprise-case-studies/comfyui-at-architectural-scale-how-moment-factory-reimagined-3d-projection-mapping", + "destination": "/customers/moment-factory/", "permanent": true }, { - "source": "/discord", - "destination": "https://discord.com/invite/comfyorg", + "source": "/cloud/enterprise-case-studies/comfyui-at-architectural-scale-how-moment-factory-reimagined-3d-projection-mapping/", + "destination": "/customers/moment-factory/", "permanent": true }, { - "source": "/press", - "destination": "/about", + "source": "/cloud/enterprise-case-studies/how-series-entertainment-rebuilt-game-and-video-production-with-comfyui", + "destination": "/customers/series-entertainment/", "permanent": true }, { - "source": "/trust", - "destination": "https://trust.comfy.org", - "permanent": false + "source": "/cloud/enterprise-case-studies/how-series-entertainment-rebuilt-game-and-video-production-with-comfyui/", + "destination": "/customers/series-entertainment/", + "permanent": true }, { - "source": "/login", - "destination": "https://cloud.comfy.org/cloud/login", - "permanent": false + "source": "/zh-CN/terms-of-service", + "destination": "/terms-of-service/", + "permanent": true + }, + { + "source": "/zh-CN/terms-of-service/", + "destination": "/terms-of-service/", + "permanent": true }, { "source": "/api", - "destination": "/platform", + "destination": "/platform/", + "permanent": true + }, + { + "source": "/api/", + "destination": "/platform/", "permanent": true }, { "source": "/zh-CN/api", - "destination": "/zh-CN/platform", + "destination": "/zh-CN/platform/", + "permanent": true + }, + { + "source": "/zh-CN/api/", + "destination": "/zh-CN/platform/", "permanent": true }, { "source": "/platform/models", - "destination": "/platform/router", + "destination": "/platform/router/", + "permanent": true + }, + { + "source": "/platform/models/", + "destination": "/platform/router/", "permanent": true }, { "source": "/zh-CN/platform/models", - "destination": "/zh-CN/platform/router", + "destination": "/zh-CN/platform/router/", + "permanent": true + }, + { + "source": "/zh-CN/platform/models/", + "destination": "/zh-CN/platform/router/", "permanent": true }, { "source": "/cloud/pricing", - "destination": "/pricing", + "destination": "/pricing/", + "permanent": true + }, + { + "source": "/cloud/pricing/", + "destination": "/pricing/", "permanent": true }, { "source": "/zh-CN/cloud/pricing", - "destination": "/zh-CN/pricing", + "destination": "/zh-CN/pricing/", "permanent": true }, { - "source": "/api/", - "destination": "/platform", + "source": "/zh-CN/cloud/pricing/", + "destination": "/zh-CN/pricing/", "permanent": true }, { - "source": "/zh-CN/api/", - "destination": "/zh-CN/platform", + "source": "/zh-CN/affiliates", + "destination": "/affiliates/", "permanent": true }, { - "source": "/cloud/pricing/", - "destination": "/pricing", + "source": "/zh-CN/affiliates/", + "destination": "/affiliates/", "permanent": true }, { - "source": "/zh-CN/cloud/pricing/", - "destination": "/zh-CN/pricing", + "source": "/zh-CN/affiliates/terms", + "destination": "/affiliates/terms/", "permanent": true }, { - "source": "/platform/models/", - "destination": "/platform/router", + "source": "/zh-CN/affiliates/terms/", + "destination": "/affiliates/terms/", "permanent": true }, { - "source": "/zh-CN/platform/models/", - "destination": "/zh-CN/platform/router", + "source": "/p/supported-models/t5xxl-fp8-e4m3fn-scaled", + "destination": "/p/supported-models/t5xxl-fp16/", "permanent": true }, { - "source": "/share-news", - "destination": "https://vibe-code-support-page.vercel.app/", - "permanent": false + "source": "/p/supported-models/t5xxl-fp8-e4m3fn-scaled/", + "destination": "/p/supported-models/t5xxl-fp16/", + "permanent": true }, { - "source": "/share-news/", - "destination": "https://vibe-code-support-page.vercel.app/", - "permanent": false + "source": "/p/supported-models/gemma-3-12b-it", + "destination": "/p/supported-models/gemma-3-12b-it-fp4-mixed/", + "permanent": true }, { - "source": "/share-news-pleaseeee", - "destination": "https://vibe-code-support-page.vercel.app/", - "permanent": false + "source": "/p/supported-models/gemma-3-12b-it/", + "destination": "/p/supported-models/gemma-3-12b-it-fp4-mixed/", + "permanent": true }, { - "source": "/share-news-pleaseeee/", - "destination": "https://vibe-code-support-page.vercel.app/", - "permanent": false + "source": "/p/supported-models/umt5-xxl-fp16", + "destination": "/p/supported-models/umt5-xxl-fp8-e4m3fn-scaled/", + "permanent": true + }, + { + "source": "/p/supported-models/umt5-xxl-fp16/", + "destination": "/p/supported-models/umt5-xxl-fp8-e4m3fn-scaled/", + "permanent": true + }, + { + "source": "/p/supported-models/qwen-2-5-vl-7b", + "destination": "/p/supported-models/qwen-2-5-vl-7b-fp8-scaled/", + "permanent": true + }, + { + "source": "/p/supported-models/qwen-2-5-vl-7b/", + "destination": "/p/supported-models/qwen-2-5-vl-7b-fp8-scaled/", + "permanent": true + }, + { + "source": "/p/supported-models/qwen3vl-4b-bf16", + "destination": "/p/supported-models/qwen3vl-4b-fp8-scaled/", + "permanent": true + }, + { + "source": "/p/supported-models/qwen3vl-4b-bf16/", + "destination": "/p/supported-models/qwen3vl-4b-fp8-scaled/", + "permanent": true + }, + { + "source": "/p/supported-models/mistral-3-small-flux2-fp8", + "destination": "/p/supported-models/mistral-3-small-flux2-bf16/", + "permanent": true + }, + { + "source": "/p/supported-models/mistral-3-small-flux2-fp8/", + "destination": "/p/supported-models/mistral-3-small-flux2-bf16/", + "permanent": true + }, + { + "source": "/p/supported-models/qwen-image-edit-2511-fp8mixed", + "destination": "/p/supported-models/qwen-image-edit-2511-bf16/", + "permanent": true + }, + { + "source": "/p/supported-models/qwen-image-edit-2511-fp8mixed/", + "destination": "/p/supported-models/qwen-image-edit-2511-bf16/", + "permanent": true + }, + { + "source": "/p/supported-models/qwen-3-8b", + "destination": "/p/supported-models/qwen-3-8b-fp8mixed/", + "permanent": true + }, + { + "source": "/p/supported-models/qwen-3-8b/", + "destination": "/p/supported-models/qwen-3-8b-fp8mixed/", + "permanent": true + }, + { + "source": "/p/supported-models/qwen-image-2512-bf16", + "destination": "/p/supported-models/qwen-image-2512-fp8-e4m3fn/", + "permanent": true + }, + { + "source": "/p/supported-models/qwen-image-2512-bf16/", + "destination": "/p/supported-models/qwen-image-2512-fp8-e4m3fn/", + "permanent": true + }, + { + "source": "/p/supported-models/gemma-2-2b-it-elm-fp8-scaled", + "destination": "/p/supported-models/gemma-2-2b-it-elm-bf16/", + "permanent": true + }, + { + "source": "/p/supported-models/gemma-2-2b-it-elm-fp8-scaled/", + "destination": "/p/supported-models/gemma-2-2b-it-elm-bf16/", + "permanent": true + }, + { + "source": "/p/supported-models/gemma-3-12b-it-fp8-scaled", + "destination": "/p/supported-models/gemma-3-12b-it-fp4-mixed/", + "permanent": true + }, + { + "source": "/p/supported-models/gemma-3-12b-it-fp8-scaled/", + "destination": "/p/supported-models/gemma-3-12b-it-fp4-mixed/", + "permanent": true + }, + { + "source": "/p/supported-models/grok-image", + "destination": "/p/supported-models/grok-imagine/", + "permanent": true + }, + { + "source": "/p/supported-models/grok-image/", + "destination": "/p/supported-models/grok-imagine/", + "permanent": true } ] } From bfb89e96e7c6aa53d23853db21ab5ea582c307f9 Mon Sep 17 00:00:00 2001 From: Maanil Verma Date: Tue, 29 Sep 2026 11:05:13 +0530 Subject: [PATCH 02/28] fix(website): make the /minimax redirects permanent /minimax/ had 7.6k clicks in the 90 days before it moved to /minimax-h3/. A 307 is not a canonical signal, so that equity never transferred. The redirects test encoded the temporary status on purpose; it now asserts 308. --- apps/website/src/config/redirects.test.ts | 8 +++----- apps/website/src/config/redirects.ts | 12 ++---------- apps/website/vercel.json | 8 ++++---- 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/apps/website/src/config/redirects.test.ts b/apps/website/src/config/redirects.test.ts index dad422d0205..444541bd82c 100644 --- a/apps/website/src/config/redirects.test.ts +++ b/apps/website/src/config/redirects.test.ts @@ -87,6 +87,8 @@ describe('generated Vercel rules', () => { vercelRedirects.find((redirect) => redirect.source === source) it.for([ + { source: '/minimax', destination: '/minimax-h3/' }, + { source: '/zh-CN/minimax', destination: '/zh-CN/minimax-h3/' }, { source: '/cloud/enterprise', destination: '/enterprise/' }, { source: '/zh-CN/affiliates', destination: '/affiliates/' }, { @@ -118,11 +120,7 @@ describe('generated Vercel rules', () => { '/share-news', '/share-news/', '/share-news-pleaseeee', - '/share-news-pleaseeee/', - '/minimax', - '/minimax/', - '/zh-CN/minimax', - '/zh-CN/minimax/' + '/share-news-pleaseeee/' ]) }) diff --git a/apps/website/src/config/redirects.ts b/apps/website/src/config/redirects.ts index fc8492eca3d..351a1e5bc06 100644 --- a/apps/website/src/config/redirects.ts +++ b/apps/website/src/config/redirects.ts @@ -62,16 +62,8 @@ export const siteRedirects: readonly SiteRedirect[] = [ destination: 'https://vibe-code-support-page.vercel.app/', temporaryBecause: 'a campaign link; a 301 stuck in the edge cache (#18611)' }, - { - source: '/minimax', - destination: '/minimax-h3/', - temporaryBecause: 'the MiniMax launch may reuse /minimax/' - }, - { - source: '/zh-CN/minimax', - destination: '/zh-CN/minimax-h3/', - temporaryBecause: 'the MiniMax launch may reuse /minimax/' - }, + { source: '/minimax', destination: '/minimax-h3/' }, + { source: '/zh-CN/minimax', destination: '/zh-CN/minimax-h3/' }, { source: '/cloud/enterprise', destination: '/enterprise/' }, { source: '/zh-CN/cloud/enterprise', destination: '/zh-CN/enterprise/' }, { diff --git a/apps/website/vercel.json b/apps/website/vercel.json index 679394f7f01..0ded5e1f182 100644 --- a/apps/website/vercel.json +++ b/apps/website/vercel.json @@ -140,22 +140,22 @@ { "source": "/minimax", "destination": "/minimax-h3/", - "permanent": false + "permanent": true }, { "source": "/minimax/", "destination": "/minimax-h3/", - "permanent": false + "permanent": true }, { "source": "/zh-CN/minimax", "destination": "/zh-CN/minimax-h3/", - "permanent": false + "permanent": true }, { "source": "/zh-CN/minimax/", "destination": "/zh-CN/minimax-h3/", - "permanent": false + "permanent": true }, { "source": "/cloud/enterprise", From 2c78d0a306be9fe5c148d5f73454b25c96b280f2 Mon Sep 17 00:00:00 2001 From: Maanil Verma Date: Tue, 29 Sep 2026 11:57:08 +0530 Subject: [PATCH 03/28] fix(website): harden the redirect list from review - Sources must be plain literal paths, so a generated slug can't smuggle a path-to-regexp pattern into vercel.json. - A row whose slash form is a page stays out of Astro's map, since its stub would overwrite that page. - Both emitters read the marker fields by definedness. - The test derives MiniMax, Enterprise and Pricing paths from routes.ts. - sync:redirects validates vercel.json before rewriting it. --- apps/website/scripts/sync-vercel-redirects.ts | 9 ++++- apps/website/src/config/redirects.test.ts | 22 +++++++---- apps/website/src/config/redirects.ts | 37 ++++++++++++------- 3 files changed, 45 insertions(+), 23 deletions(-) diff --git a/apps/website/scripts/sync-vercel-redirects.ts b/apps/website/scripts/sync-vercel-redirects.ts index 85a94676bab..82ac34d5ffe 100644 --- a/apps/website/scripts/sync-vercel-redirects.ts +++ b/apps/website/scripts/sync-vercel-redirects.ts @@ -2,6 +2,8 @@ import { readFileSync, writeFileSync } from 'node:fs' import { dirname, join } from 'node:path' import { fileURLToPath } from 'node:url' +import { z } from 'zod' + import { siteRedirects, toVercelRedirects } from '../src/config/redirects' const vercelJsonPath = join( @@ -10,8 +12,11 @@ const vercelJsonPath = join( 'vercel.json' ) -const config: Record = JSON.parse( - readFileSync(vercelJsonPath, 'utf8') +const config = z + .record(z.string(), z.unknown()) + .parse(JSON.parse(readFileSync(vercelJsonPath, 'utf8'))) +z.object({ buildCommand: z.string(), redirects: z.array(z.unknown()) }).parse( + config ) writeFileSync( diff --git a/apps/website/src/config/redirects.test.ts b/apps/website/src/config/redirects.test.ts index 444541bd82c..7bb1bacf34d 100644 --- a/apps/website/src/config/redirects.test.ts +++ b/apps/website/src/config/redirects.test.ts @@ -11,6 +11,7 @@ import { siteRedirects, toVercelRedirects } from './redirects' +import { getRoutes } from './routes' const appDir = join(dirname(fileURLToPath(import.meta.url)), '..', '..') @@ -28,6 +29,9 @@ const VERCEL_ROUTE_LIMIT = 2048 const withoutSlash = (path: string) => path.replace(/\/$/, '') +const en = getRoutes('en') +const zh = getRoutes('zh-CN') + describe('vercel.json redirects', () => { it('match the list in redirects.ts (run `pnpm --filter @comfyorg/website sync:redirects`)', () => { expect(vercelConfig.redirects).toEqual(toVercelRedirects(siteRedirects)) @@ -54,7 +58,7 @@ describe('the redirect list', () => { it('writes sources as literal paths without a trailing slash', () => { expect( - sources.filter((source) => source.endsWith('/') || /[:*(]/.test(source)) + sources.filter((source) => !/^(\/[A-Za-z0-9._-]+)+$/.test(source)) ).toEqual([]) }) @@ -87,9 +91,9 @@ describe('generated Vercel rules', () => { vercelRedirects.find((redirect) => redirect.source === source) it.for([ - { source: '/minimax', destination: '/minimax-h3/' }, - { source: '/zh-CN/minimax', destination: '/zh-CN/minimax-h3/' }, - { source: '/cloud/enterprise', destination: '/enterprise/' }, + { source: '/minimax', destination: `${en.minimax}/` }, + { source: '/zh-CN/minimax', destination: `${zh.minimax}/` }, + { source: '/cloud/enterprise', destination: `${en.enterprise}/` }, { source: '/zh-CN/affiliates', destination: '/affiliates/' }, { source: '/p/supported-models/t5xxl-fp8-e4m3fn-scaled', @@ -129,7 +133,7 @@ describe('generated Vercel rules', () => { expect(find('/login/')).toBeUndefined() }) - it.for(['/minimax-h3', '/enterprise', '/zh-CN/enterprise', '/pricing'])( + it.for([en.minimax, zh.minimax, en.enterprise, zh.enterprise, en.pricing])( 'leaves the destination %s unredirected', (path) => { expect(find(path)).toBeUndefined() @@ -139,10 +143,14 @@ describe('generated Vercel rules', () => { }) describe('Astro redirects', () => { - it('cover every internal row, so local preview matches Vercel', () => { + it('cover every internal row whose slash form redirects', () => { expect(Object.keys(astroRedirects)).toEqual( siteRedirects - .filter(({ destination }) => isInternalDestination(destination)) + .filter( + ({ destination, slashFormIsPageBecause }) => + isInternalDestination(destination) && + slashFormIsPageBecause === undefined + ) .map(({ source }) => source) ) }) diff --git a/apps/website/src/config/redirects.ts b/apps/website/src/config/redirects.ts index 351a1e5bc06..e4b131231be 100644 --- a/apps/website/src/config/redirects.ts +++ b/apps/website/src/config/redirects.ts @@ -93,32 +93,41 @@ export function isInternalDestination(destination: string): boolean { return destination.startsWith('/') } +const isPermanent = (row: SiteRedirect) => row.temporaryBecause === undefined + +const redirectsSlashForm = (row: SiteRedirect) => + row.slashFormIsPageBecause === undefined + export function toVercelRedirects( rows: readonly SiteRedirect[] ): VercelRedirect[] { - return rows.flatMap( - ({ source, destination, temporaryBecause, slashFormIsPageBecause }) => - (slashFormIsPageBecause ? [source] : [source, `${source}/`]).map( - (form) => ({ - source: form, - destination, - permanent: temporaryBecause === undefined - }) - ) + return rows.flatMap((row) => + (redirectsSlashForm(row) + ? [row.source, `${row.source}/`] + : [row.source] + ).map((source) => ({ + source, + destination: row.destination, + permanent: isPermanent(row) + })) ) } /** * Astro renders each entry as a meta-refresh stub so `astro preview` and the * e2e suite see the redirects; on Vercel the `vercel.json` rule answers first. - * Astro cannot redirect off-site, so external rows live in `vercel.json` only. + * Astro cannot redirect off-site, and a stub for `/x` is the same file as a + * page at `/x/`, so those rows live in `vercel.json` only. */ export const astroRedirects: Record = Object.fromEntries( siteRedirects - .filter(({ destination }) => isInternalDestination(destination)) - .map(({ source, destination, temporaryBecause }) => [ - source, - { status: temporaryBecause ? 307 : 308, destination } + .filter( + (row) => + isInternalDestination(row.destination) && redirectsSlashForm(row) + ) + .map((row) => [ + row.source, + { status: isPermanent(row) ? 308 : 307, destination: row.destination } ]) ) From cea4af89d2a544919bd1aa205799a5affcdc24b6 Mon Sep 17 00:00:00 2001 From: Maanil Verma Date: Tue, 29 Sep 2026 12:24:56 +0530 Subject: [PATCH 04/28] feat(website): generate the reviewed old-to-new model URL map Derives a /hub/models// slug for each of the 148 model pages and each of the 212 aliases from the display name. Nothing reads the map yet; the switch-over uses it later. --- .oxfmtrc.json | 1 + apps/website/MODEL_URL_MAP.md | 409 +++++ apps/website/package.json | 1 + .../scripts/generate-model-url-map.test.ts | 154 ++ .../website/scripts/generate-model-url-map.ts | 187 +++ apps/website/src/config/model-urls.ts | 1446 +++++++++++++++++ 6 files changed, 2198 insertions(+) create mode 100644 apps/website/MODEL_URL_MAP.md create mode 100644 apps/website/scripts/generate-model-url-map.test.ts create mode 100644 apps/website/scripts/generate-model-url-map.ts create mode 100644 apps/website/src/config/model-urls.ts diff --git a/.oxfmtrc.json b/.oxfmtrc.json index 7fc44fddc16..767b43d39bb 100644 --- a/.oxfmtrc.json +++ b/.oxfmtrc.json @@ -17,6 +17,7 @@ "apps/website/src/content/**/*.mdx", "apps/website/src/assets/world-countries.json", "apps/website/MODELS_TEST_RESULTS.md", + "apps/website/MODEL_URL_MAP.md", "apps/website/testing/models-test-results.json", "apps/website/src/content/workshop-display.json", "apps/website/src/content/workshop-models.json", diff --git a/apps/website/MODEL_URL_MAP.md b/apps/website/MODEL_URL_MAP.md new file mode 100644 index 00000000000..e9b640312d6 --- /dev/null +++ b/apps/website/MODEL_URL_MAP.md @@ -0,0 +1,409 @@ +# Model page URL map + +Generated by `scripts/generate-model-url-map.ts`. Old URL `/models//`, final URL `/hub/models//`. + +## Check these first (31) + +| New slug | Display name | Why | +| --- | --- | --- | +| `flux-tools-erase` | FLUX Tools Erase | no task words in the name; the product name stands in for the task; no version in the name, Router id is bfl/erase-v1 | +| `flux-pro-expand` | FLUX Pro Expand | no task words in the name; the product name stands in for the task; no version in the name, Router id is bfl/flux-pro-1.0-expand | +| `flux-pro-fill` | FLUX Pro Fill | no task words in the name; the product name stands in for the task; no version in the name, Router id is bfl/flux-pro-1.0-fill | +| `flux-video-upscale` | FLUX Video Upscale | no task words in the name; the product name stands in for the task; no version in the name, Router id is bfl/video-upscale-v1 | +| `flux-virtual-try-on` | FLUX Virtual Try-On | no task words in the name; the product name stands in for the task; no version in the name, Router id is bfl/vto-v1 | +| `bria-eraser` | Bria Eraser | no task words in the name; the product name stands in for the task | +| `bria-expand-image` | Bria Expand Image | no task words in the name; the product name stands in for the task | +| `bria-generative-fill` | Bria Generative Fill | no task words in the name; the product name stands in for the task | +| `bria-green-screen-video` | Bria Green Screen Video | no task words in the name; the product name stands in for the task | +| `bria-increase-resolution` | Bria Increase Resolution | no task words in the name; the product name stands in for the task | +| `bria-rmbg-2-0` | Bria RMBG 2.0 | no task words in the name; the product name stands in for the task | +| `bria-remove-video-background` | Bria Remove Video Background | no task words in the name; the product name stands in for the task | +| `bria-replace-video-background` | Bria Replace Video Background | no task words in the name; the product name stands in for the task | +| `seedream-5-0-pro-layer-separation` | Seedream 5.0 Pro Layer Separation | no task words in the name; the product name stands in for the task | +| `elevenlabs-text-to-dialogue` | ElevenLabs Text-to-Dialogue | no version in the name, Router id is elevenlabs/eleven_v3 | +| `magnific-skin-enhancer` | Magnific Skin Enhancer | no task words in the name; the product name stands in for the task | +| `nano-banana-image-edit` | Nano Banana Image Edit | no version in the name, Router id is vertexai/gemini-2.5-flash-image | +| `nano-banana-text-to-image` | Nano Banana Text-to-Image | no version in the name, Router id is vertexai/gemini-2.5-flash-image | +| `nano-banana-pro-image-edit` | Nano Banana Pro Image Edit | no version in the name, Router id is vertexai/gemini-3-pro-image | +| `nano-banana-pro-text-to-image` | Nano Banana Pro Text-to-Image | no version in the name, Router id is vertexai/gemini-3-pro-image | +| `kling-avatar` | Kling Avatar | no task words in the name; the product name stands in for the task; no version in the name, Router id is kling/videos-avatar-image2video | +| `kling-lip-sync-text-to-video` | Kling Lip Sync Text-to-Video | name says "text-to-video", task data says edit-videos | +| `gpt-image-1-image-edit` | GPT Image 1 Image Edit | name says "image-edit", task data says generate-images | +| `gpt-image-1-5-image-edit` | GPT Image 1.5 Image Edit | name says "image-edit", task data says generate-images | +| `happyhorse-reference-to-video` | HappyHorse Reference-to-Video | no version in the name, Router id is wan/happyhorse-1.1-r2v | +| `happyhorse-text-to-video` | HappyHorse Text-to-Video | no version in the name, Router id is wan/happyhorse-1.1-t2v | +| `happyhorse-video-edit` | HappyHorse Video Edit | no version in the name, Router id is wan/happyhorse-1.0-video-edit | +| `wan-2-6-reference-to-video` | Wan 2.6 Reference-to-Video | name says "reference-to-video", task data says edit-videos | +| `flashvsr` | FlashVSR | no task words in the name; the product name stands in for the task | +| `seedvr2-image-upscaler` | SeedVR2 Image Upscaler | no task words in the name; the product name stands in for the task | +| `ultimate-image-upscaler` | Ultimate Image Upscaler | no task words in the name; the product name stands in for the task | + +## Model pages (148) + +| Provider | Display name | Old slug | New slug | +| --- | --- | --- | --- | +| Beeble | Beeble SwitchX Image Edit | `beeble--switchx-image-edit--edit-images` | `beeble-switchx-image-edit` | +| Beeble | Beeble SwitchX Video Edit | `beeble--switchx-video-edit--edit-videos` | `beeble-switchx-video-edit` | +| Black Forest Labs | FLUX 2 Max Text-to-Image | `bfl--flux-2-max--generate-images` | `flux-2-max-text-to-image` | +| Black Forest Labs | FLUX 2 Pro Text-to-Image | `bfl--flux-2-pro--generate-images` | `flux-2-pro-text-to-image` | +| Black Forest Labs | FLUX 3 Video Image-to-Video | `bfl--flux-3-image-to-video--animate-images` | `flux-3-video-image-to-video` | +| Black Forest Labs | FLUX 3 Video Text-to-Video | `bfl--flux-3-text-to-video--generate-videos` | `flux-3-video-text-to-video` | +| Black Forest Labs | FLUX Tools Erase | `bfl--flux-erase--edit-images` | `flux-tools-erase` | +| Black Forest Labs | FLUX.1 Kontext Max Image Edit | `bfl--flux-kontext-max--edit-images` | `flux-1-kontext-max-image-edit` | +| Black Forest Labs | FLUX.1 Kontext Pro Image Edit | `bfl--flux-kontext-pro--edit-images` | `flux-1-kontext-pro-image-edit` | +| Black Forest Labs | FLUX Pro 1.1 Text-to-Image | `bfl--flux-pro-1.1--generate-images` | `flux-pro-1-1-text-to-image` | +| Black Forest Labs | FLUX Pro 1.1 Ultra Text-to-Image | `bfl--flux-pro-1.1-ultra--generate-images` | `flux-pro-1-1-ultra-text-to-image` | +| Black Forest Labs | FLUX Pro Expand | `bfl--flux-pro-expand--edit-images` | `flux-pro-expand` | +| Black Forest Labs | FLUX Pro Fill | `bfl--flux-pro-fill--edit-images` | `flux-pro-fill` | +| Black Forest Labs | FLUX Video Upscale | `bfl--flux-video-upscale--edit-videos` | `flux-video-upscale` | +| Black Forest Labs | FLUX Virtual Try-On | `bfl--flux-virtual-try-on--edit-images` | `flux-virtual-try-on` | +| Bria | Bria Eraser | `bria--eraser--edit-images` | `bria-eraser` | +| Bria | Bria Expand Image | `bria--expand-image--edit-images` | `bria-expand-image` | +| Bria | Bria FIBO Image Edit | `bria--fibo-image-edit--edit-images` | `bria-fibo-image-edit` | +| Bria | Bria Generative Fill | `bria--generative-fill--edit-images` | `bria-generative-fill` | +| Bria | Bria Green Screen Video | `bria--green-screen-video--edit-videos` | `bria-green-screen-video` | +| Bria | Bria Increase Resolution | `bria--increase-resolution--edit-images` | `bria-increase-resolution` | +| Bria | Bria RMBG 2.0 | `bria--remove-image-background--edit-images` | `bria-rmbg-2-0` | +| Bria | Bria Remove Video Background | `bria--remove-video-background--edit-videos` | `bria-remove-video-background` | +| Bria | Bria Replace Video Background | `bria--replace-video-background--edit-videos` | `bria-replace-video-background` | +| ByteDance | Seed Audio 1.0 Text-to-Speech | `byteplus--seed-audio-1.0--audio` | `seed-audio-1-0-text-to-speech` | +| ByteDance | Seed Audio 1.0 Multilingual Text-to-Speech | `byteplus--seed-audio-1.0-multilingual--audio` | `seed-audio-1-0-multilingual-text-to-speech` | +| ByteDance | Seedance 2.5 Video Edit | `byteplus--seedance-2-5-edit-video--edit-videos` | `seedance-2-5-video-edit` | +| ByteDance | Seedance 2.5 First-Last Frame | `byteplus--seedance-2-5-first-last-frame--animate-images` | `seedance-2-5-first-last-frame` | +| ByteDance | Seedance 2.5 Reference-to-Video | `byteplus--seedance-2-5-reference--generate-videos` | `seedance-2-5-reference-to-video` | +| ByteDance | Seedance 2.5 Text-to-Video | `byteplus--seedance-2-5-text-to-video--generate-videos` | `seedance-2-5-text-to-video` | +| ByteDance | Seedance 2.0 Fast First-Last Frame | `byteplus--seedance-2-fast-first-last-frame--animate-images` | `seedance-2-0-fast-first-last-frame` | +| ByteDance | Seedance 2.0 Fast Reference-to-Video | `byteplus--seedance-2-fast-reference--generate-videos` | `seedance-2-0-fast-reference-to-video` | +| ByteDance | Seedance 2.0 Fast Text-to-Video | `byteplus--seedance-2-fast-text-to-video--generate-videos` | `seedance-2-0-fast-text-to-video` | +| ByteDance | Seedance 2.0 Image-to-Video | `byteplus--seedance-2-image-to-video--animate-images` | `seedance-2-0-image-to-video` | +| ByteDance | Seedance 2.0 Mini Text-to-Video | `byteplus--seedance-2-mini-text-to-video--generate-videos` | `seedance-2-0-mini-text-to-video` | +| ByteDance | Seedance 2.0 Reference-to-Video | `byteplus--seedance-2-reference--generate-videos` | `seedance-2-0-reference-to-video` | +| ByteDance | Seedance 2.0 Text-to-Video | `byteplus--seedance-2-text-to-video--generate-videos` | `seedance-2-0-text-to-video` | +| ByteDance | Seedream 4.0 Image Edit | `byteplus--seedream-4--edit-images` | `seedream-4-0-image-edit` | +| ByteDance | Seedream 4.0 Text-to-Image | `byteplus--seedream-4--generate-images` | `seedream-4-0-text-to-image` | +| ByteDance | Seedream 4.5 Image Edit | `byteplus--seedream-4-5--edit-images` | `seedream-4-5-image-edit` | +| ByteDance | Seedream 4.5 Text-to-Image | `byteplus--seedream-4-5--generate-images` | `seedream-4-5-text-to-image` | +| ByteDance | Seedream 5.0 Lite Image Edit | `byteplus--seedream-5-lite--edit-images` | `seedream-5-0-lite-image-edit` | +| ByteDance | Seedream 5.0 Lite Text-to-Image | `byteplus--seedream-5-lite--generate-images` | `seedream-5-0-lite-text-to-image` | +| ByteDance | Seedream 5.0 Pro Image Edit | `byteplus--seedream-5-pro--edit-images` | `seedream-5-0-pro-image-edit` | +| ByteDance | Seedream 5.0 Pro Text-to-Image | `byteplus--seedream-5-pro--generate-images` | `seedream-5-0-pro-text-to-image` | +| ByteDance | Seedream 5.0 Pro Layer Separation | `byteplus--seedream-5-pro-layer-separation--edit-images` | `seedream-5-0-pro-layer-separation` | +| ElevenLabs | ElevenLabs Text-to-Dialogue | `elevenlabs--text-to-dialogue--audio` | `elevenlabs-text-to-dialogue` | +| Freepik | Magnific Skin Enhancer | `freepik--magnific-skin-enhancer--edit-images` | `magnific-skin-enhancer` | +| Google | Gemini Omni 1.1 Flash Image-to-Video | `gemini--omni-1.1-flash--animate-images` | `gemini-omni-1-1-flash-image-to-video` | +| Google | Gemini Omni 1.1 Flash Video Edit | `gemini--omni-1.1-flash--edit-videos` | `gemini-omni-1-1-flash-video-edit` | +| Google | Gemini Omni 1.1 Flash Text-to-Video | `gemini--omni-1.1-flash--generate-videos` | `gemini-omni-1-1-flash-text-to-video` | +| Google | Gemini Omni Flash Preview Image-to-Video | `gemini--omni-flash-preview--animate-images` | `gemini-omni-flash-preview-image-to-video` | +| Google | Gemini Omni Flash Preview Video Edit | `gemini--omni-flash-preview--edit-videos` | `gemini-omni-flash-preview-video-edit` | +| Google | Gemini Omni Flash Preview Text-to-Video | `gemini--omni-flash-preview--generate-videos` | `gemini-omni-flash-preview-text-to-video` | +| Google | Nano Banana Image Edit | `vertexai--gemini-2.5-flash-image--edit-images` | `nano-banana-image-edit` | +| Google | Nano Banana Text-to-Image | `vertexai--gemini-2.5-flash-image--generate-images` | `nano-banana-text-to-image` | +| Google | Nano Banana Pro Image Edit | `vertexai--gemini-3-pro-image--edit-images` | `nano-banana-pro-image-edit` | +| Google | Nano Banana Pro Text-to-Image | `vertexai--gemini-3-pro-image--generate-images` | `nano-banana-pro-text-to-image` | +| Google | Nano Banana 2 Image Edit | `vertexai--gemini-nano-banana-2--edit-images` | `nano-banana-2-image-edit` | +| Google | Nano Banana 2 Text-to-Image | `vertexai--gemini-nano-banana-2--generate-images` | `nano-banana-2-text-to-image` | +| Google | Veo 3 Image-to-Video | `vertexai--veo-3--animate-images` | `veo-3-image-to-video` | +| Google | Veo 3 Text-to-Video | `vertexai--veo-3--generate-videos` | `veo-3-text-to-video` | +| Google | Veo 3 First-Last Frame | `vertexai--veo-3-first-last-frame--animate-images` | `veo-3-first-last-frame` | +| Heygen | HeyGen Starfish Text-to-Speech | `heygen--starfish-tts--audio` | `heygen-starfish-text-to-speech` | +| Ideogram | Ideogram V3 Text-to-Image | `ideogram--v3--generate-images` | `ideogram-v3-text-to-image` | +| Ideogram | Ideogram V4 Text-to-Image | `ideogram--v4--generate-images` | `ideogram-v4-text-to-image` | +| Kling | Kling Avatar | `kling--avatar--animate-images` | `kling-avatar` | +| Kling | Kling 3.0 Turbo Text-to-Video | `kling--kling-3.0-turbo-text-to-video--generate-videos` | `kling-3-0-turbo-text-to-video` | +| Kling | Kling Lip Sync Audio-to-Video | `kling--lip-sync-audio-to-video--edit-videos` | `kling-lip-sync-audio-to-video` | +| Kling | Kling Lip Sync Text-to-Video | `kling--lip-sync-text-to-video--edit-videos` | `kling-lip-sync-text-to-video` | +| Kling | Kling O3 Video Edit | `kling--omni-pro-edit-video--edit-videos` | `kling-o3-video-edit` | +| Kling | Kling O3 Image-to-Video | `kling--omni-pro-image-to-video--animate-images` | `kling-o3-image-to-video` | +| Kling | Kling O3 Text-to-Video | `kling--omni-pro-text-to-video--generate-videos` | `kling-o3-text-to-video` | +| Kling | Kling O3 Video-to-Video | `kling--omni-pro-video-to-video--edit-videos` | `kling-o3-video-to-video` | +| Kling | Kling 2.5 Turbo Text-to-Video | `kling--text-to-video--generate-videos` | `kling-2-5-turbo-text-to-video` | +| Kling | Kling 2.6 Pro Text-to-Video with Audio | `kling--text-to-video-with-audio--generate-videos` | `kling-2-6-pro-text-to-video-with-audio` | +| Kling | Kling 3.0 Text-to-Video | `kling--v3--generate-videos` | `kling-3-0-text-to-video` | +| Krea | Krea 2 Large Text-to-Image | `krea--krea-2-large--generate-images` | `krea-2-large-text-to-image` | +| Krea | Krea 2 Medium Text-to-Image | `krea--krea-2-medium--generate-images` | `krea-2-medium-text-to-image` | +| Krea | Krea 2 Medium Turbo Text-to-Image | `krea--krea-2-medium-turbo--generate-images` | `krea-2-medium-turbo-text-to-image` | +| Luma | Luma Photon 1 Text-to-Image | `luma--photon-1-image-generation--generate-images` | `luma-photon-1-text-to-image` | +| Luma | Luma Photon 1 Image Edit | `luma--photon-1-image-modify--edit-images` | `luma-photon-1-image-edit` | +| Luma | Luma Photon Flash 1 Text-to-Image | `luma--photon-flash-1-image-generation--generate-images` | `luma-photon-flash-1-text-to-image` | +| Luma | Luma Photon Flash 1 Image Edit | `luma--photon-flash-1-image-modify--edit-images` | `luma-photon-flash-1-image-edit` | +| Luma | Luma Ray 2 Image-to-Video | `luma--ray-2-image-to-video--animate-images` | `luma-ray-2-image-to-video` | +| Luma | Luma Ray 2 Text-to-Video | `luma--ray-2-text-to-video--generate-videos` | `luma-ray-2-text-to-video` | +| Luma | Luma Ray Flash 2 Image-to-Video | `luma--ray-flash-2-image-to-video--animate-images` | `luma-ray-flash-2-image-to-video` | +| Luma | Luma Ray Flash 2 Text-to-Video | `luma--ray-flash-2-text-to-video--generate-videos` | `luma-ray-flash-2-text-to-video` | +| Luma | Luma Uni 1 Image Edit | `luma_2--uni-1-image-edit--edit-images` | `luma-uni-1-image-edit` | +| Luma | Luma Uni 1 Text-to-Image | `luma_2--uni-1-image-generation--generate-images` | `luma-uni-1-text-to-image` | +| Luma | Luma Uni 1 Max Image Edit | `luma_2--uni-1-max-image-edit--edit-images` | `luma-uni-1-max-image-edit` | +| Luma | Luma Uni 1 Max Text-to-Image | `luma_2--uni-1-max-image-generation--generate-images` | `luma-uni-1-max-text-to-image` | +| OpenAI | GPT Image 1 Image Edit | `openai--gpt-image-1--edit-images` | `gpt-image-1-image-edit` | +| OpenAI | GPT Image 1.5 Image Edit | `openai--gpt-image-1.5--edit-images` | `gpt-image-1-5-image-edit` | +| OpenAI | GPT Image 2 Text-to-Image | `openai--gpt-image-2--generate-images` | `gpt-image-2-text-to-image` | +| OpenAI | GPT Image 2.5 Flare Text-to-Image | `openai--gpt-image-2.5-flare--generate-images` | `gpt-image-2-5-flare-text-to-image` | +| OpenAI | GPT Image 2.5 Sunburst Text-to-Image | `openai--gpt-image-2.5-sunburst--generate-images` | `gpt-image-2-5-sunburst-text-to-image` | +| Qwen | Qwen Image 3.0 Image Edit | `qwen--qwen-image-3.0-image-edit--edit-images` | `qwen-image-3-0-image-edit` | +| Qwen | Qwen Image 3.0 Pro Image Edit | `qwen--qwen-image-3.0-pro-image-edit--edit-images` | `qwen-image-3-0-pro-image-edit` | +| Qwen | Qwen Image 3.0 Pro Text-to-Image | `qwen--qwen-image-3.0-pro-text-to-image--generate-images` | `qwen-image-3-0-pro-text-to-image` | +| Qwen | Qwen Image 3.0 Text-to-Image | `qwen--qwen-image-3.0-text-to-image--generate-images` | `qwen-image-3-0-text-to-image` | +| Recraft | Recraft V3 Text-to-Image | `recraft--v3-text-to-image--generate-images` | `recraft-v3-text-to-image` | +| Recraft | Recraft V3 Text-to-Vector | `recraft--v3-text-to-vector--generate-images` | `recraft-v3-text-to-vector` | +| Recraft | Recraft V4 Pro Text-to-Image | `recraft--v4-pro-text-to-image--generate-images` | `recraft-v4-pro-text-to-image` | +| Recraft | Recraft V4 Pro Text-to-Vector | `recraft--v4-pro-text-to-vector--generate-images` | `recraft-v4-pro-text-to-vector` | +| Recraft | Recraft V4 Text-to-Image | `recraft--v4-text-to-image--generate-images` | `recraft-v4-text-to-image` | +| Recraft | Recraft V4 Text-to-Vector | `recraft--v4-text-to-vector--generate-images` | `recraft-v4-text-to-vector` | +| Recraft | Recraft V4.1 Pro Text-to-Image | `recraft--v4.1-pro-text-to-image--generate-images` | `recraft-v4-1-pro-text-to-image` | +| Recraft | Recraft V4.1 Pro Text-to-Vector | `recraft--v4.1-pro-text-to-vector--generate-images` | `recraft-v4-1-pro-text-to-vector` | +| Recraft | Recraft V4.1 Text-to-Image | `recraft--v4.1-text-to-image--generate-images` | `recraft-v4-1-text-to-image` | +| Recraft | Recraft V4.1 Text-to-Vector | `recraft--v4.1-text-to-vector--generate-images` | `recraft-v4-1-text-to-vector` | +| Recraft | Recraft V4.1 Utility Pro Text-to-Image | `recraft--v4.1-utility-pro-text-to-image--generate-images` | `recraft-v4-1-utility-pro-text-to-image` | +| Recraft | Recraft V4.1 Utility Pro Text-to-Vector | `recraft--v4.1-utility-pro-text-to-vector--generate-images` | `recraft-v4-1-utility-pro-text-to-vector` | +| Recraft | Recraft V4.1 Utility Text-to-Image | `recraft--v4.1-utility-text-to-image--generate-images` | `recraft-v4-1-utility-text-to-image` | +| Recraft | Recraft V4.1 Utility Text-to-Vector | `recraft--v4.1-utility-text-to-vector--generate-images` | `recraft-v4-1-utility-text-to-vector` | +| Runway | Runway Aleph 2 Video-to-Video | `runway--aleph2-video-to-video--edit-videos` | `runway-aleph-2-video-to-video` | +| Runway | Runway Gen-4 Image Text-to-Image | `runway--gen4-image--generate-images` | `runway-gen-4-image-text-to-image` | +| Runway | Runway Gen-4 Turbo Image-to-Video | `runway--gen4-turbo-image-to-video--animate-images` | `runway-gen-4-turbo-image-to-video` | +| Wan | HappyHorse Reference-to-Video | `wan--happyhorse-reference-video--animate-images` | `happyhorse-reference-to-video` | +| Wan | HappyHorse Text-to-Video | `wan--happyhorse-text-to-video--generate-videos` | `happyhorse-text-to-video` | +| Wan | HappyHorse Video Edit | `wan--happyhorse-video-edit--edit-videos` | `happyhorse-video-edit` | +| Wan | Wan 2.5 Image Edit | `wan--image-to-image--edit-images` | `wan-2-5-image-edit` | +| Wan | Wan 2.6 Image-to-Video | `wan--image-to-video--animate-images` | `wan-2-6-image-to-video` | +| Wan | Wan 2.7 Image-to-Video | `wan--image-to-video-2.7--animate-images` | `wan-2-7-image-to-video` | +| Wan | Wan 3.0 Image-to-Video | `wan--image-to-video-3.0--animate-images` | `wan-3-0-image-to-video` | +| Wan | Wan 3.0 Prime Image-to-Video | `wan--image-to-video-3.0-prime--animate-images` | `wan-3-0-prime-image-to-video` | +| Wan | Wan 3.0 Reference-to-Video | `wan--reference-to-video-3.0--animate-images` | `wan-3-0-reference-to-video` | +| Wan | Wan 3.0 Prime Reference-to-Video | `wan--reference-to-video-3.0-prime--animate-images` | `wan-3-0-prime-reference-to-video` | +| Wan | Wan 2.6 Reference-to-Video | `wan--reference-video--edit-videos` | `wan-2-6-reference-to-video` | +| Wan | Wan 2.7 Reference-to-Video | `wan--reference-video-2.7--animate-images` | `wan-2-7-reference-to-video` | +| Wan | Wan 2.5 Text-to-Image | `wan--text-to-image--generate-images` | `wan-2-5-text-to-image` | +| Wan | Wan 2.6 Text-to-Video | `wan--text-to-video--generate-videos` | `wan-2-6-text-to-video` | +| Wan | Wan 2.7 Text-to-Video | `wan--text-to-video-2.7--generate-videos` | `wan-2-7-text-to-video` | +| Wan | Wan 3.0 Text-to-Video | `wan--text-to-video-3.0--generate-videos` | `wan-3-0-text-to-video` | +| Wan | Wan 3.0 Prime Text-to-Video | `wan--text-to-video-3.0-prime--generate-videos` | `wan-3-0-prime-text-to-video` | +| Wan | Wan 2.7 Video Continuation | `wan--video-continuation-2.7--animate-images` | `wan-2-7-video-continuation` | +| Wan | Wan 2.7 Video Edit | `wan--video-edit-2.7--edit-videos` | `wan-2-7-video-edit` | +| WaveSpeed | FlashVSR | `wavespeed--flashvsr--edit-videos` | `flashvsr` | +| WaveSpeed | SeedVR2 Image Upscaler | `wavespeed--seedvr2-image--edit-images` | `seedvr2-image-upscaler` | +| WaveSpeed | Ultimate Image Upscaler | `wavespeed--ultimate-image-upscaler--edit-images` | `ultimate-image-upscaler` | +| xAI | Grok Imagine Image Text-to-Image | `xai--grok-imagine-image--generate-images` | `grok-imagine-image-text-to-image` | +| xAI | Grok Imagine Image 2.0 Text-to-Image | `xai--grok-imagine-image-2.0--generate-images` | `grok-imagine-image-2-0-text-to-image` | +| xAI | Grok Imagine Video Image-to-Video | `xai--grok-imagine-video--animate-images` | `grok-imagine-video-image-to-video` | +| xAI | Grok Imagine Video Text-to-Video | `xai--grok-imagine-video--generate-videos` | `grok-imagine-video-text-to-video` | +| xAI | Grok Imagine Video 1.5 Image-to-Video | `xai--grok-imagine-video-1.5--animate-images` | `grok-imagine-video-1-5-image-to-video` | +| xAI | Grok Imagine Video 1.5 Text-to-Video | `xai--grok-imagine-video-1.5--generate-videos` | `grok-imagine-video-1-5-text-to-video` | +| xAI | Grok Imagine Video 1.5 Reference-to-Video | `xai--grok-imagine-video-1.5-reference--animate-images` | `grok-imagine-video-1-5-reference-to-video` | +| xAI | Grok Imagine Video Reference-to-Video | `xai--grok-imagine-video-reference--animate-images` | `grok-imagine-video-reference-to-video` | + +## Aliases (212) + +| Alias | New slug | +| --- | --- | +| `beeble--switchx` | `beeble-switchx-image-edit` | +| `beeble--switchx-image-edit` | `beeble-switchx-image-edit` | +| `beeble--switchx-video-edit` | `beeble-switchx-video-edit` | +| `bfl--erase-v1` | `flux-tools-erase` | +| `bfl--flux-2-max` | `flux-2-max-text-to-image` | +| `bfl--flux-2-pro` | `flux-2-pro-text-to-image` | +| `bfl--flux-3-image-to-video` | `flux-3-video-image-to-video` | +| `bfl--flux-3-text-to-video` | `flux-3-video-text-to-video` | +| `bfl--flux-3-video` | `flux-3-video-text-to-video` | +| `bfl--flux-erase` | `flux-tools-erase` | +| `bfl--flux-kontext-max` | `flux-1-kontext-max-image-edit` | +| `bfl--flux-kontext-pro` | `flux-1-kontext-pro-image-edit` | +| `bfl--flux-pro-1.0-expand` | `flux-pro-expand` | +| `bfl--flux-pro-1.0-fill` | `flux-pro-fill` | +| `bfl--flux-pro-1.1` | `flux-pro-1-1-text-to-image` | +| `bfl--flux-pro-1.1-ultra` | `flux-pro-1-1-ultra-text-to-image` | +| `bfl--flux-pro-expand` | `flux-pro-expand` | +| `bfl--flux-pro-fill` | `flux-pro-fill` | +| `bfl--flux-video-upscale` | `flux-video-upscale` | +| `bfl--flux-virtual-try-on` | `flux-virtual-try-on` | +| `bfl--video-upscale-v1` | `flux-video-upscale` | +| `bfl--vto-v1` | `flux-virtual-try-on` | +| `bria--eraser` | `bria-eraser` | +| `bria--expand-image` | `bria-expand-image` | +| `bria--fibo` | `bria-fibo-image-edit` | +| `bria--fibo-image-edit` | `bria-fibo-image-edit` | +| `bria--generative-fill` | `bria-generative-fill` | +| `bria--green-screen-video` | `bria-green-screen-video` | +| `bria--image-edit-erase` | `bria-eraser` | +| `bria--image-edit-expand` | `bria-expand-image` | +| `bria--image-edit-gen-fill` | `bria-generative-fill` | +| `bria--image-edit-increase-resolution` | `bria-increase-resolution` | +| `bria--image-edit-remove-background` | `bria-rmbg-2-0` | +| `bria--increase-resolution` | `bria-increase-resolution` | +| `bria--remove-image-background` | `bria-rmbg-2-0` | +| `bria--remove-video-background` | `bria-remove-video-background` | +| `bria--replace-video-background` | `bria-replace-video-background` | +| `bria--video-edit-green-screen` | `bria-green-screen-video` | +| `bria--video-edit-remove-background` | `bria-remove-video-background` | +| `bria--video-edit-replace-background` | `bria-replace-video-background` | +| `byteplus--dreamina-seedance-2-0-260128` | `seedance-2-0-text-to-video` | +| `byteplus--dreamina-seedance-2-0-fast-260128` | `seedance-2-0-fast-text-to-video` | +| `byteplus--dreamina-seedance-2-0-mini` | `seedance-2-0-mini-text-to-video` | +| `byteplus--dreamina-seedance-2-5-260628` | `seedance-2-5-text-to-video` | +| `byteplus--seed-audio-1.0` | `seed-audio-1-0-text-to-speech` | +| `byteplus--seed-audio-1.0-multilingual` | `seed-audio-1-0-multilingual-text-to-speech` | +| `byteplus--seedance-2-5-edit-video` | `seedance-2-5-video-edit` | +| `byteplus--seedance-2-5-first-last-frame` | `seedance-2-5-first-last-frame` | +| `byteplus--seedance-2-5-reference` | `seedance-2-5-reference-to-video` | +| `byteplus--seedance-2-5-text-to-video` | `seedance-2-5-text-to-video` | +| `byteplus--seedance-2-fast-first-last-frame` | `seedance-2-0-fast-first-last-frame` | +| `byteplus--seedance-2-fast-reference` | `seedance-2-0-fast-reference-to-video` | +| `byteplus--seedance-2-fast-text-to-video` | `seedance-2-0-fast-text-to-video` | +| `byteplus--seedance-2-image-to-video` | `seedance-2-0-image-to-video` | +| `byteplus--seedance-2-mini-text-to-video` | `seedance-2-0-mini-text-to-video` | +| `byteplus--seedance-2-reference` | `seedance-2-0-reference-to-video` | +| `byteplus--seedance-2-text-to-video` | `seedance-2-0-text-to-video` | +| `byteplus--seedream-4` | `seedream-4-0-text-to-image` | +| `byteplus--seedream-4-0-250828` | `seedream-4-0-text-to-image` | +| `byteplus--seedream-4-5` | `seedream-4-5-text-to-image` | +| `byteplus--seedream-4-5-251128` | `seedream-4-5-text-to-image` | +| `byteplus--seedream-5-0-260128` | `seedream-5-0-lite-text-to-image` | +| `byteplus--seedream-5-0-pro-260628` | `seedream-5-0-pro-text-to-image` | +| `byteplus--seedream-5-lite` | `seedream-5-0-lite-text-to-image` | +| `byteplus--seedream-5-pro` | `seedream-5-0-pro-text-to-image` | +| `byteplus--seedream-5-pro-layer-separation` | `seedream-5-0-pro-layer-separation` | +| `elevenlabs--eleven_v3` | `elevenlabs-text-to-dialogue` | +| `elevenlabs--text-to-dialogue` | `elevenlabs-text-to-dialogue` | +| `freepik--ai-skin-enhancer-creative` | `magnific-skin-enhancer` | +| `freepik--magnific-skin-enhancer` | `magnific-skin-enhancer` | +| `gemini--omni-1.1-flash` | `gemini-omni-1-1-flash-text-to-video` | +| `gemini--omni-flash-preview` | `gemini-omni-flash-preview-text-to-video` | +| `gemini-interactions--gemini-omni-1.1-flash` | `gemini-omni-1-1-flash-text-to-video` | +| `gemini-interactions--gemini-omni-flash-preview` | `gemini-omni-flash-preview-text-to-video` | +| `heygen--starfish` | `heygen-starfish-text-to-speech` | +| `heygen--starfish-tts` | `heygen-starfish-text-to-speech` | +| `ideogram--ideogram-v3` | `ideogram-v3-text-to-image` | +| `ideogram--ideogram-v4` | `ideogram-v4-text-to-image` | +| `ideogram--v3` | `ideogram-v3-text-to-image` | +| `ideogram--v4` | `ideogram-v4-text-to-image` | +| `kling--avatar` | `kling-avatar` | +| `kling--kling-3.0-turbo` | `kling-3-0-turbo-text-to-video` | +| `kling--kling-3.0-turbo-text-to-video` | `kling-3-0-turbo-text-to-video` | +| `kling--kling-v2-5-turbo` | `kling-2-5-turbo-text-to-video` | +| `kling--kling-v2-6` | `kling-2-6-pro-text-to-video-with-audio` | +| `kling--kling-v3` | `kling-3-0-text-to-video` | +| `kling--kling-v3-omni` | `kling-o3-image-to-video` | +| `kling--kling-video-o1` | `kling-o3-text-to-video` | +| `kling--lip-sync-audio-to-video` | `kling-lip-sync-audio-to-video` | +| `kling--lip-sync-text-to-video` | `kling-lip-sync-text-to-video` | +| `kling--omni-pro-edit-video` | `kling-o3-video-edit` | +| `kling--omni-pro-image-to-video` | `kling-o3-image-to-video` | +| `kling--omni-pro-text-to-video` | `kling-o3-text-to-video` | +| `kling--omni-pro-video-to-video` | `kling-o3-video-to-video` | +| `kling--text-to-video` | `kling-2-5-turbo-text-to-video` | +| `kling--text-to-video-with-audio` | `kling-2-6-pro-text-to-video-with-audio` | +| `kling--v3` | `kling-3-0-text-to-video` | +| `kling--videos-avatar-image2video` | `kling-avatar` | +| `kling--videos-lip-sync` | `kling-lip-sync-text-to-video` | +| `krea--krea-2-large` | `krea-2-large-text-to-image` | +| `krea--krea-2-medium` | `krea-2-medium-text-to-image` | +| `krea--krea-2-medium-turbo` | `krea-2-medium-turbo-text-to-image` | +| `luma--photon-1` | `luma-photon-1-text-to-image` | +| `luma--photon-1-image-generation` | `luma-photon-1-text-to-image` | +| `luma--photon-1-image-modify` | `luma-photon-1-image-edit` | +| `luma--photon-flash-1` | `luma-photon-flash-1-text-to-image` | +| `luma--photon-flash-1-image-generation` | `luma-photon-flash-1-text-to-image` | +| `luma--photon-flash-1-image-modify` | `luma-photon-flash-1-image-edit` | +| `luma--ray-2` | `luma-ray-2-text-to-video` | +| `luma--ray-2-image-to-video` | `luma-ray-2-image-to-video` | +| `luma--ray-2-text-to-video` | `luma-ray-2-text-to-video` | +| `luma--ray-flash-2` | `luma-ray-flash-2-text-to-video` | +| `luma--ray-flash-2-image-to-video` | `luma-ray-flash-2-image-to-video` | +| `luma--ray-flash-2-text-to-video` | `luma-ray-flash-2-text-to-video` | +| `luma_2--uni-1` | `luma-uni-1-text-to-image` | +| `luma_2--uni-1-image-edit` | `luma-uni-1-image-edit` | +| `luma_2--uni-1-image-generation` | `luma-uni-1-text-to-image` | +| `luma_2--uni-1-max` | `luma-uni-1-max-text-to-image` | +| `luma_2--uni-1-max-image-edit` | `luma-uni-1-max-image-edit` | +| `luma_2--uni-1-max-image-generation` | `luma-uni-1-max-text-to-image` | +| `openai--gpt-image-1` | `gpt-image-1-image-edit` | +| `openai--gpt-image-1.5` | `gpt-image-1-5-image-edit` | +| `openai--gpt-image-2` | `gpt-image-2-text-to-image` | +| `openai--gpt-image-2.5-flare` | `gpt-image-2-5-flare-text-to-image` | +| `openai--gpt-image-2.5-sunburst` | `gpt-image-2-5-sunburst-text-to-image` | +| `qwen--qwen-image-3.0` | `qwen-image-3-0-text-to-image` | +| `qwen--qwen-image-3.0-image-edit` | `qwen-image-3-0-image-edit` | +| `qwen--qwen-image-3.0-pro` | `qwen-image-3-0-pro-text-to-image` | +| `qwen--qwen-image-3.0-pro-image-edit` | `qwen-image-3-0-pro-image-edit` | +| `qwen--qwen-image-3.0-pro-text-to-image` | `qwen-image-3-0-pro-text-to-image` | +| `qwen--qwen-image-3.0-text-to-image` | `qwen-image-3-0-text-to-image` | +| `recraft--recraftv3` | `recraft-v3-text-to-image` | +| `recraft--recraftv4` | `recraft-v4-text-to-image` | +| `recraft--recraftv4_1` | `recraft-v4-1-text-to-image` | +| `recraft--recraftv4_1_pro` | `recraft-v4-1-pro-text-to-image` | +| `recraft--recraftv4_1_pro_vector` | `recraft-v4-1-pro-text-to-vector` | +| `recraft--recraftv4_1_utility` | `recraft-v4-1-utility-text-to-image` | +| `recraft--recraftv4_1_utility_pro` | `recraft-v4-1-utility-pro-text-to-image` | +| `recraft--recraftv4_1_utility_pro_vector` | `recraft-v4-1-utility-pro-text-to-vector` | +| `recraft--recraftv4_1_utility_vector` | `recraft-v4-1-utility-text-to-vector` | +| `recraft--recraftv4_1_vector` | `recraft-v4-1-text-to-vector` | +| `recraft--recraftv4_pro` | `recraft-v4-pro-text-to-image` | +| `recraft--v3-text-to-image` | `recraft-v3-text-to-image` | +| `recraft--v3-text-to-vector` | `recraft-v3-text-to-vector` | +| `recraft--v4-pro-text-to-image` | `recraft-v4-pro-text-to-image` | +| `recraft--v4-pro-text-to-vector` | `recraft-v4-pro-text-to-vector` | +| `recraft--v4-text-to-image` | `recraft-v4-text-to-image` | +| `recraft--v4-text-to-vector` | `recraft-v4-text-to-vector` | +| `recraft--v4.1-pro-text-to-image` | `recraft-v4-1-pro-text-to-image` | +| `recraft--v4.1-pro-text-to-vector` | `recraft-v4-1-pro-text-to-vector` | +| `recraft--v4.1-text-to-image` | `recraft-v4-1-text-to-image` | +| `recraft--v4.1-text-to-vector` | `recraft-v4-1-text-to-vector` | +| `recraft--v4.1-utility-pro-text-to-image` | `recraft-v4-1-utility-pro-text-to-image` | +| `recraft--v4.1-utility-pro-text-to-vector` | `recraft-v4-1-utility-pro-text-to-vector` | +| `recraft--v4.1-utility-text-to-image` | `recraft-v4-1-utility-text-to-image` | +| `recraft--v4.1-utility-text-to-vector` | `recraft-v4-1-utility-text-to-vector` | +| `runway--aleph2` | `runway-aleph-2-video-to-video` | +| `runway--aleph2-video-to-video` | `runway-aleph-2-video-to-video` | +| `runway--gen4-image` | `runway-gen-4-image-text-to-image` | +| `runway--gen4-turbo-image-to-video` | `runway-gen-4-turbo-image-to-video` | +| `runway--gen4_image` | `runway-gen-4-image-text-to-image` | +| `runway--gen4_turbo` | `runway-gen-4-turbo-image-to-video` | +| `veo--veo-3.1-generate-001` | `veo-3-text-to-video` | +| `vertexai--gemini-2.5-flash-image` | `nano-banana-text-to-image` | +| `vertexai--gemini-3-pro-image` | `nano-banana-pro-text-to-image` | +| `vertexai--gemini-3.1-flash-image` | `nano-banana-2-text-to-image` | +| `vertexai--gemini-nano-banana-2` | `nano-banana-2-text-to-image` | +| `vertexai--veo-3` | `veo-3-text-to-video` | +| `vertexai--veo-3-first-last-frame` | `veo-3-first-last-frame` | +| `wan--happyhorse-1.0-video-edit` | `happyhorse-video-edit` | +| `wan--happyhorse-1.1-r2v` | `happyhorse-reference-to-video` | +| `wan--happyhorse-1.1-t2v` | `happyhorse-text-to-video` | +| `wan--happyhorse-reference-video` | `happyhorse-reference-to-video` | +| `wan--happyhorse-text-to-video` | `happyhorse-text-to-video` | +| `wan--happyhorse-video-edit` | `happyhorse-video-edit` | +| `wan--image-to-image` | `wan-2-5-image-edit` | +| `wan--image-to-video` | `wan-2-6-image-to-video` | +| `wan--image-to-video-2.7` | `wan-2-7-image-to-video` | +| `wan--image-to-video-3.0` | `wan-3-0-image-to-video` | +| `wan--image-to-video-3.0-prime` | `wan-3-0-prime-image-to-video` | +| `wan--reference-to-video-3.0` | `wan-3-0-reference-to-video` | +| `wan--reference-to-video-3.0-prime` | `wan-3-0-prime-reference-to-video` | +| `wan--reference-video` | `wan-2-6-reference-to-video` | +| `wan--reference-video-2.7` | `wan-2-7-reference-to-video` | +| `wan--text-to-image` | `wan-2-5-text-to-image` | +| `wan--text-to-video` | `wan-2-6-text-to-video` | +| `wan--text-to-video-2.7` | `wan-2-7-text-to-video` | +| `wan--text-to-video-3.0` | `wan-3-0-text-to-video` | +| `wan--text-to-video-3.0-prime` | `wan-3-0-prime-text-to-video` | +| `wan--video-continuation-2.7` | `wan-2-7-video-continuation` | +| `wan--video-edit-2.7` | `wan-2-7-video-edit` | +| `wan--wan2.5-i2i-preview` | `wan-2-5-image-edit` | +| `wan--wan2.5-t2i-preview` | `wan-2-5-text-to-image` | +| `wan--wan2.6-i2v` | `wan-2-6-image-to-video` | +| `wan--wan2.6-r2v` | `wan-2-6-reference-to-video` | +| `wan--wan2.6-t2v` | `wan-2-6-text-to-video` | +| `wan--wan2.7-i2v` | `wan-2-7-image-to-video` | +| `wan--wan2.7-r2v` | `wan-2-7-reference-to-video` | +| `wan--wan2.7-t2v` | `wan-2-7-text-to-video` | +| `wan--wan2.7-videoedit` | `wan-2-7-video-edit` | +| `wan--wan3.0-video` | `wan-3-0-image-to-video` | +| `wan--wan3.0-video-prime` | `wan-3-0-prime-image-to-video` | +| `wavespeed--flashvsr` | `flashvsr` | +| `wavespeed--seedvr2` | `seedvr2-image-upscaler` | +| `wavespeed--seedvr2-image` | `seedvr2-image-upscaler` | +| `wavespeed--ultimate-image-upscaler` | `ultimate-image-upscaler` | +| `xai--grok-imagine-image` | `grok-imagine-image-text-to-image` | +| `xai--grok-imagine-image-2.0` | `grok-imagine-image-2-0-text-to-image` | +| `xai--grok-imagine-video` | `grok-imagine-video-text-to-video` | +| `xai--grok-imagine-video-1.5` | `grok-imagine-video-1-5-text-to-video` | +| `xai--grok-imagine-video-1.5-reference` | `grok-imagine-video-1-5-reference-to-video` | +| `xai--grok-imagine-video-reference` | `grok-imagine-video-reference-to-video` | diff --git a/apps/website/package.json b/apps/website/package.json index 2c67717ac86..beb59a19036 100644 --- a/apps/website/package.json +++ b/apps/website/package.json @@ -26,6 +26,7 @@ "cloud-nodes:refresh-snapshot": "tsx ./scripts/refresh-cloud-nodes-snapshot.ts", "rate-card:generate-types": "openapi-ts -f openapi-ts.rate-card.config.ts && node -e \"const fs=require('fs'); const f='src/types/rate-card/zod.gen.ts'; fs.writeFileSync(f, fs.readFileSync(f,'utf8').replace(\\\"from 'zod/v3'\\\", \\\"from 'zod'\\\"));\" && pnpm exec oxfmt --ignore-path .gitignore --write src/types/rate-card/index.ts src/types/rate-card/types.gen.ts src/types/rate-card/zod.gen.ts", "rate-card:refresh-snapshot": "tsx ./scripts/refresh-rate-card-snapshot.ts", + "generate:model-url-map": "tsx ./scripts/generate-model-url-map.ts", "generate:models": "tsx ./scripts/generate-models.ts", "generate:workshop-catalog": "tsx ./scripts/generate-workshop-catalog.ts", "generate:workshop-display": "tsx ./scripts/generate-workshop-display.ts", diff --git a/apps/website/scripts/generate-model-url-map.test.ts b/apps/website/scripts/generate-model-url-map.test.ts new file mode 100644 index 00000000000..5a3adc0a522 --- /dev/null +++ b/apps/website/scripts/generate-model-url-map.test.ts @@ -0,0 +1,154 @@ +import { readFileSync, readdirSync } from 'node:fs' +import { dirname, join } from 'node:path' +import { fileURLToPath } from 'node:url' + +import { describe, expect, it } from 'vitest' +import { z } from 'zod' + +import { modelAliasUrls, modelPageUrls } from '../src/config/model-urls' +import { redirects } from '../src/config/redirects' +import { + routerModelSlugAliases, + workshopModels +} from '../src/config/workshop-browse-content' +import { modelsBuildRoutes } from '../src/integrations/workshop-release-gate' +import { + MODEL_URL_SLUG, + MODEL_URL_TABLE, + MODEL_URLS_MODULE, + compileModelUrlMap, + modelUrlSlug, + renderModelUrlTable, + renderModelUrlsModule +} from './generate-model-url-map' + +const appDir = join(dirname(fileURLToPath(import.meta.url)), '..') +const newSlugs = modelPageUrls.map((page) => page.newSlug) + +function sitePathPatterns(): string[] { + const pagesDir = join(appDir, 'src/pages') + const pages = readdirSync(pagesDir, { recursive: true, encoding: 'utf8' }) + .filter((file) => /\.(astro|ts|mdx?)$/.test(file)) + .filter((file) => !file.split('/').some((part) => part.startsWith('_'))) + .filter((file) => !file.endsWith('.test.ts')) + .map( + (file) => + `/${file.replace(/\.(astro|ts|mdx?)$/, '').replace(/(^|\/)index$/, '')}` + ) + const vercel = z + .object({ redirects: z.array(z.object({ source: z.string() })) }) + .parse(JSON.parse(readFileSync(join(appDir, 'vercel.json'), 'utf8'))) + return [ + ...pages, + ...modelsBuildRoutes(true).map((route) => route.pattern), + ...Object.keys(redirects), + ...vercel.redirects.map((redirect) => redirect.source) + ] +} + +function matchesRoute(pattern: string, path: string): boolean { + const source = pattern + .split(/(\[[^\]]+\])/) + .map((part) => + part.startsWith('[...') + ? '.*' + : part.startsWith('[') + ? '[^/]+' + : part.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + ) + .join('') + return new RegExp(`^${source}/?$`).test(path) +} + +describe('model URL map', () => { + it('matches the generator output (pnpm generate:model-url-map)', () => { + const map = compileModelUrlMap(workshopModels, routerModelSlugAliases) + expect(readFileSync(MODEL_URLS_MODULE, 'utf8')).toBe( + renderModelUrlsModule(map) + ) + expect(readFileSync(MODEL_URL_TABLE, 'utf8')).toBe( + renderModelUrlTable(workshopModels, map) + ) + }) + + it('gives every published model page exactly one new slug', () => { + const oldSlugs = modelPageUrls.map((page) => page.oldSlug) + expect(new Set(oldSlugs).size).toBe(oldSlugs.length) + expect(oldSlugs.toSorted()).toEqual( + workshopModels.map((model) => model.slug).toSorted() + ) + }) + + it('points every alias straight at a new page slug', () => { + const aliases = modelAliasUrls.map((entry) => entry.alias) + const oldSlugs = new Set(modelPageUrls.map((page) => page.oldSlug)) + expect(new Set(aliases).size).toBe(aliases.length) + expect(aliases.toSorted()).toEqual( + [...routerModelSlugAliases.keys()].sort() + ) + expect(aliases.filter((alias) => oldSlugs.has(alias))).toEqual([]) + expect( + modelAliasUrls.filter((entry) => !newSlugs.includes(entry.newSlug)) + ).toEqual([]) + }) + + it('uses unique, lowercase, hyphenated slugs', () => { + expect(new Set(newSlugs).size).toBe(newSlugs.length) + expect(newSlugs.filter((slug) => !MODEL_URL_SLUG.test(slug))).toEqual([]) + }) + + it.for([ + [ + 'a Router provider id', + /(^|-)(byteplus|vertexai|wavespeed|mediakit)(-|$)/ + ], + ['a Router model id', /(^|-)(dreamina|interactions|recraftv\d)(-|$)/], + ['Gemini as a stand-in for a Google brand', /(^|-)gemini-(?!omni-)/], + ['a Router date stamp', /\d{6}/] + ] as const)('never leaks %s', ([, forbidden]) => { + expect(newSlugs.filter((slug) => forbidden.test(slug))).toEqual([]) + }) + + it('claims no path another route already serves', () => { + const patterns = sitePathPatterns() + const collisions = newSlugs.flatMap((slug) => + patterns.filter((pattern) => + matchesRoute(pattern, `/hub/models/${slug}/`) + ) + ) + expect(patterns).toContain('/p/supported-models/[slug]') + expect(collisions).toEqual([]) + }) +}) + +describe('compileModelUrlMap', () => { + it.for([ + ['FLUX.1 Kontext Max Image Edit', 'flux-1-kontext-max-image-edit'], + ['Seedance 2.5 Text-to-Video', 'seedance-2-5-text-to-video'], + ['Runway Gen-4 Turbo Image-to-Video', 'runway-gen-4-turbo-image-to-video'], + [' Bria RMBG 2.0 ', 'bria-rmbg-2-0'] + ] as const)('slugifies %s', ([name, slug]) => { + expect(modelUrlSlug(name)).toBe(slug) + }) + + it('rejects two pages that would share a URL', () => { + expect(() => + compileModelUrlMap( + [ + { slug: 'a--veo-3--generate-videos', name: 'Veo 3 Text-to-Video' }, + { slug: 'b--veo-3--generate-videos', name: 'Veo 3: Text to Video' } + ], + new Map() + ) + ).toThrow('both map to veo-3-text-to-video') + }) + + it('rejects an alias whose target page does not exist', () => { + expect(() => + compileModelUrlMap( + [{ slug: 'veo--veo-3--generate-videos', name: 'Veo 3 Text-to-Video' }], + new Map([['veo--veo-3', 'veo--missing--generate-videos']]) + ) + ).toThrow('Alias veo--veo-3 targets unknown veo--missing--generate-videos') + }) +}) diff --git a/apps/website/scripts/generate-model-url-map.ts b/apps/website/scripts/generate-model-url-map.ts new file mode 100644 index 00000000000..0fe5a60071a --- /dev/null +++ b/apps/website/scripts/generate-model-url-map.ts @@ -0,0 +1,187 @@ +import { writeFile } from 'node:fs/promises' +import { dirname, join } from 'node:path' +import { fileURLToPath } from 'node:url' + +import type { + RouterWorkshopModel, + UseCase +} from '../src/config/models-catalogue' +import { + routerModelSlugAliases, + workshopModels +} from '../src/config/workshop-browse-content' +import { isDirectExecution } from './script-entry-point' + +type MapModel = Pick< + RouterWorkshopModel, + 'slug' | 'name' | 'provider' | 'useCases' | 'routerId' +> +interface ModelUrlMap { + pages: { oldSlug: string; newSlug: string }[] + aliases: { alias: string; newSlug: string }[] +} + +export const MODEL_URL_SLUG = /^[a-z0-9]+(-[a-z0-9]+)*$/ + +const TASK_WORDS_BY_USE_CASE: Readonly> = { + 'generate-images': ['text-to-image', 'text-to-vector'], + 'edit-images': ['image-edit'], + 'generate-videos': ['text-to-video', 'reference-to-video'], + 'animate-images': [ + 'image-to-video', + 'reference-to-video', + 'first-last-frame', + 'video-continuation' + ], + 'edit-videos': ['video-edit', 'video-to-video', 'audio-to-video'], + audio: ['text-to-speech', 'text-to-dialogue'], + '3d': [], + text: [] +} +const TASK_WORDS = [...new Set(Object.values(TASK_WORDS_BY_USE_CASE).flat())] + +const compareText = (a: string, b: string) => (a < b ? -1 : a > b ? 1 : 0) + +const hasWords = (slug: string, words: string) => + `-${slug}-`.includes(`-${words}-`) + +export function modelUrlSlug(name: string): string { + return name + .toLowerCase() + .replace(/[^a-z0-9]+/g, '-') + .replace(/^-+|-+$/g, '') +} + +export function compileModelUrlMap( + models: readonly Pick[], + aliases: ReadonlyMap +): ModelUrlMap { + const newSlugByOld = new Map( + models.map((model) => [model.slug, modelUrlSlug(model.name)]) + ) + const owners = new Map() + for (const [oldSlug, newSlug] of newSlugByOld) { + if (!MODEL_URL_SLUG.test(newSlug)) + throw new Error(`Invalid model URL slug for ${oldSlug}: ${newSlug}`) + const owner = owners.get(newSlug) + if (owner) throw new Error(`${oldSlug} and ${owner} both map to ${newSlug}`) + owners.set(newSlug, oldSlug) + } + return { + pages: [...newSlugByOld] + .map(([oldSlug, newSlug]) => ({ oldSlug, newSlug })) + .sort((a, b) => compareText(a.oldSlug, b.oldSlug)), + aliases: [...aliases] + .map(([alias, target]) => { + const newSlug = newSlugByOld.get(target) + if (!newSlug) + throw new Error(`Alias ${alias} targets unknown ${target}`) + return { alias, newSlug } + }) + .sort((a, b) => compareText(a.alias, b.alias)) + } +} + +function modelUrlFlags(model: MapModel, newSlug: string): string[] { + const useCases = model.useCases ?? [] + const named = TASK_WORDS.filter((words) => hasWords(newSlug, words)) + const expected = useCases.flatMap( + (useCase) => TASK_WORDS_BY_USE_CASE[useCase] + ) + return [ + ...(named.length + ? [] + : ['no task words in the name; the product name stands in for the task']), + ...named + .filter((words) => !expected.includes(words)) + .map( + (words) => `name says "${words}", task data says ${useCases.join(', ')}` + ), + ...(/\d/.test(model.routerId.split('/')[1] ?? '') && !/\d/.test(newSlug) + ? [`no version in the name, Router id is ${model.routerId}`] + : []) + ] +} + +const entryLines = (fields: Record) => + [ + ' {', + Object.entries(fields) + .map(([k, v]) => ` ${k}: '${v}'`) + .join(',\n'), + ' }' + ].join('\n') + +export function renderModelUrlsModule(map: ModelUrlMap): string { + return `// Generated by scripts/generate-model-url-map.ts. Do not edit by hand. +export const modelPageUrls: readonly { oldSlug: string; newSlug: string }[] = [ +${map.pages.map(entryLines).join(',\n')} +] + +export const modelAliasUrls: readonly { alias: string; newSlug: string }[] = [ +${map.aliases.map(entryLines).join(',\n')} +] +` +} + +export function renderModelUrlTable( + models: readonly MapModel[], + map: ModelUrlMap +): string { + const newSlugByOld = new Map( + map.pages.map((page) => [page.oldSlug, page.newSlug]) + ) + const rows = models + .map((model) => ({ model, newSlug: newSlugByOld.get(model.slug) ?? '' })) + .sort( + (a, b) => + compareText(a.model.provider ?? '', b.model.provider ?? '') || + compareText(a.model.slug, b.model.slug) + ) + const flagged = rows.flatMap(({ model, newSlug }) => { + const flags = modelUrlFlags(model, newSlug) + return flags.length + ? [`| \`${newSlug}\` | ${model.name} | ${flags.join('; ')} |`] + : [] + }) + return [ + '# Model page URL map', + '', + 'Generated by `scripts/generate-model-url-map.ts`. Old URL `/models//`, final URL `/hub/models//`.', + '', + `## Check these first (${flagged.length})`, + '', + '| New slug | Display name | Why |', + '| --- | --- | --- |', + ...flagged, + '', + `## Model pages (${rows.length})`, + '', + '| Provider | Display name | Old slug | New slug |', + '| --- | --- | --- | --- |', + ...rows.map( + ({ model, newSlug }) => + `| ${model.provider ?? ''} | ${model.name} | \`${model.slug}\` | \`${newSlug}\` |` + ), + '', + `## Aliases (${map.aliases.length})`, + '', + '| Alias | New slug |', + '| --- | --- |', + ...map.aliases.map( + ({ alias, newSlug }) => `| \`${alias}\` | \`${newSlug}\` |` + ), + '' + ].join('\n') +} + +const appDir = join(dirname(fileURLToPath(import.meta.url)), '..') +export const MODEL_URLS_MODULE = join(appDir, 'src/config/model-urls.ts') +export const MODEL_URL_TABLE = join(appDir, 'MODEL_URL_MAP.md') + +if (isDirectExecution(process.argv[1], import.meta.filename)) { + const map = compileModelUrlMap(workshopModels, routerModelSlugAliases) + await writeFile(MODEL_URLS_MODULE, renderModelUrlsModule(map)) + await writeFile(MODEL_URL_TABLE, renderModelUrlTable(workshopModels, map)) + console.warn(`${map.pages.length} pages, ${map.aliases.length} aliases`) +} diff --git a/apps/website/src/config/model-urls.ts b/apps/website/src/config/model-urls.ts new file mode 100644 index 00000000000..fe5a88243de --- /dev/null +++ b/apps/website/src/config/model-urls.ts @@ -0,0 +1,1446 @@ +// Generated by scripts/generate-model-url-map.ts. Do not edit by hand. +export const modelPageUrls: readonly { oldSlug: string; newSlug: string }[] = [ + { + oldSlug: 'beeble--switchx-image-edit--edit-images', + newSlug: 'beeble-switchx-image-edit' + }, + { + oldSlug: 'beeble--switchx-video-edit--edit-videos', + newSlug: 'beeble-switchx-video-edit' + }, + { + oldSlug: 'bfl--flux-2-max--generate-images', + newSlug: 'flux-2-max-text-to-image' + }, + { + oldSlug: 'bfl--flux-2-pro--generate-images', + newSlug: 'flux-2-pro-text-to-image' + }, + { + oldSlug: 'bfl--flux-3-image-to-video--animate-images', + newSlug: 'flux-3-video-image-to-video' + }, + { + oldSlug: 'bfl--flux-3-text-to-video--generate-videos', + newSlug: 'flux-3-video-text-to-video' + }, + { + oldSlug: 'bfl--flux-erase--edit-images', + newSlug: 'flux-tools-erase' + }, + { + oldSlug: 'bfl--flux-kontext-max--edit-images', + newSlug: 'flux-1-kontext-max-image-edit' + }, + { + oldSlug: 'bfl--flux-kontext-pro--edit-images', + newSlug: 'flux-1-kontext-pro-image-edit' + }, + { + oldSlug: 'bfl--flux-pro-1.1--generate-images', + newSlug: 'flux-pro-1-1-text-to-image' + }, + { + oldSlug: 'bfl--flux-pro-1.1-ultra--generate-images', + newSlug: 'flux-pro-1-1-ultra-text-to-image' + }, + { + oldSlug: 'bfl--flux-pro-expand--edit-images', + newSlug: 'flux-pro-expand' + }, + { + oldSlug: 'bfl--flux-pro-fill--edit-images', + newSlug: 'flux-pro-fill' + }, + { + oldSlug: 'bfl--flux-video-upscale--edit-videos', + newSlug: 'flux-video-upscale' + }, + { + oldSlug: 'bfl--flux-virtual-try-on--edit-images', + newSlug: 'flux-virtual-try-on' + }, + { + oldSlug: 'bria--eraser--edit-images', + newSlug: 'bria-eraser' + }, + { + oldSlug: 'bria--expand-image--edit-images', + newSlug: 'bria-expand-image' + }, + { + oldSlug: 'bria--fibo-image-edit--edit-images', + newSlug: 'bria-fibo-image-edit' + }, + { + oldSlug: 'bria--generative-fill--edit-images', + newSlug: 'bria-generative-fill' + }, + { + oldSlug: 'bria--green-screen-video--edit-videos', + newSlug: 'bria-green-screen-video' + }, + { + oldSlug: 'bria--increase-resolution--edit-images', + newSlug: 'bria-increase-resolution' + }, + { + oldSlug: 'bria--remove-image-background--edit-images', + newSlug: 'bria-rmbg-2-0' + }, + { + oldSlug: 'bria--remove-video-background--edit-videos', + newSlug: 'bria-remove-video-background' + }, + { + oldSlug: 'bria--replace-video-background--edit-videos', + newSlug: 'bria-replace-video-background' + }, + { + oldSlug: 'byteplus--seed-audio-1.0--audio', + newSlug: 'seed-audio-1-0-text-to-speech' + }, + { + oldSlug: 'byteplus--seed-audio-1.0-multilingual--audio', + newSlug: 'seed-audio-1-0-multilingual-text-to-speech' + }, + { + oldSlug: 'byteplus--seedance-2-5-edit-video--edit-videos', + newSlug: 'seedance-2-5-video-edit' + }, + { + oldSlug: 'byteplus--seedance-2-5-first-last-frame--animate-images', + newSlug: 'seedance-2-5-first-last-frame' + }, + { + oldSlug: 'byteplus--seedance-2-5-reference--generate-videos', + newSlug: 'seedance-2-5-reference-to-video' + }, + { + oldSlug: 'byteplus--seedance-2-5-text-to-video--generate-videos', + newSlug: 'seedance-2-5-text-to-video' + }, + { + oldSlug: 'byteplus--seedance-2-fast-first-last-frame--animate-images', + newSlug: 'seedance-2-0-fast-first-last-frame' + }, + { + oldSlug: 'byteplus--seedance-2-fast-reference--generate-videos', + newSlug: 'seedance-2-0-fast-reference-to-video' + }, + { + oldSlug: 'byteplus--seedance-2-fast-text-to-video--generate-videos', + newSlug: 'seedance-2-0-fast-text-to-video' + }, + { + oldSlug: 'byteplus--seedance-2-image-to-video--animate-images', + newSlug: 'seedance-2-0-image-to-video' + }, + { + oldSlug: 'byteplus--seedance-2-mini-text-to-video--generate-videos', + newSlug: 'seedance-2-0-mini-text-to-video' + }, + { + oldSlug: 'byteplus--seedance-2-reference--generate-videos', + newSlug: 'seedance-2-0-reference-to-video' + }, + { + oldSlug: 'byteplus--seedance-2-text-to-video--generate-videos', + newSlug: 'seedance-2-0-text-to-video' + }, + { + oldSlug: 'byteplus--seedream-4--edit-images', + newSlug: 'seedream-4-0-image-edit' + }, + { + oldSlug: 'byteplus--seedream-4--generate-images', + newSlug: 'seedream-4-0-text-to-image' + }, + { + oldSlug: 'byteplus--seedream-4-5--edit-images', + newSlug: 'seedream-4-5-image-edit' + }, + { + oldSlug: 'byteplus--seedream-4-5--generate-images', + newSlug: 'seedream-4-5-text-to-image' + }, + { + oldSlug: 'byteplus--seedream-5-lite--edit-images', + newSlug: 'seedream-5-0-lite-image-edit' + }, + { + oldSlug: 'byteplus--seedream-5-lite--generate-images', + newSlug: 'seedream-5-0-lite-text-to-image' + }, + { + oldSlug: 'byteplus--seedream-5-pro--edit-images', + newSlug: 'seedream-5-0-pro-image-edit' + }, + { + oldSlug: 'byteplus--seedream-5-pro--generate-images', + newSlug: 'seedream-5-0-pro-text-to-image' + }, + { + oldSlug: 'byteplus--seedream-5-pro-layer-separation--edit-images', + newSlug: 'seedream-5-0-pro-layer-separation' + }, + { + oldSlug: 'elevenlabs--text-to-dialogue--audio', + newSlug: 'elevenlabs-text-to-dialogue' + }, + { + oldSlug: 'freepik--magnific-skin-enhancer--edit-images', + newSlug: 'magnific-skin-enhancer' + }, + { + oldSlug: 'gemini--omni-1.1-flash--animate-images', + newSlug: 'gemini-omni-1-1-flash-image-to-video' + }, + { + oldSlug: 'gemini--omni-1.1-flash--edit-videos', + newSlug: 'gemini-omni-1-1-flash-video-edit' + }, + { + oldSlug: 'gemini--omni-1.1-flash--generate-videos', + newSlug: 'gemini-omni-1-1-flash-text-to-video' + }, + { + oldSlug: 'gemini--omni-flash-preview--animate-images', + newSlug: 'gemini-omni-flash-preview-image-to-video' + }, + { + oldSlug: 'gemini--omni-flash-preview--edit-videos', + newSlug: 'gemini-omni-flash-preview-video-edit' + }, + { + oldSlug: 'gemini--omni-flash-preview--generate-videos', + newSlug: 'gemini-omni-flash-preview-text-to-video' + }, + { + oldSlug: 'heygen--starfish-tts--audio', + newSlug: 'heygen-starfish-text-to-speech' + }, + { + oldSlug: 'ideogram--v3--generate-images', + newSlug: 'ideogram-v3-text-to-image' + }, + { + oldSlug: 'ideogram--v4--generate-images', + newSlug: 'ideogram-v4-text-to-image' + }, + { + oldSlug: 'kling--avatar--animate-images', + newSlug: 'kling-avatar' + }, + { + oldSlug: 'kling--kling-3.0-turbo-text-to-video--generate-videos', + newSlug: 'kling-3-0-turbo-text-to-video' + }, + { + oldSlug: 'kling--lip-sync-audio-to-video--edit-videos', + newSlug: 'kling-lip-sync-audio-to-video' + }, + { + oldSlug: 'kling--lip-sync-text-to-video--edit-videos', + newSlug: 'kling-lip-sync-text-to-video' + }, + { + oldSlug: 'kling--omni-pro-edit-video--edit-videos', + newSlug: 'kling-o3-video-edit' + }, + { + oldSlug: 'kling--omni-pro-image-to-video--animate-images', + newSlug: 'kling-o3-image-to-video' + }, + { + oldSlug: 'kling--omni-pro-text-to-video--generate-videos', + newSlug: 'kling-o3-text-to-video' + }, + { + oldSlug: 'kling--omni-pro-video-to-video--edit-videos', + newSlug: 'kling-o3-video-to-video' + }, + { + oldSlug: 'kling--text-to-video--generate-videos', + newSlug: 'kling-2-5-turbo-text-to-video' + }, + { + oldSlug: 'kling--text-to-video-with-audio--generate-videos', + newSlug: 'kling-2-6-pro-text-to-video-with-audio' + }, + { + oldSlug: 'kling--v3--generate-videos', + newSlug: 'kling-3-0-text-to-video' + }, + { + oldSlug: 'krea--krea-2-large--generate-images', + newSlug: 'krea-2-large-text-to-image' + }, + { + oldSlug: 'krea--krea-2-medium--generate-images', + newSlug: 'krea-2-medium-text-to-image' + }, + { + oldSlug: 'krea--krea-2-medium-turbo--generate-images', + newSlug: 'krea-2-medium-turbo-text-to-image' + }, + { + oldSlug: 'luma--photon-1-image-generation--generate-images', + newSlug: 'luma-photon-1-text-to-image' + }, + { + oldSlug: 'luma--photon-1-image-modify--edit-images', + newSlug: 'luma-photon-1-image-edit' + }, + { + oldSlug: 'luma--photon-flash-1-image-generation--generate-images', + newSlug: 'luma-photon-flash-1-text-to-image' + }, + { + oldSlug: 'luma--photon-flash-1-image-modify--edit-images', + newSlug: 'luma-photon-flash-1-image-edit' + }, + { + oldSlug: 'luma--ray-2-image-to-video--animate-images', + newSlug: 'luma-ray-2-image-to-video' + }, + { + oldSlug: 'luma--ray-2-text-to-video--generate-videos', + newSlug: 'luma-ray-2-text-to-video' + }, + { + oldSlug: 'luma--ray-flash-2-image-to-video--animate-images', + newSlug: 'luma-ray-flash-2-image-to-video' + }, + { + oldSlug: 'luma--ray-flash-2-text-to-video--generate-videos', + newSlug: 'luma-ray-flash-2-text-to-video' + }, + { + oldSlug: 'luma_2--uni-1-image-edit--edit-images', + newSlug: 'luma-uni-1-image-edit' + }, + { + oldSlug: 'luma_2--uni-1-image-generation--generate-images', + newSlug: 'luma-uni-1-text-to-image' + }, + { + oldSlug: 'luma_2--uni-1-max-image-edit--edit-images', + newSlug: 'luma-uni-1-max-image-edit' + }, + { + oldSlug: 'luma_2--uni-1-max-image-generation--generate-images', + newSlug: 'luma-uni-1-max-text-to-image' + }, + { + oldSlug: 'openai--gpt-image-1--edit-images', + newSlug: 'gpt-image-1-image-edit' + }, + { + oldSlug: 'openai--gpt-image-1.5--edit-images', + newSlug: 'gpt-image-1-5-image-edit' + }, + { + oldSlug: 'openai--gpt-image-2--generate-images', + newSlug: 'gpt-image-2-text-to-image' + }, + { + oldSlug: 'openai--gpt-image-2.5-flare--generate-images', + newSlug: 'gpt-image-2-5-flare-text-to-image' + }, + { + oldSlug: 'openai--gpt-image-2.5-sunburst--generate-images', + newSlug: 'gpt-image-2-5-sunburst-text-to-image' + }, + { + oldSlug: 'qwen--qwen-image-3.0-image-edit--edit-images', + newSlug: 'qwen-image-3-0-image-edit' + }, + { + oldSlug: 'qwen--qwen-image-3.0-pro-image-edit--edit-images', + newSlug: 'qwen-image-3-0-pro-image-edit' + }, + { + oldSlug: 'qwen--qwen-image-3.0-pro-text-to-image--generate-images', + newSlug: 'qwen-image-3-0-pro-text-to-image' + }, + { + oldSlug: 'qwen--qwen-image-3.0-text-to-image--generate-images', + newSlug: 'qwen-image-3-0-text-to-image' + }, + { + oldSlug: 'recraft--v3-text-to-image--generate-images', + newSlug: 'recraft-v3-text-to-image' + }, + { + oldSlug: 'recraft--v3-text-to-vector--generate-images', + newSlug: 'recraft-v3-text-to-vector' + }, + { + oldSlug: 'recraft--v4-pro-text-to-image--generate-images', + newSlug: 'recraft-v4-pro-text-to-image' + }, + { + oldSlug: 'recraft--v4-pro-text-to-vector--generate-images', + newSlug: 'recraft-v4-pro-text-to-vector' + }, + { + oldSlug: 'recraft--v4-text-to-image--generate-images', + newSlug: 'recraft-v4-text-to-image' + }, + { + oldSlug: 'recraft--v4-text-to-vector--generate-images', + newSlug: 'recraft-v4-text-to-vector' + }, + { + oldSlug: 'recraft--v4.1-pro-text-to-image--generate-images', + newSlug: 'recraft-v4-1-pro-text-to-image' + }, + { + oldSlug: 'recraft--v4.1-pro-text-to-vector--generate-images', + newSlug: 'recraft-v4-1-pro-text-to-vector' + }, + { + oldSlug: 'recraft--v4.1-text-to-image--generate-images', + newSlug: 'recraft-v4-1-text-to-image' + }, + { + oldSlug: 'recraft--v4.1-text-to-vector--generate-images', + newSlug: 'recraft-v4-1-text-to-vector' + }, + { + oldSlug: 'recraft--v4.1-utility-pro-text-to-image--generate-images', + newSlug: 'recraft-v4-1-utility-pro-text-to-image' + }, + { + oldSlug: 'recraft--v4.1-utility-pro-text-to-vector--generate-images', + newSlug: 'recraft-v4-1-utility-pro-text-to-vector' + }, + { + oldSlug: 'recraft--v4.1-utility-text-to-image--generate-images', + newSlug: 'recraft-v4-1-utility-text-to-image' + }, + { + oldSlug: 'recraft--v4.1-utility-text-to-vector--generate-images', + newSlug: 'recraft-v4-1-utility-text-to-vector' + }, + { + oldSlug: 'runway--aleph2-video-to-video--edit-videos', + newSlug: 'runway-aleph-2-video-to-video' + }, + { + oldSlug: 'runway--gen4-image--generate-images', + newSlug: 'runway-gen-4-image-text-to-image' + }, + { + oldSlug: 'runway--gen4-turbo-image-to-video--animate-images', + newSlug: 'runway-gen-4-turbo-image-to-video' + }, + { + oldSlug: 'vertexai--gemini-2.5-flash-image--edit-images', + newSlug: 'nano-banana-image-edit' + }, + { + oldSlug: 'vertexai--gemini-2.5-flash-image--generate-images', + newSlug: 'nano-banana-text-to-image' + }, + { + oldSlug: 'vertexai--gemini-3-pro-image--edit-images', + newSlug: 'nano-banana-pro-image-edit' + }, + { + oldSlug: 'vertexai--gemini-3-pro-image--generate-images', + newSlug: 'nano-banana-pro-text-to-image' + }, + { + oldSlug: 'vertexai--gemini-nano-banana-2--edit-images', + newSlug: 'nano-banana-2-image-edit' + }, + { + oldSlug: 'vertexai--gemini-nano-banana-2--generate-images', + newSlug: 'nano-banana-2-text-to-image' + }, + { + oldSlug: 'vertexai--veo-3--animate-images', + newSlug: 'veo-3-image-to-video' + }, + { + oldSlug: 'vertexai--veo-3--generate-videos', + newSlug: 'veo-3-text-to-video' + }, + { + oldSlug: 'vertexai--veo-3-first-last-frame--animate-images', + newSlug: 'veo-3-first-last-frame' + }, + { + oldSlug: 'wan--happyhorse-reference-video--animate-images', + newSlug: 'happyhorse-reference-to-video' + }, + { + oldSlug: 'wan--happyhorse-text-to-video--generate-videos', + newSlug: 'happyhorse-text-to-video' + }, + { + oldSlug: 'wan--happyhorse-video-edit--edit-videos', + newSlug: 'happyhorse-video-edit' + }, + { + oldSlug: 'wan--image-to-image--edit-images', + newSlug: 'wan-2-5-image-edit' + }, + { + oldSlug: 'wan--image-to-video--animate-images', + newSlug: 'wan-2-6-image-to-video' + }, + { + oldSlug: 'wan--image-to-video-2.7--animate-images', + newSlug: 'wan-2-7-image-to-video' + }, + { + oldSlug: 'wan--image-to-video-3.0--animate-images', + newSlug: 'wan-3-0-image-to-video' + }, + { + oldSlug: 'wan--image-to-video-3.0-prime--animate-images', + newSlug: 'wan-3-0-prime-image-to-video' + }, + { + oldSlug: 'wan--reference-to-video-3.0--animate-images', + newSlug: 'wan-3-0-reference-to-video' + }, + { + oldSlug: 'wan--reference-to-video-3.0-prime--animate-images', + newSlug: 'wan-3-0-prime-reference-to-video' + }, + { + oldSlug: 'wan--reference-video--edit-videos', + newSlug: 'wan-2-6-reference-to-video' + }, + { + oldSlug: 'wan--reference-video-2.7--animate-images', + newSlug: 'wan-2-7-reference-to-video' + }, + { + oldSlug: 'wan--text-to-image--generate-images', + newSlug: 'wan-2-5-text-to-image' + }, + { + oldSlug: 'wan--text-to-video--generate-videos', + newSlug: 'wan-2-6-text-to-video' + }, + { + oldSlug: 'wan--text-to-video-2.7--generate-videos', + newSlug: 'wan-2-7-text-to-video' + }, + { + oldSlug: 'wan--text-to-video-3.0--generate-videos', + newSlug: 'wan-3-0-text-to-video' + }, + { + oldSlug: 'wan--text-to-video-3.0-prime--generate-videos', + newSlug: 'wan-3-0-prime-text-to-video' + }, + { + oldSlug: 'wan--video-continuation-2.7--animate-images', + newSlug: 'wan-2-7-video-continuation' + }, + { + oldSlug: 'wan--video-edit-2.7--edit-videos', + newSlug: 'wan-2-7-video-edit' + }, + { + oldSlug: 'wavespeed--flashvsr--edit-videos', + newSlug: 'flashvsr' + }, + { + oldSlug: 'wavespeed--seedvr2-image--edit-images', + newSlug: 'seedvr2-image-upscaler' + }, + { + oldSlug: 'wavespeed--ultimate-image-upscaler--edit-images', + newSlug: 'ultimate-image-upscaler' + }, + { + oldSlug: 'xai--grok-imagine-image--generate-images', + newSlug: 'grok-imagine-image-text-to-image' + }, + { + oldSlug: 'xai--grok-imagine-image-2.0--generate-images', + newSlug: 'grok-imagine-image-2-0-text-to-image' + }, + { + oldSlug: 'xai--grok-imagine-video--animate-images', + newSlug: 'grok-imagine-video-image-to-video' + }, + { + oldSlug: 'xai--grok-imagine-video--generate-videos', + newSlug: 'grok-imagine-video-text-to-video' + }, + { + oldSlug: 'xai--grok-imagine-video-1.5--animate-images', + newSlug: 'grok-imagine-video-1-5-image-to-video' + }, + { + oldSlug: 'xai--grok-imagine-video-1.5--generate-videos', + newSlug: 'grok-imagine-video-1-5-text-to-video' + }, + { + oldSlug: 'xai--grok-imagine-video-1.5-reference--animate-images', + newSlug: 'grok-imagine-video-1-5-reference-to-video' + }, + { + oldSlug: 'xai--grok-imagine-video-reference--animate-images', + newSlug: 'grok-imagine-video-reference-to-video' + } +] + +export const modelAliasUrls: readonly { alias: string; newSlug: string }[] = [ + { + alias: 'beeble--switchx', + newSlug: 'beeble-switchx-image-edit' + }, + { + alias: 'beeble--switchx-image-edit', + newSlug: 'beeble-switchx-image-edit' + }, + { + alias: 'beeble--switchx-video-edit', + newSlug: 'beeble-switchx-video-edit' + }, + { + alias: 'bfl--erase-v1', + newSlug: 'flux-tools-erase' + }, + { + alias: 'bfl--flux-2-max', + newSlug: 'flux-2-max-text-to-image' + }, + { + alias: 'bfl--flux-2-pro', + newSlug: 'flux-2-pro-text-to-image' + }, + { + alias: 'bfl--flux-3-image-to-video', + newSlug: 'flux-3-video-image-to-video' + }, + { + alias: 'bfl--flux-3-text-to-video', + newSlug: 'flux-3-video-text-to-video' + }, + { + alias: 'bfl--flux-3-video', + newSlug: 'flux-3-video-text-to-video' + }, + { + alias: 'bfl--flux-erase', + newSlug: 'flux-tools-erase' + }, + { + alias: 'bfl--flux-kontext-max', + newSlug: 'flux-1-kontext-max-image-edit' + }, + { + alias: 'bfl--flux-kontext-pro', + newSlug: 'flux-1-kontext-pro-image-edit' + }, + { + alias: 'bfl--flux-pro-1.0-expand', + newSlug: 'flux-pro-expand' + }, + { + alias: 'bfl--flux-pro-1.0-fill', + newSlug: 'flux-pro-fill' + }, + { + alias: 'bfl--flux-pro-1.1', + newSlug: 'flux-pro-1-1-text-to-image' + }, + { + alias: 'bfl--flux-pro-1.1-ultra', + newSlug: 'flux-pro-1-1-ultra-text-to-image' + }, + { + alias: 'bfl--flux-pro-expand', + newSlug: 'flux-pro-expand' + }, + { + alias: 'bfl--flux-pro-fill', + newSlug: 'flux-pro-fill' + }, + { + alias: 'bfl--flux-video-upscale', + newSlug: 'flux-video-upscale' + }, + { + alias: 'bfl--flux-virtual-try-on', + newSlug: 'flux-virtual-try-on' + }, + { + alias: 'bfl--video-upscale-v1', + newSlug: 'flux-video-upscale' + }, + { + alias: 'bfl--vto-v1', + newSlug: 'flux-virtual-try-on' + }, + { + alias: 'bria--eraser', + newSlug: 'bria-eraser' + }, + { + alias: 'bria--expand-image', + newSlug: 'bria-expand-image' + }, + { + alias: 'bria--fibo', + newSlug: 'bria-fibo-image-edit' + }, + { + alias: 'bria--fibo-image-edit', + newSlug: 'bria-fibo-image-edit' + }, + { + alias: 'bria--generative-fill', + newSlug: 'bria-generative-fill' + }, + { + alias: 'bria--green-screen-video', + newSlug: 'bria-green-screen-video' + }, + { + alias: 'bria--image-edit-erase', + newSlug: 'bria-eraser' + }, + { + alias: 'bria--image-edit-expand', + newSlug: 'bria-expand-image' + }, + { + alias: 'bria--image-edit-gen-fill', + newSlug: 'bria-generative-fill' + }, + { + alias: 'bria--image-edit-increase-resolution', + newSlug: 'bria-increase-resolution' + }, + { + alias: 'bria--image-edit-remove-background', + newSlug: 'bria-rmbg-2-0' + }, + { + alias: 'bria--increase-resolution', + newSlug: 'bria-increase-resolution' + }, + { + alias: 'bria--remove-image-background', + newSlug: 'bria-rmbg-2-0' + }, + { + alias: 'bria--remove-video-background', + newSlug: 'bria-remove-video-background' + }, + { + alias: 'bria--replace-video-background', + newSlug: 'bria-replace-video-background' + }, + { + alias: 'bria--video-edit-green-screen', + newSlug: 'bria-green-screen-video' + }, + { + alias: 'bria--video-edit-remove-background', + newSlug: 'bria-remove-video-background' + }, + { + alias: 'bria--video-edit-replace-background', + newSlug: 'bria-replace-video-background' + }, + { + alias: 'byteplus--dreamina-seedance-2-0-260128', + newSlug: 'seedance-2-0-text-to-video' + }, + { + alias: 'byteplus--dreamina-seedance-2-0-fast-260128', + newSlug: 'seedance-2-0-fast-text-to-video' + }, + { + alias: 'byteplus--dreamina-seedance-2-0-mini', + newSlug: 'seedance-2-0-mini-text-to-video' + }, + { + alias: 'byteplus--dreamina-seedance-2-5-260628', + newSlug: 'seedance-2-5-text-to-video' + }, + { + alias: 'byteplus--seed-audio-1.0', + newSlug: 'seed-audio-1-0-text-to-speech' + }, + { + alias: 'byteplus--seed-audio-1.0-multilingual', + newSlug: 'seed-audio-1-0-multilingual-text-to-speech' + }, + { + alias: 'byteplus--seedance-2-5-edit-video', + newSlug: 'seedance-2-5-video-edit' + }, + { + alias: 'byteplus--seedance-2-5-first-last-frame', + newSlug: 'seedance-2-5-first-last-frame' + }, + { + alias: 'byteplus--seedance-2-5-reference', + newSlug: 'seedance-2-5-reference-to-video' + }, + { + alias: 'byteplus--seedance-2-5-text-to-video', + newSlug: 'seedance-2-5-text-to-video' + }, + { + alias: 'byteplus--seedance-2-fast-first-last-frame', + newSlug: 'seedance-2-0-fast-first-last-frame' + }, + { + alias: 'byteplus--seedance-2-fast-reference', + newSlug: 'seedance-2-0-fast-reference-to-video' + }, + { + alias: 'byteplus--seedance-2-fast-text-to-video', + newSlug: 'seedance-2-0-fast-text-to-video' + }, + { + alias: 'byteplus--seedance-2-image-to-video', + newSlug: 'seedance-2-0-image-to-video' + }, + { + alias: 'byteplus--seedance-2-mini-text-to-video', + newSlug: 'seedance-2-0-mini-text-to-video' + }, + { + alias: 'byteplus--seedance-2-reference', + newSlug: 'seedance-2-0-reference-to-video' + }, + { + alias: 'byteplus--seedance-2-text-to-video', + newSlug: 'seedance-2-0-text-to-video' + }, + { + alias: 'byteplus--seedream-4', + newSlug: 'seedream-4-0-text-to-image' + }, + { + alias: 'byteplus--seedream-4-0-250828', + newSlug: 'seedream-4-0-text-to-image' + }, + { + alias: 'byteplus--seedream-4-5', + newSlug: 'seedream-4-5-text-to-image' + }, + { + alias: 'byteplus--seedream-4-5-251128', + newSlug: 'seedream-4-5-text-to-image' + }, + { + alias: 'byteplus--seedream-5-0-260128', + newSlug: 'seedream-5-0-lite-text-to-image' + }, + { + alias: 'byteplus--seedream-5-0-pro-260628', + newSlug: 'seedream-5-0-pro-text-to-image' + }, + { + alias: 'byteplus--seedream-5-lite', + newSlug: 'seedream-5-0-lite-text-to-image' + }, + { + alias: 'byteplus--seedream-5-pro', + newSlug: 'seedream-5-0-pro-text-to-image' + }, + { + alias: 'byteplus--seedream-5-pro-layer-separation', + newSlug: 'seedream-5-0-pro-layer-separation' + }, + { + alias: 'elevenlabs--eleven_v3', + newSlug: 'elevenlabs-text-to-dialogue' + }, + { + alias: 'elevenlabs--text-to-dialogue', + newSlug: 'elevenlabs-text-to-dialogue' + }, + { + alias: 'freepik--ai-skin-enhancer-creative', + newSlug: 'magnific-skin-enhancer' + }, + { + alias: 'freepik--magnific-skin-enhancer', + newSlug: 'magnific-skin-enhancer' + }, + { + alias: 'gemini--omni-1.1-flash', + newSlug: 'gemini-omni-1-1-flash-text-to-video' + }, + { + alias: 'gemini--omni-flash-preview', + newSlug: 'gemini-omni-flash-preview-text-to-video' + }, + { + alias: 'gemini-interactions--gemini-omni-1.1-flash', + newSlug: 'gemini-omni-1-1-flash-text-to-video' + }, + { + alias: 'gemini-interactions--gemini-omni-flash-preview', + newSlug: 'gemini-omni-flash-preview-text-to-video' + }, + { + alias: 'heygen--starfish', + newSlug: 'heygen-starfish-text-to-speech' + }, + { + alias: 'heygen--starfish-tts', + newSlug: 'heygen-starfish-text-to-speech' + }, + { + alias: 'ideogram--ideogram-v3', + newSlug: 'ideogram-v3-text-to-image' + }, + { + alias: 'ideogram--ideogram-v4', + newSlug: 'ideogram-v4-text-to-image' + }, + { + alias: 'ideogram--v3', + newSlug: 'ideogram-v3-text-to-image' + }, + { + alias: 'ideogram--v4', + newSlug: 'ideogram-v4-text-to-image' + }, + { + alias: 'kling--avatar', + newSlug: 'kling-avatar' + }, + { + alias: 'kling--kling-3.0-turbo', + newSlug: 'kling-3-0-turbo-text-to-video' + }, + { + alias: 'kling--kling-3.0-turbo-text-to-video', + newSlug: 'kling-3-0-turbo-text-to-video' + }, + { + alias: 'kling--kling-v2-5-turbo', + newSlug: 'kling-2-5-turbo-text-to-video' + }, + { + alias: 'kling--kling-v2-6', + newSlug: 'kling-2-6-pro-text-to-video-with-audio' + }, + { + alias: 'kling--kling-v3', + newSlug: 'kling-3-0-text-to-video' + }, + { + alias: 'kling--kling-v3-omni', + newSlug: 'kling-o3-image-to-video' + }, + { + alias: 'kling--kling-video-o1', + newSlug: 'kling-o3-text-to-video' + }, + { + alias: 'kling--lip-sync-audio-to-video', + newSlug: 'kling-lip-sync-audio-to-video' + }, + { + alias: 'kling--lip-sync-text-to-video', + newSlug: 'kling-lip-sync-text-to-video' + }, + { + alias: 'kling--omni-pro-edit-video', + newSlug: 'kling-o3-video-edit' + }, + { + alias: 'kling--omni-pro-image-to-video', + newSlug: 'kling-o3-image-to-video' + }, + { + alias: 'kling--omni-pro-text-to-video', + newSlug: 'kling-o3-text-to-video' + }, + { + alias: 'kling--omni-pro-video-to-video', + newSlug: 'kling-o3-video-to-video' + }, + { + alias: 'kling--text-to-video', + newSlug: 'kling-2-5-turbo-text-to-video' + }, + { + alias: 'kling--text-to-video-with-audio', + newSlug: 'kling-2-6-pro-text-to-video-with-audio' + }, + { + alias: 'kling--v3', + newSlug: 'kling-3-0-text-to-video' + }, + { + alias: 'kling--videos-avatar-image2video', + newSlug: 'kling-avatar' + }, + { + alias: 'kling--videos-lip-sync', + newSlug: 'kling-lip-sync-text-to-video' + }, + { + alias: 'krea--krea-2-large', + newSlug: 'krea-2-large-text-to-image' + }, + { + alias: 'krea--krea-2-medium', + newSlug: 'krea-2-medium-text-to-image' + }, + { + alias: 'krea--krea-2-medium-turbo', + newSlug: 'krea-2-medium-turbo-text-to-image' + }, + { + alias: 'luma--photon-1', + newSlug: 'luma-photon-1-text-to-image' + }, + { + alias: 'luma--photon-1-image-generation', + newSlug: 'luma-photon-1-text-to-image' + }, + { + alias: 'luma--photon-1-image-modify', + newSlug: 'luma-photon-1-image-edit' + }, + { + alias: 'luma--photon-flash-1', + newSlug: 'luma-photon-flash-1-text-to-image' + }, + { + alias: 'luma--photon-flash-1-image-generation', + newSlug: 'luma-photon-flash-1-text-to-image' + }, + { + alias: 'luma--photon-flash-1-image-modify', + newSlug: 'luma-photon-flash-1-image-edit' + }, + { + alias: 'luma--ray-2', + newSlug: 'luma-ray-2-text-to-video' + }, + { + alias: 'luma--ray-2-image-to-video', + newSlug: 'luma-ray-2-image-to-video' + }, + { + alias: 'luma--ray-2-text-to-video', + newSlug: 'luma-ray-2-text-to-video' + }, + { + alias: 'luma--ray-flash-2', + newSlug: 'luma-ray-flash-2-text-to-video' + }, + { + alias: 'luma--ray-flash-2-image-to-video', + newSlug: 'luma-ray-flash-2-image-to-video' + }, + { + alias: 'luma--ray-flash-2-text-to-video', + newSlug: 'luma-ray-flash-2-text-to-video' + }, + { + alias: 'luma_2--uni-1', + newSlug: 'luma-uni-1-text-to-image' + }, + { + alias: 'luma_2--uni-1-image-edit', + newSlug: 'luma-uni-1-image-edit' + }, + { + alias: 'luma_2--uni-1-image-generation', + newSlug: 'luma-uni-1-text-to-image' + }, + { + alias: 'luma_2--uni-1-max', + newSlug: 'luma-uni-1-max-text-to-image' + }, + { + alias: 'luma_2--uni-1-max-image-edit', + newSlug: 'luma-uni-1-max-image-edit' + }, + { + alias: 'luma_2--uni-1-max-image-generation', + newSlug: 'luma-uni-1-max-text-to-image' + }, + { + alias: 'openai--gpt-image-1', + newSlug: 'gpt-image-1-image-edit' + }, + { + alias: 'openai--gpt-image-1.5', + newSlug: 'gpt-image-1-5-image-edit' + }, + { + alias: 'openai--gpt-image-2', + newSlug: 'gpt-image-2-text-to-image' + }, + { + alias: 'openai--gpt-image-2.5-flare', + newSlug: 'gpt-image-2-5-flare-text-to-image' + }, + { + alias: 'openai--gpt-image-2.5-sunburst', + newSlug: 'gpt-image-2-5-sunburst-text-to-image' + }, + { + alias: 'qwen--qwen-image-3.0', + newSlug: 'qwen-image-3-0-text-to-image' + }, + { + alias: 'qwen--qwen-image-3.0-image-edit', + newSlug: 'qwen-image-3-0-image-edit' + }, + { + alias: 'qwen--qwen-image-3.0-pro', + newSlug: 'qwen-image-3-0-pro-text-to-image' + }, + { + alias: 'qwen--qwen-image-3.0-pro-image-edit', + newSlug: 'qwen-image-3-0-pro-image-edit' + }, + { + alias: 'qwen--qwen-image-3.0-pro-text-to-image', + newSlug: 'qwen-image-3-0-pro-text-to-image' + }, + { + alias: 'qwen--qwen-image-3.0-text-to-image', + newSlug: 'qwen-image-3-0-text-to-image' + }, + { + alias: 'recraft--recraftv3', + newSlug: 'recraft-v3-text-to-image' + }, + { + alias: 'recraft--recraftv4', + newSlug: 'recraft-v4-text-to-image' + }, + { + alias: 'recraft--recraftv4_1', + newSlug: 'recraft-v4-1-text-to-image' + }, + { + alias: 'recraft--recraftv4_1_pro', + newSlug: 'recraft-v4-1-pro-text-to-image' + }, + { + alias: 'recraft--recraftv4_1_pro_vector', + newSlug: 'recraft-v4-1-pro-text-to-vector' + }, + { + alias: 'recraft--recraftv4_1_utility', + newSlug: 'recraft-v4-1-utility-text-to-image' + }, + { + alias: 'recraft--recraftv4_1_utility_pro', + newSlug: 'recraft-v4-1-utility-pro-text-to-image' + }, + { + alias: 'recraft--recraftv4_1_utility_pro_vector', + newSlug: 'recraft-v4-1-utility-pro-text-to-vector' + }, + { + alias: 'recraft--recraftv4_1_utility_vector', + newSlug: 'recraft-v4-1-utility-text-to-vector' + }, + { + alias: 'recraft--recraftv4_1_vector', + newSlug: 'recraft-v4-1-text-to-vector' + }, + { + alias: 'recraft--recraftv4_pro', + newSlug: 'recraft-v4-pro-text-to-image' + }, + { + alias: 'recraft--v3-text-to-image', + newSlug: 'recraft-v3-text-to-image' + }, + { + alias: 'recraft--v3-text-to-vector', + newSlug: 'recraft-v3-text-to-vector' + }, + { + alias: 'recraft--v4-pro-text-to-image', + newSlug: 'recraft-v4-pro-text-to-image' + }, + { + alias: 'recraft--v4-pro-text-to-vector', + newSlug: 'recraft-v4-pro-text-to-vector' + }, + { + alias: 'recraft--v4-text-to-image', + newSlug: 'recraft-v4-text-to-image' + }, + { + alias: 'recraft--v4-text-to-vector', + newSlug: 'recraft-v4-text-to-vector' + }, + { + alias: 'recraft--v4.1-pro-text-to-image', + newSlug: 'recraft-v4-1-pro-text-to-image' + }, + { + alias: 'recraft--v4.1-pro-text-to-vector', + newSlug: 'recraft-v4-1-pro-text-to-vector' + }, + { + alias: 'recraft--v4.1-text-to-image', + newSlug: 'recraft-v4-1-text-to-image' + }, + { + alias: 'recraft--v4.1-text-to-vector', + newSlug: 'recraft-v4-1-text-to-vector' + }, + { + alias: 'recraft--v4.1-utility-pro-text-to-image', + newSlug: 'recraft-v4-1-utility-pro-text-to-image' + }, + { + alias: 'recraft--v4.1-utility-pro-text-to-vector', + newSlug: 'recraft-v4-1-utility-pro-text-to-vector' + }, + { + alias: 'recraft--v4.1-utility-text-to-image', + newSlug: 'recraft-v4-1-utility-text-to-image' + }, + { + alias: 'recraft--v4.1-utility-text-to-vector', + newSlug: 'recraft-v4-1-utility-text-to-vector' + }, + { + alias: 'runway--aleph2', + newSlug: 'runway-aleph-2-video-to-video' + }, + { + alias: 'runway--aleph2-video-to-video', + newSlug: 'runway-aleph-2-video-to-video' + }, + { + alias: 'runway--gen4-image', + newSlug: 'runway-gen-4-image-text-to-image' + }, + { + alias: 'runway--gen4-turbo-image-to-video', + newSlug: 'runway-gen-4-turbo-image-to-video' + }, + { + alias: 'runway--gen4_image', + newSlug: 'runway-gen-4-image-text-to-image' + }, + { + alias: 'runway--gen4_turbo', + newSlug: 'runway-gen-4-turbo-image-to-video' + }, + { + alias: 'veo--veo-3.1-generate-001', + newSlug: 'veo-3-text-to-video' + }, + { + alias: 'vertexai--gemini-2.5-flash-image', + newSlug: 'nano-banana-text-to-image' + }, + { + alias: 'vertexai--gemini-3-pro-image', + newSlug: 'nano-banana-pro-text-to-image' + }, + { + alias: 'vertexai--gemini-3.1-flash-image', + newSlug: 'nano-banana-2-text-to-image' + }, + { + alias: 'vertexai--gemini-nano-banana-2', + newSlug: 'nano-banana-2-text-to-image' + }, + { + alias: 'vertexai--veo-3', + newSlug: 'veo-3-text-to-video' + }, + { + alias: 'vertexai--veo-3-first-last-frame', + newSlug: 'veo-3-first-last-frame' + }, + { + alias: 'wan--happyhorse-1.0-video-edit', + newSlug: 'happyhorse-video-edit' + }, + { + alias: 'wan--happyhorse-1.1-r2v', + newSlug: 'happyhorse-reference-to-video' + }, + { + alias: 'wan--happyhorse-1.1-t2v', + newSlug: 'happyhorse-text-to-video' + }, + { + alias: 'wan--happyhorse-reference-video', + newSlug: 'happyhorse-reference-to-video' + }, + { + alias: 'wan--happyhorse-text-to-video', + newSlug: 'happyhorse-text-to-video' + }, + { + alias: 'wan--happyhorse-video-edit', + newSlug: 'happyhorse-video-edit' + }, + { + alias: 'wan--image-to-image', + newSlug: 'wan-2-5-image-edit' + }, + { + alias: 'wan--image-to-video', + newSlug: 'wan-2-6-image-to-video' + }, + { + alias: 'wan--image-to-video-2.7', + newSlug: 'wan-2-7-image-to-video' + }, + { + alias: 'wan--image-to-video-3.0', + newSlug: 'wan-3-0-image-to-video' + }, + { + alias: 'wan--image-to-video-3.0-prime', + newSlug: 'wan-3-0-prime-image-to-video' + }, + { + alias: 'wan--reference-to-video-3.0', + newSlug: 'wan-3-0-reference-to-video' + }, + { + alias: 'wan--reference-to-video-3.0-prime', + newSlug: 'wan-3-0-prime-reference-to-video' + }, + { + alias: 'wan--reference-video', + newSlug: 'wan-2-6-reference-to-video' + }, + { + alias: 'wan--reference-video-2.7', + newSlug: 'wan-2-7-reference-to-video' + }, + { + alias: 'wan--text-to-image', + newSlug: 'wan-2-5-text-to-image' + }, + { + alias: 'wan--text-to-video', + newSlug: 'wan-2-6-text-to-video' + }, + { + alias: 'wan--text-to-video-2.7', + newSlug: 'wan-2-7-text-to-video' + }, + { + alias: 'wan--text-to-video-3.0', + newSlug: 'wan-3-0-text-to-video' + }, + { + alias: 'wan--text-to-video-3.0-prime', + newSlug: 'wan-3-0-prime-text-to-video' + }, + { + alias: 'wan--video-continuation-2.7', + newSlug: 'wan-2-7-video-continuation' + }, + { + alias: 'wan--video-edit-2.7', + newSlug: 'wan-2-7-video-edit' + }, + { + alias: 'wan--wan2.5-i2i-preview', + newSlug: 'wan-2-5-image-edit' + }, + { + alias: 'wan--wan2.5-t2i-preview', + newSlug: 'wan-2-5-text-to-image' + }, + { + alias: 'wan--wan2.6-i2v', + newSlug: 'wan-2-6-image-to-video' + }, + { + alias: 'wan--wan2.6-r2v', + newSlug: 'wan-2-6-reference-to-video' + }, + { + alias: 'wan--wan2.6-t2v', + newSlug: 'wan-2-6-text-to-video' + }, + { + alias: 'wan--wan2.7-i2v', + newSlug: 'wan-2-7-image-to-video' + }, + { + alias: 'wan--wan2.7-r2v', + newSlug: 'wan-2-7-reference-to-video' + }, + { + alias: 'wan--wan2.7-t2v', + newSlug: 'wan-2-7-text-to-video' + }, + { + alias: 'wan--wan2.7-videoedit', + newSlug: 'wan-2-7-video-edit' + }, + { + alias: 'wan--wan3.0-video', + newSlug: 'wan-3-0-image-to-video' + }, + { + alias: 'wan--wan3.0-video-prime', + newSlug: 'wan-3-0-prime-image-to-video' + }, + { + alias: 'wavespeed--flashvsr', + newSlug: 'flashvsr' + }, + { + alias: 'wavespeed--seedvr2', + newSlug: 'seedvr2-image-upscaler' + }, + { + alias: 'wavespeed--seedvr2-image', + newSlug: 'seedvr2-image-upscaler' + }, + { + alias: 'wavespeed--ultimate-image-upscaler', + newSlug: 'ultimate-image-upscaler' + }, + { + alias: 'xai--grok-imagine-image', + newSlug: 'grok-imagine-image-text-to-image' + }, + { + alias: 'xai--grok-imagine-image-2.0', + newSlug: 'grok-imagine-image-2-0-text-to-image' + }, + { + alias: 'xai--grok-imagine-video', + newSlug: 'grok-imagine-video-text-to-video' + }, + { + alias: 'xai--grok-imagine-video-1.5', + newSlug: 'grok-imagine-video-1-5-text-to-video' + }, + { + alias: 'xai--grok-imagine-video-1.5-reference', + newSlug: 'grok-imagine-video-1-5-reference-to-video' + }, + { + alias: 'xai--grok-imagine-video-reference', + newSlug: 'grok-imagine-video-reference-to-video' + } +] From a0b33a0062c5fd15cdf42a19afd1dfc71ee26c3d Mon Sep 17 00:00:00 2001 From: Maanil Verma Date: Tue, 29 Sep 2026 13:07:42 +0530 Subject: [PATCH 05/28] fix(website): escape quotes and backslashes in the generated URL map --- apps/website/scripts/generate-model-url-map.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/website/scripts/generate-model-url-map.ts b/apps/website/scripts/generate-model-url-map.ts index 0fe5a60071a..7b6b00ac871 100644 --- a/apps/website/scripts/generate-model-url-map.ts +++ b/apps/website/scripts/generate-model-url-map.ts @@ -107,7 +107,7 @@ const entryLines = (fields: Record) => [ ' {', Object.entries(fields) - .map(([k, v]) => ` ${k}: '${v}'`) + .map(([k, v]) => ` ${k}: '${v.replace(/[\\']/g, '\\$&')}'`) .join(',\n'), ' }' ].join('\n') From 5c8194380bed8c9931ed60ff230f005ab06a3b09 Mon Sep 17 00:00:00 2001 From: Maanil Verma Date: Tue, 29 Sep 2026 15:06:39 +0530 Subject: [PATCH 06/28] fix(website): reject bad old slugs and escape table cells in the URL map generator --- .../website/scripts/generate-model-url-map.ts | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/apps/website/scripts/generate-model-url-map.ts b/apps/website/scripts/generate-model-url-map.ts index 7b6b00ac871..d76facc40d5 100644 --- a/apps/website/scripts/generate-model-url-map.ts +++ b/apps/website/scripts/generate-model-url-map.ts @@ -22,6 +22,7 @@ interface ModelUrlMap { } export const MODEL_URL_SLUG = /^[a-z0-9]+(-[a-z0-9]+)*$/ +const OLD_URL_SLUG = /^[\w.-]+$/ const TASK_WORDS_BY_USE_CASE: Readonly> = { 'generate-images': ['text-to-image', 'text-to-vector'], @@ -47,6 +48,8 @@ const hasWords = (slug: string, words: string) => export function modelUrlSlug(name: string): string { return name + .normalize('NFKD') + .replace(/\p{M}/gu, '') .toLowerCase() .replace(/[^a-z0-9]+/g, '-') .replace(/^-+|-+$/g, '') @@ -59,6 +62,10 @@ export function compileModelUrlMap( const newSlugByOld = new Map( models.map((model) => [model.slug, modelUrlSlug(model.name)]) ) + if (newSlugByOld.size !== models.length) + throw new Error('Two model pages share an old slug') + for (const slug of [...newSlugByOld.keys(), ...aliases.keys()]) + if (!OLD_URL_SLUG.test(slug)) throw new Error(`Invalid old slug: ${slug}`) const owners = new Map() for (const [oldSlug, newSlug] of newSlugByOld) { if (!MODEL_URL_SLUG.test(newSlug)) @@ -124,6 +131,8 @@ ${map.aliases.map(entryLines).join(',\n')} ` } +const cell = (text: string) => text.replace(/\s+/g, ' ').replace(/\|/g, '\\|') + export function renderModelUrlTable( models: readonly MapModel[], map: ModelUrlMap @@ -132,7 +141,11 @@ export function renderModelUrlTable( map.pages.map((page) => [page.oldSlug, page.newSlug]) ) const rows = models - .map((model) => ({ model, newSlug: newSlugByOld.get(model.slug) ?? '' })) + .map((model) => { + const newSlug = newSlugByOld.get(model.slug) + if (!newSlug) throw new Error(`No new slug for ${model.slug}`) + return { model, newSlug } + }) .sort( (a, b) => compareText(a.model.provider ?? '', b.model.provider ?? '') || @@ -141,7 +154,7 @@ export function renderModelUrlTable( const flagged = rows.flatMap(({ model, newSlug }) => { const flags = modelUrlFlags(model, newSlug) return flags.length - ? [`| \`${newSlug}\` | ${model.name} | ${flags.join('; ')} |`] + ? [`| \`${newSlug}\` | ${cell(model.name)} | ${cell(flags.join('; '))} |`] : [] }) return [ @@ -161,7 +174,7 @@ export function renderModelUrlTable( '| --- | --- | --- | --- |', ...rows.map( ({ model, newSlug }) => - `| ${model.provider ?? ''} | ${model.name} | \`${model.slug}\` | \`${newSlug}\` |` + `| ${cell(model.provider ?? '')} | ${cell(model.name)} | \`${model.slug}\` | \`${newSlug}\` |` ), '', `## Aliases (${map.aliases.length})`, From 94e0e87a56c3f738089fb2d8c40898451ba3f794 Mon Sep 17 00:00:00 2001 From: Maanil Verma Date: Tue, 29 Sep 2026 15:08:14 +0530 Subject: [PATCH 07/28] test(website): match Vercel path patterns in the model URL collision check --- .../scripts/generate-model-url-map.test.ts | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/apps/website/scripts/generate-model-url-map.test.ts b/apps/website/scripts/generate-model-url-map.test.ts index 5a3adc0a522..753cf7759b5 100644 --- a/apps/website/scripts/generate-model-url-map.test.ts +++ b/apps/website/scripts/generate-model-url-map.test.ts @@ -28,6 +28,7 @@ const newSlugs = modelPageUrls.map((page) => page.newSlug) function sitePathPatterns(): string[] { const pagesDir = join(appDir, 'src/pages') const pages = readdirSync(pagesDir, { recursive: true, encoding: 'utf8' }) + .map((file) => file.replaceAll('\\', '/')) .filter((file) => /\.(astro|ts|mdx?)$/.test(file)) .filter((file) => !file.split('/').some((part) => part.startsWith('_'))) .filter((file) => !file.endsWith('.test.ts')) @@ -48,11 +49,11 @@ function sitePathPatterns(): string[] { function matchesRoute(pattern: string, path: string): boolean { const source = pattern - .split(/(\[[^\]]+\])/) + .split(/(\[[^\]]+\]|:\w+\*?|\(\.\*\))/) .map((part) => - part.startsWith('[...') + /^(\[\.\.\.|:\w+\*$|\(\.\*\)$)/.test(part) ? '.*' - : part.startsWith('[') + : /^(\[|:\w)/.test(part) ? '[^/]+' : part.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') ) @@ -126,6 +127,7 @@ describe('compileModelUrlMap', () => { ['FLUX.1 Kontext Max Image Edit', 'flux-1-kontext-max-image-edit'], ['Seedance 2.5 Text-to-Video', 'seedance-2-5-text-to-video'], ['Runway Gen-4 Turbo Image-to-Video', 'runway-gen-4-turbo-image-to-video'], + ['Café Photo 2.0', 'cafe-photo-2-0'], [' Bria RMBG 2.0 ', 'bria-rmbg-2-0'] ] as const)('slugifies %s', ([name, slug]) => { expect(modelUrlSlug(name)).toBe(slug) @@ -143,6 +145,25 @@ describe('compileModelUrlMap', () => { ).toThrow('both map to veo-3-text-to-video') }) + it.for([ + ['a shared old slug', ['veo--veo-3', 'veo--veo-3'], 'share an old slug'], + [ + 'a quote in an old slug', + ["veo--veo-3'", 'veo--veo-4'], + 'Invalid old slug' + ] + ] as const)('rejects %s', ([, [first, second], message]) => { + expect(() => + compileModelUrlMap( + [ + { slug: first, name: 'Veo 3 Text-to-Video' }, + { slug: second, name: 'Veo 4 Text-to-Video' } + ], + new Map() + ) + ).toThrow(message) + }) + it('rejects an alias whose target page does not exist', () => { expect(() => compileModelUrlMap( From 33275d1f704b009628b98b99aedf5855d8ad0ef9 Mon Sep 17 00:00:00 2001 From: Maanil Verma Date: Tue, 29 Sep 2026 18:48:27 +0530 Subject: [PATCH 08/28] chore(website): mark the generated model URL map as generated --- .gitattributes | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitattributes b/.gitattributes index a7f2ead8f78..e6ae22ff6c8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -15,3 +15,5 @@ apps/website/src/content/workshop-router-aliases.json linguist-generated=true apps/website/src/data/workshop-router-identity-audit.json linguist-generated=true apps/website/src/data/workshop-router-openapi.snapshot.json linguist-generated=true apps/website/src/data/workshop-node-pricing.json linguist-generated=true +apps/website/src/config/model-urls.ts linguist-generated=true +apps/website/MODEL_URL_MAP.md linguist-generated=true From ac62ead04ce0e3329979afbb094f941e5754b961 Mon Sep 17 00:00:00 2001 From: Maanil Verma Date: Tue, 29 Sep 2026 18:52:58 +0530 Subject: [PATCH 09/28] feat(website): serve model pages at /hub/models and point every internal link there --- apps/website/public/llms.txt | 2 +- .../website/scripts/generate-model-url-map.ts | 19 +++++- .../src/components/workshop/WorkflowPage.vue | 2 +- .../cinematic-studio/AppsBackLink.vue | 2 +- .../cinematic-studio/CinematicStudioPage.vue | 3 +- apps/website/src/config/hub-models.ts | 19 ++++++ .../website/src/config/models-url-registry.ts | 64 ++++++++++++------- apps/website/src/config/routes.ts | 10 +-- .../src/config/workshop-browse-content.ts | 3 +- apps/website/src/config/workshop-return.ts | 4 +- .../src/config/workshop-router-content.ts | 2 +- .../src/integrations/markdown-twins.ts | 2 +- .../src/integrations/workshop-release-gate.ts | 3 + apps/website/src/layouts/BaseLayout.astro | 5 +- apps/website/src/routes/models/[slug].astro | 20 +++++- apps/website/src/routes/models/index.astro | 2 + .../templates/platform/modelsGalleryCards.ts | 14 ++-- 17 files changed, 125 insertions(+), 51 deletions(-) create mode 100644 apps/website/src/config/hub-models.ts diff --git a/apps/website/public/llms.txt b/apps/website/public/llms.txt index 65d1440954d..3ea212a34b9 100644 --- a/apps/website/public/llms.txt +++ b/apps/website/public/llms.txt @@ -95,7 +95,7 @@ Languages: comfy.org is published in English and Simplified Chinese, with a Japa ## Models - [Supported Models](https://comfy.org/p/supported-models/): Directory of 380+ models that run in ComfyUI: image, video, audio, 3D, and utility models, each with its own page. Machine-readable catalog at https://comfy.org/p/supported-models/llms.txt. -- [Models Overview](https://comfy.org/models/): Flagship models available on Comfy, with links to each launch page. +- [Models Overview](https://comfy.org/hub/models/): Flagship models available on Comfy, with links to each launch page. - [ChatGPT Images 2.5 (OpenAI, image model)](https://comfy.org/chatgpt-image-2.5/): Generate new images, edit existing visuals, and direct results with reference images in repeatable ComfyUI workflows through Partner Nodes. - [Qwen-Image 2.1 (Alibaba Qwen, image model)](https://comfy.org/qwen-image-2.1/): Open-weights 7B image model that generates and edits in one checkpoint, with native 2K output, RGBA transparency, and accurate English and Chinese text rendering. - [Flux 3 (Black Forest Labs, video model)](https://comfy.org/flux-3/): Multimodal model: video with native audio, up to 20 seconds per generation, from text, image, video, or keyframes. diff --git a/apps/website/scripts/generate-model-url-map.ts b/apps/website/scripts/generate-model-url-map.ts index d76facc40d5..d3edb4c294b 100644 --- a/apps/website/scripts/generate-model-url-map.ts +++ b/apps/website/scripts/generate-model-url-map.ts @@ -6,6 +6,7 @@ import type { RouterWorkshopModel, UseCase } from '../src/config/models-catalogue' +import { hubModelSlugs } from '../src/config/hub-models' import { routerModelSlugAliases, workshopModels @@ -55,12 +56,20 @@ export function modelUrlSlug(name: string): string { .replace(/^-+|-+$/g, '') } +/** + * `frozen` holds the slugs already published: a page keeps its URL when its + * display name changes, and only pages new to the map get a slug from theirs. + */ export function compileModelUrlMap( models: readonly Pick[], - aliases: ReadonlyMap + aliases: ReadonlyMap, + frozen: ReadonlyMap = new Map() ): ModelUrlMap { const newSlugByOld = new Map( - models.map((model) => [model.slug, modelUrlSlug(model.name)]) + models.map((model) => [ + model.slug, + frozen.get(model.slug) ?? modelUrlSlug(model.name) + ]) ) if (newSlugByOld.size !== models.length) throw new Error('Two model pages share an old slug') @@ -193,7 +202,11 @@ export const MODEL_URLS_MODULE = join(appDir, 'src/config/model-urls.ts') export const MODEL_URL_TABLE = join(appDir, 'MODEL_URL_MAP.md') if (isDirectExecution(process.argv[1], import.meta.filename)) { - const map = compileModelUrlMap(workshopModels, routerModelSlugAliases) + const map = compileModelUrlMap( + workshopModels, + routerModelSlugAliases, + hubModelSlugs + ) await writeFile(MODEL_URLS_MODULE, renderModelUrlsModule(map)) await writeFile(MODEL_URL_TABLE, renderModelUrlTable(workshopModels, map)) console.warn(`${map.pages.length} pages, ${map.aliases.length} aliases`) diff --git a/apps/website/src/components/workshop/WorkflowPage.vue b/apps/website/src/components/workshop/WorkflowPage.vue index 35269623574..f099150f3e7 100644 --- a/apps/website/src/components/workshop/WorkflowPage.vue +++ b/apps/website/src/components/workshop/WorkflowPage.vue @@ -48,7 +48,7 @@ const cloudHref = template