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

Document that “engines” (unets) must be generated for each combination of checkpoint & LoRA #20

Closed
zopieux opened this issue Oct 17, 2023 · 5 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@zopieux
Copy link

zopieux commented Oct 17, 2023

It's not clear from the README that an “engine” must be generated for:

  • every single checkpoint (aka model) that one wants to use
  • in the case of LoRAs, every single LoRA that one wants to use multiplied by every single checkpoint, which can quickly become a large number.

Explaining this in the README and help text in the extension UI would be nice.

@FizzleDorf
Copy link

this should go a little bit further and explain this needs to be done every time you change LoRA weights as well.

@prusswan
Copy link

not sure if the Lora weights are properly applied. I am getting very different results using the TRT version of the Lora model, when compared to the normal version (e.g. <lora:some_model:0.6>).

@devjo
Copy link

devjo commented Oct 25, 2023

If you specify <lora:some_model:0.6> on a checkpoint for which you also have a TensorRT compiled unet that you produced with some_model, then you'll effectively get <lora:some_model:1.6>.
The initial fusing of a lora weights with the checkpoints at TensorRT compilation (generation) time adds some_model at strength 1.0 already to the checkpoint weights, so keeping the <lora:...> expression in the prompt will make the same weights be multiplied again. This is Not what you want.

Just don't specify the <lora:...> bit when using the TensorRT compiled unets and you'll get the lora effect applied anyway, as if you had used the angle bracket syntax <lora:some_model:1.0>.

PS. If you want to fuse the lora with the checkpoint at a strength other than 1.0, a workaround for now is to fuse the lora with the checkpoint manually before doing the checkpoint -> tensorrt conversion. Example.

@prusswan
Copy link

prusswan commented Nov 5, 2023

@devjo thanks for this clarification, hopefully this will go into the documentation

@bigmover
Copy link

If you specify <lora:some_model:0.6> on a checkpoint for which you also have a TensorRT compiled unet that you produced with some_model, then you'll effectively get <lora:some_model:1.6>. The initial fusing of a lora weights with the checkpoints at TensorRT compilation (generation) time adds some_model at strength 1.0 already to the checkpoint weights, so keeping the <lora:...> expression in the prompt will make the same weights be multiplied again. This is Not what you want.

Just don't specify the <lora:...> bit when using the TensorRT compiled unets and you'll get the lora effect applied anyway, as if you had used the angle bracket syntax <lora:some_model:1.0>.

PS. If you want to fuse the lora with the checkpoint at a strength other than 1.0, a workaround for now is to fuse the lora with the checkpoint manually before doing the checkpoint -> tensorrt conversion. Example.

I found the lora "compile" with model A can't be used for model B. Would you mind to share how you solve it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants