- Updated main function return type from eframe::Result to eframe::Result<()> - Removed unused std::sync::Arc import in main.rs - Marked unused api_client parameters as _api_client in node_editor.rs and preview_pane.rs - Added underscore prefix to unused image_data variable in preview_pane.rs - Improves code clarity by removing unused dependencies and parameters
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.