Added chroma model parameters

This commit is contained in:
DarthAffe 2025-06-30 23:51:11 +02:00
parent bbf5743143
commit 89cf3108df
3 changed files with 13 additions and 2 deletions

View File

@ -61,7 +61,10 @@ public sealed unsafe class DiffusionModel : IDisposable
ModelParameter.KeepClipOnCPU, ModelParameter.KeepClipOnCPU,
ModelParameter.KeepControlNetOnCPU, ModelParameter.KeepControlNetOnCPU,
ModelParameter.KeepVaeOnCPU, ModelParameter.KeepVaeOnCPU,
ModelParameter.FlashAttention); ModelParameter.FlashAttention,
ModelParameter.ChromaUseDitMap,
ModelParameter.ChromaEnableT5Map,
ModelParameter.ChromaT5MaskPad);
if (_ctx == null) throw new NullReferenceException("Failed to initialize diffusion-model."); if (_ctx == null) throw new NullReferenceException("Failed to initialize diffusion-model.");
} }

View File

@ -109,6 +109,11 @@ public sealed class DiffusionModelParameter : IDiffusionModelParameter, IQuantiz
/// </summary> /// </summary>
public string T5xxlPath { get; set; } = string.Empty; 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 // SD3.5 only
/// <summary> /// <summary>
/// path to the clip-g text encoder /// path to the clip-g text encoder

View File

@ -70,7 +70,10 @@ internal unsafe partial class Native
[MarshalAs(UnmanagedType.I1)] bool keep_clip_on_cpu, [MarshalAs(UnmanagedType.I1)] bool keep_clip_on_cpu,
[MarshalAs(UnmanagedType.I1)] bool keep_control_net_cpu, [MarshalAs(UnmanagedType.I1)] bool keep_control_net_cpu,
[MarshalAs(UnmanagedType.I1)] bool keep_vae_on_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")] [LibraryImport(LIB_NAME, EntryPoint = "free_sd_ctx")]
internal static partial void free_sd_ctx(sd_ctx_t* sd_ctx); internal static partial void free_sd_ctx(sd_ctx_t* sd_ctx);