Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion StableDiffusion.NET/Models/DiffusionModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ private void Initialize()
ModelParameter.KeepClipOnCPU,
ModelParameter.KeepControlNetOnCPU,
ModelParameter.KeepVaeOnCPU,
ModelParameter.FlashAttention);
ModelParameter.FlashAttention,
ModelParameter.ChromaUseDitMap,
ModelParameter.ChromaEnableT5Map,
ModelParameter.ChromaT5MaskPad);

if (_ctx == null) throw new NullReferenceException("Failed to initialize diffusion-model.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ public sealed class DiffusionModelParameter : IDiffusionModelParameter, IQuantiz
/// </summary>
public string T5xxlPath { get; set; } = string.Empty;

// Flux Chroma specific
public bool ChromaUseDitMap { get; set; } = true;
public bool ChromaEnableT5Map { get; set; } = false;
public int ChromaT5MaskPad { get; set; } = 1;

// SD3.5 only
/// <summary>
/// path to the clip-g text encoder
Expand Down
5 changes: 4 additions & 1 deletion StableDiffusion.NET/Native/Native.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ internal struct sd_image_t
[MarshalAs(UnmanagedType.I1)] bool keep_clip_on_cpu,
[MarshalAs(UnmanagedType.I1)] bool keep_control_net_cpu,
[MarshalAs(UnmanagedType.I1)] bool keep_vae_on_cpu,
[MarshalAs(UnmanagedType.I1)] bool diffusion_flash_attn);
[MarshalAs(UnmanagedType.I1)] bool diffusion_flash_attn,
[MarshalAs(UnmanagedType.I1)] bool chroma_use_dit_mask,
[MarshalAs(UnmanagedType.I1)] bool chroma_use_t5_mask,
int chroma_t5_mask_pad);

[LibraryImport(LIB_NAME, EntryPoint = "free_sd_ctx")]
internal static partial void free_sd_ctx(sd_ctx_t* sd_ctx);
Expand Down