mixvideo-v2/cargos/uni-comfyui-sdk/src/lib.rs

59 lines
1.8 KiB
Rust

//! # uni-comfyui-sdk
//!
//! Rust SDK for ComfyUI Workflow Service & Management API
//!
//! This SDK provides a type-safe interface to interact with the ComfyUI API,
//! including workflow management, execution, monitoring, and server management.
//!
//! ## Features
//!
//! - **Status Management**: Get metrics, server status, and file listings
//! - **Workflow Management**: Create, retrieve, and delete workflows
//! - **Workflow Execution**: Run workflows and monitor their status
//! - **Server Management**: Register, unregister, and manage ComfyUI servers
//! - **Monitoring**: Health checks, system stats, and task monitoring
//! - **Type Safety**: Strongly typed API with comprehensive error handling
//!
//! ## Quick Start
//!
//! ```rust,no_run
//! use uni_comfyui_sdk::{UniComfyUIClient, Result};
//! use std::collections::HashMap;
//!
//! #[tokio::main]
//! async fn main() -> Result<()> {
//! // Create a client
//! let client = UniComfyUIClient::new("http://localhost:8000")?;
//!
//! // Get system metrics
//! let metrics = client.get_metrics().await?;
//! println!("Metrics: {:#?}", metrics);
//!
//! // Run a workflow
//! let mut data = HashMap::new();
//! data.insert("input".to_string(), serde_json::json!("test"));
//! let result = client.run_workflow("my_workflow", None, data).await?;
//! println!("Workflow result: {:#?}", result);
//!
//! Ok(())
//! }
//! ```
pub mod client;
pub mod error;
pub mod models;
pub mod types;
pub use client::UniComfyUIClient;
pub use error::{ComfyUIError, Result};
pub use models::*;
pub use types::*;
/// Re-export commonly used types
pub mod prelude {
pub use crate::client::UniComfyUIClient;
pub use crate::error::{ComfyUIError, Result};
pub use crate::models::*;
pub use crate::types::*;
}