[automated] Apply ESLint and Oxfmt fixes

This commit is contained in:
GitHub Action
2026-05-04 07:38:02 +00:00
committed by bymyself
parent f1df30f24f
commit cb6accaca5
4 changed files with 21 additions and 19 deletions

View File

@@ -18,6 +18,7 @@ Add, update, or remove model pages in the ComfyUI website.
## Phase 1 — Parse the request
Extract:
- **action**: `add` | `update` | `remove`
- **model-name**: raw string (e.g. `flux1-schnell`, `flux1_dev.safetensors`)
@@ -30,11 +31,11 @@ Example: `flux1_dev.safetensors` → `flux1-dev`
Models come from two sources merged at build time:
| File | Purpose |
|------|---------|
| File | Purpose |
| ----------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| `apps/website/src/config/generated-models.json` | Auto-generated from workflow_templates (slug, name, directory, huggingFaceUrl, workflowCount, displayName) |
| `apps/website/src/config/model-metadata.ts` | Hand-curated overrides (docsUrl, blogUrl, featured) — only add entries that need overrides |
| `apps/website/src/config/models.ts` | Merges the two above; exports typed `Model[]` |
| `apps/website/src/config/model-metadata.ts` | Hand-curated overrides (docsUrl, blogUrl, featured) — only add entries that need overrides |
| `apps/website/src/config/models.ts` | Merges the two above; exports typed `Model[]` |
To regenerate the JSON from workflow_templates:
@@ -59,6 +60,7 @@ jq '.[] | select(.slug | contains("MODEL_SLUG"))' \
```
The JSON fields are:
- `slug` — URL slug
- `name` — exact filename or display name for partner nodes
- `huggingFaceUrl` — download URL (empty for partner nodes)
@@ -131,6 +133,7 @@ pnpm typecheck 2>&1 | grep -E "error|warning" | head -20
```
Fix any type errors before proceeding. Common issues:
- `ModelDirectory` type not matching a new `directory` value — add it to the union
- JSON import shape mismatch — `generated-models.json` must match `OutputModel`
@@ -167,9 +170,9 @@ For REMOVE use `remove-model-page-MODEL-SLUG` and omit the images note.
## Error states
| Situation | Response |
|-----------|----------|
| Situation | Response |
| ------------------------------- | ---------------------------------------------------------------- |
| Model not in workflow templates | Ask user to verify spelling or add it manually as a partner node |
| Slug already exists (add) | Switch to update flow automatically |
| Slug not found (update/remove) | Stop and ask user to confirm |
| Typecheck fails | Fix the error before pushing |
| Slug already exists (add) | Switch to update flow automatically |
| Slug not found (update/remove) | Stop and ask user to confirm |
| Typecheck fails | Fix the error before pushing |

View File

@@ -1,5 +1,5 @@
import { readdirSync, readFileSync, writeFileSync } from 'node:fs'
import { join, basename } from 'node:path'
import { join } from 'node:path'
import { fileURLToPath } from 'node:url'
const TEMPLATES_DIR = fileURLToPath(
@@ -16,7 +16,7 @@ const QUANT_SUFFIXES = [
'_fp16',
'_fp4',
'_bf16',
'_int8',
'_int8'
]
interface RawModel {
@@ -77,7 +77,7 @@ const API_PROVIDER_MAP: Record<string, { name: string; slug: string }> = {
veo3: { name: 'Veo 3', slug: 'veo-3' },
flux2: { name: 'Flux 2 (API)', slug: 'flux-2-api' },
wavespeed: { name: 'Wavespeed', slug: 'wavespeed' },
wavespped: { name: 'Wavespeed', slug: 'wavespeed' },
wavespped: { name: 'Wavespeed', slug: 'wavespeed' }
}
function stripExt(name: string): string {
@@ -103,7 +103,7 @@ function makeSlug(name: string): string {
function makeDisplayName(name: string): string {
const base = stripExt(name)
return base
.split(/[_\-]/)
.split(/[_-]/)
.map((part) => {
if (/^(fp\d+|bf\d+|int\d+)$/i.test(part)) return part.toUpperCase()
if (/^(e4m3fn|scaled|mixed|fp8mixed)$/i.test(part)) return part
@@ -172,7 +172,7 @@ function extractApiModels(files: string[]): ApiModelData[] {
slug,
name: found.name,
directory: 'partner_nodes' as const,
templateCount: count,
templateCount: count
}
})
}
@@ -232,7 +232,7 @@ function run(): void {
huggingFaceUrl: data.url,
directory: data.directory,
workflowCount: data.templates.size,
displayName: makeDisplayName(name),
displayName: makeDisplayName(name)
}
if (canonicalRaw !== null) {
result.canonicalSlug = makeSlug(canonicalRaw)
@@ -248,7 +248,7 @@ function run(): void {
huggingFaceUrl: '',
directory: m.directory,
workflowCount: m.templateCount,
displayName: m.name,
displayName: m.name
}))
const combined = [...apiOutput, ...output]

View File

@@ -1658,4 +1658,4 @@
"slug": "ltx-video-2b-v0-9",
"displayName": "Ltx Video 2b V0 9"
}
]
]

View File

@@ -35,8 +35,7 @@ export const modelMetadata: Record<string, ModelOverride> = {
featured: true
},
'hunyuan-video': {
docsUrl:
'https://docs.comfy.org/tutorials/video/hunyuan/hunyuan-video',
docsUrl: 'https://docs.comfy.org/tutorials/video/hunyuan/hunyuan-video',
featured: true
},
// Wave 3