Skip to content

Commit bb3f19c

Browse files
committed
fix: increase ctx_size
1 parent 7620b92 commit bb3f19c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

stable-diffusion.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3099,7 +3099,7 @@ class StableDiffusionGGML {
30993099
struct ggml_tensor* c = ggml_new_tensor_4d(res_ctx, GGML_TYPE_F32, 1024, 2, 1, 1);
31003100
ggml_set_f32(c, 0.5);
31013101

3102-
size_t ctx_size = 1 * 1024 * 1024; // 1MB
3102+
size_t ctx_size = 10 * 1024 * 1024; // 10MB
31033103
// calculate the amount of memory required
31043104
{
31053105
struct ggml_init_params params;
@@ -3201,7 +3201,7 @@ class StableDiffusionGGML {
32013201
true);
32023202
std::vector<int>& tokens = tokens_and_weights.first;
32033203
std::vector<float>& weights = tokens_and_weights.second;
3204-
size_t ctx_size = 1 * 1024 * 1024; // 1MB
3204+
size_t ctx_size = 10 * 1024 * 1024; // 10MB
32053205
// calculate the amount of memory required
32063206
{
32073207
struct ggml_init_params params;
@@ -3335,7 +3335,7 @@ class StableDiffusionGGML {
33353335
struct ggml_tensor* x = ggml_dup_tensor(res_ctx, x_t);
33363336
copy_ggml_tensor(x, x_t);
33373337

3338-
size_t ctx_size = 1 * 1024 * 1024; // 1MB
3338+
size_t ctx_size = 10 * 1024 * 1024; // 10MB
33393339
// calculate the amount of memory required
33403340
{
33413341
struct ggml_init_params params;
@@ -3590,7 +3590,7 @@ class StableDiffusionGGML {
35903590
struct ggml_tensor* result = NULL;
35913591

35923592
// calculate the amount of memory required
3593-
size_t ctx_size = 1 * 1024 * 1024;
3593+
size_t ctx_size = 10 * 1024 * 1024; // 10MB
35943594
{
35953595
struct ggml_init_params params;
35963596
params.mem_size = ctx_size;
@@ -3719,7 +3719,7 @@ class StableDiffusionGGML {
37193719
}
37203720

37213721
// calculate the amount of memory required
3722-
size_t ctx_size = 1 * 1024 * 1024;
3722+
size_t ctx_size = 10 * 1024 * 1024; // 10MB
37233723
{
37243724
struct ggml_init_params params;
37253725
params.mem_size = ctx_size;

0 commit comments

Comments
 (0)