Skip to content

Commit f233c7b

Browse files
authored
Merge pull request #51 from DarthAffe/sd.cpp_update
Updated for latest sd.cpp
2 parents 67e8a96 + 2c7a992 commit f233c7b

File tree

8 files changed

+290
-171
lines changed

8 files changed

+290
-171
lines changed

.github/workflows/backends.yml

Lines changed: 268 additions & 115 deletions
Large diffs are not rendered by default.

Examples/ImageCreationUI/ImageCreationUI.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212
<ItemGroup>
1313
<PackageReference Include="HPPH.System.Drawing" Version="1.0.0" />
14-
<PackageReference Include="StableDiffusion.NET.Backend.Cpu" Version="3.3.1" />
15-
<PackageReference Include="StableDiffusion.NET.Backend.Cuda" Version="3.3.1" />
16-
<PackageReference Include="StableDiffusion.NET.Backend.Rocm" Version="3.3.1" />
14+
<PackageReference Include="StableDiffusion.NET.Backend.Cpu" Version="3.3.2" />
15+
<PackageReference Include="StableDiffusion.NET.Backend.Cuda" Version="3.3.2" />
16+
<PackageReference Include="StableDiffusion.NET.Backend.Rocm" Version="3.3.2" />
1717
</ItemGroup>
1818

1919
<ItemGroup>

StableDiffusion.NET/Enums/Quantization.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,14 @@ public enum Quantization
3434
F64 = 28,
3535
IQ1_M = 29,
3636
BF16 = 30,
37-
Q4_0_4_4 = 31,
38-
Q4_0_4_8 = 32,
39-
Q4_0_8_8 = 33,
37+
//Q4_0_4_4 = 31, support has been removed from gguf files
38+
//Q4_0_4_8 = 32,
39+
//Q4_0_8_8 = 33,
4040
TQ1_0 = 34,
4141
TQ2_0 = 35,
42+
// SD_TYPE_IQ4_NL_4_4 = 36,
43+
// SD_TYPE_IQ4_NL_4_8 = 37,
44+
// SD_TYPE_IQ4_NL_8_8 = 38,
4245

43-
Unspecified
46+
Unspecified = 39
4447
}

StableDiffusion.NET/Enums/Sampler.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,7 @@ public enum Sampler
1111
DPMPP2Mv2,
1212
IPNDM,
1313
IPNDM_V,
14-
LCM
14+
LCM,
15+
DDIM_Trailing,
16+
TCD
1517
}

StableDiffusion.NET/Models/DiffusionModel.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ public IImage<ColorRGB> TextToImage(string prompt, DiffusionParameter? parameter
113113
parameter.ClipSkip,
114114
parameter.CfgScale,
115115
parameter.Guidance,
116+
parameter.Eta,
116117
parameter.Width,
117118
parameter.Height,
118119
parameter.SampleMethod,
@@ -148,6 +149,7 @@ public IImage<ColorRGB> TextToImage(string prompt, DiffusionParameter? parameter
148149
parameter.ClipSkip,
149150
parameter.CfgScale,
150151
parameter.Guidance,
152+
parameter.Eta,
151153
parameter.Width,
152154
parameter.Height,
153155
parameter.SampleMethod,
@@ -175,6 +177,7 @@ public IImage<ColorRGB> TextToImage(string prompt, DiffusionParameter? parameter
175177
parameter.ClipSkip,
176178
parameter.CfgScale,
177179
parameter.Guidance,
180+
parameter.Eta,
178181
parameter.Width,
179182
parameter.Height,
180183
parameter.SampleMethod,

StableDiffusion.NET/Models/Parameter/DiffusionParameter.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,5 +90,10 @@ public sealed class DiffusionParameter
9090
/// </summary>
9191
public float Guidance { get; set; } = 3.5f;
9292

93+
/// <summary>
94+
/// eta in DDIM, only for DDIM and TCD (default: 0)
95+
/// </summary>
96+
public float Eta { get; set; } = 0f;
97+
9398
#endregion
9499
}

StableDiffusion.NET/Native/Native.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ internal struct sd_image_t
8282
int clip_skip,
8383
float cfg_scale,
8484
float guidance,
85+
float eta,
8586
int width,
8687
int height,
8788
sample_method_t sample_method,

build.bat

Lines changed: 0 additions & 48 deletions
This file was deleted.

0 commit comments

Comments
 (0)