- Updated stablediffusion crate path from "../stable-diffusion-burn" to "./crates/stable-diffusion-burn" for proper workspace resolution - Enhanced .gitignore to include generated model files (.mpk, .pt, .bin, .safetensors, .ckpt) and user_data directory - Added Cargo.lock to gitignore with appropriate comment - Reorganized IDE files section in gitignore for better clarity - Added newline at end of file for proper formatting
ComfyUI with Burn Integration
This project demonstrates the integration of stable-diffusion-burn with the comfyui-rs framework to enable image generation capabilities using Burn tensor operations with GPU acceleration.
Features
- CLI interface for image generation using stable-diffusion-burn
- Integration with Burn tensor operations
- Support for different backends (CPU, GPU)
- Workflow execution with Burn tensor operations
Requirements
- Rust 1.70+
- Cargo
Building
For CPU/GPU (default)
# Build debug version
cargo build
# Build release version
cargo build --release
For Vulkan GPU Acceleration (requires Vulkan drivers)
# Enable wgpu-backend feature to use Vulkan
cargo build --features wgpu-backend
Usage
Show model info
./target/debug/comfyui-cli info --model-path /path/to/SDv1-4.mpk
Generate image
./target/debug/comfyui-cli generate \
--model-path /path/to/SDv1-4.mpk \
--prompt "a beautiful sunset" \
--output ./output.png \
--steps 20 \
--device cpu
Integration Details
This implementation demonstrates how to integrate with stable-diffusion-burn:
- Model Loading: Uses the stable-diffusion-burn framework to load model files
- Device Management: Supports different backends (CPU, GPU, etc.) via Burn
- Tensor Operations: Implements actual Burn tensor operations for image generation
- Workflow Execution: Executes workflows using Burn tensor operations
PyTorch Dependency Note
Important: When using the wgpu-backend feature for Vulkan GPU acceleration, PyTorch is NOT required. The integration uses:
burn-wgpufor Vulkan acceleration (no PyTorch needed)burn-tchonly when using CPU/CUDA/MPS backends (requires PyTorch)
The default build works without PyTorch dependencies, and the wgpu-backend feature enables Vulkan support without requiring PyTorch.
Future Work
- Implement actual stable-diffusion-burn integration
- Add proper image saving functionality
- Add more comprehensive CLI commands and options
- Optimize memory usage for large models
- Add configuration options for different parameters
Description
Languages
Rust
98.8%
Python
1.2%