Skip to content

th0usandw1nd/ComfyUI-Discord-helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ComfyUI - Discord小助手

一個簡單的Discord bot,讓用戶能在文字頻道中用指令控制ComfyUI。

有關ComfyUI的安裝與依賴請參閱此處

展示

pic

pic

Bot Setup

詳細資訊請參閱Discord Developer Portal: Intro | Documentation,此處只簡單列舉設置bot的步驟。

1. 建立 Discord 應用程式

  • 前往 Discord Developer Portal,點擊 "New Application"
  • 輸入應用程式名稱,點擊 "Create"

2. 建立 Bot 使用者

  • 在左側選單中,點擊 "Bot",選擇 "Add Bot"
    • 建議將public bot設為關閉

3. 設定 Bot 權限:

  • 在"Privileged Gateway Intents",找到並勾選:
    • MESSAGE CONTENT INTENT

4. 取得 Bot Token:

  • 在 Bot 設定頁面中,找到 "TOKEN" 區塊,點擊 "Reset Token" 按鈕
    • ! 不要隨意洩漏自己的TOKEN !!

5. 邀請 Bot 到伺服器:

  • 前往 OAuth2 設定頁面,點擊 "URL Generator"

  • 在 "SCOPES" 區塊中,勾選以下選項:

    • bot(必須)
    • applications.commands(必須,用於 Slash Commands)
  • 在 "BOT PERMISSIONS" 區塊中,勾選以下選項:

    • Send Messages(傳送訊息)
    • Attach Files(附加檔案)
    • Embed Links(嵌入連結)
    • Read Message History(讀取訊息歷史)
  • 複製頁面底部自動生成的 "GENERATED URL"

安裝步驟

1. 克隆此專案

git clone https://github.com/th0usandw1nd/ComfyUI-Discord-helper cd ComfyUI-Discord-helper

2. 安裝依賴

uv sync

3. 設定環境變數:

4. 準備 ComfyUI workflow:

  • 預設checkpoint使用Illustrious-XL v0.1,請根據你的需求自行修改
  • 將你的 workflow 儲存為 default_workflow.json
  • 確保 workflow 中包含以下節點:
    • Positive Prompt Loader
    • Negative Prompt Loader
    • empty latent

pic

5. 執行 Bot

uv run bot

Discord 指令

  • /txt2img [count] [size] - 文生圖

    • 從設定的提示詞生成圖片。
    • count:生成數量 (預設: 1, 上限: 4)。
    • size:可選 vertical (預設)、squarehorizontal
  • /img2img <image> [denoise] [count] [size] - 圖生圖

    • 根據上傳的圖片進行重繪。
    • image:必須上傳一張圖片。
    • denoise:去噪強度 (0.1-1.0),越高與原圖差異越大 (預設: 0.75)。
  • /editprompts - 編輯提示詞

    • 彈出一個視窗,可修改正向與負向提示詞並儲存。
  • /checkprompts - 查看提示詞

    • 顯示目前設定的提示詞。
  • /queue - 查看佇列

    • 顯示目前的生成佇列狀態以及用戶所在的位置。
  • /cancel - 取消請求

    • 從佇列中移除用戶所有等待中的請求。
  • /help - 顯示幫助訊息

    • 顯示此份完整的指令說明。

About

一個簡單的Discord bot,讓用戶能在文字頻道中用指令控制ComfyUI。

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages