yangxy / PASD

[ECCV2024] Pixel-Aware Stable Diffusion for Realistic Image Super-Resolution and Personalized Stylization
Apache License 2.0
895 stars 61 forks source link

TypeError: load_checkpoint_and_dispatch() got an unexpected keyword argument 'force_hooks' #67

Open RC-Hong opened 2 months ago

RC-Hong commented 2 months ago

Run python test_pasd_sdxl.py Traceback (most recent call last): File "D:\PASD\test_pasd_sdxl.py", line 319, in main(args) File "D:\PASD\test_pasd_sdxl.py", line 206, in main pipeline, refiner_pipeline = load_pasd_pipeline(args, accelerator, enable_xformers_memory_efficient_attention) File "D:\PASD\test_pasd_sdxl.py", line 59, in load_pasd_pipeline unet = UNet2DConditionModel.from_pretrained(f"{args.pasd_model_path}/unet") File "D:\python\lib\site-packages\huggingface_hub\utils_validators.py", line 114, in _inner_fn return fn(*args, **kwargs) File "D:\python\lib\site-packages\diffusers\models\modeling_utils.py", line 774, in from_pretrained accelerate.load_checkpoint_and_dispatch( TypeError: load_checkpoint_and_dispatch() got an unexpected keyword argument 'force_hooks'

=============================

And edit gradio_pasd.py to pretrained_model_path = "checkpoints/stable-diffusion-xl-base-1.0" #stable-diffusion-v1-5" ckpt_path = "runs/pasd_sdxl/checkpoint-200000" #pasd/checkpoint-100000" dreambooth_lora_path = "checkpoints/personalized_models/sdxl_lcm_lora.safetensors" #majicmixRealistic_v6.safetensors"

feature_extractor = CLIPImageProcessor.from_pretrained(f"{pretrained_model_path}/feature_extractor")

Run python gradio_pasd.py D:\python\lib\site-packages\torchvision\models_utils.py:208: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and may be removed in the future, please use 'weights' instead. warnings.warn( D:\python\lib\site-packages\torchvision\models_utils.py:223: UserWarning: Arguments other than a weight enum or None for 'weights' are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passing weights=None. warnings.warn(msg) Traceback (most recent call last): File "D:\PASD\gradio_pasd.py", line 43, in unet = UNet2DConditionModel.from_pretrained(ckpt_path, subfolder="unet") File "D:\python\lib\site-packages\huggingface_hub\utils_validators.py", line 114, in _inner_fn return fn(*args, **kwargs) File "D:\python\lib\site-packages\diffusers\models\modeling_utils.py", line 774, in from_pretrained accelerate.load_checkpoint_and_dispatch( TypeError: load_checkpoint_and_dispatch() got an unexpected keyword argument 'force_hooks'

yangxy commented 2 months ago

Update diffusers to the latest version.

RC-Hong commented 2 months ago

installed diffusers-0.30.2 but still TypeError: load_checkpoint_and_dispatch() got an unexpected keyword argument 'force_hooks'

yangxy commented 2 months ago

Update accelerate to the latest version.