From e25d8ad5c90eef142083659a4c29b9ac6e012a69 Mon Sep 17 00:00:00 2001 From: DarthAffe Date: Mon, 27 Oct 2025 19:34:14 +0100 Subject: [PATCH] Removed unused method --- StableDiffusion.NET/Helper/ImageHelper.cs | 10 +--------- StableDiffusion.NET/StableDiffusionCpp.cs | 1 - 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/StableDiffusion.NET/Helper/ImageHelper.cs b/StableDiffusion.NET/Helper/ImageHelper.cs index 9b36f97..d61d27c 100644 --- a/StableDiffusion.NET/Helper/ImageHelper.cs +++ b/StableDiffusion.NET/Helper/ImageHelper.cs @@ -82,14 +82,6 @@ internal static class ImageHelper } } - public static unsafe Native.Types.sd_image_t* ToSdImagePtr(this IImage image, bool monochrome = false) - { - Native.Types.sd_image_t* imagePtr = (Native.Types.sd_image_t*)NativeMemory.Alloc((nuint)Marshal.SizeOf()); - imagePtr[0] = image.ToSdImage(monochrome); - - return imagePtr; - } - public static unsafe void Free(this Native.Types.sd_image_t sdImage) { if (sdImage.data == null) return; @@ -127,7 +119,7 @@ internal static class ImageHelper { int count = images.Length; - Native.Types.sd_image_t* imagePtr = (Native.Types.sd_image_t*)NativeMemory.Alloc((nuint)(count * Marshal.SizeOf())); + Native.Types.sd_image_t* imagePtr = (Native.Types.sd_image_t*)NativeMemory.Alloc((nuint)count, (nuint)Marshal.SizeOf()); for (int i = 0; i < count; i++) imagePtr[i] = images[i].ToSdImage(monochrome); diff --git a/StableDiffusion.NET/StableDiffusionCpp.cs b/StableDiffusion.NET/StableDiffusionCpp.cs index 13676c7..eb3d650 100644 --- a/StableDiffusion.NET/StableDiffusionCpp.cs +++ b/StableDiffusion.NET/StableDiffusionCpp.cs @@ -1,5 +1,4 @@ using System; -using System.Runtime.InteropServices; using HPPH; using JetBrains.Annotations;