Hello!
I’m trying to get (Stablediffusionapi) to work using the Web API Feature but had no success…
This is a photo of the blocks I’m using
I’ve tried different blocks in the Header including ( Accept - engine-ID … etc )
I’ve also tried different endpoints but have had no success
everything is working as it should in Postman so i have no problem with my API whatsoever
I’m getting an error (NetworkError when attempting to fetch resource.) when trying to test the App on the web so I have exported the APP as APK but i got no error message when trying ( no response)
Does anyone know where could the problem be ?
Thanks in advance
if the call was ok (status=200), then the returned picture is from property “output” (see sample from response from Text To Image - Stable Diffusion API)
Thanks for your reply!
So you mean i have an error in the last block?
I have created an if-do block and said if the status = 200 then show the result like this
But how can i add (output)
Should I write it in the text block?
Nothing happens,
I don’t get any error message or any result and the dashboard in stablediffusionapi didn’t register any Response or request
and I’m pretty sure of everything including the API and url
so frustrating…
i know why it’s not working for you. you’re inside the if_error block when you’re testing the status. if your call was successful, you’d never get inside your if_error block.
Thanks for your help!!
The error was actually because how I have the body, I had samples then negative prompt then height so when I tried your project I used the same textinput2- field at the bottom - for debugging and I got an error saying the height must be a number and sample must be a number so I knew I had something wrong in the body
Thanks again for the fantastic help <3
Can you try the “outdir” paramter, use a value of “,” (dot) and see if ut saves it to Downloads. Otherwise you’ll have to do s creen capture, or send a query to stability ai.
Yes sure,
I’ve set the result to an App variable called result then used the resize image block when the user clicks on Download and I’ve used the upload file block with an open link block as well ( URL) so when the user clicks on download it uploads the result to URL and opens a link with the photo ready to download
Another question if you don’t mind
is there anything wrong with my If-do block?
because it navigates to download page even if status is not 200
I tried response and tried if not error also
The status block returns a text string. So you need to compare it to “200”. I usually just check for an error and don’t worry about the status but I’d try that if you need to check it.