ComfyUI Line Boil
A ComfyUI custom node pack that applies a subtle line boil effect to images and videos.
ComfyUI Line Boil Custom Node
This custom node applies a "line boil" effect to images or videos, targeting only pixels close to black (line art). It provides a subtle, hand-drawn look by slightly warping and shifting the detected lines over time.
🎨 Features
- Line Art Detection: Specifically targets near-black pixels, leaving fills and background untouched.
- Two Node Variants:
- Line Boil (Image): Processes standard ComfyUI image batches (tensors).
- Line Boil (Video): Processes a video file path directly, outputting a new video file with a custom suffix.
- Frame-Level Parallelism: Uses
ProcessPoolExecutorto process multiple frames in parallel. - GPU Acceleration: Optional
cv2.cudasupport for heavy image operations (mask warp, blur, morphology). - Temporal Stability: Configurable
holdparameter to reuse the same boil pattern for consecutive frames. - Deterministic Output: Uses a random seed for reproducible results.
- Progress Tracking: Integrated ComfyUI progress bar for long batches or videos.
⚙️ Parameters
| Parameter | Description | Default | Type |
|-----------|-------------|---------|------|
| enabled | Toggle the effect on/off | True | Boolean |
| black_threshold | Maximum per-channel distance from #000000 to count as line art | 45 | Integer (0-255) |
| expand | Expand the detected line mask to catch antialiasing | 1 | Integer (0-10) |
| warp_strength | Subtle displacement amount in pixels | 0.8 | Float (0.1-5.0) |
| warp_scale | Noise scale for displacement | 28.0 | Float (1.0-100.0) |
| shift | Maximum random X/Y pixel shift | 1 | Integer (0-10) |
| alpha_jitter | Small per-frame strength jitter | 0.06 | Float (0.0-1.0) |
| hold | Reuse the same boil pattern for N consecutive frames | 2 | Integer (1-100) |
| seed | Random seed for the effect | 0 | Integer |
| workers | Number of parallel processes to use | 4 | Integer (1-32) |
| use_gpu | Toggle OpenCV CUDA acceleration | False | Boolean |
📋 Requirements
Core Dependencies
opencv-python>=4.5.0numpy>=1.20.0torch>=1.0.0(included with ComfyUI)
Optional Dependencies
opencv-contrib-python>=4.5.0for CUDA supportopencv-python-headless>=4.5.0for headless environments
🚀 Installation
Method 1: Git Clone (Recommended)
cd ComfyUI/custom_nodes/
git clone https://github.com/scofano/comfy-line-boil.git
Method 2: Manual Installation
- Download the latest release from GitHub
- Extract the contents to
ComfyUI/custom_nodes/comfy-line-boil/ - Restart ComfyUI
Method 3: Using ComfyUI Manager
If you have ComfyUI Manager installed, you can add this repository URL:
https://github.com/scofano/comfy-line-boil.git
📖 Usage
Image Processing
- Load your image into ComfyUI
- Add the "Line Boil (Image)" node to your workflow
- Connect your image to the input
- Adjust parameters to achieve desired effect
- Connect output to your next node or save image
Video Processing
- Add the "Line Boil (Video)" node to your workflow
- Provide the path to your video file
- Set output suffix (e.g., "_boiled")
- Configure processing parameters
- Run the node to generate processed video
🎯 Tips & Best Practices
For Optimal Results
- Start with defaults: Begin with default parameters and adjust gradually
- Black threshold tuning: Lower values for cleaner line art, higher for more inclusive detection
- Warp strength: Keep below 2.0 for subtle effects, higher for dramatic animation
- Hold parameter: Use higher values (10-50) for smoother, more stable animation
Performance Optimization
- Enable GPU: Set
use_gpu=Trueif you have CUDA-compatible hardware - Worker count: Match to your CPU core count for optimal parallel processing
- Hold frames: Higher hold values reduce processing time while maintaining quality
Creative Applications
- Animation enhancement: Add subtle movement to static line art
- Video processing: Apply to entire video sequences for hand-drawn effects
- Batch processing: Process multiple images with consistent parameters
🔧 Troubleshooting
Common Issues
CUDA Not Available
Error: OpenCV CUDA not available
- Install
opencv-contrib-pythoninstead ofopencv-python - Ensure CUDA drivers are properly installed
- Set
use_gpu=Falseto disable GPU acceleration
Memory Issues with Large Videos
MemoryError: Unable to allocate memory
- Reduce
workersparameter - Process shorter video segments
- Close other applications to free memory
No Effect Visible
Line boil effect not applied
- Check
enabledparameter is set toTrue - Verify
black_thresholdis appropriate for your image - Ensure input contains sufficient line art
Getting Help
- Check the Issues section
- Review Discussions for community tips
- Create a new issue with detailed error information
🤝 Contributing
We welcome contributions! Please see our Contributing Guide for details.
Development Setup
# Clone the repository
git clone https://github.com/scofano/comfy-line-boil.git
cd comfy-line-boil
# Install development dependencies
pip install -r requirements-dev.txt
# Run tests
python -m pytest tests/
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- ComfyUI for the excellent workflow system
- OpenCV for powerful image processing capabilities
- The ComfyUI community for inspiration and support
📞 Contact
For questions, suggestions, or feedback:
- Create an Issue
- Join our Discussions
- Visit the ComfyUI Discord
Made with ❤️ for the ComfyUI community