Comments (6)
Hi, HIRES fix is something that I have not considered when developing this. Due to the engine having to be swapped in and out the overhead overshadows all performance gains.
This is something I need to address, but this will take some time.
from stable-diffusion-webui-tensorrt.
Ok I found a post that tells that we have to generate a specific profile for the target resolution if we use HIRES FIX.
Otherwise the generation will fail.
So if I disable HIRES FIX, that I always use, the generation works and I see an improvement from 14 it/s to 23 it/s with my 4070 TI.
But ... if I enable HIRES FIX to upscale 512 x 768 image to 1024 x 1536, even after the genration of a dedicated profile for 1024*1536, the generation speed does not increase by much (18.7 sec vs 17.9 sec using 150 sampling steps to better check the speed).
The iterations increses to 23 from 14 again but something works wrong appartently ...
The hires fix speed does not increase at all.
See console messages below (it seems like it is using the wrong profile ???) :
_0%| | 0/150 [00:00<?, ?it/s]Loading TensorRT engine: F:\A1111\stable-diffusion-webui\models\Unet-trt\SD_cyberrealistic_v33_82b0d085_cc89_sample=1x4x64x64+2x4x64x64+8x4x96x96-timesteps=1+2+8-encoder_hidden_states=1x77x768+2x77x768+8x154x768.trt | 0/10 [00:00<?, ?it/s]
[I] Loading bytes from F:\A1111\stable-diffusion-webui\models\Unet-trt\SD_cyberrealistic_v33_82b0d085_cc89_sample=1x4x64x64+2x4x64x64+8x4x96x96-timesteps=1+2+8-encoder_hidden_states=1x77x768+2x77x768+8x154x768.trt
Profile 0:
sample = [(1, 4, 64, 64), (2, 4, 64, 64), (8, 4, 96, 96)]
timesteps = [(1,), (2,), (8,)]
encoder_hidden_states = [(1, 77, 768), (2, 77, 768), (8, 154, 768)]
latent = [(-1945884672), (-1945884160), (-1945878668)]
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 150/150 [00:09<00:00, 15.65it/s]
0%| | 0/10 [00:00<?, ?it/s]Loading TensorRT engine: F:\A1111\stable-diffusion-webui\models\Unet-trt\SD_cyberrealistic_v33_82b0d085_cc89_sample=2x4x192x128-timesteps=2-encoder_hidden_states=2x77x768.trt
[I] Loading bytes from F:\A1111\stable-diffusion-webui\models\Unet-trt\SD_cyberrealistic_v33_82b0d085_cc89_sample=2x4x192x128-timesteps=2-encoder_hidden_states=2x77x768.trt
Profile 0:
sample = [(2, 4, 192, 128), (2, 4, 192, 128), (2, 4, 192, 128)]
timesteps = [(2,), (2,), (2,)]
encoder_hidden_states = [(2, 77, 768), (2, 77, 768), (2, 77, 768)]
latent = [(2, 4, 192, 128), (2, 4, 192, 128), (2, 4, 192, 128)]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:04<00:00, 2.23it/s]
Total progress: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 160/160 [00:18<00:00, 8.83it/s]
Total progress: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 160/160 [00:18<00:00, 3.25it/s]_
from stable-diffusion-webui-tensorrt.
Maybe it can fall back to not using the tensorrt engine automatically if no matching profile found? Faster trt first pass, normal hires fix, faster trt adetailer inpainting. In the spirit of quality over quantity. :)
from stable-diffusion-webui-tensorrt.
@tyen0 The limiting factor is reloading weights. Torch and TensorRT use different memory pools. Therefore you wouldn't see any performance benefit from that...
from stable-diffusion-webui-tensorrt.
The dev branch contains a fix for the engine selection heuristic. It will now try to select an engine that covers both the hi and lowres. If it can't it will inform the user.
Please not that this is still WIP and might have some bugs.
from stable-diffusion-webui-tensorrt.
Ok I found a post that tells that we have to generate a specific profile for the target resolution if we use HIRES FIX. Otherwise the generation will fail.
So if I disable HIRES FIX, that I always use, the generation works and I see an improvement from 14 it/s to 23 it/s with my 4070 TI.
But ... if I enable HIRES FIX to upscale 512 x 768 image to 1024 x 1536, even after the genration of a dedicated profile for 1024*1536, the generation speed does not increase by much (18.7 sec vs 17.9 sec using 150 sampling steps to better check the speed). The iterations increses to 23 from 14 again but something works wrong appartently ... The hires fix speed does not increase at all.
See console messages below (it seems like it is using the wrong profile ???) :
_0%| | 0/150 [00:00<?, ?it/s]Loading TensorRT engine: F:\A1111\stable-diffusion-webui\models\Unet-trt\SD_cyberrealistic_v33_82b0d085_cc89_sample=1x4x64x64+2x4x64x64+8x4x96x96-timesteps=1+2+8-encoder_hidden_states=1x77x768+2x77x768+8x154x768.trt | 0/10 [00:00<?, ?it/s] [I] Loading bytes from F:\A1111\stable-diffusion-webui\models\Unet-trt\SD_cyberrealistic_v33_82b0d085_cc89_sample=1x4x64x64+2x4x64x64+8x4x96x96-timesteps=1+2+8-encoder_hidden_states=1x77x768+2x77x768+8x154x768.trt Profile 0: sample = [(1, 4, 64, 64), (2, 4, 64, 64), (8, 4, 96, 96)] timesteps = [(1,), (2,), (8,)] encoder_hidden_states = [(1, 77, 768), (2, 77, 768), (8, 154, 768)] latent = [(-1945884672), (-1945884160), (-1945878668)]
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 150/150 [00:09<00:00, 15.65it/s] 0%| | 0/10 [00:00<?, ?it/s]Loading TensorRT engine: F:\A1111\stable-diffusion-webui\models\Unet-trt\SD_cyberrealistic_v33_82b0d085_cc89_sample=2x4x192x128-timesteps=2-encoder_hidden_states=2x77x768.trt [I] Loading bytes from F:\A1111\stable-diffusion-webui\models\Unet-trt\SD_cyberrealistic_v33_82b0d085_cc89_sample=2x4x192x128-timesteps=2-encoder_hidden_states=2x77x768.trt Profile 0: sample = [(2, 4, 192, 128), (2, 4, 192, 128), (2, 4, 192, 128)] timesteps = [(2,), (2,), (2,)] encoder_hidden_states = [(2, 77, 768), (2, 77, 768), (2, 77, 768)] latent = [(2, 4, 192, 128), (2, 4, 192, 128), (2, 4, 192, 128)]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:04<00:00, 2.23it/s] Total progress: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 160/160 [00:18<00:00, 8.83it/s] Total progress: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 160/160 [00:18<00:00, 3.25it/s]_
this problem still exits
The dev branch contains a fix for the engine selection heuristic. It will now try to select an engine that covers both the hi and lowres. If it can't it will inform the user.
Please not that this is still WIP and might have some bugs.
even switch to the dev branch and reinstall the extension
from stable-diffusion-webui-tensorrt.
Related Issues (20)
- how to generate json config file in the LoRA tab. HOT 1
- [branch: Controlnet_V2] ONNX IR model version conflict, how do i downgrade?
- [E] 3: getPluginCreator could not find plugin: InstanceNormalization_TRT version: 1 when building engine with latest TRT_VERSION="10.0.0b6"
- No config file found for You can generate it in the LoRA tab. HOT 3
- Advise to add promt token check in warning report
- [Feature Request] Add a Command Line Interface for the exporter process.
- AttributeError: 'tensorrt_bindings.tensorrt.ICudaEngine' object has no attribute 'get_profile_shape' HOT 2
- How to process a batch of images with ControlNet TensorRT in img2img ?
- Latest version of automatic1111 wont start with this extension installed. HOT 2
- AttributeError: 'NoneType' object has no attribute 'device_memory' HOT 12
- Error Code 3: API Usage Error (Parameter check failed
- Export LoRA to onnx depending on cyberrealistic_v31 can't fit to v1-5-pruned-emaonly_cnet_1846e6c3c239531e.trt
- TensorRT doesn't install on fresh A1111 install on Ubuntu, stuck at install after copy/paste de git link HOT 10
- TensorRT doesn't find Loras from subdirectories HOT 2
- TensorTR extension is building engine with wrong parameters
- may a name mistake in beta version (utilities.py)
- Engines not loading with text size larger than 75 HOT 1
- SD3 TensoRRT (sd3-clip-t5xxlfp8) works perfectly but cannot get SDXL ... HOT 1
- ONNX Export Error: Tensors on Different Devices (CPU and CUDA) HOT 1
- ValueError: __len__() should return >= 0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stable-diffusion-webui-tensorrt.