ahrm / UnstableFusion

A Stable Diffusion desktop frontend with inpainting, img2img and more!
GNU General Public License v3.0
1.26k stars 84 forks source link

Getting this error when I try to generate an image. I'm on arch linux. #39

Closed PistachioGuy closed 1 year ago

PistachioGuy commented 2 years ago

Traceback (most recent call last): File "/home/boi/.local/lib/python3.10/site-packages/huggingface_hub/utils/_errors.py", line 213, in hf_raise_for_status response.raise_for_status() File "/usr/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/fp16/model_index.json

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

Traceback (most recent call last): File "/home/boi/.local/lib/python3.10/site-packages/diffusers/configuration_utils.py", line 228, in get_config_dict config_file = hf_hub_download( File "/home/boi/.local/lib/python3.10/site-packages/huggingface_hub/file_download.py", line 1053, in hf_hub_download metadata = get_hf_file_metadata( File "/home/boi/.local/lib/python3.10/site-packages/huggingface_hub/file_download.py", line 1359, in get_hf_file_metadata hf_raise_for_status(r) File "/home/boi/.local/lib/python3.10/site-packages/huggingface_hub/utils/_errors.py", line 254, in hf_raise_for_status raise HfHubHTTPError(str(HTTPError), response=response) from e huggingface_hub.utils._errors.HfHubHTTPError: <class 'requests.exceptions.HTTPError'> (Request ID: Nk1158C9LHrkTH1ybJVBC)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/boi/UnstableFusion/unstablefusion.py", line 897, in handle_generate_button if type(self.get_handler()) == ServerStableDiffusionHandler: File "/home/boi/UnstableFusion/unstablefusion.py", line 460, in get_handler return self.stable_diffusion_manager.get_handler() File "/home/boi/UnstableFusion/unstablefusion.py", line 329, in get_handler return self.get_local_handler(self.get_huggingface_token()) File "/home/boi/UnstableFusion/unstablefusion.py", line 312, in get_local_handler self.cached_local_handler = StableDiffusionHandler(token) File "/home/boi/UnstableFusion/diffusionserver.py", line 33, in init self.text2img = StableDiffusionPipeline.from_pretrained( File "/home/boi/.local/lib/python3.10/site-packages/diffusers/pipeline_utils.py", line 431, in from_pretrained config_dict = cls.get_config_dict( File "/home/boi/.local/lib/python3.10/site-packages/diffusers/configuration_utils.py", line 260, in get_config_dict raise EnvironmentError( OSError: There was a specific connection error when trying to load runwayml/stable-diffusion-v1-5: <class 'requests.exceptions.HTTPError'> (Request ID: Nk1158C9LHrkTH1ybJVBC)

ahrm commented 2 years ago

You need to accept the license agreement in the model's page here: https://huggingface.co/runwayml/stable-diffusion-v1-5

PistachioGuy commented 2 years ago

Thank you, that fixed it. But not it says i need cuda, is it at all possible to use this on an AMD gpu or do i need nvidia?

ahrm commented 2 years ago

You need nvidia (you can run the server on a google colba though).

PistachioGuy commented 2 years ago

So i would have to host it on a nvidia device? or are there any existing servers i can use?

ahrm commented 2 years ago

Yes, there is documentation here: https://github.com/ahrm/UnstableFusion#how-to-run-using-colab-servers

PistachioGuy commented 2 years ago

now im getting this error on the colab:

100% 31/31 [00:08<00:00, 3.79it/s]

ERROR:UnstableFusion.diffusionserver:Exception on /generate [POST] Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 2447, in wsgi_app response = self.full_dispatch_request() File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1952, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1821, in handle_user_exception reraise(exc_type, exc_value, tb) File "/usr/local/lib/python3.7/dist-packages/flask/_compat.py", line 39, in reraise raise value File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1950, in full_dispatch_request rv = self.dispatch_request() File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1936, in dispatch_request return self.view_functionsrule.endpoint File "/content/UnstableFusion/diffusionserver.py", line 255, in generate use_gfp=use_gfp) File "/content/UnstableFusion/diffusionserver.py", line 132, in generate return im.resize((width, height), resample=Image.Resampling.LANCZOS) File "/usr/local/lib/python3.7/dist-packages/PIL/Image.py", line 61, in getattr raise AttributeError("module '{}' has no attribute '{}'".format(name, name)) AttributeError: module 'PIL.Image' has no attribute 'Resampling' INFO:werkzeug:127.0.0.1 - - [08/Nov/2022 12:35:00] "POST /generate HTTP/1.1" 500 -

and this error on the client side:

Traceback (most recent call last): File "/home/boi/UnstableFusion/unstablefusion.py", line 899, in handle_generate_button image = await self.get_handler().generate(prompt, File "/home/boi/UnstableFusion/unstablefusion.py", line 273, in generate resp_data = resp.json() File "/home/boi/.local/lib/python3.10/site-packages/httpx/_models.py", line 743, in json return jsonlib.loads(self.text, **kwargs) File "/usr/lib/python3.10/json/init.py", line 346, in loads return _default_decoder.decode(s) File "/usr/lib/python3.10/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.10/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)

ahrm commented 2 years ago

Should be fixed in the latest commits.

PistachioGuy commented 2 years ago

I'll try it, thanks.