Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

comfy-ui-client-0.0.1.10.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

comfy_ui_client-0.0.1.10-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

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

Hashes for comfy-ui-client-0.0.1.10.tar.gz
Algorithm Hash digest
SHA256 49052c13051b9b5c3cdb6d7a44712d89aec458418dcb9207758a491ccee16a70
MD5 a741e33fc96f393b8908bf92bed1a02f
BLAKE2b-256 462e59c3268fe1baa36e08a3ce575e490fdff14de0b2dc4df0f4d1be5b78d669

See more details on using hashes here.

File details

Details for the file comfy_ui_client-0.0.1.10-py3-none-any.whl.

File metadata

File hashes

Hashes for comfy_ui_client-0.0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 eaca382385d7e754bdb9ddabf16bf04d8d7cc36bcb08c0e40ad45b81c750191e
MD5 d2d36c585fa216f3544d982a53b374fb
BLAKE2b-256 9f19c47e3f4b0afa42b55e67462eb43fa734901d9d5a1631b6fe58a818574878

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page