FoooXus-Fooocus-Extender icon indicating copy to clipboard operation
FoooXus-Fooocus-Extender copied to clipboard

Generate Image API not working with Foocus 2.5.5 after update

Open TriptSharma opened this issue 4 months ago • 1 comments

I am passing the encoded empty value (from https://github.com/toutjavascript/FoooXus-Fooocus-Extender/blob/main/src/api.py#L39) as an api call from my local system to the colab hosted gradio app. However, it's giving me the following error:

  File "<string>", line 1, in <module>
  File "c:\work\gen-pipe\gen-env\Lib\site-packages\gradio_client\client.py", line 468, in predict
    ).result()
      ^^^^^^^^
  File "c:\work\gen-pipe\gen-env\Lib\site-packages\gradio_client\client.py", line 1499, in result
    return super().result(timeout=timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\concurrent\futures\_base.py", line 456, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\concurrent\futures\_base.py", line 401, in __get_result
    raise self._exception
  File "C:\Python311\Lib\concurrent\futures\thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\work\gen-pipe\gen-env\Lib\site-packages\gradio_client\compatibility.py", line 63, in _inner
    data = self.serialize(*data)
           ^^^^^^^^^^^^^^^^^^^^^
  File "c:\work\gen-pipe\gen-env\Lib\site-packages\gradio_client\compatibility.py", line 244, in serialize
    o = tuple([s.serialize(d) for s, d in zip(self.serializers, data)])
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\work\gen-pipe\gen-env\Lib\site-packages\gradio_client\compatibility.py", line 244, in <listcomp>
    o = tuple([s.serialize(d) for s, d in zip(self.serializers, data)])
               ^^^^^^^^^^^^^^
  File "c:\work\gen-pipe\gen-env\Lib\site-packages\gradio_client\serializing.py", line 188, in serialize
    return utils.encode_file_to_base64(Path(load_dir) / x)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\work\gen-pipe\gen-env\Lib\site-packages\gradio_client\utils.py", line 689, in encode_file_to_base64
    with open(f, "rb") as file:
         ^^^^^^^^^^^^^
OSError: [Errno 22] Invalid argument: 'data:image\\png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg=='

TriptSharma avatar Oct 04 '24 12:10 TriptSharma