Skip to content
This repository was archived by the owner on May 8, 2025. It is now read-only.

Commit bb3dcd8

Browse files
committed
fix: updated readme
1 parent 9f24389 commit bb3dcd8

File tree

4 files changed

+42
-25
lines changed

4 files changed

+42
-25
lines changed

.github/workflows/CD-docker_release.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,29 @@ on:
66

77
jobs:
88
docker:
9+
strategy:
10+
matrix:
11+
include:
12+
- model_name: stable-diffusion-v1-5
13+
model_tag: runwayml/stable-diffusion-v1-5
14+
model_url: https://huggingface.co/runwayml/stable-diffusion-v1-5
15+
16+
- model_name: anything-v3
17+
model_tag: Linaqruf/anything-v3.0
18+
model_url: https://huggingface.co/Linaqruf/anything-v3.0
19+
20+
- model_name: anything-v4
21+
model_tag: andite/anything-v4.0
22+
model_url: https://huggingface.co/andite/anything-v4.0
23+
24+
- model_name: openjourney
25+
model_tag: prompthero/openjourney
26+
model_url: https://huggingface.co/prompthero/openjourney
27+
28+
- model_name: realistic-vision
29+
model_tag: SG161222/Realistic_Vision_V1.4
30+
model_url: https://huggingface.co/SG161222/Realistic_Vision_V1.4
31+
932
runs-on: ubuntu-latest
1033
steps:
1134
- name: Clear Space
@@ -30,5 +53,8 @@ jobs:
3053
- name: Build and push
3154
uses: docker/build-push-action@v4
3255
with:
56+
build-args: |
57+
MODEL_URL=${{ matrix.model_url }}
58+
MODEL_TAG=${{ matrix.model_tag }}
3359
push: true
34-
tags: ${{ secrets.DOCKERHUB_REPO }}/${{ secrets.DOCKERHUB_IMG }}:${{ github.event.release.tag_name }}
60+
tags: ${{ secrets.DOCKERHUB_REPO }}/${{ secrets.DOCKERHUB_IMG }}:${{ matrix.model_name }}-${{ github.event.release.tag_name }}

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,6 @@ RUN rm /model_fetcher.py
2626
# Add src files (Worker Template)
2727
ADD src .
2828

29+
ENV RUNPOD_DEBUG_LEVEL=INFO
30+
2931
CMD python -u /rp_handler.py --model_tag=${MODEL_TAG}

README.md

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,24 @@
11
<div align="center">
22

3-
<h1>Template | Worker</h1>
3+
<h1>Stable Diffusion v1.5 | Worker</h1>
44

55
[![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)
66

7-
🚀 | A simple worker that can be used as a starting point to build your own custom RunPod Endpoint API worker.
87
</div>
98

10-
## 📖 | Getting Started
9+
## RunPod Endpoint
1110

12-
1. Clone this repository.
13-
2. (Optional) Add DockerHub credentials to GitHub Secrets.
14-
3. Add your code to the `src` directory.
15-
4. Update the `handler.py` file to load models and process requests.
16-
5. Add any dependencies to the `requirements.txt` file.
17-
6. Add any other build time scripts to the`builder` directory, for example, downloading models.
18-
7. Update the `Dockerfile` to include any additional dependencies.
11+
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
1912

20-
### CI/CD
13+
- [Stable Diffusion v1](https://docs.runpod.io/reference/stable-diffusion-v1)
14+
- [Anything v3](https://docs.runpod.io/reference/anything-v3)
15+
- [Anything v4](https://docs.runpod.io/reference/anything-v4)
16+
- [OpenJourney](https://docs.runpod.io/reference/openjourney-sd-v15)
2117

22-
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:
18+
## Docker Image
2319

24-
- `DOCKERHUB_USERNAME` | Your DockerHub username for logging in.
25-
- `DOCKERHUB_TOKEN` | Your DockerHub token for logging in.
26-
- `DOCKERHUB_REPO` | The name of the repository you want to push to.
27-
- `DOCKERHUB_IMG` | The name of the image you want to push to.
20+
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.
2821

29-
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.
30-
31-
## Best Practices
32-
33-
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.
34-
35-
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.
22+
```bash
23+
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 .
24+
```

builder/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Required Python packages get listed here, one per line.
22
# Reccomended to lock the version number to avoid unexpected changes.
33

4-
runpod==0.9.3
4+
runpod==0.9.7
55
diffusers==0.12.1
66
torch==1.13.1 --extra-index-url=https://download.pytorch.org/whl/cu116
77
ftfy==6.1.1

0 commit comments

Comments
 (0)