A simple WebSocket client for Comfy UI
Project description
comfy-ui-client
A simple client for comfy ui.
Usage:
import json
from comfy_ui_client.client import ComfyUIClient
from comfy_ui_client.type import ImageRef
def test_text2img():
client = ComfyUIClient("localhost:8188")
with open("text2img.json", "r") as f:
prompt_text = f.read()
prompt = json.loads(prompt_text)
ret = client.get_outputs(prompt)
assert "images" in ret
def test_img2img():
client = ComfyUIClient("localhost:8188")
with open("img2img.json", "r") as f:
prompt_text = f.read()
client.upload_image(ImageRef(filename="example.png", subfolder="", type="input"), "./example.png")
prompt = json.loads(prompt_text)
ret = client.get_outputs(prompt)
assert "images" in ret
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for comfy_ui_client-0.0.1.10-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eaca382385d7e754bdb9ddabf16bf04d8d7cc36bcb08c0e40ad45b81c750191e |
|
MD5 | d2d36c585fa216f3544d982a53b374fb |
|
BLAKE2b-256 | 9f19c47e3f4b0afa42b55e67462eb43fa734901d9d5a1631b6fe58a818574878 |