From f93cc4b5c37a929aa1a91c2648c571908d9a47cf Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Sat, 6 Dec 2025 08:33:06 -0800 Subject: [PATCH] Add an API example to the image generation tutorial --- docs/Image Generation Tutorial.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/Image Generation Tutorial.md b/docs/Image Generation Tutorial.md index 875d1d44..0d562041 100644 --- a/docs/Image Generation Tutorial.md +++ b/docs/Image Generation Tutorial.md @@ -75,3 +75,24 @@ After that, your prompts will be automatically updated by the LLM each time you The improvement in creativity is striking: comparison_collage + +## Generating images over API + +It is possible to generate images usign the project's API. Just make sure to start the server with `--api`, either by + +1. Passing the `--api` flag to your `start` script, like `./start_linux.sh --api`, or +2. Writing `--api` to your `user_data/CMD_FLAGS.txt` file and relaunching the web UI. + +Here is an API call example: + +``` +curl http://127.0.0.1:5000/v1/images/generations \ + -H "Content-Type: application/json" \ + -d '{ + "prompt": "an orange tree", + "steps": 9, + "cfg_scale": 0, + "batch_size": 1, + "batch_count": 1 + }' +```