mirror of
https://github.com/leejet/stable-diffusion.cpp.git
synced 2026-10-03 19:37:51 -05:00
refactor: unify runner lifecycles and weight residency (#1940)
This commit is contained in:
+1
-9
@@ -32,13 +32,6 @@ void UpscalerGGML::set_max_graph_vram_bytes(size_t max_vram_bytes) {
|
||||
}
|
||||
}
|
||||
|
||||
void UpscalerGGML::set_stream_layers_enabled(bool enabled) {
|
||||
stream_layers_enabled = enabled;
|
||||
if (esrgan_upscaler) {
|
||||
esrgan_upscaler->set_stream_layers_enabled(enabled);
|
||||
}
|
||||
}
|
||||
|
||||
bool UpscalerGGML::load_from_file(const std::string& esrgan_path,
|
||||
int n_threads) {
|
||||
ggml_log_set(ggml_log_callback_default, nullptr);
|
||||
@@ -94,7 +87,6 @@ bool UpscalerGGML::load_from_file(const std::string& esrgan_path,
|
||||
return false;
|
||||
}
|
||||
esrgan_upscaler->set_max_graph_vram_bytes(max_graph_vram_bytes);
|
||||
esrgan_upscaler->set_stream_layers_enabled(stream_layers_enabled);
|
||||
if (direct) {
|
||||
esrgan_upscaler->set_conv2d_direct_enabled(true);
|
||||
}
|
||||
@@ -139,7 +131,7 @@ sd::Tensor<float> UpscalerGGML::upscale_tensor(const sd::Tensor<float>& input_te
|
||||
false,
|
||||
on_processing);
|
||||
}
|
||||
esrgan_upscaler->free_compute_buffer();
|
||||
esrgan_upscaler->runner_end();
|
||||
if (upscaled.empty()) {
|
||||
LOG_ERROR("esrgan compute failed");
|
||||
return {};
|
||||
|
||||
Reference in New Issue
Block a user