replicate-js
replicate-js copied to clipboard
Predictor outputs null?
Bug description
Just wondering how the predictor works. I was thinking I was going to get data similar to the Replicate log, but i just get an occasional null - with no output at the end.
What I thought I'd get:
What I get:
Steps to reproduce
Code:
const model = await replicate.models.get('stability-ai/stable-diffusion');
let options = {
prompt: req.query.phrase,
width: 768,
height: 768,
prompt_strength: 0.8,
num_outputs: 1,
num_inference_steps: 50,
guidance_scale: 7.5,
scheduler: "K_EULER"
};
//let output = await model.predict(options);
let output = model.predictor(options);
for await(let prediction of output){
console.log(prediction);
}
res.status(200).json({'result':'success','data':output})
console.log(output)
Expected behavior
No response
Example repository
No response
Anything else?
No response
Facing the same issue. Returning Null.