fal 1.0.8__py3-none-any.whl → 1.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of fal might be problematic. Click here for more details.

Files changed (45) hide show
  1. fal/_fal_version.py +2 -2
  2. fal/api.py +27 -26
  3. fal/cli/deploy.py +18 -8
  4. fal/workflows.py +1 -1
  5. {fal-1.0.8.dist-info → fal-1.1.0.dist-info}/METADATA +1 -1
  6. {fal-1.0.8.dist-info → fal-1.1.0.dist-info}/RECORD +44 -23
  7. {fal-1.0.8.dist-info → fal-1.1.0.dist-info}/WHEEL +1 -1
  8. openapi_fal_rest/api/comfy/__init__.py +0 -0
  9. openapi_fal_rest/api/comfy/create_workflow.py +172 -0
  10. openapi_fal_rest/api/comfy/delete_workflow.py +175 -0
  11. openapi_fal_rest/api/comfy/get_workflow.py +181 -0
  12. openapi_fal_rest/api/comfy/list_user_workflows.py +189 -0
  13. openapi_fal_rest/api/comfy/update_workflow.py +198 -0
  14. openapi_fal_rest/api/users/__init__.py +0 -0
  15. openapi_fal_rest/api/users/get_current_user.py +143 -0
  16. openapi_fal_rest/api/workflows/{create_or_update_workflow_workflows_post.py → create_workflow.py} +4 -4
  17. openapi_fal_rest/api/workflows/{get_workflows_workflows_get.py → list_user_workflows.py} +4 -4
  18. openapi_fal_rest/api/workflows/update_workflow.py +198 -0
  19. openapi_fal_rest/models/__init__.py +32 -10
  20. openapi_fal_rest/models/comfy_workflow_detail.py +109 -0
  21. openapi_fal_rest/models/comfy_workflow_item.py +88 -0
  22. openapi_fal_rest/models/comfy_workflow_schema.py +119 -0
  23. openapi_fal_rest/models/{execute_workflow_workflows_user_id_workflow_name_post_json_body_type_0.py → comfy_workflow_schema_extra_data.py} +5 -5
  24. openapi_fal_rest/models/{execute_workflow_workflows_user_id_workflow_name_post_response_200_type_0.py → comfy_workflow_schema_fal_inputs.py} +5 -5
  25. openapi_fal_rest/models/comfy_workflow_schema_fal_inputs_dev_info.py +44 -0
  26. openapi_fal_rest/models/{workflow_detail_contents_type_0.py → comfy_workflow_schema_prompt.py} +5 -5
  27. openapi_fal_rest/models/current_user.py +138 -0
  28. openapi_fal_rest/models/customer_details.py +8 -8
  29. openapi_fal_rest/models/lock_reason.py +3 -0
  30. openapi_fal_rest/models/page_comfy_workflow_item.py +107 -0
  31. openapi_fal_rest/models/team_role.py +10 -0
  32. openapi_fal_rest/models/typed_comfy_workflow.py +85 -0
  33. openapi_fal_rest/models/typed_comfy_workflow_update.py +95 -0
  34. openapi_fal_rest/models/typed_workflow_update.py +95 -0
  35. openapi_fal_rest/models/user_member.py +87 -0
  36. openapi_fal_rest/models/workflow_contents.py +20 -1
  37. openapi_fal_rest/models/workflow_contents_metadata.py +44 -0
  38. openapi_fal_rest/models/workflow_detail.py +18 -59
  39. openapi_fal_rest/models/workflow_detail_contents.py +44 -0
  40. openapi_fal_rest/models/workflow_item.py +19 -1
  41. openapi_fal_rest/api/workflows/execute_workflow_workflows_user_id_workflow_name_post.py +0 -268
  42. {fal-1.0.8.dist-info → fal-1.1.0.dist-info}/entry_points.txt +0 -0
  43. {fal-1.0.8.dist-info → fal-1.1.0.dist-info}/top_level.txt +0 -0
  44. /openapi_fal_rest/api/workflows/{delete_workflow_workflows_user_id_workflow_name_delete.py → delete_workflow.py} +0 -0
  45. /openapi_fal_rest/api/workflows/{get_workflow_workflows_user_id_workflow_name_get.py → get_workflow.py} +0 -0
@@ -0,0 +1,175 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Dict, Optional, Union, cast
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import Client
8
+ from ...models.http_validation_error import HTTPValidationError
9
+ from ...types import Response
10
+
11
+
12
+ def _get_kwargs(
13
+ user_id: str,
14
+ name: str,
15
+ *,
16
+ client: Client,
17
+ ) -> Dict[str, Any]:
18
+ url = "{}/comfy/{user_id}/{name}".format(client.base_url, user_id=user_id, name=name)
19
+
20
+ headers: Dict[str, str] = client.get_headers()
21
+ cookies: Dict[str, Any] = client.get_cookies()
22
+
23
+ return {
24
+ "method": "delete",
25
+ "url": url,
26
+ "headers": headers,
27
+ "cookies": cookies,
28
+ "timeout": client.get_timeout(),
29
+ "follow_redirects": client.follow_redirects,
30
+ }
31
+
32
+
33
+ def _parse_response(*, client: Client, response: httpx.Response) -> Optional[Union[Any, HTTPValidationError]]:
34
+ if response.status_code == HTTPStatus.NO_CONTENT:
35
+ response_204 = cast(Any, None)
36
+ return response_204
37
+ if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY:
38
+ response_422 = HTTPValidationError.from_dict(response.json())
39
+
40
+ return response_422
41
+ if client.raise_on_unexpected_status:
42
+ raise errors.UnexpectedStatus(response.status_code, response.content)
43
+ else:
44
+ return None
45
+
46
+
47
+ def _build_response(*, client: Client, response: httpx.Response) -> Response[Union[Any, HTTPValidationError]]:
48
+ return Response(
49
+ status_code=HTTPStatus(response.status_code),
50
+ content=response.content,
51
+ headers=response.headers,
52
+ parsed=_parse_response(client=client, response=response),
53
+ )
54
+
55
+
56
+ def sync_detailed(
57
+ user_id: str,
58
+ name: str,
59
+ *,
60
+ client: Client,
61
+ ) -> Response[Union[Any, HTTPValidationError]]:
62
+ """Delete Workflow
63
+
64
+ Args:
65
+ user_id (str):
66
+ name (str):
67
+
68
+ Raises:
69
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
70
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
71
+
72
+ Returns:
73
+ Response[Union[Any, HTTPValidationError]]
74
+ """
75
+
76
+ kwargs = _get_kwargs(
77
+ user_id=user_id,
78
+ name=name,
79
+ client=client,
80
+ )
81
+
82
+ response = httpx.request(
83
+ verify=client.verify_ssl,
84
+ **kwargs,
85
+ )
86
+
87
+ return _build_response(client=client, response=response)
88
+
89
+
90
+ def sync(
91
+ user_id: str,
92
+ name: str,
93
+ *,
94
+ client: Client,
95
+ ) -> Optional[Union[Any, HTTPValidationError]]:
96
+ """Delete Workflow
97
+
98
+ Args:
99
+ user_id (str):
100
+ name (str):
101
+
102
+ Raises:
103
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
104
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
105
+
106
+ Returns:
107
+ Union[Any, HTTPValidationError]
108
+ """
109
+
110
+ return sync_detailed(
111
+ user_id=user_id,
112
+ name=name,
113
+ client=client,
114
+ ).parsed
115
+
116
+
117
+ async def asyncio_detailed(
118
+ user_id: str,
119
+ name: str,
120
+ *,
121
+ client: Client,
122
+ ) -> Response[Union[Any, HTTPValidationError]]:
123
+ """Delete Workflow
124
+
125
+ Args:
126
+ user_id (str):
127
+ name (str):
128
+
129
+ Raises:
130
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
131
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
132
+
133
+ Returns:
134
+ Response[Union[Any, HTTPValidationError]]
135
+ """
136
+
137
+ kwargs = _get_kwargs(
138
+ user_id=user_id,
139
+ name=name,
140
+ client=client,
141
+ )
142
+
143
+ async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
144
+ response = await _client.request(**kwargs)
145
+
146
+ return _build_response(client=client, response=response)
147
+
148
+
149
+ async def asyncio(
150
+ user_id: str,
151
+ name: str,
152
+ *,
153
+ client: Client,
154
+ ) -> Optional[Union[Any, HTTPValidationError]]:
155
+ """Delete Workflow
156
+
157
+ Args:
158
+ user_id (str):
159
+ name (str):
160
+
161
+ Raises:
162
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
163
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
164
+
165
+ Returns:
166
+ Union[Any, HTTPValidationError]
167
+ """
168
+
169
+ return (
170
+ await asyncio_detailed(
171
+ user_id=user_id,
172
+ name=name,
173
+ client=client,
174
+ )
175
+ ).parsed
@@ -0,0 +1,181 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Dict, Optional, Union
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import Client
8
+ from ...models.comfy_workflow_detail import ComfyWorkflowDetail
9
+ from ...models.http_validation_error import HTTPValidationError
10
+ from ...types import Response
11
+
12
+
13
+ def _get_kwargs(
14
+ user_id: str,
15
+ name: str,
16
+ *,
17
+ client: Client,
18
+ ) -> Dict[str, Any]:
19
+ url = "{}/comfy/{user_id}/{name}".format(client.base_url, user_id=user_id, name=name)
20
+
21
+ headers: Dict[str, str] = client.get_headers()
22
+ cookies: Dict[str, Any] = client.get_cookies()
23
+
24
+ return {
25
+ "method": "get",
26
+ "url": url,
27
+ "headers": headers,
28
+ "cookies": cookies,
29
+ "timeout": client.get_timeout(),
30
+ "follow_redirects": client.follow_redirects,
31
+ }
32
+
33
+
34
+ def _parse_response(
35
+ *, client: Client, response: httpx.Response
36
+ ) -> Optional[Union[ComfyWorkflowDetail, HTTPValidationError]]:
37
+ if response.status_code == HTTPStatus.OK:
38
+ response_200 = ComfyWorkflowDetail.from_dict(response.json())
39
+
40
+ return response_200
41
+ if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY:
42
+ response_422 = HTTPValidationError.from_dict(response.json())
43
+
44
+ return response_422
45
+ if client.raise_on_unexpected_status:
46
+ raise errors.UnexpectedStatus(response.status_code, response.content)
47
+ else:
48
+ return None
49
+
50
+
51
+ def _build_response(
52
+ *, client: Client, response: httpx.Response
53
+ ) -> Response[Union[ComfyWorkflowDetail, HTTPValidationError]]:
54
+ return Response(
55
+ status_code=HTTPStatus(response.status_code),
56
+ content=response.content,
57
+ headers=response.headers,
58
+ parsed=_parse_response(client=client, response=response),
59
+ )
60
+
61
+
62
+ def sync_detailed(
63
+ user_id: str,
64
+ name: str,
65
+ *,
66
+ client: Client,
67
+ ) -> Response[Union[ComfyWorkflowDetail, HTTPValidationError]]:
68
+ """Get Workflow
69
+
70
+ Args:
71
+ user_id (str):
72
+ name (str):
73
+
74
+ Raises:
75
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
76
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
77
+
78
+ Returns:
79
+ Response[Union[ComfyWorkflowDetail, HTTPValidationError]]
80
+ """
81
+
82
+ kwargs = _get_kwargs(
83
+ user_id=user_id,
84
+ name=name,
85
+ client=client,
86
+ )
87
+
88
+ response = httpx.request(
89
+ verify=client.verify_ssl,
90
+ **kwargs,
91
+ )
92
+
93
+ return _build_response(client=client, response=response)
94
+
95
+
96
+ def sync(
97
+ user_id: str,
98
+ name: str,
99
+ *,
100
+ client: Client,
101
+ ) -> Optional[Union[ComfyWorkflowDetail, HTTPValidationError]]:
102
+ """Get Workflow
103
+
104
+ Args:
105
+ user_id (str):
106
+ name (str):
107
+
108
+ Raises:
109
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
110
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
111
+
112
+ Returns:
113
+ Union[ComfyWorkflowDetail, HTTPValidationError]
114
+ """
115
+
116
+ return sync_detailed(
117
+ user_id=user_id,
118
+ name=name,
119
+ client=client,
120
+ ).parsed
121
+
122
+
123
+ async def asyncio_detailed(
124
+ user_id: str,
125
+ name: str,
126
+ *,
127
+ client: Client,
128
+ ) -> Response[Union[ComfyWorkflowDetail, HTTPValidationError]]:
129
+ """Get Workflow
130
+
131
+ Args:
132
+ user_id (str):
133
+ name (str):
134
+
135
+ Raises:
136
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
137
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
138
+
139
+ Returns:
140
+ Response[Union[ComfyWorkflowDetail, HTTPValidationError]]
141
+ """
142
+
143
+ kwargs = _get_kwargs(
144
+ user_id=user_id,
145
+ name=name,
146
+ client=client,
147
+ )
148
+
149
+ async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
150
+ response = await _client.request(**kwargs)
151
+
152
+ return _build_response(client=client, response=response)
153
+
154
+
155
+ async def asyncio(
156
+ user_id: str,
157
+ name: str,
158
+ *,
159
+ client: Client,
160
+ ) -> Optional[Union[ComfyWorkflowDetail, HTTPValidationError]]:
161
+ """Get Workflow
162
+
163
+ Args:
164
+ user_id (str):
165
+ name (str):
166
+
167
+ Raises:
168
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
169
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
170
+
171
+ Returns:
172
+ Union[ComfyWorkflowDetail, HTTPValidationError]
173
+ """
174
+
175
+ return (
176
+ await asyncio_detailed(
177
+ user_id=user_id,
178
+ name=name,
179
+ client=client,
180
+ )
181
+ ).parsed
@@ -0,0 +1,189 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Dict, Optional, Union
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import Client
8
+ from ...models.http_validation_error import HTTPValidationError
9
+ from ...models.page_comfy_workflow_item import PageComfyWorkflowItem
10
+ from ...types import UNSET, Response, Unset
11
+
12
+
13
+ def _get_kwargs(
14
+ *,
15
+ client: Client,
16
+ page: Union[Unset, None, int] = 1,
17
+ size: Union[Unset, None, int] = 50,
18
+ ) -> Dict[str, Any]:
19
+ url = "{}/comfy/".format(client.base_url)
20
+
21
+ headers: Dict[str, str] = client.get_headers()
22
+ cookies: Dict[str, Any] = client.get_cookies()
23
+
24
+ params: Dict[str, Any] = {}
25
+ params["page"] = page
26
+
27
+ params["size"] = size
28
+
29
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
30
+
31
+ return {
32
+ "method": "get",
33
+ "url": url,
34
+ "headers": headers,
35
+ "cookies": cookies,
36
+ "timeout": client.get_timeout(),
37
+ "follow_redirects": client.follow_redirects,
38
+ "params": params,
39
+ }
40
+
41
+
42
+ def _parse_response(
43
+ *, client: Client, response: httpx.Response
44
+ ) -> Optional[Union[HTTPValidationError, PageComfyWorkflowItem]]:
45
+ if response.status_code == HTTPStatus.OK:
46
+ response_200 = PageComfyWorkflowItem.from_dict(response.json())
47
+
48
+ return response_200
49
+ if response.status_code == HTTPStatus.UNPROCESSABLE_ENTITY:
50
+ response_422 = HTTPValidationError.from_dict(response.json())
51
+
52
+ return response_422
53
+ if client.raise_on_unexpected_status:
54
+ raise errors.UnexpectedStatus(response.status_code, response.content)
55
+ else:
56
+ return None
57
+
58
+
59
+ def _build_response(
60
+ *, client: Client, response: httpx.Response
61
+ ) -> Response[Union[HTTPValidationError, PageComfyWorkflowItem]]:
62
+ return Response(
63
+ status_code=HTTPStatus(response.status_code),
64
+ content=response.content,
65
+ headers=response.headers,
66
+ parsed=_parse_response(client=client, response=response),
67
+ )
68
+
69
+
70
+ def sync_detailed(
71
+ *,
72
+ client: Client,
73
+ page: Union[Unset, None, int] = 1,
74
+ size: Union[Unset, None, int] = 50,
75
+ ) -> Response[Union[HTTPValidationError, PageComfyWorkflowItem]]:
76
+ """List User Workflows
77
+
78
+ Args:
79
+ page (Union[Unset, None, int]): Default: 1.
80
+ size (Union[Unset, None, int]): Default: 50.
81
+
82
+ Raises:
83
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
84
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
85
+
86
+ Returns:
87
+ Response[Union[HTTPValidationError, PageComfyWorkflowItem]]
88
+ """
89
+
90
+ kwargs = _get_kwargs(
91
+ client=client,
92
+ page=page,
93
+ size=size,
94
+ )
95
+
96
+ response = httpx.request(
97
+ verify=client.verify_ssl,
98
+ **kwargs,
99
+ )
100
+
101
+ return _build_response(client=client, response=response)
102
+
103
+
104
+ def sync(
105
+ *,
106
+ client: Client,
107
+ page: Union[Unset, None, int] = 1,
108
+ size: Union[Unset, None, int] = 50,
109
+ ) -> Optional[Union[HTTPValidationError, PageComfyWorkflowItem]]:
110
+ """List User Workflows
111
+
112
+ Args:
113
+ page (Union[Unset, None, int]): Default: 1.
114
+ size (Union[Unset, None, int]): Default: 50.
115
+
116
+ Raises:
117
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
118
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
119
+
120
+ Returns:
121
+ Union[HTTPValidationError, PageComfyWorkflowItem]
122
+ """
123
+
124
+ return sync_detailed(
125
+ client=client,
126
+ page=page,
127
+ size=size,
128
+ ).parsed
129
+
130
+
131
+ async def asyncio_detailed(
132
+ *,
133
+ client: Client,
134
+ page: Union[Unset, None, int] = 1,
135
+ size: Union[Unset, None, int] = 50,
136
+ ) -> Response[Union[HTTPValidationError, PageComfyWorkflowItem]]:
137
+ """List User Workflows
138
+
139
+ Args:
140
+ page (Union[Unset, None, int]): Default: 1.
141
+ size (Union[Unset, None, int]): Default: 50.
142
+
143
+ Raises:
144
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
145
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
146
+
147
+ Returns:
148
+ Response[Union[HTTPValidationError, PageComfyWorkflowItem]]
149
+ """
150
+
151
+ kwargs = _get_kwargs(
152
+ client=client,
153
+ page=page,
154
+ size=size,
155
+ )
156
+
157
+ async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
158
+ response = await _client.request(**kwargs)
159
+
160
+ return _build_response(client=client, response=response)
161
+
162
+
163
+ async def asyncio(
164
+ *,
165
+ client: Client,
166
+ page: Union[Unset, None, int] = 1,
167
+ size: Union[Unset, None, int] = 50,
168
+ ) -> Optional[Union[HTTPValidationError, PageComfyWorkflowItem]]:
169
+ """List User Workflows
170
+
171
+ Args:
172
+ page (Union[Unset, None, int]): Default: 1.
173
+ size (Union[Unset, None, int]): Default: 50.
174
+
175
+ Raises:
176
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
177
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
178
+
179
+ Returns:
180
+ Union[HTTPValidationError, PageComfyWorkflowItem]
181
+ """
182
+
183
+ return (
184
+ await asyncio_detailed(
185
+ client=client,
186
+ page=page,
187
+ size=size,
188
+ )
189
+ ).parsed