Git Product home page Git Product logo

aiyabot's People

Contributors

auwowauwu avatar btcookies avatar cyberofficial avatar danstis avatar dependabot[bot] avatar eidenz avatar foxxmd avatar harubaru avatar joshbaldwin101 avatar justguythatguy avatar kilvoctu avatar philpax avatar pseudobunny avatar pyrotuna avatar saltaccount avatar sebaxakerhtc avatar solareon avatar wizz13150 avatar yoinked-h avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

aiyabot's Issues

Keyerror: 'info'

After pulling the latest commit, the bot stucks at saving images' metadata.
Error message are as follows:

Traceback (most recent call last):
  File "C:\Users\leo89\Desktop\aipaint\aiyabot\core\stablecog.py", line 239, in dream
    metadata = json.dumps(response['info']).strip('"')
KeyError: 'info'

JSONDecodeError when switching models

I have 2 models that I put in the bot. MJ4 and SD. If I load the model manually in the WebUI, and then run the discord /draw command, it works perfectly fine. If I try to switch the model using the discord bot, it says

txt2img failed Expecting value: line 1 column 1 (char 0) None

And the bot will refuse to work for a while, unless it is terminated and restarted.
Looking into the terminal, I see

image

JSONDecodeError when switching models, error in Line 1.

I'm fairly sure my models.csv is formatted correctly. Not sure what other problems could cause this error. Any thoughts?

Option to use URL for `init_image`

My workflow is to generate images, and then to remix the result with a different prompt. Right now, I need to download the generated image and reupload it to use it as an init_image; I'd like to be able to

  • use an URL as an init image, so that I can skip those steps and use arbitrary images from the internet as a base.
  • directly remix an existing image, similar to Midjourney's variations/remixing. That is, add a button to generation outputs that let you run a new generation using the output as the init_image with a new prompt.

Let me know if you need any further information!

Error when setting blank seed with ๐Ÿ–‹๏ธ button

When using the ๐Ÿ–‹๏ธ button to edit an output image, if user sets the seed field to nothing, there will be an error. I forget what it said, but no matter.

I will fix this tomorrow. I think I'll have both "-1" and a blank field randomize the seed for ๐Ÿ–‹๏ธ. Don't want to break previous process, but also typing -1 is tedious to do.

I want to add the model in the model.csv but it got error

Hello I want to add the model list to change by discord bot
but I got some error, when I edit the model.csv

below is the model.csv
display_name|model_full_name|activator_token
default||
SD1.5|v1-5-pruned.ckpt|
wd1.4|wd-1-4-anime_e2.ckpt|
anything4.5|anything-v4.5.ckpt|

and below is the error after the file change
Traceback (most recent call last):
File "F:\aiyabot\aiya.py", line 19, in <module
settings.files_check()
File "F:\aiyabot\core\settings.py", line 320, in files_check
populate_global_vars()
File "F:\aiyabot\core\settings.py", line 417, in populate_global_vars
if row[1].split(os.sep)[-1] == model['filename'].split(os.sep)[-1] \
IndexError: list index out of range

Support for styles

Add support to use the user styles in styles.csv on the backend.

The API already makes it very easy to add a user-defined style to payload, e.g.

payload = {
    "prompt": "puppy dog",
    "steps": 10,
    "styles": [
        "Anime"
    ]
}

This will be a proper implementation of the experimental feature on this branch 2112e68

Problems to solve:

  1. How to pull the available styles from the styles.csv, so user knows what's available
  2. The bigger problem is slash command options can only have up to 25 choices... Discord limitation

A possible solution for 2 is to have the styles option require user to manually type in the style.
Then, I can make further use of the /tips command and Discord Buttons. /tips can have a 2nd page that provides a list of available styles.
Clunky, but it should work hypothetically.

https://docs.pycord.dev/en/stable/api.html#discord.AutocompleteContext
This could be a way to get around the 25 choice limit

Token Error

D:- Descargas\aiyabot-main>python -m venv venv

