Skip to content
This repository was archived by the owner on Nov 27, 2024. It is now read-only.

Commit 29826f9

Browse files
committed
UI: Fix incorrect diffuser setup on editing ControlNet model
1 parent decad92 commit 29826f9

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

OnnxStack.UI/Dialogs/UpdateModelDialog.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949
<CheckBox IsChecked="{Binding UpdateModelSet.EnableImageToImage}" Content="Image To Image" VerticalAlignment="Center" Margin="0,4,0,0"/>
5050
<CheckBox IsChecked="{Binding UpdateModelSet.EnableImageInpaintLegacy}" Content="Image Inpaint Legacy" VerticalAlignment="Center" Margin="0,4,0,0"/>
5151
<CheckBox IsChecked="{Binding UpdateModelSet.EnableImageInpaint}" Content="Image Inpaint" VerticalAlignment="Center" Margin="0,4,0,0"/>
52+
<CheckBox IsChecked="{Binding UpdateModelSet.EnableControlNet}" Content="ControlNet" VerticalAlignment="Center" Margin="0,4,0,0"/>
53+
<CheckBox IsChecked="{Binding UpdateModelSet.EnableControlNetImage}" Content="ControlNet Image" VerticalAlignment="Center" Margin="0,4,0,0"/>
5254
</UniformGrid>
5355

5456
</StackPanel>

OnnxStack.UI/Models/UpdateStableDiffusionModelSetViewModel.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ public class UpdateStableDiffusionModelSetViewModel : INotifyPropertyChanged
2929
private bool _enableImageToImage;
3030
private bool _enableImageInpaint;
3131
private bool _enableImageInpaintLegacy;
32+
private bool _enableControlNet;
33+
private bool _enableControlNetImage;
3234
private DiffuserPipelineType _pipelineType;
3335
private int _dualEmbeddingsLength;
3436
private TokenizerType _tokenizerType;
@@ -113,6 +115,18 @@ public bool EnableImageInpaintLegacy
113115
set { _enableImageInpaintLegacy = value; NotifyPropertyChanged(); }
114116
}
115117

118+
public bool EnableControlNet
119+
{
120+
get { return _enableControlNet; }
121+
set { _enableControlNet = value; NotifyPropertyChanged(); }
122+
}
123+
124+
public bool EnableControlNetImage
125+
{
126+
get { return _enableControlNetImage; }
127+
set { _enableControlNetImage = value; NotifyPropertyChanged(); }
128+
}
129+
116130
public int DeviceId
117131
{
118132
get { return _deviceId; }
@@ -173,6 +187,10 @@ public IEnumerable<DiffuserType> GetDiffusers()
173187
yield return DiffuserType.ImageInpaint;
174188
if (_enableImageInpaintLegacy)
175189
yield return DiffuserType.ImageInpaintLegacy;
190+
if (_enableControlNet)
191+
yield return DiffuserType.ControlNet;
192+
if (_enableControlNetImage)
193+
yield return DiffuserType.ControlNetImage;
176194
}
177195

178196

@@ -187,6 +205,8 @@ public static UpdateStableDiffusionModelSetViewModel FromModelSet(StableDiffusio
187205
EnableImageInpaintLegacy = modelset.Diffusers.Contains(DiffuserType.ImageInpaintLegacy),
188206
EnableImageToImage = modelset.Diffusers.Contains(DiffuserType.ImageToImage),
189207
EnableTextToImage = modelset.Diffusers.Contains(DiffuserType.TextToImage),
208+
EnableControlNet = modelset.Diffusers.Contains(DiffuserType.ControlNet),
209+
EnableControlNetImage = modelset.Diffusers.Contains(DiffuserType.ControlNetImage),
190210
ExecutionMode = modelset.ExecutionMode,
191211
ExecutionProvider = modelset.ExecutionProvider,
192212
InterOpNumThreads = modelset.InterOpNumThreads,

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,14 @@ __________________________
4747
* Text to Image
4848
* Image to Image
4949
* Image Inpaint
50+
* Video to Video
51+
* Control Net
52+
5053

5154
`OnnxStack.StableDiffusion` provides compatibility with a diverse set of models, including
5255
* StableDiffusion 1.5
5356
* StableDiffusion Inpaint
57+
* StableDiffusion ControlNet
5458
* SDXL
5559
* SDXL Inpaint
5660
* SDXL-Turbo
@@ -107,7 +111,7 @@ We welcome contributions to OnnxStack! If you have any ideas, bug reports, or im
107111

108112

109113
__________________________
110-
## ONNX Runtime Resources
114+
## ONNX Runtime Resources
111115
- [ONNX Runtime C# API Doc](https://onnxruntime.ai/docs/api/csharp/api)
112116
- [Get Started with C# in ONNX Runtime](https://onnxruntime.ai/docs/get-started/with-csharp.html)
113117

@@ -116,4 +120,6 @@ Special thanks to the creators of the fantastic repositories below; all were ins
116120

117121
* [Stable Diffusion with C# and ONNX Runtime](https://github.com/cassiebreviu/stablediffusion) by Cassie Breviu (@cassiebreviu)
118122
* [Diffusers](https://github.com/huggingface/diffusers) by Huggingface (@huggingface)
119-
* [Onnx-Web](https://github.com/ssube/onnx-web) by Sean Sube (@ssube)
123+
* [Onnx-Web](https://github.com/ssube/onnx-web) by Sean Sube (@ssube)
124+
* [Axodox-MachineLearning](https://github.com/axodox/axodox-machinelearning) by Péter Major @(axodox)
125+
* [ControlNet](https://github.com/lllyasviel/ControlNet) by Lvmin Zhang (@lllyasviel)

0 commit comments

Comments
 (0)