diff --git a/README.md b/README.md index 40a71045..b4873578 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ usage: oobabot [-h] [-c CONFIG] [--generate-config] [--invite-url] [--ai-name AI [--stable-diffusion-url STABLE_DIFFUSION_URL] [--extra-prompt-text EXTRA_PROMPT_TEXT] -oobabot v0.2.0: Discord bot for oobabooga's text-generation-webui +oobabot v0.2.1: Discord bot for oobabooga's text-generation-webui General Settings: diff --git a/docs/RELEASE-0.2.1.md b/docs/RELEASE-0.2.1.md new file mode 100644 index 00000000..d5df1275 --- /dev/null +++ b/docs/RELEASE-0.2.1.md @@ -0,0 +1,71 @@ + +# Release v.0.2.1 + +## What's Changed + +True to the version, his is a small bug-fix release. I had been wanting to get a few more small features in, but a few urgent bugs came up, and I wanted to get them out to users as soon as possible. My priority is to make sure things keep working well first, before adding new features. + +## New Contributors + +This is the first release to feature pull requests from the community! Thanks to everyone who took the time out to make `oobabot` better! + +* @clintkittiesmeow (with help from @jmoney7823956789378) made their first contribution in [PR 61](https://github.com/chrisrude/oobabot/pull/61) +* @harlyh made their first contribution in [PR 66](https://github.com/chrisrude/oobabot/pull/66) + +## New Features + +* Stable Diffusion Parameters in Prompt by @clintkittiesmeow + +A discord user, with your permission, can now customize pretty much any aspect of Stable Diffusion generation within the prompt. For example: + +```none + Make me a picture of a cat wearing a hat width=512 height=512 steps=10 seed=10 +``` + +The syntax is just `=` and you can include as many as you want. + +A parameter must pass two checks before they are passed to Stable Diffusion: + +* It must be included in the new `user_override_params` setting +* It must have a default in the `request_params` dictionary. We use this to know the type of the parameter, and to provide a default value if the user doesn't specify one. + +The new yaml setting for `user_override_params` looks like this, and will enable these settings by default: + +```yaml + # These parameters can be overridden by the Discord user by including them in their image + # generation request. The format for this is: param_name=value This is a whitelist of + # parameters that can be overridden. They must be simple parameters (strings, numbers, + # booleans), and they must be in the request_params dictionary. The value the user inputs + # will be checked against the type from the request_params dictionary, and if it doesn't + # match, the default value will be used instead. Otherwise, this value will be passed + # through to Stable Diffusion without any changes, so be mindful of what you allow here. + # It could potentially be used to inject malicious values into your SD server. For + # example, steps=1000000 could be bad for your server. + user_override_params: + - cfg_scale + - enable_hr + - model + - negative_prompt + - sampler_name + - seed + - height + - width +``` + +Thanks to @jmoney7823956789378 and @clintkittiesmeow for the idea and the initial implementation! It would not have happened without you. :) + +## Bug Fixes / Tech Improvements + +* Fixed the Unicode logging issue in ooba_client.py + +A Windows 11 update has reportedly caused an issue with the `--log-all-the-things` parameter. This fix should resolve that issue. Thanks @harlyh for the quick fix. + +* Fixed an urgent bug with streaming responses + +When using streaming responses, the bot would not be able to see its own messages in the history. This was due to a mistake in how the messages were edited when updates came in. This is now fixed. + +* Removed the ai-generated keywords feature, which was never finished and didn't really work right. It would cause issues with the new Stable Diffusion keyword parsing, so it's better to just remove it for now. + +### Full Changelog + +[All changes from 0.2.0 to 0.2.1](https://github.com/chrisrude/oobabot/compare/v0.2.0...v0.2.1) diff --git a/docs/config.sample.yml b/docs/config.sample.yml index b5d3d825..9723d6e5 100644 --- a/docs/config.sample.yml +++ b/docs/config.sample.yml @@ -6,7 +6,7 @@ # "config.yml" from the current directory when it is run. # -version: 0.2.0 +version: 0.2.1 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # persona @@ -44,7 +44,7 @@ discord: # Token to log into Discord with. For security purposes it's strongly recommended that # you set this via the DISCORD_TOKEN environment variable instead, if possible. - discord_token: + discord_token: '' # Post the entire response as a single message, rather than splitting it into separate # messages by sentence. @@ -87,12 +87,11 @@ discord: # default: 0.7 stream_responses_speed_limit: - # FEATURE PREVIEW: Adds a limit to the number of channels the bot will post unsolicited - # messages in at the same time. This is to prevent the bot from being too noisy in large - # servers. When set, only the most recent N channels the bot has been summoned in will - # have a chance of receiving an unsolicited message. The bot will still respond to - # @-mentions and wake words in any channel it can access. Set to 0 to disable this - # feature. + # Adds a limit to the number of channels the bot will post unsolicited messages in at the + # same time. This is to prevent the bot from being too noisy in large servers. When set, + # only the most recent N channels the bot has been summoned in will have a chance of + # receiving an unsolicited message. The bot will still respond to @-mentions and wake + # words in any channel it can access. Set to 0 to disable this feature. # default: 3 unsolicited_channel_cap: @@ -183,21 +182,37 @@ stable_diffusion: # Feel free to add additional simple parameters here as Stable Diffusion's API evolves. # See Stable Diffusion's documentation for what these parameters mean. request_params: + cfg_scale: 7 do_not_save_samples: true do_not_save_grid: true + enable_hr: false + model: '' negative_prompt: animal harm, suicide, loli, nsfw negative_prompt_nsfw: animal harm, suicide, loli + sampler_name: '' + seed: -1 steps: 30 width: 512 height: 512 - sampler: '' - # FEATURE PREVIEW: If set, the bot will ask Oobabooga to generate image keywords from a - # user's message. It will then pass the keywords that Oobabooga produces to Stable - # Diffusion to finally generate an image. Otherwise, the bot will simply extract keywords - # directly from the user's message using a simple regex. - # default: False - use_ai_generated_keywords: + # These parameters can be overridden by the Discord user by including them in their image + # generation request. The format for this is: param_name=value This is a whitelist of + # parameters that can be overridden. They must be simple parameters (strings, numbers, + # booleans), and they must be in the request_params dictionary. The value the user inputs + # will be checked against the type from the request_params dictionary, and if it doesn't + # match, the default value will be used instead. Otherwise, this value will be passed + # through to Stable Diffusion without any changes, so be mindful of what you allow here. + # It could potentially be used to inject malicious values into your SD server. For + # example, steps=1000000 could be bad for your server. + user_override_params: + - cfg_scale + - enable_hr + - model + - negative_prompt + - sampler_name + - seed + - height + - width # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # template diff --git a/pyproject.toml b/pyproject.toml index 4a84156d..0f750437 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "oobabot" -version = "0.2.0" +version = "0.2.1" description = "A Discord bot which talks to Large Language Model AIs running on oobabooga's text-generation-webui" authors = ["Christopher Rude "] license = "MIT" diff --git a/src/oobabot/__init__.py b/src/oobabot/__init__.py index 664e89e2..a4085637 100644 --- a/src/oobabot/__init__.py +++ b/src/oobabot/__init__.py @@ -4,4 +4,4 @@ """ # todo: sync this up automatically -__version__ = "0.2.0" +__version__ = "0.2.1"