generated from runpod-workers/worker-template
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9f24389
commit bb3dcd8
Showing
4 changed files
with
42 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,24 @@ | ||
<div align="center"> | ||
|
||
<h1>Template | Worker</h1> | ||
<h1>Stable Diffusion v1.5 | Worker</h1> | ||
|
||
[![Docker Image](https://github.com/runpod-workers/worker-template/actions/workflows/CD-docker_dev.yml/badge.svg)](https://github.com/runpod-workers/worker-template/actions/workflows/CD-docker_dev.yml) | ||
|
||
🚀 | A simple worker that can be used as a starting point to build your own custom RunPod Endpoint API worker. | ||
</div> | ||
|
||
## 📖 | Getting Started | ||
## RunPod Endpoint | ||
|
||
1. Clone this repository. | ||
2. (Optional) Add DockerHub credentials to GitHub Secrets. | ||
3. Add your code to the `src` directory. | ||
4. Update the `handler.py` file to load models and process requests. | ||
5. Add any dependencies to the `requirements.txt` file. | ||
6. Add any other build time scripts to the`builder` directory, for example, downloading models. | ||
7. Update the `Dockerfile` to include any additional dependencies. | ||
This repository contains the worker for the SDv1 AI Endpoints. The following docs can be referenced to make direct calls to the running endpoints on runpod.io | ||
|
||
### CI/CD | ||
- [Stable Diffusion v1](https://docs.runpod.io/reference/stable-diffusion-v1) | ||
- [Anything v3](https://docs.runpod.io/reference/anything-v3) | ||
- [Anything v4](https://docs.runpod.io/reference/anything-v4) | ||
- [OpenJourney](https://docs.runpod.io/reference/openjourney-sd-v15) | ||
|
||
This repository is setup to automatically build and push a docker image to the GitHub Container Registry. You will need to add the following to the GitHub Secrets for this repository to enable this functionality: | ||
## Docker Image | ||
|
||
- `DOCKERHUB_USERNAME` | Your DockerHub username for logging in. | ||
- `DOCKERHUB_TOKEN` | Your DockerHub token for logging in. | ||
- `DOCKERHUB_REPO` | The name of the repository you want to push to. | ||
- `DOCKERHUB_IMG` | The name of the image you want to push to. | ||
The docker image requires two build arguments `MODEL_URL` and `Model_TAG` to build the image. The `MODEL_URL` is the url of the model repository and the `Model_TAG` is the tag of the model repository. | ||
|
||
The `CD-docker_dev.yml` file will build the image and push it to the `dev` tag, while the `CD-docker_release.yml` file will build the image on releases and tag it with the release version. | ||
|
||
## Best Practices | ||
|
||
Models should be part of your docker image, this can be accomplished by either copying them into the image or downloading them during the build process. | ||
|
||
If using the input validation utility from the runpod python package, create a `schemas` python file where you can define the schemas, then import that file into your `handler.py` file. | ||
```bash | ||
docker build --build-arg MODEL_URL=https://huggingface.co/runwayml/stable-diffusion-v1-5 --build-arg MODEL_TAG=main -t runwayml/stable-diffusion-v1-5 . | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters