Skip to content

chore: 🐝 Update SDK - Generate 0.8.0 #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
**/__pycache__/
**/.speakeasy/temp/
**/.speakeasy/logs/
.speakeasy/reports
README-PYPI.md
.venv/
Expand Down
53 changes: 20 additions & 33 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
lockVersion: 2.0.0
id: 2c1d440e-25e4-46e2-a435-ebd1f72a7373
management:
docChecksum: a12e94397f17ad377cd82287f65fc0dd
docChecksum: c3555c5386ea2308bddda5f4775bee30
docVersion: V2
speakeasyVersion: 1.523.2
generationVersion: 2.560.1
releaseVersion: 0.7.0
configChecksum: efd69310efe6f150238bffd349771dd8
speakeasyVersion: 1.599.0
generationVersion: 2.675.0
releaseVersion: 0.8.0
configChecksum: e9f29c1e81f1de95e6fa67929147bd42
repoURL: https://github.com/comfy-deploy/comfy-deploy-python.git
installationURL: https://github.com/comfy-deploy/comfy-deploy-python.git
published: true
features:
python:
additionalDependencies: 1.0.0
constsAndDefaults: 1.0.5
core: 5.12.4
core: 5.19.7
defaultEnabledRetries: 0.2.0
devContainers: 3.0.0
enumUnions: 0.1.0
Expand All @@ -23,21 +23,19 @@ features:
globalSecurity: 3.0.3
globalSecurityCallbacks: 1.0.0
globalSecurityFlattening: 1.0.0
globalServerURLs: 3.1.0
globalServerURLs: 3.1.1
groups: 3.0.0
nameOverrides: 3.0.1
nullables: 1.0.1
responseFormat: 1.0.1
retries: 3.0.2
sdkHooks: 1.0.1
sdkHooks: 1.1.0
unions: 3.0.4
webhooks: 2.0.0
generatedFiles:
- .devcontainer/README.md
- .devcontainer/devcontainer.json
- .devcontainer/setup.sh
- .gitattributes
- .python-version
- .vscode/settings.json
- USAGE.md
- docs/models/components/createrunresponse.md
Expand All @@ -52,17 +50,13 @@ generatedFiles:
- docs/models/components/validationerror.md
- docs/models/components/workflowrunmodel.md
- docs/models/components/workflowrunoutputmodel.md
- docs/models/components/workflowrunstatus.md
- docs/models/components/workflowrunwebhookbody.md
- docs/models/components/workflowrunwebhookresponse.md
- docs/models/errors/httpvalidationerror.md
- docs/models/operations/cancelrunrunrunidcancelpostrequest.md
- docs/models/operations/cancelrunrunrunidcancelpostresponse.md
- docs/models/operations/getrunrunrunidgetrequest.md
- docs/models/operations/getrunrunrunidgetresponse.md
- docs/models/operations/queuedeploymentrunrundeploymentqueuepostresponse.md
- docs/models/utils/retryconfig.md
- docs/models/webhooks/runupdaterequestbodywebhookpostresponse.md
- docs/sdks/comfydeploy/README.md
- docs/sdks/deployment/README.md
- docs/sdks/run/README.md
Expand Down Expand Up @@ -90,18 +84,16 @@ generatedFiles:
- src/comfydeploy/models/components/validationerror.py
- src/comfydeploy/models/components/workflowrunmodel.py
- src/comfydeploy/models/components/workflowrunoutputmodel.py
- src/comfydeploy/models/components/workflowrunstatus.py
- src/comfydeploy/models/components/workflowrunwebhookbody.py
- src/comfydeploy/models/components/workflowrunwebhookresponse.py
- src/comfydeploy/models/errors/__init__.py
- src/comfydeploy/models/errors/comfydeployerror.py
- src/comfydeploy/models/errors/httpvalidationerror.py
- src/comfydeploy/models/errors/no_response_error.py
- src/comfydeploy/models/errors/responsevalidationerror.py
- src/comfydeploy/models/errors/sdkerror.py
- src/comfydeploy/models/operations/__init__.py
- src/comfydeploy/models/operations/cancel_run_run_run_id_cancel_post.py
- src/comfydeploy/models/operations/get_run_run_run_id_get.py
- src/comfydeploy/models/operations/queue_deployment_run_run_deployment_queue_post.py
- src/comfydeploy/models/webhooks/__init__.py
- src/comfydeploy/models/webhooks/run_update_request_body_webhook_post.py
- src/comfydeploy/py.typed
- src/comfydeploy/run.py
- src/comfydeploy/sdk.py
Expand All @@ -110,6 +102,7 @@ generatedFiles:
- src/comfydeploy/types/basemodel.py
- src/comfydeploy/utils/__init__.py
- src/comfydeploy/utils/annotations.py
- src/comfydeploy/utils/datetimes.py
- src/comfydeploy/utils/enums.py
- src/comfydeploy/utils/eventstreaming.py
- src/comfydeploy/utils/forms.py
Expand All @@ -121,17 +114,20 @@ generatedFiles:
- src/comfydeploy/utils/retries.py
- src/comfydeploy/utils/security.py
- src/comfydeploy/utils/serializers.py
- src/comfydeploy/utils/unmarshal_json_response.py
- src/comfydeploy/utils/url.py
- src/comfydeploy/utils/values.py
examples:
get_run_run__run_id__get:
speakeasy-default-get-run-run-run-id-get:
parameters:
path:
run_id: "b888f774-3e7c-4135-a18c-6b985523c4bc"
run_id: "faf49b3a-7b64-4687-95c8-58ca8a41dd73"
query:
queue_position: false
responses:
"200":
application/json: {"id": "e50f7622-81da-484b-9c66-1c8a99c6b71b", "workflow_version_id": "ecd62b8f-7112-4aaf-90ab-4e43b4cca371", "workflow_inputs": "<value>", "workflow_id": "f620807a-a1f8-4cf0-95d8-9d58ee381f6b", "workflow_api": "<value>", "machine_id": "b885c09d-541c-4293-b683-64a15f8d7e75", "origin": "<value>", "status": "<value>", "created_at": "2024-02-02T12:01:38.576Z", "updated_at": "2023-04-16T15:25:27.950Z", "gpu_event_id": "<id>", "gpu": "<value>", "machine_version": "<value>", "machine_type": "<value>", "modal_function_call_id": "<id>", "user_id": "<id>", "org_id": "<id>", "live_status": "<value>", "progress": 0, "is_realtime": false, "webhook": "<value>", "webhook_status": "<value>", "webhook_intermediate_status": false, "number": 494415, "duration": 6188.69, "cold_start_duration": 9131.15, "cold_start_duration_total": 1865.92, "run_duration": 3787.04}
application/json: {"id": "46a99099-5b7a-4e10-8e06-6dacc98118bf", "workflow_version_id": "f69dd44f-f54c-41db-91a8-2526823f19f0", "workflow_inputs": "<value>", "workflow_id": "39f9f100-52c4-4837-9d06-0278a672e1ec", "workflow_api": "<value>", "machine_id": "2fc8c79b-bed3-4891-b575-269d7cdf77e5", "origin": "<value>", "status": "<value>", "created_at": "2025-04-08T06:46:17.964Z", "updated_at": "2024-08-17T20:17:10.773Z", "gpu_event_id": "<id>", "gpu": "<value>", "machine_version": "<value>", "machine_type": "<value>", "modal_function_call_id": "<id>", "user_id": "<id>", "org_id": "<id>", "live_status": "<value>", "progress": 0, "is_realtime": false, "webhook": "<value>", "webhook_status": "<value>", "webhook_intermediate_status": false}
"422":
application/json: {}
cancel_run_run__run_id__cancel_post:
Expand All @@ -147,20 +143,11 @@ examples:
queue_deployment_run_run_deployment_queue_post:
speakeasy-default-queue-deployment-run-run-deployment-queue-post:
requestBody:
application/json: {"inputs": {"prompt": "A beautiful landscape", "seed": 42}, "webhook": "https://myapp.com/webhook", "webhook_intermediate_status": true, "deployment_id": "15e79589-12c9-453c-a41a-348fdd7de957"}
application/json: {"inputs": {"num_inference_steps": 30, "prompt": "A futuristic cityscape", "seed": 123456}, "webhook": "https://myapp.com/webhook", "webhook_intermediate_status": true, "deployment_id": "12345678-1234-5678-1234-567812345678"}
responses:
"200":
application/json: {"run_id": "03ec31b2-4d0d-4329-88ff-ac74003017b7"}
application/json: {"run_id": "17cad37f-15e1-48dc-8b81-b4a67ba778ba"}
"422":
application/json: {}
run_update__request_body__webhook__post:
speakeasy-default-run-update-request-body-webhook-post:
requestBody:
application/json: {"run_id": "<id>", "status": "success", "live_status": "<value>", "progress": 0}
responses:
"200":
application/json: {"status": "<value>"}
"422":
application/json: {}
examplesVersion: 1.0.0
examplesVersion: 1.0.2
generatedTests: {}
11 changes: 10 additions & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,31 @@ generation:
maintainOpenAPIOrder: true
usageSnippets:
optionalPropertyRendering: withExample
sdkInitStyle: constructor
useClassNamesForArrayFields: true
fixes:
nameResolutionDec2023: true
nameResolutionFeb2025: false
parameterOrderingFeb2024: true
requestResponseComponentNamesFeb2024: true
securityFeb2025: false
sharedErrorComponentsApr2025: false
auth:
oAuth2ClientCredentialsEnabled: false
oAuth2PasswordEnabled: false
tests:
generateTests: true
generateNewTests: false
skipResponseBodyAssertions: false
python:
version: 0.7.0
version: 0.8.0
additionalDependencies:
dev: {}
main: {}
author: Speakeasy
authors:
- Speakeasy
baseErrorName: ComfyDeployError
clientServerStatusCodesAsErrors: true
defaultErrorName: SDKError
description: Python Client SDK Generated by Speakeasy
Expand All @@ -46,9 +53,11 @@ python:
inputModelSuffix: input
maxMethodParams: 4
methodArguments: require-security-and-request
moduleName: ""
outputModelSuffix: output
packageName: comfydeploy
projectUrls: {}
pytestFilterWarnings: []
pytestTimeout: 0
responseFormat: envelope-http
templateVersion: v2
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.599.0
sources:
comfydeploy-api:
sourceNamespace: comfydeploy-api
sourceRevisionDigest: sha256:88643a4de11cc9a90c5da0de3ecf6526f61237a30189707b7a6abf6192ad4cb2
sourceBlobDigest: sha256:df07cbe29241948042d8f8f0dc662107805290842e5a6ed7623ccf270744fba1
sourceRevisionDigest: sha256:dbcb9ebaa3713d40344a21b88b23d2e32a1636d32d03dfa8289bea77340ab287
sourceBlobDigest: sha256:5211ba08069d2ed9ac8660a26292941fed64af92a464c70cb5f5d96ec5399140
tags:
- latest
- speakeasy-sdk-regen-1743002572
- speakeasy-sdk-regen-1753229691
- V2
targets:
comfy-deploy:
source: comfydeploy-api
sourceNamespace: comfydeploy-api
sourceRevisionDigest: sha256:88643a4de11cc9a90c5da0de3ecf6526f61237a30189707b7a6abf6192ad4cb2
sourceBlobDigest: sha256:df07cbe29241948042d8f8f0dc662107805290842e5a6ed7623ccf270744fba1
sourceRevisionDigest: sha256:dbcb9ebaa3713d40344a21b88b23d2e32a1636d32d03dfa8289bea77340ab287
sourceBlobDigest: sha256:5211ba08069d2ed9ac8660a26292941fed64af92a464c70cb5f5d96ec5399140
codeSamplesNamespace: code-samples-python-comfy-deploy
codeSamplesRevisionDigest: sha256:adf2885110445ea05f59d31a8a76e34c61bc6c030a258fc1ef5ae0c8836be768
codeSamplesRevisionDigest: sha256:9d00406804ff49ae2c10709badad219304c49b09c44cdfe92c2f1946cd499c07
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
84 changes: 51 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,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 +146,7 @@ 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 +158,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 +189,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 Down Expand Up @@ -233,7 +233,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 +254,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 +267,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.
[`ComfyDeployError`](./src/comfydeploy/models/errors/comfydeployerror.py) is the base class for all HTTP error responses. It has the following properties:

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 |

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 +290,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 @@ -338,7 +356,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 @@ -355,11 +373,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
Loading