|
|
@ -205,11 +205,23 @@ public abstract partial class InferenceGenerationViewModelBase |
|
|
|
uploadName |
|
|
|
uploadName |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// For pngs, strip metadata since Pillow can't handle some valid files? |
|
|
|
|
|
|
|
if (localFile.Info.Extension.Equals(".png", StringComparison.OrdinalIgnoreCase)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var bytes = PngDataHelper.RemoveMetadata(await localFile.ReadAllBytesAsync()); |
|
|
|
|
|
|
|
using var stream = new MemoryStream(bytes); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await client.UploadImageAsync(stream, uploadName); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
await using var stream = localFile.Info.OpenRead(); |
|
|
|
await using var stream = localFile.Info.OpenRead(); |
|
|
|
|
|
|
|
|
|
|
|
await client.UploadImageAsync(stream, uploadName); |
|
|
|
await client.UploadImageAsync(stream, uploadName); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// <summary> |
|
|
|
/// Runs a generation task |
|
|
|
/// Runs a generation task |
|
|
|