Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .devcontainer/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ curl -fsSL https://raw.githubusercontent.com/speakeasy-api/speakeasy/main/instal
rmdir samples || true
mkdir samples


python -m pip install --upgrade pip
pip install -e .

Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
**/__pycache__/
**/.speakeasy/temp/
**/.speakeasy/logs/
.env
.env.local
.speakeasy/reports
README-PYPI.md
.venv/
Expand Down
444 changes: 389 additions & 55 deletions .speakeasy/gen.lock

Large diffs are not rendered by default.

29 changes: 28 additions & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,43 @@ generation:
maintainOpenAPIOrder: true
usageSnippets:
optionalPropertyRendering: withExample
sdkInitStyle: constructor
useClassNamesForArrayFields: true
fixes:
nameResolutionDec2023: true
nameResolutionFeb2025: false
parameterOrderingFeb2024: true
requestResponseComponentNamesFeb2024: true
securityFeb2025: false
sharedErrorComponentsApr2025: false
sharedNestedComponentsJan2026: false
auth:
oAuth2ClientCredentialsEnabled: false
oAuth2PasswordEnabled: false
hoistGlobalSecurity: true
schemas:
allOfMergeStrategy: shallowMerge
requestBodyFieldName: ""
persistentEdits: {}
tests:
generateTests: true
generateNewTests: false
skipResponseBodyAssertions: false
python:
version: 0.7.0
version: 0.8.0
additionalDependencies:
dev: {}
main: {}
allowedRedefinedBuiltins:
- id
- object
asyncMode: both
author: Speakeasy
authors:
- Speakeasy
baseErrorName: ComfyDeployError
clientServerStatusCodesAsErrors: true
constFieldCasing: upper
defaultErrorName: SDKError
description: Python Client SDK Generated by Speakeasy
enableCustomCodeRegions: false
Expand All @@ -43,12 +61,21 @@ python:
operations: models/operations
shared: models/components
webhooks: models/webhooks
inferUnionDiscriminators: true
inputModelSuffix: input
license: ""
maxMethodParams: 4
methodArguments: require-security-and-request
moduleName: ""
multipartArrayFormat: legacy
outputModelSuffix: output
packageManager: poetry
packageName: comfydeploy
preApplyUnionDiscriminators: false
projectUrls: {}
pytestFilterWarnings: []
pytestTimeout: 0
responseFormat: envelope-http
sseFlatResponse: false
templateVersion: v2
useAsyncHooks: false
14 changes: 7 additions & 7 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
speakeasyVersion: 1.523.2
speakeasyVersion: 1.700.2
sources:
comfydeploy-api:
sourceNamespace: comfydeploy-api
sourceRevisionDigest: sha256:88643a4de11cc9a90c5da0de3ecf6526f61237a30189707b7a6abf6192ad4cb2
sourceBlobDigest: sha256:df07cbe29241948042d8f8f0dc662107805290842e5a6ed7623ccf270744fba1
sourceRevisionDigest: sha256:2aaedaaafa9b1d33e83ac5670f3aced8eedb36817d7faa0ded9d685a7cc4cb10
sourceBlobDigest: sha256:04e6ce3f75140ce358238261d8803b6dff6e955380b3e353eca99c7798681767
tags:
- latest
- speakeasy-sdk-regen-1743002572
- speakeasy-sdk-regen-1758759186
- V2
targets:
comfy-deploy:
source: comfydeploy-api
sourceNamespace: comfydeploy-api
sourceRevisionDigest: sha256:88643a4de11cc9a90c5da0de3ecf6526f61237a30189707b7a6abf6192ad4cb2
sourceBlobDigest: sha256:df07cbe29241948042d8f8f0dc662107805290842e5a6ed7623ccf270744fba1
sourceRevisionDigest: sha256:2aaedaaafa9b1d33e83ac5670f3aced8eedb36817d7faa0ded9d685a7cc4cb10
sourceBlobDigest: sha256:04e6ce3f75140ce358238261d8803b6dff6e955380b3e353eca99c7798681767
codeSamplesNamespace: code-samples-python-comfy-deploy
codeSamplesRevisionDigest: sha256:adf2885110445ea05f59d31a8a76e34c61bc6c030a258fc1ef5ae0c8836be768
codeSamplesRevisionDigest: sha256:9d00406804ff49ae2c10709badad219304c49b09c44cdfe92c2f1946cd499c07
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
102 changes: 64 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,15 @@ To authenticate your requests, include your API key in the `Authorization` heade
>
> Once a Python version reaches its [official end of life date](https://devguide.python.org/versions/), a 3-month grace period is provided for users to upgrade. Following this grace period, the minimum python version supported in the SDK will be updated.

The SDK can be installed with either *pip* or *poetry* package managers.
The SDK can be installed with *uv*, *pip*, or *poetry* package managers.

### uv

*uv* is a fast Python package installer and resolver, designed as a drop-in replacement for pip and pip-tools. It's recommended for its speed and modern Python tooling capabilities.

```bash
uv add comfydeploy
```

### PIP

Expand Down Expand Up @@ -136,7 +144,7 @@ with ComfyDeploy(
bearer="<YOUR_BEARER_TOKEN_HERE>",
) as comfy_deploy:

res = comfy_deploy.run.get(run_id="b888f774-3e7c-4135-a18c-6b985523c4bc")
res = comfy_deploy.run.get(run_id="faf49b3a-7b64-4687-95c8-58ca8a41dd73", queue_position=False)

assert res.workflow_run_model is not None

Expand All @@ -146,7 +154,8 @@ with ComfyDeploy(

</br>

The same SDK client can also be used to make asychronous requests by importing asyncio.
The same SDK client can also be used to make asynchronous requests by importing asyncio.

```python
# Asynchronous Example
import asyncio
Expand All @@ -158,7 +167,7 @@ async def main():
bearer="<YOUR_BEARER_TOKEN_HERE>",
) as comfy_deploy:

res = await comfy_deploy.run.get_async(run_id="b888f774-3e7c-4135-a18c-6b985523c4bc")
res = await comfy_deploy.run.get_async(run_id="faf49b3a-7b64-4687-95c8-58ca8a41dd73", queue_position=False)

assert res.workflow_run_model is not None

Expand Down Expand Up @@ -189,7 +198,7 @@ with ComfyDeploy(
bearer="<YOUR_BEARER_TOKEN_HERE>",
) as comfy_deploy:

res = comfy_deploy.run.get(run_id="b888f774-3e7c-4135-a18c-6b985523c4bc")
res = comfy_deploy.run.get(run_id="faf49b3a-7b64-4687-95c8-58ca8a41dd73", queue_position=False)

assert res.workflow_run_model is not None

Expand All @@ -205,13 +214,12 @@ with ComfyDeploy(
<details open>
<summary>Available methods</summary>


### [run](docs/sdks/run/README.md)
### [Run](docs/sdks/run/README.md)

* [get](docs/sdks/run/README.md#get) - Get Run
* [cancel](docs/sdks/run/README.md#cancel) - Cancel Run

#### [run.deployment](docs/sdks/deployment/README.md)
### [Run.Deployment](docs/sdks/deployment/README.md)

* [queue](docs/sdks/deployment/README.md#queue) - Queue Run

Expand All @@ -233,7 +241,7 @@ with ComfyDeploy(
bearer="<YOUR_BEARER_TOKEN_HERE>",
) as comfy_deploy:

res = comfy_deploy.run.get(run_id="b888f774-3e7c-4135-a18c-6b985523c4bc",
res = comfy_deploy.run.get(run_id="faf49b3a-7b64-4687-95c8-58ca8a41dd73", queue_position=False,
RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False))

assert res.workflow_run_model is not None
Expand All @@ -254,7 +262,7 @@ with ComfyDeploy(
bearer="<YOUR_BEARER_TOKEN_HERE>",
) as comfy_deploy:

res = comfy_deploy.run.get(run_id="b888f774-3e7c-4135-a18c-6b985523c4bc")
res = comfy_deploy.run.get(run_id="faf49b3a-7b64-4687-95c8-58ca8a41dd73", queue_position=False)

assert res.workflow_run_model is not None

Expand All @@ -267,26 +275,18 @@ with ComfyDeploy(
<!-- Start Error Handling [errors] -->
## Error Handling

Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an exception.

By default, an API error will raise a errors.SDKError exception, which has the following properties:

| Property | Type | Description |
|-----------------|------------------|-----------------------|
| `.status_code` | *int* | The HTTP status code |
| `.message` | *str* | The error message |
| `.raw_response` | *httpx.Response* | The raw HTTP response |
| `.body` | *str* | The response content |
[`ComfyDeployError`](./src/comfydeploy/models/errors/comfydeployerror.py) is the base class for all HTTP error responses. It has the following properties:

When custom error responses are specified for an operation, the SDK may also raise their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `get_async` method may raise the following exceptions:

| Error Type | Status Code | Content Type |
| -------------------------- | ----------- | ---------------- |
| errors.HTTPValidationError | 422 | application/json |
| errors.SDKError | 4XX, 5XX | \*/\* |
| Property | Type | Description |
| ------------------ | ---------------- | --------------------------------------------------------------------------------------- |
| `err.message` | `str` | Error message |
| `err.status_code` | `int` | HTTP response status code eg `404` |
| `err.headers` | `httpx.Headers` | HTTP response headers |
| `err.body` | `str` | HTTP body. Can be empty string if no body is returned. |
| `err.raw_response` | `httpx.Response` | Raw HTTP response |
| `err.data` | | Optional. Some errors may contain structured data. [See Error Classes](#error-classes). |

### Example

```python
from comfydeploy import ComfyDeploy
from comfydeploy.models import errors
Expand All @@ -298,20 +298,46 @@ with ComfyDeploy(
res = None
try:

res = comfy_deploy.run.get(run_id="b888f774-3e7c-4135-a18c-6b985523c4bc")
res = comfy_deploy.run.get(run_id="faf49b3a-7b64-4687-95c8-58ca8a41dd73", queue_position=False)

assert res.workflow_run_model is not None

# Handle response
print(res.workflow_run_model)

except errors.HTTPValidationError as e:
# handle e.data: errors.HTTPValidationErrorData
raise(e)
except errors.SDKError as e:
# handle exception
raise(e)

except errors.ComfyDeployError as e:
# The base class for HTTP error responses
print(e.message)
print(e.status_code)
print(e.body)
print(e.headers)
print(e.raw_response)

# Depending on the method different errors may be thrown
if isinstance(e, errors.HTTPValidationError):
print(e.data.detail) # Optional[List[components.ValidationError]]
```

### Error Classes
**Primary errors:**
* [`ComfyDeployError`](./src/comfydeploy/models/errors/comfydeployerror.py): The base class for HTTP error responses.
* [`HTTPValidationError`](./src/comfydeploy/models/errors/httpvalidationerror.py): Validation Error. Status code `422`.

<details><summary>Less common errors (5)</summary>

<br />

**Network errors:**
* [`httpx.RequestError`](https://www.python-httpx.org/exceptions/#httpx.RequestError): Base class for request errors.
* [`httpx.ConnectError`](https://www.python-httpx.org/exceptions/#httpx.ConnectError): HTTP client was unable to make a request to a server.
* [`httpx.TimeoutException`](https://www.python-httpx.org/exceptions/#httpx.TimeoutException): HTTP request timed out.


**Inherit from [`ComfyDeployError`](./src/comfydeploy/models/errors/comfydeployerror.py)**:
* [`ResponseValidationError`](./src/comfydeploy/models/errors/responsevalidationerror.py): Type mismatch between the response data and the expected Pydantic model. Provides access to the Pydantic validation error via the `cause` attribute.

</details>
<!-- End Error Handling [errors] -->

<!-- Start Server Selection [server] -->
Expand All @@ -334,11 +360,11 @@ from comfydeploy import ComfyDeploy


with ComfyDeploy(
server_idx=2,
server_idx=0,
bearer="<YOUR_BEARER_TOKEN_HERE>",
) as comfy_deploy:

res = comfy_deploy.run.get(run_id="b888f774-3e7c-4135-a18c-6b985523c4bc")
res = comfy_deploy.run.get(run_id="faf49b3a-7b64-4687-95c8-58ca8a41dd73", queue_position=False)

assert res.workflow_run_model is not None

Expand All @@ -355,11 +381,11 @@ from comfydeploy import ComfyDeploy


with ComfyDeploy(
server_url="https://api.comfydeploy.com/api",
server_url="http://localhost:3011/api",
bearer="<YOUR_BEARER_TOKEN_HERE>",
) as comfy_deploy:

res = comfy_deploy.run.get(run_id="b888f774-3e7c-4135-a18c-6b985523c4bc")
res = comfy_deploy.run.get(run_id="faf49b3a-7b64-4687-95c8-58ca8a41dd73", queue_position=False)

assert res.workflow_run_model is not None

Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,4 +188,14 @@ Based on:
### Generated
- [python v0.7.0] .
### Releases
- [PyPI v0.7.0] https://pypi.org/project/comfydeploy/0.7.0 - .
- [PyPI v0.7.0] https://pypi.org/project/comfydeploy/0.7.0 - .

## 2026-02-02 00:19:19
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.700.2 (2.801.2) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v0.8.0] .
### Releases
- [PyPI v0.8.0] https://pypi.org/project/comfydeploy/0.8.0 - .
7 changes: 4 additions & 3 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ with ComfyDeploy(
bearer="<YOUR_BEARER_TOKEN_HERE>",
) as comfy_deploy:

res = comfy_deploy.run.get(run_id="b888f774-3e7c-4135-a18c-6b985523c4bc")
res = comfy_deploy.run.get(run_id="faf49b3a-7b64-4687-95c8-58ca8a41dd73", queue_position=False)

assert res.workflow_run_model is not None

Expand All @@ -18,7 +18,8 @@ with ComfyDeploy(

</br>

The same SDK client can also be used to make asychronous requests by importing asyncio.
The same SDK client can also be used to make asynchronous requests by importing asyncio.

```python
# Asynchronous Example
import asyncio
Expand All @@ -30,7 +31,7 @@ async def main():
bearer="<YOUR_BEARER_TOKEN_HERE>",
) as comfy_deploy:

res = await comfy_deploy.run.get_async(run_id="b888f774-3e7c-4135-a18c-6b985523c4bc")
res = await comfy_deploy.run.get_async(run_id="faf49b3a-7b64-4687-95c8-58ca8a41dd73", queue_position=False)

assert res.workflow_run_model is not None

Expand Down
Loading