From b9054b485a1857f79135c438e78628b048c2a2c5 Mon Sep 17 00:00:00 2001 From: jankaminski1 <76042738+jankaminski1@users.noreply.github.com> Date: Thu, 21 Sep 2023 12:25:11 +0200 Subject: [PATCH] =?UTF-8?q?Resolution=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Und zurückgeschraubt auf 3.5 --- KIKunstKirstenKlöckner/Pages/AiArt.razor | 21 +++++++++++++++++-- .../wwwroot/idea_prompt.txt | 3 ++- .../wwwroot/test_prompt2.txt | 6 +++--- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/KIKunstKirstenKlöckner/Pages/AiArt.razor b/KIKunstKirstenKlöckner/Pages/AiArt.razor index f04b1fc..a2723d6 100644 --- a/KIKunstKirstenKlöckner/Pages/AiArt.razor +++ b/KIKunstKirstenKlöckner/Pages/AiArt.razor @@ -32,6 +32,15 @@ @temperature + + Resolution: + + + x + + + @@ -179,6 +188,8 @@ private string _imagePrompt = ""; private float temperature = 0.9f; + private int? width = 1024; + private int? height = 1024; private string request = ""; private string addons = ""; private OpenAIAPI _openAiApi; @@ -241,7 +252,7 @@ _openAiApi = new OpenAIAPI(_openAiApiKey); var inferenceModelUrl = "https://api-inference.huggingface.co/models/Nacken/kkkk-sdxl-5000"; - + //_client.BaseAddress = new Uri(inferenceModelUrl); _client.DefaultRequestHeaders.Clear(); @@ -319,6 +330,12 @@ var postData = new { inputs = prompt, + parameters = new + { + negative_prompt = "photorealistic, highly detailed, 8K, portrait", + width = width, + height = height + }, options = new { // Cache deaktivieren, damit Huggingface für den selben Prompt unterschiedliche Ergebnisse liefert @@ -412,7 +429,7 @@ ChatRequest chatRequest = new ChatRequest { Temperature = temperature, - Model = Model.GPT4, + Model = Model.ChatGPTTurbo, }; converse = _openAiApi.Chat.CreateConversation(chatRequest); diff --git a/KIKunstKirstenKlöckner/wwwroot/idea_prompt.txt b/KIKunstKirstenKlöckner/wwwroot/idea_prompt.txt index c19c211..ad1479b 100644 --- a/KIKunstKirstenKlöckner/wwwroot/idea_prompt.txt +++ b/KIKunstKirstenKlöckner/wwwroot/idea_prompt.txt @@ -1 +1,2 @@ -Gib mir eine Bildidee, die ein Bild kurz beschreibt im Ãœbertragenden Sinne. Der Titel ist: \ No newline at end of file +Gib mir eine kreative Idee für ein Kunstwerk. +Der Titel ist: \ No newline at end of file diff --git a/KIKunstKirstenKlöckner/wwwroot/test_prompt2.txt b/KIKunstKirstenKlöckner/wwwroot/test_prompt2.txt index 4107480..74d97a7 100644 --- a/KIKunstKirstenKlöckner/wwwroot/test_prompt2.txt +++ b/KIKunstKirstenKlöckner/wwwroot/test_prompt2.txt @@ -1,9 +1,9 @@ Bitte generiere einen Englischen Prompt für dieses Bild Hier findest du Beispiele, wie der Promt aussehen soll: -"Portrait of an astronaut in space, detailed starry background, reflective helmet." +"Painting of an astronaut in space, detailed starry background, reflective helmet." “Painting of a floating island with giant clock gears, populated with mythical creatures.” -“Landscape of a Japanese garden in autumn, with a bridge over a koi pond.” +“Painting of a Japanese garden in autumn, with a bridge over a koi pond.” “Painting representing the sound of jazz music, using pale colors and erratic shapes.” -Bitte nutze unbedingt für den Prompt maximal 20 Wörter! + Der Promt selber darf auf keinen Fall abstrakt sein, man muss durch den Promt ein genaues Bild vor Augen haben.