Skip to content

An image generation bot that uses Comfy's API and Discord's API in a workflow format that focuses on creation over configuration.

License

Notifications You must be signed in to change notification settings

Tenos-ai/tenos-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Tenosai-Bot: ComfyUI API Discord Bot for Flux & SDXL Image Generation

Updates

COMPLETED UPDATES

8/18/25

  • Update 8: Added custom workflow overrides so each Flux/SDXL/Qwen command can run a user-supplied ComfyUI graph without touching the defaults. Introduced ten curated Material palettes plus a configurable custom theme, and exposed Discord bot branding controls (name + avatar) directly in the configurator.

8/12/25

  • Update 7: Rebuilt the configurator around a PySide6 Material shell with live diagnostics, curated Qwen workflow queueing/export, and a hardened updater hand-off so first-run installs no longer loop. Added Qwen Image Edit support to /edit (use --engine qwen or pick "Qwen Image Edit" from the slash command) and expanded settings to cover default edit engine, steps, guidance, and denoise controls.

8/03/25

  • Update 6: Added an in-app shortcut to the official Qwen-Image workflow guide, refreshed the updater to target the current GitHub API version, and bundled a portable HTTP client so first-run environments no longer require installing third-party packages.

7/30/25

  • Update 5: Added native Qwen image workflow support across generation, variation, and upscale flows, refreshed the configurator theme, and hardened the auto-updater with release version checks.

7/29/25

  • Update 4: Version 1.2.4

This update introduces a more organized and powerful configuration experience, adds dedicated settings for Kontext and Qwen Image editing, and refines the user interface.

  • Tabbed Bot Settings in Configurator: The "Bot Settings" tab in the GUI has been reorganized into five distinct sub-tabs for clarity:

    • General: Core model selections, VAE, variation settings, batch sizes, MP size, and upscale factor.
    • Flux: Default style, steps, guidance specifically for Flux generations.
    • SDXL: Default style, steps, guidance, and negative prompt for SDXL generations.
    • Kontext: New dedicated settings for the /edit command, including default steps, guidance, and MP size.
    • LLM: Settings for the prompt enhancer and display preferences. Added support for OpenAI oss models and all other thinking models via Groq. Added support for OpenAI GPT-5.
  • Model-Specific Default Styles: The single default_style setting has been split. You can now set a default_style_flux and a default_style_sdxl independently in the configurator. The bot will automatically apply the correct default style based on the model being used.

  • Advanced MP Size Control: In the configurator, the "Default MP Size" fields are now float values instead of a dropdown, allowing for more precise control over generation resolution (e.g., 1.15). The /settings command in Discord retains the user-friendly dropdown.

  • Variation Batch Size: A new setting for "Variation Batch Size" has been added for future features.

  • UI & Bug Fixes:

    • The variation buttons on generation results have been refined. Single-image results (like variations or reruns) now correctly show distinct Vary W 🀏 and Vary S πŸ’ͺ buttons. Multi-image (batch) results correctly show simplified V1, V2, etc., which dynamically use your current default variation setting.
    • Fixed a bug where the MP value was not displayed correctly in the final completion message.
    • Fixed a visual bug in the configurator where the Bot Settings page would not refresh correctly after being changed via the /settings command in Discord.
    • The file scanner now correctly recognizes completed Kontext jobs (prefixed with EDIT_).

7/6/25

  • Update 3:
    • fixed a few bugs, official V1.2.3 update now has all features working with no bugs, as of today this will be stable release 1. Update tool will pull updates on the next numbered release (1.2.4).

7/4/25

  • Update 2:
    • added auto update feature so the app and repo stay in sync without needing to download the zip over and over as I add features. The automatic update on startup can be turned on and off in main config > app settings. Updates can also be triggered manually via Tools > Update Application.
    • added sub tabs to the LLM prompts so that its easier to manage.

7/2/25

  • Update 1: Integrated FLUX Kontext for powerful instruction-based image editing and stitching via the new /edit command. The LLM Enhancer now supports multi-modal vision to better interpret edit instructions.
  • Hotfix 1: Fixed a job cancellation issue, improved first-time setup with venv creation, enhanced LLM support for new models, and added a tool to pull complete LLM model lists from the GUI.

KNOWN BUGS

  • None(?)

PLANED UPDATES

  • New GUI
  • Metadata on/off toggle for all jobs

image image
image image

First-Time Setup

(IF YOU DO NOT HAVE A DISCORD BOT ACCOUNT ALREADY CREATED, OPEN docs/HOW TO DISCORD BOT.txt AND FOLLOW INSTRUCTIONS)

Make sure you already have ComfyUI installed. If you need ComfyUI still, you can download it HERE.

Portable Windows build (GUI executable)

If running TENOSAI-BOT.bat does not launch the configurator, use the automated Windows installer which provisions dependencies, builds the executable, and launches the Material GUI in one pass:

python scripts/windows/install_and_launch.py

