mak448a / AI-Drawing-Chatbot

An image generator Discord bot written in Python with no GPU requirement! It can be easily deployed to your favorite VPS for hosting.
MIT License
28 stars 5 forks source link

Chatbot drawing sometimes breaks #57

Closed guguxh closed 1 year ago

guguxh commented 1 year ago

Describe the bug Tried to generate image using gpt draw thing and can't.

To Reproduce Just type "Draw a XXXX" where XXXX is your prompt, then your bot will try to make the request to the horde, and wait wait wait then you get into a loop that doesnt end.

Expected behavior Generate the image without any error

Screenshots

  File "C:\Users\GUILHERME\Desktop\terraria\gta\Discord\AI-Drawing-ChatBot\main.py", line 254, in <module>
    bot.run(bot_token)
  File "C:\Users\GUILHERME\Desktop\terraria\gta\Discord\AI-Drawing-ChatBot\venv\lib\site-packages\discord\client.py", line 860, in run
    asyncio.run(runner())
  File "C:\Users\GUILHERME\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "C:\Users\GUILHERME\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 636, in run_until_complete
    self.run_forever()
  File "C:\Users\GUILHERME\AppData\Local\Programs\Python\Python310\lib\asyncio\windows_events.py", line 321, in run_forever
    super().run_forever()
  File "C:\Users\GUILHERME\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 603, in run_forever
    self._run_once()
  File "C:\Users\GUILHERME\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 1906, in _run_once
    handle._run()
  File "C:\Users\GUILHERME\AppData\Local\Programs\Python\Python310\lib\asyncio\events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "C:\Users\GUILHERME\Desktop\terraria\gta\Discord\AI-Drawing-ChatBot\venv\lib\site-packages\discord\client.py", line 441, in _run_event
    await coro(*args, **kwargs)
  File "C:\Users\GUILHERME\Desktop\terraria\gta\Discord\AI-Drawing-ChatBot\main.py", line 91, in on_message
    await imagine_horde(
  File "C:\Users\GUILHERME\Desktop\terraria\gta\Discord\AI-Drawing-ChatBot\venv\lib\site-packages\discord\ext\commands\core.py", line 590, in __call__
    return await self.callback(context, *args, **kwargs)  # type: ignore
  File "C:\Users\GUILHERME\Desktop\terraria\gta\Discord\AI-Drawing-ChatBot\main.py", line 120, in imagine_horde
    image_files, images = await generate_with_stable_horde(
  File "C:\Users\GUILHERME\Desktop\terraria\gta\Discord\AI-Drawing-ChatBot\image_generation_utils.py", line 18, in generate_with_stable_horde
    await horde_generator.generate(prompt, api_key, f"{file_uuid}.png", 4,
  File "C:\Users\GUILHERME\Desktop\terraria\gta\Discord\AI-Drawing-ChatBot\horde_module\__init__.py", line 152, in generate
    img_data = requests.get(results[iter]["img"]).content
  File "C:\Users\GUILHERME\Desktop\terraria\gta\Discord\AI-Drawing-ChatBot\venv\lib\site-packages\requests\api.py", line 73, in get
    return request("get", url, params=params, **kwargs)
  File "C:\Users\GUILHERME\Desktop\terraria\gta\Discord\AI-Drawing-ChatBot\venv\lib\site-packages\requests\api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
  File "C:\Users\GUILHERME\Desktop\terraria\gta\Discord\AI-Drawing-ChatBot\venv\lib\site-packages\requests\sessions.py", line 587, in request
    resp = self.send(prep, **send_kwargs)
  File "C:\Users\GUILHERME\Desktop\terraria\gta\Discord\AI-Drawing-ChatBot\venv\lib\site-packages\requests\sessions.py", line 701, in send
    r = adapter.send(request, **kwargs)
  File "C:\Users\GUILHERME\Desktop\terraria\gta\Discord\AI-Drawing-ChatBot\venv\lib\site-packages\requests\adapters.py", line 489, in send
    resp = conn.urlopen(
  File "C:\Users\GUILHERME\Desktop\terraria\gta\Discord\AI-Drawing-ChatBot\venv\lib\site-packages\urllib3\connectionpool.py", line 714, in urlopen
    httplib_response = self._make_request(
  File "C:\Users\GUILHERME\Desktop\terraria\gta\Discord\AI-Drawing-ChatBot\venv\lib\site-packages\urllib3\connectionpool.py", line 403, in _make_request
    self._validate_conn(conn)
  File "C:\Users\GUILHERME\Desktop\terraria\gta\Discord\AI-Drawing-ChatBot\venv\lib\site-packages\urllib3\connectionpool.py", line 1053, in _validate_conn
    conn.connect()
  File "C:\Users\GUILHERME\Desktop\terraria\gta\Discord\AI-Drawing-ChatBot\venv\lib\site-packages\urllib3\connection.py", line 363, in connect
    self.sock = conn = self._new_conn()
  File "C:\Users\GUILHERME\Desktop\terraria\gta\Discord\AI-Drawing-ChatBot\venv\lib\site-packages\urllib3\connection.py", line 174, in _new_conn
    conn = connection.create_connection(
  File "C:\Users\GUILHERME\Desktop\terraria\gta\Discord\AI-Drawing-ChatBot\venv\lib\site-packages\urllib3\util\connection.py", line 85, in create_connection
    sock.connect(sa)

Desktop (please complete the following information):

mak448a commented 1 year ago

I cannot reproduce this. Do you have the latest version of the GitHub repository?

This is while generating

image

This is after generating finishes

image

guguxh commented 1 year ago

I cannot reproduce this. Do you have the latest version of the GitHub repository?

This is while generating

image

This is after generating finishes

image

sure I have

mak448a commented 1 year ago

Not sure what could be causing this. Could you send a screenshot of the message on Discord and the full output log?

mishl-dev commented 1 year ago

this is why you use docker

guguxh commented 1 year ago

Not sure what could be causing this. Could you send a screenshot of the message on Discord and the full output log?

I just type "draw a picture of a girl holding a fruit", thing like that and then I get a infinite loop, this happen just sometimes, rare case but exists

mishl-dev commented 1 year ago

waow

mak448a commented 1 year ago

I think this is fixed. Reopen if it's not.