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.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dfc9b61bb90d806c1ba8cd3469baa33ae9f10ed52a3cf1dba8f8eee30ad3880c |
|
MD5 | 22f05b9aea47fe01a63f61f095091728 |
|
BLAKE2b-256 | 276f0986ba21647cdc8afeecd081fd10998ba24a039fb9cbd65dd632e7f1ab10 |