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

Compatibility with updated built-in LoRA extension #170

Closed
catboxanon opened this issue Jul 17, 2023 · 8 comments
Closed

Compatibility with updated built-in LoRA extension #170

catboxanon opened this issue Jul 17, 2023 · 8 comments

Comments

@catboxanon
Copy link
Contributor

Semi-related to #141. See AUTOMATIC1111/stable-diffusion-webui#11821 for the full details.


Currently, this extension references the multiplier attribute a lot. As of the latest dev version for the upcoming 1.5.0 release of the web UI, this has been replaced by a separate te_multiplier and unet_multiplier, as seen here: https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/a99d5708e6d603e8f7cfd1b8c6595f8026219ba0/extensions-builtin/Lora/network.py#L87-L95

From having a cursory look at the PR it also looks like there's now built-in functions like calc_scale, something that I believe is being done manually in the current extension code.

if hasattr(module, 'up'):
scale = lora_m.multiplier * (module.alpha / module.up.weight.size(1) if module.alpha else 1.0)
else:
scale = lora_m.multiplier * (module.alpha / module.dim if module.alpha else 1.0)

@hako-mikan
Copy link
Owner

Thanks for the info.
It looks like LyCORIS will be supported as well, so I will try to support it when it is officially released.

@hako-mikan
Copy link
Owner

I believe it has probably been fixed.
It worked fine in my environment with version 1.5RC.

However, there still seem to be issues with the built-in Lora code.
It appears that using the old Lora option results in an error.

@catboxanon
Copy link
Contributor Author

Working for me as of AUTOMATIC1111/stable-diffusion-webui@2f98f7c as well, thanks!

However, there still seem to be issues with the built-in Lora code.
It appears that using the old Lora option results in an error.

Is this in reference to the PR or this extension? Not sure what "old Lora option" you're referring to.

@hako-mikan
Copy link
Owner

Lora/Networks: use old method that takes longer when you have multiple Loras active and produces same results as kohya-ss/sd-webui-additional-networks extension
in settings
this options is needed for latent mode
however, its broken in 1.5RC

@catboxanon
Copy link
Contributor Author

catboxanon commented Jul 21, 2023

Ah, I see it now. Is that required though, or are you just making sure it's supported? Asking since if it is required that isn't listed in the README anywhere. I'm also not as familiar with how to use latent mode with multiple LoRAs so likely somebody else would need to chime in if they could help.

@hako-mikan
Copy link
Owner

hako-mikan commented Jul 21, 2023

It is not necessary, but it is better to use it.
With the update around version 1.3, the method of applying LoRA has changed.
This usually brings good results.
However, in cases like this extension, when changing the strength of LoRA in every steps, the generation process becomes slower.
If the issue is not resolved when 1.5 is officially released, I will report it as an issue.

@catboxanon
Copy link
Contributor Author

1.5 is already in the release candidate phase so it may be worth reporting now. There's a Discord channel too where you may be able to discuss the matter with Auto. https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Contributing

@catboxanon
Copy link
Contributor Author

@hako-mikan AUTOMATIC1111/stable-diffusion-webui#12466

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