D:- Descargas\aiyabot-main>venv\Scripts\pip.exe install -r requirements.txt
Requirement already satisfied: py-cord in d:- descargas\aiyabot-main\venv\lib\site-packages (from -r requirements.txt (line 1)) (2.4.0)
Requirement already satisfied: python-dotenv in d:- descargas\aiyabot-main\venv\lib\site-packages (from -r requirements.txt (line 2)) (0.21.1)
Requirement already satisfied: requests in d:- descargas\aiyabot-main\venv\lib\site-packages (from -r requirements.txt (line 3)) (2.28.2)
Requirement already satisfied: Pillow in d:- descargas\aiyabot-main\venv\lib\site-packages (from -r requirements.txt (line 4)) (9.4.0)
Requirement already satisfied: tomlkit in d:- descargas\aiyabot-main\venv\lib\site-packages (from -r requirements.txt (line 5)) (0.11.6)
Requirement already satisfied: typing-extensions<5,>=4 in d:- descargas\aiyabot-main\venv\lib\site-packages (from py-cord->-r requirements.txt (line 1)) (4.4.0)
Requirement already satisfied: aiohttp<3.9.0,>=3.6.0 in d:- descargas\aiyabot-main\venv\lib\site-packages (from py-cord->-r requirements.txt (line 1)) (3.8.3)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in d:- descargas\aiyabot-main\venv\lib\site-packages (from requests->-r requirements.txt (line 3)) (1.26.14)
Requirement already satisfied: charset-normalizer<4,>=2 in d:- descargas\aiyabot-main\venv\lib\site-packages (from requests->-r requirements.txt (line 3)) (2.1.1)
Requirement already satisfied: idna<4,>=2.5 in d:- descargas\aiyabot-main\venv\lib\site-packages (from requests->-r requirements.txt (line 3)) (3.4)
Requirement already satisfied: certifi>=2017.4.17 in d:- descargas\aiyabot-main\venv\lib\site-packages (from requests->-r requirements.txt (line 3)) (2022.12.7)
Requirement already satisfied: frozenlist>=1.1.1 in d:- descargas\aiyabot-main\venv\lib\site-packages (from aiohttp<3.9.0,>=3.6.0->py-cord->-r requirements.txt (line 1)) (1.3.3)
Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in d:- descargas\aiyabot-main\venv\lib\site-packages (from aiohttp<3.9.0,>=3.6.0->py-cord->-r requirements.txt (line 1)) (4.0.2)
Requirement already satisfied: yarl<2.0,>=1.0 in d:- descargas\aiyabot-main\venv\lib\site-packages (from aiohttp<3.9.0,>=3.6.0->py-cord->-r requirements.txt (line 1)) (1.8.2)
Requirement already satisfied: aiosignal>=1.1.2 in d:- descargas\aiyabot-main\venv\lib\site-packages (from aiohttp<3.9.0,>=3.6.0->py-cord->-r requirements.txt (line 1)) (1.3.1)
Requirement already satisfied: attrs>=17.3.0 in d:- descargas\aiyabot-main\venv\lib\site-packages (from aiohttp<3.9.0,>=3.6.0->py-cord->-r requirements.txt (line 1)) (22.2.0)
Requirement already satisfied: multidict<7.0,>=4.5 in d:- descargas\aiyabot-main\venv\lib\site-packages (from aiohttp<3.9.0,>=3.6.0->py-cord->-r requirements.txt (line 1)) (6.0.4)

[notice] A new release of pip available: 22.2.1 -> 23.0
[notice] To update, run: D:- Descargas\aiyabot-main\venv\Scripts\python.exe -m pip install --upgrade pip

D:- Descargas\aiyabot-main>venv\Scripts\python.exe aiya.py
Using URL: http://127.0.0.1:7860
Using outputs directory: outputs
[2023-02-11 15:52:09] INFO: Cleaning up tasks.
[2023-02-11 15:52:09] INFO: Closing the event loop.
[2023-02-11 15:52:09] ERROR: token must be of type str, not NoneType

Sorry if i need to give another type of information, is my first time opening an issue.

[Bug]"checkpoint not found; loading fallback..." when clicking on the dice icon.

running the "latest" version

$ git show
commit 4c00670a66125ad51867fdeeef529dff47d3261f (HEAD -> main, origin/main, origin/HEAD)
Merge: 324f040 3354781
Author: Kilvoctu <[email protected]>
Date:   Thu Nov 24 15:42:02 2022 -0600

    Merge pull request #66 from Kilvoctu/add-facefix-to-upscale

    Add facefix options to upscalecog

after generating some picture with bot via /draw I click on the randomize seed icon under the picture, the bot tries to load some default checkpoint it seems, which my A1111 does not have.
so the A1111 console throws "error":
Checkpoint not found; loading fallback modernDisney-v1.1.ckpt [c6303f9f]

after that the generation works fine, but stays on that model and when I change it back in the A1111 webui to sd1.5 and generate and then click on randomize, the problem repeats.

ps: when trying to select a model in the /draw request, it shows only "Default"

Error when launching with launch.bat

