Extending ComfyUI with Python

🤖 AI Video Summary: ComfyUI and Python integration enables automated, customizable image generation workflows. This combination allows for efficient processing of multiple images and remote triggering of ComfyUI processes, expanding creative possibilities.

👉 Go to the Assets Tab (directly above) to download the relevant files

ComfyUI’s power can be greatly enhanced when combined with Python. Here’s how to set it up:

  1. Install the ComfyUI tooling nodes custom node.
  2. Enable dev mode in ComfyUI settings.
  3. Set Node ID badge mode to “show all” in Light Graph settings.

Workflow Notes:

The workflow itself doesn’t really matter. All that does is the “Load Image (Base64)” (if performing an image-to-image task) and the “Send Image (WebSocket)” as an output node.

Make sure to notate the Node ID if using the Load Image (Base64) node and also export the workflow as an API file.

    Python Integration:

    1. Create a directory with your input image, main.py file, and workflow file.
    2. Main.py will load the workflow, encode the input image to Base64, and send/receive the data to the ComfyUI server.
    3. Be sure to update the server IP address and Load Image node ID in the Python script.

    This setup allows for batch processing, automation, and integration with other Python tools, greatly expanding ComfyUI’s capabilities.

    Leave a Comment

    Leave a Comment