Skip to content

Commit

Permalink
add relay node
Browse files Browse the repository at this point in the history
  • Loading branch information
larkbirdy committed May 15, 2024
1 parent 015c2ec commit 24eaa52
Show file tree
Hide file tree
Showing 11 changed files with 266 additions and 276 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
# VSCode specific
*.code-workspace
/.vscode

.idea/
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.PHONY: start
start:
docker compose --profile "combined-cpu" up --build

.PHONY: download
download:
docker compose --profile download up --build

.PHONY: clean
clean:
docker system prune -a --volumes --force
59 changes: 5 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,7 @@
# Stable Diffusion WebUI Docker
# Stable Diffusion Miner Docker

Run Stable Diffusion on your machine with a nice UI without any hassle!
```bash
make download

## Setup & Usage

Visit the wiki for [Setup](https://github.com/AbdBarho/stable-diffusion-webui-docker/wiki/Setup) and [Usage](https://github.com/AbdBarho/stable-diffusion-webui-docker/wiki/Usage) instructions, checkout the [FAQ](https://github.com/AbdBarho/stable-diffusion-webui-docker/wiki/FAQ) page if you face any problems, or create a new issue!

## Features

This repository provides multiple UIs for you to play around with stable diffusion:

### [AUTOMATIC1111](https://github.com/AUTOMATIC1111/stable-diffusion-webui)

[Full feature list here](https://github.com/AUTOMATIC1111/stable-diffusion-webui-feature-showcase), Screenshots:

| Text to image | Image to image | Extras |
| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| ![](https://user-images.githubusercontent.com/24505302/189541954-46afd772-d0c8-4005-874c-e2eca40c02f2.jpg) | ![](https://user-images.githubusercontent.com/24505302/189541956-5b528de7-1b5d-479f-a1db-d3f5a53afc59.jpg) | ![](https://user-images.githubusercontent.com/24505302/189541957-cf78b352-a071-486d-8889-f26952779a61.jpg) |

### [InvokeAI](https://github.com/invoke-ai/InvokeAI)

[Full feature list here](https://github.com/invoke-ai/InvokeAI#features), Screenshots:

| Text to image | Image to image | Extras |
| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| ![](https://user-images.githubusercontent.com/24505302/195158552-39f58cb6-cfcc-4141-9995-a626e3760752.jpg) | ![](https://user-images.githubusercontent.com/24505302/195158553-152a0ab8-c0fd-4087-b121-4823bcd8d6b5.jpg) | ![](https://user-images.githubusercontent.com/24505302/195158548-e118206e-c519-4915-85d6-4c248eb10fc0.jpg) |

### [ComfyUI](https://github.com/comfyanonymous/ComfyUI)

[Full feature list here](https://github.com/comfyanonymous/ComfyUI#features), Screenshot:

| Workflow |
| -------------------------------------------------------------------------------- |
| ![](https://github.com/comfyanonymous/ComfyUI/raw/master/comfyui_screenshot.png) |

## Contributing

Contributions are welcome! **Create a discussion first of what the problem is and what you want to contribute (before you implement anything)**

## Disclaimer

The authors of this project are not responsible for any content generated using this interface.

This license of this software forbids you from sharing any content that violates any laws, produce any harm to a person, disseminate any personal information that would be meant for harm, spread misinformation and target vulnerable groups. For the full list of restrictions please read [the license](./LICENSE).

## Thanks

Special thanks to everyone behind these awesome projects, without them, none of this would have been possible:

- [AUTOMATIC1111/stable-diffusion-webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui)
- [InvokeAI](https://github.com/invoke-ai/InvokeAI)
- [ComfyUI](https://github.com/comfyanonymous/ComfyUI)
- [CompVis/stable-diffusion](https://github.com/CompVis/stable-diffusion)
- [Sygil-webui](https://github.com/Sygil-Dev/sygil-webui)
- and many many more.
make start
```
82 changes: 36 additions & 46 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
version: '3.9'

x-base_service: &base_service
ports:
- "${WEBUI_PORT:-7860}:7860"
volumes:
- &v1 ./data:/data
- &v2 ./output:/output
stop_signal: SIGKILL
tty: true
deploy:
resources:
reservations:
devices:
- driver: nvidia
device_ids: ['0']
capabilities: [compute, utility]
ports:
- "${WEBUI_PORT:-7860}:7860"
volumes:
- &v1 ./data:/data
- &v2 ./output:/output
stop_signal: SIGKILL
tty: true
networks:
- mynetwork
deploy:
resources:
reservations:
devices:
- driver: nvidia
device_ids: ['0']
capabilities: [compute, utility]

name: webui-docker

networks:
mynetwork:
driver: bridge

services:
download:
build: ./services/download/
Expand All @@ -27,47 +33,31 @@ services:

auto: &automatic
<<: *base_service
profiles: ["auto"]
profiles: ["auto", "combined"]
build: ./services/AUTOMATIC1111
image: sd-auto:72
environment:
- CLI_ARGS=--allow-code --medvram --xformers --enable-insecure-extension-access --api

auto-cpu:
<<: *automatic
profiles: ["auto-cpu"]
profiles: ["auto-cpu", "combined-cpu"]
deploy: {}
environment:
- CLI_ARGS=--no-half --precision full --allow-code --enable-insecure-extension-access --api

invoke: &invoke
<<: *base_service
profiles: ["invoke"]
build: ./services/invoke/
image: sd-invoke:30
environment:
- PRELOAD=true
- CLI_ARGS=--xformers

# invoke-cpu:
# <<: *invoke
# profiles: ["invoke-cpu"]
# environment:
# - PRELOAD=true
# - CLI_ARGS=--always_use_cpu

comfy: &comfy
<<: *base_service
profiles: ["comfy"]
build: ./services/comfy/
image: sd-comfy:6
environment:
- CLI_ARGS=


comfy-cpu:
<<: *comfy
profiles: ["comfy-cpu"]
deploy: {}
relay-node:
networks:
- mynetwork
ports:
- "${RELAY_NODE_PORT:-6387}:6387"
profiles: ["relay-node", "combined", "combined-cpu"]
build:
context: ./services/relay-node
args:
- ETH_PRIVATE_KEY=${ETH_PRIVATE_KEY}
depends_on:
- auto-cpu
environment:
- CLI_ARGS=--cpu
- ETH_PRIVATE_KEY=${ETH_PRIVATE_KEY}
- SD_URL=${SD_URL:-http://auto-cpu:7860}
22 changes: 0 additions & 22 deletions services/comfy/Dockerfile

This file was deleted.

31 changes: 0 additions & 31 deletions services/comfy/entrypoint.sh

This file was deleted.

25 changes: 0 additions & 25 deletions services/comfy/extra_model_paths.yaml

This file was deleted.

53 changes: 0 additions & 53 deletions services/invoke/Dockerfile

This file was deleted.

45 changes: 0 additions & 45 deletions services/invoke/entrypoint.sh

This file was deleted.

30 changes: 30 additions & 0 deletions services/relay-node/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Use an official Golang image as the base image
FROM golang:1.22

ARG ETH_PRIVATE_KEY
ENV ETH_PRIVATE_KEY=${ETH_PRIVATE_KEY}

# Set the working directory inside the container
WORKDIR /app

# Install necessary packages
RUN apt-get update && apt-get install -y git curl

# Copy wait-for-it.sh into the image
COPY wait-for-it.sh /usr/local/bin/wait-for-it.sh
RUN chmod +x /usr/local/bin/wait-for-it.sh

# Clone the repository
RUN git clone https://github.com/cuckoo-network/cuckoo.git

# Navigate to the specific directory
WORKDIR /app/cuckoo/packages/node

# Build the Go application with specified flags
RUN go build -tags netgo -ldflags '-s -w' -o app

# Set the environment variable
ENV NODE_TYPE=MINER

# Define the command to run the application
CMD ["/usr/local/bin/wait-for-it.sh", "auto-cpu:7860", "--", "./app"]
Loading

0 comments on commit 24eaa52

Please sign in to comment.