The installer performs these steps:

  1. Creates .venv (if necessary) and installs the Python dependency stack from requirements/.
  2. Invokes the PyInstaller helper to build a portable bundle, copying the required python*.dll and vcruntime140.dll so the executable starts on clean systems.
  3. Drops a shortcut named TenosAIConfigurator.lnk in the repository root that points to dist/TenosAIConfigurator/TenosAIConfigurator.exe.
  4. Launches the freshly built executable.

If you prefer to rebuild manually, the helper can still be invoked directly:

python tools/build_configurator.py --zip

The script generates dist/TenosAIConfigurator/TenosAIConfigurator.exe alongside a ready-to-distribute dist/TenosAIConfigurator-portable.zip archive containing the executable and default configuration files.

Python Dependencies

Install the UI dependency stack before launching the configurator:

pip install PySide6

Download the portable zip from this repository via the "Code" button at the top of the page, or click HERE to download the zip directly. I recommend placing it in your ComfyUI Portable folder, but you can put it anywhere and it should work just fine.

image
  • The bot requires specific custom nodes. You can install them manually by cloning the following GitHub repositories into your ComfyUI/custom_nodes folder, or by using the Configurator's "Install/Update Custom Nodes" tool (under the "Tools" menu):
    1. https://github.com/rgthree/rgthree-comfy.git
    2. https://github.com/ssitu/ComfyUI_UltimateSDUpscale.git
    3. https://github.com/jamesWalker55/comfyui-various.git
    4. https://github.com/city96/ComfyUI-GGUF.git
    5. https://github.com/tsogzark/ComfyUI-load-image-from-url.git
    6. https://github.com/BobsBlazed/Bobs_Latent_Optimizer.git
    7. https://github.com/Tenos-ai/Tenos-Resize-to-1-M-Pixels.git

Before using Tenosai-Bot, you MUST run the configurator (TENOSAI-BOT.bat or by executing python config-editor-script.py) to:

  • Map all necessary file paths (Outputs, Models, CLIPs, LoRAs, Custom Nodes) under the "Main Config" tab.
  • Input your unique Discord bot token into the BOT_API -> KEY field in "Main Config".
  • Input the admin's Discord User ID into the ADMIN -> ID field in "Main Config".
  • Optionally input API Keys for Google Gemini, Groq, and/or OpenAI in the LLM_ENHANCER section of "Main Config" if you plan to use the LLM Prompt Enhancer feature.

This step is crucial for the bot to function correctly. After initial setup, use the "Bot Control" tab in the configurator to start the bot. The bot uses the model selected via /settings or the Configurator as the default for new generations.

Material Configurator Preview

Prefer a Material Design UI? Install PySide6 and launch the configurator:

python -m material_gui.app

The Material interface includes navigation for the overview, Discord enhancer toggles, live diagnostics, an activity log that streams updater output, and a dedicated Qwen workflow gallery for quick queueing or export. Living Material-inspired animations add breathing status indicators and cross-fading navigation to keep the experience lively without sacrificing focus.

OPTIONAL: Download the Tenos Official Flux Dev Finetune from Huggingface HERE

GEN_UP_d2617aa5_from_img3_srcID49b5195c_00001_ GEN_UP_9e781f69_from_img1_srcIDdd942772_00001_
GEN_UP_d1cd670a_from_img1_srcID1f65a8b2_00001_ GEN_UP_eaaae372_from_img1_srcID59bbc663_00001_
GEN_UP_2a4b938f_from_img3_srcID72bdcd57_00001_ GEN_UP_14d8816e_from_img4_srcID2bc0af53_00001_

Commands and Features

1. Image Generation

Commands: /gen or /please Usage: /gen [prompt] [options] or /please [prompt] [options]

Options:

  • --seed [number]: Set a specific seed for reproducibility.
  • --g [number]: Set guidance scale for Flux models (e.g., 3.5). Default in /settings.
  • --g_sdxl [number]: Set guidance scale for SDXL and Qwen Image models (e.g., 7.0). Default in /settings.
  • --model [flux|sdxl|qwen]: Override the saved default workflow for a single run without changing /settings.
  • --engine qwen: When using /edit, switch from Kontext to the Qwen Image Edit workflow on demand (also available as a slash command dropdown).
  • --ar [W:H]: Set aspect ratio (e.g., --ar 16:9). Default is 1:1.
  • --mp [M]: (Flux & SDXL) Set Megapixel target size (e.g., 0.5, 1, 1.75). Default in /settings.
  • --img [strength] [URL]: (Flux Only) Use img2img. Strength S (0-100), URL of input image.
  • --style [style_name]: Apply a predefined LoRA style (see /styles). Default in /settings.
  • --r [N]: Run the prompt N times with different seeds (max 10).
  • --no "[negative_prompt_text]": (SDXL & Qwen) Provide a negative prompt.

Example: /gen a majestic lion --ar 16:9 --seed 1234 --style realistic --g_sdxl 6.5 Example (SDXL with custom negative): /gen cyberpunk city --no "trees, nature, day"

LLM Prompt Enhancer:

  • An admin can enable a prompt enhancer via /settings.
  • If enabled, your initial prompt may be rewritten by the selected LLM (Google Gemini, Groq, or OpenAI) to be more descriptive. This applies to /gen and /edit commands.
  • Generated messages will have a ✨ icon if the enhancer was used successfully.
  • Edit the system prompts used by the enhancer via the Configurator's "LLM Prompts" tab.

