Refactored ImageGenerator

Option "StableDiffusionModel" zu AppSettings hinzugefügt
This commit is contained in:
Simon Lübeß
2023-10-13 12:20:24 +02:00
parent 80c7dca613
commit fa75985014
4 changed files with 56 additions and 31 deletions

View File

@ -305,7 +305,7 @@
// Vier Bilder generieren
for (int i = 0; i < 4; i++)
{
_imageUrls[i] = await ImageGenerator.GenerateImageAsync(_imagePrompt, "", width, height, wunschInfo);
_imageUrls[i] = (await ImageGenerator.GenerateImageAsync(wunschInfo, width, height))?.Dateiname;
// Kein Bild -> Fehler
if (_imageUrls[i] == null)
@ -317,12 +317,14 @@
if (retry == true)
{
await ImageGenerator.GenerateImageAsync(_imagePrompt, "", width, height, wunschInfo);
_imageUrls[i] = (await ImageGenerator.GenerateImageAsync(wunschInfo, width, height))?.Dateiname;
}
}
generatedImages++;
if (_imageUrls[i] != null)
generatedImages++;
// TODO: Fehler anzeigen
_imageStates[i] = ImageState.FadeIn;
await InvokeAsync(StateHasChanged);
}