Files
Ben_Kosytorz 14137101f3 feat(rust-frontend): remove unused api_client parameter and update result type
- 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
2026-03-03 08:30:05 +01:00
..

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:

  • eframe and egui for the UI framework
  • reqwest for HTTP communication with the backend
  • serde for 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

  1. Make sure you have Rust installed (rustup or curl https://sh.rustup.org/rustup.sh -sSf | sh)
  2. Start the backend server:
    cd ../backend && cargo run
    
  3. 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.