I’m new here and would appreciate your help.
I am currently experiencing an issue with the stablediffusion API.
Here’s my code.
const request_body = {
key: process.env.REACT_APP_STABLE_DIFFUSION_API,
prompt: "ultra realistic close up portrait ((beautiful pale cyberpunk female with heavy black eyeliner))",
negative_prompt: null,
width: "512",
height: "512",
samples: 1,
num_inference_steps: "20",
seed: null,
guidance_scale: 7.5,
safety_checker: "yes",
multi_lingual: "no",
panorama: "no",
self_attention: "no",
upscale: "no",
embeddings_model: null,
webhook: null,
track_id: null,
};
const generateImage = async () => {
const generateResponse = await axios.post(
"https://stablediffusionapi.com/api/v5/text2video",
request_body
);
console.log(generateResponse.data);
};
It’s not just an issue with the API key. The result is an error.
The status shows an error and the error message needs a seconds value.
2
Answers
Hey @theavocoder, you used the wrong API. The one you used is for text2video.
Try using the API above.
Add seconds parameter in request_body to specify the duration-related parameter if it is intended for video rendering.
Add an exception handler for detailed error insights: