MCPcopy Index your code
hub / github.com/NVIDIA/Stable-Diffusion-WebUI-TensorRT / add_entry

Method add_entry

model_manager.py:103–136  ·  view source on GitHub ↗
(
        self,
        model_name,
        model_hash,
        profile,
        static_shapes,
        fp32,
        inpaint,
        refit,
        vram,
        unet_hidden_dim,
        lora,
    )

Source from the content-addressed store, hash-verified

101 self.update()
102
103 def add_entry(
104 self,
105 model_name,
106 model_hash,
107 profile,
108 static_shapes,
109 fp32,
110 inpaint,
111 refit,
112 vram,
113 unet_hidden_dim,
114 lora,
115 ):
116 config = ModelConfig(
117 profile, static_shapes, fp32, inpaint, refit, lora, vram, unet_hidden_dim
118 )
119 trt_name, trt_path = self.get_trt_path(
120 model_name, model_hash, profile, static_shapes
121 )
122
123 base_model_name = f"{model_name}" # _{model_hash}
124 if self.cc not in self.all_models:
125 self.all_models[self.cc] = {}
126
127 if base_model_name not in self.all_models[self.cc]:
128 self.all_models[self.cc][base_model_name] = []
129 self.all_models[self.cc][base_model_name].append(
130 {
131 "filepath": trt_name,
132 "config": config,
133 }
134 )
135
136 self.write_json()
137
138 def add_lora_entry(
139 self, base_model, lora_name, trt_lora_path, fp32, inpaint, vram, unet_hidden_dim

Callers 1

export_unet_to_trtFunction · 0.80

Calls 3

get_trt_pathMethod · 0.95
write_jsonMethod · 0.95
ModelConfigClass · 0.90

Tested by

no test coverage detected