/Marusya-bot-for-auto1111

A neat Discord bot for AUTOMATIC1111's Web UI

Primary LanguagePythonGNU General Public License v2.0GPL-2.0

Marusya

A Discord bot interface for Stable Diffusion

Usage

To generate an image from text, use the /draw command and include your prompt as the query.

To generate a prompt from a couple of words, use the /generate command and include your text as the query.

Currently supported options

  • face swap (ReActor) (Install it, if you haven't)
  • live preview
  • negative prompts
  • swap model/checkpoint (see origial wiki)
  • sampling steps
  • width/height
  • CFG scale
  • sampling method
  • seed
  • Web UI styles
  • extra networks (hypernetwork, LoRA)
  • face restoration
  • high-res fix
  • CLIP skip
  • img2img
  • denoising strength
  • batch count

Bonus features

  • /settings command - set per-channel defaults for supported options (see Notes!):
    • also can set maximum steps limit and max batch count limit
    • refresh (update Marusya's options with any changes from Web UI)
  • /identify command - create a caption for your image.
  • /generate command - generate a prompt from text, using https://huggingface.co/Gustavosta/MagicPrompt-Stable-Diffusion
  • /stats command - shows how many /draw commands have been used.
  • /queue command - shows the size of each queue.
  • /info command - basic usage guide, other info, and download batch images.
  • /upscale command - resize your image.
  • buttons - certain outputs will contain buttons.
    • 🖋 - edit prompt, then generate a new image with same parameters.
    • 🎲 - randomize seed, then generate a new image with same parameters.
    • 📋 - view the generated image's information.
    • ⬆️ - upscale the generated image with defaults. Batch grids require use of the drop downs
    • ❌ - deletes the generated image. In Live preview this button interrupts generation process
    • ➡️ - skips the current image generation in live preview and go to next batch (if there's more than 1)
  • dropdown menus - batch images produce two drop down menus for the first 25 images.
    • The first menu prompts the bot to send only the images that you select at single images
    • The second menu prompts the bot to upscale the selected image from the batch.
  • context menu options - commands you can try on any message.
    • Get Image Info - view information of an image generated by Stable Diffusion.
    • Quick Upscale - upscale an image without needing to set options.
    • Batch Download - download all images of a batch set without needing to specify batch_id and image_id
  • mark image as spoiler
    • Per image (on /draw)
    • Set channel-wide default or force based on role with /settings
  • configuration file - can change some of Marusya's operational aspects.

Setup requirements

  • Set up AUTOMATIC1111's Stable Diffusion AI Web UI.
    • Marusya is currently tested on commit cf2772fab0af5573da775e7437e6acdca424f26e of the Web UI.
  • Run the Web UI with API (COMMANDLINE_ARGS= --api).
  • Clone this repo.
  • Create a file in your cloned repo called ".env", formatted like so:
# .env
TOKEN = put your bot token here
  • Run Marusya by running launch.bat (or launch.sh for Linux)

Notes

Credits

Foundation

Marusya only exists thanks to these awesome people: