- simply deploy comfyui, provide api.
- publish to replicate, use replicate gpu.
pull code in ubuntu
git clone https://github.com/xuhongming251/cog-xuxx-comfyui.git
cd cog-xuxx-comfyui
- start comfyui
sudo cog run -p 8188 bash
cd ComfyUI/
python main.py --listen 0.0.0.0
- open link
http://localhost:8188/
python3 test_basic_api_example.py
python3 test_local_predict_cmd.py
or use cmd below, it can print log real time
cog predict -i workflow=test0
cog predict -i workflow=test1
-
install wsl2, see step 1-3
-
install ubuntu24.04 in wsl2, see step 4-5
-
install docker, see step 6
-
install cog in ubuntu, see step 7
-
test env in local
- Test the local UI by the link http://localhost:8188/ to verify that the env of comfyui and the custom nodes work.
del all local checkpoints models、local input images, and test below.
python3 test_basic_api_example.py
, verify the dev workflow api json file.python3 test_local_predict_cmd.py
, test local predict cmd.cog predict -i workflow=test0
, the model file auto download by name.cog predict -i workflow=test1
, input image use http online address.cog predict -i workflow=test1
, that the output dir images will return.
-
add github action for push model.(see
.github\workflows\push.yml
)- need config secret REPLICATE_API_TOKEN at github config use replicate api token, see Step 2、3.
- need config PAT_TOKEN to access pull submodule for github actions. config setp by step
- push action
-
add custom node and publish
- add custom_nodes pip deps in
cog.yaml
- check the checkpoints name has been in
weights.json
and the config_weihts_use_in_work_flow inpredict.py
. - can add extra params in
predict.py
(not needed), predict fun. - config
.dockerignore
file, add not static files like models file(will dynamic download) to dockerignore. (for local publish, ignore it for git action publish) - change the input workflow params when invoke, use http online address in workflow for image.
- add custom_nodes pip deps in
- simple text 2 image workflow.
- add only one custom node, reactor node.