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
File details
Details for the file comfy-ui-client-0.0.1.10.tar.gz
.
File metadata
- Download URL: comfy-ui-client-0.0.1.10.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49052c13051b9b5c3cdb6d7a44712d89aec458418dcb9207758a491ccee16a70 |
|
MD5 | a741e33fc96f393b8908bf92bed1a02f |
|
BLAKE2b-256 | 462e59c3268fe1baa36e08a3ce575e490fdff14de0b2dc4df0f4d1be5b78d669 |
File details
Details for the file comfy_ui_client-0.0.1.10-py3-none-any.whl
.
File metadata
- Download URL: comfy_ui_client-0.0.1.10-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eaca382385d7e754bdb9ddabf16bf04d8d7cc36bcb08c0e40ad45b81c750191e |
|
MD5 | d2d36c585fa216f3544d982a53b374fb |
|
BLAKE2b-256 | 9f19c47e3f4b0afa42b55e67462eb43fa734901d9d5a1631b6fe58a818574878 |