@Panda said in Interesting Widget code, but can’t fetch API:
Dont think its any problem with that flow, because the prompt comes first
That’s correct, but the prompt is interactive in the sense that it waits for user input.
fetch('https://stable-diffusion-demo-8yn9n69web73.octoai.cloud/predict', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${apiKey}`
},
body: JSON.stringify({
'prompt': promp,
// 'num_inference_steps': '30',
'sheduler': 'DPMSolverMultistep'
})
})
As you can see from above, the original promp
value is passed to the JSON
function. As that value is never entered, the value is returned NULL.