hey guys, I am using the stable diffusion within C# and I have replicated the curl command within C# and it's working good but I am not satisfied with the generated image,
string new_text = "A fox in the jungle, low poly";
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("https://api.stability.ai/v1/generation/stable-diffusion-v1-5/text-to-image"),
Headers =
{
{ "Accept", "image/png" },
{ "Authorization", "API_KEY" },
{ "Cookie", "__cf_bm=FMRRcWzshoDLeugLIOuR49M55SurpuyHsp1trp5ooPk-1681039461-0-AXhrLXucsQywuiiyfV1/YKGADKSRzWJ6g5vbIozpe0xTpWYaYqM0eG2Nv778H6EuxdZqbHj0fPVUOdsrxxRIHqY=" }
},
Content = new StringContent($@"{{
""text_prompts"": [
{{
""text"": ""{new_text}""
}}
],
""cfg_scale"": 8,
""height"": 512,
""width"": 512,
""samples"": 1,
""generation.sampler"": ""SAMPLER_K_DPMPP_2M"",
""steps"": 50,
""engine"": ""stable-diffusion-xl-beta-v2-2-2""
}}", Encoding.UTF8, "application/json")
};
And the generated image looks like this;
Now, I have also used the DreamStudio UI to generate the image with the same prompt and the parameters and the result looks much better, you can see the result below, what could be wrong in the above code.
hey guys, I am using the stable diffusion within C# and I have replicated the curl command within C# and it's working good but I am not satisfied with the generated image,
And the generated image looks like this;
Now, I have also used the DreamStudio UI to generate the image with the same prompt and the parameters and the result looks much better, you can see the result below, what could be wrong in the above code.