Traceback (most recent call last):
File "C:\Users\micha\Desktop\New folder (2)\venv\lib\site-packages\requests\models.py", line 971, in json
return complexjson.loads(self.text, **kwargs)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64__qbz5n2kfra8p0\lib\json_init_.py", line 346, in loads
return _default_decoder.decode(s)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64__qbz5n2kfra8p0\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64__qbz5n2kfra8p0\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\micha\Desktop\New folder (2)\aiya.py", line 19, in
settings.files_check()
File "C:\Users\micha\Desktop\New folder (2)\core\settings.py", line 211, in files_check
populate_global_vars()
File "C:\Users\micha\Desktop\New folder (2)\core\settings.py", line 243, in populate_global_vars
for s1 in r1.json():
File "C:\Users\micha\Desktop\New folder (2)\venv\lib\site-packages\requests\models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

bot no longer works in DMs

Bot no longer will reply in DMs due to some changes with #17.
Have bot use standard defaults when no server is detected.
Fixing this will allow me to test commit 81ec359 fix for issue #14

Hypernetworks not working

AUTOMATIC1111/stable-diffusion-webui@40ff6db (extra networks UI) reworked how hypernetworks are used.
This has caused some issues for API usage, as the rework removed the parameter used to send hypernetwork to the API.

If you're already using Web UI, it seems you can update to current commit (AUTOMATIC1111/stable-diffusion-webui@f2eae61, right now) with no issues. I did so, and hypernetworks still work.

However, if using a fresh Web UI install, it will not include the settings needed for hypernetworks to function. In which case, AUTOMATIC1111/stable-diffusion-webui@e33cace is the commit right before this change, if you want to use hypernetworks.

Model does not swap under certain conditions with updated Web UI

I don't know exactly which commit it started with, but if updating to a more recent commit of A1111 (currently 30b1bcc64e67ad50c5d3af3a6fe1bd1e9553f34e), there is a bug in which the model will not swap under some conditions. This is a Web UI issue.

If models (checkpoints) are being cached and VAE files are being used, the model will not swap (it instead loads weights from the VAE). A workaround for now is either:
-don't cache models (set "Checkpoints to cache in RAM" to 0 in Web UI)
-don't use separate VAE files (set "SD VAE" to none in Web UI)

Otherwise, AIYA should function like usual if anyone wants to update Web UI (to 30b1bcc64e67ad50c5d3af3a6fe1bd1e9553f34e).

edit: Still an issue as of a1111 web ui commit ac085628540d0ec6a988fad93f5b8f2154209571.

Model switching is stuck on what the webui is set on

@philpax was trying to get the model switching working, but it seems whatever the webui is set to overrides the model selection in the discord bot!

How to replicate: Set one model in the webui, try to prompt with another model with the discord bot

Invalid URL '/login': No scheme supplied.

