Skip to content

Text to vertical video in 100+ styles: AI codes each scene (HTML/SVG/WebGL), renders a 9:16 MP4 with music and English/Vietnamese voice. MCP, CLI and REST for AI agents.

2.4 KB
Raw Blame

Mã chép từ AskEditor (MIT)

  • Nguồn: https://github.com/AskEditor/ai-video-editing-skills, commit e20000b262fb5f2b7e0e87f9354d44bc00e545ca (chép ngày 28/11/2026).
  • Giấy phép: mã MIT (LICENSE, © AskEditor). Font OFL 1.1 (mỗi font có OFL.txt đi kèm). Model tải lúc cài, mỗi model giữ giấy phép riêng (NOTICE.md).
  • Phần đã chép: fx/core/ (toàn bộ), fx/effects/{__init__,options,clean_cut,captions,qc_check}.py, fx/run.py, fx/meta.py, effects/{clean-cut,captions,qc-check}/effect.json, fonts/, requirements.txt. 38 hiệu ứng còn lại KHÔNG chép.
  • LumReels gọi phần này qua edit/py/lumedit.py (không qua fx/run.py).

Chỗ LumReels đã sửa (đánh dấu [LumReels] trong mã)

  1. fx/core/words.py
    • Ngôn ngữ và model chép lời lấy từ biến môi trường: FX_LANG (vd vi), FX_WHISPER (vd large-v3), FX_DEVICE (auto|cuda|cpu). Không đặt thì giữ nguyên như gốc (small.en, tiếng Anh, CPU).
    • Chạy GPU khi có CUDA: cuda_libraries() nạp DLL cuBLAS/cuDNN từ wheel nvidia-* (Windows); Linux dùng LD_LIBRARY_PATH do edit/env.mjs đặt; macOS chạy CPU. GPU lỗi thì tự chuyển CPU.
    • Khoá cache chữ (model_key) gồm model + ngôn ngữ, nên đổi model thì chép lại.
    • Không dùng câu mồi (initial_prompt) ngoài tiếng Anh (làm whisper bịa câu tiếng Việt).
    • Từ đệm tiếng Việt (ờ, ờm, ừm, ơ, hừm); câu whisper hay bịa ("hãy subscribe…", "ghiền mì gõ"…) bị bỏ ngay ở lượt nghe đầu.
    • Ghi thiết bị whisper thật (DEVICE: cuda float16 hoặc cpu int8 (lý do)) vào cache chữ (device), để log Edit thấy khi GPU âm thầm rơi về CPU.
  2. fx/core/text.py: khi FX_LANG=vi, các mặt chữ Poppins (thiếu dấu Việt) vẽ bằng Be Vietnam Pro (OFL), do node edit/setup.mjs ghép từ engine/fonts.
  3. fx/core/models.py: thêm lệnh fetch-vision (chỉ tải model mặt/người; model giọng do FX_WHISPER lo).
  4. Mọi read_text() ghi rõ encoding="utf-8". Ngoài ra LumReels luôn chạy Python với -X utf8 / PYTHONUTF8=1 vì Windows mặc định cp1252 làm vỡ chữ Việt ở các chỗ write_text().
  5. fx/core/video.py: FrameWriter đọc FX_VCODEC_ARGS (danh sách JSON tham số ffmpeg, vd h264_nvenc) thay cho libx264 khi Node đặt (edit/encoder.mjs); không đặt thì giữ libx264 như gốc.