feat: add comfyui sdk
This commit is contained in:
48
cargos/comfyui-sdk/lib.rs
Normal file
48
cargos/comfyui-sdk/lib.rs
Normal file
@@ -0,0 +1,48 @@
|
||||
//! # 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");
|
||||
Reference in New Issue
Block a user