cde8c3a468f428bb9a55c3d29ef85b4c39f3a6c6
ComfyUI Mobile UI – Workflow Endpoints
This is a small ComfyUI custom node that adds HTTP endpoints for a standalone client (like the mobile UI in this repo) to:
- List workflow
.jsonfiles stored on the ComfyUI machine - Fetch a workflow JSON
- Fetch an API-compatible prompt JSON for a workflow (either already API prompt, or converted via an optional converter endpoint)
- Convert posted workflow JSON into an API prompt JSON
Endpoints
-
GET /mobileui/info- Returns version + detected workflow directories + endpoint hints.
-
GET /mobileui/workflows- Returns an array of objects:
name(string): workflow name / relative path without.jsonbytes(number|null): file sizemtime(number|null): modified time (unix seconds)
- Returns an array of objects:
-
GET /mobileui/workflows/{name}- Returns the raw workflow JSON file.
{name}may include subfolders and may optionally include.json.
-
GET /mobileui/workflows_api/{name}- Returns an API prompt JSON.
- Behavior:
- If the JSON already looks like an API prompt (contains
class_typeentries), it is returned as-is. - Otherwise, the node tries to POST the workflow JSON to
POST /workflow/convert.- This requires the optional converter extension: https://github.com/SethRobinson/comfyui-workflow-to-api-converter-endpoint
- If the JSON already looks like an API prompt (contains
-
POST /mobileui/convert- Accepts any workflow JSON payload in the request body and returns an API prompt JSON.
- Uses the same conversion rules as
workflows_api.
-
OPTIONS /mobileui/{tail:.*}- CORS preflight helper.
Install
Copy the folder comfyui_mobileui_workflow_list_endpoint into:
ComfyUI/custom_nodes/
Then restart ComfyUI.
CORS
This node can add CORS headers itself if you set:
MOBILEUI_CORS_ORIGIN=http://localhost:5173(or*)
You can also use ComfyUI's built-in CORS flag if you prefer.
Configuration
By default, it scans common locations relative to the ComfyUI root:
<root>/workflows<root>/user/workflows<root>/examples<root>/examples/workflows<root>/pysssss-workflows(used by ComfyUI-Custom-Scripts)
You can override/add workflow directories with environment variables:
COMFY_WORKFLOWS_DIR=/path/to/workflowsCOMFY_WORKFLOWS_DIRS=/path/one,/path/two
Notes
- Includes basic path traversal protection.
- Only serves files ending in
.json. - Conversion requires
POST /workflow/convertto exist.
Description
A custom node for ComfyUI that offers additional API functionality not provided by the internal API or existing custom nodes.
Languages
Python
100%