🎨 一键更换头像背景,AI 智能抠图,快速生成个性化头像
- 🚀 极速抠图:快速模式 37ms 完成,比传统方法快 45 倍
- 🎯 双模式选择:快速模式 + 高质量 AI 模式,满足不同需求
- 📱 响应式设计:完美适配移动端和桌面端
- 🌍 多语言支持:中文/英文界面切换
- 🎨 丰富背景:预设颜色 + 自定义背景图片
- ⚡ 本地处理:无需上传到服务器,保护隐私
- 📦 多格式导出:支持 PNG、JPG、WebP 格式
访问:https://your-username.github.io/x-avater/
- 前端框架:Vue 3 + TypeScript
- 构建工具:Vite
- UI 框架:Tailwind CSS + DaisyUI
- 状态管理:Pinia
- AI 抠图:MediaPipe + 自研快速算法
- 国际化:Vue I18n
VSCode + Volar (and disable Vetur).
See Vite Configuration Reference.
npm installnpm run devnpm run buildnpm run build:gh-pages-
Fork 本仓库到你的 GitHub 账户
-
启用 GitHub Pages:
- 进入仓库设置 → Pages
- Source 选择 "GitHub Actions"
-
修改配置:
- 编辑
vite.config.js中的base路径:
base: process.env.NODE_ENV === 'production' ? '/你的仓库名/' : '/',
- 编辑
-
推送代码:
git add . git commit -m "Deploy to GitHub Pages" git push origin main
-
等待部署完成:
- GitHub Actions 会自动构建和部署
- 访问
https://你的用户名.github.io/你的仓库名/
# 构建项目
npm run build:gh-pages
# 部署到 gh-pages 分支(需要安装 gh-pages)
npm install -g gh-pages
gh-pages -d dist- Node.js:20.19+ 或 22.12+
- npm:最新版本
NODE_ENV=production:生产环境构建- 自动优化资源路径和性能
- ✅ SPA 路由重定向支持
- ✅ 静态资源路径优化
- ✅ 自动化 CI/CD 部署
- ✅ 404 页面处理