- Updated README.md to reflect the addition of a native Rust frontend using egui - Added setup instructions for the new rust-frontend directory - Modified frontend package.json to downgrade TypeScript version from 5.3.3 to 4.9.5 due to conflicts - Updated path references in documentation from ComfyUI-Rust/ to direct paths - Reorganized project structure documentation to distinguish between original and new frontends
1.6 KiB
1.6 KiB
ComfyUI Rust Frontend
A native Rust frontend for ComfyUI-like AI image generation tool using egui.
Features
- Node-based workflow editor
- Real-time preview pane
- Integration with backend API
- ROCm support through Rust bindings
Architecture
This frontend is built with:
eframeandeguifor the UI frameworkreqwestfor HTTP communication with the backendserdefor JSON serialization/deserialization
Project Structure
src/
├── main.rs # Main application entry point
├── node_editor.rs # Node-based workflow editor implementation
├── node_panel.rs # Panel for selecting and managing nodes
├── preview_pane.rs # Preview pane for image results
└── api_client.rs # Backend API communication layer
Running the Application
- Make sure you have Rust installed (
rustuporcurl https://sh.rustup.org/rustup.sh -sSf | sh) - Start the backend server:
cd ../backend && cargo run - In another terminal, run the frontend:
cd rust-frontend && cargo run
Building
To build for release:
cd rust-frontend && cargo build --release
The executable will be located at target/release/comfyui-rust-frontend.
Integration with Backend
This frontend communicates with the backend through HTTP API endpoints. The API client handles:
- Fetching available node types from
/nodes - Executing workflows via POST to
/execute - Getting execution results and preview images
The backend must be running on http://localhost:8080 by default, but this can be configured in src/main.rs.