Skip to content

Commit 1c447e3

Browse files
committed
Refactor ComfyZluda class to streamline launch options and improve stability settings
1 parent c421649 commit 1c447e3

1 file changed

Lines changed: 44 additions & 24 deletions

File tree

StabilityMatrix.Core/Models/Packages/ComfyZluda.cs

Lines changed: 44 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
using System.Diagnostics;
2-
using System.Text.RegularExpressions;
3-
using Injectio.Attributes;
4-
using StabilityMatrix.Core.Exceptions;
1+
using StabilityMatrix.Core.Exceptions;
52
using StabilityMatrix.Core.Extensions;
63
using StabilityMatrix.Core.Helper;
74
using StabilityMatrix.Core.Helper.Cache;
85
using StabilityMatrix.Core.Helper.HardwareInfo;
9-
using StabilityMatrix.Core.Models;
106
using StabilityMatrix.Core.Models.FileInterfaces;
117
using StabilityMatrix.Core.Models.Progress;
128
using StabilityMatrix.Core.Processes;
@@ -41,7 +37,7 @@ IPyInstallationManager pyInstallationManager
4137
public override string Disclaimer =>
4238
"Prerequisite install may require admin privileges and a reboot. "
4339
+ "Visual Studio Build Tools for C++ Desktop Development will be installed automatically. "
44-
+ "AMD GPUs under the RX 6800 may require additional manual setup.";
40+
+ "AMD GPUs under the RX 6800 may require additional manual setup. ";
4541
public override string LaunchCommand => Path.Combine("zluda", "zluda.exe");
4642

4743
public override List<LaunchOptionDefinition> LaunchOptions
@@ -56,31 +52,55 @@ public override List<LaunchOptionDefinition> LaunchOptions
5652
{
5753
options[crossAttentionIndex] = options[crossAttentionIndex] with
5854
{
59-
InitialValue = "--use-quad-cross-attention"
55+
InitialValue = "--use-quad-cross-attention",
6056
};
6157
}
6258

6359
// Add new options before Extras (which is usually last)
6460
var extrasIndex = options.FindIndex(o => o.Name == "Extra Launch Arguments");
6561
var insertIndex = extrasIndex != -1 ? extrasIndex : options.Count;
6662

67-
options.Insert(insertIndex, new LaunchOptionDefinition
68-
{
69-
Name = "Disable Async Offload",
70-
Type = LaunchOptionType.Bool,
71-
InitialValue = true,
72-
Options = ["--disable-async-offload"],
73-
Description = "Disable async weight offloading. Recommended for ZLUDA stability.",
74-
});
75-
76-
options.Insert(insertIndex + 1, new LaunchOptionDefinition
77-
{
78-
Name = "Disable Pinned Memory",
79-
Type = LaunchOptionType.Bool,
80-
InitialValue = true,
81-
Options = ["--disable-pinned-memory"],
82-
Description = "Disable pinned memory. Recommended for ZLUDA stability.",
83-
});
63+
options.Insert(
64+
insertIndex,
65+
new LaunchOptionDefinition
66+
{
67+
Name = "Disable Async Offload",
68+
Type = LaunchOptionType.Bool,
69+
InitialValue = true,
70+
Options = ["--disable-async-offload"],
71+
}
72+
);
73+
74+
options.Insert(
75+
insertIndex + 1,
76+
new LaunchOptionDefinition
77+
{
78+
Name = "Disable Pinned Memory",
79+
Type = LaunchOptionType.Bool,
80+
InitialValue = true,
81+
Options = ["--disable-pinned-memory"],
82+
}
83+
);
84+
options.Insert(
85+
insertIndex + 2,
86+
new LaunchOptionDefinition
87+
{
88+
Name = "Disable Smart Memory",
89+
Type = LaunchOptionType.Bool,
90+
InitialValue = false,
91+
Options = ["--disable-smart-memory"],
92+
}
93+
);
94+
options.Insert(
95+
insertIndex + 3,
96+
new LaunchOptionDefinition
97+
{
98+
Name = "Disable Model/Node Caching",
99+
Type = LaunchOptionType.Bool,
100+
InitialValue = false,
101+
Options = ["--cache-none"],
102+
}
103+
);
84104

85105
return options;
86106
}

0 commit comments

Comments
 (0)