Browse Source

Apply post install dep updates for ComfyUI ext update

pull/629/head
Ionite 8 months ago
parent
commit
ff26180e8b
No known key found for this signature in database
  1. 40
      StabilityMatrix.Core/Models/Packages/ComfyUI.cs

40
StabilityMatrix.Core/Models/Packages/ComfyUI.cs

@ -511,6 +511,32 @@ public class ComfyUI(
}
}
/// <inheritdoc />
public override async Task UpdateExtensionAsync(
InstalledPackageExtension installedExtension,
InstalledPackage installedPackage,
PackageExtensionVersion? version = null,
IProgress<ProgressReport>? progress = null,
CancellationToken cancellationToken = default
)
{
await base.UpdateExtensionAsync(
installedExtension,
installedPackage,
version,
progress,
cancellationToken
)
.ConfigureAwait(false);
cancellationToken.ThrowIfCancellationRequested();
var installedDirs = installedExtension.Paths.OfType<DirectoryPath>().Where(dir => dir.Exists);
await PostInstallAsync(installedPackage, installedDirs, progress, cancellationToken)
.ConfigureAwait(false);
}
/// <inheritdoc />
public override async Task InstallExtensionAsync(
PackageExtension extension,
@ -539,6 +565,20 @@ public class ComfyUI(
.Select(path => cloneRoot.JoinDir(path!))
.Where(dir => dir.Exists);
await PostInstallAsync(installedPackage, installedDirs, progress, cancellationToken)
.ConfigureAwait(false);
}
/// <summary>
/// Runs post install / update tasks (i.e. install.py, requirements.txt)
/// </summary>
private async Task PostInstallAsync(
InstalledPackage installedPackage,
IEnumerable<DirectoryPath> installedDirs,
IProgress<ProgressReport>? progress = null,
CancellationToken cancellationToken = default
)
{
foreach (var installedDir in installedDirs)
{
cancellationToken.ThrowIfCancellationRequested();

Loading…
Cancel
Save