- Flask frontend + serialized GPU worker + BTCPay invoice/webhook - 12 example images rendered from the real ComfyUI workflows - fix: ipadapter workflow uses modern IPAdapter node (was broken IPAdapterApply) - helper scripts: generate/optimize examples - README with deploy recipe
16 lines
609 B
Python
16 lines
609 B
Python
#!/usr/bin/env python3
|
|
"""Optimize generated example PNGs into web-friendly JPEGs (<=1024px)."""
|
|
import os, glob
|
|
from PIL import Image
|
|
|
|
EXAMPLES = os.path.expanduser("~/comfy-web/static/examples")
|
|
|
|
for png in sorted(glob.glob(os.path.join(EXAMPLES, "*.png"))):
|
|
im = Image.open(png).convert("RGB")
|
|
im.thumbnail((1024, 1024), Image.LANCZOS)
|
|
jpg = os.path.splitext(png)[0] + ".jpg"
|
|
im.save(jpg, "JPEG", quality=87, optimize=True, progressive=True)
|
|
kb = os.path.getsize(jpg) // 1024
|
|
os.remove(png) # drop the giant full-res png
|
|
print(f"{os.path.basename(jpg):22s} {im.size} {kb}KB")
|