Skip to content

Commit

Permalink
Add async process for generation
Browse files Browse the repository at this point in the history
  • Loading branch information
konieshadow committed Oct 24, 2023
1 parent 0ed6a06 commit 336bd3e
Show file tree
Hide file tree
Showing 10 changed files with 488 additions and 553 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ conda env create -f environment.yaml
conda activate fooocus-api
```

Set enviroment variable `TORCH_INDEX_URL` to the version corresponding to the local cuda driver.
Default is "https://download.pytorch.org/whl/cu121", you may change the part "cu118".

Run
```
python main.py
Expand Down Expand Up @@ -70,13 +67,15 @@ Swagger openapi defination see [openapi.json](docs/openapi.json).

You can import it in [Swagger-UI](https://swagger.io/tools/swagger-ui/) editor.

All the generation api support for response in PNG bytes directly when request's 'Accept' header is 'image/png'.

All the generation api support async process by pass parameter `async_process`` to true. And then use query job api to retrieve progress and generation results.

#### Text to Image
> POST /v1/generation/text-to-image
Alternative api for the normal image generation of Fooocus Gradio interface.

Add support for response in PNG bytes directly when request's 'Accept' header is 'image/png'.

#### Image Upscale or Variation
> POST /v1/generation/image-upscale-vary
Expand All @@ -91,3 +90,8 @@ Alternative api for 'Inpaint or Outpaint' tab of Fooocus Gradio interface.
> POST /v1/generation/image-prompt
Alternative api for 'Image Prompt' tab of Fooocus Gradio interface.

#### Query Job
> GET /v1/generation/query-job
Query async generation request results, return job progress and generation results.
Loading

0 comments on commit 336bd3e

Please sign in to comment.