ComfyUI Extension: ComfyUI ASCII Generator Node
ASCII art generator for ComfyUI with multi-language character set support
Custom Nodes (0)
README
ComfyUI ASCII Generator Node
A powerful ComfyUI custom node that converts images to ASCII art with multi-language character set support. Based on the excellent ASCII-generator by vietnh1009.
Features
đ¨ Multi-Language ASCII Art
- English, Chinese, Japanese, Korean, Russian, German character sets
- Simple and complex ASCII character mappings
- Customizable output density and style
đźď¸ Dual Output Format
- ASCII Art Image: Visual representation with customizable background
- ASCII Text: Raw text output for further processing
âď¸ Flexible Parameters
- Adjustable column count (10-500)
- Multiple character sets
- Black/white background options
- Configurable font sizes
đ§ ComfyUI Integration
- Native tensor support
- Batch processing capability
- Error handling and fallbacks
Installation
Method 1: ComfyUI Manager (Recommended)
- Open ComfyUI Manager
- Search for "ASCII Generator"
- Click Install
Method 2: Manual Installation
- Clone this repository to your ComfyUI custom nodes directory:
cd ComfyUI/custom_nodes/
git clone https://github.com/YOUR_USERNAME/comfyui-ascii-generator.git
- Install dependencies:
cd comfyui-ascii-generator
pip install -r requirements.txt
- Restart ComfyUI
Usage
Basic Workflow
- Load Image: Connect any image source to the ASCII Generator node
- Configure Parameters:
num_cols
: Number of ASCII columns (affects detail level)language
: Character set to usebackground
: Black or white backgroundfont_size
: Size of characters in output image
- Generate: The node outputs both an ASCII image and text
Parameters
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| image
| IMAGE | - | Input image to convert |
| num_cols
| INT | 100 | Number of ASCII columns (10-500) |
| language
| COMBO | simple | Character set selection |
| background
| COMBO | black | Background color (black/white) |
| font_size
| INT | 12 | Font size for ASCII image (6-48) |
Character Sets
- simple:
@%#*+=-:.
- Basic ASCII characters - complex: Full ASCII character set with symbols
- english:
AaBbCc...
- English alphabet - chinese: Chinese characters for unique artistic effects
- korean: Korean Hangul characters
- japanese: Japanese Hiragana characters
- russian: Cyrillic alphabet
- german: German alphabet with umlauts
Examples
Simple ASCII Art
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@####################%@@@@@@@@@
@@@@@@@@@@ +@@@@@@@@@
@@@@@@@@@@ +@@@@@@@@@
Complex ASCII Art
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$$$$$$$$$$$$$wU\<l <[rU*$$$$$$$$$$$$
$$$$$$$$$$Z{ :rW$$$$$$$$$
$$$$$$$$n" !_)\nnnnj\[<^ <k$$$$$$$
Gradient Mapping
.....::::-----====++++*****####%%%%%@@@@
.`^,;l!>~+-]}{)|/tjxnvzYUCQOZwpdka*#W8B@
Technical Details
Algorithm
The node uses brightness-based character mapping:
- Image Processing: Converts input to grayscale
- Cell Division: Divides image into character-sized cells
- Brightness Analysis: Calculates average brightness per cell
- Character Mapping: Maps brightness to character density
- Output Generation: Creates both image and text outputs
Character Sorting
Characters are automatically sorted by visual density using PIL font rendering to ensure optimal brightness-to-character mapping.
Compatibility
- ComfyUI: Latest version
- Python: 3.8+
- Dependencies: torch, numpy, Pillow
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Development Setup
git clone https://github.com/YOUR_USERNAME/comfyui-ascii-generator.git
cd comfyui-ascii-generator
pip install -r requirements.txt
python test_ascii_generator.py
Credits
- Original ASCII generation algorithm by vietnh1009
- ComfyUI integration and enhancements
- Generated using the MCP ComfyUI Framework
License
MIT License - see LICENSE file for details.
Changelog
v1.0.0
- Initial release
- Multi-language character set support
- Dual output format (image + text)
- ComfyUI tensor compatibility
- Configurable parameters
Support
If you encounter any issues or have questions:
- Check the Issues page
- Create a new issue with detailed description
- Include your ComfyUI version and error logs
Made with â¤ď¸ for the ComfyUI community