Skip to content

v0.1.5 release

Compare
Choose a tag to compare
@chrisrude chrisrude released this 12 May 22:30
· 214 commits to main since this release

Lots of work in this release. A few new features, but a lot of under-the-hood changes to support more in the future.

If you've forked and started to make changes, you might have trouble merging. My apologies!

BREAKING CHANGES

The command-line arguments

  --stable-diffusion-negative-prompt
  --stable-diffusion-negative-prompt-nsfw

have been shortened to

  --sd-negative-prompt
  --sd-negative-prompt-nsfw

The old ones were just annoyingly long. :)

NEW FEATURES

  • More Customization
    A number of command-line arguments have been added to customize more aspects of the bot's behavior:
  --history-lines HISTORY_LINES
                        Number of lines of history to supply to the AI. This is the number
                        of lines of history that the AI will see when generating a response.
                        The default is 20.
  --diffusion-steps DIFFUSION_STEPS
                        Number of diffusion steps to take when generating an image. The
                        default is 30.
  --image-height IMAGE_HEIGHT
                        Size of images to generate. This is the height of the image in
                        pixels. The default is 512.
  --image-width IMAGE_WIDTH
                        Size of images to generate. This is the width of the image in
                        pixels. The default is 512.
  --image-words [IMAGE_WORDS ...]
                        One or more words that will indicate the user is requeting an image
                        to be generated.
  --stable-diffusion-sampler STABLE_DIFFUSION_SAMPLER, --sd-sampler STABLE_DIFFUSION_SAMPLER
                        Sampler to use when generating images. If not specified, the one set
                        on the AUTOMATIC1111 server will be used.
  • add FAQ

Major Bugfixes

There was a bug earlier with unsolicited replies, which would cause the bot to respond to every message in a channel for the first 2 minutes after it was pinged. The intended behavior was for it to only have a percentage chance of replies.

This has been fixed, and the bot is a bit less chatty. I've tweaked the response changes a bit as a result to keep some of the chattiness, but now it will chill sometimes, which is nice.

Internal Changes

If you've been looking at contributing, this might be a good time. I've made some changes to make the code a bit more easier to understand and maintain, at least in my opinion.

The purpose of these changes was to:

  • make the code easier to contribute to, maintain, and write tests for
  • limit discord-specific logic to a small number of files, so that things are easier in the future if we add other messaging integrations
  • centralize all settings to afford even more user customization later

Here's a quick tour of the main bits in the new structure:

important but nonexciting parts

  • oobabot.py - main, sets up and runs everything
  • ooba_client.py - oobabooga client http API <> python
  • sd_client.py - stable diffusion client http API <> python
  • settings.py - reads user-customizable settings

Bot brains

  • discord_bot.py - connects to Discord, monitors for messages, sends replies
  • image_generator.py - generates images and posts them, UI to redo images
  • decide_to_respond.py - chooses which messages to reply to
  • prompt_generator.py - generates the prompt sent to Oobabooga
  • repetition_tracker.py - watches for bot loops and tries to stop them

Utilities

  • http_client.py - http client, used by both sd_client and ooba_client
  • response_stats.py - logs operational stats
  • sentence_splitter.py - splits a stream of tokens into sentences
  • types.py - defines generic versions messaging objects
  • templates.py - creates all UI messages and bot prompts

Hopefully this will make things easier to understand!

Immediate upcoming work which will be supported by this change is:

  • allowing users full control over the prompt sent to the bot
  • exposing more knobs about the bot's responsiveness, temperature, etc.

Full Changelog: v0.1.4...v0.1.5