rupeshs / fastsdcpu

Fast stable diffusion on CPU
MIT License
1.01k stars 87 forks source link

is there a way to get it working behind an api? #165

Closed Mortezanavidi closed 1 month ago

Mortezanavidi commented 2 months ago

i tried to create a api for it using the already built app.py file but i didn't found a way to control the file name or file path parameters, is there any kind of api for fastsd? if not how can i give it a path file parameter so the generated images goes in there

rupeshs commented 2 months ago

@Mortezanavidi This settings(https://github.com/rupeshs/fastsdcpu/blob/main/src/models/settings.py) controls the generation. Also Contextclass(https://github.com/rupeshs/fastsdcpu/blob/main/src/context.py) is used by frontends(webui/desktop ui/cli) to generate images Set the lcm_diffusion_setting parameters and call the context to generate images.

Mortezanavidi commented 2 months ago

perfect, thank you so much for the fast response, i was wondering as well is there any way we could get other sdxl-lightning models such as 1 step, 4 step and 8 steps? is there any scripts to run to make them useable by fast-sd? ( sorry for sounding so naive, as long as it comes to diffuser models, i mostly don't know what i'm doing )

rupeshs commented 2 months ago

@Mortezanavidi We need to convert it using optimum-cli ,Refer https://github.com/rupeshs/lcm-openvino-converter Are you using FastAPI to create API, feel free to create a PR :)

rupeshs commented 1 month ago

@Mortezanavidi Added API support in the v1.0.0-beta.32 release https://github.com/rupeshs/fastsdcpu/releases/tag/v1.0.0-beta.32