Traceback (most recent call last):
  File "Y:\stablediff\aiyabot_test\subtest\core\stablecog.py", line 231, in dream
    s.post(URL + '/login', data=login_payload)
  File "Y:\stablediff\aiyabot_test\subtest\pydata\lib\site-packages\requests\sessions.py", line 635, in post
    return self.request("POST", url, data=data, json=json, **kwargs)
  File "Y:\stablediff\aiyabot_test\subtest\pydata\lib\site-packages\requests\sessions.py", line 573, in request
    prep = self.prepare_request(req)
  File "Y:\stablediff\aiyabot_test\subtest\pydata\lib\site-packages\requests\sessions.py", line 484, in prepare_request
    p.prepare(
  File "Y:\stablediff\aiyabot_test\subtest\pydata\lib\site-packages\requests\models.py", line 368, in prepare
    self.prepare_url(url, params)
  File "Y:\stablediff\aiyabot_test\subtest\pydata\lib\site-packages\requests\models.py", line 439, in prepare_url
    raise MissingSchema(
requests.exceptions.MissingSchema: Invalid URL '/login': No scheme supplied. Perhaps you meant http:///login?

Gradio login support

I'm using WebUI with port forward so I could access the UI remotely, set up a password after the recently discovered RCE. I also wanted to share the computing powers with a bunch of friend via Discord. Could a login workaround be possible? Thanks a ton!

add support for --api-auth

The web ui added authentication in this commit AUTOMATIC1111/stable-diffusion-webui@41e242b.

I think the usage for it is --api-auth user:pass

If anyone is using this argument, aiya will just get confused and fail at the first time we need to access the API. At least that's my best guess on what's happening.

Traceback (most recent call last):
  File "D:\StableDiffusion\aiyabot-git\aiya.py", line 19, in <module>
    settings.files_check()
  File "D:\StableDiffusion\aiyabot-git\core\settings.py", line 166, in files_check
    global_var.sampler_names.append(s1['name'])
TypeError: string indices must be integers

edit: I don't know how --api-auth works ๐Ÿคทโ€โ™€๏ธ. It's just going to be unsupported by aiya, for now.

Problem: for d in range(len(old_config["dependencies"])): KeyError: 'dependencies'

Hello!

I would love to try and use your bot but sadly i am running into a error when trying to launch the launch.bat

I think the requirements are already satisfied, the --api parameter is added, the SD-Web-UI is running and accessable by /config and /api
Bot token and credentials are present in the .env file.

Maybe someone can fix or help me what the problem is (iยดll copy the whole bunch in here):

`D:\AI-Painting\06_aiyabot>"D:\AI-Painting\06_aiyabot\venv\Scripts\Python.exe" launch.py
Requirement already satisfied: py-cord in d:\ai-painting\06_aiyabot\venv\lib\site-packages (from -r requirements.txt (line 1)) (2.2.2)
Requirement already satisfied: python-dotenv in d:\ai-painting\06_aiyabot\venv\lib\site-packages (from -r requirements.txt (line 2)) (0.21.0)
Requirement already satisfied: requests in d:\ai-painting\06_aiyabot\venv\lib\site-packages (from -r requirements.txt (line 3)) (2.28.1)
Requirement already satisfied: Pillow in d:\ai-painting\06_aiyabot\venv\lib\site-packages (from -r requirements.txt (line 4)) (9.3.0)
Requirement already satisfied: aiohttp<3.9.0,>=3.6.0 in d:\ai-painting\06_aiyabot\venv\lib\site-packages (from py-cord->-r requirements.txt (line 1)) (3.8.3)
Requirement already satisfied: charset-normalizer<3,>=2 in d:\ai-painting\06_aiyabot\venv\lib\site-packages (from requests->-r requirements.txt (line 3)) (2.1.1)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in d:\ai-painting\06_aiyabot\venv\lib\site-packages (from requests->-r requirements.txt (line 3)) (1.26.12)
Requirement already satisfied: certifi>=2017.4.17 in d:\ai-painting\06_aiyabot\venv\lib\site-packages (from requests->-r requirements.txt (line 3)) (2022.9.24)
Requirement already satisfied: idna<4,>=2.5 in d:\ai-painting\06_aiyabot\venv\lib\site-packages (from requests->-r requirements.txt (line 3)) (3.4)
Requirement already satisfied: attrs>=17.3.0 in d:\ai-painting\06_aiyabot\venv\lib\site-packages (from aiohttp<3.9.0,>=3.6.0->py-cord->-r requirements.txt (line 1)) (22.1.0)
Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in d:\ai-painting\06_aiyabot\venv\lib\site-packages (from aiohttp<3.9.0,>=3.6.0->py-cord->-r requirements.txt (line 1)) (4.0.2)
Requirement already satisfied: multidict<7.0,>=4.5 in d:\ai-painting\06_aiyabot\venv\lib\site-packages (from aiohttp<3.9.0,>=3.6.0->py-cord->-r requirements.txt (line 1)) (6.0.2)
Requirement already satisfied: frozenlist>=1.1.1 in d:\ai-painting\06_aiyabot\venv\lib\site-packages (from aiohttp<3.9.0,>=3.6.0->py-cord->-r requirements.txt (line 1)) (1.3.1)
Requirement already satisfied: aiosignal>=1.1.2 in d:\ai-painting\06_aiyabot\venv\lib\site-packages (from aiohttp<3.9.0,>=3.6.0->py-cord->-r requirements.txt (line 1)) (1.2.0)
Requirement already satisfied: yarl<2.0,>=1.0 in d:\ai-painting\06_aiyabot\venv\lib\site-packages (from aiohttp<3.9.0,>=3.6.0->py-cord->-r requirements.txt (line 1)) (1.8.1)

[notice] A new release of pip available: 22.2.2 -> 22.3
[notice] To update, run: D:\AI-Painting\06_aiyabot\venv\Scripts\python.exe -m pip install --upgrade pip
['aiohttp', 'aiosignal', 'async-timeout', 'attrs', 'certifi', 'charset-normalizer', 'frozenlist', 'idna', 'multidict', 'Pillow', 'py-cord', 'python-dotenv', 'requests', 'urllib3', 'yarl'] installed
[2022-11-02 09:55:27] WARNING: PyNaCl is not installed, voice will NOT be supported
Using URL: http://127.0.0.1:7860
Using outputs directory: outputs
Traceback (most recent call last):
File "D:\AI-Painting\06_aiyabot\launch.py", line 12, in
import aiya
File "D:\AI-Painting\06_aiyabot\aiya.py", line 20, in
settings.old_api_check()
File "D:\AI-Painting\06_aiyabot\core\settings.py", line 124, in old_api_check
for d in range(len(old_config["dependencies"])):
KeyError: 'dependencies'`

Reacting with โŒ doesn't delete generations in DMs

The bot is able to delete its generations in Discord servers, but not DMs.
It will throw this error

Traceback (most recent call last):
  File "D:\StableDiffusion\aiyabot-git\venv\lib\site-packages\discord\client.py", line 377, in _run_event
    await coro(*args, **kwargs)
  File "D:\StableDiffusion\aiyabot-git\aiya.py", line 74, in on_raw_reaction_add
    message = await self.get_channel(ctx.channel_id).fetch_message(ctx.message_id)
AttributeError: 'NoneType' object has no attribute 'fetch_message'

Crash on fresh install

fresh install excluding .env which sets a URL and discord token.

C:\sd\aiyabot>git show
commit 61331b72c85ec120c9c6111c7610739cddfceb50 (HEAD -> main, origin/main, origin/HEAD)
Merge: 04b68e8 9353f79
Author: Kilvoctu <[email protected]>
Date:   Tue Nov 8 23:29:48 2022 -0600

    Merge pull request #45 from Kilvoctu/model-activator-token

    Option to provide preset model activation token


C:\sd\aiyabot>git status
On branch main
Your branch is up to date with 'origin/main'.

nothing to commit, working tree clean

C:\sd\aiyabot>.\launch.bat

C:\sd\aiyabot>python -m venv venv

C:\sd\aiyabot>venv\Scripts\pip.exe install -r requirements.txt
Requirement already satisfied: py-cord in c:\sd\aiyabot\venv\lib\site-packages (from -r requirements.txt (line 1)) (2.2.2)
Requirement already satisfied: python-dotenv in c:\sd\aiyabot\venv\lib\site-packages (from -r requirements.txt (line 2)) (0.21.0)
Requirement already satisfied: requests in c:\sd\aiyabot\venv\lib\site-packages (from -r requirements.txt (line 3)) (2.28.1)
Requirement already satisfied: Pillow in c:\sd\aiyabot\venv\lib\site-packages (from -r requirements.txt (line 4)) (9.3.0)
Requirement already satisfied: aiohttp<3.9.0,>=3.6.0 in c:\sd\aiyabot\venv\lib\site-packages (from py-cord->-r requirements.txt (line 1)) (3.8.3)
Requirement already satisfied: idna<4,>=2.5 in c:\sd\aiyabot\venv\lib\site-packages (from requests->-r requirements.txt (line 3)) (3.4)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\sd\aiyabot\venv\lib\site-packages (from requests->-r requirements.txt (line 3)) (1.26.12)
Requirement already satisfied: certifi>=2017.4.17 in c:\sd\aiyabot\venv\lib\site-packages (from requests->-r requirements.txt (line 3)) (2022.9.24)
Requirement already satisfied: charset-normalizer<3,>=2 in c:\sd\aiyabot\venv\lib\site-packages (from requests->-r requirements.txt (line 3)) (2.1.1)
Requirement already satisfied: yarl<2.0,>=1.0 in c:\sd\aiyabot\venv\lib\site-packages (from aiohttp<3.9.0,>=3.6.0->py-cord->-r requirements.txt (line 1)) (1.8.1)
Requirement already satisfied: aiosignal>=1.1.2 in c:\sd\aiyabot\venv\lib\site-packages (from aiohttp<3.9.0,>=3.6.0->py-cord->-r requirements.txt (line 1)) (1.3.1)
Requirement already satisfied: attrs>=17.3.0 in c:\sd\aiyabot\venv\lib\site-packages (from aiohttp<3.9.0,>=3.6.0->py-cord->-r requirements.txt (line 1)) (22.1.0)
Requirement already satisfied: multidict<7.0,>=4.5 in c:\sd\aiyabot\venv\lib\site-packages (from aiohttp<3.9.0,>=3.6.0->py-cord->-r requirements.txt (line 1)) (6.0.2)
Requirement already satisfied: frozenlist>=1.1.1 in c:\sd\aiyabot\venv\lib\site-packages (from aiohttp<3.9.0,>=3.6.0->py-cord->-r requirements.txt (line 1)) (1.3.3)
Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in c:\sd\aiyabot\venv\lib\site-packages (from aiohttp<3.9.0,>=3.6.0->py-cord->-r requirements.txt (line 1)) (4.0.2)

[notice] A new release of pip available: 22.2.1 -> 22.3.1
[notice] To update, run: C:\sd\aiyabot\venv\Scripts\python.exe -m pip install --upgrade pip

C:\sd\aiyabot>venv\Scripts\python.exe aiya.py
[2022-11-09 21:03:37] WARNING: PyNaCl is not installed, voice will NOT be supported
Using URL: http://localhost:9595
Using outputs directory: outputs
Traceback (most recent call last):
  File "C:\sd\aiyabot\aiya.py", line 19, in <module>
    settings.files_check()
  File "C:\sd\aiyabot\core\settings.py", line 134, in files_check
    sampler = s1['name']
TypeError: string indices must be integers

Python 3.10.6
Windows 10 Pro, 21H1

Solution: ...this is apparently what a connection problem looks like. Remember to launch a1111 with --listen --api etc...

Leaving the issue open - this needs a safety check to make sure it can talk to the api, and it needs to throw a reasonable error (ideally without immediately exiting when launched by double-clicking the .bat).

Bot breaks with "invalid parameter"

The issue:

The bot itself will break sometimes for no apparent reason. It will spew out "an invalid parameter was found" even though the prompt did not have anything changed in it, as well as the settings (From when the prompt was working).

Ignoring exception in command draw:
Traceback (most recent call last):
  File "Y:\AI-GIT-CLONE\aiyabot\venv\lib\site-packages\discord\commands\core.py", line 124, in wrapped
    ret = await coro(arg)
  File "Y:\AI-GIT-CLONE\aiyabot\venv\lib\site-packages\discord\commands\core.py", line 978, in _invoke
    await self.callback(self.cog, ctx, **kwargs)
  File "Y:\AI-GIT-CLONE\aiyabot\core\stablecog.py", line 319, in dream_handler
    await ctx.send_response(
  File "Y:\AI-GIT-CLONE\aiyabot\venv\lib\site-packages\discord\interactions.py", line 825, in send_message
    await self._locked_response(
  File "Y:\AI-GIT-CLONE\aiyabot\venv\lib\site-packages\discord\interactions.py", line 1090, in _locked_response
    await coro
  File "Y:\AI-GIT-CLONE\aiyabot\venv\lib\site-packages\discord\webhook\async_.py", line 219, in request
    raise NotFound(response, data)
discord.errors.NotFound: 404 Not Found (error code: 10062): Unknown interaction

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "Y:\AI-GIT-CLONE\aiyabot\venv\lib\site-packages\discord\bot.py", line 1114, in invoke_application_command
    await ctx.command.invoke(ctx)
  File "Y:\AI-GIT-CLONE\aiyabot\venv\lib\site-packages\discord\commands\core.py", line 375, in invoke
    await injected(ctx)
  File "Y:\AI-GIT-CLONE\aiyabot\venv\lib\site-packages\discord\commands\core.py", line 132, in wrapped
    raise ApplicationCommandInvokeError(exc) from exc
discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: NotFound: 404 Not Found (error code: 10062): Unknown interaction

From the error, I'd guess it has something to do with my internet, but it still does not explain why the back msg goes through discord

Note, the code above appears in the command line, but sometimes, JUST SOMETIMES everything works. (The bot still spew out errors and says that app is unavailable, but the command goes through to the AI interface)

Windows 10 pro edition, git clone

Choosing the model/checkpoint to use

I think this will require upstream work on the API (just looking at the FastAPI listing), but it would be nice to switch models so that you can use specific models for specific generation tasks. Not sure if it makes sense to make it a per-generation setting, or just a global setting that someone can change as required.

request - Usage tracker

Hi, i was wondering if some sort of GPU, CPU, and RAM usage along with temp and power draw tracker would be nice, like in the 'playing' part or while its generating it shows somewhere, i would find it useful
also a 'cached in vram' (idk if it has a cached in vram or if it only loads one model into vram) and 'cached in ram' when looking at all models would be nice
EDIT: Also a it/s counter would be cool and maybe showing the img say every 5 steps till its done

Note of appreciation

Hey there! Would've put this in a GH discussion but those aren't enabled for forks by default.

Just wanted to say I appreciate you setting up a bot to work against a1111's UI - we (friends and I) can now collaborate like we do with Midjourney, and use the web UI when we need more control. This is a huge workflow improvement for us, thank you :)

Autocomplete not showing models from model.csv

Updated to newer commit of sd-webui and some reason autocomplete and /tips wont show the models in my list, just shows the last one.
image

It was working fine with the commit from two weeks ago

This is whats in my models.csv
display_name|model_full_name|activator_token
AnythingV3|Anything-V3.0.ckpt|
AbyssOrangeMix2|AbyssOrangeMix2.ckpt|
ProtoGenX3.4|ProtoGen_X3.4.ckpt|
BerryMix|berry_mix.ckpt|
SimpMaker3K3|SimpMaker 3k3.ckpt|
HDDream|HDDream.ckpt|
OpenJourney|openjourney-v2.ckpt|mdjrny-v4style
WildsMixv1|wildSMix_v1Alloround.ckpt|
EimisAnimeDiffusion|EimisAnimeDiffusion_1-0v.ckpt|
StablediffusionV1.5|v1-5-pruned-emaonly.ckpt|
ZombiMixV8|ZombiMix-v8.ckpt|
SeekArtMegav1|seekartmegav1.ckpt|

Bot erroring out*

Regarding the comment from 8534a11#commitcomment-87409492

My issue

Request -- cyber_official#0001 -- Prompt: a giant egg
Ignoring exception in command draw:
Traceback (most recent call last):
  File "Y:\stablediff\aiyabot\datadir\lib\site-packages\discord\commands\core.py", line 124, in wrapped
    ret = await coro(arg)
  File "Y:\stablediff\aiyabot\datadir\lib\site-packages\discord\commands\core.py", line 970, in _invoke
    await self.callback(self.cog, ctx, **kwargs)
  File "Y:\stablediff\aiyabot\core\stablecog.py", line 134, in dream_handler
    PayloadFormatter.do_format(self, PayloadFormatter.PayloadFormat.TXT2IMG)
  File "Y:\stablediff\aiyabot\core\PayloadFormatter.py", line 47, in do_format
    dependenciesjson = responsestr["dependencies"]
KeyError: 'dependencies'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "Y:\stablediff\aiyabot\datadir\lib\site-packages\discord\bot.py", line 1088, in invoke_application_command
    await ctx.command.invoke(ctx)
  File "Y:\stablediff\aiyabot\datadir\lib\site-packages\discord\commands\core.py", line 374, in invoke
    await injected(ctx)
  File "Y:\stablediff\aiyabot\datadir\lib\site-packages\discord\commands\core.py", line 132, in wrapped
    raise ApplicationCommandInvokeError(exc) from exc
discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: KeyError: 'dependencies'

I have tried to use the suggested commit, and bot still doesn't run

IndexError on line 323 in dream. Image doesn't get posted to Discord

I am running into an issue in the latest version of Aiyabot.
After the image is generated by StableDiffusion, I get an error from Aiyabot and it doesn't post it to discord.
This has worked before on an earlier version of Aiyabot.. not sure what went wrong.
I am using the recommended git version of AUTOMATIC1111 that is mentioned in the Readme.
I am getting the following error

`

/draw prompt:test steps:30 height:512 width:512 guidance_scale:7.0 sampler:Euler a seed:2987020433 count:1
Traceback (most recent call last):

  File "C:\AI-ART\aiyabot\aiyabot\core\stablecog.py", line 323, in dream

    image = Image.open(io.BytesIO(base64.b64decode(image_base64.split(",",1)[1])))

IndexError: list index out of range

Request -- Kate#xxxx  -- Prompt: test

/draw prompt:test steps:30 height:512 width:512 guidance_scale:7.0 sampler:Euler a seed:373217648 count:1

Traceback (most recent call last):

  File "C:\AI-ART\aiyabot\aiyabot\core\stablecog.py", line 323, in dream

    image = Image.open(io.BytesIO(base64.b64decode(image_base64.split(",",1)[1])))

IndexError: list index out of range

`

GFPGAN

Hey there,
How can I set GfpGan with this?

Google Colaboratory support?

Hello, can you please make a google colab with your repository? I tried to make it, but I lack the knowledge of python. Yesterday I updated python on colab and even managed to run launch.py and aiya.py at the same time, but nothing worked. Today I couldn't even do that. Please, I beg you, this will be very useful for people with an amd graphics card like me, or people who don't have a powerful enough graphics card to run stable diffusion. Thanks in advance

aiya not getting samplers/styles on startup

Think I broke this with commit d4ddc6e.

The code for populating the samplers and styles list occurs after the check for Web UI running. Even though aiya launches "normally" after getting a connection, that block of code doesn't seem to execute.

Gen-Stop

It appears that there is a problem with your image generation system when multiple users are trying to use it at the same time. When one user is already generating an image and another user starts a new one, it cancels the first user's generation and doesn't put it in a queue, resulting in a incomplete image.

Discord channel permissions are only partially honored?

I want to set up a single discord channel for stable diffusion generation which will have slow mode enabled, so the bot will not respond to prompts on any other channel, to keep things nicely organized.

I disallowed the bot to see/post channel content, but it still reacts to slash commands and will attempt to generate an image, failing to post a reply with an image due to 403. It should not even attempt to generate or reply "bear with me", just ignore, since it's not shown in the members list.

Can't generate edited prompt despite using max prompt steps

When trying to edit an image (๐Ÿ–‹๏ธ) using 50 steps (50 is max_steps) the bot will tell you that 50 steps is beyond the boundary (0-50) despite 50 being the upper limit.

viewhandler.py > Line 144
if 0 < int(line.split(':', 1)[1]) < max_steps:

Instead, should be:
if 0 < int(line.split(':', 1)[1]) <= max_steps:

This change seems to fixes the issue for me.

Performance issue? 4.5sec to generate, 11-15 seconds to post

Describe the bug
On my machine it takes between 4-4.5sec to generate an image with 30 steps, and an additional 6-10sec for the bot to post it.
I have a 1000/50M internet connection. Is this a bug, a limitation of discord (it throttles all bot messages) or a config issue? I would think total bot overhead should be <1sec.

Any way I can troubleshoot this more to provide better breakdown of where the time is going?

My processor is Ryzen 9 5900x, PC was not doing any other tasks at the time, no running backups in the background etc.


Environment

  • OS: Windows 10.

KeyError: 'dependencies'

The latest commit mentioned the fix of this issue, but I am still able to recreate the error on a fresh clone.
Have tried issue #2 's fix by ironing out the crlf, still no luck.
Any investigation is greatly appreciated!

Ignoring exception in command draw:
Traceback (most recent call last):
  File "C:\Users\\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 124, in wrapped
    ret = await coro(arg)
  File "C:\Users\\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 970, in _invoke
    await self.callback(self.cog, ctx, **kwargs)
  File "C:\Users\\Desktop\aipaint\aiyabot\core\stablecog.py", line 141, in dream_handler
    PayloadFormatter.do_format(self, PayloadFormatter.PayloadFormat.TXT2IMG)
  File "C:\Users\\Desktop\aipaint\aiyabot\core\PayloadFormatter.py", line 54, in do_format
    dependenciesjson = responsestr["dependencies"]
KeyError: 'dependencies'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\bot.py", line 1088, in invoke_application_command
    await ctx.command.invoke(ctx)
  File "C:\Users\\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 374, in invoke
    await injected(ctx)
  File "C:\Users\\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\core.py", line 132, in wrapped
    raise ApplicationCommandInvokeError(exc) from exc
discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: KeyError: 'dependencies'

On fresh install default DIR crashes

I'm tired af at the moment so I'm not debugging it right now but here it is:

Traceback (most recent call last):
  File "D:\githu\aiyabot-main\aiya.py", line 24, in <module>
    self.load_extension('core.stablecog')
  File "D:\githu\aiyabot-main\venv\lib\site-packages\discord\cog.py", line 893, in load_extension
    self._load_from_module_spec(spec, name)
  File "D:\githu\aiyabot-main\venv\lib\site-packages\discord\cog.py", line 760, in _load_from_module_spec
    raise errors.ExtensionFailed(key, e) from e
discord.errors.ExtensionFailed: Extension 'core.stablecog' raised an error: TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType

it is solved by setting .env DIR = outputs

Linux Support

Could you include a bash script in addition to the .bat so this can be easily run on a Linux machine?

Error on local host

Forgive me if its a fucky-wucky by me, I followed the install/use steps and its throwing this error

aiyabot-main\env\lib\site-packages\requests\sessions.py", line 792, in get_adapter
    raise InvalidSchema(f"No connection adapters were found for {url!r}")
requests.exceptions.InvalidSchema: No connection adapters were found for '192.168.100.105:7860/login'

it is worth mentioning that 192.168.100.105:7860/login shows "Method Not Allowed"

[Feature request] "respond with X to delete the message"

It would be really great to have an ability to order the bot to delete a created image from the chat.
very important in cases when the created image has explicit content not allowed by TOS of discord.

Just a simple "note" when the bot is posting an image with the hint "react with X to delete created picture"
and under it the wanted reaction a user can click.
Have seen it working perfectly on another bot.

Like that:

reactwithXtodelete

bot should reply to message where it lists options

The bot should both ping the user who made the request as well as reply to its original message where it confirms the request and lists the settings. This would make it easier to discern which prompt/options resulted in the image, for instance when sending many different prompts in the same channel.

index error out of range when using ๐Ÿ–‹๏ธ

Getting reports of an error with recent PR #81

Something like:

pen[3] = [k for k, v in settings.global_var.simple_model_pairs.items() if v == fixed_short][0]
an index error out of range

The root of this issue comes from my poor handling of the models.csv

Currently the preferred way to populate models.csv is "simple" way as added with PR #68 (details there); that is, no file extension nor hash

That said, I need to support each method of models.csv format.
Will look into this later

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.