You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat: provide option to run the handler locally as API
* ci: run the workflow on our extended instance
* feat: the local API should run on 0.0.0.0
* feat: make the image smaller
* ci: use semantic-version to create releases automatically
* chore: we don't want to break anyone with a minor release
* docs: added section for local API testing
* ci: use custom runner
* fix: added .releaserc, otherwise semantic-release will complain about a missing "package.json"
* feat: support network volumes, skip default models (#16)
* Support network volumes
* README tweaks
* docs: added comment on what is happening
* feat: don't overwrite the default paths, but add "runpod_worker_comfy" to have additional paths
* docs: updated "bring your own models"
---------
Co-authored-by: Tim Pietrusky <[email protected]>
* feat: provide access to ComfyUI via web
* fix: use the full path to the output image
* feat: added env vars COMFY_POLLING_INTERVAL_MS and COMFY_POLLING_MAX_RETRIES
* test: added "subfolder"
* Implement optional restoring of ComfyUI snapshots
* feat: use comfy-cli to install ComfyUI & restore snapshot
* fix: install all dependencies from the snapshot
* chore: moved example snapshot to test_resources
* feat: allow any kind of snapshot file
* feat: allow any file that has "snapshot" in its name
* ci: added test for "restore-snapshot"
* ci: run restore snapshat test automatically
* docs: use "snapshots" to bake custom nodes into the docker image
* docs: add link to ComfyUI Manager docs on how to export snapshots
* ci: use correct path to example_snapshot.json
* ci: fix the path
* ci: fix the file path
* ci: use a mock instead of the actual file
* ci: fix the path
* chore: don't ignore snapshot.json as people might use this
---------
Co-authored-by: Tim Pietrusky <[email protected]>
Co-authored-by: Meptl <[email protected]>
→ Please also checkout [Captain: The AI Platform](https://github.com/blib-la/captain)
14
-
15
13
---
16
14
17
15
<!-- toc -->
18
16
19
17
-[Quickstart](#quickstart)
20
18
-[Features](#features)
21
19
-[Config](#config)
22
-
*[Upload image to AWS S3](#upload-image-to-aws-s3)
20
+
-[Upload image to AWS S3](#upload-image-to-aws-s3)
23
21
-[Use the Docker image on RunPod](#use-the-docker-image-on-runpod)
24
-
*[Create your template (optional)](#create-your-template-optional)
25
-
*[Create your endpoint](#create-your-endpoint)
26
-
*[GPU recommendations](#gpu-recommendations)
22
+
-[Create your template (optional)](#create-your-template-optional)
23
+
-[Create your endpoint](#create-your-endpoint)
24
+
-[GPU recommendations](#gpu-recommendations)
27
25
-[API specification](#api-specification)
28
-
*[JSON Request Body](#json-request-body)
29
-
*[Fields](#fields)
30
-
+["input.images"](#inputimages)
26
+
-[JSON Request Body](#json-request-body)
27
+
-[Fields](#fields)
28
+
-["input.images"](#inputimages)
31
29
-[Interact with your RunPod API](#interact-with-your-runpod-api)
32
-
*[Health status](#health-status)
33
-
*[Generate an image](#generate-an-image)
34
-
+[Example request for SDXL with cURL](#example-request-for-sdxl-with-curl)
30
+
-[Health status](#health-status)
31
+
-[Generate an image](#generate-an-image)
32
+
-[Example request for SDXL with cURL](#example-request-for-sdxl-with-curl)
35
33
-[How to get the workflow from ComfyUI?](#how-to-get-the-workflow-from-comfyui)
36
34
-[Bring Your Own Models and Nodes](#bring-your-own-models-and-nodes)
37
-
*[Network Volume](#network-volume)
38
-
*[Custom Docker Image](#custom-docker-image)
35
+
-[Network Volume](#network-volume)
36
+
-[Custom Docker Image](#custom-docker-image)
37
+
-[Adding Custom Models](#adding-custom-models)
38
+
-[Adding Custom Nodes](#adding-custom-nodes)
39
+
-[Building the Image](#building-the-image)
39
40
-[Local testing](#local-testing)
40
-
*[Setup](#setup)
41
-
+[Setup for Windows](#setup-for-windows)
42
-
*[Testing the RunPod handler](#testing-the-runpod-handler)
43
-
*[Local API](#local-api)
44
-
+[Access the local Worker API](#access-the-local-worker-api)
45
-
+[Access local ComfyUI](#access-local-comfyui)
41
+
-[Setup](#setup)
42
+
-[Setup for Windows](#setup-for-windows)
43
+
-[Testing the RunPod handler](#testing-the-runpod-handler)
44
+
-[Local API](#local-api)
45
+
-[Access the local Worker API](#access-the-local-worker-api)
46
+
-[Access local ComfyUI](#access-local-comfyui)
46
47
-[Automatically deploy to Docker hub with GitHub Actions](#automatically-deploy-to-docker-hub-with-github-actions)
47
48
-[Acknowledgments](#acknowledgments)
48
49
@@ -293,39 +294,52 @@ Note: The folders in the Network Volume are automatically available to ComfyUI w
293
294
294
295
### Custom Docker Image
295
296
296
-
If you prefer to include your models directly in the Docker image, follow these steps:
297
+
If you prefer to include your models and custom nodes directly in the Docker image, follow these steps:
297
298
298
299
1. **Fork the Repository**:
299
-
300
300
- Fork this repository to your own GitHub account.
301
301
302
-
2. **Add Your Modelsin the Dockerfile**:
302
+
#### Adding Custom Models
303
303
304
-
- Edit the `Dockerfile` to include your models:
305
-
```Dockerfile
306
-
RUN wget -O models/checkpoints/sd_xl_base_1.0.safetensors https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/resolve/main/sd_xl_base_1.0.safetensors
307
-
```
308
-
- You can also add custom nodes:
309
-
```Dockerfile
310
-
RUN git clone https://github.com/<username>/<custom-node-repo>.git custom_nodes/<custom-node-repo>
311
-
```
304
+
To include additional models in your Docker image, edit the `Dockerfile` and add the download commands:
312
305
313
-
3. **Build Your Docker Image**:
314
-
- Build the **base** image locally:
315
-
```bash
316
-
docker build -t <your_dockerhub_username>/runpod-worker-comfy:dev-base --target base --platform linux/amd64 .
RUN wget -O models/checkpoints/sd_xl_base_1.0.safetensors https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/resolve/main/sd_xl_base_1.0.safetensors
308
+
```
309
+
310
+
#### Adding Custom Nodes
311
+
312
+
To include custom nodes in your Docker image:
313
+
314
+
1. [Export a snapshot from ComfyUI Manager](https://github.com/ltdrdata/ComfyUI-Manager?tab=readme-ov-file#snapshot-manager) that includes all your desired custom nodes
315
+
a. Open "Manager > Snapshot Manager"
316
+
b. Create a new snapshot by clicking on "Save snapshot"
317
+
c. Get the `*_snapshot.json` from your ComfyUI: `ComfyUI/custom_nodes/ComfyUI-Manager/snapshots`
318
+
2. Save the snapshot file in the root directory of the project
319
+
3. The snapshot will be automatically restored during the Docker build process, see [Building the Image](#building-the-image)
320
+
321
+
> [!NOTE]
322
+
>
323
+
> - Some custom nodes may download additional models during installation, which can significantly increase the image size
324
+
> - Having many custom nodes may increase ComfyUI's initialization time
325
+
326
+
#### Building the Image
327
+
328
+
Build your customized Docker image locally:
329
+
330
+
```bash
331
+
# Build the base image
332
+
docker build -t <your_dockerhub_username>/runpod-worker-comfy:dev-base --target base --platform linux/amd64 .
0 commit comments