Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added fastapi server and Docker files. #41

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Banbury
Copy link

@Banbury Banbury commented Sep 5, 2024

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:

fastapi run server.py

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.

@wiz-inc-a28a8b7b4c
Copy link

Wiz Scan Summary

Scan Module Critical High Medium Low Info Total
IaC Misconfigurations 0 1 6 2 2 11
Vulnerabilities 0 0 0 0 0 0
Sensitive Data 0 0 0 0 0 0
Secrets 0 0 0 0 0 0
Total 0 1 6 2 2 11

View scan details in Wiz

@Banbury
Copy link
Author

Banbury commented Sep 17, 2024

UVUnwrapper uses std::exchange, that doesn't seem to exist in newer versions of gcc. That forced me to downgrade the version of Debian.

@@ -0,0 +1,16 @@
FROM python:slim-bullseye
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FROM python:3.10-slim-bullseye

pytorchvision cannot be installed if the version of python is > 3.10

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm using this Docker image myself, and it works quite fine. I will try your change, when I have the time, but could you tell me, what the difference is?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants