Skip to content

Commit ccc21dc

Browse files
committed
v0.4.7 - Variant Support, ViewBase Refactor
1 parent d5e46ed commit ccc21dc

File tree

78 files changed

+2811
-3038
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+2811
-3038
lines changed

DiffuseApp/DiffuseApp.Common/PipelineClient.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,9 @@ private async Task ProcessProgressQueueAsync(IProgress<PipelineProgress> progres
269269
progressCallback?.Report(progress);
270270
}
271271
catch (OperationCanceledException) { }
272-
catch (Exception ex)
272+
catch (Exception)
273273
{
274-
_logger?.LogError(ex, $"[PipelineClient] [ProcessProgressQueueAsync] - An exception occurred processing progress");
274+
// _logger?.LogError(ex, $"[PipelineClient] [ProcessProgressQueueAsync] - An exception occurred processing progress");
275275
}
276276
}
277277
}

DiffuseApp/DiffuseApp/App.xaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -458,15 +458,15 @@
458458
</StackPanel>
459459
<StackPanel Visibility="{Binding LoraModels, Converter={StaticResource NullVisibilityConverter}}">
460460
<TextBlock Text="Lora Strength" Style="{StaticResource FieldTextBlockStyle}" />
461-
<ItemsControl ItemsSource="{Binding Options.LoraStrength}">
461+
<ItemsControl ItemsSource="{Binding Options.LoraOptions}">
462462
<ItemsControl.ItemsPanel>
463463
<ItemsPanelTemplate>
464464
<StackPanel IsItemsHost="True" Orientation="Horizontal" />
465465
</ItemsPanelTemplate>
466466
</ItemsControl.ItemsPanel>
467467
<ItemsControl.ItemTemplate>
468468
<DataTemplate>
469-
<TextBox Text="{Binding ., Mode=OneWay}" Style="{StaticResource TextBlockStyle}" IsReadOnly="True" Margin="0,0,4,0" />
469+
<TextBox Text="{Binding Strength, Mode=OneWay}" Style="{StaticResource TextBlockStyle}" IsReadOnly="True" Margin="0,0,4,0" />
470470
</DataTemplate>
471471
</ItemsControl.ItemTemplate>
472472
</ItemsControl>
@@ -487,8 +487,8 @@
487487
</StackPanel>
488488
<UniformGrid Columns="3" Visibility="{Binding ExtractorType, Converter={StaticResource EnumToVisibilityConverter}, ConverterParameter=Default}">
489489
<StackPanel>
490-
<TextBlock Text="Tile Mode" Style="{StaticResource FieldTextBlockStyle}" />
491-
<TextBlock Text="{Binding ExtractOptions.TileMode}" />
490+
<TextBlock Text="Tiled" Style="{StaticResource FieldTextBlockStyle}" />
491+
<TextBlock Text="{Binding ExtractOptions.IsTileEnabled}" />
492492
</StackPanel>
493493
<StackPanel>
494494
<TextBlock Text="Tile Size" Style="{StaticResource FieldTextBlockStyle}" />
@@ -543,8 +543,8 @@
543543
</StackPanel>
544544
<UniformGrid Columns="3" Margin="0,0,0,0">
545545
<StackPanel>
546-
<TextBlock Text="Tile Mode" Style="{StaticResource FieldTextBlockStyle}" />
547-
<TextBlock Text="{Binding UpscaleOptions.TileMode}" />
546+
<TextBlock Text="Tiled" Style="{StaticResource FieldTextBlockStyle}" />
547+
<TextBlock Text="{Binding UpscaleOptions.IsTileEnabled}" />
548548
</StackPanel>
549549
<StackPanel>
550550
<TextBlock Text="Tile Size" Style="{StaticResource FieldTextBlockStyle}" />
@@ -615,8 +615,8 @@
615615
<Separator Opacity=".7"/>
616616
<UniformGrid Columns="3" Visibility="{Binding ExtractorType, Converter={StaticResource EnumToVisibilityConverter}, ConverterParameter=Default}">
617617
<StackPanel>
618-
<TextBlock Text="Tile Mode" Style="{StaticResource FieldTextBlockStyle}" />
619-
<TextBlock Text="{Binding Options.TileMode}" />
618+
<TextBlock Text="Tiled" Style="{StaticResource FieldTextBlockStyle}" />
619+
<TextBlock Text="{Binding Options.IsTileEnabled}" />
620620
</StackPanel>
621621
<StackPanel>
622622
<TextBlock Text="Tile Size" Style="{StaticResource FieldTextBlockStyle}" />
@@ -731,8 +731,8 @@
731731
<Separator Opacity=".7"/>
732732
<UniformGrid Columns="3" Margin="0,0,0,0">
733733
<StackPanel>
734-
<TextBlock Text="Tile Mode" Style="{StaticResource FieldTextBlockStyle}" />
735-
<TextBlock Text="{Binding Options.TileMode}" />
734+
<TextBlock Text="Tiled" Style="{StaticResource FieldTextBlockStyle}" />
735+
<TextBlock Text="{Binding Options.IsTileEnabled}" />
736736
</StackPanel>
737737
<StackPanel>
738738
<TextBlock Text="Tile Size" Style="{StaticResource FieldTextBlockStyle}" />

DiffuseApp/DiffuseApp/App.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ private async void OnTaskSchedulerException(object sender, UnobservedTaskExcepti
252252
/// <param name="ex">The ex.</param>
253253
private static async Task ShowExceptionMessage(Exception ex)
254254
{
255-
await DialogService.ShowErrorAsync("Error", $"An unexpected error occurred:\n{ex.Message}");
255+
await DialogService.ShowErrorAsync("Unexpected Error", $"An unexpected error occurred:\n{ex.Message}");
256256
}
257257

258258

DiffuseApp/DiffuseApp/Common/DiffusionInputOptions.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ public record DiffusionInputOptions : BaseRecord
2121
private int _steps2;
2222
private float _strength = 1;
2323
private float _controlNetStrength = 1;
24-
private float[] _loraStrength = [1,1,1,1,1,1];
2524
private int _inputImageCount = 0;
2625
private SchedulerInputOptions _schedulerOptions = new SchedulerInputOptions();
26+
private List<LoraOptionModel> _loraOptions;
2727

2828
public int Width
2929
{
@@ -91,10 +91,10 @@ public float Strength
9191
set { SetProperty(ref _strength, value); }
9292
}
9393

94-
public float[] LoraStrength
94+
public List<LoraOptionModel> LoraOptions
9595
{
96-
get { return _loraStrength; }
97-
set { SetProperty(ref _loraStrength, value); }
96+
get { return _loraOptions; }
97+
set { SetProperty(ref _loraOptions, value); }
9898
}
9999

100100
public float ControlNetStrength

DiffuseApp/DiffuseApp/Common/DiffusionModel.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public class DiffusionModel : BaseModel
1515
public string Name { get; set; }
1616
public string Pipeline { get; set; }
1717
public string Path { get; set; }
18+
public string Variant { get; set; }
1819
public ModelSourceType Source { get; set; }
1920
public bool IsDefault { get; set; }
2021
public MemoryProfile[] MemoryProfile { get; set; }

DiffuseApp/DiffuseApp/Common/ExtractInputOptions.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,14 @@ namespace Diffuse.Common
66
{
77
public class ExtractInputOptions : BaseModel
88
{
9+
private bool _isTileEnabled;
10+
911
// Default
10-
public TileMode TileMode { get; set; }
12+
public bool IsTileEnabled
13+
{
14+
get { return _isTileEnabled; }
15+
set { SetProperty(ref _isTileEnabled, value); }
16+
}
1117
public int TileSize { get; set; }
1218
public int TileOverlap { get; set; }
1319
public bool IsInverted { get; set; }
@@ -26,5 +32,7 @@ public class ExtractInputOptions : BaseModel
2632
public float JointRadius { get; set; }
2733
public float BoneRadius { get; set; }
2834
public float BoneThickness { get; set; }
35+
36+
public bool IsTileSupported { get; set; }
2937
}
3038
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using TensorStack.WPF;
2+
3+
namespace Diffuse.Common
4+
{
5+
public class LoraOptionModel : BaseModel
6+
{
7+
public string Name { get; init; }
8+
public string Key { get; init; }
9+
public float Strength { get; set; }
10+
}
11+
}

DiffuseApp/DiffuseApp/Common/PipelineModel.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,12 @@ public bool IsReloadRequired(PipelineModel pipeline)
7575
{
7676
return pipeline is null
7777
|| pipeline.DiffusionModel != _diffusionModel
78-
|| pipeline.LoraAdapterModel != _loraAdapterModel
78+
|| pipeline.LoraAdapterModel.HasChanged(_loraAdapterModel)
7979
|| pipeline.ControlNetModel != _controlNetModel
8080
|| pipeline.MemoryMode != _memoryMode
8181
|| pipeline.DataType != _dataType
8282
|| pipeline.ProcessType != _processType;
8383
}
84+
8485
}
8586
}

DiffuseApp/DiffuseApp/Common/UpscaleInputOptions.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
using TensorStack.Common;
2-
using TensorStack.WPF;
1+
using TensorStack.WPF;
32

43
namespace Diffuse.Common
54
{
65
public class UpscaleInputOptions : BaseModel
76
{
8-
private TileMode _tileMode;
7+
private bool _isTileEnabled;
98
private int _tileSize;
109
private int _tileOverlap;
1110

12-
public TileMode TileMode
11+
public bool IsTileEnabled
1312
{
14-
get { return _tileMode; }
15-
set { SetProperty(ref _tileMode, value); }
13+
get { return _isTileEnabled; }
14+
set { SetProperty(ref _isTileEnabled, value); }
1615
}
1716

1817
public int TileSize

DiffuseApp/DiffuseApp/Common/UpscaleModel.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public class UpscaleModel : BaseModel
2121
public int Channels { get; set; } = 3;
2222
public int SampleSize { get; set; }
2323
public int ScaleFactor { get; set; } = 1;
24+
public int MemorySize { get; set; } = 2;
2425
public Normalization Normalization { get; set; } = Normalization.ZeroToOne;
2526
public Normalization OutputNormalization { get; set; } = Normalization.OneToOne;
2627
public UpscaleInputOptions DefaultOptions { get; set; }

0 commit comments

Comments
 (0)