Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not compatible with diffusers 0.21+ [with workaround] #29

Open
eps696 opened this issue Sep 25, 2023 · 2 comments
Open

not compatible with diffusers 0.21+ [with workaround] #29

eps696 opened this issue Sep 25, 2023 · 2 comments

Comments

@eps696
Copy link

eps696 commented Sep 25, 2023

everything runs ok on diffusers version 0.20 or below, while getting this error on diffusers 0.21:

File "F:\_neuro\SDfu\lib\tokenflow.py", line 185, in denoise_step
  noise_pred = self.unet(lat_in, t, conds).sample
File "C:\Users\eps\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
  return forward_call(*args, **kwargs)
File "C:\Users\eps\AppData\Local\Programs\Python\Python39\lib\site-packages\diffusers\models\unet_2d_condition.py", line 1018, in forward
  sample = upsample_block(
File "C:\Users\eps\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
  return forward_call(*args, **kwargs)
File "C:\Users\eps\AppData\Local\Programs\Python\Python39\lib\site-packages\diffusers\models\unet_2d_blocks.py", line 2227, in forward
  hidden_states = resnet(hidden_states, temb, scale=lora_scale)
File "C:\Users\eps\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
  return forward_call(*args, **kwargs)
TypeError: forward() got an unexpected keyword argument 'scale'

i've got python 2.0.1, xformers 0.0.21 (but again, it's only diffusers version that brings this error or not).
UPD: the error is only for pnp method, sdedit works ok.

there were some similar issues on their github, maybe it helps:
huggingface/diffusers#3348
huggingface/diffusers#5028

@eps696
Copy link
Author

eps696 commented Sep 25, 2023

in fact, here is a workaround with a dummy argument:
change this line to def forward(input_tensor, temb, scale=None):

no idea if it breaks something about lora (as no idea if lora is compatible with tokenflow in general ::)

@eps696 eps696 changed the title not compatible with diffusers 0.21+ not compatible with diffusers 0.21+ [with workaround] Sep 25, 2023
@daeunni
Copy link

daeunni commented May 9, 2024

@eps696 Really helpful. Thanks! :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants