-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Expand file tree
/
Copy pathopenapi.yaml
More file actions
3231 lines (3113 loc) · 97.3 KB
/
openapi.yaml
File metadata and controls
3231 lines (3113 loc) · 97.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.1.0
info:
title: ComfyUI API
description: |
API for ComfyUI - A powerful and modular stable diffusion GUI and backend.
This API allows you to interact with ComfyUI programmatically, including:
- Submitting and managing workflow executions
- Querying node/object information
- Uploading and viewing files
- Managing user settings and data
- Asset management (feature-gated)
## Dual-path routing
Every route registered via `self.routes` in the ComfyUI server is available at
both its bare path (e.g. `/prompt`) and an `/api`-prefixed path (e.g. `/api/prompt`).
This spec uses the `/api`-prefixed versions as canonical.
## Multi-user mode
When ComfyUI is started with `--multi-user`, the `Comfy-User` header identifies
the active user for settings, userdata, and history isolation. This is **not** a
security mechanism — it is an organisational convenience with no authentication
or authorisation behind it.
version: 1.0.0
license:
name: GNU General Public License v3.0
url: https://github.com/comfyanonymous/ComfyUI/blob/master/LICENSE
servers:
- url: /
description: Default ComfyUI server (typically http://127.0.0.1:8188)
tags:
- name: prompt
description: Workflow submission and prompt info
- name: queue
description: Queue inspection and management
- name: history
description: Execution history
- name: upload
description: File upload endpoints
- name: view
description: File viewing / download
- name: system
description: System stats and feature flags
- name: node
description: Node / object_info definitions
- name: model
description: Model folder and file listing
- name: user
description: User management (multi-user mode)
- name: userdata
description: Per-user file storage
- name: settings
description: Per-user settings
- name: extensions
description: Frontend extension JS files
- name: subgraph
description: Global subgraph blueprints
- name: internal
description: Internal / debug endpoints
- name: assets
description: Asset management (feature-gated behind enable-assets)
paths:
# ---------------------------------------------------------------------------
# WebSocket
# ---------------------------------------------------------------------------
/ws:
get:
operationId: connectWebSocket
tags: [system]
summary: WebSocket connection for real-time updates
description: |
Upgrades to a WebSocket connection that streams execution progress,
node status, and output messages. The server sends an initial `status`
message with the session ID (SID) on connect.
## Message types (server → client)
The server sends JSON messages with a `type` field. See the
`x-websocket-messages` list below for the schema of each message type.
parameters:
- name: clientId
in: query
required: false
schema:
type: string
description: Client identifier. If omitted the server assigns one.
responses:
"101":
description: WebSocket upgrade successful
x-websocket-messages:
- type: status
schema:
$ref: "#/components/schemas/StatusWsMessage"
- type: progress
schema:
$ref: "#/components/schemas/ProgressWsMessage"
- type: progress_text
schema:
$ref: "#/components/schemas/ProgressTextWsMessage"
- type: progress_state
schema:
$ref: "#/components/schemas/ProgressStateWsMessage"
- type: executing
schema:
$ref: "#/components/schemas/ExecutingWsMessage"
- type: executed
schema:
$ref: "#/components/schemas/ExecutedWsMessage"
- type: execution_start
schema:
$ref: "#/components/schemas/ExecutionStartWsMessage"
- type: execution_success
schema:
$ref: "#/components/schemas/ExecutionSuccessWsMessage"
- type: execution_cached
schema:
$ref: "#/components/schemas/ExecutionCachedWsMessage"
- type: execution_interrupted
schema:
$ref: "#/components/schemas/ExecutionInterruptedWsMessage"
- type: execution_error
schema:
$ref: "#/components/schemas/ExecutionErrorWsMessage"
- type: logs
schema:
$ref: "#/components/schemas/LogsWsMessage"
- type: notification
schema:
$ref: "#/components/schemas/NotificationWsMessage"
- type: feature_flags
schema:
$ref: "#/components/schemas/FeatureFlagsWsMessage"
- type: asset_download
schema:
$ref: "#/components/schemas/AssetDownloadWsMessage"
- type: asset_export
schema:
$ref: "#/components/schemas/AssetExportWsMessage"
# ---------------------------------------------------------------------------
# Prompt
# ---------------------------------------------------------------------------
/api/prompt:
get:
operationId: getPromptInfo
tags: [prompt]
summary: Get queue status
description: Returns how many items remain in the execution queue.
responses:
"200":
description: Queue info
content:
application/json:
schema:
$ref: "#/components/schemas/PromptInfo"
post:
operationId: executePrompt
tags: [prompt]
summary: Submit a workflow for execution
description: Submits a workflow for execution. The server validates the graph, assigns a `prompt_id`, and enqueues it. Clients listen on `/ws` for execution progress and output messages.
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/PromptRequest"
responses:
"200":
description: Prompt accepted
content:
application/json:
schema:
$ref: "#/components/schemas/PromptResponse"
"400":
description: Validation or node errors
content:
application/json:
schema:
$ref: "#/components/schemas/PromptErrorResponse"
# ---------------------------------------------------------------------------
# Queue
# ---------------------------------------------------------------------------
/api/queue:
get:
operationId: getQueue
tags: [queue]
summary: Get running and pending queue items
description: Returns the server's current execution queue, split into the currently-running prompt and the list of pending prompts.
responses:
"200":
description: Queue contents
content:
application/json:
schema:
$ref: "#/components/schemas/QueueInfo"
post:
operationId: manageQueue
tags: [queue]
summary: Clear or delete items from the queue
description: Mutates the execution queue. Supports clearing all queued prompts or deleting individual prompts by ID.
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/QueueManageRequest"
responses:
"200":
description: Queue updated
/api/interrupt:
post:
operationId: interruptExecution
tags: [queue]
summary: Interrupt current execution
description: Interrupts the prompt that is currently executing. The next queued prompt (if any) will start immediately after.
requestBody:
required: false
content:
application/json:
schema:
type: object
properties:
prompt_id:
type: string
format: uuid
description: "If provided, only interrupts this specific running prompt. Otherwise interrupts all."
responses:
"200":
description: Interrupt signal sent
/api/free:
post:
operationId: freeMemory
tags: [queue]
summary: Free GPU memory and/or unload models
description: Frees GPU memory by unloading models and/or freeing the resident model cache, controlled by the request flags.
requestBody:
required: false
content:
application/json:
schema:
type: object
properties:
unload_models:
type: boolean
description: Unload all models from VRAM/RAM
free_memory:
type: boolean
description: Run garbage collection and free cached memory
responses:
"200":
description: Memory freed
# ---------------------------------------------------------------------------
# Jobs
# ---------------------------------------------------------------------------
/api/jobs:
get:
operationId: listJobs
tags: [queue]
summary: List jobs with filtering and pagination
description: Returns a paginated list of completed prompt executions, newest first.
parameters:
- name: status
in: query
schema:
type: string
description: Filter by job status
- name: workflow_id
in: query
schema:
type: string
description: Filter by workflow ID
- name: sort_by
in: query
schema:
type: string
description: Field to sort by
- name: sort_order
in: query
schema:
type: string
enum: [asc, desc]
description: Sort direction
- name: limit
in: query
schema:
type: integer
description: Maximum number of results (default is unlimited/None)
- name: offset
in: query
schema:
type: integer
default: 0
description: Pagination offset
responses:
"200":
description: Jobs list
content:
application/json:
schema:
type: object
properties:
jobs:
type: array
items:
$ref: "#/components/schemas/JobEntry"
pagination:
$ref: "#/components/schemas/PaginationInfo"
/api/jobs/{job_id}:
get:
operationId: getJob
tags: [queue]
summary: Get a single job by ID
description: Returns the full record for a single completed prompt execution, including its outputs, status, and metadata.
parameters:
- name: job_id
in: path
description: The job (prompt) ID to fetch.
required: true
schema:
type: string
format: uuid
responses:
"200":
description: Job detail
content:
application/json:
schema:
$ref: "#/components/schemas/JobDetailResponse"
"404":
description: Job not found
# ---------------------------------------------------------------------------
# History
# ---------------------------------------------------------------------------
/api/history:
get:
operationId: getHistory
tags: [history]
summary: Get execution history
deprecated: true
description: |
**Deprecated.** Superseded by `GET /api/jobs`, which returns the same
execution records in a paginated, filterable format. Planned for removal
no earlier than a future major release; sunset timeline TBD.
Returns a dictionary keyed by prompt_id. Each value is a HistoryEntry
containing prompt metadata, outputs, status, and node meta.
parameters:
- $ref: "#/components/parameters/ComfyUserHeader"
- name: max_items
in: query
schema:
type: integer
description: Maximum number of history entries to return
- name: offset
in: query
schema:
type: integer
description: Pagination offset (number of entries to skip)
responses:
"200":
description: History dictionary keyed by prompt_id
content:
application/json:
schema:
type: object
additionalProperties:
$ref: "#/components/schemas/HistoryEntry"
post:
operationId: manageHistory
tags: [history]
summary: Clear or delete history entries
deprecated: true
description: |
**Deprecated.** Superseded by the forthcoming job-management endpoints
under `/api/jobs`. Planned for removal no earlier than a future major
release; sunset timeline TBD.
parameters:
- $ref: "#/components/parameters/ComfyUserHeader"
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/HistoryManageRequest"
responses:
"200":
description: History updated
/api/history/{prompt_id}:
get:
operationId: getHistoryByPromptId
tags: [history]
summary: Get history for a specific prompt
deprecated: true
description: |
**Deprecated.** Superseded by `GET /api/jobs/{job_id}`, which returns
the same execution record. Planned for removal no earlier than a future
major release; sunset timeline TBD.
parameters:
- $ref: "#/components/parameters/ComfyUserHeader"
- name: prompt_id
in: path
description: The prompt ID to fetch history for.
required: true
schema:
type: string
format: uuid
responses:
"200":
description: Single-entry history dictionary. Returns an empty object `{}` if the prompt_id is not found.
content:
application/json:
schema:
type: object
additionalProperties:
$ref: "#/components/schemas/HistoryEntry"
# ---------------------------------------------------------------------------
# Upload
# ---------------------------------------------------------------------------
/api/upload/image:
post:
operationId: uploadImage
tags: [upload]
summary: Upload an image file
description: Uploads an image file into one of the input/output/temp directories so it can be referenced by workflow nodes.
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
required:
- image
properties:
image:
type: string
format: binary
description: Image file to upload
type:
type: string
enum: [input, temp, output]
default: input
description: Target directory type
overwrite:
type: string
description: 'Set to "true" to overwrite existing files'
subfolder:
type: string
description: Subfolder within the target directory
responses:
"200":
description: Upload result
content:
application/json:
schema:
$ref: "#/components/schemas/UploadResult"
"400":
description: No file provided or invalid request
/api/upload/mask:
post:
operationId: uploadMask
tags: [upload]
summary: Upload a mask image
description: Uploads a mask image associated with a previously-uploaded reference image.
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
required:
- image
- original_ref
properties:
image:
type: string
format: binary
description: Mask image (alpha channel is used)
original_ref:
type: object
description: Reference to the original image file
required:
- filename
properties:
filename:
type: string
description: Filename of the original image
additionalProperties: true
type:
type: string
enum: [input, temp, output]
default: input
description: Target directory type
overwrite:
type: string
description: 'Set to "true" to overwrite existing files'
subfolder:
type: string
description: Subfolder within the target directory
responses:
"200":
description: Upload result
content:
application/json:
schema:
$ref: "#/components/schemas/UploadResult"
"400":
description: No file provided or invalid request
# ---------------------------------------------------------------------------
# View
# ---------------------------------------------------------------------------
/api/view:
get:
operationId: viewFile
tags: [view]
summary: View or download a file
description: Serves a file (image, audio, or video) from the input/output/temp directory identified by the query parameters.
parameters:
- name: filename
in: query
required: true
schema:
type: string
description: Name of the file to view
- name: type
in: query
schema:
type: string
enum: [input, output, temp]
default: output
description: Directory type
- name: subfolder
in: query
schema:
type: string
description: Subfolder within the directory
- name: preview
in: query
schema:
type: string
description: Preview format hint (e.g. "webp;90")
- name: channel
in: query
schema:
type: string
enum: [rgba, rgb, a]
description: Channel extraction mode
responses:
"200":
description: File content
content:
image/*:
schema:
type: string
format: binary
video/*:
schema:
type: string
format: binary
audio/*:
schema:
type: string
format: binary
application/octet-stream:
schema:
type: string
format: binary
"404":
description: File not found
/api/view_metadata/{folder_name}:
get:
operationId: viewMetadata
tags: [view]
summary: Get metadata for a file (e.g. safetensors header)
description: Returns embedded metadata parsed from a file in the given folder — for example, the header of a safetensors model.
parameters:
- name: folder_name
in: path
required: true
schema:
type: string
description: Folder type (output, input, temp, etc.)
- name: filename
in: query
required: true
schema:
type: string
description: Filename to read metadata from
responses:
"200":
description: File metadata
content:
application/json:
schema:
type: object
additionalProperties: true
"404":
description: File or metadata not found
# ---------------------------------------------------------------------------
# System
# ---------------------------------------------------------------------------
/api/system_stats:
get:
operationId: getSystemStats
tags: [system]
summary: Get system statistics
description: Returns hardware, Python, VRAM, and runtime statistics for the running ComfyUI process.
responses:
"200":
description: System stats
content:
application/json:
schema:
$ref: "#/components/schemas/SystemStatsResponse"
/api/features:
get:
operationId: getFeatures
tags: [system]
summary: Get enabled feature flags
description: Returns a dictionary of feature flag names to their enabled state.
responses:
"200":
description: Feature flags
content:
application/json:
schema:
type: object
additionalProperties:
type: boolean
# ---------------------------------------------------------------------------
# Node / Object Info
# ---------------------------------------------------------------------------
/api/object_info:
get:
operationId: getObjectInfo
tags: [node]
summary: Get all node definitions
description: |
Returns a dictionary of every registered node class, keyed by class name.
Each value is a NodeInfo object describing inputs, outputs, category, etc.
responses:
"200":
description: All node definitions
content:
application/json:
schema:
type: object
additionalProperties:
$ref: "#/components/schemas/NodeInfo"
/api/object_info/{node_class}:
get:
operationId: getObjectInfoByClass
tags: [node]
summary: Get a single node definition
description: Returns the `NodeInfo` definition for a single registered node class.
parameters:
- name: node_class
in: path
required: true
schema:
type: string
description: Node class name (e.g. "KSampler")
responses:
"200":
description: Single node definition
content:
application/json:
schema:
type: object
additionalProperties:
$ref: "#/components/schemas/NodeInfo"
"404":
description: Node class not found
/api/embeddings:
get:
operationId: getEmbeddings
tags: [node]
summary: List available embedding names
description: Returns the list of text-encoder embeddings available on disk.
responses:
"200":
description: Embedding names
content:
application/json:
schema:
type: array
items:
type: string
# ---------------------------------------------------------------------------
# Models
# ---------------------------------------------------------------------------
/api/models:
get:
operationId: getModelTypes
tags: [model]
summary: List model folder type names
description: Returns an array of model type names (e.g. checkpoints, loras, vae).
responses:
"200":
description: Model type names
content:
application/json:
schema:
type: array
items:
type: string
/api/models/{folder}:
get:
operationId: getModelsByFolder
tags: [model]
summary: List model filenames in a folder
description: Returns the names of model files in the given folder. This endpoint predates `/api/experiment/models/{folder}` and returns names only — prefer the experiment endpoint for new integrations.
parameters:
- name: folder
in: path
required: true
schema:
type: string
description: Model folder type name
responses:
"200":
description: Model filenames
content:
application/json:
schema:
type: array
items:
type: string
"404":
description: Unknown folder type
/api/experiment/models:
get:
operationId: getExperimentModels
tags: [model]
summary: List model folders with paths
description: Returns an array of model folder objects with name and folder paths.
responses:
"200":
description: Model folders
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/ModelFolder"
/api/experiment/models/{folder}:
get:
operationId: getExperimentModelsByFolder
tags: [model]
summary: List model files with metadata
description: Returns the model files in the given folder with richer metadata (path index, mtime, size) than the legacy `/api/models/{folder}` endpoint.
parameters:
- name: folder
in: path
required: true
schema:
type: string
description: Model folder type name
responses:
"200":
description: Model files with metadata
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/ModelFile"
"404":
description: Unknown folder type
/api/experiment/models/preview/{folder}/{path_index}/{filename}:
get:
operationId: getModelPreview
tags: [model]
summary: Get model preview image
description: Returns the preview image associated with a model file, if one exists alongside the model on disk.
parameters:
- name: folder
in: path
required: true
schema:
type: string
description: Model folder type name
- name: path_index
in: path
required: true
schema:
type: integer
description: Path index within the folder
- name: filename
in: path
required: true
schema:
type: string
description: Model filename
responses:
"200":
description: Preview image (WebP)
content:
image/webp:
schema:
type: string
format: binary
"404":
description: Preview not found
# ---------------------------------------------------------------------------
# Users
# ---------------------------------------------------------------------------
/api/users:
get:
operationId: getUsers
tags: [user]
summary: Get user storage info
description: |
Returns user storage configuration. In single-user mode returns
`{"storage": "server", "migrated": true/false}`. In multi-user mode
returns `{"storage": "server", "users": {"user_id": "user_dir", ...}}`.
parameters:
- $ref: "#/components/parameters/ComfyUserHeader"
responses:
"200":
description: User info
content:
application/json:
schema:
type: object
properties:
storage:
type: string
description: Storage backend type (always "server")
migrated:
type: boolean
description: Whether migration from browser storage is complete (single-user)
users:
type: object
additionalProperties:
type: string
description: Map of user_id to directory name (multi-user)
post:
operationId: createUser
tags: [user]
summary: Create a new user (multi-user mode)
description: Creates a new user entry. Only meaningful when ComfyUI is running in multi-user mode.
parameters:
- $ref: "#/components/parameters/ComfyUserHeader"
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- username
properties:
username:
type: string
description: Username for the new user
responses:
"200":
description: Created user ID
content:
application/json:
schema:
type: string
description: The generated user_id
"400":
description: Username already exists or invalid
# ---------------------------------------------------------------------------
# Userdata
# ---------------------------------------------------------------------------
/api/userdata:
get:
operationId: listUserdata
tags: [userdata]
summary: List files in a userdata directory
description: Lists files in the authenticated user's data directory. Returns either filename strings or full objects depending on the `full_info` query parameter.
parameters:
- $ref: "#/components/parameters/ComfyUserHeader"
- name: dir
in: query
required: true
schema:
type: string
description: Directory path relative to the user's data folder
- name: recurse
in: query
schema:
type: boolean
description: Recurse into subdirectories
- name: full_info
in: query
schema:
type: boolean
description: Return full file info objects instead of just names
- name: split
in: query
schema:
type: boolean
description: Split paths into directory components
responses:
"200":
description: File listing
content:
application/json:
schema:
$ref: "#/components/schemas/ListUserdataResponse"
"404":
description: Directory not found
/api/v2/userdata:
get:
operationId: listUserdataV2
tags: [userdata]
summary: List files in userdata (v2 format)
description: Lists files in the authenticated user's data directory using the v2 response shape, which always returns full objects.
parameters:
- $ref: "#/components/parameters/ComfyUserHeader"
- name: path
in: query
schema:
type: string
description: Directory path relative to user data root
responses:
"200":
description: File listing with metadata
content:
application/json:
schema:
type: array
items:
type: object
properties:
name:
type: string
path:
type: string
type:
type: string
enum: [file, directory]
size:
type: integer
modified:
type: number
description: Unix timestamp
/api/userdata/{file}:
get:
operationId: getUserdataFile
tags: [userdata]
summary: Read a userdata file
description: Reads the contents of a file from the authenticated user's data directory.
parameters:
- $ref: "#/components/parameters/ComfyUserHeader"
- name: file
in: path
required: true
schema:
type: string
description: File path relative to user data directory
responses:
"200":
description: File content
content:
application/octet-stream:
schema:
type: string
format: binary
"404":
description: File not found
post:
operationId: writeUserdataFile
tags: [userdata]
summary: Write or create a userdata file
description: Writes (creates or replaces) a file in the authenticated user's data directory.
parameters:
- $ref: "#/components/parameters/ComfyUserHeader"
- name: file