Giter Site home page Giter Site logo

Document that “engines” (unets) must be generated for each combination of checkpoint & LoRA about stable-diffusion-webui-tensorrt HOT 5 CLOSED

nvidia avatar nvidia commented on July 21, 2024 2
Document that “engines” (unets) must be generated for each combination of checkpoint & LoRA

from stable-diffusion-webui-tensorrt.

Comments (5)

devjo avatar devjo commented on July 21, 2024 1

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.

from stable-diffusion-webui-tensorrt.

FizzleDorf avatar FizzleDorf commented on July 21, 2024

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

from stable-diffusion-webui-tensorrt.

prusswan avatar prusswan commented on July 21, 2024

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>).

from stable-diffusion-webui-tensorrt.

prusswan avatar prusswan commented on July 21, 2024

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

from stable-diffusion-webui-tensorrt.

bigmover avatar bigmover commented on July 21, 2024

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?

from stable-diffusion-webui-tensorrt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.