oelin / node-replicate

A Node.js client for Replicate.
https://npmjs.com/node-replicate
63 stars 4 forks source link

Why is it returning me this error? #7

Closed calangosh closed 1 year ago

calangosh commented 1 year ago

return fetch(https://replicate.com/api/models${prediction.version.model.absolute_url}/versions/${prediction.version_id}/predictions/${prediction.uuid}) ^

TypeError: Cannot read properties of undefined (reading 'model')

oelin commented 1 year ago

Could you provide more context?

yeci226 commented 1 year ago

Could you provide more context?

When using

const model = "owner/model:version"
const input = { prompt: "an astronaut riding on a horse" }

await replicate. run(model, input)

will return this error TypeError: Cannot read properties of undefined (reading 'model')

bunpro1920 commented 1 year ago

i have same error and i found bug here

{ detail: 'You need to sign in to run this model.', code: 'SIGN_IN_REQUIRED' }

oelin commented 1 year ago

Ah, yes some models are not possible to run from this client because they require authorization. May potentially add support for them in the future. On Replicate.com, you can check if a model requires sign in.

bunpro1910 commented 1 year ago

Do you have any model for midjourney don't need sign in

oelin commented 1 year ago

Check out midjourney-client which uses Openjourney.

calangosh commented 1 year ago

Ah, yes some models are not possible to run from this client because they require authorization. May potentially add support for them in the future. On Replicate.com, you can check if a model requires sign in.

Is there a daily limit? or can i use it at will?

sromovskypeter commented 1 year ago

There is the same problem with midjourney-client.

oelin commented 1 year ago

Ah, yes some models are not possible to run from this client because they require authorization. May potentially add support for them in the future. On Replicate.com, you can check if a model requires sign in.

Is there a daily limit? or can i use it at will?

There's potentially a limit, however Replicate.com don't seem to specify it anywhere.

halower commented 1 year ago

In Windows, the application is actually working properly, so I feel like it's related to the operating system.

yeci226 commented 1 year ago

In Windows, the application is actually working properly, so I feel like it's related to the operating system.

Same, this error apeared when i using linux

halower commented 1 year ago

I have solved this problem, it should be an issue with the library. Great job!

yeci226 commented 1 year ago

I have solved this problem, it should be an issue with the library. Great job!

how to solve?

halower commented 1 year ago

There's potentially a limit, however Replicate.com don't seem to specify it anywhere, use Stable Diffusion local api

sromovskypeter commented 1 year ago

It does work with some of the VPN servers (Proton). But, I have definitely not hit the limit with my IP address. Online prompt at PromptHero works always fine.

oelin commented 1 year ago

Could you provide more context?

When using

const model = "owner/model:version"
const input = { prompt: "an astronaut riding on a horse" }

await replicate. run(model, input)

will return this error TypeError: Cannot read properties of undefined (reading 'model')

I realise that this might have not been clear enough, but you'll need to pass in a concrete model name and version id. For instance, stability-ai/stable-diffusion:db21e45d3f7023abc2a46ee38a23973f6dce16bb082a930b0c49861f96d1e5bf.

halower commented 1 year ago

Could you provide more context?

When using

const model = "owner/model:version"
const input = { prompt: "an astronaut riding on a horse" }

await replicate. run(model, input)

will return this error TypeError: Cannot read properties of undefined (reading 'model') I forgot to explain to you in detail. I have rewritten the logic of this section, but in fact, I found that the official website will record your IP address. When the frequency of requests is too high, an exception of 400-403 will be triggered. Therefore, I used a dynamic proxy, a free proxy crawled by the website I found online @yeci226

BarryAllen-Arrow commented 1 year ago

I'm having the TypeError: Cannot read properties of undefined (reading 'model') issue even using “no need to sign in” models(already test it with the openjourney model).... Have no idea why :(

sromovskypeter commented 1 year ago

I am still seeing the error. I don't understand why would you close this issue without any explanation.