Installation Guide
This guide will walk you through installing Discomfort and setting up your environment for programmatic ComfyUI workflow execution.
Prerequisites
Before installing Discomfort, ensure you have:
Required Software
- Python 3.8+ (Python 3.9+ recommended)
- ComfyUI installed and working
- Git for cloning the repository
System Requirements
- RAM: 8GB minimum, 16GB+ recommended
- GPU: CUDA-compatible GPU recommended for ComfyUI
- Disk Space: 2GB for dependencies and temporary files
Step 1: Install Discomfort
Method 1: Clone into ComfyUI (Recommended)
- Navigate to your ComfyUI custom nodes directory:
cd ComfyUI/custom_nodes
- Clone the Discomfort repository:
git clone https://github.com/Distillery-Dev/Discomfort.git discomfort
- Install Python dependencies:
cd discomfort
pip install -r requirements.txt
Method 2: Manual Installation
- Download the repository as a ZIP file
- Extract to
ComfyUI/custom_nodes/discomfort/
- Install dependencies as shown above
Step 2: Verify Installation
Restart ComfyUI completely (close and reopen)
Check for Discomfort nodes in the ComfyUI interface:
- Look for
discomfort/utilities
category - You should see
Discomfort Port (Input/Output)
node - You should see
Discomfort Test Runner
node
- Look for
Dependencies Explained
Discomfort requires several Python packages for full functionality:
Core Dependencies
requests
- HTTP communication with ComfyUI APIpillow
- Image processing and manipulationnetworkx
- Graph analysis for workflow topologycloudpickle
- Advanced serialization for complex objects
Advanced Features
playwright
- Browser automation for workflow conversionwebsocket-client
- Real-time communication with ComfyUIpsutil
- System resource monitoringbackoff
- Retry logic for robust operations
Optional Dependencies
filelock
- Thread-safe file operationsnumpy
- Numerical operations
Configuration
Discomfort comes with sensible defaults but can be customized:
Memory Configuration
Edit workflow_context.json
:
{
"MAX_RAM_PERCENT": 50, // Use 50% of free system RAM
"MAX_RAM_GB": 32, // Or limit to 32GB
"CONTEXTS_DIR_NAME": "contexts"
}
Server Configuration
Edit comfy_serverless.json
:
{
"API_COMMAND_LINE": "python3 main.py",
"API_WORKING_DIRECTORY": "./",
"API_URL": "127.0.0.1",
"INITIAL_PORT": 8188,
"MAX_COMFY_START_ATTEMPTS": 10,
"COMFY_START_ATTEMPTS_SLEEP": 1.0,
"COMFYUI_PATH": "./"
}
Data Type Handling
You can edit pass_by_rules.json
to customize how different data types are handled. The presets are as follows:
{
"MODEL": "ref", // Models passed by reference (workflow graphs)
"CLIP": "ref", // CLIP models passed by reference
"VAE": "ref", // VAE models passed by reference
"CONDITIONING": "ref", // Conditioning passed by reference
"LATENT": "val", // Latents passed by value (direct storage)
"IMAGE": "val", // Images passed by value
"MASK": "val", // Masks passed by value
"CONTROL_NET": "ref", // ControlNet models passed by reference
"STRING": "val", // Text passed by value
"INT": "val", // Numbers passed by value
"FLOAT": "val", // Decimals passed by value
"BOOLEAN": "val", // Booleans passed by value
"TUPLE": "val", // Tuples passed by value
"LIST": "val", // Lists passed by value
"DICT": "val", // Dictionaries passed by value
"ANY": "val" // "ANY" type passed by value
}
Troubleshooting
Common Issues
❌ "ModuleNotFoundError: No module named 'discomfort'"
Solution: Ensure the folder is named exactly discomfort
and is in ComfyUI/custom_nodes/
❌ "playwright._impl._api_types.Error: Executable doesn't exist"
Solution: Try installing Playwright browser directly:
python -m playwright install --with-deps chromium
❌ "Permission denied" errors on Linux/Mac
Solution: Fix permissions:
chmod +x ComfyUI/custom_nodes/discomfort/
❌ Memory errors during large workflows
Solution: Try increasing RAM or switching to disk memory. If this doesn't work, it's likely the issue is at the OS level. If you're on Linux, the OS may be capping your allocated memory for temp files; run df -H
to confirm if that's the case and increase the size of /dev/shm
accordingly.
❌ ComfyUI doesn't start automatically
Solution: Check comfy_serverless.json
paths:
- Ensure
API_WORKING_DIRECTORY
points to your ComfyUI folder - Verify
API_COMMAND_LINE
matches your Python setup
Getting Help
If you encounter issues:
- Check the logs - Discomfort provides detailed logging
- Verify ComfyUI works - Test ComfyUI independently first
- Update dependencies - Run
pip install -r requirements.txt --upgrade
- Check system resources - Ensure adequate RAM and disk space
Next Steps
Now that Discomfort is installed:
- Watch Tutorial videos - Basic tutorial
- Create your first workflow - Master the basics before advanced techniques
- Learn core concepts - Understand DiscomfortPorts
- Explore examples - See real-world usage patterns
- Read the API reference - Detailed method documentation