diff --git a/Examples/ImageCreationUI/ImageCreationUI.csproj b/Examples/ImageCreationUI/ImageCreationUI.csproj
index ab86463..1a68fce 100644
--- a/Examples/ImageCreationUI/ImageCreationUI.csproj
+++ b/Examples/ImageCreationUI/ImageCreationUI.csproj
@@ -11,9 +11,9 @@
-
-
-
+
+
+
diff --git a/StableDiffusion.NET/Models/Builder/ModelBuilder.cs b/StableDiffusion.NET/Models/Builder/ModelBuilder.cs
index d7189bf..3d91c0b 100644
--- a/StableDiffusion.NET/Models/Builder/ModelBuilder.cs
+++ b/StableDiffusion.NET/Models/Builder/ModelBuilder.cs
@@ -6,6 +6,7 @@ namespace StableDiffusion.NET;
public static class ModelBuilder
{
public static StableDiffusionModelBuilder StableDiffusion(string modelPath) => new(modelPath);
+ public static StableDiffusion3_5ModelBuilder StableDiffusion3_5(string modelPath, string clipLPath, string clipGPath, string t5xxlPath) => new(modelPath, clipLPath, clipGPath, t5xxlPath);
public static FluxModelBuilder Flux(string diffusionModelPath, string clipLPath, string t5xxlPath, string vaePath) => new(diffusionModelPath, clipLPath, t5xxlPath, vaePath);
public static ESRGANModelBuilder ESRGAN(string modelPath) => new(modelPath);
}
\ No newline at end of file
diff --git a/StableDiffusion.NET/Models/Builder/StableDiffusion3_5ModelBuilder.cs b/StableDiffusion.NET/Models/Builder/StableDiffusion3_5ModelBuilder.cs
new file mode 100644
index 0000000..66ac5b1
--- /dev/null
+++ b/StableDiffusion.NET/Models/Builder/StableDiffusion3_5ModelBuilder.cs
@@ -0,0 +1,37 @@
+using JetBrains.Annotations;
+
+namespace StableDiffusion.NET;
+
+[PublicAPI]
+public sealed class StableDiffusion3_5ModelBuilder : IDiffusionModelBuilder, IQuantizedModelBuilder
+{
+ #region Properties & Fields
+
+ public DiffusionModelParameter Parameter { get; }
+ IDiffusionModelParameter IDiffusionModelBuilder.Parameter => Parameter;
+ IQuantizedModelParameter IQuantizedModelBuilder.Parameter => Parameter;
+
+ #endregion
+
+ #region Constructors
+
+ public StableDiffusion3_5ModelBuilder(string modelPath, string clipLPath, string clipGPath, string t5xxlPath)
+ {
+ Parameter = new DiffusionModelParameter
+ {
+ DiffusionModelType = DiffusionModelType.StableDiffusion,
+ ModelPath = modelPath,
+ ClipLPath = clipLPath,
+ ClipGPath = clipGPath,
+ T5xxlPath = t5xxlPath,
+ };
+ }
+
+ #endregion
+
+ #region Methods
+
+ public DiffusionModel Build() => new(Parameter);
+
+ #endregion
+}
\ No newline at end of file
diff --git a/StableDiffusion.NET/Models/DiffusionModel.cs b/StableDiffusion.NET/Models/DiffusionModel.cs
index 1f90b70..cbb2e7d 100644
--- a/StableDiffusion.NET/Models/DiffusionModel.cs
+++ b/StableDiffusion.NET/Models/DiffusionModel.cs
@@ -41,6 +41,7 @@ public sealed unsafe class DiffusionModel : IDisposable
{
_ctx = Native.new_sd_ctx(ModelParameter.ModelPath,
ModelParameter.ClipLPath,
+ ModelParameter.ClipGPath,
ModelParameter.T5xxlPath,
ModelParameter.DiffusionModelPath,
ModelParameter.VaePath,
diff --git a/StableDiffusion.NET/Models/Parameter/DiffusionModelParameter.cs b/StableDiffusion.NET/Models/Parameter/DiffusionModelParameter.cs
index 379750a..8a54a79 100644
--- a/StableDiffusion.NET/Models/Parameter/DiffusionModelParameter.cs
+++ b/StableDiffusion.NET/Models/Parameter/DiffusionModelParameter.cs
@@ -24,12 +24,16 @@ public sealed class DiffusionModelParameter : IDiffusionModelParameter, IQuantiz
public Quantization Quantization { get; set; } = Quantization.Unspecified;
- // Stable Diffusion only
+ // SD <= 3 only
public string ModelPath { get; set; } = string.Empty;
public string StackedIdEmbeddingsDirectory { get; set; } = string.Empty;
- // Flux only
+ // Flux & SD3.5 only
public string DiffusionModelPath { get; set; } = string.Empty;
public string ClipLPath { get; set; } = string.Empty;
public string T5xxlPath { get; set; } = string.Empty;
+
+
+ // SD3.5 only
+ public string ClipGPath { get; set; } = string.Empty;
}
\ No newline at end of file
diff --git a/StableDiffusion.NET/Models/Parameter/DiffusionParameter.cs b/StableDiffusion.NET/Models/Parameter/DiffusionParameter.cs
index 3210254..c6809e5 100644
--- a/StableDiffusion.NET/Models/Parameter/DiffusionParameter.cs
+++ b/StableDiffusion.NET/Models/Parameter/DiffusionParameter.cs
@@ -9,6 +9,7 @@ public sealed class DiffusionParameter
public static DiffusionParameter SD1Default => new() { Width = 512, Height = 512, CfgScale = 7.5f, Guidance = 1f, SampleSteps = 25, SampleMethod = Sampler.Euler_A };
public static DiffusionParameter SDXLDefault => new() { Width = 1024, Height = 1024, CfgScale = 7f, Guidance = 1f, SampleSteps = 30, SampleMethod = Sampler.Euler_A };
+ public static DiffusionParameter SD3_5Default => new() { Width = 1024, Height = 1024, CfgScale = 4.5f, Guidance = 1f, SampleSteps = 20, SampleMethod = Sampler.Euler };
public static DiffusionParameter FluxDefault => new() { Width = 1024, Height = 1024, CfgScale = 1, Guidance = 3.5f, SampleSteps = 20, SampleMethod = Sampler.Euler };
public string NegativePrompt { get; set; } = string.Empty;
diff --git a/StableDiffusion.NET/Native/Native.cs b/StableDiffusion.NET/Native/Native.cs
index 8d27155..66f55ab 100644
--- a/StableDiffusion.NET/Native/Native.cs
+++ b/StableDiffusion.NET/Native/Native.cs
@@ -51,6 +51,7 @@ internal unsafe partial class Native
[LibraryImport(LIB_NAME, EntryPoint = "new_sd_ctx")]
internal static partial sd_ctx_t* new_sd_ctx([MarshalAs(UnmanagedType.LPStr)] string model_path,
[MarshalAs(UnmanagedType.LPStr)] string clip_l_path,
+ [MarshalAs(UnmanagedType.LPStr)] string clip_g_path,
[MarshalAs(UnmanagedType.LPStr)] string t5xxl_path,
[MarshalAs(UnmanagedType.LPStr)] string diffusion_model_path,
[MarshalAs(UnmanagedType.LPStr)] string vae_path,