feat: update to burn 0.14.0 with vulkan support and refactor frontend to egui
- Updated burn framework dependencies from 0.21.0-pre.2 to 0.14.0 - Added optional vulkan backend support with burn-wgpu feature - Replaced React/TypeScript frontend with native Rust egui frontend - Added Vulkan GPU support documentation and setup instructions - Updated README with new architecture and backend configuration - Refactored GPU backend detection and reporting to include backend type - Added vulkan-backend feature flag for conditional compilation - Updated dependency installation instructions for Vulkan support
This commit is contained in:
77
README.md
77
README.md
@@ -4,21 +4,22 @@
|
||||
This project implements an AI image/video generation tool inspired by the node-based workflow editor of Stable Diffusion Web UI. Built as a modern web application using:
|
||||
|
||||
- **Backend**: Pure Rust (Actix-web framework)
|
||||
- **Frontend**: React + TypeScript with Node graph visualization (currently having TypeScript version conflict)
|
||||
- **Frontend**: Native Rust frontend using egui (replacing previous React/TypeScript frontend)
|
||||
- **New Frontend Alternative**: Native Rust frontend using egui
|
||||
- **GPU Acceleration**: ROCm integration for AMD RX 9070 XT GPU
|
||||
- **GPU Acceleration**: ROCm integration for AMD RX 9070 XT GPU or Vulkan GPU support
|
||||
|
||||
### Key Features:
|
||||
1. ✅ REST API for model inference requests
|
||||
2. 🔄 ROCm integration on AMD RX 9070 XT GPU
|
||||
3. ⚙️ Task queue system using Tokio async runtime (Rayon parallelism)
|
||||
4. 💾 File upload/download support with session management
|
||||
3. 🧼 Vulkan GPU backend support (optional)
|
||||
4. ⚙️ Task queue system using Tokio async runtime (Rayon parallelism)
|
||||
5. 💾 File upload/download support with session management
|
||||
|
||||
## Architecture Design:
|
||||
|
||||
```
|
||||
┌─────────────────────┐ WebSocket ┌──────────────────┐
|
||||
│ React Web Frontend │◄═══► progress │ Rust Backend API ├─▶ ROCm GPU (RX9070XT)
|
||||
│ Rust Frontend │◄═══► progress │ Rust Backend API ├─▶ ROCm GPU (RX9070XT)
|
||||
│ - Node Graph Editor | ├── Inference Queue|
|
||||
│ - Workflow Builder | ◄──── Models |
|
||||
╰─────────────────────╯ REST/JSON └────────┬──■═══►
|
||||
@@ -30,22 +31,27 @@ This project implements an AI image/video generation tool inspired by the node-b
|
||||
|
||||
### Prerequisites:
|
||||
- Rust toolchain (cargo)
|
||||
- Node.js & npm/yarn/pnpm
|
||||
- AMD ROCm installed for RX 9070 XT GPU acceleration
|
||||
- Vulkan drivers installed for Vulkan GPU support (optional)
|
||||
|
||||
```bash
|
||||
# Install dependencies if needed on Linux/AMD systems:
|
||||
|
||||
sudo apt-get update && sudo apt install -y build-essential cmake ninja-build libopenblas-dev
|
||||
sudo apt-get update && sudo apt install -y build-essential cmake ninja-build libopenblas-dev vulkan-tools
|
||||
|
||||
ROCm installation (run as user with appropriate permissions):
|
||||
wget https://repo.radeon.com/amd-install/latest/install.sh
|
||||
chmod +x amd-install/install.sh
|
||||
./amd-install/install.sh --no-dkms # Skip DKMS if AMD driver is already installed system-wide for RX9070XT
|
||||
# For Ubuntu/Debian systems:
|
||||
sudo apt install rocm-dev rocm-utils
|
||||
|
||||
# For other systems, follow AMD's official ROCm installation guide:
|
||||
# https://rocm.docs.amd.com/projects/install-on-linux/en/latest/
|
||||
|
||||
# Verify ROCm installation:
|
||||
rocminfo # Should show your GPU info including "gfx900" or similar architecture
|
||||
|
||||
# Verify Vulkan installation (if using Vulkan backend):
|
||||
vulkaninfo # Should show Vulkan-compatible GPUs
|
||||
|
||||
```
|
||||
|
||||
### Backend Setup (Rust):
|
||||
@@ -54,26 +60,16 @@ rocminfo # Should show your GPU info including "gfx900" or similar architectu
|
||||
cd backend
|
||||
cargo build --release # For production builds, use release mode for better performance on AMD GPUs
|
||||
|
||||
# Run the backend server:
|
||||
# Run the backend server with ROCm (default):
|
||||
./target/release/comfyui-backend-server [port]
|
||||
|
||||
# Run the backend server with Vulkan backend:
|
||||
GPU_BACKEND=vulkan ./target/release/comfyui-backend-server [port]
|
||||
|
||||
Backend runs at: http://localhost:[PORT]
|
||||
API endpoints available after starting.
|
||||
```
|
||||
|
||||
### Frontend Setup (React - currently has TypeScript conflict):
|
||||
|
||||
```bash
|
||||
cd frontend
|
||||
npm install # Install dependencies
|
||||
|
||||
Run dev mode with hot reload and AMD GPU preview support:
|
||||
yarn start
|
||||
|
||||
# Production build for deployment on ROCm systems:
|
||||
RUST_AMD_ROCM_PATH=/usr/local/AMDROCmlib yarn run prod-build && npm run serve
|
||||
```
|
||||
|
||||
### New Rust Frontend Setup (egui):
|
||||
|
||||
```bash
|
||||
@@ -107,20 +103,7 @@ src/
|
||||
|
||||
```
|
||||
|
||||
### Original Frontend Web App (`frontend/src`):
|
||||
```typescript/react
|
||||
src/
|
||||
├─ components/node-editor.tsx // Node-based workflow editor (graph canvas)
|
||||
- Drag & drop node positioning on AMD GPU-aware preview panel
|
||||
|
||||
├── store/graph-store.js # Redux state management for nodes
|
||||
│ │
|
||||
|
||||
└──── utils/api-client API calls to Rust backend server
|
||||
|
||||
```
|
||||
|
||||
### New Rust Frontend (`rust-frontend/src`):
|
||||
### Rust Frontend (`rust-frontend/src`):
|
||||
```rust
|
||||
src/
|
||||
├── main.rs # Main application entry point
|
||||
@@ -157,10 +140,22 @@ curl http://localhost:8080/api/infer \
|
||||
--data '{"prompt":"A futuristic cityscape","negative_prompt":"","guidance_scale":7,"steps":20}'
|
||||
```
|
||||
|
||||
3. **Web Frontend Usage**:
|
||||
- Open React app in browser (http://localhost:[frontend_port])
|
||||
3. **Frontend Usage**:
|
||||
- Run the egui frontend with `cargo run` or `cargo build --release`
|
||||
|
||||
4. ROCm GPU Acceleration is automatically detected and used when available.
|
||||
|
||||
5. **Vulkan Backend Usage** (optional):
|
||||
To use Vulkan backend instead of ROCm, build with the feature flag:
|
||||
```bash
|
||||
cargo build --features vulkan-backend
|
||||
```
|
||||
Then run with:
|
||||
```bash
|
||||
GPU_BACKEND=vulkan ./target/release/comfyui-backend-server
|
||||
```
|
||||
|
||||
The `/system-info` endpoint will now show the selected backend.
|
||||
|
||||
## API Endpoints:
|
||||
|
||||
@@ -204,4 +199,4 @@ This project follows open-source best practices with community contributions wel
|
||||
|
||||
---
|
||||
|
||||
**Built specifically to leverage AMD RX9070 XT GPU capabilities through ROCm framework for accelerated AI inference.**
|
||||
**Built specifically to leverage AMD RX 9070 XT GPU capabilities through ROCm framework for accelerated AI inference.**
|
||||
Reference in New Issue
Block a user