Files
2026-01-25 09:54:53 -08:00

3.4 KiB

Quick Start Guide

For Kubernetes/Helm Users

1. Apply ConfigMap

kubectl apply -f kubernetes/configmap.yaml

2. Add to Your Helm Chart

Add these sections to your values.yaml:

initContainers:
  - name: install-mqtt-node
    image: busybox:latest
    command: [sh, -c, "mkdir -p /comfyui/custom_nodes/comfyui-mqtt-node && cp -v /mqtt-node-source/* /comfyui/custom_nodes/comfyui-mqtt-node/"]
    volumeMounts:
      - {name: mqtt-node-config, mountPath: /mqtt-node-source}
      - {name: custom-nodes, mountPath: /comfyui/custom_nodes}

  - name: install-mqtt-dependencies
    image: YOUR-COMFYUI-IMAGE:TAG  # ⚠️ MUST match your main container
    command: [sh, -c, "pip install --no-cache-dir paho-mqtt>=1.6.1"]
    volumeMounts:
      - {name: custom-nodes, mountPath: /comfyui/custom_nodes}

volumes:
  - name: mqtt-node-config
    configMap: {name: comfyui-mqtt-node}
  - name: custom-nodes
    emptyDir: {}

volumeMounts:  # Add to main container
  - name: custom-nodes
    mountPath: /app/custom_nodes  # ⚠️ Adjust to your ComfyUI path

3. Deploy

helm upgrade comfyui ./your-chart -f values.yaml

4. Verify

POD=$(kubectl get pod -l app=comfyui -o jsonpath='{.items[0].metadata.name}')
kubectl logs $POD -c install-mqtt-node
kubectl logs $POD | grep -i mqtt

For Local/Docker Users

1. Copy to ComfyUI

cp -r /home/jeff/comfyui-mqtt-node /path/to/ComfyUI/custom_nodes/

2. Install Dependencies

cd /path/to/ComfyUI
pip install -r custom_nodes/comfyui-mqtt-node/requirements.txt

3. Restart ComfyUI

Using the Node

  1. Add Node: Right-click → Add Node → image → mqtt → "MQTT Publish Image"

  2. Configure:

    • broker_url: Your MQTT broker address
    • broker_port: 1883 (standard) or 8883 (TLS)
    • topic: Your topic (e.g., "comfyui/renders")
    • use_tls: Enable for encrypted connections
    • username/password: If your broker requires auth
  3. Run your workflow!

Testing with Local Mosquitto

# Terminal 1: Start broker
mosquitto -v

# Terminal 2: Subscribe to see messages
mosquitto_sub -h localhost -t "comfyui/#" -v

# Terminal 3: Run ComfyUI with MQTT node
# You should see messages in Terminal 2 when workflow runs

Common Issues

Node doesn't appear in ComfyUI:

  • Check logs for Python errors
  • Verify files are in custom_nodes/comfyui-mqtt-node/
  • Ensure paho-mqtt is installed

Connection refused:

  • Verify broker is running: netstat -an | grep 1883
  • Check broker_url and broker_port

TLS errors:

  • Verify broker has valid certificates
  • Check broker is configured for TLS

Files Overview

  • __init__.py - Package initialization
  • mqtt_node.py - Main node implementation (two nodes)
  • requirements.txt - Python dependencies
  • README.md - Full documentation
  • DECISIONS.md - Technical decisions and architecture
  • KUBERNETES_INSTALL.md - Detailed K8s guide
  • kubernetes/ - K8s configuration files

Next Steps

Support

Check console output for error messages. The node prints status:

  • ✓ Success: "Published to broker:port/topic"
  • ✗ Error: "MQTT Error: [details]"