2. Image Editing (Kontext & Qwen)

Command: /edit Usage: /edit [instruction] [image1] [image2] [image3] [image4] [options]

Edit with FLUX Kontext (multi-image edits, stitching, MP control) or Qwen Image Edit (single-image diffusion edits with denoise control). Kontext accepts up to four reference images; Qwen currently supports one image per request.

Options:

  • --g [number]: Set guidance scale for the edit (e.g., 3.0 for Kontext, 6.0 for Qwen).
  • --ar [W:H]: Set aspect ratio for the final output canvas (Kontext only).
  • --steps [number]: Set the number of steps for the generation (both engines).
  • --mp [number]: Target megapixels for Kontext edits.
  • --denoise [0-1]: Control the strength of Qwen edits (default in /settings).
  • --engine [kontext|qwen]: Override the default edit engine saved in /settings.

Example (Kontext): /edit instruction:make the cat wear a wizard hat image1:<upload_cat_image> Example (Qwen): /edit instruction:add neon city lights image1:<upload_cat_image> --denoise 0.55 --engine qwen Example (Kontext multi-image): /edit instruction:blend these two styles image1:<upload_style1_image> image2:<upload_style2_image> --ar 16:9

3. Image Upscaling

Command: Reply with --up or click the Upscale ⬆️ button. Usage: Reply to a generated image with --up [options] or click the button.

Options (for reply command):

  • --seed [number]: Set a specific seed for the upscale.
  • --style [style_name]: Apply a different style during the upscale process.

Example (replying to an image): --up --seed 5678 --style detailed

4. Image Variation

Command: Reply with --vary [type] or click the Vary W 🀏 / Vary S πŸ’ͺ buttons. Usage: Reply to a generated image with --vary [type] [options] or click the button.

Types:

  • w: Weak variation (subtle changes, lower denoise)
  • s: Strong variation (significant changes, higher denoise)

Options (for reply command):

  • --prompt "[new_prompt]": If Remix Mode is ON (via /settings), use this new prompt for the variation.
  • --no "[negative_prompt_text]": (SDXL & Qwen) Sets/replaces the negative prompt for this variation.
  • --style [style_name]: Apply a different style to the variation.

Remix Mode:

  • If "Variation Remix Mode" is ON (via /settings), clicking a Vary button (🀏/πŸ’ͺ) will open a modal to edit the prompt before generating.

5. Rerunning & Editing

  • Rerun πŸ”„: Reruns the original generation prompt and parameters with a new seed.
  • Edit ✏️: Opens a modal to perform a new edit on the selected image(s). Kontext supports up to four references; add --engine qwen if you prefer the Qwen Image Edit workflow.

6. Utility Commands

  • /styles: View available style presets via DM.
  • /ping: Check bot latency.
  • /help: Show this help information.

7. Deleting & Managing Jobs

  • Delete πŸ—‘οΈ / Reply --delete: (Admin/Owner only) Deletes generated image file(s) AND the Discord message.
  • React with πŸ—‘οΈ: (Admin/Owner only) Same as the Delete button.
  • Reply --remove: (Admin/Owner only) Removes the Discord message only (files remain).
  • Cancel ⏸️: (Admin/Owner of job only) Appears on queued messages to cancel the job in ComfyUI.
  • --show (Reply): (Admin only) Get a DM with the full prompt string used for a generation.

8. Admin Commands

  • /settings: Configure default models (Flux, SDXL, Kontext), CLIPs, generation parameters, LLM enhancer, and more.
  • /sheet [src]: Queue prompts from a TSV file (URL or Discord Message ID/Link).
  • /clear: Clear the ComfyUI processing queue.
  • /models: List models available to ComfyUI via DM.

9. Configuration and Management (Configurator Tool)

The Configurator Tool (TENOSAI-BOT.bat or python config-editor-script.py) allows admins to:

  • Main Config: Update all critical paths, Bot Token, Admin ID, and LLM API Keys.
  • Bot Settings: Set global defaults for all generation parameters (mirrors /settings).
  • LoRA Styles: Create, edit, and favorite LoRA style presets.
  • Favorites: Mark favorite Models, CLIPs, and Styles for easier selection in menus.
  • LLM Prompts: Edit the powerful system prompts used by the LLM Enhancer.
  • Bot Control: Start/Stop the bot script and view its live log output.
  • Tools Menu: Install/Update Custom Nodes, Scan for new models/checkpoints/CLIPs, and refresh the LLM models list.

Important Notes:

  • Changes made in the Configurator (especially paths and API keys) require restarting the bot script to take effect (use the "Bot Control" tab).
  • The bot distinguishes between Flux and SDXL workflows based on the model selected in /settings. Ensure your selected model has the correct prefix (e.g., "Flux: model.gguf" or "SDXL: checkpoint.safetensors").

Enjoy creating! ❀️ BobsBlazed @Tenos.ai

About

An image generation bot that uses Comfy's API and Discord's API in a workflow format that focuses on creation over configuration.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published