Issue while Recreating the Service

#6
by varad17photai - opened

Traceback (most recent call last):
File "/home/ubuntu/Varad/fast_inpaint_diffusers/main.py", line 30, in
state_dict = torch.load(model_file)
File "/home/ubuntu/Varad/fast_inpaint_diffusers/venv/lib/python3.10/site-packages/torch/serialization.py", line 1114, in load
return _legacy_load(
File "/home/ubuntu/Varad/fast_inpaint_diffusers/venv/lib/python3.10/site-packages/torch/serialization.py", line 1338, in _legacy_load
magic_number = pickle_module.load(f, **pickle_load_args)
_pickle.UnpicklingError: invalid load key, '\xa0'.

I tried to run the scripts for hosting in my personal space. But I got these issue . Can you specify the torch version or if there is any issue in it ?

Owner

Hi, this shouldn't be torch dependent if its higher than 2.1 which is old. Are you using a older pytorch? The error seems more like it fails at loading the model, did you change the model?

No the script and model is exact same as for the space . Can you provide a dockerfile for this space ? Or the exact versions of the requirements used . For cloning the environment .

Owner

it has a requirements.txt with the versions for the packages that are crucial, but if it helps, the version I have that runs locally has this installed:

accelerate==0.34.2
aiofiles==23.2.1
annotated-types==0.7.0
anyio==4.5.0
certifi==2024.8.30
charset-normalizer==3.3.2
click==8.1.7
colorama==0.4.6
contourpy==1.3.0
cycler==0.12.1
diffusers==0.30.3
fastapi==0.112.4
ffmpy==0.4.0
filelock==3.13.1
fonttools==4.53.1
fsspec==2024.2.0
gradio==4.42.0
gradio_client==1.3.0
gradio_imageslider==0.0.20
h11==0.14.0
httpcore==1.0.5
httpx==0.27.2
huggingface-hub==0.25.0
idna==3.10
importlib_metadata==8.5.0
importlib_resources==6.4.5
Jinja2==3.1.3
kiwisolver==1.4.7
markdown-it-py==3.0.0
MarkupSafe==2.1.5
matplotlib==3.9.2
mdurl==0.1.2
mpmath==1.3.0
networkx==3.2.1
numpy==1.26.4
opencv-python==4.10.0.84
orjson==3.10.7
packaging==24.1
pandas==2.2.2
pillow==10.4.0
psutil==5.9.8
pydantic==2.9.2
pydantic_core==2.23.4
pydub==0.25.1
Pygments==2.18.0
pyparsing==3.1.4
python-dateutil==2.9.0.post0
python-multipart==0.0.9
pytz==2024.2
PyYAML==6.0.2
regex==2024.9.11
requests==2.32.3
rich==13.8.1
ruff==0.6.5
safetensors==0.4.5
semantic-version==2.10.0
setuptools==70.0.0
shellingham==1.5.4
six==1.16.0
sniffio==1.3.1
spaces==0.30.2
starlette==0.38.5
sympy==1.12
tokenizers==0.19.1
tomlkit==0.12.0
torch==2.4.1+cu124
tqdm==4.66.5
transformers==4.44.2
typer==0.12.5
typing_extensions==4.9.0
tzdata==2024.1
urllib3==2.2.3
uvicorn==0.30.6
websockets==12.0
zipp==3.20.2 

Thanks , Will test with these . @OzzyGT .

@OzzyGT I wanted to try this diffusers outpaint as well for this pipeline . There is a hugging face space as well for this . Why are the output sizes of multiples of 64 performing better . As I have tested the outputs of size not multiples of 64 doesnt perform good

this is just a PoC for a guide I made, I put the information in the readme and in the space. This is not a complete finalized solution. Having said that, there is no reason for it to work better with multiples of something specific , just what the model needs which I think is 8.

This should work for any aspect ratio and size of images that the base model supports (SDXL) but as this is just a PoC of a guide, I made it just for 1024x1024, if you change that size, you'll need to change the code accordingly for it to support more sizes (and they have to be multiples of 8).

Even if the image is bigger or is not a multiple of 8, with code, you can adapt it so it can also work and you just crop the result or in the case of bigger images you can use a tiled generation.

The diffusers outpaint was made by a talented person that used the knowledge of my guide to expand it, but I remember that also has some specific resolutions hard coded (and aspect ratios).

edit: Oh sorry, I didn't update this space, I updated the other spaces with the information about the guide and the PoC, thanks, I'll also update this one.

Got It . Thanks for the help mate @OzzyGT . Would Love to connect over you for stuff related to diffusion . Could you share your mail or any social media profile ? Thanks in advance .

sure, your question remind me that I haven't added those in huggingface profile. This is my twitter profile. I'm a maintainer for diffusers so I'm pretty active there and in the huggingface discord too.

Sign up or log in to comment