Skip to content

Commit 40085ae

Browse files
committed
refactor(tx): free sampling stream
Signed-off-by: thxCode <thxcode0824@gmail.com>
1 parent e498154 commit 40085ae

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

stable-diffusion.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2364,6 +2364,7 @@ void sd_sampling_stream_free(sd_sampling_stream_t* stream) {
23642364
stream->cond = {};
23652365
stream->uncond = {};
23662366
stream->control_hint = nullptr;
2367+
// stream->x = nullptr; // no need to free, it's a view
23672368
stream->noised_input = nullptr;
23682369
stream->out_cond = nullptr;
23692370
stream->out_uncond = nullptr;
@@ -2372,7 +2373,10 @@ void sd_sampling_stream_free(sd_sampling_stream_t* stream) {
23722373
ggml_free(stream->work_ctx);
23732374
stream->work_ctx = nullptr;
23742375
}
2376+
// stream->sampler = nullptr; // no need to free, it's a shared pointer
23752377
stream->sigmas.clear();
2378+
// stream->rng = nullptr; // no need to free, it's a shared pointer
2379+
stream->skip_layers.clear();
23762380
}
23772381

23782382
bool sd_sampling_stream_sample(sd_ctx_t* sd_ctx, sd_sampling_stream_t* stream) {

0 commit comments

Comments
 (0)