Skip to content

Commit 24c4cb4

Browse files
committed
v0.5.1 - Vendor Builds, Volume Support, TextElement
1 parent 9a8b5b9 commit 24c4cb4

34 files changed

+229
-79
lines changed

DiffuseApp/DiffuseApp/App.xaml.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public partial class App : Application
3333
private static string _directoryBase;
3434
private static string _directoryData;
3535
private static string _directoryPython;
36+
private readonly Settings _settings;
3637

3738
public App()
3839
{
@@ -59,8 +60,8 @@ public App()
5960
builder.Logging.AddSerilog(logger: Log.Logger, dispose: true);
6061

6162
// Add TensorStack.WPF
62-
var settings = LoadSettingsFile();
63-
builder.Services.AddWPFCommon<MainWindow, Settings>(settings);
63+
_settings = LoadSettingsFile();
64+
builder.Services.AddWPFCommon<MainWindow, Settings>(_settings);
6465

6566
// Add sService
6667
builder.Services.AddSingleton<IHardwareService, HardwareService>();
@@ -140,6 +141,7 @@ private async Task AppShutdown()
140141
{
141142
using (_appHost)
142143
{
144+
await SettingsManager.SaveAsync(_settings);
143145
await _appHost.StopAsync();
144146
DeregisterExceptionHandlers();
145147
_appMutex.WaitOne();

DiffuseApp/DiffuseApp/Common/AudioModel.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public class AudioModel : BaseModel
1414

1515
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
1616
public int Id { get; set; }
17+
public BackendType Backend { get; set; }
1718
public string Name { get; set; }
1819
public bool IsDefault { get; set; }
1920
public AudioModelType Type { get; set; }

DiffuseApp/DiffuseApp/Common/ControlNetModel.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System.IO;
22
using System.Text.Json.Serialization;
3+
using TensorStack.Common.Common;
34
using TensorStack.WPF;
45

56
namespace Diffuse.Common
@@ -10,6 +11,7 @@ public class ControlNetModel : BaseModel
1011

1112
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
1213
public int Id { get; set; }
14+
public BackendType Backend { get; set; }
1315
public string Name { get; set; }
1416
public string Path { get; set; }
1517
public ModelSourceType Source { get; set; }

DiffuseApp/DiffuseApp/Common/DiffusionModel.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System.Collections.Generic;
22
using System.IO;
33
using System.Text.Json.Serialization;
4+
using TensorStack.Common.Common;
45
using TensorStack.Python.Common;
56
using TensorStack.WPF;
67

@@ -12,6 +13,7 @@ public class DiffusionModel : BaseModel
1213

1314
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
1415
public int Id { get; set; }
16+
public BackendType Backend { get; set; }
1517
public string Name { get; set; }
1618
public string Pipeline { get; set; }
1719
public string Path { get; set; }

DiffuseApp/DiffuseApp/Common/ExtractModel.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public class ExtractModel : BaseModel
1515

1616
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
1717
public int Id { get; set; }
18+
public BackendType Backend { get; set; }
1819
public string Name { get; set; }
1920
public bool IsDefault { get; set; }
2021
public ExtractorType Type { get; set; }

DiffuseApp/DiffuseApp/Common/LoraAdapterModel.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System.IO;
22
using System.Text.Json.Serialization;
3+
using TensorStack.Common.Common;
34
using TensorStack.WPF;
45

56
namespace Diffuse.Common
@@ -11,6 +12,7 @@ public class LoraAdapterModel : BaseModel
1112

1213
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
1314
public int Id { get; set; }
15+
public BackendType Backend { get; set; }
1416
public string Name { get; set; }
1517
public string Key { get; set; }
1618
public string Path { get; set; }

DiffuseApp/DiffuseApp/Common/TextInput.cs

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

DiffuseApp/DiffuseApp/Common/UpscaleModel.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public class UpscaleModel : BaseModel
1616

1717
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
1818
public int Id { get; set; }
19+
public BackendType Backend { get; set; }
1920
public string Name { get; set; }
2021
public bool IsDefault { get; set; }
2122
public int Channels { get; set; } = 3;

DiffuseApp/DiffuseApp/Dialogs/ControlNetModelDialog.xaml.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using System.IO;
88
using System.Linq;
99
using System.Threading.Tasks;
10+
using TensorStack.Common.Common;
1011
using TensorStack.WPF;
1112
using TensorStack.WPF.Controls;
1213

@@ -51,6 +52,7 @@ public Task<bool> AddAsync()
5152
ControlNetModel = new ControlNetModel
5253
{
5354
Id = modelId,
55+
Backend = BackendType.Pytorch,
5456
Source = ModelSourceType.HuggingFace
5557
};
5658
return base.ShowDialogAsync();
@@ -158,7 +160,9 @@ private static ControlNetModel DeepClone(ControlNetModel controlNetModel, int mo
158160
Id = modelId,
159161
Name = controlNetModel.Name,
160162
Path = controlNetModel.Path,
161-
Pipeline = controlNetModel.Pipeline
163+
Pipeline = controlNetModel.Pipeline,
164+
Backend = controlNetModel.Backend,
165+
Source = controlNetModel.Source,
162166
};
163167
}
164168
}

DiffuseApp/DiffuseApp/Dialogs/DiffusionModelDialog.xaml.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using System.Linq;
99
using System.Threading.Tasks;
1010
using TensorStack.Common;
11+
using TensorStack.Common.Common;
1112
using TensorStack.Python.Common;
1213
using TensorStack.WPF;
1314
using TensorStack.WPF.Controls;
@@ -104,6 +105,7 @@ public Task<bool> AddAsync()
104105
DiffusionModel = new DiffusionModel
105106
{
106107
Id = modelId,
108+
Backend = BackendType.Pytorch,
107109
BaseType = DataType.Bfloat16,
108110
MemoryProfile =
109111
[
@@ -429,6 +431,7 @@ private static DiffusionModel DeepClone(DiffusionModel diffusionModel, int model
429431
return new DiffusionModel
430432
{
431433
Id = modelId,
434+
Backend = diffusionModel.Backend,
432435
Name = diffusionModel.Name,
433436
Path = diffusionModel.Path,
434437
Variant = diffusionModel.Variant,

0 commit comments

Comments
 (0)