Skip to content

Commit e6297d4

Browse files
committed
Mapped FreeParamsImmediately-Parameter
1 parent 305d0a6 commit e6297d4

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

StableDiffusion.NET/Models/Parameter/DiffusionModelParameter.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ public sealed class DiffusionModelParameter
4141
/// </summary>
4242
public bool VaeDecodeOnly { get; set; } = false;
4343

44+
public bool FreeParamsImmediately { get; set; } = false;
45+
4446
/// <summary>
4547
/// process vae in tiles to reduce memory usage
4648
/// </summary>
@@ -103,7 +105,7 @@ public sealed class DiffusionModelParameter
103105
/// path to PHOTOMAKER stacked id embeddings
104106
/// </summary>
105107
public string StackedIdEmbeddingsDirectory { get; set; } = string.Empty;
106-
108+
107109
/// <summary>
108110
/// path to full model
109111
/// </summary>

StableDiffusion.NET/Native/Marshaller/DiffusionModelParameterMarshaller.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public static Native.Types.sd_ctx_params_t ConvertToUnmanaged(DiffusionModelPara
2525
embedding_dir = AnsiStringMarshaller.ConvertToUnmanaged(managed.EmbeddingsDirectory),
2626
photo_maker_path = AnsiStringMarshaller.ConvertToUnmanaged(managed.StackedIdEmbeddingsDirectory),
2727
vae_decode_only = (sbyte)(managed.VaeDecodeOnly ? 1 : 0),
28-
free_params_immediately = 0, // DarthAffe 06.08.2025: Static value
28+
free_params_immediately = (sbyte)(managed.FreeParamsImmediately ? 1 : 0),
2929
n_threads = managed.ThreadCount,
3030
wtype = managed.Quantization,
3131
rng_type = managed.RngType,
@@ -63,6 +63,7 @@ public static DiffusionModelParameter ConvertToManaged(Native.Types.sd_ctx_param
6363
EmbeddingsDirectory = AnsiStringMarshaller.ConvertToManaged(unmanaged.embedding_dir) ?? string.Empty,
6464
StackedIdEmbeddingsDirectory = AnsiStringMarshaller.ConvertToManaged(unmanaged.photo_maker_path) ?? string.Empty,
6565
VaeDecodeOnly = unmanaged.vae_decode_only == 1,
66+
FreeParamsImmediately = unmanaged.free_params_immediately == 1,
6667
ThreadCount = unmanaged.n_threads,
6768
Quantization = unmanaged.wtype,
6869
RngType = unmanaged.rng_type,

0 commit comments

Comments
 (0)