d8ahazard / sd_dreambooth_extension

Other
1.85k stars 283 forks source link

[Bug]: Fast api of concepts don't work #1478

Open lambdaily opened 1 month ago

lambdaily commented 1 month ago

Is there an existing issue for this?

What happened?

When making the request to the FastAPI endpoint /dreambooth/concept, it returns an error: "Unprocessable Entity". The response body indicates: { "detail": [ { "loc": [ "body", "concept" ], "msg": "value is not a valid dict", "type": "type_error.dict" } ] } Regardless of how the parameters are passed, it doesn't work.

Steps to reproduce the problem

  1. Prepare Request URL: Construct the URL for the endpoint /dreambooth/concept
  2. Prepare Request Headers: If required, set up the necessary headers such as Content-Type. If an API key is set, make sure to include it in the headers. 3.Prepare Request Body: Create a JSON object representing the concept you want to add or update. Include the following fields: Note: Replace the values with your specific data. { "class_data_dir": "", "class_guidance_scale": 7.5, "class_infer_steps": 60, "class_negative_prompt": "", "class_prompt": "", "class_token": "", "instance_data_dir": "", "instance_prompt": "", "instance_token": "", "is_valid": false, "n_save_sample": 1, "num_class_images_per": 0, "sample_seed": -1, "save_guidance_scale": 7.5, "save_infer_steps": 20, "save_sample_negative_prompt": "", "save_sample_prompt": "", "save_sample_template": "" } 4.Send the Request: Use your preferred HTTP client (such as cURL, Postman, or Python's requests library) to send the POST request to the specified endpoint with the prepared headers and request body.

5.Handle Response: Upon receiving the response, handle it according to your application's requirements. Check for any error responses or status codes returned by the server.

Commit and libraries

Starting at Initializing Dreambooth and ending several lines below at [+] bitsandbytes version 0.35.4 installed..

Command Line Arguments

--xformers --api --listen

Console logs

XHRPOST
http://localhost:7860/dreambooth/concept
[HTTP/1.1 422 Unprocessable Entity 2ms]

POST
    http://localhost:7860/dreambooth/concept
Status
422
Unprocessable Entity
VersionHTTP/1.1
Transferred305 B (98 B size)
Referrer Policystrict-origin-when-cross-origin
Request PriorityHighest
DNS ResolutionSystem

Additional information

No response

lambdaily commented 1 month ago

![Uploading Screenshot from 2024-05-29 11-44-43.png…]() all this data exist in the gui { "class_data_dir": "/home/smart/Desktop/smartR/stable-diffusion-webui/models/dreambooth/rbrt_v3/classifiers_0", "class_guidance_scale": 1, "class_infer_steps": 10, "class_negative_prompt": "badpic", "class_prompt": "photo of a man", "class_token": "", "instance_data_dir": "/home/smart/Desktop/train/Robert", "instance_prompt": "rbrt man", "instance_token": "ohmx", "is_valid": true, "n_save_sample": 0, "num_class_images_per": 3, "sample_seed": -1, "save_guidance_scale": 1, "save_infer_steps": 10, "save_sample_negative_prompt": "", "save_sample_prompt": "", "save_sample_template": "" }

github-actions[bot] commented 3 weeks ago

This issue is stale because it has been open for 14 days with no activity. Remove stale label or comment or this will be closed in 30 days