Compare commits

..

No commits in common. "16d60aca7b0c33cc38ee3703119f060cb02a1a61" and "d25eb9716854c0a550e572746b81a841726eab90" have entirely different histories.

7 changed files with 5 additions and 50 deletions

View File

@ -11,9 +11,9 @@
<ItemGroup>
<PackageReference Include="HPPH.System.Drawing" Version="1.0.0" />
<PackageReference Include="StableDiffusion.NET.Backend.Cpu" Version="3.2.0" />
<PackageReference Include="StableDiffusion.NET.Backend.Cuda" Version="3.2.0" />
<PackageReference Include="StableDiffusion.NET.Backend.Rocm" Version="3.2.0" />
<PackageReference Include="StableDiffusion.NET.Backend.Cpu" Version="3.0.0" />
<PackageReference Include="StableDiffusion.NET.Backend.Cuda" Version="3.0.0" />
<PackageReference Include="StableDiffusion.NET.Backend.Rocm" Version="3.0.0" />
</ItemGroup>
<ItemGroup>

View File

@ -6,7 +6,6 @@ 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);
}

View File

@ -1,37 +0,0 @@
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
}

View File

@ -41,7 +41,6 @@ public sealed unsafe class DiffusionModel : IDisposable
{
_ctx = Native.new_sd_ctx(ModelParameter.ModelPath,
ModelParameter.ClipLPath,
ModelParameter.ClipGPath,
ModelParameter.T5xxlPath,
ModelParameter.DiffusionModelPath,
ModelParameter.VaePath,

View File

@ -24,16 +24,12 @@ public sealed class DiffusionModelParameter : IDiffusionModelParameter, IQuantiz
public Quantization Quantization { get; set; } = Quantization.Unspecified;
// SD <= 3 only
// Stable Diffusion only
public string ModelPath { get; set; } = string.Empty;
public string StackedIdEmbeddingsDirectory { get; set; } = string.Empty;
// Flux & SD3.5 only
// Flux 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;
}

View File

@ -9,7 +9,6 @@ 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;

View File

@ -51,7 +51,6 @@ 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,