Skip to content

xcjs/musebot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2,317 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Musebot

Musebot Logo

Musebot is a self-hosted Discord bot that bridges generative AI systems into Discord. It connects to Ollama for LLM-powered conversation and ComfyUI/SwarmUI for media generation (images, video, audio, music) — all running on your own hardware, no external APIs required.

Features

  • Chat Mode — Context-aware LLM conversations via Ollama, with streaming support, multi-model selection, and custom system prompts
  • Media Mode — Generate images, video, audio, and music from text or image prompts via ComfyUI/SwarmUI workflows
  • Multi-Instance — Run multiple bot instances (chat, media, or both) from a single configuration file
  • Interactive Controls — Discord buttons for retry, randomize, expand prompt, and guidance scale adjustments on generated media
  • Extensible Workflows — Customize and swap ComfyUI workflow JSON files at runtime without code changes
  • Task Queue — Configurable serial or parallel execution with automatic retries and load balancing across multiple hosts

Prerequisites

  • Node.js 24+ (for development) or a pre-built binary (for production)
  • For Chat Mode: Ollama with at least one model downloaded (e.g., ollama pull mistral-nemo)
  • For Media Mode: ComfyUI or SwarmUI with a ComfyUI backend

Quick Start

Download & Install

  1. Download the latest Musebot release.
  2. Extract the files into a new directory.
  3. Copy config.example.jsonc to config.jsonc and edit it (see Configuration below).

Running

Linux:

chmod +x musebot-linux-x86_64
./musebot-linux-x86_64

Windows:

Double-click musebot-win-x86_64.exe or run it from a terminal.

Docker:

docker compose up -d

See Docker below for details.

Development

npm install
npm start

A debugging configuration is provided for Visual Studio Code.

Configuration

Musebot is configured via config.jsonc (JSON with comments). Copy config.example.jsonc to get started — it contains every option with inline documentation.

Minimal Chat Bot

{
  "bots": [
    {
      "botId": "chat-bot",
      "mode": "chat",
      "chatApis": {
        "discord": {
          "token": "YOUR_DISCORD_BOT_TOKEN"
        }
      },
      "ollama": {
        "hosts": ["http://localhost:11434"],
        "models": ["mistral-nemo"]
      }
    }
  ]
}

Minimal Media Bot

{
  "bots": [
    {
      "botId": "media-bot",
      "mode": "media",
      "chatApis": {
        "discord": {
          "token": "YOUR_DISCORD_BOT_TOKEN"
        }
      },
      "comfyUi": {
        "hosts": ["http://localhost:8188"]
      }
    }
  ]
}

Key Settings

Setting Description
mode "chat" for LLM conversation, "media" for media generation
chatApis.discord.token Bot token from the Discord Developer Portal
chatApis.discord.channels Allowed channel IDs (empty = all channels)
ollama.hosts Ollama API URLs (required for chat mode)
ollama.models LLM model names to use
ollama.systemPrompt Custom system prompt (string or string array)
comfyUi.hosts ComfyUI/SwarmUI API URLs (required for media mode)
requiresMention Require @mention to respond (default: true)
taskQueue.strategy "serial" or "parallel" execution (default: "serial")

For the full configuration reference, see config.example.jsonc or the Configuration docs.

Docker

The included docker-compose.yml mounts your configuration and workflows:

services:
  musebot:
    container_name: musebot
    build: .
    restart: unless-stopped
    volumes:
      - ./config.jsonc:/app/config.jsonc
      - ./workflows:/app/workflows

For production deployment with multiple bot instances, see docker-compose.prod.yml.

Workflows

ComfyUI workflow JSON files live under the workflows/ directory and are organized by generation type (txt2img/, img2img/, txt2vid/, etc.). These can be customized or replaced at runtime without code changes — just drop in new workflow JSON files and restart.

Documentation

Full end-user documentation is available online at musebot.docs.xcjs.com or in the docs directory, including:

License

AGPL-3.0 — see LICENSE.

About

A Discord bot that integrates with ComfyUI and Ollama

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages