Skip to content

Commit 4b04e84

Browse files
committed
Fix CUDNN toggle module: add DisableCudnn property and simplify UI to single toggle
1 parent acf87de commit 4b04e84

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

StabilityMatrix.Avalonia/Controls/Inference/CfzCudnnToggleCard.axaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@
1313
<ControlTemplate>
1414
<controls:Card x:Name="PART_Card">
1515
<StackPanel Spacing="8">
16-
<TextBlock Text="Enable CUDNN" FontSize="14" FontWeight="Bold" />
17-
<ToggleSwitch
18-
IsChecked="{Binding EnableCudnn}"
19-
Margin="8,0,4,0"
20-
HorizontalAlignment="Stretch" />
21-
2216
<TextBlock Text="Disable CUDNN" FontSize="14" FontWeight="Bold" />
2317
<ToggleSwitch
2418
IsChecked="{Binding DisableCudnn}"

StabilityMatrix.Avalonia/ViewModels/Inference/CfzCudnnToggleCardViewModel.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,4 @@ public partial class CfzCudnnToggleCardViewModel : LoadableViewModelBase
1515

1616
[ObservableProperty]
1717
private bool disableCudnn = true;
18-
19-
[ObservableProperty]
20-
private bool cudnnBenchmark = false;
2118
}

StabilityMatrix.Avalonia/ViewModels/Inference/Modules/CfzCudnnToggleModule.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public CfzCudnnToggleModule(IServiceManager<ViewModelBase> vmFactory)
1919
: base(vmFactory)
2020
{
2121
Title = "CUDNN Toggle (ComfyUI-Zluda)";
22+
AddCards(vmFactory.Get<CfzCudnnToggleCardViewModel>());
2223
}
2324

2425
/// <summary>
@@ -37,6 +38,7 @@ protected override void OnApplyStep(ModuleApplyStepEventArgs e)
3738
// Check if primary is a latent (from sampler output)
3839
if (primary.IsT0) // T0 is LatentNodeConnection
3940
{
41+
var card = GetCard<CfzCudnnToggleCardViewModel>();
4042
var latentConnection = primary.AsT0;
4143

4244
// Insert CUDNN toggle node between sampler and VAE decode
@@ -47,8 +49,8 @@ protected override void OnApplyStep(ModuleApplyStepEventArgs e)
4749
Model = null,
4850
Conditioning = null,
4951
Latent = latentConnection, // Pass through the latent from sampler
50-
EnableCudnn = !Card.DisableCudnn,
51-
CudnnBenchmark = Card.CudnnBenchmark,
52+
EnableCudnn = !card.DisableCudnn,
53+
CudnnBenchmark = false,
5254
}
5355
);
5456

0 commit comments

Comments
 (0)