AUTOMATIC1111 / stable-diffusion-webui-promptgen

stable-diffusion-webui-promptgen
MIT License
484 stars 93 forks source link

Added an API #18

Open MrLappes opened 1 year ago

MrLappes commented 1 year ago

Added a new api_generate and a return_available_models function in promptgen.py and added api.py which uses these to get the same behaviour in api as in Webui

davidmartinrius commented 8 months ago

Hi @MrLappes I installed your branch. I called the endpoints GET /promptgen/list_models and POST /promptgen/generate Unfortunatelly it just returns RuntimeError: (404, '{"detail":"Not Found"}')

http://localhost:7860/sdapi/v1/promptgen/list_models returns 404

I am running --api parameter when running webui. Is there any missing configuration?

Thanks!

davidmartinrius commented 8 months ago

Ah I see what happens... The endpoints of that branch are not defined in

stable-diffusion-webui/modules/api/api.py

So it cannot be called such as http://localhost:7860/sdapi/v1/promptgen/list_models

but

http://localhost:7860/promptgen/list_models

Solved!