Skip to content

Commit d5e46ed

Browse files
committed
v0.4.5 - Inpaint Support, Upscale Tile Progress
1 parent b90e42e commit d5e46ed

25 files changed

+585
-59
lines changed

DiffuseApp/DiffuseApp/App.xaml

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,15 @@
2323
<BitmapImage x:Key="ImageIcon" UriSource="pack://application:,,,/Diffuse;component/Images/Icon.png" />
2424

2525
<!--Fonts-->
26-
<FontFamily x:Key="FontAwesomeBrands">pack://application:,,,/Diffuse;component/Fonts/Brands-Regular-400.otf#Font Awesome 6 Brands Regular</FontFamily>
27-
<FontFamily x:Key="FontAwesomeDuotone">pack://application:,,,/Diffuse;component/Fonts/Duotone-Solid-900.otf#Font Awesome 6 Duotone Solid</FontFamily>
28-
<FontFamily x:Key="FontAwesomeLight">pack://application:,,,/Diffuse;component/Fonts/Light-300.otf#Font Awesome 6 Pro Light</FontFamily>
29-
<FontFamily x:Key="FontAwesomeRegular">pack://application:,,,/Diffuse;component/Fonts/Regular-400.otf#Font Awesome 6 Pro Regular</FontFamily>
30-
<FontFamily x:Key="FontAwesomeSolid">pack://application:,,,/Diffuse;component/Fonts/Solid-900.otf#Font Awesome 6 Pro Solid</FontFamily>
31-
<FontFamily x:Key="FontAwesomeThin">pack://application:,,,/Diffuse;component/Fonts/Thin-100.otf#Font Awesome 6 Pro Thin</FontFamily>
32-
<FontFamily x:Key="FontAwesomeSharpLight">pack://application:,,,/Diffuse;component/Fonts/Sharp-Light-300.otf#Font Awesome 6 Sharp Light</FontFamily>
33-
<FontFamily x:Key="FontAwesomeSharpRegular">pack://application:,,,/Diffuse;component/Fonts/Sharp-Regular-400.otf#Font Awesome 6 Sharp Regular</FontFamily>
34-
<FontFamily x:Key="FontAwesomeSharpSolid">pack://application:,,,/Diffuse;component/Fonts/Sharp-Solid-900.otf#Font Awesome 6 Sharp Solid</FontFamily>
35-
<FontFamily x:Key="FontAwesomeSharpThin">pack://application:,,,/Diffuse;component/Fonts/Sharp-Thin-100.otf#Font Awesome 6 Sharp Thin</FontFamily>
26+
<FontFamily x:Key="FontAwesomeBrands">pack://application:,,,/Diffuse;component/Fonts/Brands-Regular-400.otf#Font Awesome 7 Brands</FontFamily>
27+
<FontFamily x:Key="FontAwesomeLight">pack://application:,,,/Diffuse;component/Fonts/Light-300.otf#Font Awesome 7 Pro Light</FontFamily>
28+
<FontFamily x:Key="FontAwesomeRegular">pack://application:,,,/Diffuse;component/Fonts/Regular-400.otf#Font Awesome 7 Pro</FontFamily>
29+
<FontFamily x:Key="FontAwesomeSolid">pack://application:,,,/Diffuse;component/Fonts/Solid-900.otf#Font Awesome 7 Pro Solid</FontFamily>
30+
<FontFamily x:Key="FontAwesomeThin">pack://application:,,,/Diffuse;component/Fonts/Thin-100.otf#Font Awesome 7 Pro Thin</FontFamily>
31+
<FontFamily x:Key="FontAwesomeSharpLight">pack://application:,,,/Diffuse;component/Fonts/Sharp-Light-300.otf#Font Awesome 7 Sharp Light</FontFamily>
32+
<FontFamily x:Key="FontAwesomeSharpRegular">pack://application:,,,/Diffuse;component/Fonts/Sharp-Regular-400.otf#Font Awesome 7 Sharp</FontFamily>
33+
<FontFamily x:Key="FontAwesomeSharpSolid">pack://application:,,,/Diffuse;component/Fonts/Sharp-Solid-900.otf#Font Awesome 7 Sharp Solid</FontFamily>
34+
<FontFamily x:Key="FontAwesomeSharpThin">pack://application:,,,/Diffuse;component/Fonts/Sharp-Thin-100.otf#Font Awesome 7 Sharp Thin</FontFamily>
3635

3736

3837
<Color x:Key="Accent1">#ff5a7fa7</Color>
@@ -182,6 +181,7 @@
182181

183182
<Style x:Key="ImageDropZoneStyle" TargetType="{x:Type Border}">
184183
<Setter Property="AllowDrop" Value="False"/>
184+
<Setter Property="Background" Value="Transparent"/>
185185
<Setter Property="BorderBrush" Value="Transparent"/>
186186
<Setter Property="BorderThickness" Value="1"/>
187187
<Style.Triggers>
@@ -193,12 +193,32 @@
193193
</MultiDataTrigger.Conditions>
194194
<MultiDataTrigger.Setters>
195195
<Setter Property="AllowDrop" Value="True"/>
196+
<Setter Property="Background" Value="#20000000"/>
196197
<Setter Property="BorderBrush" Value="{StaticResource AccentColour2}"/>
197198
</MultiDataTrigger.Setters>
198199
</MultiDataTrigger>
199200
</Style.Triggers>
200201
</Style>
201202

203+
<Style x:Key="ImageDropTextStyle" TargetType="{x:Type TextBlock}">
204+
<Setter Property="VerticalAlignment" Value="Center"/>
205+
<Setter Property="HorizontalAlignment" Value="Center"/>
206+
<Setter Property="Visibility" Value="Collapsed"/>
207+
<Setter Property="Foreground" Value="{StaticResource AccentColour2}"/>
208+
<Style.Triggers>
209+
<MultiDataTrigger>
210+
<MultiDataTrigger.Conditions>
211+
<Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="True" />
212+
<Condition Binding="{Binding IsDragDrop, RelativeSource={RelativeSource AncestorType=CommonControls:ViewControl}}" Value="True" />
213+
<Condition Binding="{Binding DragDropType, RelativeSource={RelativeSource AncestorType=CommonControls:ViewControl}}" Value="Image" />
214+
</MultiDataTrigger.Conditions>
215+
<MultiDataTrigger.Setters>
216+
<Setter Property="Visibility" Value="Visible"/>
217+
</MultiDataTrigger.Setters>
218+
</MultiDataTrigger>
219+
</Style.Triggers>
220+
</Style>
221+
202222

203223
<Style x:Key="VideoDropZoneStyle" TargetType="{x:Type Border}">
204224
<Setter Property="AllowDrop" Value="False"/>
@@ -293,7 +313,7 @@
293313
<Setter Property="Placement" Value="Bottom"/>
294314
<Setter Property="FontSize" Value="14"/>
295315
<Setter Property="IconSize" Value="17"/>
296-
<Setter Property="IconStyle" Value="Solid"/>
316+
<Setter Property="IconStyle" Value="SharpLight"/>
297317
<Setter Property="FontWeight" Value="Bold"/>
298318
<Setter Property="TextOpacity" Value=".8"/>
299319
<Setter Property="TextMargin" Value="1,-3,0,0"/>
@@ -310,7 +330,7 @@
310330
<Setter Property="FontWeight" Value="Bold"/>
311331
<Setter Property="TextOpacity" Value=".8"/>
312332
<Setter Property="IconSize" Value="20"/>
313-
<Setter Property="IconStyle" Value="Solid"/>
333+
<Setter Property="IconStyle" Value="SharpLight"/>
314334
<Setter Property="IconColor" Value="{StaticResource AccentColour2}"/>
315335
</Style>
316336

DiffuseApp/DiffuseApp/App.xaml.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
using System.Threading.Tasks;
1313
using System.Windows;
1414
using System.Windows.Threading;
15+
using TensorStack.Common.Common;
1516
using TensorStack.WPF;
1617
using TensorStack.WPF.Services;
1718

@@ -143,6 +144,7 @@ private async Task AppShutdown()
143144
_appMutex.WaitOne();
144145
_appMutex.ReleaseMutex();
145146
_appMutex.Dispose();
147+
FileQueue.Shutdown();
146148
}
147149
}
148150

DiffuseApp/DiffuseApp/Common/ExtractModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ public class ExtractModel : BaseModel
1818
public string Name { get; set; }
1919
public bool IsDefault { get; set; }
2020
public ExtractorType Type { get; set; }
21-
public int Channels { get; set; }
21+
public int Channels { get; set; } = 3;
2222
public int SampleSize { get; set; }
2323
public Normalization Normalization { get; set; } = Normalization.ZeroToOne;
2424
public Normalization OutputNormalization { get; set; } = Normalization.OneToOne;
25-
public int OutputChannels { get; set; }
25+
public int OutputChannels { get; set; } = 1;
2626
public bool IsDynamicOutput { get; set; }
2727
public ExtractInputOptions DefaultOptions { get; set; }
2828
public string[] UrlPaths { get; set; }

DiffuseApp/DiffuseApp/Common/PipelineModel.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ public bool IsReloadRequired(PipelineModel pipeline)
7878
|| pipeline.LoraAdapterModel != _loraAdapterModel
7979
|| pipeline.ControlNetModel != _controlNetModel
8080
|| pipeline.MemoryMode != _memoryMode
81-
|| pipeline.DataType != _dataType;
81+
|| pipeline.DataType != _dataType
82+
|| pipeline.ProcessType != _processType;
8283
}
8384
}
8485
}

DiffuseApp/DiffuseApp/Controls/DiffusionInputControl.xaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,10 @@
193193
<CommonControls:SliderControl Text="Strength" Value="{Binding Options.Strength}" IsPercent="True" Minimum="0.01" Maximum="1" TickFrequency="0.01"/>
194194
</StackPanel>
195195

196-
196+
<!--ImageInpaint-->
197+
<StackPanel Visibility="{Binding ProcessType, Converter={StaticResource EnumToVisibilityConverter}, ConverterParameter=ImageInpaint}">
198+
<CommonControls:SliderControl Text="Strength" Value="{Binding Options.Strength}" IsPercent="True" Minimum="0.01" Maximum="1" TickFrequency="0.01"/>
199+
</StackPanel>
197200

198201
<!--ControlNetImage-->
199202
<StackPanel Visibility="{Binding ProcessType, Converter={StaticResource EnumToVisibilityConverter}, ConverterParameter=ControlNetImage}">

DiffuseApp/DiffuseApp/Controls/DiffusionInputControl.xaml.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,10 @@ public bool IsGuidance2Enabled
164164
private Task OnPipelineChanged(PipelineModel oldPipeline, PipelineModel newPipeline)
165165
{
166166
if (newPipeline is null || newPipeline.DiffusionModel is null)
167+
{
168+
IsModelOptionsVisible = false;
167169
return Task.CompletedTask;
170+
}
168171

169172
var oldModel = oldPipeline?.DiffusionModel;
170173
var oldOptions = oldModel?.DefaultOptions;

DiffuseApp/DiffuseApp/Controls/DiffusionModelControl.xaml.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ public PipelineModel CurrentPipeline
100100
set { SetValue(CurrentPipelineProperty, value); }
101101
}
102102

103+
103104
public bool IsSelectionValid
104105
{
105106
get { return (bool)GetValue(IsSelectionValidProperty); }
@@ -288,10 +289,8 @@ private Task UnloadAsync()
288289
{
289290
_currentModel = default;
290291

291-
SelectedControlNet = default;
292-
SelectedExtractor = default;
292+
IsSelectionValid = false;
293293
LoraAdapters.Clear();
294-
SelectedUpscaler = default;
295294

296295
IsExtractorEnabled = false;
297296
IsLoraEnabled = false;
@@ -336,8 +335,8 @@ private bool HasCurrentChanged()
336335
|| _currentControlNet != SelectedControlNet
337336
|| _currentExtractor != SelectedExtractor
338337
|| _currentExtractorEnabled != _isExtractorEnabled
339-
|| HasLoraChanged()
340338
|| _currentLoraEnabled != _isLoraEnabled
339+
|| HasLoraChanged()
341340
|| _currentUpscaler != SelectedUpscaler
342341
|| _currentUpscalerEnabled != _isUpscalerEnabled
343342
|| _currentMemoryMode != SelectedMemoryMode.MemoryMode
@@ -558,8 +557,12 @@ private bool IsLoraValid()
558557
return LoraAdapters.Count > 0 && LoraAdapters.All(x => !string.IsNullOrEmpty(x.Name));
559558
}
560559

560+
561561
public bool HasLoraChanged()
562562
{
563+
if (!_isLoraSupported || !_isLoraEnabled)
564+
return false;
565+
563566
if (_currentLora == null && LoraAdapters == null)
564567
return false;
565568
if (_currentLora == null || LoraAdapters == null)

DiffuseApp/DiffuseApp/Dialogs/DiffusionModelDialog.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
<CheckBox x:Name="CheckBoxImageToImage" Content="ImageToImage" />
9696
<CheckBox x:Name="CheckBoxImageToVideo" Content="ImageToVideo" />
9797
<CheckBox x:Name="CheckBoxImageEdit" Content="ImageEdit" />
98+
<CheckBox x:Name="CheckBoxImageInpaint" Content="ImageInpaint" />
9899
<CheckBox x:Name="CheckBoxVideoToVideo" Content="VideoToVideo" />
99100
<CheckBox x:Name="CheckBoxControlNetImage" Content="Image (ControlNet)" />
100101
</UniformGrid>

DiffuseApp/DiffuseApp/Dialogs/DiffusionModelDialog.xaml.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,8 @@ private void SetProcessTypes()
370370
CheckBoxImageToImage.IsChecked = true;
371371
if (processType == ProcessType.ImageEdit)
372372
CheckBoxImageEdit.IsChecked = true;
373+
if (processType == ProcessType.ImageInpaint)
374+
CheckBoxImageInpaint.IsChecked = true;
373375
if (processType == ProcessType.ControlNetImage)
374376
CheckBoxControlNetImage.IsChecked = true;
375377
if (processType == ProcessType.ControlNetImageToImage)
@@ -394,6 +396,8 @@ IEnumerable<ProcessType> ProcessTypes()
394396
yield return ProcessType.ImageToImage;
395397
if (CheckBoxImageEdit.IsChecked == true)
396398
yield return ProcessType.ImageEdit;
399+
if (CheckBoxImageInpaint.IsChecked == true)
400+
yield return ProcessType.ImageInpaint;
397401
if (CheckBoxControlNetImage.IsChecked == true)
398402
yield return ProcessType.ControlNetImage;
399403
if (CheckBoxControlNetImageToImage.IsChecked == true)

DiffuseApp/DiffuseApp/DiffuseApp.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
<!--Fonts-->
6464
<ItemGroup Condition="Exists('Fonts\Brands-Regular-400.otf')">
6565
<Resource Include="Fonts\Brands-Regular-400.otf" />
66-
<Resource Include="Fonts\Duotone-Solid-900.otf" />
6766
<Resource Include="Fonts\Light-300.otf" />
6867
<Resource Include="Fonts\Regular-400.otf" />
6968
<Resource Include="Fonts\Sharp-Light-300.otf" />
@@ -74,7 +73,6 @@
7473
<Resource Include="Fonts\Thin-100.otf" />
7574
</ItemGroup>
7675

77-
7876
<!--Settings-->
7977
<ItemGroup>
8078
<None Update="Settings.default.json">

0 commit comments

Comments
 (0)