49 lines
1.4 KiB
Rust
49 lines
1.4 KiB
Rust
//! # ComfyUI SDK for Rust
|
|
//!
|
|
//! A modern Rust SDK for ComfyUI with flexible template system and elegant callback mechanisms.
|
|
//!
|
|
//! ## Features
|
|
//!
|
|
//! - **HTTP Client**: Full-featured HTTP client for ComfyUI API
|
|
//! - **WebSocket Client**: Real-time event handling and progress tracking
|
|
//! - **Template System**: Parameterized workflow templates with validation
|
|
//! - **Built-in Templates**: Pre-built templates for common workflows
|
|
//! - **Type Safety**: Full type safety with comprehensive error handling
|
|
//! - **Async/Await**: Modern async/await support throughout
|
|
//!
|
|
//! ## Quick Start
|
|
//!
|
|
//! ```rust,no_run
|
|
//! use comfyui_sdk::{ComfyUIClient, ComfyUIClientConfig};
|
|
//!
|
|
//! #[tokio::main]
|
|
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|
//! let mut client = ComfyUIClient::new(ComfyUIClientConfig {
|
|
//! base_url: "http://localhost:8188".to_string(),
|
|
//! ..Default::default()
|
|
//! })?;
|
|
//!
|
|
//! client.connect().await?;
|
|
//! println!("Connected to ComfyUI!");
|
|
//!
|
|
//! Ok(())
|
|
//! }
|
|
//! ```
|
|
|
|
pub mod client;
|
|
pub mod templates;
|
|
pub mod template_hub;
|
|
pub mod types;
|
|
pub mod utils;
|
|
pub mod error;
|
|
|
|
// Re-export main types and functions
|
|
pub use client::{ComfyUIClient, HTTPClient, WebSocketClient};
|
|
pub use templates::{WorkflowTemplate, WorkflowInstance, TemplateManager};
|
|
pub use template_hub::*;
|
|
pub use types::*;
|
|
pub use error::{ComfyUIError, Result};
|
|
|
|
/// SDK version
|
|
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
|