Browse Source

Merge pull request #61 from ionite34/sharedfolders-support

Add SharedFolder definitions for VladAutomatic and ComfyUI
pull/5/head
JT 1 year ago committed by GitHub
parent
commit
568cb52d98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      StabilityMatrix/Models/CheckpointFile.cs
  2. 16
      StabilityMatrix/Models/Packages/ComfyUI.cs
  3. 21
      StabilityMatrix/Models/Packages/VladAutomatic.cs
  4. 10
      StabilityMatrix/Models/SharedFolderType.cs

2
StabilityMatrix/Models/CheckpointFile.cs

@ -39,7 +39,7 @@ public partial class CheckpointFile : ObservableObject
public string FileName => Path.GetFileName(FilePath);
private static readonly string[] SupportedCheckpointExtensions = { ".safetensors", ".pt", ".ckpt", ".pth" };
private static readonly string[] SupportedCheckpointExtensions = { ".safetensors", ".pt", ".ckpt", ".pth", "bin" };
private static readonly string[] SupportedImageExtensions = { ".png", ".jpg", ".jpeg" };
partial void OnConnectedModelChanged(ConnectedModelInfo? value)

16
StabilityMatrix/Models/Packages/ComfyUI.cs

@ -30,6 +30,22 @@ public class ComfyUI : BaseGitPackage
{
}
// https://github.com/comfyanonymous/ComfyUI/blob/master/folder_paths.py#L11
public override Dictionary<SharedFolderType, string> SharedFolders => new()
{
[SharedFolderType.StableDiffusion] = "models/checkpoints",
[SharedFolderType.Diffusers] = "models/diffusers",
[SharedFolderType.Lora] = "models/loras",
[SharedFolderType.CLIP] = "models/clip",
[SharedFolderType.TextualInversion] = "models/embeddings",
[SharedFolderType.VAE] = "models/vae",
[SharedFolderType.ApproxVAE] = "models/vae_approx",
[SharedFolderType.ControlNet] = "models/controlnet",
[SharedFolderType.GLIGEN] = "models/gligen",
[SharedFolderType.ESRGAN] = "models/upscale_models",
[SharedFolderType.Hypernetwork] = "models/hypernetworks",
};
public override List<LaunchOptionDefinition> LaunchOptions => new()
{
new()

21
StabilityMatrix/Models/Packages/VladAutomatic.cs

@ -25,6 +25,27 @@ public class VladAutomatic : BaseGitPackage
base(githubApi, settingsManager, downloadService)
{
}
// https://github.com/vladmandic/automatic/blob/master/modules/shared.py#L324
public override Dictionary<SharedFolderType, string> SharedFolders => new()
{
[SharedFolderType.StableDiffusion] = "models/Stable-diffusion",
[SharedFolderType.Diffusers] = "models/Diffusers",
[SharedFolderType.VAE] = "models/VAE",
[SharedFolderType.TextualInversion] = "models/embeddings",
[SharedFolderType.Hypernetwork] = "models/hypernetworks",
[SharedFolderType.Codeformer] = "models/Codeformer",
[SharedFolderType.GFPGAN] = "models/GFPGAN",
[SharedFolderType.BSRGAN] = "models/BSRGAN",
[SharedFolderType.ESRGAN] = "models/ESRGAN",
[SharedFolderType.RealESRGAN] = "models/RealESRGAN",
[SharedFolderType.ScuNET] = "models/ScuNET",
[SharedFolderType.SwinIR] = "models/SwinIR",
[SharedFolderType.LDSR] = "models/LDSR",
[SharedFolderType.CLIP] = "models/CLIP",
[SharedFolderType.Lora] = "models/Lora",
[SharedFolderType.LyCORIS] = "models/LyCORIS",
};
public override List<LaunchOptionDefinition> LaunchOptions => new()
{

10
StabilityMatrix/Models/SharedFolderType.cs

@ -10,6 +10,10 @@ public enum SharedFolderType
Lora,
LyCORIS,
ESRGAN,
GFPGAN,
BSRGAN,
Codeformer,
Diffusers,
RealESRGAN,
SwinIR,
VAE,
@ -18,5 +22,9 @@ public enum SharedFolderType
DeepDanbooru,
TextualInversion,
Hypernetwork,
ControlNet
ControlNet,
LDSR,
CLIP,
ScuNET,
GLIGEN,
}

Loading…
Cancel
Save