Fix compatibility with Python 3.9, 3.10, fix Configuration class declaration issue

This commit is contained in:
doctorpangloss
2024-02-07 21:52:20 -08:00
parent 747ab861c1
commit 123c512a84
17 changed files with 121 additions and 69 deletions
@@ -3,6 +3,7 @@ import asyncio
import pytest
import torch
from comfy.cli_args_types import Configuration
from comfy.client.embedded_comfy_client import EmbeddedComfyClient
from comfy.client.sdxl_with_refiner_workflow import sdxl_workflow_with_refiner
@@ -34,6 +35,14 @@ async def test_embedded_comfy():
outputs = await client.queue_prompt(prompt)
assert outputs["13"]["images"][0]["abs_path"] is not None
@pytest.mark.asyncio
async def test_configuration_options():
config = Configuration()
async with EmbeddedComfyClient(configuration=config) as client:
prompt = sdxl_workflow_with_refiner("test")
outputs = await client.queue_prompt(prompt)
assert outputs["13"]["images"][0]["abs_path"] is not None
@pytest.mark.asyncio
async def test_multithreaded_comfy():
async with EmbeddedComfyClient(max_workers=2) as client: