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

Commit f693d59

Browse files
committed
Support 1 step inference in UI
1 parent 951ef37 commit f693d59

File tree

4 files changed

+39
-12
lines changed

4 files changed

+39
-12
lines changed

OnnxStack.UI/Models/SchedulerOptionsModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public int Seed
8080
/// <value>
8181
/// The number of steps to run inference for. The more steps the longer it will take to run the inference loop but the image quality should improve.
8282
/// </value>
83-
[Range(5, 200)]
83+
[Range(1, 200)]
8484
public int InferenceSteps
8585
{
8686
get { return _inferenceSteps; }

OnnxStack.UI/UserControls/SchedulerControl.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@
163163
<Label>Inference Steps</Label>
164164
<TextBlock Text="{Binding ElementName=SliderInferenceSteps, Path=Value, StringFormat={}{0}}" VerticalAlignment="Bottom" HorizontalAlignment="Right" FontSize="10" Margin="0,0,6,0" FontWeight="Medium" />
165165
</DockPanel>
166-
<Slider Name="SliderInferenceSteps" Value="{Binding SchedulerOptions.InferenceSteps}" Minimum="2" Maximum="{Binding SchedulerOptions.OriginalInferenceSteps}" TickFrequency="1" IsSnapToTickEnabled="True" SmallChange="1" LargeChange="1" >
166+
<Slider Name="SliderInferenceSteps" Value="{Binding SchedulerOptions.InferenceSteps}" Minimum="1" Maximum="{Binding SchedulerOptions.OriginalInferenceSteps}" TickFrequency="1" IsSnapToTickEnabled="True" SmallChange="1" LargeChange="1" >
167167
<i:Interaction.Behaviors>
168168
<behaviors:SliderMouseWheelBehavior />
169169
</i:Interaction.Behaviors>

OnnxStack.UI/UserControls/SchedulerControl.xaml.cs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Models;
1+
using LibGit2Sharp;
2+
using Models;
23
using OnnxStack.Core;
34
using OnnxStack.StableDiffusion;
45
using OnnxStack.StableDiffusion.Config;
@@ -150,15 +151,8 @@ private void OnModelChanged(ModelOptionsModel model)
150151
if (model is null)
151152
return;
152153

153-
if (model.ModelOptions.PipelineType == DiffuserPipelineType.StableDiffusion)
154-
{
155-
foreach (SchedulerType type in Enum.GetValues<SchedulerType>().Where(x => x != SchedulerType.LCM))
156-
SchedulerTypes.Add(type);
157-
}
158-
else if (model.ModelOptions.PipelineType == DiffuserPipelineType.LatentConsistency)
159-
{
160-
SchedulerTypes.Add(SchedulerType.LCM);
161-
}
154+
foreach (SchedulerType type in model.ModelOptions.PipelineType.GetSchedulerTypes())
155+
SchedulerTypes.Add(type);
162156

163157
SchedulerOptions.SchedulerType = SchedulerTypes.FirstOrDefault();
164158
}

OnnxStack.UI/appsettings.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,39 @@
441441
"https://raw.githubusercontent.com/saddam213/OnnxStack/master/Assets/Templates/Deliberate-V3/Preview5.png",
442442
"https://raw.githubusercontent.com/saddam213/OnnxStack/master/Assets/Templates/Deliberate-V3/Preview6.png"
443443
]
444+
},
445+
{
446+
"Name": "InstaFlow 0.9B",
447+
"Description": "",
448+
"Author": "TheyCallMeHex",
449+
"Repository": "https://huggingface.co/TheyCallMeHex/InstaFlow-0.9B-ONNX",
450+
"ImageIcon": "",
451+
"Status": "Active",
452+
"PadTokenId": 49407,
453+
"BlankTokenId": 49407,
454+
"TokenizerLimit": 77,
455+
"EmbeddingsLength": 768,
456+
"ScaleFactor": 0.18215,
457+
"PipelineType": "InstaFlow",
458+
"Diffusers": [
459+
"TextToImage"
460+
],
461+
"ModelFiles": [
462+
"https://huggingface.co/TheyCallMeHex/InstaFlow-0.9B-ONNX/resolve/main/tokenizer/model.onnx",
463+
"https://huggingface.co/TheyCallMeHex/InstaFlow-0.9B-ONNX/resolve/main/unet/model.onnx",
464+
"https://huggingface.co/TheyCallMeHex/InstaFlow-0.9B-ONNX/resolve/main/unet/model.onnx_data",
465+
"https://huggingface.co/TheyCallMeHex/InstaFlow-0.9B-ONNX/resolve/main/text_encoder/model.onnx",
466+
"https://huggingface.co/TheyCallMeHex/InstaFlow-0.9B-ONNX/resolve/main/vae_decoder/model.onnx",
467+
"https://huggingface.co/TheyCallMeHex/InstaFlow-0.9B-ONNX/resolve/main/vae_encoder/model.onnx"
468+
],
469+
"Images": [
470+
"",
471+
"",
472+
"",
473+
"",
474+
"",
475+
""
476+
]
444477
}
445478
]
446479
}

0 commit comments

Comments
 (0)