Sign inSign up

nerwander/comfy-chatbot

By nerwander

•Updated about 17 hours ago

ComfyUI Chat — web chat interface for ComfyUI image generation

Image
0

100K+

nerwander/comfy-chatbot repository overview

⁠ComfyUI Chat

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.

⁠Screenshot

image

⁠Features

  • Chat UI — prompt history (↑/↓), LoRA chip shortcuts, lightbox image viewer
  • LoRA tags — include <lora:name:strength> anywhere in a prompt
  • Live progress — Server-Sent Events stream status updates while ComfyUI runs
  • Slash commands — /help, /server, /server-add, /t2i-workflow
  • Multi-server — switch between ComfyUI instances at runtime; supports both Unix and Windows path conventions
  • Persistent output — generated images saved to a configurable host directory

⁠Quick Start

The easiest way to run ComfyUI Chat is with the published image on Docker Hub (nerwander/comfy-chatbot⁠).

  1. Download docker-compose.yml⁠ from this repo
  2. Edit it — set COMFY_SERVER to your ComfyUI address and adjust the volume mounts
  3. Run it
docker-compose up -d
  1. Open http://localhost:5000⁠ — default login: user / password

To 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).

⁠Configuration

All settings are environment variables in docker-compose.yml:

VariableDefaultDescription
COMFY_SERVER192.168.1.135:8000ComfyUI server address (host:port)
COMFY_SERVER_OSunixPath style sent to server: unix or windows
COMFY_WORKFLOWz_image_turbo_apiDefault workflow template name
COMFY_FACEDETAILER_WORKFLOW(first found)Default face-detailer workflow (in facedetailer/ subdir) used by /face-detail
COMFY_WORKFLOW_DIR/app/workflowsDirectory of workflow .json templates
COMFY_LORAS_FILE/app/workflows/loras.jsonLoRA catalogue
COMFY_OUTPUT_DIR/app/outputWhere generated images are saved
APP_USERNAMEuserLogin username
APP_PASSWORDpasswordLogin password
SECRET_KEY(change this)Flask session secret
ARCHIVE_VOLUME(empty)Host path to the volume for /archive-*
ARCHIVE_SIZE20GSize of the archive volume created on first archive (zuluCrypt-cli units)
ARCHIVE_AGENT_SOCKET/run/archive-agent.sockUnix socket of the host archive agent
ARCHIVE_MOUNT_DIR/app/archiveWhere 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_SIZE20GSize of the output volume created on first deploy (zuluCrypt-cli units)
IDLE_TIMEOUT_SECONDS7200Log everyone off and close the volumes after this long with no activity and no running job. 0 disables
⁠loras.json

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.

⁠Volume mounts (docker-compose.yml)
volumes:
  - ~/dot-files/comfyui:/app/workflows:ro   # workflow templates + loras.json
  - ~/Pictures/ComfyUI:/app/output           # generated image output

⁠Slash Commands

CommandDescription
/helpList available commands
/serverPick a ComfyUI server from the catalogue
/server-add <name> <host:port:os>Add a server (os: unix or windows)
/t2i-workflowPick a workflow template
/face-detail <prompt>Run a face-detailer workflow over the last generated image (supports <lora:…> tags)
/face-detail-workflowPick 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)

⁠Adding Workflows

⁠1. Export from ComfyUI as API format

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.

⁠2. Add placeholder tokens

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 replaceToken to useNotes
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.

Tag summary

Content type

Image

Digest

sha256:79b25b0e9…

Size

209.1 MB

Last updated

about 17 hours ago

docker pull nerwander/comfy-chatbot