midjourney-client
midjourney-client copied to clipboard
TypeError: Cannot read properties of undefined (reading 'model')
I've seen the same error in 2 other issues that are closed, but circumstances are different for me when getting the error. First I tried to generate 2 images by setting optional "num_outputs: 2" and the error happened for the first time so I stuck to just one image generation and it worked couple of times, but then the error happened again. Now its just the same error all the time.
I'll try and see if I can reproduce this error. Also note that on the Replicate page for Openjourney only 1 and 4 are valid values for the num_outputs parameter.
Ah ok, yeah I see that now. Thanks for pointing that out. Hopefully this error will get resolved. I am using typescript btw and created my own midjourney-client.d.ts
declare module 'midjourney-client'
{
type MidjourneyResponse = string[];
interface MidjourneyOptions {
width?: number;
heigth?: number;
num_outputs?: number;
num_inference_steps?: number;
guidance_scale?: number;
seed?: number;
}
interface MidjourneyClient {
(input: string, options?: MidjourneyOptions): Promise<MidjourneyResponse>;
}
const midjourney: MidjourneyClient;
export default midjourney;
}
It did work well with using it couple of times, but now, the same error persists.