Skip to content

Commit

Permalink
Fix open pose vector generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Acly committed Oct 15, 2024
1 parent 7775cc2 commit eaaa432
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
3 changes: 2 additions & 1 deletion ai_diffusion/comfy_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,8 @@ def _extract_pose_json(msg: dict):
try:
output = msg["data"]["output"]
if "openpose_json" in output:
return json.loads(output["openpose_json"][0])
result = json.loads(output["openpose_json"][0])
return result[0] if isinstance(result, list) else result
except Exception as e:
log.warning(f"Error processing message, error={str(e)}, msg={msg}")
return None
Expand Down
7 changes: 1 addition & 6 deletions tests/test_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,18 +132,13 @@ def test_large_image(qtapp, cloud_client):
run_and_save(qtapp, cloud_client, workflow, "pod_large_image")


@pytest.mark.parametrize("scenario", ["resolution", "steps", "control", "max_pixels"])
@pytest.mark.parametrize("scenario", ["resolution", "steps", "max_pixels"])
def test_validation(qtapp, cloud_client: CloudClient, scenario: str):
workflow = create_simple_workflow()
if scenario == "resolution":
workflow.images = ImageInput.from_extent(Extent(19000, 512))
elif scenario == "steps":
ensure(workflow.sampling).total_steps = 200
elif scenario == "control":
img = Image.create(Extent(4, 4))
control = ensure(workflow.conditioning).control
for i in range(7):
control.append(ControlInput(ControlMode.depth, img))
elif scenario == "max_pixels":
workflow.images = ImageInput.from_extent(Extent(3840, 2168)) # > 4k

Expand Down

0 comments on commit eaaa432

Please sign in to comment.