Skip to content

Commit 9a0e51c

Browse files
committed
Refactor: Use constant for venv directory and remove unused parameter
- Added VenvDirectoryName constant for better maintainability - Removed unused installLocation parameter from GetEnvVars method - Tested: Build successful, fresh ComfyUI-Zluda install works, generation successful
1 parent 7a83c6a commit 9a0e51c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

StabilityMatrix.Core/Models/Packages/ComfyZluda.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ IPyInstallationManager pyInstallationManager
2727
"https://github.com/lshqqytiger/ZLUDA/releases/download/rel.5e717459179dc272b7d7d23391f0fad66c7459cf/ZLUDA-nightly-windows-rocm6-amd64.zip";
2828

2929
private const string HipSdkExtensionDownloadUrl = "https://cdn.lykos.ai/HIP-SDK-extension.7z";
30+
private const string VenvDirectoryName = "venv";
3031

3132
private Process? zludaProcess;
3233

@@ -109,7 +110,7 @@ await newInstallBatPath
109110
[],
110111
installLocation,
111112
onConsoleOutput,
112-
GetEnvVars(true, installLocation)
113+
GetEnvVars(true)
113114
);
114115
await installProcess.WaitForExitAsync(cancellationToken).ConfigureAwait(false);
115116

@@ -141,7 +142,7 @@ await SetupVenv(installLocation, pythonVersion: PyVersion.Parse(installedPackage
141142
args,
142143
installLocation,
143144
HandleConsoleOutput,
144-
GetEnvVars(false, installLocation)
145+
GetEnvVars(false)
145146
);
146147

147148
return;
@@ -184,7 +185,7 @@ await zludaProcess
184185
GC.SuppressFinalize(this);
185186
}
186187

187-
private Dictionary<string, string> GetEnvVars(bool isInstall, string installLocation)
188+
private Dictionary<string, string> GetEnvVars(bool isInstall)
188189
{
189190
var portableGitBin = new DirectoryPath(PrerequisiteHelper.GitBinPath);
190191
var hipPath = Path.Combine(
@@ -204,7 +205,7 @@ private Dictionary<string, string> GetEnvVars(bool isInstall, string installLoca
204205

205206
if (isInstall)
206207
{
207-
envVars["VIRTUAL_ENV"] = "venv";
208+
envVars["VIRTUAL_ENV"] = VenvDirectoryName;
208209
}
209210

210211
if (envVars.TryGetValue("PATH", out var pathValue))

0 commit comments

Comments
 (0)