Added fastapi server and Docker files. #41
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I needed a REST API, that I can deploy with Docker, for my workflow. So I wrote a simple one and the necessary Docker files.
Since the model is fast enough for me even on CPU, I didn't make the container compatible with CUDA. It allows me to keep Stable Diffusion on the GPU at the same time as stable-fast-3d.
Since I have already done the work for it, I thought you might be interested in it. License is CC0, no strings attached.
Start the server with:
If you have trouble starting the FastAPI server, the reason is most likely the
__init_.py
file in the root directory. FastAPI tries to import server.py as a module, and that executes__init__.py
. I'm not sure, why this is there, but you need to delete or rename it, for the server to start.