ComfyUI Chat — web chat interface for ComfyUI image generation
100K+
A self-hosted web chat interface for generating images with ComfyUI. Type a prompt, watch progress stream in real time, and see the generated image appear inline in the conversation.
<lora:name:strength> anywhere in a prompt/help, /server, /server-add, /t2i-workflowThe easiest way to run ComfyUI Chat is with the published image on Docker Hub (nerwander/comfy-chatbot).
docker-compose.yml from this repoCOMFY_SERVER to your ComfyUI address and adjust the volume mountsdocker-compose up -d
user / passwordTo build from source instead, replace image: nerwander/comfy-chatbot:latest with build: . (or keep both — Docker Compose uses build when present and falls back to image for docker pull).
All settings are environment variables in docker-compose.yml:
| Variable | Default | Description |
|---|---|---|
COMFY_SERVER | 192.168.1.135:8000 | ComfyUI server address (host:port) |
COMFY_SERVER_OS | unix | Path style sent to server: unix or windows |
COMFY_WORKFLOW | z_image_turbo_api | Default workflow template name |
COMFY_FACEDETAILER_WORKFLOW | (first found) | Default face-detailer workflow (in facedetailer/ subdir) used by /face-detail |
COMFY_WORKFLOW_DIR | /app/workflows | Directory of workflow .json templates |
COMFY_LORAS_FILE | /app/workflows/loras.json | LoRA catalogue |
COMFY_OUTPUT_DIR | /app/output | Where generated images are saved |
APP_USERNAME | user | Login username |
APP_PASSWORD | password | Login password |
SECRET_KEY | (change this) | Flask session secret |
ARCHIVE_VOLUME | (empty) | Host path to the volume for /archive-* |
ARCHIVE_SIZE | 20G | Size of the archive volume created on first archive (zuluCrypt-cli units) |
ARCHIVE_AGENT_SOCKET | /run/archive-agent.sock | Unix socket of the host archive agent |
ARCHIVE_MOUNT_DIR | /app/archive | Where the host mount appears inside the container |
OUTPUT_VOLUME | (empty) | Host path to the live-output volume (blank = plain). Auto-created on first deploy |
OUTPUT_PASSWORD | (empty) | Passphrase for the output volume (falls back to SECRET_KEY, so you can declare one secret) |
OUTPUT_SIZE | 20G | Size of the output volume created on first deploy (zuluCrypt-cli units) |
IDLE_TIMEOUT_SECONDS | 7200 | Log everyone off and close the volumes after this long with no activity and no running job. 0 disables |
The LoRA catalogue controls which chips appear in the chat UI and provides default strengths. Each entry can be a plain filename string or an object with an explicit strength:
{
"loras": [
{ "name": "styles/cinematic.safetensors", "strength": 0.8 },
{ "name": "styles/anime-flat.safetensors", "strength": 0.7 },
{ "name": "characters/hero.safetensors", "strength": 1.0 },
"detail-enhancer.safetensors"
]
}
Plain strings default to strength 1.0. The name value is the path sent to the ComfyUI server — on Windows servers use backslashes (styles\\cinematic.safetensors) or set COMFY_SERVER_OS=windows and let the app convert them automatically.
volumes:
- ~/dot-files/comfyui:/app/workflows:ro # workflow templates + loras.json
- ~/Pictures/ComfyUI:/app/output # generated image output
| Command | Description |
|---|---|
/help | List available commands |
/server | Pick a ComfyUI server from the catalogue |
/server-add <name> <host:port:os> | Add a server (os: unix or windows) |
/t2i-workflow | Pick a workflow template |
/face-detail <prompt> | Run a face-detailer workflow over the last generated image (supports <lora:…> tags) |
/face-detail-workflow | Pick which face-detailer workflow /face-detail uses (from the facedetailer/ subdir) |
/archive-session [name] | Copy this session's images into the archive volume, then delete the originals |
/archive-today [name] | Archive images generated today into the archive volume |
/archive-all [name] | Archive every image in the output folder (asks y/n first) |
Open your workflow in ComfyUI, then in the menu enable "Dev Mode Options" (Settings → Enable Dev Mode Options). A new "Save (API Format)" button will appear. Use this — not the regular Save — to export the file. The regular format includes UI layout data that the chatbot cannot execute directly.
The exported JSON is a static snapshot; you need to replace the values you want the chatbot to substitute at generation time with placeholder tokens. Open the file in a text editor and replace:
| What to replace | Token to use | Notes |
|---|---|---|
| The prompt string | <PROMPT> | Inside the existing quotes in the JSON |
| A LoRA filename | <LORA_1_NAME> | Use <LORA_2_NAME> for a second LoRA, etc. |
| A LoRA strength | <LORA_1_STRENGTH> | Remove the surrounding quotes — this must be a bare number in the JSON |
A LoadImage filename | <INPUT_IMAGE> | For facedetailer/ workflows — filled with the last generated image, which /face-detail uploads to the server |
For example, a KSampler node's prompt input might look like this before and after:
// Before
"text": "a photo of a cat"
// After
"text": "<PROMPT>"
And a LoRA loader node:
// Before
"lora_name": "my-lora.safetensors",
"strength_model": 0.8,
// After
"lora_name": "<LORA_1_NAME>",
"strength_model": <LORA_1_STRENGTH>,
LoRA placeholders are optional — any slots not filled by the user's prompt are automatically removed from the workflow graph before submission.
Content type
Image
Digest
sha256:79b25b0e9…
Size
209.1 MB
Last updated
about 17 hours ago
docker pull nerwander/comfy-chatbot