replicate-js icon indicating copy to clipboard operation
replicate-js copied to clipboard

Predictor outputs null?

Open bigrig2212 opened this issue 2 years ago • 1 comments

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: Screenshot 2022-12-29 at 4 06 41 PM

What I get: Screenshot 2022-12-29 at 4 07 41 PM

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

bigrig2212 avatar Dec 30 '22 00:12 bigrig2212

Facing the same issue. Returning Null.

iamphoenix310 avatar Jan 22 '23 14:01 iamphoenix310