hi everyone, i’m trying to use stable diffusion, i found a website i’m trying on it. in console it says succesful but how i can access to the image created by website?
// Start is called before the first frame update
void Start()
{
var body = @"{" + "\n" +
@" ""key"": ""api code here""," + "\n" +
@" ""prompt"": ""ultra realistic close up portrait ((beautiful pale cyberpunk female with heavy black eyeliner)), blue eyes, shaved side haircut, hyper detail, cinematic lighting, magic neon, dark red city, Canon EOS R3, nikon, f/1.4, ISO 200, 1/160s, 8K, RAW, unedited, symmetrical balance, in-frame, 8K""," + "\n" +
@" ""negative_prompt"": ""((out of frame)), ((extra fingers)), mutated hands, ((poorly drawn hands)), ((poorly drawn face)), (((mutation))), (((deformed))), (((tiling))), ((naked)), ((tile)), ((fleshpile)), ((ugly)), (((abstract))), blurry, ((bad anatomy)), ((bad proportions)), ((extra limbs)), cloned face, (((skinny))), glitchy, ((extra breasts)), ((double torso)), ((extra arms)), ((extra hands)), ((mangled fingers)), ((missing breasts)), (missing lips), ((ugly face)), ((fat)), ((extra legs)), anime""," + "\n" +
@" ""width"": ""512""," + "\n" +
@" ""height"": ""512""," + "\n" +
@" ""samples"": ""1""," + "\n" +
@" ""num_inference_steps"": ""20""," + "\n" +
@" ""seed"": null," + "\n" +
@" ""guidance_scale"": 7.5," + "\n" +
@" ""webhook"": null," + "\n" +
@" ""track_id"": null" + "\n" +
@"}";
StartCoroutine(Post("https://stablediffusionapi.com/api/v3/text2img",body));
}
IEnumerator Post(string url, string bodyJsonString)
{
/*Form form = new WWWForm();
form.AddField("input","body");
using (UnityWebRequest www = UnityWebRequest.Post("https://stablediffusionapi.com/api/v3/text2img", form)) ;*/
var request = new UnityWebRequest(url, "POST");
byte[] bodyRaw = Encoding.UTF8.GetBytes(bodyJsonString);
request.uploadHandler = (UploadHandler)new UploadHandlerRaw(bodyRaw);
request.downloadHandler = (DownloadHandler)new DownloadHandlerBuffer();
request.SetRequestHeader("Content-Type", "application/json");
yield return request.SendWebRequest();
Debug.Log("Status Code: " + request.result);
}
i tried to change this part, but it doesn’t work.
Debug.Log("Status Code: " + request.result);
thanks everyone.