dreambooth icon indicating copy to clipboard operation
dreambooth copied to clipboard

Model not specified error

Open btahir opened this issue 2 years ago • 1 comments

Hi -

I followed the instructions in the blog post but am running into an error:

{"detail":"model not specified"}

This is my setup (token and image source taken out):

curl -X POST \
    -H "Authorization: Token TOKEN" \
    -d '{
            "input": {
                "instance_prompt": "a photo of a cjw person",
                "class_prompt": "a photo of a person",
                "instance_data": "https://storage.googleapis.com/blahblah",
                "max_train_steps": 2000
            },
            "model": "my_username/my_modelname",
            "trainer_version": "cd3f925f7ab21afaef7d45224790eedbb837eeac40d22e8fefe015489ab644aa",
            "webhook_completed": "https://example.com/dreambooth-webhook"
        }' \
    https://dreambooth-api-experimental.replicate.com/v1/trainings

Any help would be appreciated!

btahir avatar Sep 30 '23 02:09 btahir

Pass the application/json as the Content-Type to let the API know that you are passing a json body so it can parse the request body properly. Their instruction is missing that header. You'd want to do:

$ curl -X POST \                                       
    -H "Authorization: Token $REPLICATE_API_TOKEN" \                                       
    -H "Content-Type: application/json" \
    -d '{
            "input": {
                "instance_prompt": "a photo of a cjw person",
                "class_prompt": "a photo of a person",
                "instance_data": "'"$SERVING_URL"'",
                "max_train_steps": 2000
            },
            "model": "yourusername/yourmodel",
            "trainer_version": "cd3f925f7ab21afaef7d45224790eedbb837eeac40d22e8fefe015489ab644aa"
        }' \
    https://dreambooth-api-experimental.replicate.com/v1/trainings

brianleungwh avatar Nov 05 '23 02:11 brianleungwh