zxix / stable-diffusion-pickle-scanner

187 stars 19 forks source link

Error: `argument of type 'functools.partial' is not iterable` #11

Open thebeline opened 1 year ago

thebeline commented 1 year ago

Scanning a friends embeddings directory and had this pop up a bit. We just pulled the embeddings that failed, and are assuming they are compromised until we find out otherwise.

Thoughts?

hal0thane commented 1 year ago

Also just encountered this error when scanning my downloaded embeddings (before moving them into place in the AUTOMATIC1111 hierarchy) on macOS Ventura 13.1. Here's the full error output if that helps:

hal0@ikigai:/Volumes/G-DRIVE/Diffusion> ./AUTOMATIC1111/venv/bin/python3 stable-diffusion-pickle-scanner/pickle_scan.py Downloaded\ embeddings >embedding_output.log
Traceback (most recent call last):
  File "/Volumes/G-DRIVE/Diffusion/stable-diffusion-pickle-scanner/pickle_scan.py", line 24, in <module>
    result = torch.load(path.as_posix(), pickle_module=pickle_inspector.pickle)
  File "/Volumes/G-DRIVE/Diffusion/AUTOMATIC1111/venv/lib/python3.10/site-packages/torch/serialization.py", line 712, in load
    return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
  File "/Volumes/G-DRIVE/Diffusion/AUTOMATIC1111/venv/lib/python3.10/site-packages/torch/serialization.py", line 1049, in _load
    result = unpickler.load()
  File "/Volumes/G-DRIVE/Diffusion/stable-diffusion-pickle-scanner/pickle_inspector.py", line 99, in load
    result.structure = super().load()
  File "/Volumes/G-DRIVE/Diffusion/stable-diffusion-pickle-scanner/pickle_inspector.py", line 67, in _call_tracer
    if attr not in self.args:
TypeError: argument of type 'functools.partial' is not iterable

The Downloaded embeddings folder and its subfolders contains 158 .pt files and 7 .bin files. In total, I had 3 .pt files (all embeddings) that caused this error.

aibaby1991 commented 1 year ago

I got this error:

...c:/stable-diffusion/embeddings/negative/bad-image-v2-39000.pt seen this file somethings not normal!!??

...c:/stable-diffusion/embeddings/negative/bad-image-v2-39000.pt

Traceback (most recent call last): File "E:\sd\pickle_scan.py", line 24, in result = torch.load(path.as_posix(), pickle_module=pickle_inspector.pickle) File "C:\Python\Python31011\lib\site-packages\torch\serialization.py", line 809, in load return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args) File "C:\Python\Python31011\lib\site-packages\torch\serialization.py", line 1172, in _load result = unpickler.load() File "E:\sd\pickle_inspector.py", line 99, in load result.structure = super().load() File "E:\sd\pickle_inspector.py", line 67, in _call_tracer if attr not in self.args: TypeError: argument of type 'functools.partial' is not iterable

Asherathe commented 4 months ago

I get this error while scanning the files in my adetailer folder. They all create this error.