Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem status 422 #9

Open
purpleFade opened this issue Mar 19, 2024 · 4 comments
Open

Problem status 422 #9

purpleFade opened this issue Mar 19, 2024 · 4 comments

Comments

@purpleFade
Copy link

Hello everyone. I got next issue : Error: ApiError: Request to https://api.replicate.com/v1/predictions failed with status 422 Unprocessable Entity: {"title":"Invalid version or not permitted","detail":"The specified version does not exist (or perhaps you don't have
permission to use it?)","status":422}

Here is the code :

import Replicate from 'replicate'
import dotenv from 'dotenv'
import { readFile } from 'node:fs/promises';

const image = await readFile('./assets/picture.png');

dotenv.config()

const replicate = new Replicate({
  auth: process.env.REPLICATE_API_TOKEN,
  userAgent: 'https://www.npmjs.com/package/create-replicate'
})
const model =
  'fofr/face-to-many:4912b99b3b101a70ae4af66c989d98f5b354c63fb8c4b5a248a299ac244242ed';
const input = {
  image: image,
  style: 'Video game',
  prompt: 'a person in a ps2 horror game',
  negative_prompt: '',
  prompt_strength: 4.5,
  denoising_strength: 0.65,
  instant_id_strength: 0.8,
};

console.log({ model, input })
console.log('Running...')

try {
  const output = await replicate.run(model, { input });
  console.log('Done!', output);
} catch (error) {
  console.error('Error:', error);
}

Maybe someone had this problem. I'd be grateful for support! I want to ask if this api is free? I didn't pay so maybe this is the problem. Thanks.

@fofr
Copy link
Owner

fofr commented Mar 22, 2024

Have you set your REPLICATE_API_TOKEN?

@lilminthehoodieboi
Copy link

maybe you should pay for api token

@purpleFade
Copy link
Author

I created app using npm create replicate, so I think that it created correctly. Also it asked to copy my token. I did it.

@Jasper-zzq
Copy link

I created app using npm create replicate, so I think that it created correctly. Also it asked to copy my token. I did it.

pay for api token

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants