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

Revert commit 3808599 #79

Merged
merged 1 commit into from
Dec 23, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,6 @@ protected override async Task<DenseTensor<float>> SchedulerStepAsync(StableDiffu
// Get Model metadata
var metadata = _onnxModelService.GetModelMetadata(modelOptions, OnnxModelType.Unet);

// Some LCM variants require no guidance embeds
var guidanceEmbeddingsRequired = metadata.Inputs.Count == 4;

// Loop though the timesteps
var step = 0;
foreach (var timestep in timesteps)
Expand All @@ -130,8 +127,7 @@ protected override async Task<DenseTensor<float>> SchedulerStepAsync(StableDiffu
inferenceParameters.AddInputTensor(inputTensor);
inferenceParameters.AddInputTensor(timestepTensor);
inferenceParameters.AddInputTensor(promptEmbeddings.PromptEmbeds);
if(guidanceEmbeddingsRequired)
inferenceParameters.AddInputTensor(guidanceEmbeddings);
inferenceParameters.AddInputTensor(guidanceEmbeddings);
inferenceParameters.AddOutputBuffer(outputDimension);

var results = await _onnxModelService.RunInferenceAsync(modelOptions, OnnxModelType.Unet, inferenceParameters);
Expand Down