• Stars
    star
    462
  • Rank 94,188 (Top 2 %)
  • Language
    Python
  • License
    MIT License
  • Created 8 months ago
  • Updated 9 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Run ComfyUI with an API

cog-comfyui

Run ComfyUI workflows on Replicate:

https://replicate.com/fofr/any-comfyui-workflow

We recommend:

  • trying it with your favorite workflow and make sure it works
  • writing code to customise the JSON you pass to the model, for example changing seeds or prompts
  • using the Replicate API to run the workflow

TLDR: json blob -> img/mp4

Whatโ€™s included

We've tried to include many of the most popular model weights:

View list of supported weights

The following custom nodes are also supported, these are fixed to specific commits:

Raise an issue to request more custom nodes or models, or use this model as a template to roll your own.

How to use

1. Get your API JSON

Youโ€™ll need the API version of your ComfyUI workflow. This is different to the commonly shared JSON version, it does not included visual information about nodes, etc.

To get your API JSON:

  1. Turn on the "Enable Dev mode Options" from the ComfyUI settings (via the settings icon)
  2. Load your workflow into ComfyUI
  3. Export your API JSON using the "Save (API format)" button
comfyui-save-workflow.mp4

2. Gather your input files

If your model takes inputs, like images for img2img or controlnet, you have 3 options:

Use a URL

Modify your API JSON file to point at a URL:

- "image": "/your-path-to/image.jpg",
+ "image": "https://example.com/image.jpg",

Upload a single input

You can also upload a single input file when running the model.

This file will be saved as input.[extension] โ€“ for example input.jpg. It'll be placed in the ComfyUI input directory, so you can reference in your workflow with:

- "image": "/your-path-to/image.jpg",
+ "image": "image.jpg",

Upload a zip file or tar file of your inputs

These will be downloaded and extracted to the input directory. You can then reference them in your workflow based on their relative paths.

So a zip file containing:

- my_img.png
- references/my_reference_01.jpg
- references/my_reference_02.jpg

Might be used in the workflow like:

"image": "my_img.png",
...
"directory": "references",

Run your workflow

With all your inputs updated, you can now run your workflow.

Some workflows save temporary files, for example pre-processed controlnet images. You can also return these by enabling the return_temp_files option.

Developing locally

Clone this repository:

git clone --recurse-submodules https://github.com/fofr/cog-comfyui.git

Run the following script to install all the custom nodes:

./scripts/clone_plugins.sh

Running the Web UI from your Cog container

  1. GPU Machine: Start the Cog container and expose port 8188:
sudo cog run -p 8188 bash

Running this command starts up the Cog container and let's you access it

  1. Inside Cog Container: Now that we have access to the Cog container, we start the server, binding to all network interfaces:
cd ComfyUI/
python main.py --listen 0.0.0.0
  1. Local Machine: Access the server using the GPU machine's IP and the exposed port (8188): http://<gpu-machines-ip>:8188

When you goto http://<gpu-machines-ip>:8188 you'll see the classic ComfyUI web form!

More Repositories

1

cog-face-to-many

Turn any face into a video game character, pixel art, claymation, 3D or toy
Python
1,154
star
2

css-experiments

CSS, HTML and JS experiments from 2010
JavaScript
635
star
3

cog-face-to-sticker

face-to-sticker
Python
544
star
4

cog-become-image

Turn anyone into another image
Python
204
star
5

cog-stickers

Make stickers
Python
181
star
6

replicate-llm-training

Fine tune an LLM using Replicate
JavaScript
51
star
7

waveformer

Text to waveform video using MusicGen
JavaScript
48
star
8

cog-cpu-toolkit

Common tasks in a single model
Python
33
star
9

cog-style-transfer

Copy the style from one image to another
Python
31
star
10

cog-lcm

Python
27
star
11

cog-sdxl-multi-controlnet-lora

SDXL Multi-controlnet with loras
Python
24
star
12

cog-video-morpher

Generate a video that morphs between subjects, with an optional style
Python
24
star
13

upscale

A local upscaler using Replicate
Python
22
star
14

mediawiki-to-training-data

Split out a MediaWiki XML file into files
JavaScript
21
star
15

cog-material-transfer

Transfer the material from one image to another
Python
21
star
16

prompter.fofr.ai

An app for generating prompts
JavaScript
20
star
17

cog-sdxl-lcm-multi-controlnet-lora

SDXL LCM Multi-controlnet with loras
Python
15
star
18

animate

Python
12
star
19

prompts

Prompts
JavaScript
11
star
20

cog-align-your-steps

A simple text-to-image model using AYS
Python
10
star
21

replicate-predict

A wrapper library to make running parallel API calls to Replicate models easier.
JavaScript
10
star
22

cog-sdxl-turbo-multi-controlnet-lora

Python
10
star
23

ComfyUI-HyperSDXL1StepUnetScheduler

ComfyUI sampler for HyperSDXL UNet
Python
10
star
24

audio-to-waveform

Convert an audio file to a waveform video
Python
7
star
25

cog-comfyui-sd3

Python
5
star
26

cog-realvisxl-3

RealVisXL_v3.0
Python
5
star
27

sprite-generator

Create sprites from selected images
JavaScript
4
star
28

cog-potat

Text to video using Potat model
Python
4
star
29

video-to-frames

Split videos into frames
Python
3
star
30

cog-sdxl-turbo

Python
3
star
31

cog-realvisxl-3-multi-controlnet-lora

Python
3
star
32

cog-lcm-video2video

https://replicate.com/fofr/lcm-video2video
Python
3
star
33

govuk_status_prototype

Prototype GOV.UK status page
CSS
2
star
34

cog-lcm-animation

Python
2
star
35

cog-comfyui-scripts

Scripts for helping to manage cog-comfyui
2
star
36

frames-to-video

Combine frames into video
Python
2
star
37

llama-court-app

JavaScript
2
star
38

cog-comfyui-image-merge

Python
2
star
39

cog-batch-image-captioning

Caption images for lora training
Python
1
star
40

cog-deliberate-multi-controlnet

Python
1
star
41

cog-consistent-character

Python
1
star
42

govuk-prototype-rig-template

A template of the GOV.UK Prototype Rig to create new prototypes from
HTML
1
star
43

opencga-prototype

Open CGA prototype
JavaScript
1
star
44

cog-comfyui-trt-builder

TensorRT engine builder
Python
1
star
45

cog-aura-flow

Run AuraFlow on Replicate
Python
1
star
46

sdxl-custom-train

Python
1
star
47

talking-heads

JavaScript
1
star
48

cog-lcm-sdxl-lora

Python
1
star
49

cog-text-to-image-template

Python
1
star
50

publisher-display-screen

Dashboard for GOV.UK admin tools
JavaScript
1
star
51

govuk-design-history-old

A place for documenting designs. Built using the GOV.UK prototyping kit
JavaScript
1
star
52

cog-comfyui-pulid

Python
1
star
53

cog-comfyui-instantid

Python
1
star