A ComfyUI extension to allow external control over generation
This extension uses Flask(For the Rest API), Selenium(Controlled Workflow), Webdriver Manager(Custom Session) and Flasgger(Swagger UI) for its functionality. The purpose of this extension is to automate stuff with ComfyUI without requiring modifications to the source code, by using Selenium in head mode. It was developed specifically for KoboldCS to enable ComfyUI support for chat sessions.
Alternatively use KoboldCS's installer if you intend to use this with KoboldCS
Head into your python_embeded
folder in your ComfyUI root directory and install the following required packages with:
python -m pip install selenium
python -m pip install webdriver_manager
python -m pip install flask
python -m pip install flasgger
Then move the ExtendedAPIHook
folder your custom_nodes
folder
Link to access the Swagger UI locally: http://127.0.0.1:5000/apidocs/
This extension uses custom nodes called KSampler (External Advanced)
and KSampler (External Prompt)
which can be optionally used to control steps
, cfg
, positive prompt,
sampler_name
and scheduler
. Be informed that external send data won't be included in the metadata of the generated pictures, so those will be missing.
Furthermore you are able to start and cancel generation and receive result per Rest-API.
To receive the image, you must use the Save Image
node where the filename-prefix
is set to ComfyUI
when not changed in the source.
The following is a sample of a workflow where KSampler (External)
was used:
sci-fi, masterpiece,
is a static prompt and will be included in every requested generation. The prompt send externally(in this case "Fighter jet") will be appended to the static prompt.