You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
6.6 KiB
6.6 KiB
ComfyUI Launcher
A modern GTK4 launcher for ComfyUI with full conda environment support.
Features
- 🚀 Conda Environment Management: Easy selection of available conda environments
- 🔧 Automatic Installation: Install ComfyUI and comfy-cli with one click
- 📊 Real-time Monitoring: Continuously monitors if ComfyUI is running
- 🎮 Intuitive Controls: Start and stop ComfyUI easily
- 📝 Real-time Logs: View ComfyUI output directly in the launcher
- 🎨 Modern Interface: Built with GTK4 and libadwaita
Prerequisites
- Python 3.9 or higher
- conda or miniconda installed
- GTK4 and libadwaita
- Development libraries (cairo-devel, gobject-introspection-devel, etc.)
System Dependencies Installation
Fedora/RHEL/CentOS/Rocky Linux
# Install system dependencies
sudo dnf install cairo-devel gobject-introspection-devel gtk4-devel pkg-config python3-devel
# Install conda if not already installed
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
Debian/Ubuntu
# Update package list
sudo apt update
# Install system dependencies
sudo apt install libcairo2-dev libgirepository1.0-dev libgtk-4-dev pkg-config python3-dev python3-venv
# Install conda if not already installed
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
Installation
- Clone the repository:
git clone <repository-url>
cd gtk-app
- Create and activate virtual environment:
python3 -m venv .venv
source .venv/bin/activate
- Install Python dependencies:
pip install -r requirements.txt
Usage
Quick Start
- Launch the application:
python main.py
or use the provided script:
./run.sh
-
Select a conda environment from the dropdown list
-
Install ComfyUI (if not already installed) by clicking "Install ComfyUI"
-
Start ComfyUI by clicking "Start ComfyUI"
-
The launcher will automatically monitor ComfyUI status
Detailed Workflow
-
Environment Selection
- The launcher automatically detects all available conda environments
- Select your preferred environment from the dropdown
- Click "Refresh Environment List" to reload environments
-
ComfyUI Installation
- If ComfyUI is not installed in the selected environment, click "Install ComfyUI"
- This will install both
comfy-cliand ComfyUI automatically - Installation progress is shown in the log window
-
Running ComfyUI
- Click "Start ComfyUI" to launch ComfyUI in the selected environment
- Real-time output appears in the log window
- The status indicator shows when ComfyUI is running
-
Monitoring
- The launcher checks every 3 seconds if ComfyUI is running
- Status is indicated by both text and visual indicators
- Automatic detection works even if ComfyUI was started outside the launcher
Features Detail
Environment Management
- Automatic detection of all conda environments
- Support for conda base environment
- Refresh button to reload environment list
- Clear indication of selected environment
Status Monitoring
- Checks every 3 seconds if ComfyUI is running
- Visual status indicator (icon and color)
- Detection via port 8188 and active processes
- Works even with externally started ComfyUI instances
Controls
- Start ComfyUI: Launch ComfyUI in selected environment
- Stop ComfyUI: Gracefully terminate ComfyUI process
- Install ComfyUI: Install comfy-cli and ComfyUI in environment
- Refresh Environments: Reload conda environment list
Logging
- Real-time output from ComfyUI
- Timestamp for each message
- Monospace font for better readability
- Automatic scrolling to latest messages
File Structure
gtk-app/
├── main.py # Main application
├── requirements.txt # Python dependencies
├── style.css # Custom styles (optional)
├── comfyui-launcher.desktop # Desktop integration file
├── run.sh # Launch script
├── README.md # This file
├── .gitignore # Git ignore rules
└── .venv/ # Virtual environment (created after setup)
Troubleshooting
Conda not found
Make sure conda is in your PATH:
export PATH="$HOME/miniconda3/bin:$PATH"
# Add to ~/.bashrc or ~/.zshrc for persistence
echo 'export PATH="$HOME/miniconda3/bin:$PATH"' >> ~/.bashrc
Permission errors
Make the script executable:
chmod +x main.py
chmod +x run.sh
ComfyUI won't start
- Verify the conda environment has Python 3.9+
- Check that comfy-cli is properly installed
- Review logs for specific error messages
- Ensure sufficient disk space and memory
GTK/PyGObject errors
Make sure all system dependencies are installed:
# Fedora/RHEL
sudo dnf install gtk4-devel python3-gobject
# Debian/Ubuntu
sudo apt install libgtk-4-dev python3-gi
Missing fonts
The launcher uses monospace fonts for logs. If fonts appear wrong:
# Install additional fonts (optional)
sudo dnf install jetbrains-mono-fonts # Fedora
sudo apt install fonts-jetbrains-mono # Ubuntu
Development
Setting up development environment
- Fork the repository
- Clone your fork
- Install development dependencies:
pip install -r requirements.txt
- Make your changes
- Test thoroughly
- Submit a pull request
Code Style
- Follow PEP 8 for Python code
- Use meaningful variable names
- Add comments for complex logic
- Keep functions focused and small
Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Update documentation
- Submit a pull request
License
MIT License - see the LICENSE file for details.
Acknowledgments
- ComfyUI - The amazing stable diffusion GUI
- comfy-cli - Command line tool for ComfyUI
- GTK - The GUI toolkit
- PyGObject - Python bindings for GTK
Support
If you encounter issues:
- Check the troubleshooting section above
- Search existing GitHub issues
- Create a new issue with:
- Your operating system and version
- Python version
- Complete error messages
- Steps to reproduce the problem