Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image generation don't work #7

Closed
vasmarfas opened this issue Jun 20, 2023 · 7 comments
Closed

Image generation don't work #7

vasmarfas opened this issue Jun 20, 2023 · 7 comments

Comments

@vasmarfas
Copy link
Contributor

I started the bot.
Sent the /img command
Sent the prompt (cat)
Chose style (Imagine V3)
Selected ratio (1x1)

And nothing happened in tg-bot. But in the terminal i see this:
2023-06-20 17:16:29,810 (async_telebot.py:566 MainThread) INFO - TeleBot: "Received 1 new updates"
An error occurred while making the request: 400, message='Bad Request', url=URL('https://inferenceengine.vyro.ai/sdprem')
An error occurred while writing the image to file: a bytes-like object is required, not 'NoneType'
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0xffff606b6140>
Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0xffff606d4be0>, 458942.560470698)]']
connector: <aiohttp.connector.TCPConnector object at 0xffff606b61d0>
2023-06-20 17:16:30,162 (async_telebot.py:542 MainThread) ERROR - TeleBot: "expected str, bytes or os.PathLike object, not NoneType"

How to fix this?

@noes14155
Copy link
Owner

Yes imaginepy API is down. I am looking for an alternative

@noes14155
Copy link
Owner

Fixed

@vasmarfas
Copy link
Contributor Author

If i try to generate img, i get this error in terminal
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-68' coro=<Dispatcher._process_polling_updates() done, defined at /usr/local/lib/python3.10/dist-packages/aiogram/dispatcher/dispatcher.py:407> exception=TypeError('AsyncImagine.init() takes 1 positional argument but 2 were given')>
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/aiogram/dispatcher/dispatcher.py", line 415, in _process_polling_updates
for responses in itertools.chain.from_iterable(await self.process_updates(updates, fast)):
File "/usr/local/lib/python3.10/dist-packages/aiogram/dispatcher/dispatcher.py", line 235, in process_updates
return await asyncio.gather(*tasks)
File "/usr/local/lib/python3.10/dist-packages/aiogram/dispatcher/handler.py", line 117, in notify
response = await handler_obj.handler(*args, **partial_data)
File "/usr/local/lib/python3.10/dist-packages/aiogram/dispatcher/dispatcher.py", line 256, in process_update
return await self.message_handlers.notify(update.message)
File "/usr/local/lib/python3.10/dist-packages/aiogram/dispatcher/handler.py", line 117, in notify
response = await handler_obj.handler(*args, **partial_data)
File "/home/ubuntu/Telegrambot-with-GPT4free/main.py", line 200, in generate_image
filename = await text_task
File "/home/ubuntu/Telegrambot-with-GPT4free/bot/botmedia.py", line 43, in generate_image
imagine = AsyncImagine(style_enum)
TypeError: AsyncImagine.init() takes 1 positional argument but 2 were given

@noes14155
Copy link
Owner

update imaginepy from github https://github.com/ItsCEED/Imaginepy. I already updated the requirements.txt

@vasmarfas
Copy link
Contributor Author

I have latest (1.1.0) imaginepy, tried to pip3 install -r requirements.txt, but problem is still here

@noes14155
Copy link
Owner

pip install won't work as imaginepy pypi package is not updated.
pip uninstall imaginepy
git clone https://github.com/ItsCEED/Imaginepy
cd Imaginepy
python setup.py install

@vasmarfas
Copy link
Contributor Author

vasmarfas commented Jun 30, 2023

Got imaginepy from github
Got this error in console

ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-23' coro=<Dispatcher._process_polling_updates() done, defined at /usr/local/lib/python3.1                            0/dist-packages/aiogram/dispatcher/dispatcher.py:407> exception=ConnectionError("An error occurred while making the request                            : 404, message='Not Found', url=URL('https://inferenceengine.vyro.ai/sdprem')")>
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/imaginepy-1.1.0-py3.10.egg/imaginepy/async_imagine.py", line 78, in sdprem
    async with self.session.post(
  File "/usr/local/lib/python3.10/dist-packages/aiohttp/client.py", line 1141, in __aenter__
    self._resp = await self._coro
  File "/usr/local/lib/python3.10/dist-packages/aiohttp/client.py", line 643, in _request
    resp.raise_for_status()
  File "/usr/local/lib/python3.10/dist-packages/aiohttp/client_reqrep.py", line 1005, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found', url=URL('https://inferenceengine.vyro.ai/sdprem')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/aiogram/dispatcher/dispatcher.py", line 415, in _process_polling_updates
    for responses in itertools.chain.from_iterable(await self.process_updates(updates, fast)):
  File "/usr/local/lib/python3.10/dist-packages/aiogram/dispatcher/dispatcher.py", line 235, in process_updates
    return await asyncio.gather(*tasks)
  File "/usr/local/lib/python3.10/dist-packages/aiogram/dispatcher/handler.py", line 117, in notify
    response = await handler_obj.handler(*args, **partial_data)
  File "/usr/local/lib/python3.10/dist-packages/aiogram/dispatcher/dispatcher.py", line 256, in process_update
    return await self.message_handlers.notify(update.message)
  File "/usr/local/lib/python3.10/dist-packages/aiogram/dispatcher/handler.py", line 117, in notify
    response = await handler_obj.handler(*args, **partial_data)
  File "/home/ubuntu/Telegrambot-with-GPT4free/main.py", line 184, in generate_image
    filename = await text_task
  File "/home/ubuntu/Telegrambot-with-GPT4free/bot/botmedia.py", line 46, in generate_image
    img_data = await imagine.sdprem(
  File "/usr/local/lib/python3.10/dist-packages/imaginepy-1.1.0-py3.10.egg/imaginepy/async_imagine.py", line 95, in sdprem
    raise ConnectionError(f"An error occurred while making the request: {e}")
ConnectionError: An error occurred while making the request: 404, message='Not Found', url=URL('https://inferenceengine.vyr                            o.ai/sdprem')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants