⚠️ Beta Version NoticeThis is an early preview release (v0.1.0-beta) with the following limitations:
- Tested only on macOS Apple Silicon (M1/M2/M3)
- Some features may be unstable or contain bugs
- Windows/Linux support not yet available
- API may change in future versions
Feedback and contributions are welcome!
基于 stable-diffusion.cpp 的现代化 Web 管理界面,为 macOS (Apple Silicon) 优化。
- 🎨 文生图 (txt2img) - 根据文本提示词生成图片
- 🖼️ 图生图 (img2img) - 基于输入图片生成变体
- ✏️ 图像修复 (inpaint) - 局部重绘和修复
- 🔍 超分辨率 (upscale) - 图片放大增强
- 📦 模型管理 - 扫描、加载、切换模型
- 📚 历史记录 - 浏览、搜索、收藏生成历史
- ⚙️ 预设管理 - 风格模板和自定义预设
- 📊 资源监控 - CPU/内存/GPU 实时状态
- 🖥️ 桌面应用 - Tauri 打包的原生 macOS 应用
前端: React 19 + TypeScript + Zustand + Tailwind CSS 4 + Vite 8
后端: Bun + Hono + SQLite (Drizzle ORM)
桌面: Tauri 2.x (Rust)
引擎: stable-diffusion.cpp v1.8.0+ (Metal 加速)
- macOS 13.0+ (Ventura or later, recommended)
- macOS 12.0+ (Monterey, minimum support)
- Apple Silicon Mac (M1/M2/M3) - Required
- 16GB RAM (recommended) / 8GB RAM (minimum)
- Bun 1.0+
- Rust 1.70+ (for Tauri build)
- Xcode Command Line Tools
- stable-diffusion.cpp v1.8.0+ (installed separately)
# 克隆项目
git clone <repository-url>
cd sd-webui
# 安装依赖
bun install
# 运行环境检查
bun run setup# 启动开发服务器 (前后端同时启动)
bun run dev
# 或分别启动
bun run dev:frontend # http://localhost:5173
bun run dev:server # http://localhost:7860# 构建所有项目
bun run build
# 分别构建
bun run build:frontend
bun run build:serversd-webui/
├── frontend/ # 前端项目 (React + TypeScript)
│ ├── src/
│ │ ├── features/ # 功能模块
│ │ ├── shared/ # 共享组件
│ │ ├── services/ # API 服务
│ │ └── styles/ # 样式
│ └── package.json
│
├── server/ # 后端项目 (Bun + Hono)
│ ├── src/
│ │ ├── routes/ # 路由
│ │ ├── services/ # 业务逻辑
│ │ ├── engine/ # 引擎交互
│ │ └── db/ # 数据库
│ └── package.json
│
├── src-tauri/ # Tauri 桌面应用 (Rust)
│ ├── src/
│ │ └── main.rs # Tauri 主入口
│ ├── icons/ # 应用图标
│ ├── Cargo.toml # Rust 依赖配置
│ └── tauri.conf.json # Tauri 配置
│
├── shared/ # 共享类型定义
├── scripts/ # 开发脚本
├── docs/ # 文档
├── e2e/ # E2E 测试 (Playwright)
└── package.json # Workspace 配置
- TypeScript 严格模式
- ESLint + Prettier 自动格式化
- Conventional Commits 提交规范
# 代码检查
bun run lint
# 代码格式化
bun run format
# 类型检查
bun run typecheck
# 运行测试
bun run test项目使用 Husky 自动化代码检查:
pre-commit: 运行 lint-stagedcommit-msg: 验证提交信息格式
- Platform Limitation: Only supports macOS Apple Silicon. Windows/Linux support is planned.
- Model Compatibility: Only tested with select GGUF models. Some models may not work properly.
- Memory Usage: Large model generation may consume significant memory. 16GB+ RAM recommended.
- Initial Startup: First model load takes 30-60 seconds. Subsequent loads are faster.
- DMG Signing: Not notarized by Apple. First launch requires manual confirmation.
See RELEASE_NOTES_BETA.md for detailed information.
参考官方仓库:https://github.com/leejet/stable-diffusion.cpp
# macOS (Homebrew)
brew install stable-diffusion.cpp
# 或从源码编译
git clone https://github.com/leejet/stable-diffusion.cpp
cd stable-diffusion.cpp
make确保:
- 使用 Apple Silicon Mac (M1/M2/M3)
- macOS 版本 ≥ 12.0
- stable-diffusion.cpp 编译时启用了 Metal 支持
MIT
This project is in early development stage. All forms of contributions are welcome:
- 🐛 Report bugs (use Bug Report Template)
- 💡 Suggest features (use Feature Request Template)
- 📝 Improve documentation
- 🔧 Submit code fixes (read Contributing Guide)
- 🧪 Test on different environments and provide feedback
Check out Good First Issues to get started!
注意: 本项目处于早期开发阶段,部分功能可能尚未完成。