Skip to content
This repository was archived by the owner on Nov 27, 2024. It is now read-only.

Removing hash as it is different between tests despite the image being the same. #36

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions OnnxStack.IntegrationTests/StableDiffusionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ public async Task GivenAStableDiffusionModel_WhenLoadModel_ThenModelIsLoaded(str
}

[Theory]
[InlineData(StableDiffusionModel, SchedulerType.EulerAncestral, 10, 7.0f, "E518D0E4F67CBD5E93513574D30F3FD7")]
[InlineData(LatentConsistencyModel, SchedulerType.LCM, 4, 1.0f, "3554E5E1B714D936805F4C9D890B0711")]
[InlineData(StableDiffusionModel, SchedulerType.EulerAncestral, 10, 7.0f)]
[InlineData(LatentConsistencyModel, SchedulerType.LCM, 4, 1.0f)]
public async Task GivenTextToImage_WhenInference_ThenImageGenerated(string modelName, SchedulerType schedulerType,
int inferenceSteps, float guidanceScale, string generatedImageMd5Hash)
int inferenceSteps, float guidanceScale)

{
//arrange
Expand Down Expand Up @@ -118,12 +118,6 @@ public async Task GivenTextToImage_WhenInference_ThenImageGenerated(string model
image.Height.Should().Be(512);

File.Exists(fileName).Should().BeTrue();
var md5 = MD5.Create();
var hash = md5.ComputeHash(File.ReadAllBytes(fileName));
var hashString = string.Join("", hash.Select(b => b.ToString("X2")));
_logger.LogInformation($"MD5 Hash of generated image: {hashString}");

hashString.Should().Be(generatedImageMd5Hash);
}
}
}