FahimF / sd-gui

Clean and simple Stable Diffusion GUI for macOS, Windows, and Linux
MIT License
230 stars 17 forks source link

TypeError: __init__() got an unexpected keyword argument 'device_map' #21

Closed dnlbrv closed 1 year ago

dnlbrv commented 1 year ago

Hello, in advance congrats for the hard work. I install everything on my M1 max, everything is fine and the GUI opens, but when I hit the Build button the window closes and gives me this error:

(ml) dnlbrv@dMBP16 sd-gui % python app.py Output folder exists Type: GeneratorType.txt2img Scheduler: Default Prompt: a car in the sky Width: 512 Height: 64 Strength: 0.6 Num Stpes: 99 Guidance: 8.0 Copies: 1 Seed: -1 Traceback (most recent call last): File "/Users/dnlbrv/Stable Difusion GUI/sd-gui/ui/generator_tab.py", line 393, in do_generate self.sd = self.get_server(self.server_type.value()) File "/Users/dnlbrv/Stable Difusion GUI/sd-gui/ui/base_tab.py", line 70, in get_server return SDEngine(self.cfg.type, self.cfg.scheduler, self.cfg.num_inference_steps) File "/Users/dnlbrv/Stable Difusion GUI/sd-gui/tools/sd_engine.py", line 48, in init self.pipe = StableDiffusionPipeline.from_pretrained("stable-diffusion-v1-4").to(self.device) File "/Users/dnlbrv/miniconda3/envs/ml/lib/python3.9/site-packages/diffusers/pipeline_utils.py", line 517, in from_pretrained loaded_sub_model = load_method(os.path.join(cached_folder, name), *loading_kwargs) File "/Users/dnlbrv/miniconda3/envs/ml/lib/python3.9/site-packages/transformers/modeling_utils.py", line 1843, in from_pretrained model = cls(config, model_args, **model_kwargs) TypeError: init() got an unexpected keyword argument 'device_map' zsh: abort python app.py

Any idea? Thanxs a lot

FahimF commented 1 year ago

Yes, this is due to a bug in the latest version of diffusers. See the issue report here: https://github.com/huggingface/diffusers/issues/852

The suggested solution is to upgrade to the latest transformers but do note that this could result in various other package issues popping up depending on what is updated and how. You'd need to know a bit about resolving these issues yourself in order to get things working.

dnlbrv commented 1 year ago

Okey, thanxs for answer.