Gourieff / sd-webui-reactor

Fast and Simple Face Swap Extension for StableDiffusion WebUI (A1111 SD WebUI, SD WebUI Forge, SD.Next, Cagliostro)
GNU Affero General Public License v3.0
2.55k stars 278 forks source link

[Feature]: An API to create a new model given an array of base64 images #421

Open alex-the-programmer opened 7 months ago

alex-the-programmer commented 7 months ago

Feature description

An API to create a new model given an array of base64 images. currently there's no API with a feature equivalent to creating a blended or single image model available from web UI: image

The API would call the same blend_model method that the web interface calls. I've been trying to get it working in my fork: https://github.com/Gourieff/sd-webui-reactor/compare/main...alex-the-programmer:sd-webui-reactor:main

If the API is implemented, the suggested pipeline would be one of the two described below:

An API workflow 1 - first use of the model:

calling the new API POST /reactor/blend_models with a collection of base64 image, character_name, and potentially two other optional params (compute_method and check_shape). The API returns the generated model name (ideally I'd prefer an async API that would call my webhook upon model generation completion but I guess it's too much to ask) Using /sdapi/v1/txt2img similarly to this example: https://github.com/alex-the-programmer/sd-webui-reactor/blob/main/example/api_example.py#L24 generating a bunch of images. Downloading the model by name via an API and then moving it to an S3 bucket Deleting the model by name via an API An API workflow 2 - repeated use of the model:

Using a new API, uploading a previously generated model from S3 to the server where SD WebUI is running Generating images (the same way as step 3 in the workflow 1). Deleting the model by name via an API.

johndpope commented 7 months ago

if you grab the respective code (cat out all the respective python) - and give to claude opus - it will produce what you want.

see Claude produce low level code for driver - https://github.com/geohot/cuda_ioctl_sniffer/issues/5

boehmi1988 commented 6 months ago

+1 this would be very useful!