-
-
Notifications
You must be signed in to change notification settings - Fork 221
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
feat/restore-snapshot #30
Conversation
… a missing "package.json"
* 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 <timpietrusky@gmail.com>
@kklemon Hi - is it possible to provide a little more guidance here? I added a snapshot.json in the root directory, but nothing changed when I built the image in Docker. Thank you |
Adding a Edit: Since the Dockerfile uses glob-based file copying, you will need a relatively new Docker installation. I couldn't figure out the exact version, but it should work from Docker version 20 upwards. |
Thanks @kklemon - I didn't build the image from scratch, so will try again with your advice |
@kklemon thanks for adding this, it sounds really nice. We will have to test this, as this is a feature we haven't used yet. But it sounds like this would solve a lot of problems regarding custom nodes and backing them into the actual Docker image. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kklemon I have two questions, please take a look!
@@ -39,15 +41,16 @@ RUN if [ -z "$SKIP_DEFAULT_MODELS" ]; then wget -O models/vae/sdxl_vae.safetenso | |||
RUN if [ -z "$SKIP_DEFAULT_MODELS" ]; then wget -O models/vae/sdxl-vae-fp16-fix.safetensors https://huggingface.co/madebyollin/sdxl-vae-fp16-fix/resolve/main/sdxl_vae.safetensors; fi | |||
RUN if [ -z "$SKIP_DEFAULT_MODELS" ]; then wget -O models/loras/xl_more_art-full_v1.safetensors https://civitai.com/api/download/models/152309; fi | |||
|
|||
# Support for the network volume | |||
ADD src/extra_model_paths.yaml ./ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this removed? As this is also usable for adding models into ComfyUI via the network volume.
Dockerfile
Outdated
RUN chmod +x /start.sh /restore_snapshot.sh | ||
|
||
# Optionally copy snapshot file | ||
ADD snapshot.jso[n] / |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would we have jso[n]
here when we always expect a json-file?
@kklemon I updated the base branch as we want to move away from having the |
@kklemon ping 🙏 |
@TimPietrusky I've completely forgotten about this PR. I will check whether it's still relevant, update it if that's the case or close it otherwise. |
@martintomov I haven't been active in the ComfyUI community for a while and don't know what the current de facto standard for managing extensions is, but when I created this PR, I assumed that it's ComfyUI Manager. If you want to incorporate custom nodes into a RunPod deployment, my recommendation is to install your nodes or extensions via ComfyUI Manager and export a snapshot of your setup as JSON file. You can then just put the |
src/restore_snapshot.sh
Outdated
|
||
# Trigger restoring of the snapshot by performing a quick test run | ||
# Note: We need to use `yes` as some custom nodes may try to install dependencies with pip | ||
/usr/bin/yes | python main.py --cpu --quick-test-for-ci |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be python3?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's a good idea to add a symlink for python to point to python3.10.
Here is the relevant section of the Dockerfile with the symlink added:
RUN apt-get update && apt-get install -y \
python3.10 \
python3-pip \
git \
wget \
&& ln -sf /usr/bin/python3.10 /usr/bin/python
@kklemon thank you very much, then I will go down this road and make sure it is working. |
Some changes are coming:
In my tests this made sure, that we can now install custom nodes using the snapshot created using the ComfyUI Manager, which is way more nice than adding the nodes directly into the Dockerfile. |
🎉 This PR is included in version 3.2.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
I can't seem to get this working . When i start a runpod pod and open my comfy ui on port 8188 it works fine , i can generate my images fine But when i use the serverless endpoint with the same workflow json , i get an error It seems like the custom nodes are not being recognized in the serverless endpoint even though i have the snapshot.json in the /runpod-volume (/workspace) directory If i try a request with no custom nodes on the runpod serverless endpoint , it works fine. |
* 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 (blib-la#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 <timpietrusky@gmail.com> * 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 <timpietrusky@gmail.com> Co-authored-by: Meptl <git-client@meptl.com>
* 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 (blib-la#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 <timpietrusky@gmail.com> * 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 <timpietrusky@gmail.com> Co-authored-by: Meptl <git-client@meptl.com>
Motivation
Many users and workflows rely on custom nodes and extensions which correspondingly should also be available in a RunPod worker.
ComfyUI Manager, perhaps the most popular ComfyUI management exension, provides a convenient feature to export a snapshot of the ComfyUI instance with all installed extensions.
This PR implements optional restoring of a snapshot if provided as
snapshot.json
in the root directory. If such a file is found, ComfyUI Manager will be installed and restoring of the snapshot will be triggered by starting ComfyUI with the--cpu --quick-test-for-ci
flags within the Docker image build process.Issues closed
#6 #22 #18 #9 (partially)
Todo