Metadata-Version: 2.1
Name: comfy-ui-client
Version: 0.0.1.10
Summary: A simple WebSocket client for Comfy UI
Author: Gavin Bao
Author-email: xingce.bao@gmail.com
License: MIT
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: websocket-client
Requires-Dist: uuid
Requires-Dist: requests
Provides-Extra: dev
Requires-Dist: pytest>=6.0; extra == "dev"

# comfy-ui-client

A simple client for comfy ui.

Usage:

```python
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
```
