feat(backend): add stablediffusion-ggml by mudler · Pull Request #4289 · mudler/LocalAI (original) (raw)
Description
This PR is a first attempt into adding a very straightforward backend for stablediffusion.cpp (https://github.com/leejet/stable-diffusion.cpp which is using ggml-based engine). Part of #1126
To test it:
name: sd-ggml backend: stablediffusion-ggml parameters: model: huggingface://city96/FLUX.1-dev-gguf/flux1-dev-Q2_K.gguf
options:
- "diffusion_model"
- "clip_l_path:clip_l.safetensors"
- "t5xxl_path:t5xxl_fp16.safetensors"
- "vae_path:ae.safetensors"
- "sampler:euler"
step: 25
download_files:
- filename: ae.safetensors sha256: afc8e28272cd15db3919bacdb6918ce9c1ed22e96cb12c4d5ed0fba823529e38 uri: https://huggingface.co/ChuckMcSneed/FLUX.1-dev/resolve/main/ae.safetensors
- filename: clip_l.safetensors sha256: 660c6f5b1abae9dc498ac2d21e1347d2abdb0cf6c0c0c8576cd796491d9a6cdd uri: https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/clip_l.safetensors
- filename: t5xxl_fp16.safetensors sha256: 6e480b09fae049a72d2a8c5fbccb8d3e92febeb233bbe9dfe7256958a9167635 uri: https://huggingface.co/comfyanonymous/flux_text_encoders/resolve/main/t5xxl_fp16.safetensors
curl http://localhost:8080/v1/images/generations -H "Content-Type: application/json" -d '{ "prompt": "A cute baby sea otter", "model": "sd-ggml", "size": "256x256" }'
Notes for Reviewers
It does not wire up all the options available to stablediffusion.cpp, the purpose of this PR is to introduce the backend first, optimizations are left as an exercise for later.
- Yes, I signed my commits.