Browse Source

Merge pull request #414 from ionite34/fix-comfy-yaml

Fix comfy yaml
pull/339/head
JT 11 months ago committed by GitHub
parent
commit
9b1617156b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      CHANGELOG.md
  2. 2
      README.md
  3. 25
      StabilityMatrix.Core/Models/FileInterfaces/FilePath.cs

6
CHANGELOG.md

@ -5,6 +5,10 @@ All notable changes to Stability Matrix will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2.0.0.html).
## v2.7.3
### Fixed
- Fixed UnicodeDecodeError when using extra_model_paths.yaml in ComfyUI on certain locales
## v2.7.2
### Changed
- Changed Symlink shared folder link targets for Automatic1111 and ComfyUI. From `ControlNet -> models/controlnet` to `ControlNet -> models/controlnet/ControlNet` and `T2IAdapter -> models/controlnet/T2IAdapter`.
@ -18,7 +22,7 @@ and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2
## v2.7.1
### Added
- Added Turkish UI language option, thanks to Progresor for the translation
- Added Turkish UI language option, thanks to Progesor for the translation
### Fixed
- Fixed Inference Image to Image projects missing denoise strength setting

2
README.md

@ -105,7 +105,7 @@ Stability Matrix is now available in the following languages, thanks to our comm
- 🇷🇺 Русский
- aolko
- 🇹🇷 Türkçe
- Progresor
- Progesor
If you would like to contribute a translation, please create an issue or contact us on Discord. Include an email where we'll send an invite to our [POEditor](https://poeditor.com/) project.

25
StabilityMatrix.Core/Models/FileInterfaces/FilePath.cs

@ -113,12 +113,13 @@ public partial class FilePath : FileSystemPath, IPathObject
}
/// <summary> Write text </summary>
public void WriteAllText(string text) => File.WriteAllText(FullPath, text, Encoding.UTF8);
public void WriteAllText(string text, Encoding? encoding = null) =>
File.WriteAllText(FullPath, text, encoding ?? new UTF8Encoding(false));
/// <summary> Write text asynchronously </summary>
public Task WriteAllTextAsync(string text, CancellationToken ct = default)
public Task WriteAllTextAsync(string text, CancellationToken ct = default, Encoding? encoding = null)
{
return File.WriteAllTextAsync(FullPath, text, Encoding.UTF8, ct);
return File.WriteAllTextAsync(FullPath, text, encoding ?? new UTF8Encoding(false), ct);
}
/// <summary> Read bytes </summary>
@ -144,19 +145,14 @@ public partial class FilePath : FileSystemPath, IPathObject
/// </summary>
public FilePath Rename(string fileName)
{
if (
Path.GetDirectoryName(FullPath) is { } directory
&& !string.IsNullOrWhiteSpace(directory)
)
if (Path.GetDirectoryName(FullPath) is { } directory && !string.IsNullOrWhiteSpace(directory))
{
var target = Path.Combine(directory, fileName);
Info.MoveTo(target, true);
return new FilePath(target);
}
throw new InvalidOperationException(
"Cannot rename a file path that is empty or has no directory"
);
throw new InvalidOperationException("Cannot rename a file path that is empty or has no directory");
}
/// <summary>
@ -193,10 +189,7 @@ public partial class FilePath : FileSystemPath, IPathObject
/// Move the file to a target path with auto increment if the file already exists.
/// </summary>
/// <returns>The new path, possibly with incremented file name</returns>
public async Task<FilePath> MoveToWithIncrementAsync(
FilePath destinationFile,
int maxTries = 100
)
public async Task<FilePath> MoveToWithIncrementAsync(FilePath destinationFile, int maxTries = 100)
{
await Task.Yield();
@ -214,9 +207,7 @@ public partial class FilePath : FileSystemPath, IPathObject
);
}
throw new IOException(
$"Could not move file to {destinationFile} because it already exists."
);
throw new IOException($"Could not move file to {destinationFile} because it already exists.");
}
/// <summary>

Loading…
Cancel
Save