Skip to content

Commit 664e2be

Browse files
committed
Add a spell-check action.
1 parent 6950840 commit 664e2be

File tree

4 files changed

+329
-0
lines changed

4 files changed

+329
-0
lines changed

.github/.spellcheck.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
matrix:
2+
- name: Markdown
3+
sources:
4+
- '**/*.md'
5+
aspell:
6+
lang: en
7+
dictionary:
8+
wordlists:
9+
- .github/.wordlist.txt
10+
encoding: utf-8
11+
pipeline:
12+
- pyspelling.filters.markdown:
13+
markdown_extensions:
14+
- pymdownx.superfences:
15+
- pyspelling.filters.html:
16+
comments: false
17+
ignores:
18+
- code
19+
- pre
20+
21+
- name: Index JSON Files
22+
sources:
23+
- 'templates/index*.json'
24+
aspell:
25+
lang: en
26+
dictionary:
27+
wordlists:
28+
- .github/.wordlist.txt
29+
encoding: utf-8
30+
pipeline:
31+
- pyspelling.filters.text:
32+
33+
- name: Workflow JSON Files
34+
sources:
35+
- 'templates/*.json'
36+
- '!templates/index*.json'
37+
aspell:
38+
lang: en
39+
dictionary:
40+
wordlists:
41+
- .github/.wordlist.txt
42+
encoding: utf-8
43+
pipeline:
44+
- pyspelling.filters.context:
45+
context_visible_first: true
46+
escapes: \\[\\`~]
47+
delimiters:
48+
# Extract widgets_values from MarkdownNote and Note nodes
49+
- open: '(?s)"type":\s*"(?:MarkdownNote|Note)".*?"widgets_values":\s*\['
50+
close: '\]'
51+
- pyspelling.filters.text:
52+

.github/.wordlist.txt

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
# Custom dictionary for ComfyUI workflow templates
2+
ComfyUI
3+
ComfyUI's
4+
Comfy
5+
comfyui
6+
comfyanonymous
7+
webp
8+
WEBP
9+
png
10+
jpeg
11+
jpg
12+
MP4
13+
mp4
14+
mp3
15+
workflow
16+
workflows
17+
VAE
18+
vae
19+
UNETLoader
20+
CLIPLoader
21+
VAELoader
22+
SaveWEBM
23+
hugginface
24+
huggingface
25+
embeddings
26+
UNET
27+
safetensors
28+
repackaged
29+
fp8
30+
bf16
31+
xxl
32+
thumbnails
33+
Wan
34+
ltxv
35+
cnr
36+
diffusion
37+
PyPi
38+
pyproject
39+
toml
40+
PySpelling
41+
Zod
42+
e4m3fn
43+
t2v
44+
s2v
45+
i2v
46+
t2i
47+
i2i
48+
modelFile
49+
Github
50+
Pinia
51+
composables
52+
Vitest
53+
Playwright
54+
eslint
55+
prettier
56+
EzGif
57+
ezgif
58+
gif
59+
markdown
60+
Markdownlint
61+
nodejs
62+
npm
63+
pnpm
64+
repo
65+
utils
66+
changelog
67+
encoders
68+
diffusers
69+
configs
70+
metadata
71+
SHA256
72+
bytedance
73+
seedream4
74+
flf2v
75+
bfl
76+
kontext
77+
vercel
78+
Qwen
79+
qwen
80+
subgraphed
81+
moduleName
82+
mediaType
83+
mediaSubtype
84+
tutorialUrl
85+
thumbnailVariant
86+
hoverDissolve
87+
hoverZoom
88+
compareSlider
89+
isEssential
90+
LoRA
91+
lora
92+
inpaint
93+
inpainting
94+
upscaling
95+
upscale
96+
ControlNet
97+
controlnet
98+
SDXL
99+
sdxl
100+
Flux
101+
flux
102+
Hunyuan3D
103+
hunyuan
104+
ACE
105+
upscaler
106+
detailer
107+
img2img
108+
latents
109+
IPAdapter
110+
AnimateDiff
111+
AnimateLCM
112+
LCM
113+
LTX
114+
LTXV
115+
CogVideo
116+
CogVideoX
117+
GGUF
118+
gguf
119+
fp16
120+
SD1
121+
SD3
122+
SD3.5
123+
Latte
124+
Mochi
125+
Mamba
126+
SORA
127+
StyleGan
128+
StyleGAN
129+
VideoLLM
130+
controlnets
131+
DepthMap
132+
depthmap
133+
Canny
134+
OpenPose
135+
ComfyOrg
136+
Comfy-Org
137+
Safetensor
138+
PyTorch
139+
pytorch
140+
cuda
141+
CUDA
142+
VRAM
143+
vram
144+
GPU
145+
cpu
146+
checkpoints
147+
OSS
148+
API
149+
api
150+
JSON
151+
json
152+
UI
153+
mediafiles
154+
videogen
155+
imagegen
156+
audiogen
157+
quantized
158+
quantization
159+
MarkdownNote
160+
civitai
161+
majicmixRealistic
162+
japaneseStyleRealistic
163+
openpose
164+
mse
165+
ema
166+
pruned
167+
stabilityai
168+
fp
169+
v11p
170+
v7
171+
v20
172+
sd15
173+
vae-ft-mse
174+
safetensor
175+
workflows
176+
href
177+
url
178+
github
179+
README
180+
readme
181+
workaround
182+

.github/extract_workflow_text.py

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#!/usr/bin/env python3
2+
"""
3+
Custom filter for PySpelling to extract text content from workflow JSON files.
4+
Only extracts widgets_values from MarkdownNote and Note type nodes.
5+
"""
6+
import json
7+
import sys
8+
import io
9+
10+
def extract_text_from_workflow(content):
11+
"""Extract text from widgets_values in MarkdownNote and Note nodes."""
12+
try:
13+
data = json.loads(content)
14+
15+
# Handle different JSON structures
16+
nodes = []
17+
if isinstance(data, dict):
18+
# Check if it's a workflow with nodes
19+
if 'nodes' in data:
20+
nodes = data['nodes']
21+
elif 'workflow' in data and 'nodes' in data['workflow']:
22+
nodes = data['workflow']['nodes']
23+
elif isinstance(data, list):
24+
nodes = data
25+
26+
extracted_text = []
27+
28+
for node in nodes:
29+
if not isinstance(node, dict):
30+
continue
31+
32+
node_type = node.get('type', '')
33+
34+
# Only process MarkdownNote and Note nodes
35+
if node_type in ['MarkdownNote', 'Note']:
36+
widgets_values = node.get('widgets_values', [])
37+
38+
# Extract text from widgets_values
39+
for value in widgets_values:
40+
if isinstance(value, str):
41+
extracted_text.append(value)
42+
elif isinstance(value, (list, dict)):
43+
# Convert complex values to string
44+
extracted_text.append(str(value))
45+
46+
return '\n\n'.join(extracted_text) if extracted_text else ''
47+
48+
except json.JSONDecodeError:
49+
return ''
50+
except Exception as e:
51+
print(f"Error processing workflow: {e}", file=sys.stderr)
52+
return ''
53+
54+
55+
def main():
56+
"""Read from stdin and output extracted text to stdout."""
57+
content = sys.stdin.read()
58+
result = extract_text_from_workflow(content)
59+
sys.stdout.write(result)
60+
61+
62+
if __name__ == '__main__':
63+
main()
64+

.github/workflows/spellcheck.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Spellcheck
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
paths:
9+
- '**/*.md'
10+
- '**/*.json'
11+
- 'docs/**'
12+
- 'templates/**'
13+
- '.github/.spellcheck.yml'
14+
- '.github/.wordlist.txt'
15+
- '.github/workflows/spellcheck.yml'
16+
17+
jobs:
18+
spellcheck:
19+
name: Spellcheck
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
26+
- name: Run spellcheck
27+
uses: rojopolis/[email protected]
28+
name: Spellcheck
29+
with:
30+
config_path: .github/.spellcheck.yml
31+

0 commit comments

Comments
 (0)