Skip to content

Commit dd2eef6

Browse files
committed
Merge pull request LykosAI#1164 from ionite34/moar-fixes
Comfy-zluda fixes, use launch scripts for swarm, possibly fix some threading issues in a couple components, and fix wrong destination file name when moving duplicates for model sharing (cherry picked from commit 03d526b416eaa72cee30938ac5c5aaad0f79f626)
1 parent c0eb742 commit dd2eef6

File tree

11 files changed

+201
-33
lines changed

11 files changed

+201
-33
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,21 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2.0.0.html).
77

88
## v2.15.3
9+
### Changed
10+
- Updated fallback rocm index for InvokeAI to rocm6.3
11+
- Updated SwarmUI to launch via the launch script for better compatibility
912
### Fixed
13+
- Fixed cuDNN frontend error on ComfyUI-Zluda startup (thanks @neural_fault!)
14+
- Maybe finally actually fixed threading issue with the Python Packages dialog search box for real this time? (may fix [#1392](https://github.com/LykosAI/StabilityMatrix/issues/1392))
15+
- Fixed potential install failures when moving duplicate files into shared model folders (may fix [#1393](https://github.com/LykosAI/StabilityMatrix/issues/1393))
16+
- Fixed potential threading issues with the Inference image gallery (may fix [#1408](https://github.com/LykosAI/StabilityMatrix/issues/1408))
1017
- Fixed [#1424](https://github.com/LykosAI/StabilityMatrix/issues/1424) - Civitai account 401 error when connecting accounts, updated for new API changes
18+
### Supporters
19+
#### 🌟 Visionaries
20+
Our deepest gratitude to our Visionaries for their foundational support: **Waterclouds**, **JungleDragon**, **bluepopsicle**, **Bob S**, and **whudunit**! Your commitment allows us to focus on the essential work of squashing bugs and improving stability, ensuring a rock-solid experience for everyone.
21+
#### 🚀 Pioneers
22+
A huge thank you to our incredible Pioneers for keeping the project on track! Your support is vital for these important refinement updates. Thank you to **Szir777**, **Noah M**, **USATechDude**, **Thom**, **SeraphOfSalem**, **Desert Viber**, **Tundra Everquill**, **Adam**, **Droolguy**, **Philip R.**, **ACTUALLY_the_Real_Willem_Dafoe**, **takyamtom**, and a warm welcome to our newest Pioneer, **robek**!
23+
1124

1225
## v2.15.2
1326
### Changed

StabilityMatrix.Avalonia/Helpers/UnixPrerequisiteHelper.cs

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
using StabilityMatrix.Avalonia.Languages;
1313
using StabilityMatrix.Core.Exceptions;
1414
using StabilityMatrix.Core.Helper;
15+
using StabilityMatrix.Core.Helper.HardwareInfo;
1516
using StabilityMatrix.Core.Models;
1617
using StabilityMatrix.Core.Models.FileInterfaces;
1718
using StabilityMatrix.Core.Models.Packages;
@@ -696,6 +697,69 @@ public async Task InstallUvIfNecessary(IProgress<ProgressReport>? progress = nul
696697
File.Delete(UvDownloadPath);
697698
}
698699

700+
public string? GetGfxArchFromAmdGpuName()
701+
{
702+
var gpu =
703+
settingsManager.Settings.PreferredGpu
704+
?? HardwareHelper.IterGpuInfo().FirstOrDefault(x => x is { Name: not null, IsAmd: true });
705+
706+
if (gpu?.Name is null || !gpu.IsAmd)
707+
return null;
708+
709+
// Normalize for safer substring checks (handles RX7800 vs RX 7800, etc.)
710+
var name = gpu.Name;
711+
var nameNoSpaces = name.Replace(" ", "", StringComparison.Ordinal);
712+
713+
return name switch
714+
{
715+
// RDNA4
716+
_ when Has("9060") || Has("9070") => "gfx1201",
717+
718+
// RDNA3.5 APUs
719+
_ when Has("860M") => "gfx1152",
720+
_ when Has("890M") => "gfx1150",
721+
_ when Has("8040S") || Has("8050S") || Has("8060S") || Has("880M") || Has("Z2 Extreme") =>
722+
"gfx1151",
723+
724+
// RDNA3 APUs (Phoenix)
725+
_ when Has("740M") || Has("760M") || Has("780M") || Has("Z1") || Has("Z2") => "gfx1103",
726+
727+
// RDNA3 dGPU Navi33
728+
_ when Has("7400") || Has("7500") || Has("7600") || Has("7650") || Has("7700S") => "gfx1102",
729+
730+
// RDNA3 dGPU Navi32
731+
_ when Has("7700") || Has("RX 7800") || HasNoSpace("RX7800") => "gfx1101",
732+
733+
// RDNA3 dGPU Navi31 (incl. Pro)
734+
_ when Has("W7800") || Has("7900") || Has("7950") || Has("7990") => "gfx1100",
735+
736+
// RDNA2 APUs (Rembrandt)
737+
_ when Has("660M") || Has("680M") => "gfx1035",
738+
739+
// RDNA2 Navi24 low-end (incl. some mobiles)
740+
_ when Has("6300") || Has("6400") || Has("6450") || Has("6500") || Has("6550") || Has("6500M") =>
741+
"gfx1034",
742+
743+
// RDNA2 Navi23
744+
_ when Has("6600") || Has("6650") || Has("6700S") || Has("6800S") || Has("6600M") => "gfx1032",
745+
746+
// RDNA2 Navi22 (note: desktop 6800 is NOT here; that’s Navi21/gfx1030)
747+
_ when Has("6700") || Has("6750") || Has("6800M") || Has("6850M") => "gfx1031",
748+
749+
// RDNA2 Navi21 (big die)
750+
_ when Has("6800") || Has("6900") || Has("6950") => "gfx1030",
751+
752+
_ => null,
753+
};
754+
755+
bool HasNoSpace(string s) =>
756+
nameNoSpaces.Contains(
757+
s.Replace(" ", "", StringComparison.Ordinal),
758+
StringComparison.OrdinalIgnoreCase
759+
);
760+
bool Has(string s) => name.Contains(s, StringComparison.OrdinalIgnoreCase);
761+
}
762+
699763
private async Task DownloadAndExtractPrerequisite(
700764
IProgress<ProgressReport>? progress,
701765
string downloadUrl,

StabilityMatrix.Avalonia/Helpers/WindowsPrerequisiteHelper.cs

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -921,6 +921,69 @@ public async Task AddMissingLibsToVenv(
921921
// await downloadPath.DeleteAsync();
922922
}
923923

924+
public string? GetGfxArchFromAmdGpuName()
925+
{
926+
var gpu =
927+
settingsManager.Settings.PreferredGpu
928+
?? HardwareHelper.IterGpuInfo().FirstOrDefault(x => x is { Name: not null, IsAmd: true });
929+
930+
if (gpu?.Name is null || !gpu.IsAmd)
931+
return null;
932+
933+
// Normalize for safer substring checks (handles RX7800 vs RX 7800, etc.)
934+
var name = gpu.Name;
935+
var nameNoSpaces = name.Replace(" ", "", StringComparison.Ordinal);
936+
937+
return name switch
938+
{
939+
// RDNA4
940+
_ when Has("9060") || Has("9070") => "gfx1201",
941+
942+
// RDNA3.5 APUs
943+
_ when Has("860M") => "gfx1152",
944+
_ when Has("890M") => "gfx1150",
945+
_ when Has("8040S") || Has("8050S") || Has("8060S") || Has("880M") || Has("Z2 Extreme") =>
946+
"gfx1151",
947+
948+
// RDNA3 APUs (Phoenix)
949+
_ when Has("740M") || Has("760M") || Has("780M") || Has("Z1") || Has("Z2") => "gfx1103",
950+
951+
// RDNA3 dGPU Navi33
952+
_ when Has("7400") || Has("7500") || Has("7600") || Has("7650") || Has("7700S") => "gfx1102",
953+
954+
// RDNA3 dGPU Navi32
955+
_ when Has("7700") || Has("RX 7800") || HasNoSpace("RX7800") => "gfx1101",
956+
957+
// RDNA3 dGPU Navi31 (incl. Pro)
958+
_ when Has("W7800") || Has("7900") || Has("7950") || Has("7990") => "gfx1100",
959+
960+
// RDNA2 APUs (Rembrandt)
961+
_ when Has("660M") || Has("680M") => "gfx1035",
962+
963+
// RDNA2 Navi24 low-end (incl. some mobiles)
964+
_ when Has("6300") || Has("6400") || Has("6450") || Has("6500") || Has("6550") || Has("6500M") =>
965+
"gfx1034",
966+
967+
// RDNA2 Navi23
968+
_ when Has("6600") || Has("6650") || Has("6700S") || Has("6800S") || Has("6600M") => "gfx1032",
969+
970+
// RDNA2 Navi22 (note: desktop 6800 is NOT here; that’s Navi21/gfx1030)
971+
_ when Has("6700") || Has("6750") || Has("6800M") || Has("6850M") => "gfx1031",
972+
973+
// RDNA2 Navi21 (big die)
974+
_ when Has("6800") || Has("6900") || Has("6950") => "gfx1030",
975+
976+
_ => null,
977+
};
978+
979+
bool HasNoSpace(string s) =>
980+
nameNoSpaces.Contains(
981+
s.Replace(" ", "", StringComparison.Ordinal),
982+
StringComparison.OrdinalIgnoreCase
983+
);
984+
bool Has(string s) => name.Contains(s, StringComparison.OrdinalIgnoreCase);
985+
}
986+
924987
private async Task DownloadAndExtractPrerequisite(
925988
IProgress<ProgressReport>? progress,
926989
string downloadUrl,

StabilityMatrix.Avalonia/ViewModels/Dialogs/PythonPackagesViewModel.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ private void PostConstruct()
6868
var searchPredicate = this.WhenPropertyChanged(vm => vm.SearchQuery)
6969
.Throttle(TimeSpan.FromMilliseconds(100))
7070
.DistinctUntilChanged()
71+
.ObserveOn(SynchronizationContext.Current!)
7172
.Select(value =>
7273
{
7374
if (string.IsNullOrWhiteSpace(value.Value))
@@ -86,8 +87,8 @@ private void PostConstruct()
8687
.Filter(searchPredicate)
8788
.Transform(p => new PythonPackagesItemViewModel(settingsManager) { Package = p })
8889
.SortBy(vm => vm.Package.Name)
89-
.Bind(Packages)
9090
.ObserveOn(SynchronizationContext.Current!)
91+
.Bind(Packages)
9192
.Subscribe();
9293
}
9394

@@ -120,10 +121,14 @@ await pyInstallationManager.GetInstallationAsync(
120121

121122
var packages = await venvRunner.PipList();
122123

123-
packageSource.EditDiff(packages);
124+
Dispatcher.UIThread.Post(() =>
125+
{
126+
var currentName = SelectedPackage?.Package.Name;
127+
SelectedPackage = null;
124128

125-
// Delay a bit to prevent thread issues with UI list
126-
await Task.Delay(100);
129+
packageSource.EditDiff(packages);
130+
SelectedPackage = Packages.FirstOrDefault(p => p.Package.Name == currentName);
131+
});
127132
}
128133
}
129134
finally
@@ -155,6 +160,7 @@ await pyInstallationManager.GetInstallationAsync(
155160
{
156161
// Backup selected package
157162
var currentPackageName = SelectedPackage?.Package.Name;
163+
SelectedPackage = null;
158164

159165
packageSource.EditDiff(packages);
160166

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Linq;
2+
using Avalonia.Threading;
23
using StabilityMatrix.Avalonia.Models;
34

45
namespace StabilityMatrix.Avalonia.ViewModels.Inference;
@@ -12,13 +13,20 @@ public interface IImageGalleryComponent
1213
/// </summary>
1314
public void LoadImagesToGallery(params ImageSource[] imageSources)
1415
{
15-
ImageGalleryCardViewModel.ImageSources.Clear();
16-
17-
foreach (var imageSource in imageSources)
16+
Dispatcher.UIThread.Post(() =>
1817
{
19-
ImageGalleryCardViewModel.ImageSources.Add(imageSource);
20-
}
18+
ImageGalleryCardViewModel.SelectedImage = null;
19+
ImageGalleryCardViewModel.SelectedImageIndex = -1;
20+
21+
ImageGalleryCardViewModel.ImageSources.Clear();
22+
23+
foreach (var imageSource in imageSources)
24+
{
25+
ImageGalleryCardViewModel.ImageSources.Add(imageSource);
26+
}
2127

22-
ImageGalleryCardViewModel.SelectedImage = imageSources.FirstOrDefault();
28+
ImageGalleryCardViewModel.SelectedImageIndex = imageSources.Length > 0 ? 0 : -1;
29+
ImageGalleryCardViewModel.SelectedImage = imageSources.FirstOrDefault();
30+
});
2331
}
2432
}

StabilityMatrix.Core/Helper/FileTransfers.cs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public static ulong GetBufferSize(ulong totalBytes) =>
2424
< 100 * Size.MiB => 16 * Size.KiB,
2525
< 500 * Size.MiB => Size.MiB,
2626
< Size.GiB => 16 * Size.MiB,
27-
_ => 32 * Size.MiB
27+
_ => 32 * Size.MiB,
2828
};
2929

3030
/// <summary>
@@ -234,12 +234,15 @@ public static async Task MoveFileAsync(
234234
// append a number to the file name until it doesn't exist
235235
for (var i = 0; i < 100; i++)
236236
{
237-
if (!destinationFile.Exists)
237+
var destDir = destinationFile.Directory;
238+
var baseName = destinationFile.NameWithoutExtension;
239+
var ext = destinationFile.Extension;
240+
var candidate = destDir?.JoinFile($"{baseName} ({i}){ext}");
241+
if (candidate?.Exists is false)
242+
{
243+
destinationFile = candidate;
238244
break;
239-
240-
destinationFile = new FilePath(
241-
destinationFile.NameWithoutExtension + $" ({i})" + destinationFile.Extension
242-
);
245+
}
243246
}
244247
}
245248
else if (!overwrite)

StabilityMatrix.Core/Helper/IPrerequisiteHelper.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,4 +297,5 @@ Task AddMissingLibsToVenv(
297297
Task InstallPythonIfNecessary(PyVersion version, IProgress<ProgressReport>? progress = null);
298298
Task InstallVirtualenvIfNecessary(PyVersion version, IProgress<ProgressReport>? progress = null);
299299
Task InstallTkinterIfNecessary(PyVersion version, IProgress<ProgressReport>? progress = null);
300+
string? GetGfxArchFromAmdGpuName();
300301
}

StabilityMatrix.Core/Models/PackageModification/InstallSageAttentionStep.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ await pyInstallationManager.GetInstallationAsync(pyVersion).ConfigureAwait(false
9494
sageWheelUrl =
9595
"https://github.com/woct0rdho/SageAttention/releases/download/v2.2.0-windows.post3/sageattention-2.2.0+cu128torch2.9.0.post3-cp39-abi3-win_amd64.whl";
9696
}
97+
else if (torchInfo.Version.Contains("2.9.0") && torchInfo.Version.Contains("cu130"))
98+
{
99+
sageWheelUrl =
100+
"https://github.com/woct0rdho/SageAttention/releases/download/v2.2.0-windows.post3/sageattention-2.2.0+cu130torch2.9.0.post3-cp39-abi3-win_amd64.whl";
101+
}
97102

98103
var pipArgs = new PipInstallArgs("triton-windows");
99104

StabilityMatrix.Core/Models/Packages/ComfyZluda.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ private Dictionary<string, string> GetEnvVars(bool isInstall)
201201
["HIP_PATH_64"] = hipPath,
202202
["GIT"] = portableGitBin.JoinFile("git.exe"),
203203
};
204-
envVars.Update(settingsManager.Settings.EnvironmentVariables);
205204

206205
if (envVars.TryGetValue("PATH", out var pathValue))
207206
{
@@ -219,6 +218,14 @@ private Dictionary<string, string> GetEnvVars(bool isInstall)
219218
envVars["MIOPEN_FIND_MODE"] = "2";
220219
envVars["MIOPEN_LOG_LEVEL"] = "3";
221220

221+
var gfxArch = PrerequisiteHelper.GetGfxArchFromAmdGpuName();
222+
if (!string.IsNullOrWhiteSpace(gfxArch))
223+
{
224+
envVars["TRITON_OVERRIDE_ARCH"] = gfxArch;
225+
}
226+
227+
envVars.Update(settingsManager.Settings.EnvironmentVariables);
228+
222229
return envVars;
223230
}
224231
}

StabilityMatrix.Core/Models/Packages/InvokeAI.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ public override async Task InstallPackage(
215215
TorchIndex.Cpu when Compat.IsLinux => "https://download.pytorch.org/whl/cpu",
216216
TorchIndex.Cuda when isLegacyNvidiaGpu => "https://download.pytorch.org/whl/cu126",
217217
TorchIndex.Cuda => "https://download.pytorch.org/whl/cu128",
218-
TorchIndex.Rocm => "https://download.pytorch.org/whl/rocm6.2.4",
218+
TorchIndex.Rocm => "https://download.pytorch.org/whl/rocm6.3",
219219
_ => string.Empty,
220220
};
221221

0 commit comments

Comments
 (0)